[PF-25] Fix planforge model when installed via npm and remove @planforge/core dependency - #39
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
chucoding
force-pushed
the
bugfix/PF-25_core
branch
from
March 15, 2026 05:44
613d2f8 to
1d204ce
Compare
chucoding
added a commit
that referenced
this pull request
Mar 15, 2026
* [PF-25] Fix planforge model when installed via npm and remove @planforge/core dependency (#39) * fix : add copy core script (no more use monorepo) * refactor : remove dependency @planforge/core * refactor : remove dependency @planforge/core * [PF-25] Fix planforge model when installed via npm and remove @planforge/core dependency (#40) * fix : add copy core script (no more use monorepo) * refactor : remove dependency @planforge/core * refactor : remove dependency @planforge/core * release : v0.1.7
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.
Purpose
Fix
planforge model(and plan/implement prompts) failing after global npm install because core assets were missing, and remove the@planforge/coredependency so the CLI relies only on the bundled copy.Description
Problem: After
npm install -g planforge,planforge modelfailed withCannot find module '@planforge/core/package.json'. Prompts for plan/implement also depend on core; the CLI resolved them viarequire.resolve('@planforge/core/package.json'), and@planforge/coreis not installed in the global install (it was"file:../core").Fix (core bundle)
packages/cli-js/scripts/copy-core.js(new): At build time, copiespackages/core/promptsandpackages/core/models.jsonintopackages/cli-js/core/.packages/cli-js/src/utils/paths.ts: AddedgetCoreRoot()returningresolve(__dirname, "..", "..", "core")so prompts andmodels.jsonare always read from the package’s bundledcore/.packages/cli-js/package.json: Added"core"tofilesand addedcopy-core.jsto the build script so the published package includes core assets.Dependency cleanup
"@planforge/core": "file:../core"frompackages/cli-js/package.json. The CLI no longer depends on the core package; it only uses the bundled copy underpackages/cli-js/core/(filled bycopy-core.jsat build).createRequireandrequire;getCoreRoot()no longer usesrequire.resolve, only the path above.models.jsonis missing updated to: "Run pnpm run build in cli-js or reinstall planforge."Docs
@planforge/core.How to test
cd packages/cli-js && pnpm run build. Confirmpackages/cli-js/core/exists withprompts/andmodels.json.npm install -g <path-to-repo>/packages/cli-js(or publish andnpm i -g planforge). Runplanforge modeland confirm it runs without "Cannot find module" and shows the model catalog.planforge plan "test"orplanforge implement "test"(with providers set up) and confirm prompts load (no core resolution errors).pnpm installin the repo and runplanforge modelfrompackages/cli-jsafter build; behavior should be unchanged.Review Requirement
@planforge/coreis innode_modules(onlypaths.tsandpackage.jsonwere changed for this).copy-core.jsruns aftertscsocore/exists before pack/publish.Additional Info