expo-updates 29.0.15 → 29.0.16
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/CHANGELOG.md +6 -0
- package/android/build.gradle +2 -2
- package/package.json +3 -3
- package/build-cli/assetsVerify.d.ts +0 -3
- package/build-cli/assetsVerify.js +0 -88
- package/build-cli/assetsVerifyAsync.d.ts +0 -59
- package/build-cli/assetsVerifyAsync.js +0 -127
- package/build-cli/assetsVerifyTypes.d.ts +0 -45
- package/build-cli/assetsVerifyTypes.js +0 -7
- package/build-cli/cli.d.ts +0 -2
- package/build-cli/cli.js +0 -56
- package/build-cli/configureCodeSigning.d.ts +0 -3
- package/build-cli/configureCodeSigning.js +0 -43
- package/build-cli/configureCodeSigningAsync.d.ts +0 -7
- package/build-cli/configureCodeSigningAsync.js +0 -42
- package/build-cli/generateCodeSigning.d.ts +0 -3
- package/build-cli/generateCodeSigning.js +0 -48
- package/build-cli/generateCodeSigningAsync.d.ts +0 -8
- package/build-cli/generateCodeSigningAsync.js +0 -43
- package/build-cli/utils/args.d.ts +0 -16
- package/build-cli/utils/args.js +0 -52
- package/build-cli/utils/dir.d.ts +0 -1
- package/build-cli/utils/dir.js +0 -8
- package/build-cli/utils/log.d.ts +0 -7
- package/build-cli/utils/log.js +0 -34
- package/build-cli/utils/modifyConfigAsync.d.ts +0 -3
- package/build-cli/utils/modifyConfigAsync.js +0 -41
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 29.0.16 — 2026-01-06
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- Bump to `@expo/code-signing-certificates@^0.0.6` ([#41965](https://github.com/expo/expo/pull/41965) by [@kitten](https://github.com/kitten))
|
|
18
|
+
|
|
13
19
|
## 29.0.15 — 2025-12-08
|
|
14
20
|
|
|
15
21
|
_This version does not introduce any user-facing changes._
|
package/android/build.gradle
CHANGED
|
@@ -42,7 +42,7 @@ expoModule {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
group = 'host.exp.exponent'
|
|
45
|
-
version = '29.0.
|
|
45
|
+
version = '29.0.16'
|
|
46
46
|
|
|
47
47
|
// Utility method to derive boolean values from the environment or from Java properties,
|
|
48
48
|
// and return them as strings to be used in BuildConfig fields
|
|
@@ -88,7 +88,7 @@ android {
|
|
|
88
88
|
namespace "expo.modules.updates"
|
|
89
89
|
defaultConfig {
|
|
90
90
|
versionCode 31
|
|
91
|
-
versionName '29.0.
|
|
91
|
+
versionName '29.0.16'
|
|
92
92
|
consumerProguardFiles("proguard-rules.pro")
|
|
93
93
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
94
94
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-updates",
|
|
3
|
-
"version": "29.0.
|
|
3
|
+
"version": "29.0.16",
|
|
4
4
|
"description": "Fetches and manages remotely-hosted assets and updates to your app's JS bundle.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"preset": "expo-module-scripts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@expo/code-signing-certificates": "0.0.
|
|
41
|
+
"@expo/code-signing-certificates": "^0.0.6",
|
|
42
42
|
"@expo/plist": "^0.4.8",
|
|
43
43
|
"@expo/spawn-async": "^1.7.2",
|
|
44
44
|
"arg": "4.1.0",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"react": "*",
|
|
74
74
|
"react-native": "*"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "e615daa250a27c60da3cea1f0572dcde93df5b68"
|
|
77
77
|
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.expoAssetsVerify = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
-
const assetsVerifyAsync_1 = require("./assetsVerifyAsync");
|
|
9
|
-
const assetsVerifyTypes_1 = require("./assetsVerifyTypes");
|
|
10
|
-
const args_1 = require("./utils/args");
|
|
11
|
-
const Log = tslib_1.__importStar(require("./utils/log"));
|
|
12
|
-
const debug = require('debug')('expo-updates:assets:verify');
|
|
13
|
-
const expoAssetsVerify = async (argv) => {
|
|
14
|
-
const args = (0, args_1.assertArgs)({
|
|
15
|
-
// Types
|
|
16
|
-
'--asset-map-path': String,
|
|
17
|
-
'--exported-manifest-path': String,
|
|
18
|
-
'--build-manifest-path': String,
|
|
19
|
-
'--platform': String,
|
|
20
|
-
'--help': Boolean,
|
|
21
|
-
// Aliases
|
|
22
|
-
'-a': '--asset-map-path',
|
|
23
|
-
'-e': '--exported-manifest-path',
|
|
24
|
-
'-b': '--build-manifest-path',
|
|
25
|
-
'-p': '--platform',
|
|
26
|
-
'-h': '--help',
|
|
27
|
-
}, argv !== null && argv !== void 0 ? argv : []);
|
|
28
|
-
if (args['--help']) {
|
|
29
|
-
Log.exit((0, chalk_1.default) `
|
|
30
|
-
{bold Description}
|
|
31
|
-
Verify that all static files in an exported bundle are in either the export or an embedded bundle
|
|
32
|
-
|
|
33
|
-
{bold Usage}
|
|
34
|
-
{dim $} npx expo-updates assets:verify {dim <dir>}
|
|
35
|
-
|
|
36
|
-
Options
|
|
37
|
-
<dir> Directory of the Expo project. Default: Current working directory
|
|
38
|
-
-a, --asset-map-path <path> Path to the \`assetmap.json\` in an export produced by the command \`npx expo export --dump-assetmap\`
|
|
39
|
-
-e, --exported-manifest-path <path> Path to the \`metadata.json\` in an export produced by the command \`npx expo export --dump-assetmap\`
|
|
40
|
-
-b, --build-manifest-path <path> Path to the \`app.manifest\` file created by expo-updates in an Expo application build (either ios or android)
|
|
41
|
-
-p, --platform <platform> Options: ${JSON.stringify(assetsVerifyTypes_1.validPlatforms)}
|
|
42
|
-
-h, --help Usage info
|
|
43
|
-
`, 0);
|
|
44
|
-
}
|
|
45
|
-
return (async () => {
|
|
46
|
-
const projectRoot = (0, args_1.getProjectRoot)(args);
|
|
47
|
-
const validatedArgs = resolveOptions(projectRoot, args);
|
|
48
|
-
debug(`Validated params: ${JSON.stringify(validatedArgs, null, 2)}`);
|
|
49
|
-
const { buildManifestPath, exportedManifestPath, assetMapPath, platform } = validatedArgs;
|
|
50
|
-
const missingAssets = await (0, assetsVerifyAsync_1.getMissingAssetsAsync)(buildManifestPath, exportedManifestPath, assetMapPath, platform);
|
|
51
|
-
if (missingAssets.length > 0) {
|
|
52
|
-
throw new Error(`${missingAssets.length} assets not found in either embedded manifest or in exported bundle:${JSON.stringify(missingAssets, null, 2)}`);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
Log.log(`All resolved assets found in either embedded manifest or in exported bundle.`);
|
|
56
|
-
}
|
|
57
|
-
process.exit(0);
|
|
58
|
-
})().catch((e) => {
|
|
59
|
-
Log.log(`${e}`);
|
|
60
|
-
process.exit(1);
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
exports.expoAssetsVerify = expoAssetsVerify;
|
|
64
|
-
function resolveOptions(projectRoot, args) {
|
|
65
|
-
const exportedManifestPath = validatedPathFromArgument(projectRoot, args, '--exported-manifest-path');
|
|
66
|
-
const buildManifestPath = validatedPathFromArgument(projectRoot, args, '--build-manifest-path');
|
|
67
|
-
const assetMapPath = validatedPathFromArgument(projectRoot, args, '--asset-map-path');
|
|
68
|
-
const platform = args['--platform'];
|
|
69
|
-
if (!(0, assetsVerifyTypes_1.isValidPlatform)(platform)) {
|
|
70
|
-
throw new Error(`Platform must be one of ${JSON.stringify(assetsVerifyTypes_1.validPlatforms)}`);
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
exportedManifestPath,
|
|
74
|
-
buildManifestPath,
|
|
75
|
-
assetMapPath,
|
|
76
|
-
platform,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function validatedPathFromArgument(projectRoot, args, key) {
|
|
80
|
-
const maybeRelativePath = args[key];
|
|
81
|
-
if (!maybeRelativePath) {
|
|
82
|
-
throw new Error(`No value for ${key}`);
|
|
83
|
-
}
|
|
84
|
-
if (maybeRelativePath.indexOf('/') === 0) {
|
|
85
|
-
return maybeRelativePath; // absolute path
|
|
86
|
-
}
|
|
87
|
-
return path_1.default.resolve(projectRoot, maybeRelativePath);
|
|
88
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { BuildManifest, ExportedMetadata, FullAssetDump, FullAssetDumpEntry, MissingAsset, Platform } from './assetsVerifyTypes';
|
|
2
|
-
/**
|
|
3
|
-
* Finds any assets that will be missing from an app given a build and an exported update bundle.
|
|
4
|
-
*
|
|
5
|
-
* @param buildManifestPath Path to the `app.manifest` file created by expo-updates in an Expo application build (either ios or android)
|
|
6
|
-
* @param exportMetadataPath Path to the `metadata.json` in an export produced by the command `npx expo export --dump-assetmap`
|
|
7
|
-
* @param assetMapPath Path to the `assetmap.json` in an export produced by the command `npx expo export --dump-assetmap`
|
|
8
|
-
* @param projectRoot The project root path
|
|
9
|
-
* @returns An array containing any assets that are found in the Metro asset dump, but not included in either app.manifest or the exported bundle
|
|
10
|
-
*/
|
|
11
|
-
export declare function getMissingAssetsAsync(buildManifestPath: string, exportMetadataPath: string, assetMapPath: string, platform: Platform): Promise<MissingAsset[]>;
|
|
12
|
-
/**
|
|
13
|
-
* Reads and returns the embedded manifest (app.manifest) for a build.
|
|
14
|
-
*
|
|
15
|
-
* @param buildManifestPath Path to the build folder
|
|
16
|
-
* @param platform Either 'android' or 'ios'
|
|
17
|
-
* @param projectRoot The project root path
|
|
18
|
-
* @returns the JSON structure of the manifest
|
|
19
|
-
*/
|
|
20
|
-
export declare function getBuildManifestAsync(buildManifestPath: string): Promise<BuildManifest>;
|
|
21
|
-
/**
|
|
22
|
-
* Extracts the set of asset hashes from a build manifest.
|
|
23
|
-
*
|
|
24
|
-
* @param buildManifest The build manifest
|
|
25
|
-
* @returns The set of asset hashes contained in the build manifest
|
|
26
|
-
*/
|
|
27
|
-
export declare function getBuildManifestHashSet(buildManifest: BuildManifest): Set<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Reads and extracts the asset dump for an exported bundle.
|
|
30
|
-
*
|
|
31
|
-
* @param assetMapPath The path to the exported assetmap.json.
|
|
32
|
-
* @returns The asset dump as an object.
|
|
33
|
-
*/
|
|
34
|
-
export declare function getFullAssetDumpAsync(assetMapPath: string): Promise<FullAssetDump>;
|
|
35
|
-
/**
|
|
36
|
-
* Extracts the set of asset hashes from an asset dump.
|
|
37
|
-
*
|
|
38
|
-
* @param assetDump
|
|
39
|
-
* @returns The set of asset hashes in the asset dump, and a map of hash to asset
|
|
40
|
-
*/
|
|
41
|
-
export declare function getFullAssetDumpHashSet(assetDump: FullAssetDump): {
|
|
42
|
-
fullAssetHashSet: Set<string>;
|
|
43
|
-
fullAssetHashMap: Map<string, FullAssetDumpEntry>;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Reads and extracts the metadata.json from an exported bundle.
|
|
47
|
-
*
|
|
48
|
-
* @param exportedMetadataPath Path to the exported metadata.json.
|
|
49
|
-
* @returns The metadata of the bundle.
|
|
50
|
-
*/
|
|
51
|
-
export declare function getExportedMetadataAsync(exportedMetadataPath: string): Promise<ExportedMetadata>;
|
|
52
|
-
/**
|
|
53
|
-
* Extracts the set of asset hashes from an exported bundle's metadata for a given platform.
|
|
54
|
-
*
|
|
55
|
-
* @param metadata The metadata from the exported bundle
|
|
56
|
-
* @param platform Either 'android' or 'ios'
|
|
57
|
-
* @returns the set of asset hashes
|
|
58
|
-
*/
|
|
59
|
-
export declare function getExportedMetadataHashSet(metadata: ExportedMetadata, platform: Platform): Set<string>;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExportedMetadataHashSet = exports.getExportedMetadataAsync = exports.getFullAssetDumpHashSet = exports.getFullAssetDumpAsync = exports.getBuildManifestHashSet = exports.getBuildManifestAsync = exports.getMissingAssetsAsync = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const debug = require('debug')('expo-updates:assets:verify');
|
|
6
|
-
/**
|
|
7
|
-
* Finds any assets that will be missing from an app given a build and an exported update bundle.
|
|
8
|
-
*
|
|
9
|
-
* @param buildManifestPath Path to the `app.manifest` file created by expo-updates in an Expo application build (either ios or android)
|
|
10
|
-
* @param exportMetadataPath Path to the `metadata.json` in an export produced by the command `npx expo export --dump-assetmap`
|
|
11
|
-
* @param assetMapPath Path to the `assetmap.json` in an export produced by the command `npx expo export --dump-assetmap`
|
|
12
|
-
* @param projectRoot The project root path
|
|
13
|
-
* @returns An array containing any assets that are found in the Metro asset dump, but not included in either app.manifest or the exported bundle
|
|
14
|
-
*/
|
|
15
|
-
async function getMissingAssetsAsync(buildManifestPath, exportMetadataPath, assetMapPath, platform) {
|
|
16
|
-
const buildManifestHashSet = getBuildManifestHashSet(await getBuildManifestAsync(buildManifestPath));
|
|
17
|
-
const fullAssetDump = await getFullAssetDumpAsync(assetMapPath);
|
|
18
|
-
const { fullAssetHashSet, fullAssetHashMap } = getFullAssetDumpHashSet(fullAssetDump);
|
|
19
|
-
const exportedAssetSet = getExportedMetadataHashSet(await getExportedMetadataAsync(exportMetadataPath), platform);
|
|
20
|
-
debug(`Assets in build: ${JSON.stringify([...buildManifestHashSet], null, 2)}`);
|
|
21
|
-
debug(`Assets in exported bundle: ${JSON.stringify([...exportedAssetSet], null, 2)}`);
|
|
22
|
-
debug(`All assets resolved by Metro: ${JSON.stringify([...fullAssetHashSet], null, 2)}`);
|
|
23
|
-
const buildAssetsPlusExportedAssets = new Set(buildManifestHashSet);
|
|
24
|
-
exportedAssetSet.forEach((hash) => buildAssetsPlusExportedAssets.add(hash));
|
|
25
|
-
const missingAssets = [];
|
|
26
|
-
fullAssetHashSet.forEach((hash) => {
|
|
27
|
-
if (!buildAssetsPlusExportedAssets.has(hash)) {
|
|
28
|
-
const asset = fullAssetHashMap.get(hash);
|
|
29
|
-
asset === null || asset === void 0 ? void 0 : asset.fileHashes.forEach((fileHash, index) => {
|
|
30
|
-
if ((asset === null || asset === void 0 ? void 0 : asset.fileHashes[index]) === hash) {
|
|
31
|
-
missingAssets.push({
|
|
32
|
-
hash,
|
|
33
|
-
path: asset === null || asset === void 0 ? void 0 : asset.files[index],
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
return missingAssets;
|
|
40
|
-
}
|
|
41
|
-
exports.getMissingAssetsAsync = getMissingAssetsAsync;
|
|
42
|
-
/**
|
|
43
|
-
* Reads and returns the embedded manifest (app.manifest) for a build.
|
|
44
|
-
*
|
|
45
|
-
* @param buildManifestPath Path to the build folder
|
|
46
|
-
* @param platform Either 'android' or 'ios'
|
|
47
|
-
* @param projectRoot The project root path
|
|
48
|
-
* @returns the JSON structure of the manifest
|
|
49
|
-
*/
|
|
50
|
-
async function getBuildManifestAsync(buildManifestPath) {
|
|
51
|
-
const buildManifestString = await fs_1.promises.readFile(buildManifestPath, { encoding: 'utf-8' });
|
|
52
|
-
const buildManifest = JSON.parse(buildManifestString);
|
|
53
|
-
return buildManifest;
|
|
54
|
-
}
|
|
55
|
-
exports.getBuildManifestAsync = getBuildManifestAsync;
|
|
56
|
-
/**
|
|
57
|
-
* Extracts the set of asset hashes from a build manifest.
|
|
58
|
-
*
|
|
59
|
-
* @param buildManifest The build manifest
|
|
60
|
-
* @returns The set of asset hashes contained in the build manifest
|
|
61
|
-
*/
|
|
62
|
-
function getBuildManifestHashSet(buildManifest) {
|
|
63
|
-
var _a;
|
|
64
|
-
return new Set(((_a = buildManifest.assets) !== null && _a !== void 0 ? _a : []).map((asset) => asset.packagerHash));
|
|
65
|
-
}
|
|
66
|
-
exports.getBuildManifestHashSet = getBuildManifestHashSet;
|
|
67
|
-
/**
|
|
68
|
-
* Reads and extracts the asset dump for an exported bundle.
|
|
69
|
-
*
|
|
70
|
-
* @param assetMapPath The path to the exported assetmap.json.
|
|
71
|
-
* @returns The asset dump as an object.
|
|
72
|
-
*/
|
|
73
|
-
async function getFullAssetDumpAsync(assetMapPath) {
|
|
74
|
-
const assetMapString = await fs_1.promises.readFile(assetMapPath, { encoding: 'utf-8' });
|
|
75
|
-
const assetMap = new Map(Object.entries(JSON.parse(assetMapString)));
|
|
76
|
-
return assetMap;
|
|
77
|
-
}
|
|
78
|
-
exports.getFullAssetDumpAsync = getFullAssetDumpAsync;
|
|
79
|
-
/**
|
|
80
|
-
* Extracts the set of asset hashes from an asset dump.
|
|
81
|
-
*
|
|
82
|
-
* @param assetDump
|
|
83
|
-
* @returns The set of asset hashes in the asset dump, and a map of hash to asset
|
|
84
|
-
*/
|
|
85
|
-
function getFullAssetDumpHashSet(assetDump) {
|
|
86
|
-
const fullAssetHashSet = new Set();
|
|
87
|
-
const fullAssetHashMap = new Map();
|
|
88
|
-
assetDump.forEach((asset) => asset.fileHashes.forEach((hash) => {
|
|
89
|
-
fullAssetHashSet.add(hash);
|
|
90
|
-
fullAssetHashMap.set(hash, asset);
|
|
91
|
-
}));
|
|
92
|
-
return {
|
|
93
|
-
fullAssetHashSet,
|
|
94
|
-
fullAssetHashMap,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
exports.getFullAssetDumpHashSet = getFullAssetDumpHashSet;
|
|
98
|
-
/**
|
|
99
|
-
* Reads and extracts the metadata.json from an exported bundle.
|
|
100
|
-
*
|
|
101
|
-
* @param exportedMetadataPath Path to the exported metadata.json.
|
|
102
|
-
* @returns The metadata of the bundle.
|
|
103
|
-
*/
|
|
104
|
-
async function getExportedMetadataAsync(exportedMetadataPath) {
|
|
105
|
-
const metadataString = await fs_1.promises.readFile(exportedMetadataPath, { encoding: 'utf-8' });
|
|
106
|
-
const metadata = JSON.parse(metadataString);
|
|
107
|
-
return metadata;
|
|
108
|
-
}
|
|
109
|
-
exports.getExportedMetadataAsync = getExportedMetadataAsync;
|
|
110
|
-
/**
|
|
111
|
-
* Extracts the set of asset hashes from an exported bundle's metadata for a given platform.
|
|
112
|
-
*
|
|
113
|
-
* @param metadata The metadata from the exported bundle
|
|
114
|
-
* @param platform Either 'android' or 'ios'
|
|
115
|
-
* @returns the set of asset hashes
|
|
116
|
-
*/
|
|
117
|
-
function getExportedMetadataHashSet(metadata, platform) {
|
|
118
|
-
var _a;
|
|
119
|
-
const fileMetadata = platform === 'android' ? metadata.fileMetadata.android : metadata.fileMetadata.ios;
|
|
120
|
-
if (!fileMetadata) {
|
|
121
|
-
throw new Error(`Exported bundle was not exported for platform ${platform}`);
|
|
122
|
-
}
|
|
123
|
-
const assets = (_a = fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.assets) !== null && _a !== void 0 ? _a : [];
|
|
124
|
-
// Asset paths in the export metadata are of the form 'assets/<hash string>'
|
|
125
|
-
return new Set(assets.map((asset) => asset.path.substring(7, asset.path.length)));
|
|
126
|
-
}
|
|
127
|
-
exports.getExportedMetadataHashSet = getExportedMetadataHashSet;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export declare const validPlatforms: string[];
|
|
2
|
-
export type Platform = (typeof validPlatforms)[number];
|
|
3
|
-
export declare const isValidPlatform: (p: any) => boolean;
|
|
4
|
-
export interface ValidatedOptions {
|
|
5
|
-
exportedManifestPath: string;
|
|
6
|
-
buildManifestPath: string;
|
|
7
|
-
assetMapPath: string;
|
|
8
|
-
platform: Platform;
|
|
9
|
-
}
|
|
10
|
-
export type FullAssetDumpEntry = {
|
|
11
|
-
files: string[];
|
|
12
|
-
hash: string;
|
|
13
|
-
name: string;
|
|
14
|
-
type: string;
|
|
15
|
-
fileHashes: string[];
|
|
16
|
-
};
|
|
17
|
-
export type FullAssetDump = Map<string, FullAssetDumpEntry>;
|
|
18
|
-
export type BuildManifestAsset = {
|
|
19
|
-
name: string;
|
|
20
|
-
type: string;
|
|
21
|
-
packagerHash: string;
|
|
22
|
-
};
|
|
23
|
-
export type BuildManifest = {
|
|
24
|
-
assets: BuildManifestAsset[];
|
|
25
|
-
} & {
|
|
26
|
-
[key: string]: any;
|
|
27
|
-
};
|
|
28
|
-
export type ExportedMetadataAsset = {
|
|
29
|
-
path: string;
|
|
30
|
-
ext: string;
|
|
31
|
-
};
|
|
32
|
-
export type FileMetadata = {
|
|
33
|
-
bundle: string;
|
|
34
|
-
assets: ExportedMetadataAsset[];
|
|
35
|
-
};
|
|
36
|
-
export type ExportedMetadata = {
|
|
37
|
-
fileMetadata: {
|
|
38
|
-
ios?: FileMetadata;
|
|
39
|
-
android?: FileMetadata;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export type MissingAsset = {
|
|
43
|
-
hash: string;
|
|
44
|
-
path: string;
|
|
45
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Types for the options passed into the command
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.isValidPlatform = exports.validPlatforms = void 0;
|
|
5
|
-
exports.validPlatforms = ['android', 'ios'];
|
|
6
|
-
const isValidPlatform = (p) => exports.validPlatforms.includes(p);
|
|
7
|
-
exports.isValidPlatform = isValidPlatform;
|
package/build-cli/cli.d.ts
DELETED
package/build-cli/cli.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const arg_1 = tslib_1.__importDefault(require("arg"));
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
8
|
-
const getenv_1 = require("getenv");
|
|
9
|
-
const Log = tslib_1.__importStar(require("./utils/log"));
|
|
10
|
-
// Setup before requiring `debug`.
|
|
11
|
-
if ((0, getenv_1.boolish)('EXPO_DEBUG', false)) {
|
|
12
|
-
debug_1.default.enable('expo-updates:*');
|
|
13
|
-
}
|
|
14
|
-
else if (debug_1.default.enabled('expo-updates:')) {
|
|
15
|
-
process.env.EXPO_DEBUG = '1';
|
|
16
|
-
}
|
|
17
|
-
const commands = {
|
|
18
|
-
// Add a new command here
|
|
19
|
-
'codesigning:generate': () => import('./generateCodeSigning.js').then((i) => i.generateCodeSigning),
|
|
20
|
-
'codesigning:configure': () => import('./configureCodeSigning.js').then((i) => i.configureCodeSigning),
|
|
21
|
-
'assets:verify': () => import('./assetsVerify.js').then((i) => i.expoAssetsVerify),
|
|
22
|
-
};
|
|
23
|
-
const args = (0, arg_1.default)({
|
|
24
|
-
// Types
|
|
25
|
-
'--help': Boolean,
|
|
26
|
-
// Aliases
|
|
27
|
-
'-h': '--help',
|
|
28
|
-
}, {
|
|
29
|
-
permissive: true,
|
|
30
|
-
});
|
|
31
|
-
const command = args._[0];
|
|
32
|
-
const commandArgs = args._.slice(1);
|
|
33
|
-
// Handle `--help` flag
|
|
34
|
-
if ((args['--help'] && !command) || !command) {
|
|
35
|
-
Log.exit((0, chalk_1.default) `
|
|
36
|
-
{bold Usage}
|
|
37
|
-
{dim $} npx expo-updates <command>
|
|
38
|
-
|
|
39
|
-
{bold Commands}
|
|
40
|
-
${Object.keys(commands).sort().join(', ')}
|
|
41
|
-
|
|
42
|
-
{bold Options}
|
|
43
|
-
--help, -h Displays this message
|
|
44
|
-
|
|
45
|
-
For more information run a command with the --help flag
|
|
46
|
-
{dim $} npx expo-updates codesigning:generate --help
|
|
47
|
-
`, 0);
|
|
48
|
-
}
|
|
49
|
-
// Push the help flag to the subcommand args.
|
|
50
|
-
if (args['--help']) {
|
|
51
|
-
commandArgs.push('--help');
|
|
52
|
-
}
|
|
53
|
-
// Install exit hooks
|
|
54
|
-
process.on('SIGINT', () => process.exit(0));
|
|
55
|
-
process.on('SIGTERM', () => process.exit(0));
|
|
56
|
-
commands[command]().then((exec) => exec(commandArgs));
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.configureCodeSigning = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const args_1 = require("./utils/args");
|
|
8
|
-
const Log = tslib_1.__importStar(require("./utils/log"));
|
|
9
|
-
const configureCodeSigning = async (argv) => {
|
|
10
|
-
const args = (0, args_1.assertArgs)({
|
|
11
|
-
// Types
|
|
12
|
-
'--help': Boolean,
|
|
13
|
-
'--certificate-input-directory': String,
|
|
14
|
-
'--key-input-directory': String,
|
|
15
|
-
'--keyid': String,
|
|
16
|
-
// Aliases
|
|
17
|
-
'-h': '--help',
|
|
18
|
-
}, argv !== null && argv !== void 0 ? argv : []);
|
|
19
|
-
if (args['--help']) {
|
|
20
|
-
Log.exit((0, chalk_1.default) `
|
|
21
|
-
{bold Description}
|
|
22
|
-
Configure expo-updates code signing for this project and verify setup
|
|
23
|
-
|
|
24
|
-
{bold Usage}
|
|
25
|
-
{dim $} npx expo-updates codesigning:configure --certificate-input-directory <dir> --key-input-directory <dir>
|
|
26
|
-
|
|
27
|
-
Options
|
|
28
|
-
--certificate-input-directory <string> Directory containing code signing certificate
|
|
29
|
-
--key-input-directory <string> Directory containing private and public keys
|
|
30
|
-
-h, --help Output usage information
|
|
31
|
-
`, 0);
|
|
32
|
-
}
|
|
33
|
-
const { configureCodeSigningAsync } = await import('./configureCodeSigningAsync.js');
|
|
34
|
-
const certificateInput = (0, args_1.requireArg)(args, '--certificate-input-directory');
|
|
35
|
-
const keyInput = (0, args_1.requireArg)(args, '--key-input-directory');
|
|
36
|
-
const keyid = args['--keyid'];
|
|
37
|
-
return await configureCodeSigningAsync((0, args_1.getProjectRoot)(args), {
|
|
38
|
-
certificateInput,
|
|
39
|
-
keyInput,
|
|
40
|
-
keyid,
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
exports.configureCodeSigning = configureCodeSigning;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configureCodeSigningAsync = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const code_signing_certificates_1 = require("@expo/code-signing-certificates");
|
|
6
|
-
const config_1 = require("@expo/config");
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
|
-
const log_1 = require("./utils/log");
|
|
10
|
-
const modifyConfigAsync_1 = require("./utils/modifyConfigAsync");
|
|
11
|
-
async function configureCodeSigningAsync(projectRoot, { certificateInput, keyInput, keyid }) {
|
|
12
|
-
const certificateInputDir = path_1.default.resolve(projectRoot, certificateInput);
|
|
13
|
-
const keyInputDir = path_1.default.resolve(projectRoot, keyInput);
|
|
14
|
-
const [certificatePEM, privateKeyPEM, publicKeyPEM] = await Promise.all([
|
|
15
|
-
fs_1.promises.readFile(path_1.default.join(certificateInputDir, 'certificate.pem'), 'utf8'),
|
|
16
|
-
fs_1.promises.readFile(path_1.default.join(keyInputDir, 'private-key.pem'), 'utf8'),
|
|
17
|
-
fs_1.promises.readFile(path_1.default.join(keyInputDir, 'public-key.pem'), 'utf8'),
|
|
18
|
-
]);
|
|
19
|
-
const certificate = (0, code_signing_certificates_1.convertCertificatePEMToCertificate)(certificatePEM);
|
|
20
|
-
const keyPair = (0, code_signing_certificates_1.convertKeyPairPEMToKeyPair)({ privateKeyPEM, publicKeyPEM });
|
|
21
|
-
(0, code_signing_certificates_1.validateSelfSignedCertificate)(certificate, keyPair);
|
|
22
|
-
const { exp } = (0, config_1.getConfig)(projectRoot, { skipSDKVersionRequirement: true });
|
|
23
|
-
const fields = {
|
|
24
|
-
codeSigningCertificate: `./${path_1.default.relative(projectRoot, certificateInputDir)}/certificate.pem`,
|
|
25
|
-
codeSigningMetadata: {
|
|
26
|
-
keyid: keyid !== null && keyid !== void 0 ? keyid : 'main',
|
|
27
|
-
alg: 'rsa-v1_5-sha256',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
await (0, modifyConfigAsync_1.attemptModification)(projectRoot, {
|
|
31
|
-
updates: {
|
|
32
|
-
...exp.updates,
|
|
33
|
-
...fields,
|
|
34
|
-
},
|
|
35
|
-
}, {
|
|
36
|
-
updates: {
|
|
37
|
-
...fields,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
(0, log_1.log)(`Code signing configuration written to app configuration.`);
|
|
41
|
-
}
|
|
42
|
-
exports.configureCodeSigningAsync = configureCodeSigningAsync;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.generateCodeSigning = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const args_1 = require("./utils/args");
|
|
8
|
-
const Log = tslib_1.__importStar(require("./utils/log"));
|
|
9
|
-
const generateCodeSigning = async (argv) => {
|
|
10
|
-
const args = (0, args_1.assertArgs)({
|
|
11
|
-
// Types
|
|
12
|
-
'--help': Boolean,
|
|
13
|
-
'--key-output-directory': String,
|
|
14
|
-
'--certificate-output-directory': String,
|
|
15
|
-
'--certificate-validity-duration-years': Number,
|
|
16
|
-
'--certificate-common-name': String,
|
|
17
|
-
// Aliases
|
|
18
|
-
'-h': '--help',
|
|
19
|
-
}, argv !== null && argv !== void 0 ? argv : []);
|
|
20
|
-
if (args['--help']) {
|
|
21
|
-
Log.exit((0, chalk_1.default) `
|
|
22
|
-
{bold Description}
|
|
23
|
-
Generate expo-updates private key, public key, and code signing certificate using that public key (self-signed by the private key)
|
|
24
|
-
|
|
25
|
-
{bold Usage}
|
|
26
|
-
{dim $} npx expo-updates codesigning:generate --key-output-directory <dir> --certificate-output-directory <dir> --certificate-validity-duration-years <num years> --certificate-common-name <name>
|
|
27
|
-
|
|
28
|
-
Options
|
|
29
|
-
--key-output-directory <string> Directory in which to put the generated private and public keys
|
|
30
|
-
--certificate-output-directory <string> Directory in which to put the generated certificate
|
|
31
|
-
--certificate-validity-duration-years <number> Certificate validity duration in years (number of years before certificate needs rotation)
|
|
32
|
-
--certificate-common-name <string> Common name attribute for certificate (generally the human readable name of the organization owning this application)
|
|
33
|
-
-h, --help Output usage information
|
|
34
|
-
`, 0);
|
|
35
|
-
}
|
|
36
|
-
const { generateCodeSigningAsync } = await import('./generateCodeSigningAsync.js');
|
|
37
|
-
const keyOutput = (0, args_1.requireArg)(args, '--key-output-directory');
|
|
38
|
-
const certificateOutput = (0, args_1.requireArg)(args, '--certificate-output-directory');
|
|
39
|
-
const certificateValidityDurationYears = (0, args_1.requireArg)(args, '--certificate-validity-duration-years');
|
|
40
|
-
const certificateCommonName = (0, args_1.requireArg)(args, '--certificate-common-name');
|
|
41
|
-
return await generateCodeSigningAsync((0, args_1.getProjectRoot)(args), {
|
|
42
|
-
certificateValidityDurationYears,
|
|
43
|
-
keyOutput,
|
|
44
|
-
certificateOutput,
|
|
45
|
-
certificateCommonName,
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
exports.generateCodeSigning = generateCodeSigning;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type Options = {
|
|
2
|
-
certificateValidityDurationYears: number;
|
|
3
|
-
keyOutput: string;
|
|
4
|
-
certificateOutput: string;
|
|
5
|
-
certificateCommonName: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function generateCodeSigningAsync(projectRoot: string, { certificateValidityDurationYears, keyOutput, certificateOutput, certificateCommonName }: Options): Promise<void>;
|
|
8
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateCodeSigningAsync = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const code_signing_certificates_1 = require("@expo/code-signing-certificates");
|
|
6
|
-
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
|
-
const dir_1 = require("./utils/dir");
|
|
10
|
-
const log_1 = require("./utils/log");
|
|
11
|
-
async function generateCodeSigningAsync(projectRoot, { certificateValidityDurationYears, keyOutput, certificateOutput, certificateCommonName }) {
|
|
12
|
-
const validityDurationYears = Math.floor(certificateValidityDurationYears);
|
|
13
|
-
const certificateOutputDir = path_1.default.resolve(projectRoot, certificateOutput);
|
|
14
|
-
const keyOutputDir = path_1.default.resolve(projectRoot, keyOutput);
|
|
15
|
-
await Promise.all([(0, dir_1.ensureDirAsync)(certificateOutputDir), (0, dir_1.ensureDirAsync)(keyOutputDir)]);
|
|
16
|
-
const [certificateOutputDirContents, keyOutputDirContents] = await Promise.all([
|
|
17
|
-
fs_1.promises.readdir(certificateOutputDir),
|
|
18
|
-
fs_1.promises.readdir(keyOutputDir),
|
|
19
|
-
]);
|
|
20
|
-
(0, assert_1.default)(certificateOutputDirContents.length === 0, 'Certificate output directory must be empty');
|
|
21
|
-
(0, assert_1.default)(keyOutputDirContents.length === 0, 'Key output directory must be empty');
|
|
22
|
-
const keyPair = (0, code_signing_certificates_1.generateKeyPair)();
|
|
23
|
-
const validityNotBefore = new Date();
|
|
24
|
-
const validityNotAfter = new Date();
|
|
25
|
-
validityNotAfter.setFullYear(validityNotAfter.getFullYear() + validityDurationYears);
|
|
26
|
-
const certificate = (0, code_signing_certificates_1.generateSelfSignedCodeSigningCertificate)({
|
|
27
|
-
keyPair,
|
|
28
|
-
validityNotBefore,
|
|
29
|
-
validityNotAfter,
|
|
30
|
-
commonName: certificateCommonName,
|
|
31
|
-
});
|
|
32
|
-
const keyPairPEM = (0, code_signing_certificates_1.convertKeyPairToPEM)(keyPair);
|
|
33
|
-
const certificatePEM = (0, code_signing_certificates_1.convertCertificateToCertificatePEM)(certificate);
|
|
34
|
-
await Promise.all([
|
|
35
|
-
fs_1.promises.writeFile(path_1.default.join(keyOutputDir, 'public-key.pem'), keyPairPEM.publicKeyPEM),
|
|
36
|
-
fs_1.promises.writeFile(path_1.default.join(keyOutputDir, 'private-key.pem'), keyPairPEM.privateKeyPEM),
|
|
37
|
-
fs_1.promises.writeFile(path_1.default.join(certificateOutputDir, 'certificate.pem'), certificatePEM),
|
|
38
|
-
]);
|
|
39
|
-
(0, log_1.log)(`Generated public and private keys output in ${keyOutputDir}. Remember to add them to .gitignore or to encrypt them. (e.g. with git-crypt)`);
|
|
40
|
-
(0, log_1.log)(`Generated code signing certificate output in ${certificateOutputDir}.`);
|
|
41
|
-
(0, log_1.log)(`To automatically configure this project for code signing, run \`yarn expo-updates codesigning:configure --certificate-input-directory=${certificateOutput} --key-input-directory=${keyOutput}\`.`);
|
|
42
|
-
}
|
|
43
|
-
exports.generateCodeSigningAsync = generateCodeSigningAsync;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import arg from 'arg';
|
|
2
|
-
/**
|
|
3
|
-
* Parse the first argument as a project directory.
|
|
4
|
-
*
|
|
5
|
-
* @returns valid project directory.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getProjectRoot(args: arg.Result<arg.Spec>): string;
|
|
8
|
-
/**
|
|
9
|
-
* Parse args and assert unknown options.
|
|
10
|
-
*
|
|
11
|
-
* @param schema the `args` schema for parsing the command line arguments.
|
|
12
|
-
* @param argv extra strings
|
|
13
|
-
* @returns processed args object.
|
|
14
|
-
*/
|
|
15
|
-
export declare function assertArgs(schema: arg.Spec, argv: string[]): arg.Result<arg.Spec>;
|
|
16
|
-
export declare function requireArg(args: arg.Result<arg.Spec>, name: any): any;
|
package/build-cli/utils/args.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.requireArg = exports.assertArgs = exports.getProjectRoot = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
// Common utilities for interacting with `args` library.
|
|
6
|
-
// These functions should be used by every command.
|
|
7
|
-
const arg_1 = tslib_1.__importDefault(require("arg"));
|
|
8
|
-
const fs_1 = require("fs");
|
|
9
|
-
const path_1 = require("path");
|
|
10
|
-
const Log = tslib_1.__importStar(require("./log"));
|
|
11
|
-
/**
|
|
12
|
-
* Parse the first argument as a project directory.
|
|
13
|
-
*
|
|
14
|
-
* @returns valid project directory.
|
|
15
|
-
*/
|
|
16
|
-
function getProjectRoot(args) {
|
|
17
|
-
const projectRoot = (0, path_1.resolve)(args._[0] || '.');
|
|
18
|
-
if (!(0, fs_1.existsSync)(projectRoot)) {
|
|
19
|
-
Log.exit(`Invalid project root: ${projectRoot}`);
|
|
20
|
-
}
|
|
21
|
-
return projectRoot;
|
|
22
|
-
}
|
|
23
|
-
exports.getProjectRoot = getProjectRoot;
|
|
24
|
-
/**
|
|
25
|
-
* Parse args and assert unknown options.
|
|
26
|
-
*
|
|
27
|
-
* @param schema the `args` schema for parsing the command line arguments.
|
|
28
|
-
* @param argv extra strings
|
|
29
|
-
* @returns processed args object.
|
|
30
|
-
*/
|
|
31
|
-
function assertArgs(schema, argv) {
|
|
32
|
-
try {
|
|
33
|
-
return (0, arg_1.default)(schema, { argv });
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
// Ensure unknown options are handled the same way.
|
|
37
|
-
if (error.code === 'ARG_UNKNOWN_OPTION') {
|
|
38
|
-
Log.exit(error.message, 1);
|
|
39
|
-
}
|
|
40
|
-
// Otherwise rethrow the error.
|
|
41
|
-
throw error;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.assertArgs = assertArgs;
|
|
45
|
-
function requireArg(args, name) {
|
|
46
|
-
const value = args[name];
|
|
47
|
-
if (value === undefined || value === null) {
|
|
48
|
-
Log.exit(`${name} must be provided`, 1);
|
|
49
|
-
}
|
|
50
|
-
return value;
|
|
51
|
-
}
|
|
52
|
-
exports.requireArg = requireArg;
|
package/build-cli/utils/dir.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ensureDirAsync(path: string): Promise<string | undefined>;
|
package/build-cli/utils/dir.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ensureDirAsync = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
function ensureDirAsync(path) {
|
|
6
|
-
return fs_1.promises.mkdir(path, { recursive: true });
|
|
7
|
-
}
|
|
8
|
-
exports.ensureDirAsync = ensureDirAsync;
|
package/build-cli/utils/log.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare function time(label?: string): void;
|
|
2
|
-
export declare function timeEnd(label?: string): void;
|
|
3
|
-
export declare function error(...message: string[]): void;
|
|
4
|
-
export declare function warn(...message: string[]): void;
|
|
5
|
-
export declare function log(...message: string[]): void;
|
|
6
|
-
/** Log a message and exit the current process. If the `code` is non-zero then `console.error` will be used instead of `console.log`. */
|
|
7
|
-
export declare function exit(message: string, code?: number): never;
|
package/build-cli/utils/log.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exit = exports.log = exports.warn = exports.error = exports.timeEnd = exports.time = void 0;
|
|
4
|
-
function time(label) {
|
|
5
|
-
console.time(label);
|
|
6
|
-
}
|
|
7
|
-
exports.time = time;
|
|
8
|
-
function timeEnd(label) {
|
|
9
|
-
console.timeEnd(label);
|
|
10
|
-
}
|
|
11
|
-
exports.timeEnd = timeEnd;
|
|
12
|
-
function error(...message) {
|
|
13
|
-
console.error(...message);
|
|
14
|
-
}
|
|
15
|
-
exports.error = error;
|
|
16
|
-
function warn(...message) {
|
|
17
|
-
console.warn(...message);
|
|
18
|
-
}
|
|
19
|
-
exports.warn = warn;
|
|
20
|
-
function log(...message) {
|
|
21
|
-
console.log(...message);
|
|
22
|
-
}
|
|
23
|
-
exports.log = log;
|
|
24
|
-
/** Log a message and exit the current process. If the `code` is non-zero then `console.error` will be used instead of `console.log`. */
|
|
25
|
-
function exit(message, code = 1) {
|
|
26
|
-
if (code === 0) {
|
|
27
|
-
log(message);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
error(message);
|
|
31
|
-
}
|
|
32
|
-
process.exit(code);
|
|
33
|
-
}
|
|
34
|
-
exports.exit = exit;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.attemptModification = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const config_1 = require("@expo/config");
|
|
6
|
-
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const Log = tslib_1.__importStar(require("./log"));
|
|
8
|
-
/** Wraps `[@expo/config] modifyConfigAsync()` and adds additional logging. */
|
|
9
|
-
async function attemptModification(projectRoot, edits, exactEdits) {
|
|
10
|
-
const modification = await (0, config_1.modifyConfigAsync)(projectRoot, edits, {
|
|
11
|
-
skipSDKVersionRequirement: true,
|
|
12
|
-
});
|
|
13
|
-
if (modification.type === 'success') {
|
|
14
|
-
Log.log();
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
warnAboutConfigAndThrow(modification.type, modification.message, exactEdits);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.attemptModification = attemptModification;
|
|
21
|
-
function logNoConfig() {
|
|
22
|
-
Log.log(chalk_1.default.yellow(`No Expo config was found. Please create an Expo config (${chalk_1.default.bold `app.json`} or ${chalk_1.default.bold `app.config.js`}) in your project root.`));
|
|
23
|
-
}
|
|
24
|
-
function warnAboutConfigAndThrow(type, message, edits) {
|
|
25
|
-
Log.log();
|
|
26
|
-
if (type === 'warn') {
|
|
27
|
-
// The project is using a dynamic config, give the user a helpful log and bail out.
|
|
28
|
-
Log.log(chalk_1.default.yellow(message));
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
logNoConfig();
|
|
32
|
-
}
|
|
33
|
-
notifyAboutManualConfigEdits(edits);
|
|
34
|
-
throw new Error();
|
|
35
|
-
}
|
|
36
|
-
function notifyAboutManualConfigEdits(edits) {
|
|
37
|
-
Log.log(chalk_1.default.cyan(`Please add the following to your Expo config`));
|
|
38
|
-
Log.log();
|
|
39
|
-
Log.log(JSON.stringify(edits, null, 2));
|
|
40
|
-
Log.log();
|
|
41
|
-
}
|