René's URL Explorer Experiment


Title: build: emit to dist/ and ship generated declarations by edusperoni · Pull Request #6092 · NativeScript/nativescript-cli · GitHub

Open Graph Title: build: emit to dist/ and ship generated declarations by edusperoni · Pull Request #6092 · NativeScript/nativescript-cli

X Title: build: emit to dist/ and ship generated declarations by edusperoni · Pull Request #6092 · 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 (1513 passing, unchanged). Tests for the changes are included. (build change; verified by packing and installing the artifact — see below) What is the current behavior? tsc emits next to each source file, so lib/ holds both the TypeScript and its output. That has cost us repeatedly: A spec deleted in Sept 2025 left its compiled .js behind and kept running for ten months — 8 tests exercising code that no longer existed. prepack silently undid its own release compile, because ts:release_build and the test step both wrote to the same place. Shipped lib/*.js carried comments as a result. .gitignore needs a blanket *.js plus a growing list of negations to tell source from output apart, which is why new files under scripts/ and dev/ have twice been invisible to git. clean has to reconstruct "which .js are output" from a glob list. There is also no coherent published type surface: 60 hand-written .d.ts ship, but the package declares no types entry, so consumers get nothing. What is the new behavior? Build output goes to dist/, and dist/ is assembled as a complete package root rather than just compiled JS. That last part is the crux. lib/ resolves its siblings through __dirname — ../package.json, ../docs/helpers, ../../config, ../../vendor/gradle-plugin, ../../../vendor/aab-tool/bundletool.jar. Mirroring resources/, docs/, config/, vendor/, bin/ and setup/ alongside lib/ means all 46 of those paths keep working with no code changes, and the published tarball keeps exactly the internal layout it has today. Only where it is built from changed. tsconfig.json gains rootDir/outDir (rootDir is required, or tsc flattens the tree) tsconfig.release.json builds lib/ only, with declaration: true — this is what gets packed scripts/copy-assets.js mirrors assets, writes dist/package.json packing npm run pack → npm pack ./dist; prepack/postpack are gone 392 generated declarations now ship, replacing the hand-written set as the emitted API surface. Adding a types entry is a deliberate follow-up — worth doing on its own merits rather than smuggling a new public contract into a build change. Two behaviours improve as a side effect: The GA id no longer touches your working tree. It is set inside dist (set-ga-id.js live --dir dist), so a failed pack can no longer leave a checkout configured to report as production. That is the concern raised on #6088, resolved by the design rather than bolted on. A guard refuses to pack the repository root, which would otherwise nest everything one level deeper and silently break every __dirname path. Verified it blocks bare npm pack and does not fire for npm pack ./dist. Two bugs this caught while being built Worth recording, because both produce a successful build with a subtly wrong artifact and neither is visible to the test suite: The asset copy initially clobbered fresh output. lib/ still contained 375 stale compiled .js from the old in-place build (against 7 genuine source .js — vendored scripts, hooks, fixtures). The copy step now treats a .js with a sibling .ts as compiler output and skips it. README.md, LICENSE and CHANGELOG.md dropped out of the tarball. npm takes those from the directory being packed, which is now dist. Caught by diffing the packed file list against the published 9.1.0-alpha.15. Hand-written .d.ts are also copied through: tsc treats them as inputs and never emits them, and 115 generated declarations import from them — leaving them behind shipped types with dangling references. Verification 1513 passing, 9 pending — unchanged, now running from dist/ Packed file list vs published 9.1.0-alpha.15: the only absences are lib/.d.ts (the grunt-ts aggregator, removed in #6088) and the unused cross-client enum (removed in #6089) — both already gone from main Tarball installed into a clean consumer: CLI runs, --version reports, help renders 56 rows across 6 sections, sibling paths resolve, sample generated declaration has zero dangling imports Shipped config.json carries the live GA id while the working tree keeps dev npm run clean.build leaves zero compiler output in lib//test/ Note for reviewers .github/workflows/npm_release_cli.yml changes from npm pack to npm run pack. Without that the release would produce a tarball with everything nested under dist/. The publish job is unaffected — it publishes a tarball, so no lifecycle scripts run. Summary by CodeRabbit Build & Packaging Improved package creation for more reliable CLI distribution. Packages now publish only the built dist/ output and point the CLI entry to the built artifact. Added safeguards to prevent packing from the repository root. Improved asset copying for consistent runtime distribution. Testing Tests now run against the built distribution output (dist/). Maintenance Improved cleanup of generated build files. Added an option to select a configuration directory when setting or verifying analytics IDs.

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/6092

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,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-controllerpull_requests
route-actionfiles
fetch-noncev2:5b5fe4ad-84ff-b741-0564-06b5310c8fa2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAF8A:14F601:3407670:41FC35C:6B01C1B3
html-safe-nonce44eb3da56d0aa948a1896aed9f33742257d1bece73d78483bdb82b72a47264c3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjhBOjE0RjYwMTozNDA3NjcwOjQxRkMzNUM6NkIwMUMxQjMiLCJ2aXNpdG9yX2lkIjoiOTE3NDg4OTA3NzcxODIzNzYxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfc13d19aab89a780441d8acfabd0d69c1d55746ffb19aa43d2da574a2d066df3
hovercard-subject-tagpull_request:4154935371
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/nativescript-cli/pull/6092/files
twitter:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4061767?s=400&v=4
og:image:altPR 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/nativescript-cli git https://github.com/NativeScript/nativescript-cli.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id21347346
octolytics-dimension-repository_nwoNativeScript/nativescript-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id21347346
octolytics-dimension-repository_network_root_nwoNativeScript/nativescript-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/nativescript-cli/pull/6092/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-cli%2Fpull%2F6092%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-cli%2Fpull%2F6092%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fnativescript-cli
Reloadhttps://github.com/NativeScript/nativescript-cli/pull/6092/files
Reloadhttps://github.com/NativeScript/nativescript-cli/pull/6092/files
Reloadhttps://github.com/NativeScript/nativescript-cli/pull/6092/files
NativeScripthttps://github.com/NativeScript
nativescript-clihttps://github.com/NativeScript/nativescript-cli
Codehttps://github.com/NativeScript/nativescript-cli
Issues357 (357)https://github.com/NativeScript/nativescript-cli/issues
Pull requests38 (38)https://github.com/NativeScript/nativescript-cli/pulls
Actionshttps://github.com/NativeScript/nativescript-cli/actions
Projectshttps://github.com/NativeScript/nativescript-cli/projects
Security and qualityhttps://github.com/NativeScript/nativescript-cli/security
Insightshttps://github.com/NativeScript/nativescript-cli/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fnativescript-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fnativescript-cli%2Fissues%2Fnew%2Fchoose
NathanWalkerhttps://github.com/NathanWalker
NativeScript:mainhttps://github.com/NativeScript/nativescript-cli/tree/main
edusperoni:chore/build-to-disthttps://github.com/edusperoni/nativescript-cli/tree/chore/build-to-dist
Conversation 7 https://github.com/NativeScript/nativescript-cli/pull/6092
Commits 1 https://github.com/NativeScript/nativescript-cli/pull/6092/commits
Checks 6 https://github.com/NativeScript/nativescript-cli/pull/6092/checks
Files changed https://github.com/NativeScript/nativescript-cli/pull/6092/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6092/files
build: emit to dist/ and ship generated declarations https://github.com/NativeScript/nativescript-cli/pull/6092/files#top
Show all changes 1 commit https://github.com/NativeScript/nativescript-cli/pull/6092/files
ea24c4d build: emit to dist/ and ship generated declarations edusperoni Jul 28, 2026 https://github.com/NativeScript/nativescript-cli/pull/6092/commits/ea24c4d5284a7a0ec661de499ca5929d8985bdb8
Clear filters https://github.com/NativeScript/nativescript-cli/pull/6092/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6092/files
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6092/files
npm_release_cli.yml https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-863dbb8ef918dea4055ac98a7559898d51556ef3eae3cb8497f1f7fbf2fa2af9
.gitignore https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
project-backup-service.ts https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
package.json https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
clean.js https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-cfcbe4515bb8c1f6553d70f04c44fbb86d8b80c4fb65782e38c3defc65995366
copy-assets.js https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-c09ab817828733799eca92ef5549fb39e30d30561fe53cdbd6c244795a251c62
guard-root-pack.js https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-0bad8962d2364faeaa8bd7ba7d7fc164e800596739b7da42a6e2c5db31bdbda8
set-ga-id.js https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-5cf56576ce4ebea79123f4f63a656a1f649e80feac1885f352fac4daa4fd600d
.mocharc.yml https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-87ae3a54ae4e259ede402e65f7f194c264918307dd1c39536a58407f5743c868
tsconfig.json https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-b55cdbef4907b7045f32cc5360d48d262cca5f94062e353089f189f4460039e0
tsconfig.release.json https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-7b712a97e855db03c32bdf4edddd12da55549811da4edae7121044c17b7fddc8
.github/workflows/npm_release_cli.ymlhttps://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-863dbb8ef918dea4055ac98a7559898d51556ef3eae3cb8497f1f7fbf2fa2af9
View file https://github.com/edusperoni/nativescript-cli/blob/ea24c4d5284a7a0ec661de499ca5929d8985bdb8/.github/workflows/npm_release_cli.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6092/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-863dbb8ef918dea4055ac98a7559898d51556ef3eae3cb8497f1f7fbf2fa2af9
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-863dbb8ef918dea4055ac98a7559898d51556ef3eae3cb8497f1f7fbf2fa2af9
.gitignorehttps://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
View file https://github.com/edusperoni/nativescript-cli/blob/ea24c4d5284a7a0ec661de499ca5929d8985bdb8/.gitignore
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6092/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-bc37d034bad564583790a46f19d807abfe519c5671395fd494d8cce506c42947
lib/services/project-backup-service.tshttps://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
View file https://github.com/edusperoni/nativescript-cli/blob/ea24c4d5284a7a0ec661de499ca5929d8985bdb8/lib/services/project-backup-service.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6092/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-2ddd34784a4bf8edc21b4dae763534b5467962029990969a759439d32808c701
package.jsonhttps://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
View file https://github.com/edusperoni/nativescript-cli/blob/ea24c4d5284a7a0ec661de499ca5929d8985bdb8/package.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6092/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519
scripts/clean.jshttps://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-cfcbe4515bb8c1f6553d70f04c44fbb86d8b80c4fb65782e38c3defc65995366
View file https://github.com/edusperoni/nativescript-cli/blob/ea24c4d5284a7a0ec661de499ca5929d8985bdb8/scripts/clean.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6092/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-cfcbe4515bb8c1f6553d70f04c44fbb86d8b80c4fb65782e38c3defc65995366
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-cfcbe4515bb8c1f6553d70f04c44fbb86d8b80c4fb65782e38c3defc65995366
scripts/copy-assets.jshttps://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-c09ab817828733799eca92ef5549fb39e30d30561fe53cdbd6c244795a251c62
View file https://github.com/edusperoni/nativescript-cli/blob/ea24c4d5284a7a0ec661de499ca5929d8985bdb8/scripts/copy-assets.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6092/{{ revealButtonHref }}
scripts/guard-root-pack.jshttps://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-0bad8962d2364faeaa8bd7ba7d7fc164e800596739b7da42a6e2c5db31bdbda8
View file https://github.com/edusperoni/nativescript-cli/blob/ea24c4d5284a7a0ec661de499ca5929d8985bdb8/scripts/guard-root-pack.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6092/{{ revealButtonHref }}
scripts/set-ga-id.jshttps://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-5cf56576ce4ebea79123f4f63a656a1f649e80feac1885f352fac4daa4fd600d
View file https://github.com/edusperoni/nativescript-cli/blob/ea24c4d5284a7a0ec661de499ca5929d8985bdb8/scripts/set-ga-id.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-cli/pull/6092/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-5cf56576ce4ebea79123f4f63a656a1f649e80feac1885f352fac4daa4fd600d
coderabbitaihttps://github.com/apps/coderabbitai
Jul 28, 2026https://github.com/NativeScript/nativescript-cli/pull/6092/files#r3669080547
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6092/files
https://github.com/NativeScript/nativescript-cli/pull/6092/files#diff-5cf56576ce4ebea79123f4f63a656a1f649e80feac1885f352fac4daa4fd600d
Please reload this pagehttps://github.com/NativeScript/nativescript-cli/pull/6092/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.