v6.1.3
π οΈ v6.1.3 β Release Pipeline & Bundler Compatibility Fixes
TL;DR β
v6.1.2shipped a broken tarball: it was missing allnitrogen/generated/native bindings (breakingpod installwithcannot load such file -- nitrogen/generated/ios/SensitiveInfo+autolinking.rb) and itsexportsmap could not be resolved by some bundlers (Re.Pack/rspack), causingCannot find module 'react-native-sensitive-info/hooks'at build time.
v6.1.3is a pure release-tooling fix β no runtime/API changes. Upgrade and rebuild.
π Bug Fixes
π¦ Restore missing iOS / Android native bindings in the published tarball
v6.1.2 was published without any nitrogen/generated/ output because:
nitrogen/is gitignored (it's a build artifact).- The previous
release-itbefore:inithook only rantypecheck+bob build, notnitrogencodegen. - So when CI checked out a clean tree, the
nitrogen/directory never existed at publish time.
Symptom on consumer side:
[!] Invalid Podfile file: [!] Invalid SensitiveInfo.podspec file:
cannot load such file -- nitrogen/generated/ios/SensitiveInfo+autolinking.rb.
Fix: the release pipeline now always regenerates nitrogen artifacts (via npm run codegen) before packing/publishing, and aborts the release if any expected artifact is missing.
π Fix Cannot find module 'react-native-sensitive-info/hooks' under Re.Pack / rspack
Some bundlers (notably Re.Pack/rspack, and certain Metro configurations) don't resolve the package exports map for subpath imports, so import { useSecret } from 'react-native-sensitive-info/hooks' failed at build time even though the files were physically present in node_modules.
Fix: added classic subpath proxy directories (hooks/, errors/) following the same pattern used by date-fns, lodash, react-router, and @reduxjs/toolkit. They expose main / module / react-native / types fields pointing into lib/..., so any bundler that falls back to filesystem resolution can find them. Modern bundlers continue to use the exports map β both paths resolve to the same files.
β Release Pipeline Hardening
To make sure this kind of regression can never ship again, release-it's before:init hook now runs a single release:prepare script that performs three sequential checks. Any failure aborts the publish + git push.
| # | Step | What it guarantees |
|---|---|---|
| 1 | ποΈ npm run codegen |
Regenerates nitrogen/ (iOS/Android autolinking, shared C++ headers) and runs bob build. |
| 2 | π verify-release-artifacts.js |
Fast filesystem check for 11 critical artifacts in the workspace. Fails fast with an actionable message. |
| 3 | π smoke-test-release.js |
Full end-to-end consumer simulation: npm pack β install into a sandbox β resolve every documented subpath via both the exports map and the legacy proxy fields β ruby -c on the podspec + autolinking.rb to catch parse errors. |
If v6.1.2 had been gated by this pipeline, the release would have been blocked at step 3 with a clear error pointing at the missing nitrogen/generated/ios/SensitiveInfo+autolinking.rb.
π§° What you need to do
Just bump the version β no code changes are required:
npm install react-native-sensitive-info@^6.1.3
# then on iOS:
cd ios && pod installIf you were stuck on v6.1.2 due to the pod install or Cannot find module 'react-native-sensitive-info/hooks' errors, both are resolved.
π Files changed
package.jsonβ addedrelease:preparescript;before:initnow runs it;hooks/anderrors/added tofiles.hooks/package.json(new) β subpath proxy for bundlers withoutexportssupport.errors/package.json(new) β subpath proxy for bundlers withoutexportssupport.scripts/verify-release-artifacts.js(new) β workspace-level artifact check.scripts/smoke-test-release.js(new) β end-to-end pack/install/resolve smoke test.