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.
Important Distinction: Dohballs come in two forms:
doh install
from configured hostsDohballs address the desire to manage an internal suite of shared code with maximum flexibility and minimal administrative burden:
doh upgrade
.Dohballs Support Multiple Distribution Methods
Dohballs can be distributed and shared through two complementary approaches:
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:dohball_host
module enables Doh instances to serve baked Dohballs directly via HTTP endpoints.doh install
or doh upgrade
commands..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: Develop and use your own code within your project seamlessly.
How It Works:
doh install
or similar commands.Example Local Workflow:
# You create a new module
mkdir -p modules/my_feature
# Add your code to modules/my_feature/my_module.js
# Auto-Packager automatically makes it available
# You can immediately use it: Doh.load('my_module')
# Make changes to your code
# Changes are reflected immediately - no rebuild/install needed
Goal: Install and use code from other Doh instances via remote hosting.
Setup (Consuming Project):
pod.yaml
:dohball_host:
- https://team-host.com
- http://localhost:3001
Installation Workflow:
doh install package_name
to pull from configured hosts.doh upgrade
to get newer versions from hosts.Note: This is different from local development - remote dohballs require explicit installation steps.
Dohballs support two approaches for team sharing:
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.Goal: Serve Dohballs directly via HTTP/HTTPS without requiring Git transport, enabling real-time distribution of updates.
Setup (Hosting Instance):
pod.yaml
with:dohball_deployment:
compile_manifest: true
host_load:
- dohball_host # Enable the dohball_host module
doh bake
to create Dohballs, then doh run
to start serving them.Setup (Consuming Instance):
pod.yaml
:dohball_host:
- https://your-host.com
- http://localhost:3001 # For local development
doh install package_name
or doh upgrade
to fetch directly from the host.Benefits of Direct HTTP Hosting:
Question | Answer |
---|---|
Q: Can I mix npm deps & Dohballs? | Absolutely. Doh’s NPM bridge works seamlessly alongside Dohballs. |
Q: Do Dohballs require Git? | No! While Git can be used to transport baked Dohball artifacts, Dohballs can also be distributed directly via HTTP using the dohball_host module. Consumers can install directly from running Doh hosts using doh install or doh upgrade without any Git operations. |
Q: Do I need to install local code? | No! Local code in your project is automatically handled by the Auto-Packager - no installation needed. The doh install command is ONLY for pulling Dohballs from remote hosts configured in dohball_host . |
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 from Doh.load() , Doh.Module() , and Doh.Package 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!