@radhya/mach 2.6.7 → 2.6.9
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/dist/index.js +141 -137
- package/docs/deep-links.md +6 -0
- package/expo-plugin/index.js +5 -1
- package/package.json +1 -1
package/docs/deep-links.md
CHANGED
|
@@ -88,6 +88,12 @@ to `dist` or `build/web` while deep-link setup wrote files under `public` or
|
|
|
88
88
|
`deep-links`. The generated files replace stale association files in the upload,
|
|
89
89
|
so the hosted release matches `mach.config.json`.
|
|
90
90
|
|
|
91
|
+
Before upload, Mach verifies that the generated AASA and Asset Links files
|
|
92
|
+
match the app IDs in the active `mach.config.json`. When Mach can identify the
|
|
93
|
+
selected hosting project's stable Production hostname, it also blocks a deploy
|
|
94
|
+
whose deep-link domain belongs to another app. This prevents a root workspace
|
|
95
|
+
config from silently publishing one product's AASA to another product's host.
|
|
96
|
+
|
|
91
97
|
`mach.config.json` is the only Mach deep-link source of truth. Values already available from the selected profile or root config are not duplicated inside `deepLinks`. A typical generated block is intentionally small:
|
|
92
98
|
|
|
93
99
|
```json
|
package/expo-plugin/index.js
CHANGED
|
@@ -4,6 +4,10 @@ const path = require('path')
|
|
|
4
4
|
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
|
+
const mergeScheme = (current, machScheme) => {
|
|
8
|
+
const values = unique([machScheme, ...(Array.isArray(current) ? current : [current])])
|
|
9
|
+
return values.length === 1 ? values[0] : values
|
|
10
|
+
}
|
|
7
11
|
|
|
8
12
|
const withoutRuntimeVersion = platformConfig => {
|
|
9
13
|
if (!platformConfig || typeof platformConfig !== 'object' || !Object.prototype.hasOwnProperty.call(platformConfig, 'runtimeVersion')) {
|
|
@@ -216,7 +220,7 @@ module.exports = function withMachDeepLinks(config, options) {
|
|
|
216
220
|
|
|
217
221
|
if (!deepLinks.baseUrl || !deepLinks.domain) return config
|
|
218
222
|
|
|
219
|
-
config.scheme = deepLinks.scheme
|
|
223
|
+
config.scheme = mergeScheme(config.scheme, deepLinks.scheme)
|
|
220
224
|
config.extra.deepLinkBaseUrl = deepLinks.baseUrl
|
|
221
225
|
|
|
222
226
|
config.ios = config.ios || {}
|