expo-updates 58.0.12 → 58.0.13
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 +8 -0
- package/android/build.gradle +2 -2
- package/cli/build/resolveRuntimeVersion.js +12 -1
- package/cli/build/resolveRuntimeVersion.js.map +1 -1
- package/cli/build/syncConfigurationToNative.js +12 -1
- package/cli/build/syncConfigurationToNative.js.map +1 -1
- package/cli/src/resolveRuntimeVersion.ts +4 -1
- package/cli/src/syncConfigurationToNative.ts +5 -1
- package/expo-updates-gradle-plugin/src/main/kotlin/expo/modules/updates/ExpoUpdatesPlugin.kt +1 -0
- package/package.json +7 -5
- package/scripts/create-updates-resources-ios.sh +3 -1
- package/utils/build/createManifestForBuildAsync.js +11 -15
- package/utils/build/createManifestForBuildAsync.js.map +1 -1
- package/utils/build/createUpdatesResources.js +12 -0
- package/utils/build/createUpdatesResources.js.map +1 -1
- package/utils/src/createManifestForBuildAsync.ts +4 -18
- package/utils/src/createUpdatesResources.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 58.0.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Resolve Android resource names and `drawable-*` folders with `@react-native/asset-utils`, matching how React Native resolves embedded assets at runtime. Scales outside the standard set map to a `drawable-<n>dpi` folder instead of failing the export, and assets referenced through `?unstable_path=` drop that prefix from their resource name. ([#50861](https://github.com/expo/expo/pull/50861) by [@huntie](https://github.com/huntie))
|
|
8
|
+
- Load app config and `.env` files in the native build's mode when generating Updates resources. ([#49452](https://github.com/expo/expo/pull/49452) by [@ramonclaudio](https://github.com/ramonclaudio))
|
|
9
|
+
- Load `.env` files in `runtimeversion:resolve` and `configuration:syncnative` before reading app config. ([#49508](https://github.com/expo/expo/pull/49508) by [@ramonclaudio](https://github.com/ramonclaudio))
|
|
10
|
+
|
|
3
11
|
## 58.0.12
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/android/build.gradle
CHANGED
|
@@ -42,7 +42,7 @@ expoModule {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
group = 'host.exp.exponent'
|
|
45
|
-
version = '58.0.
|
|
45
|
+
version = '58.0.13'
|
|
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
|
|
@@ -103,7 +103,7 @@ android {
|
|
|
103
103
|
namespace "expo.modules.updates"
|
|
104
104
|
defaultConfig {
|
|
105
105
|
versionCode 31
|
|
106
|
-
versionName '58.0.
|
|
106
|
+
versionName '58.0.13'
|
|
107
107
|
consumerProguardFiles("proguard-rules.pro")
|
|
108
108
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
109
109
|
|
|
@@ -9,6 +9,13 @@ Object.defineProperty(exports, "resolveRuntimeVersion", {
|
|
|
9
9
|
return resolveRuntimeVersion;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
function _env() {
|
|
13
|
+
const data = require("@expo/env");
|
|
14
|
+
_env = function() {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
12
19
|
function _chalk() {
|
|
13
20
|
const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
14
21
|
_chalk = function() {
|
|
@@ -109,7 +116,11 @@ Resolve expo-updates runtime version
|
|
|
109
116
|
const debug = args['--debug'];
|
|
110
117
|
const runtimeVersionInfo = await (0, _withConsoleDisabledAsync.withConsoleDisabledAsync)(async ()=>{
|
|
111
118
|
try {
|
|
112
|
-
|
|
119
|
+
const projectRoot = (0, _args.getProjectRoot)(args);
|
|
120
|
+
(0, _env().loadProjectEnv)(projectRoot, {
|
|
121
|
+
mode: (0, _env().consumeConfigEnvMode)() ?? 'production'
|
|
122
|
+
});
|
|
123
|
+
return await resolveRuntimeVersionAsync(projectRoot, platform, {
|
|
113
124
|
silent: true,
|
|
114
125
|
debug
|
|
115
126
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["resolveRuntimeVersion.ts"],"sourcesContent":[null],"names":["resolveRuntimeVersion","argv","args","assertArgs","Boolean","String","Log","exit","chalk","resolveRuntimeVersionAsync","platform","requireArg","includes","CommandError","workflow","debug","runtimeVersionInfo","withConsoleDisabledAsync","getProjectRoot","silent","workflowOverride","e","message","console","log","JSON","stringify"],"mappings":";;;;;+
|
|
1
|
+
{"version":3,"sources":["resolveRuntimeVersion.ts"],"sourcesContent":[null],"names":["resolveRuntimeVersion","argv","args","assertArgs","Boolean","String","Log","exit","chalk","resolveRuntimeVersionAsync","platform","requireArg","includes","CommandError","workflow","debug","runtimeVersionInfo","withConsoleDisabledAsync","projectRoot","getProjectRoot","loadProjectEnv","mode","consumeConfigEnvMode","silent","workflowOverride","e","message","console","log","JSON","stringify"],"mappings":";;;;;+BAUaA;;;eAAAA;;;;yBATwC;;;;;;;gEACnC;;;;;;sBAGqC;wBAC1B;6DACR;0CACoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,MAAMA,wBAAiC,OAAOC;IACnD,MAAMC,OAAOC,IAAAA,gBAAU,EACrB;QACE,QAAQ;QACR,UAAUC;QACV,cAAcC;QACd,cAAcA;QACd,WAAWD;QACX,UAAU;QACV,MAAM;IACR,GACAH,QAAQ,EAAE;IAGZ,IAAIC,IAAI,CAAC,SAAS,EAAE;QAClBI,KAAIC,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC;;;;;;;;;;;;IAYR,CAAC,EACC;IAEJ;IAEA,MAAM,EAAEC,0BAA0B,EAAE,GAClC,MAAM,MAAM,CAAC;IAEf,MAAMC,WAAWC,IAAAA,gBAAU,EAACT,MAAM;IAClC,IAAI,CAAC;QAAC;QAAO;KAAU,CAACU,QAAQ,CAACF,WAAW;QAC1C,MAAM,IAAIG,oBAAY,CAAC,CAAC,2BAA2B,EAAEH,UAAU;IACjE;IAEA,MAAMI,WAAWZ,IAAI,CAAC,aAAa;IACnC,IAAIY,YAAY,CAAC;QAAC;QAAW;KAAU,CAACF,QAAQ,CAACE,WAAW;QAC1D,MAAM,IAAID,oBAAY,CACpB,CAAC,2BAA2B,EAAEC,SAAS,uCAAuC,CAAC;IAEnF;IAEA,MAAMC,QAAQb,IAAI,CAAC,UAAU;IAE7B,MAAMc,qBAAqB,MAAMC,IAAAA,kDAAwB,EAAC;QACxD,IAAI;YACF,MAAMC,cAAcC,IAAAA,oBAAc,EAACjB;YACnCkB,IAAAA,qBAAc,EAACF,aAAa;gBAAEG,MAAMC,IAAAA,2BAAoB,OAAM;YAAa;YAC3E,OAAO,MAAMb,2BACXS,aACAR,UACA;gBACEa,QAAQ;gBACRR;YACF,GACA;gBACES,kBAAkBV;YACpB;QAEJ,EAAE,OAAOW,GAAQ;YACf,MAAM,IAAIZ,oBAAY,CAACY,EAAEC,OAAO;QAClC;IACF;IAEAC,QAAQC,GAAG,CAACC,KAAKC,SAAS,CAACd;AAC7B"}
|
|
@@ -9,6 +9,13 @@ Object.defineProperty(exports, "syncConfigurationToNative", {
|
|
|
9
9
|
return syncConfigurationToNative;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
function _env() {
|
|
13
|
+
const data = require("@expo/env");
|
|
14
|
+
_env = function() {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
12
19
|
function _chalk() {
|
|
13
20
|
const data = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
14
21
|
_chalk = function() {
|
|
@@ -104,8 +111,12 @@ only needs to be used by the EAS CLI for generic projects that don't use continu
|
|
|
104
111
|
].includes(workflow)) {
|
|
105
112
|
throw new _errors.CommandError(`Invalid workflow argument: ${workflow}. Must be either 'managed' or 'generic'`);
|
|
106
113
|
}
|
|
114
|
+
const projectRoot = (0, _args.getProjectRoot)(args);
|
|
115
|
+
(0, _env().loadProjectEnv)(projectRoot, {
|
|
116
|
+
mode: (0, _env().consumeConfigEnvMode)() ?? 'production'
|
|
117
|
+
});
|
|
107
118
|
await (0, _syncConfigurationToNativeAsync.syncConfigurationToNativeAsync)({
|
|
108
|
-
projectRoot
|
|
119
|
+
projectRoot,
|
|
109
120
|
platform,
|
|
110
121
|
workflow
|
|
111
122
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["syncConfigurationToNative.ts"],"sourcesContent":[null],"names":["syncConfigurationToNative","argv","args","assertArgs","Boolean","String","Log","exit","chalk","platform","requireArg","includes","CommandError","workflow","
|
|
1
|
+
{"version":3,"sources":["syncConfigurationToNative.ts"],"sourcesContent":[null],"names":["syncConfigurationToNative","argv","args","assertArgs","Boolean","String","Log","exit","chalk","platform","requireArg","includes","CommandError","workflow","projectRoot","getProjectRoot","loadProjectEnv","mode","consumeConfigEnvMode","syncConfigurationToNativeAsync"],"mappings":";;;;;+BAUaA;;;eAAAA;;;;yBATwC;;;;;;;gEACnC;;;;;;gDAG6B;sBACQ;wBAC1B;6DACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,MAAMA,4BAAqC,OAAOC;IACvD,MAAMC,OAAOC,IAAAA,gBAAU,EACrB;QACE,QAAQ;QACR,UAAUC;QACV,cAAcC;QACd,cAAcA;QACd,UAAU;QACV,MAAM;IACR,GACAJ,QAAQ,EAAE;IAGZ,IAAIC,IAAI,CAAC,SAAS,EAAE;QAClBI,KAAIC,IAAI,CACNC,IAAAA,gBAAK,CAAA,CAAC;;;;;;;;;;;;IAYR,CAAC,EACC;IAEJ;IAEA,MAAMC,WAAWC,IAAAA,gBAAU,EAACR,MAAM;IAClC,IAAI,CAAC;QAAC;QAAO;KAAU,CAACS,QAAQ,CAACF,WAAW;QAC1C,MAAM,IAAIG,oBAAY,CAAC,CAAC,2BAA2B,EAAEH,UAAU;IACjE;IAEA,MAAMI,WAAWH,IAAAA,gBAAU,EAACR,MAAM;IAClC,IAAI,CAAC;QAAC;QAAW;KAAU,CAACS,QAAQ,CAACE,WAAW;QAC9C,MAAM,IAAID,oBAAY,CACpB,CAAC,2BAA2B,EAAEC,SAAS,uCAAuC,CAAC;IAEnF;IAEA,MAAMC,cAAcC,IAAAA,oBAAc,EAACb;IACnCc,IAAAA,qBAAc,EAACF,aAAa;QAAEG,MAAMC,IAAAA,2BAAoB,OAAM;IAAa;IAE3E,MAAMC,IAAAA,8DAA8B,EAAC;QACnCL;QACAL;QACAI;IACF;AACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { consumeConfigEnvMode, loadProjectEnv } from '@expo/env';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
|
|
4
5
|
import { Command } from './cli';
|
|
@@ -59,8 +60,10 @@ Resolve expo-updates runtime version
|
|
|
59
60
|
|
|
60
61
|
const runtimeVersionInfo = await withConsoleDisabledAsync(async () => {
|
|
61
62
|
try {
|
|
63
|
+
const projectRoot = getProjectRoot(args);
|
|
64
|
+
loadProjectEnv(projectRoot, { mode: consumeConfigEnvMode() ?? 'production' });
|
|
62
65
|
return await resolveRuntimeVersionAsync(
|
|
63
|
-
|
|
66
|
+
projectRoot,
|
|
64
67
|
platform,
|
|
65
68
|
{
|
|
66
69
|
silent: true,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { consumeConfigEnvMode, loadProjectEnv } from '@expo/env';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
|
|
4
5
|
import { Command } from './cli';
|
|
@@ -51,8 +52,11 @@ only needs to be used by the EAS CLI for generic projects that don't use continu
|
|
|
51
52
|
);
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
const projectRoot = getProjectRoot(args);
|
|
56
|
+
loadProjectEnv(projectRoot, { mode: consumeConfigEnvMode() ?? 'production' });
|
|
57
|
+
|
|
54
58
|
await syncConfigurationToNativeAsync({
|
|
55
|
-
projectRoot
|
|
59
|
+
projectRoot,
|
|
56
60
|
platform,
|
|
57
61
|
workflow,
|
|
58
62
|
});
|
package/expo-updates-gradle-plugin/src/main/kotlin/expo/modules/updates/ExpoUpdatesPlugin.kt
CHANGED
|
@@ -83,6 +83,7 @@ abstract class ExpoUpdatesPlugin : Plugin<Project> {
|
|
|
83
83
|
add(assetDir.get().toString())
|
|
84
84
|
add(if (debuggableVariant.get()) "only-fingerprint" else "all")
|
|
85
85
|
add(entryFile.get())
|
|
86
|
+
add(if (debuggableVariant.get()) "development" else "production")
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-updates",
|
|
3
|
-
"version": "58.0.
|
|
3
|
+
"version": "58.0.13",
|
|
4
4
|
"description": "Fetches and manages remotely-hosted assets and updates to your app's JS bundle.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"expo",
|
|
@@ -45,8 +45,10 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@expo/code-signing-certificates": "^0.0.6",
|
|
48
|
+
"@expo/env": "^2.5.1",
|
|
48
49
|
"@expo/plist": "^0.10.1",
|
|
49
50
|
"@expo/spawn-async": "^1.8.0",
|
|
51
|
+
"@react-native/asset-utils": "0.88.0-rc.3",
|
|
50
52
|
"arg": "^4.1.0",
|
|
51
53
|
"chalk": "^4.1.2",
|
|
52
54
|
"debug": "^4.3.4",
|
|
@@ -61,8 +63,8 @@
|
|
|
61
63
|
"resolve-from": "^5.0.0"
|
|
62
64
|
},
|
|
63
65
|
"devDependencies": {
|
|
64
|
-
"@expo/metro-config": "58.0.
|
|
65
|
-
"@testing-library/react-native": "^
|
|
66
|
+
"@expo/metro-config": "58.0.7",
|
|
67
|
+
"@testing-library/react-native": "^14.0.1",
|
|
66
68
|
"@types/debug": "^4.1.7",
|
|
67
69
|
"@types/getenv": "^1.0.0",
|
|
68
70
|
"@types/jest": "^29.2.1",
|
|
@@ -71,8 +73,8 @@
|
|
|
71
73
|
"@types/picomatch": "^4.0.0",
|
|
72
74
|
"@types/react": "~19.3.0",
|
|
73
75
|
"@vercel/ncc": "^0.38.3",
|
|
74
|
-
"expo-dev-client": "58.0.
|
|
75
|
-
"expo-module-scripts": "56.0.
|
|
76
|
+
"expo-dev-client": "58.0.10",
|
|
77
|
+
"expo-module-scripts": "56.0.5",
|
|
76
78
|
"express": "^5.1.0",
|
|
77
79
|
"form-data": "^4.0.4",
|
|
78
80
|
"memfs": "^3.2.0",
|
|
@@ -50,5 +50,7 @@ else
|
|
|
50
50
|
exit 1
|
|
51
51
|
fi
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
CONFIG_MODE=$([[ "$CONFIGURATION" == *Debug* ]] && echo development || echo production)
|
|
54
|
+
|
|
55
|
+
"${EXPO_UPDATES_PACKAGE_DIR}/scripts/with-node.sh" "${EXPO_UPDATES_PACKAGE_DIR}/utils/build/createUpdatesResources.js" ios "$PROJECT_ROOT" "$RESOURCE_DEST" "$CREATE_UPDATES_RESOURCES_MODE" "$ENTRY_FILE" "$CONFIG_MODE"
|
|
54
56
|
|
|
@@ -8,6 +8,13 @@ Object.defineProperty(exports, "createManifestForBuildAsync", {
|
|
|
8
8
|
return createManifestForBuildAsync;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
function _assetutils() {
|
|
12
|
+
const data = require("@react-native/asset-utils");
|
|
13
|
+
_assetutils = function() {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
11
18
|
function _crypto() {
|
|
12
19
|
const data = /*#__PURE__*/ _interop_require_default(require("crypto"));
|
|
13
20
|
_crypto = function() {
|
|
@@ -102,7 +109,7 @@ async function createManifestForBuildAsync(platform, projectRoot, destinationDir
|
|
|
102
109
|
manifest.assets.push({
|
|
103
110
|
...baseAssetInfoForManifest,
|
|
104
111
|
scales: asset.scales,
|
|
105
|
-
resourcesFilename: getAndroidResourceIdentifier(asset),
|
|
112
|
+
resourcesFilename: (0, _assetutils().getAndroidResourceIdentifier)(asset),
|
|
106
113
|
resourcesFolder: getAndroidResourceFolderName(asset)
|
|
107
114
|
});
|
|
108
115
|
}
|
|
@@ -111,27 +118,16 @@ async function createManifestForBuildAsync(platform, projectRoot, destinationDir
|
|
|
111
118
|
_fs().default.writeFileSync(_path().default.join(destinationDir, 'app.manifest'), JSON.stringify(manifest));
|
|
112
119
|
}
|
|
113
120
|
function getAndroidResourceFolderName(asset) {
|
|
114
|
-
return
|
|
115
|
-
}
|
|
116
|
-
// copied from react-native/Libraries/Image/assetPathUtils.js
|
|
117
|
-
function getAndroidResourceIdentifier(asset) {
|
|
118
|
-
const folderPath = getBasePath(asset);
|
|
119
|
-
return (folderPath + '/' + asset.name).toLowerCase().replace(/\//g, '_') // Encode folder structure in file name
|
|
120
|
-
.replace(/([^a-z0-9_])/g, '') // Remove illegal chars
|
|
121
|
-
.replace(/^assets_/, ''); // Remove "assets_" prefix
|
|
121
|
+
return _assetutils().drawableFileTypes.has(asset.type) ? 'drawable' : 'raw';
|
|
122
122
|
}
|
|
123
123
|
function getIosDestinationDir(asset) {
|
|
124
124
|
// react-native-cli replaces `..` with `_` when embedding assets in the iOS app bundle
|
|
125
125
|
// https://github.com/react-native-community/cli/blob/0a93be1a42ed1fb05bb0ebf3b82d58b2dd920614/packages/cli/src/commands/bundle/getAssetDestPathIOS.ts
|
|
126
126
|
return getBasePath(asset).replace(/\.\.\//g, '_');
|
|
127
127
|
}
|
|
128
|
-
// copied from react-native/Libraries/Image/assetPathUtils.js
|
|
129
128
|
function getBasePath(asset) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
basePath = basePath.substr(1);
|
|
133
|
-
}
|
|
134
|
-
return basePath;
|
|
129
|
+
const basePath = asset.httpServerLocation;
|
|
130
|
+
return basePath.startsWith('/') ? basePath.slice(1) : basePath;
|
|
135
131
|
}
|
|
136
132
|
|
|
137
133
|
//# sourceMappingURL=createManifestForBuildAsync.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["createManifestForBuildAsync.ts"],"sourcesContent":[null],"names":["createManifestForBuildAsync","platform","projectRoot","destinationDir","entryFileArg","entryFile","process","env","ENTRY_FILE","resolveEntryPoint","chdir","options","minify","dev","CONFIGURATION","sourcemapUseAbsolutePath","resetCache","server","bundleRequest","createMetroServerAndBundleRequestAsync","assets","exportEmbedAssetsAsync","e","Error","message","end","manifest","id","crypto","randomUUID","commitTime","Date","getTime","forEach","asset","fileHashes","platformScales","Set","filterPlatformAssetScales","scales","scale","index","has","baseAssetInfoForManifest","name","type","packagerHash","subdirectory","httpServerLocation","push","nsBundleDir","getIosDestinationDir","nsBundleFilename","resourcesFilename","getAndroidResourceIdentifier","resourcesFolder","getAndroidResourceFolderName","fs","writeFileSync","path","join","JSON","stringify","drawableFileTypes","
|
|
1
|
+
{"version":3,"sources":["createManifestForBuildAsync.ts"],"sourcesContent":[null],"names":["createManifestForBuildAsync","platform","projectRoot","destinationDir","entryFileArg","entryFile","process","env","ENTRY_FILE","resolveEntryPoint","chdir","options","minify","dev","CONFIGURATION","sourcemapUseAbsolutePath","resetCache","server","bundleRequest","createMetroServerAndBundleRequestAsync","assets","exportEmbedAssetsAsync","e","Error","message","end","manifest","id","crypto","randomUUID","commitTime","Date","getTime","forEach","asset","fileHashes","platformScales","Set","filterPlatformAssetScales","scales","scale","index","has","baseAssetInfoForManifest","name","type","packagerHash","subdirectory","httpServerLocation","push","nsBundleDir","getIosDestinationDir","nsBundleFilename","resourcesFilename","getAndroidResourceIdentifier","resourcesFolder","getAndroidResourceFolderName","fs","writeFileSync","path","join","JSON","stringify","drawableFileTypes","getBasePath","replace","basePath","startsWith","slice"],"mappings":";;;;+BAcsBA;;;eAAAA;;;;yBAb0C;;;;;;;gEAC7C;;;;;;;yBAEe;;;;;;;yBAI3B;;;;;;;gEACQ;;;;;;;gEACE;;;;;;2CAEyB;;;;;;AAEnC,eAAeA,4BACpBC,QAA2B,EAC3BC,WAAmB,EACnBC,cAAsB,EACtBC,YAAqB;IAErB,MAAMC,YACJD,gBACAE,QAAQC,GAAG,CAACC,UAAU,IACtBC,IAAAA,0BAAiB,EAACP,aAAa;QAAED;IAAS,MAC1C;IAEFK,QAAQI,KAAK,CAACR;IAEd,MAAMS,UAAU;QACdV;QACAI;QACAO,QAAQ;QACRC,KAAKP,QAAQC,GAAG,CAACO,aAAa,KAAK;QACnCC,0BAA0B;QAC1BC,YAAY;IACd;IAEA,MAAM,EAAEC,MAAM,EAAEC,aAAa,EAAE,GAAG,MAAMC,IAAAA,uEAAsC,EAC5EjB,aACAS;IAGF,IAAIS;IACJ,IAAI;QACFA,SAAS,MAAMC,IAAAA,uDAAsB,EAACJ,QAAQC,eAAehB,aAAaS;IAC5E,EAAE,OAAOW,GAAQ;QACf,MAAM,IAAIC,MACR,iHACED,EAAEE,OAAO;IAEf,SAAU;QACRP,OAAOQ,GAAG;IACZ;IAEA,MAAMC,WAA6B;QACjCC,IAAIC,iBAAM,CAACC,UAAU;QACrBC,YAAY,IAAIC,OAAOC,OAAO;QAC9BZ,QAAQ,EAAE;IACZ;IAEAA,OAAOa,OAAO,CAAC,SAAUC,KAAK;QAC5B,IAAI,CAACA,MAAMC,UAAU,EAAE;YACrB,MAAM,IAAIZ,MACR;QAEJ;QACA,MAAMa,iBAAiB,IAAIC,IAAIC,IAAAA,oDAAyB,EAACrC,UAAUiC,MAAMK,MAAM;QAC/EL,MAAMK,MAAM,CAACN,OAAO,CAAC,SAAUO,KAAK,EAAEC,KAAK;YACzC,IAAI,CAACL,eAAeM,GAAG,CAACF,QAAQ;gBAC9B;YACF;YACA,MAAMG,2BAA2B;gBAC/BC,MAAMV,MAAMU,IAAI;gBAChBC,MAAMX,MAAMW,IAAI;gBAChBL;gBACAM,cAAcZ,MAAMC,UAAU,CAACM,MAAM;gBACrCM,cAAcb,MAAMc,kBAAkB;YACxC;YACA,IAAI/C,aAAa,OAAO;gBACtByB,SAASN,MAAM,CAAC6B,IAAI,CAAC;oBACnB,GAAGN,wBAAwB;oBAC3BO,aAAaC,qBAAqBjB;oBAClCkB,kBAAkBZ,UAAU,IAAIN,MAAMU,IAAI,GAAGV,MAAMU,IAAI,GAAG,MAAMJ,QAAQ;gBAC1E;YACF,OAAO,IAAIvC,aAAa,WAAW;gBACjCyB,SAASN,MAAM,CAAC6B,IAAI,CAAC;oBACnB,GAAGN,wBAAwB;oBAC3BJ,QAAQL,MAAMK,MAAM;oBACpBc,mBAAmBC,IAAAA,0CAA4B,EAACpB;oBAChDqB,iBAAiBC,6BAA6BtB;gBAChD;YACF;QACF;IACF;IAEAuB,aAAE,CAACC,aAAa,CAACC,eAAI,CAACC,IAAI,CAACzD,gBAAgB,iBAAiB0D,KAAKC,SAAS,CAACpC;AAC7E;AAEA,SAAS8B,6BAA6BtB,KAAsB;IAC1D,OAAO6B,+BAAiB,CAACrB,GAAG,CAACR,MAAMW,IAAI,IAAI,aAAa;AAC1D;AAEA,SAASM,qBAAqBjB,KAAsB;IAClD,sFAAsF;IACtF,sJAAsJ;IACtJ,OAAO8B,YAAY9B,OAAO+B,OAAO,CAAC,WAAW;AAC/C;AAEA,SAASD,YAAY9B,KAAsB;IACzC,MAAMgC,WAAWhC,MAAMc,kBAAkB;IACzC,OAAOkB,SAASC,UAAU,CAAC,OAAOD,SAASE,KAAK,CAAC,KAAKF;AACxD"}
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
function _env() {
|
|
6
|
+
const data = require("@expo/env");
|
|
7
|
+
_env = function() {
|
|
8
|
+
return data;
|
|
9
|
+
};
|
|
10
|
+
return data;
|
|
11
|
+
}
|
|
5
12
|
function _assert() {
|
|
6
13
|
const data = /*#__PURE__*/ _interop_require_default(require("assert"));
|
|
7
14
|
_assert = function() {
|
|
@@ -39,6 +46,11 @@ function _interop_require_default(obj) {
|
|
|
39
46
|
throw new Error(`Unsupported createUpdatesResourcesMode: ${createUpdatesResourcesMode}`);
|
|
40
47
|
}
|
|
41
48
|
const entryFileArg = process.argv[6];
|
|
49
|
+
const mode = process.argv[7];
|
|
50
|
+
process.env = (0, _env().getOriginalEnv)();
|
|
51
|
+
(0, _env().logLoadedEnv)((0, _env().loadProjectEnv)(possibleProjectRoot, {
|
|
52
|
+
mode
|
|
53
|
+
}));
|
|
42
54
|
await Promise.all([
|
|
43
55
|
createUpdatesResourcesMode === 'all' ? (0, _createManifestForBuildAsync.createManifestForBuildAsync)(platform, possibleProjectRoot, destinationDir, entryFileArg) : null,
|
|
44
56
|
(0, _createFingerprintForBuildAsync.createFingerprintForBuildAsync)(platform, possibleProjectRoot, destinationDir)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["createUpdatesResources.ts"],"sourcesContent":[null],"names":["platform","process","argv","includes","Error","projectRootArg","assert","possibleProjectRoot","findUpProjectRoot","destinationDir","createUpdatesResourcesMode","entryFileArg","Promise","all","createManifestForBuildAsync","createFingerprintForBuildAsync","catch","e","message","console","error","exit"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"sources":["createUpdatesResources.ts"],"sourcesContent":[null],"names":["platform","process","argv","includes","Error","projectRootArg","assert","possibleProjectRoot","findUpProjectRoot","destinationDir","createUpdatesResourcesMode","entryFileArg","mode","env","getOriginalEnv","logLoadedEnv","loadProjectEnv","Promise","all","createManifestForBuildAsync","createFingerprintForBuildAsync","catch","e","message","console","error","exit"],"mappings":";;;;;yBAA6D;;;;;;;gEAC1C;;;;;;gDAE4B;6CACH;mCACV;;;;;;AAEjC,CAAA;IACC,MAAMA,WAAWC,QAAQC,IAAI,CAAC,EAAE;IAChC,IAAI,CAAC;QAAC;QAAO;KAAU,CAACC,QAAQ,CAACH,WAAW;QAC1C,MAAM,IAAII,MAAM,CAAC,sBAAsB,EAAEJ,UAAU;IACrD;IAEA,MAAMK,iBAAiBJ,QAAQC,IAAI,CAAC,EAAE;IACtCI,IAAAA,iBAAM,EAACD,gBAAgB;IAEvB,MAAME,sBAAsBC,IAAAA,oCAAiB,EAACH;IAC9CC,IAAAA,iBAAM,EAACC,qBAAqB;IAE5B,MAAME,iBAAiBR,QAAQC,IAAI,CAAC,EAAE;IACtCI,IAAAA,iBAAM,EAACG,gBAAgB;IAEvB,MAAMC,6BAA6BT,QAAQC,IAAI,CAAC,EAAE;IAElD,IACEQ,8BAA8B,QAC9B,CAAC;QAAC;QAAO;KAAmB,CAACP,QAAQ,CAACO,6BACtC;QACA,MAAM,IAAIN,MAAM,CAAC,wCAAwC,EAAEM,4BAA4B;IACzF;IAEA,MAAMC,eAAeV,QAAQC,IAAI,CAAC,EAAE;IACpC,MAAMU,OAAOX,QAAQC,IAAI,CAAC,EAAE;IAE5BD,QAAQY,GAAG,GAAGC,IAAAA,qBAAc;IAC5BC,IAAAA,mBAAY,EAACC,IAAAA,qBAAc,EAACT,qBAAqB;QAAEK;IAAK;IAExD,MAAMK,QAAQC,GAAG,CAAC;QAChBR,+BAA+B,QAC3BS,IAAAA,wDAA2B,EAACnB,UAAUO,qBAAqBE,gBAAgBE,gBAC3E;QACJS,IAAAA,8DAA8B,EAACpB,UAAUO,qBAAqBE;KAC/D;AACH,CAAA,IAAKY,KAAK,CAAC,CAACC;IACV,8FAA8F;IAC9FA,EAAEC,OAAO,GAAG,CAAC,2BAA2B,EAAED,EAAEC,OAAO,CAAC,2BAA2B,CAAC;IAChFC,QAAQC,KAAK,CAACH;IACdrB,QAAQyB,IAAI,CAAC;AACf"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { HashedAssetData } from '@expo/metro-config/build/transform-worker/getAssets';
|
|
2
|
+
import { drawableFileTypes, getAndroidResourceIdentifier } from '@react-native/asset-utils';
|
|
2
3
|
import crypto from 'crypto';
|
|
3
4
|
import type { EmbeddedManifest } from 'expo-manifests';
|
|
4
5
|
import { resolveEntryPoint } from 'expo/config/paths';
|
|
5
6
|
import {
|
|
6
|
-
drawableFileTypes,
|
|
7
7
|
createMetroServerAndBundleRequestAsync,
|
|
8
8
|
exportEmbedAssetsAsync,
|
|
9
9
|
} from 'expo/internal/unstable-expo-updates-cli-exports';
|
|
@@ -97,17 +97,7 @@ export async function createManifestForBuildAsync(
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
function getAndroidResourceFolderName(asset: HashedAssetData) {
|
|
100
|
-
return
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// copied from react-native/Libraries/Image/assetPathUtils.js
|
|
104
|
-
function getAndroidResourceIdentifier(asset: HashedAssetData) {
|
|
105
|
-
const folderPath = getBasePath(asset);
|
|
106
|
-
return (folderPath + '/' + asset.name)
|
|
107
|
-
.toLowerCase()
|
|
108
|
-
.replace(/\//g, '_') // Encode folder structure in file name
|
|
109
|
-
.replace(/([^a-z0-9_])/g, '') // Remove illegal chars
|
|
110
|
-
.replace(/^assets_/, ''); // Remove "assets_" prefix
|
|
100
|
+
return drawableFileTypes.has(asset.type) ? 'drawable' : 'raw';
|
|
111
101
|
}
|
|
112
102
|
|
|
113
103
|
function getIosDestinationDir(asset: HashedAssetData) {
|
|
@@ -116,11 +106,7 @@ function getIosDestinationDir(asset: HashedAssetData) {
|
|
|
116
106
|
return getBasePath(asset).replace(/\.\.\//g, '_');
|
|
117
107
|
}
|
|
118
108
|
|
|
119
|
-
// copied from react-native/Libraries/Image/assetPathUtils.js
|
|
120
109
|
function getBasePath(asset: HashedAssetData) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
basePath = basePath.substr(1);
|
|
124
|
-
}
|
|
125
|
-
return basePath;
|
|
110
|
+
const basePath = asset.httpServerLocation;
|
|
111
|
+
return basePath.startsWith('/') ? basePath.slice(1) : basePath;
|
|
126
112
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getOriginalEnv, loadProjectEnv, logLoadedEnv } from '@expo/env';
|
|
1
2
|
import assert from 'assert';
|
|
2
3
|
|
|
3
4
|
import { createFingerprintForBuildAsync } from './createFingerprintForBuildAsync';
|
|
@@ -29,6 +30,10 @@ import { findUpProjectRoot } from './findUpProjectRoot';
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
const entryFileArg = process.argv[6];
|
|
33
|
+
const mode = process.argv[7];
|
|
34
|
+
|
|
35
|
+
process.env = getOriginalEnv();
|
|
36
|
+
logLoadedEnv(loadProjectEnv(possibleProjectRoot, { mode }));
|
|
32
37
|
|
|
33
38
|
await Promise.all([
|
|
34
39
|
createUpdatesResourcesMode === 'all'
|