pulse-updates 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/publish.mjs +23 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pulse-updates",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "OTA updates for React Native - lightweight alternative to expo-updates",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -777,8 +777,9 @@ async function publish(options) {
777
777
  }
778
778
  logSuccess(`Created release: ${release.id}`);
779
779
 
780
- // Crash-prediction preflight: warn (and abort unless --force) if this release references native
781
- // modules that weren't in the previous good release for this runtime version.
780
+ // Crash-prediction preflight: REFUSE the publish (fail-closed) if this release references native
781
+ // modules that weren't in the previous good release for this runtime version — native code can't ship
782
+ // over the air, so it would crash the installed cohort. Override with --allow-native-change.
782
783
  let preflight = null;
783
784
  try {
784
785
  const pfRes = await fetch(`${config.apiUrl}/api/releases/${release.id}/preflight`, {
@@ -790,17 +791,24 @@ async function publish(options) {
790
791
  }
791
792
  if (preflight) {
792
793
  for (const w of preflight.warnings || []) log(`⚠ ${w}`);
793
- // Only NEW NATIVE modules are risky for OTA (native code can't ship over the air); JS changes
794
- // are always fine. Warn by default; only block when the publisher opts into --strict.
795
- if (!preflight.ok) {
796
- if (options.strict) {
794
+ // Only NEW NATIVE modules are risky for OTA (native code can't ship over the air); JS changes are
795
+ // always fine. FAIL-CLOSED by default: a new native module referenced by this JS bundle that isn't
796
+ // in the previous good build for this runtime-version would CRASH the whole installed cohort on load,
797
+ // so we refuse the publish. Override only with --allow-native-change (you certify the native module
798
+ // is already in the installed binary). `--no-native-check` skips the gate entirely.
799
+ if (!preflight.ok && !options['no-native-check']) {
800
+ const allow = options['allow-native-change'] || options.force;
801
+ if (!allow) {
797
802
  throw new Error(
798
- 'Aborting (--strict): this release references native modules new to it they cannot ship ' +
799
- 'over the air. Ship them in a new native binary first.'
803
+ `Refusing to publish: this release references native module(s) NOT in the previous good build ` +
804
+ `for runtime-version ${config.runtimeVersion}/${config.platform}. Native code cannot ship over ` +
805
+ `the air — this OTA would crash the installed cohort on load. Ship a NEW native binary (and bump ` +
806
+ `the runtime-version) first. If you are certain the native module is already in the installed ` +
807
+ `binary, re-run with --allow-native-change.`
800
808
  );
801
809
  }
802
- log('⚠ Continuing: native-module changes detected (above). Only matters if those native modules ' +
803
- 'are not already in the installed binary. Re-run with --strict to block on this.');
810
+ logWarning('--allow-native-change: publishing despite detected native-module changes. If those ' +
811
+ 'native modules are NOT already in the installed binary, this OTA will crash the cohort.');
804
812
  }
805
813
  }
806
814
 
@@ -989,7 +997,11 @@ ${colors.cyan}Options:${colors.reset}
989
997
  --entry-file <file> Entry file (default: index.ts)
990
998
  --skip-bundle Skip bundle creation (use existing)
991
999
  --dry-run Build + validate locally without creating a release on the server
992
- --strict Abort publish if new native modules are detected (default: warn only)
1000
+ --allow-native-change Publish even though new native modules were detected (you certify they're
1001
+ already in the installed binary). Default is FAIL-CLOSED: a new native module
1002
+ not in the shipped build is refused (it would crash the cohort over the air).
1003
+ --no-native-check Skip the native-mismatch gate entirely (not recommended)
1004
+ --strict (deprecated — blocking on native changes is now the default)
993
1005
  --build <number> Build number (shown in version, e.g., 1.0.0.42)
994
1006
  --message <msg> Release message/notes
995
1007
  --key-id <id> Key id for keygen (default: auto-generated)