Conversation
Add pre-release verification and smoke-test tooling plus compatibility proxy package.json files. New scripts: `scripts/verify-release-artifacts.js` checks that generated native bindings and compiled JS artifacts exist before publishing; `scripts/smoke-test-release.js` packs the tarball into a temporary project and verifies tarball entries, exports subpath resolution, legacy main/module/react-native proxy targets, and Ruby syntax for podspec/autolinking. Add lightweight proxy package.json shims under `hooks/` and `errors/` so bundlers that ignore `exports` can still resolve subpaths. Update root package.json to include `hooks` and `errors` in the published files, add a `release:prepare` script that runs codegen and the new verification steps, and replace the release hook commands to run `release:prepare` before publishing. These changes catch missing build or packaging issues early in the release flow.
Contributor
There was a problem hiding this comment.
Pull request overview
Enhances the release workflow by adding pre-publish verification and smoke-test scripts, plus subpath proxy package.json shims to support bundlers that don’t honor the root exports map.
Changes:
- Add
scripts/verify-release-artifacts.jsto ensure required generated/built artifacts exist before releasing. - Add
scripts/smoke-test-release.jsto pack/install the tarball and validate key entry points, proxy shims, and Ruby syntax. - Update
package.jsonto includehooks/anderrors/in published files and runrelease:prepareviarelease-it’sbefore:init.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/verify-release-artifacts.js | Adds a pre-release check for expected generated native + compiled JS artifacts. |
| scripts/smoke-test-release.js | Adds an end-to-end tarball pack/install smoke test for entrypoints, shims, and Ruby syntax. |
| package.json | Wires release:prepare into release-it and ensures new shim directories are published. |
| hooks/package.json | Adds a proxy shim for legacy bundlers for the ./hooks subpath. |
| errors/package.json | Adds a proxy shim for legacy bundlers for the ./errors subpath. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+55
to
+58
| const fail = (msg) => { | ||
| console.error(`\n[smoke-test-release] ❌ ${msg}\n`) | ||
| process.exit(1) | ||
| } |
Comment on lines
+69
to
+70
| const entries = run(`tar -tzf ${tarballName}`, { cwd: ROOT }).split('\n') | ||
| const missing = REQUIRED_TARBALL_ENTRIES.filter((e) => !entries.includes(e)) |
Comment on lines
+28
to
+39
| const REQUIRED_TARBALL_ENTRIES = [ | ||
| 'package/nitrogen/generated/ios/SensitiveInfo+autolinking.rb', | ||
| 'package/nitrogen/generated/android/SensitiveInfo+autolinking.gradle', | ||
| 'package/hooks/package.json', | ||
| 'package/errors/package.json', | ||
| 'package/lib/commonjs/index.js', | ||
| 'package/lib/module/index.js', | ||
| 'package/lib/commonjs/hooks/index.js', | ||
| 'package/lib/module/hooks/index.js', | ||
| 'package/lib/commonjs/errors.js', | ||
| 'package/lib/module/errors.js', | ||
| ] |
Comment on lines
+42
to
+45
| 'react-native-sensitive-info', | ||
| 'react-native-sensitive-info/hooks', | ||
| 'react-native-sensitive-info/errors', | ||
| 'react-native-sensitive-info/package.json', |
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.
This pull request introduces improvements to the release process to ensure package integrity and compatibility, especially for bundlers that don't honor the
exportsfield. It adds compatibility shims, new verification scripts, and updates the release workflow to automate checks before publishing.Release workflow enhancements:
release:preparescript to the mainpackage.json, which runs code generation and two new verification scripts before publishing a release. This script is now invoked in therelease-itbefore:inithook, replacing the previous typecheck/build steps. [1] [2]Automated verification scripts:
scripts/verify-release-artifacts.js, which checks for the existence of all required native bindings, compiled JS files, and subpath proxypackage.jsonfiles before a release. The script aborts the release if any artifact is missing.scripts/smoke-test-release.js, an end-to-end smoke test that packs the release tarball, installs it into a temporary project, and verifies entry points and compatibility with both modern and legacy bundlers. It also checks Ruby syntax for iOS files to prevent installation errors.Compatibility shims for bundlers:
errors/package.jsonandhooks/package.jsonas compatibility shims. These proxy files allow older bundlers (e.g., older Re.Pack/rspack/Metro) that do not support theexportsfield to resolve the correct entry points via legacy fields (main,module,react-native). [1] [2]package.jsonto include the newhooksanderrorsdirectories for publishing.Add pre-release verification and smoke-test tooling plus compatibility proxy package.json files. New scripts:scripts/verify-release-artifacts.jschecks that generated native bindings and compiled JS artifacts exist before publishing;scripts/smoke-test-release.jspacks the tarball into a temporary project and verifies tarball entries, exports subpath resolution, legacy main/module/react-native proxy targets, and Ruby syntax for podspec/autolinking. Add lightweight proxy package.json shims underhooks/anderrors/so bundlers that ignoreexportscan still resolve subpaths. Update root package.json to includehooksanderrorsin the published files, add arelease:preparescript that runs codegen and the new verification steps, and replace the release hook commands to runrelease:preparebefore publishing. These changes catch missing build or packaging issues early in the release flow.