| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
📝 Walkthrough
WalkthroughThe CLI bootstrap and postinstall script now detect dist/lib and fall back to lib, allowing module resolution in both published packages and source checkouts. ChangesRuntime library resolution
Estimated code review effort: 2 (Simple) | ~10 minutes Poem 🚥 Pre-merge checks | ✅ 5 ✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
Both resolve into lib/ relative to their own location, which stopped working when the build moved output to dist/: lib/ now holds only TypeScript, so running ./bin/tns or postinstall.js from a checkout fails with MODULE_NOT_FOUND. The published package is unaffected, since dist/ is its root and lib/ already sits next to bin/ there. Both now prefer dist/lib when it exists and fall back otherwise, which covers the checkout and the package without either needing to know which it is. The other bin entries delegate to ./tns, so they are fixed with it. npm install in a checkout runs postinstall and would hit the same failure - masked only because npm run setup passes --ignore-scripts.
| Back | FazBrowse Home | New Git URL |
PR Checklist
A regression from #6092. The release-script half of this went straight to main as cb3fb8db5, since it was blocking publishing; this is the remainder.
What is the current behavior?
bin/tns and postinstall.js resolve into lib/ relative to their own location:
Since the build moved output to dist/, lib/ holds only TypeScript, so from a checkout:
The published package is unaffected — dist/ is its root there, so lib/ already sits next to bin/. Only the source tree broke, which is exactly why the packaging verification on #6092 did not catch it.
npm install in a checkout runs postinstall and hits the same failure. That is masked today only because npm run setup passes --ignore-scripts.
What is the new behavior?
Both prefer dist/lib when it exists and fall back otherwise, so neither needs to know which layout it is in. The remaining bin/ entries (nativescript, ns, nsc, …) all require("./tns"), so they are fixed with it.
Verification
Not reachable from the unit suite, so both layouts were exercised directly:
Worth noting for follow-up: nothing in the suite executes bin/tns in either layout, which is why this class of bug is invisible to CI. A smoke test covering both would close that.
Summary by CodeRabbit