@radhya/mach 2.0.43 → 2.0.45

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.
package/docs/ota.md CHANGED
@@ -54,7 +54,7 @@ The default `ON_LOAD` behavior downloads a compatible release on one cold launch
54
54
 
55
55
  ## Runtime compatibility
56
56
 
57
- The native binary and OTA manifest must contain the same runtime version. Mach injects the resolved runtime into Expo config during builds and publishes, and synchronizes it into committed bare native projects before a Mach build. Runtime precedence is command `--runtime-version`, `ota.runtimeVersion`, `ota.runtimeVersionPolicy`, Expo config, then package version fallback. When Mach has a policy, old hardcoded Expo runtime values do not override it.
57
+ The native binary and OTA manifest must contain the same runtime version. Mach injects the resolved runtime into Expo config during builds and publishes, and synchronizes it into committed bare native projects before a Mach build. Runtime precedence is command `--runtime-version`, `ota.runtimeVersion`, `ota.runtimeVersionPolicy`, Expo config, then package version fallback. When Mach has a runtime or policy, old top-level or platform-specific Expo runtime values do not override it.
58
58
 
59
59
  `mach ota verify`, `mach ota publish`, and OTA-enabled Expo builds validate the final resolved Expo URL, channel, and runtime. They stop with a repair instruction if the project-local plugin would embed different values.
60
60
 
@@ -5,6 +5,15 @@ const unique = values => Array.from(new Set(values.filter(Boolean)))
5
5
  const nonEmpty = value => typeof value === 'string' && value.trim().length > 0 ? value.trim() : undefined
6
6
  const first = (...values) => values.map(nonEmpty).find(Boolean)
7
7
 
8
+ const withoutRuntimeVersion = platformConfig => {
9
+ if (!platformConfig || typeof platformConfig !== 'object' || !Object.prototype.hasOwnProperty.call(platformConfig, 'runtimeVersion')) {
10
+ return platformConfig
11
+ }
12
+ const nextConfig = { ...platformConfig }
13
+ delete nextConfig.runtimeVersion
14
+ return nextConfig
15
+ }
16
+
8
17
  const sanitizeScheme = value => {
9
18
  const normalized = nonEmpty(value)
10
19
  if (!normalized) return 'app'
@@ -126,6 +135,8 @@ module.exports = function withMachDeepLinks(config) {
126
135
  } else if (ota.runtimeVersionPolicy) {
127
136
  config.runtimeVersion = { policy: ota.runtimeVersionPolicy }
128
137
  }
138
+ config.ios = withoutRuntimeVersion(config.ios)
139
+ config.android = withoutRuntimeVersion(config.android)
129
140
  config.extra.mach = {
130
141
  ...(config.extra.mach || {}),
131
142
  projectId: ota.projectId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radhya/mach",
3
- "version": "2.0.43",
3
+ "version": "2.0.45",
4
4
  "description": "Mach CLI: Cloud Build Orchestrator for React Native & Expo",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -16,7 +16,8 @@
16
16
  ],
17
17
  "scripts": {
18
18
  "build": "tsup src/index.ts src/commands/isolated-upload.ts --format esm --clean --minify --dts",
19
- "test": "tsx --test src/**/*.test.ts && node --test tests/*.test.cjs",
19
+ "test": "npm run typecheck:ota && tsx --test src/**/*.test.ts && node --test tests/*.test.cjs",
20
+ "typecheck:ota": "tsc --noEmit --skipLibCheck --moduleResolution Bundler --module ESNext --target ES2022 --esModuleInterop --noImplicitAny false src/commands/ota.ts",
20
21
  "start": "node dist/index.js",
21
22
  "dev": "tsx src/index.ts",
22
23
  "release": "semantic-release"