fix(dev-tools): ship dist/ to npm so Rozenite plugin loads#209
Open
azizbecha wants to merge 1 commit intocallstackincubator:mainfrom
Open
fix(dev-tools): ship dist/ to npm so Rozenite plugin loads#209azizbecha wants to merge 1 commit intocallstackincubator:mainfrom
azizbecha wants to merge 1 commit intocallstackincubator:mainfrom
Conversation
Without a "files" whitelist, npm respected .gitignore and stripped dist/ from the tarball, leaving consumers with no rozenite.json, no entry JS, and a blank DevTools panel. Add files:["dist"] plus an explicit exports map covering both the documented root import and the /react-native subpath users adopted as a workaround.
|
@azizbecha is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fixes #204.
Summary
@react-native-ai/dev-tools@0.12.0is published to npm without adist/folder, so Rozenite cannot discover the plugin (blank panel) and the documented import paths point at non-existent files. This PR fixes the packaging without touching any runtime code.Root cause
.gitignoreexcludesdist/.packages/dev-tools/package.jsonhas no"files"field.npm publishbuilds the tarball without a"files"whitelist, it respects.gitignoreand stripsdist/. Thepreparescript (rozenite build) does run, but its output is excluded from the tarball.package.json+ sources, nodist/rozenite.json, no entry-point JS, no UI bundle.main/module/typesall dangle.The other symptoms reported in #204 are downstream of this:
/react-nativesubpath" — Metro happens to resolvereact-native.tssource from the package root whendist/is absent.node_modules, where peer/dev separation breaks.react-json-treeis already correctly listed independencies.Once
dist/ships, all of these go away.Change
Single file:
packages/dev-tools/package.json. Adds two top-level fields:"files": ["dist"]— whitelists the built artifact for the npm tarball, overriding.gitignore."exports"— explicit map covering both.(the documented root import) and./react-native(the workaround users adopted from the issue thread). Both map to the same built entry, so there's no behavioral split../package.jsonis exposed for tooling that introspects it. Existingmain/module/typesare kept untouched for older bundlers.No source code, no docs, no version bump, no new dependencies.
Verification
Clean rebuild produces the expected dist:
Confirmed
dist/rozenite.json,dist/react-native.{js,cjs,d.ts},dist/App.html,dist/assets/App-*.js, plus per-function entries anddist/src/**/*.d.ts.npm pack --dry-runtarball (25 files, 169 KB packed / 850 KB unpacked) now includes:dist/rozenite.json✓ (Rozenite plugin manifest — fixes blank panel)dist/react-native.{js,cjs,d.ts}✓ (entry points for the documented root import)dist/App.html+dist/assets/App-*.js✓ (UI bundle)dist/{getAiSdkTracer,useAiSdkDevTools,telemetry-recorder}.{js,cjs}✓dist/src/**/*.d.ts✓ (type declarations referenced byreact-native.d.ts)LICENSE,README.md,package.json(auto-included)And correctly excludes
src/,react-native.ts,vite.config.ts,rozenite.config.ts,tsconfig.json— those are build inputs, not runtime artifacts.Node resolver on the published shape resolves both:
@react-native-ai/dev-tools→dist/react-native.cjs@react-native-ai/dev-tools/react-native→dist/react-native.cjs