8c228b731ad8f109d9f45072d7b67a43fc92961a
README
- emit.js will scaffold a dir or update files that are already there
- gen.js is the build script that builds to the target dir
- serve.js is a local server for your cards interface
emit.mjs
emit.mjs is the deployment adapter projection engine. It reconciles engine-level deployment templates with target-specific instance directories, preserving user configuration while propagating structural template updates.
Usage
```bash node engine/emit.mjs
```<target>: The deploy plugin directory located insideengine/(e.g.,cloudflare).<dir>: The target instance directory where the adapter files will be projected.
Core Principles
- Rebuild & Preserve: Reads per-target configuration values (such as
nameandTITLE) out of existing target files (wrangler.toml), then regenerates all adapter files from the plugin templates carrying those values. Structural template changes automatically propagate on every run. - Authored Content Protection: The
content/directory is authored data—it is never generated, overwritten, or touched by the emitter. - Manifest Generation: Automatically invokes the engine's
gen.mjsscript against the target'scontent/directory to build the_manifest.jsindex.
Workflow Execution
- Validation: Verifies that both arguments are provided and that the specified deploy plugin exists under the engine path.
- Configuration Extraction: Scans the existing target configuration (
wrangler.toml) for pre-existing custom tokens likeNAMEandTITLE. If absent, defaults to template placeholders ({{NAME}},{{TITLE}}). - Adapter Projection: Iterates over all files in the plugin directory, maps special names (such as converting
gitignoreto.gitignore), injects the preserved configuration values, and writes them out to the target directory. Ensures thecontent/directory structure exists without altering its contents. - Manifest Compilation: Executes
gen.mjswithin the context of the target directory to rebuild_manifest.jsfrom the authored content. - Scaffolding Notice: Reports success and alerts the user if any required placeholder variables still need to be filled in prior to deployment.
Languages
HTML
74.3%
JavaScript
25.7%