@expo-harmony/config-plugins 55.0.10-harmony.5 → 55.0.11-harmony.2
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/build/config.d.ts +5 -0
- package/build/normalizeConfig.d.ts +1 -0
- package/build/normalizeConfig.js +15 -0
- package/package.json +2 -2
- package/src/config.ts +5 -0
- package/src/normalizeConfig.ts +17 -0
package/build/config.d.ts
CHANGED
|
@@ -26,6 +26,9 @@ export interface HarmonyConfig {
|
|
|
26
26
|
vendor?: string;
|
|
27
27
|
versionCode?: number;
|
|
28
28
|
versionName?: string;
|
|
29
|
+
runtimeVersion?: string | {
|
|
30
|
+
policy: 'nativeVersion' | 'sdkVersion' | 'appVersion' | 'fingerprint';
|
|
31
|
+
};
|
|
29
32
|
/** @deprecated Configure targetSdkVersion in @expo-harmony/expo-build-properties. */
|
|
30
33
|
targetApiVersion?: number;
|
|
31
34
|
targetSdkVersion?: number | string;
|
|
@@ -42,6 +45,8 @@ export interface HarmonyConfig {
|
|
|
42
45
|
jsEngine?: 'hermes';
|
|
43
46
|
abiFilters?: string[];
|
|
44
47
|
signingConfigFile?: string;
|
|
48
|
+
/** Native module build options supplied by config plugins. */
|
|
49
|
+
moduleBuilds?: Record<string, Record<string, string | number | boolean>>;
|
|
45
50
|
}
|
|
46
51
|
export type ExpoConfigWithHarmony = Omit<ExpoConfig, 'platforms'> & {
|
|
47
52
|
platforms?: ExpoHarmonyPlatform[];
|
|
@@ -10,6 +10,7 @@ interface NormalizedHarmonyConfig {
|
|
|
10
10
|
icon?: string;
|
|
11
11
|
label: string;
|
|
12
12
|
moduleName: string;
|
|
13
|
+
moduleBuilds?: NonNullable<HarmonyConfig['moduleBuilds']>;
|
|
13
14
|
nativeOrientation: Exclude<NonNullable<HarmonyConfig['orientation']>, 'default'> | 'unspecified';
|
|
14
15
|
permissions: NonNullable<HarmonyConfig['permissions']>;
|
|
15
16
|
productName: string;
|
package/build/normalizeConfig.js
CHANGED
|
@@ -211,7 +211,22 @@ function normalizeHarmonyConfig(config) {
|
|
|
211
211
|
const devices = harmony.deviceTypes === undefined
|
|
212
212
|
? ['phone', 'tablet']
|
|
213
213
|
: normalizeStringArray(harmony.deviceTypes, 'harmony.deviceTypes', DeviceTypes);
|
|
214
|
+
const moduleBuilds = harmony.moduleBuilds;
|
|
215
|
+
if (moduleBuilds !== undefined) {
|
|
216
|
+
if (!moduleBuilds || typeof moduleBuilds !== 'object' || Array.isArray(moduleBuilds)) {
|
|
217
|
+
throw new HarmonyConfigError('harmony.moduleBuilds must be an object.');
|
|
218
|
+
}
|
|
219
|
+
for (const [name, options] of Object.entries(moduleBuilds)) {
|
|
220
|
+
if (!/^(@[a-z0-9._~-]+\/)?[a-z0-9._~-]+$/u.test(name)
|
|
221
|
+
|| !options || typeof options !== 'object' || Array.isArray(options)
|
|
222
|
+
|| Object.values(options).some(value => !['boolean', 'string', 'number'].includes(typeof value)
|
|
223
|
+
|| (typeof value === 'number' && !Number.isFinite(value)))) {
|
|
224
|
+
throw new HarmonyConfigError(`Invalid native module build options for ${name}.`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
214
228
|
return Object.freeze({
|
|
229
|
+
...(moduleBuilds && Object.keys(moduleBuilds).length ? { moduleBuilds: structuredClone(moduleBuilds) } : {}),
|
|
215
230
|
abiFilters: abis,
|
|
216
231
|
abilityName: ability,
|
|
217
232
|
backgroundColor: background,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo-harmony/config-plugins",
|
|
3
|
-
"version": "55.0.
|
|
3
|
+
"version": "55.0.11-harmony.2",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react-native",
|
|
6
6
|
"expo",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@expo/config-plugins": "55.0.
|
|
45
|
+
"@expo/config-plugins": "55.0.11",
|
|
46
46
|
"@expo/config-types": "^55.0.5",
|
|
47
47
|
"json5": "2.2.3"
|
|
48
48
|
},
|
package/src/config.ts
CHANGED
|
@@ -34,6 +34,9 @@ export interface HarmonyConfig {
|
|
|
34
34
|
vendor?: string;
|
|
35
35
|
versionCode?: number;
|
|
36
36
|
versionName?: string;
|
|
37
|
+
runtimeVersion?: string | {
|
|
38
|
+
policy: 'nativeVersion' | 'sdkVersion' | 'appVersion' | 'fingerprint';
|
|
39
|
+
};
|
|
37
40
|
/** @deprecated Configure targetSdkVersion in @expo-harmony/expo-build-properties. */
|
|
38
41
|
targetApiVersion?: number;
|
|
39
42
|
targetSdkVersion?: number | string;
|
|
@@ -50,6 +53,8 @@ export interface HarmonyConfig {
|
|
|
50
53
|
jsEngine?: 'hermes';
|
|
51
54
|
abiFilters?: string[];
|
|
52
55
|
signingConfigFile?: string;
|
|
56
|
+
/** Native module build options supplied by config plugins. */
|
|
57
|
+
moduleBuilds?: Record<string, Record<string, string | number | boolean>>;
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
export type ExpoConfigWithHarmony = Omit<ExpoConfig, 'platforms'> & {
|
package/src/normalizeConfig.ts
CHANGED
|
@@ -21,6 +21,7 @@ interface NormalizedHarmonyConfig {
|
|
|
21
21
|
icon?: string;
|
|
22
22
|
label: string;
|
|
23
23
|
moduleName: string;
|
|
24
|
+
moduleBuilds?: NonNullable<HarmonyConfig['moduleBuilds']>;
|
|
24
25
|
nativeOrientation: Exclude<NonNullable<HarmonyConfig['orientation']>, 'default'> | 'unspecified';
|
|
25
26
|
permissions: NonNullable<HarmonyConfig['permissions']>;
|
|
26
27
|
productName: string;
|
|
@@ -320,7 +321,23 @@ function normalizeHarmonyConfig(config: HarmonyExpoConfig): NormalizedHarmonyCon
|
|
|
320
321
|
DeviceTypes
|
|
321
322
|
);
|
|
322
323
|
|
|
324
|
+
const moduleBuilds = harmony.moduleBuilds;
|
|
325
|
+
if (moduleBuilds !== undefined) {
|
|
326
|
+
if (!moduleBuilds || typeof moduleBuilds !== 'object' || Array.isArray(moduleBuilds)) {
|
|
327
|
+
throw new HarmonyConfigError('harmony.moduleBuilds must be an object.');
|
|
328
|
+
}
|
|
329
|
+
for (const [name, options] of Object.entries(moduleBuilds)) {
|
|
330
|
+
if (!/^(@[a-z0-9._~-]+\/)?[a-z0-9._~-]+$/u.test(name)
|
|
331
|
+
|| !options || typeof options !== 'object' || Array.isArray(options)
|
|
332
|
+
|| Object.values(options).some(value => !['boolean', 'string', 'number'].includes(typeof value)
|
|
333
|
+
|| (typeof value === 'number' && !Number.isFinite(value)))) {
|
|
334
|
+
throw new HarmonyConfigError(`Invalid native module build options for ${name}.`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
323
339
|
return Object.freeze({
|
|
340
|
+
...(moduleBuilds && Object.keys(moduleBuilds).length ? { moduleBuilds: structuredClone(moduleBuilds) } : {}),
|
|
324
341
|
abiFilters: abis,
|
|
325
342
|
abilityName: ability,
|
|
326
343
|
backgroundColor: background,
|