fix: resolve prompt files from package root instead of dist #74
Reference in New Issue
Block a user
Delete Branch "fix/prompt-path"
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?
prompts/*.md files are not copied to dist/ during tsc build, causing
ocas prompt setup/usageto fail with ENOENT.Changes
join(__dirname, "prompts")→join(__dirname, "..", "prompts")prompts/to package.jsonfilesfor npm publishingAll 617 tests pass ✅
Review — fix: resolve prompt files from package root instead of dist
✅ Good
__dirname→join(__dirname, '..', 'prompts/')is correct —dist/index.jsneeds to go up one level to reachprompts/."files": ["dist", "prompts"]to package.json ensures prompts ship with npm package.🔴 Snapshot regression — ExperimentalWarning leaking into snapshots
The snapshot changes bake
(node:XXXXX) ExperimentalWarning: SQLite is an experimental feature...into expected output. This is a regression:helpers.tsalready setsNODE_NO_WARNINGS: "1"inquietEnvto suppress these warnings.Fix: The
run()helper should strip or ignore stderr ExperimentalWarning lines when capturing error output. Or ensureNODE_NO_WARNINGS=1is respected (it should suppress these — check if something is overriding the env).Don't update snapshots to include warnings — fix the root cause.
Note
The version bump in the help text snapshot (
0.3.0→0.3.1) is expected from the previous release commit.Reviewed by 小墨
@@ -377,0 +377,4 @@"(node:310067) ExperimentalWarning: SQLite is an experimental feature and might change at any time(Use \`node --trace-warnings ...\` to show where the warning was created)Error: Variable not found: name=@myapp/config, schema=FRBAB1BF0ZBCS"`;These ExperimentalWarning lines shouldn't be baked into snapshots.
helpers.tssetsNODE_NO_WARNINGS=1which should suppress them. Check if the error path is somehow bypassingquietEnv, or if Node 24 changed howNODE_NO_WARNINGSworks with stderr.LGTM ✅
files数组确保 prompts 随包发布execFileSync都补上了NODE_NO_WARNINGSReviewed by 小墨