Repository navigation
fix(ph-cli): define the fs arg types on cmd-ts's root entry - #3155
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The conditional export and all affected imports are consistent, with no stale deep imports or patch hashes remaining.
Review effort: Balanced
Findings: None
What changed in this PR
Routes cmd-ts filesystem helpers through a Bun-aware export, avoiding the CJS/chalk failure while preserving Node behavior.
Changes:
- Adds a conditional
./batteries/fsexport to the cmd-ts patch. - Updates six generate commands to use the public subpath.
- Refreshes the patched dependency hash.
| File | Description |
|---|---|
pnpm-lock.yaml |
Updates the cmd-ts patch hash. |
patches/cmd-ts@0.15.0.patch |
Adds Bun/CJS filesystem-helper exports. |
clis/ph-cli/src/commands/generate-subgraph.ts |
Uses the exported filesystem helpers. |
clis/ph-cli/src/commands/generate-processor.ts |
Uses the exported filesystem helpers. |
clis/ph-cli/src/commands/generate-piece.ts |
Uses the exported filesystem helpers. |
clis/ph-cli/src/commands/generate-editor.ts |
Uses the exported filesystem helpers. |
clis/ph-cli/src/commands/generate-document-model.ts |
Uses the exported filesystem helpers. |
clis/ph-cli/src/commands/generate-app.ts |
Uses the exported filesystem helpers. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
acaldas
force-pushed
the
fix/cmd-ts-bun-batteries-fs
branch
from
October 1, 2026 15:00
5f0f927 to
f861a1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under bun 1.4.2, ph-cli's
postbuild(bun run scripts/generate-commands-docs.ts) intermittently fails (run):This is the bun regression worked around in #3133 (oven-sh/bun#33180, fix oven-sh/bun#37185 unmerged). That patch routes
cmd-tsto its ESM build under bun, but sixgenerate-*commands importcmd-ts/dist/cjs/batteries/fs.jsdirectly, which pulls the CJSindex.jsand itsrequire("chalk")back in.clis/ph-cli/src/utils/fs-args.tsdefinesDirectoryandFile(same behaviour as cmd-ts'sbatteries/fs) on the rootcmd-tsentry, and the six commands import them from there. ph-cli now imports only"cmd-ts", which resolves under both the workspace patch and the stock package that published installs get. The patch is unchanged.generate-commands-docs.tsloads 27 CJS cmd-ts modules on main and 0 on this branch.oven/bun:1.4.2), so this removes the path from the stack trace rather than turning a local repro green.COMMANDS.mdunchanged; the Node-built CLI rejects a missing path ("Path doesn't exist") and a directory passed as a file ("Provided path is not a file").