@radhya/mach 2.0.42 → 2.0.44
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/README.md +2 -2
- package/dist/index.js +139 -139
- package/docs/ota.md +4 -2
- package/expo-plugin/index.js +12 -1
- package/package.json +2 -1
package/docs/ota.md
CHANGED
|
@@ -22,7 +22,7 @@ mach ota setup
|
|
|
22
22
|
mach ota verify
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Setup reads project ID, framework, channel, runtime policy, and existing URL from `mach.config.json`. Command flags have higher precedence. Interactive setup asks before installing dependencies; use `mach --yes ota setup` in automation. Use `--skip-install` only when dependencies are managed separately.
|
|
25
|
+
Setup reads project ID, framework, channel, runtime policy, and existing URL from `mach.config.json`. Command flags have higher precedence. It also refreshes an older project-local `@radhya/mach` package so Expo prebuild uses a plugin compatible with the running CLI. Interactive setup asks before installing dependencies; use `mach --yes ota setup` in automation. Use `--skip-install` only when dependencies are managed separately.
|
|
26
26
|
|
|
27
27
|
For a bare React Native project, setup may make these intentional changes:
|
|
28
28
|
|
|
@@ -54,7 +54,9 @@ 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.
|
|
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
|
+
|
|
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.
|
|
58
60
|
|
|
59
61
|
The default `appVersion` policy uses the app/package version as the compatibility boundary. Use an explicit `ota.runtimeVersion` or `--runtime-version` only when deliberately managing compatibility yourself.
|
|
60
62
|
|
package/expo-plugin/index.js
CHANGED
|
@@ -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'
|
|
@@ -123,9 +132,11 @@ module.exports = function withMachDeepLinks(config) {
|
|
|
123
132
|
}
|
|
124
133
|
if (ota.runtimeVersion) {
|
|
125
134
|
config.runtimeVersion = ota.runtimeVersion
|
|
126
|
-
} else if (
|
|
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.
|
|
3
|
+
"version": "2.0.44",
|
|
4
4
|
"description": "Mach CLI: Cloud Build Orchestrator for React Native & Expo",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,7 @@
|
|
|
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
20
|
"start": "node dist/index.js",
|
|
20
21
|
"dev": "tsx src/index.ts",
|
|
21
22
|
"release": "semantic-release"
|