Repository navigation
fix(cli): import the local cli command loader through a file url - #272
Merged
Merged
Conversation
Exeloo
force-pushed
the
fix/windows-local-bin-import
branch
from
November 11, 2026 17:54
7bc9932 to
9556b37
Compare
Exeloo
force-pushed
the
fix/windows-local-bin-import
branch
from
November 11, 2026 18:02
9556b37 to
6a73df9
Compare
Exeloo
force-pushed
the
fix/windows-local-bin-import
branch
from
November 11, 2026 18:59
6a73df9 to
89d25e5
Compare
Exeloo
force-pushed
the
fix/windows-local-bin-import
branch
from
November 11, 2026 19:38
89d25e5 to
a6e3186
Compare
Exeloo
force-pushed
the
fix/windows-local-bin-import
branch
from
November 11, 2026 19:44
a6e3186 to
92660a7
Compare
Exeloo
force-pushed
the
fix/windows-local-bin-import
branch
from
November 11, 2026 19:54
92660a7 to
d907650
Compare
4 tasks
MartinFillon
approved these changes
Nov 13, 2026
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.
What does this PR do?
Refs #123
nfnow imports the local CLI'scommand.loader.jsthroughpathToFileURL(...).hrefinstead of a rawposix.joinpath. ESM rejects a rawC:\...path on Windows, which would break every command run inside a project that has the CLI installed locally.Stack (all PRs target
main, merge in this order): #274 → #273 → this PR. Until those merge, this PR also lists their commits.It also adds
e2e/cli-local-bin.test.ts: a project with a stub local CLI innode_modules, wherenf --helpmust list the stub's command. On Linux the old raw-path import works too, so this test only tells the fix apart on theEnd-to-end tests (windows-latest)job.This covers the code criteria of #123. The issue stays open until the Windows retest (
nf new,nf build,nf start,nf dev) is done.Merge danger
Door: two-way (revert is enough)
Blast radius: small. No runtime dependents; dev dependents in
engineandexamples. The CLI is a published package: it ships with the next release, nothing deploys on merge.Follow-up issues
None
How do you test this PR?
import("C:\\...\\command.loader.js")is rejected by ESM on Windows (read from the code, not reproduced on Windows).After:
src/lib/utils/local-binaries.spec.tschecks thatC:\Users\me\my gamegivesfile:///C:/Users/me/my%20game/node_modules/@nanoforge-dev/cli/dist/command.loader.js, plus a POSIX path.pnpm run build✓,pnpm run lint✓,pnpm run test:unit✓ (262 tests); pre-push hook:repo:build,repo:lint,repo:test:unit,repo:test:e2e✓.nf --helpfrom a project with a local CLI installed goes through the new import and prints the usage.Quality gate