@radhya/mach 2.0.30 → 2.0.32
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 +41 -1
- package/dist/{chunk-6LOQKG2J.js → chunk-ZPETQEMG.js} +18 -18
- package/dist/{credentials-P3555DXZ.js → credentials-STB7QAPB.js} +1 -1
- package/dist/index.js +154 -148
- package/docs/ota-implementation-plan.md +1004 -0
- package/expo-plugin/index.js +43 -1
- package/package.json +3 -2
package/expo-plugin/index.js
CHANGED
|
@@ -85,12 +85,54 @@ const resolveDeepLinks = config => {
|
|
|
85
85
|
return { ...deepLinks, baseUrl, domain, scheme }
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
const resolveOta = config => {
|
|
89
|
+
const machConfig = readMachConfig(config)
|
|
90
|
+
const ota = machConfig.ota || machConfig.update || {}
|
|
91
|
+
if (ota.enabled === false) return { enabled: false }
|
|
92
|
+
const projectId = nonEmpty(machConfig.projectId)
|
|
93
|
+
const engine = nonEmpty(ota.engine) || (machConfig.framework === 'expo' ? 'expo-updates' : undefined)
|
|
94
|
+
const url = first(
|
|
95
|
+
ota.url,
|
|
96
|
+
ota.deploymentUrl,
|
|
97
|
+
projectId && engine !== 'mach-react-native' ? `https://mach-api.securejs.in/api/ota/expo/${projectId}` : undefined
|
|
98
|
+
)
|
|
99
|
+
const runtimeVersion = nonEmpty(ota.runtimeVersion)
|
|
100
|
+
const runtimeVersionPolicy = nonEmpty(ota.runtimeVersionPolicy) || 'appVersion'
|
|
101
|
+
const channel = nonEmpty(ota.channel) || 'production'
|
|
102
|
+
return { ...ota, enabled: Boolean(url), projectId, engine, url, runtimeVersion, runtimeVersionPolicy, channel }
|
|
103
|
+
}
|
|
104
|
+
|
|
88
105
|
module.exports = function withMachDeepLinks(config) {
|
|
89
106
|
const deepLinks = resolveDeepLinks(config)
|
|
107
|
+
const ota = resolveOta(config)
|
|
108
|
+
|
|
109
|
+
config.extra = { ...(config.extra || {}) }
|
|
110
|
+
|
|
111
|
+
if (ota.enabled && ota.url) {
|
|
112
|
+
config.updates = {
|
|
113
|
+
...(config.updates || {}),
|
|
114
|
+
url: ota.url,
|
|
115
|
+
}
|
|
116
|
+
if (ota.runtimeVersion) {
|
|
117
|
+
config.runtimeVersion = ota.runtimeVersion
|
|
118
|
+
} else if (!config.runtimeVersion && ota.runtimeVersionPolicy) {
|
|
119
|
+
config.runtimeVersion = { policy: ota.runtimeVersionPolicy }
|
|
120
|
+
}
|
|
121
|
+
config.extra.mach = {
|
|
122
|
+
...(config.extra.mach || {}),
|
|
123
|
+
projectId: ota.projectId,
|
|
124
|
+
ota: {
|
|
125
|
+
channel: ota.channel,
|
|
126
|
+
url: ota.url,
|
|
127
|
+
runtimeVersionPolicy: ota.runtimeVersionPolicy,
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
90
132
|
if (!deepLinks.baseUrl || !deepLinks.domain) return config
|
|
91
133
|
|
|
92
134
|
config.scheme = deepLinks.scheme
|
|
93
|
-
config.extra =
|
|
135
|
+
config.extra.deepLinkBaseUrl = deepLinks.baseUrl
|
|
94
136
|
|
|
95
137
|
config.ios = config.ios || {}
|
|
96
138
|
config.ios.associatedDomains = unique([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radhya/mach",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.32",
|
|
4
4
|
"description": "Mach CLI: Cloud Build Orchestrator for React Native & Expo",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"dist/",
|
|
12
12
|
"expo-plugin/",
|
|
13
13
|
"docs/frameworks/",
|
|
14
|
-
"docs/deep-links.md"
|
|
14
|
+
"docs/deep-links.md",
|
|
15
|
+
"docs/ota-implementation-plan.md"
|
|
15
16
|
],
|
|
16
17
|
"scripts": {
|
|
17
18
|
"build": "tsup src/index.ts src/commands/isolated-upload.ts --format esm --clean --minify --dts",
|