Skip to content

Add release verification scripts and proxy shims#600

Merged
mCodex merged 1 commit intomasterfrom
fix/build
Apr 29, 2026
Merged

Add release verification scripts and proxy shims#600
mCodex merged 1 commit intomasterfrom
fix/build

Conversation

@mCodex
Copy link
Copy Markdown
Owner

@mCodex mCodex commented Apr 29, 2026

This pull request introduces improvements to the release process to ensure package integrity and compatibility, especially for bundlers that don't honor the exports field. It adds compatibility shims, new verification scripts, and updates the release workflow to automate checks before publishing.

Release workflow enhancements:

  • Added a new release:prepare script to the main package.json, which runs code generation and two new verification scripts before publishing a release. This script is now invoked in the release-it before:init hook, replacing the previous typecheck/build steps. [1] [2]

Automated verification scripts:

  • Introduced scripts/verify-release-artifacts.js, which checks for the existence of all required native bindings, compiled JS files, and subpath proxy package.json files before a release. The script aborts the release if any artifact is missing.
  • Added 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:

  • Added errors/package.json and hooks/package.json as compatibility shims. These proxy files allow older bundlers (e.g., older Re.Pack/rspack/Metro) that do not support the exports field to resolve the correct entry points via legacy fields (main, module, react-native). [1] [2]
  • Updated the files list in the root package.json to include the new hooks and errors directories for publishing.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.

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.
Copilot AI review requested due to automatic review settings April 29, 2026 13:20
@mCodex mCodex merged commit 91a6069 into master Apr 29, 2026
7 checks passed
@mCodex mCodex deleted the fix/build branch April 29, 2026 13:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js to ensure required generated/built artifacts exist before releasing.
  • Add scripts/smoke-test-release.js to pack/install the tarball and validate key entry points, proxy shims, and Ruby syntax.
  • Update package.json to include hooks/ and errors/ in published files and run release:prepare via release-it’s before: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',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants