refactor(daemon): workflows must be bundled to dist/, daemon only loads dist/index.js #221

Merged
xiaomo merged 1 commits from refactor/219-workflow-bundle-dist into main 2026-04-28 05:27:21 +00:00
Owner

What

Workflow build output must go to workflows/<name>/dist/index.js. Daemon only loads and watches dist/.

Changes

  • workflow-worker.ts: loadWorkflowDefinition → only dist/index.js, no .ts/.js fallback
  • file-watcher.ts: watch workflows/*/dist/**/*.js instead of *.ts; sense watch uses .js regex
  • create.ts: scaffold includes package.json with esbuild build script
  • Tests: all updated and passing (23 tests)

Benefits

  • Clean source/artifact separation
  • No accidental hot-reload during editing
  • Watcher fires only when build completes
  • Single bundled file = faster import

Fixes #219

## What Workflow build output must go to `workflows/<name>/dist/index.js`. Daemon only loads and watches `dist/`. ## Changes - **workflow-worker.ts**: `loadWorkflowDefinition` → only `dist/index.js`, no .ts/.js fallback - **file-watcher.ts**: watch `workflows/*/dist/**/*.js` instead of `*.ts`; sense watch uses `.js` regex - **create.ts**: scaffold includes `package.json` with `esbuild` build script - **Tests**: all updated and passing (23 tests) ## Benefits - Clean source/artifact separation - No accidental hot-reload during editing - Watcher fires only when build completes - Single bundled file = faster import Fixes #219
xiaoju added 1 commit 2026-04-28 05:25:53 +00:00
- workflow-worker: loadWorkflowDefinition only looks for dist/index.js
- file-watcher: watch workflows/*/dist/**/*.js instead of *.ts
- file-watcher: sense watch uses .js regex pattern
- nerve create workflow: scaffold includes package.json with esbuild build script
- Updated all related tests

Fixes #219
xiaomo approved these changes 2026-04-28 05:27:19 +00:00
xiaomo left a comment
Owner

LGTM

改动清晰一致:

  • workflow-worker 只认 dist/index.js,去掉 .ts/.js fallback — 干净
  • file-watcher regex 精准匹配 workflows/*/dist/**/*.js,sense 侧也改成 .js
  • create scaffold 自带 package.json + esbuild build script,开箱即用
  • 测试全部同步更新,覆盖到位
  • 注释和 JSDoc 同步刷新

唯一提醒:PR 描述里提到 sense-generator 需要配套改(加 esbuild + build to dist/),记得跟进。

LGTM ✅ 改动清晰一致: - `workflow-worker` 只认 `dist/index.js`,去掉 .ts/.js fallback — 干净 - `file-watcher` regex 精准匹配 `workflows/*/dist/**/*.js`,sense 侧也改成 `.js` - `create` scaffold 自带 `package.json` + esbuild build script,开箱即用 - 测试全部同步更新,覆盖到位 - 注释和 JSDoc 同步刷新 唯一提醒:PR 描述里提到 sense-generator 需要配套改(加 esbuild + build to dist/),记得跟进。
xiaomo merged commit 1933934340 into main 2026-04-28 05:27:21 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
2 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#221