A Dohball is an automated snapshot of a folder's contents, where that folder acts as a container for one or more Doh Packages or Modules. These snapshots are versioned using Doh's internal dohver.js
incremental versioning system.
The primary purpose of Dohballs is to provide a "management-less" way for a developer's Doh projects to act as internal repositories for each other.
This system excels at facilitating the seamless sharing, linear updating, and organic evolution of:
DohPath
), and custom modules.Think of Dohballs not as a replacement for NPM (for public libraries) or Git (for comprehensive source control), but as a specialized, complementary tool. They are particularly powerful for:
Dohballs are designed for largely transparent operation, automated by the Auto-Packager and the dohball_host
module. They are distinct from real-time file synchronization systems; Dohballs provide a more deliberate, version-incremented way to update shared codebases. In essence, a Dohball is more akin to a versioned "fork" of a shared code segment than a traditional package version. Future enhancements may even allow "melding" these forks.
Dohballs address the desire to manage an internal suite of shared code with maximum flexibility and minimal administrative burden:
doh upgrade
.Dohballs & Git: A Crucial Partnership
dohball.json
file (containing the dohver.js
-managed version) resides in the source folder of the packages being baked. The doh bake
command updates this file. Users never edit or create dohball.json
files manually; doh bake
handles this..tar.gz
files (created in project_root/dohballs/
) are also intended to be committed to your Git repository alongside your source code and the updated source dohball.json
files.
This practice serves two main purposes:.tar.gz
archive of a specific folder's state, containing source files where Doh Packages/Modules are defined.Doh.load('MyCustomUtility')
).dohver.js
:version
in a package's source dohball.json
is an incremental string like 0.0.1a
, managed by dohver.js
. This is not a content hash.doh bake
uses dohver.js
to update this version in the source dohball.json
if changes warrant.dohball.json
inside the .tar.gz
):version
: The dohver.js
-generated version, copied from the source dohball.json
.removals[]
: An array of file paths no longer present, for cleanup by the consumer.The dohball_host
system is networkable. A Doh instance can consume from multiple hosts (via http://
or https://
URLs in pod.yaml
's dohball_host
list) and can be both a host and a consumer, enabling "lazy push/pull" of code between isolated monorepos or instances.
Control what gets included using these pod.yaml
settings:
packager_ignore
: Dohballs respect global packager_ignore
settings (e.g., for node_modules
, .git
).dohball_deployment
section):ignore_paths
: List directory paths (relative to project root) never to include in any Dohball, nor whose packages should trigger Dohball creation for that path.ignore_packages
: List specific Doh Package names. These packages won't be "exposed," and their containing folders won't be baked on their behalf. (Often, expose_packages: '*'
is used, with these ignores providing refinement.)Goal: Effortlessly keep your foundational utilities and custom Doh patterns consistent across all your local Doh projects.
One-Time Setup:
pod.yaml
):dohball_deployment.expose_packages: '*'
.dohball_deployment.compile_manifest: true
.dohball_host
module to host_load
.pod.yaml
):dohball_host
:
dohball_host: ['http://localhost:PORT_OF_MONOREPO']
(e.g., http://localhost:3001
).Ongoing Workflow:
I. Update Your Toolkit Monorepo:
doh bake
.dohver.js
versions in source dohball.json
files and creates/updates .tar.gz
archives in /dohballs/
. Commit these changes to Git.doh run
.dohball_host
module. Its public manifest is rebuilt, ready to serve updates.II. Update a Consuming Local Project:
doh upgrade
.dohver.js
versions, downloads, and installs.doh run
in the consuming project.Goal: Use Git to transport baked Dohball artifacts to a shared Doh instance (e.g., team server), which then acts as the dohball_host
for other consumers. This facilitates team management of a shared component library where "build artifacts" become installable.
Steps (Sharer/Developer - On Local Machine):
doh bake
.dohball.json
versions and refreshes .tar.gz
files in /dohballs/
.dohball.json
files, and the /dohballs/
directory. Push to your remote Git repo.dohball.json
s), ready for the hosting instance.Steps (Remote Hosting Instance - e.g., Central Team Server):
git pull
..tar.gz
files in its /dohballs/
and the source dohball.json
files.doh pm2 restart
).dohball_host
module with compile_manifest: true
) regenerates its public manifest, reflecting the now-updated Dohballs it can serve.Steps (Consuming Instance - Team Member's Project, CI, etc.):
pod.yaml
lists the remote host.doh upgrade
.dohver.js
versions, and doh install
s newer Dohballs.Question | Answer |
---|---|
Q: Can I mix npm deps & Dohballs? | Absolutely. Dohβs NPM bridge works seamlessly alongside Dohballs. |
Q: What if two hosts offer a package with the same name? | The order of dohball_host declarations in the consumer's pod.yaml is the sole decider. The first host in the list that provides the package "wins" for that package. dohver.js versions are used to determine if an update is needed from that chosen host, but not to select between hosts. |
Q: How do I "un-install" a Dohball from a consumer? | There isn't a formal doh uninstall-dohball command. Dohballs are designed for flexibility. If you no longer need packages from a specific Dohball: 1. Remove Doh.load() calls or dependency listings for its packages from your source. 2. You can manually delete the installed folder (typically found under a path mirroring its origin within your project, or in /.doh/dohballs/ if managed there by older installers). Doh itself does not automatically prune these package files or manage this aspect of the lifecycle. Its "package management-like" systems are for discovery, installation, and linear updates of these "fork-like" code snapshots, not full lifecycle management. |
Q: Do Dohballs work for binary assets? | Yesβimages, shaders, WASM, etc. If itβs in the folder tree that gets baked, itβs in the tarball. |
Source remains sacred; builds remain ephemeral artifacts.
Dohballs embody this by snapshotting folders as-is and letting every consuming Doh instance re-interpret their contents through its own Auto-Packager. The dohver.js
system provides a simple, linear way to track updates. You trade the complexity of semantic versioning and manual publishing for teleport-grade portability and the freedom to organically evolve hundreds of interconnected components within your own Doh ecosystem.
Happy bakingβand even happier not thinking about it most of the time!