refactor(daemon): workflows must be bundled to dist/, daemon only loads dist/index.js #219
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Workflow build output should go to
workflows/<name>/dist/index.js(bundled), not scatter.jsfiles alongside.tssource. Daemon should only load and watchdist/.Current (broken)
tscoutputs.jsnext to.tssource — mixed source and build artifactsloadWorkflowDefinitionlooks forindex.ts/index.jsin workflow root.tsfiles — triggers on source edits, not build outputTarget
Build
workflows/<name>/dist/index.js(single file, esbuild or similar).tsstays in workflow root,dist/is gitignored build outputnerve create workflowscaffold should include a build scriptDaemon loader (workflow-worker.ts)
loadWorkflowDefinitionlooks forworkflows/<name>/dist/index.jsonly.tsfallback, no root-level.jsfallbackFile-watcher (file-watcher.ts)
workflows/*/dist/**/*.jsfor changesworkflows/*/*.ts(source edits dont trigger reload)dist/content changes (= build completed)Sense loader (sense-worker.ts)
senses/<name>/index.js(already correct)Benefits
Ref
Supersedes the simpler .ts/.js swap in #217. PR #218 can be closed in favor of this.
fix(daemon): only import and watch built .js, never .ts sourceto refactor(daemon): workflows must be bundled to dist/, daemon only loads dist/index.js