Title: fix: resolve compiled output from dist in bin and postinstall by edusperoni · Pull Request #6095 · NativeScript/nativescript-cli · GitHub
Open Graph Title: fix: resolve compiled output from dist in bin and postinstall by edusperoni · Pull Request #6095 · NativeScript/nativescript-cli
X Title: fix: resolve compiled output from dist in bin and postinstall by edusperoni · Pull Request #6095 · NativeScript/nativescript-cli
Description: PR Checklist The PR title follows our guidelines. There is an issue for the bug/feature this PR is for. (no tracking issue — happy to open one) You have signed the CLA. All existing tests are passing (1514 passing, unchanged). Tests for the changes are included. (the failure is not reachable from the unit suite — verification below) 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: pathToLib = path.join(__dirname, "..", "lib"); // bin/tns require(path.join(__dirname, "lib", "constants")); // postinstall.js Since the build moved output to dist/, lib/ holds only TypeScript, so from a checkout: $ ./bin/tns --version Error: Cannot find module '.../lib/common/verify-node-version' 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: Checkout: ./bin/tns --version reports, ./bin/tns renders 56 help rows, the nativescript/ns/nsc aliases work, node postinstall.js resolves Installed package: packed, installed into a clean consumer, confirmed the fallback is the branch taken (no dist/lib present) — --version reports, help renders 56 rows, postinstall.js resolves 1514 passing, unchanged 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 Bug Fixes Improved CLI startup across both published package installations and source checkouts. Improved post-install setup by correctly locating required files in different package layouts. Prevented installation and command-loading issues caused by incorrect library paths.
Open Graph Description: PR Checklist The PR title follows our guidelines. There is an issue for the bug/feature this PR is for. (no tracking issue — happy to open one) You have signed the CLA. All existing tests are ...
X Description: PR Checklist The PR title follows our guidelines. There is an issue for the bug/feature this PR is for. (no tracking issue — happy to open one) You have signed the CLA. All existing tests are ...
Opengraph URL: https://github.com/NativeScript/nativescript-cli/pull/6095
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:46fe0ac3-b99e-7f07-c0be-77ebdc421641 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DB5E:E9D16:2542BD2:2F48EBD:6B01C259 |
| html-safe-nonce | 99dfcb489b5342d1672960eefa000856cf006b65763fb581c5f05d4f681b04cd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjVFOkU5RDE2OjI1NDJCRDI6MkY0OEVCRDo2QjAxQzI1OSIsInZpc2l0b3JfaWQiOiIzNDIxNTc1Nzc2Nzc5MjIzNjQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a7f26c4abc83526f6298db902c5f3c4b6dd41f5441c7d7884359ef8ec3aba3aa |
| hovercard-subject-tag | pull_request:4161021340 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/NativeScript/nativescript-cli/pull/6095/files |
| twitter:image | https://avatars.githubusercontent.com/u/4061767?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4061767?s=400&v=4 |
| og:image:alt | PR Checklist The PR title follows our guidelines. There is an issue for the bug/feature this PR is for. (no tracking issue — happy to open one) You have signed the CLA. All existing tests are ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/NativeScript/nativescript-cli git https://github.com/NativeScript/nativescript-cli.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 21347346 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21347346 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width