@expo/repack-app 0.1.6 → 0.1.7

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.
@@ -41,13 +41,18 @@ async function updateAndroidManifestAsync({ config, androidManiestXml, dexClasse
41
41
  findXmlNodes(nodeName, node, (nodeName, node) => nodeName === 'action' && node[0].$?.['android:name'] === 'android.intent.action.VIEW').length > 0);
42
42
  const firstScheme = Array.isArray(config.scheme) ? config.scheme[0] : config.scheme;
43
43
  for (const node of intentFilterViewActionNodes) {
44
- replaceXmlAttributeValue(node, (value) => value
44
+ replaceXmlAttributeValue(node, (value) => {
45
+ let newValue = value
46
+ // android.package in app.json
47
+ .replace(originalAppId, appId)
48
+ // default scheme generated from slug in app.json
49
+ .replace(/^exp\+.+$/g, `exp+${(0, utils_1.requireNotNull)(config.slug)}`);
45
50
  // scheme in app.json
46
- .replace(/^myapp$/g, (0, utils_1.requireNotNull)(firstScheme))
47
- // android.package in app.json
48
- .replace(originalAppId, appId)
49
- // default scheme generated from slug in app.json
50
- .replace(/^exp\+.+$/g, `exp+${(0, utils_1.requireNotNull)(config.slug)}`));
51
+ if (firstScheme) {
52
+ newValue = value.replace(/^myapp$/g, firstScheme);
53
+ }
54
+ return newValue;
55
+ });
51
56
  }
52
57
  // [2] expo-updates configuration
53
58
  const mainApplicationNode = androidManiestXml.manifest.application[0];
@@ -24,13 +24,16 @@ async function updateInfoPlistAsync({ config, infoPlistPath, originalAppId, opti
24
24
  for (const urlType of urlTypes) {
25
25
  if (Array.isArray(urlType.CFBundleURLSchemes)) {
26
26
  const schemes = urlType.CFBundleURLSchemes.map((scheme) => {
27
- return (scheme
28
- // scheme in app.json
29
- .replace(/^myapp$/g, (0, utils_1.requireNotNull)(firstScheme))
27
+ let newScheme = scheme
30
28
  // ios.bundleIdentifier in app.json
31
29
  .replace(originalAppId, bundleIdentifier)
32
30
  // default scheme generated from slug in app.json
33
- .replace(/^exp\+.+$/g, `exp+${(0, utils_1.requireNotNull)(config.slug)}`));
31
+ .replace(/^exp\+.+$/g, `exp+${(0, utils_1.requireNotNull)(config.slug)}`);
32
+ // scheme in app.json
33
+ if (firstScheme) {
34
+ newScheme = scheme.replace(/^myapp$/g, firstScheme);
35
+ }
36
+ return newScheme;
34
37
  });
35
38
  urlType.CFBundleURLSchemes = schemes;
36
39
  }
@@ -90,7 +93,9 @@ async function addBundleAssetsAsync({ appWorkingDirectory, assetRoot, bundleOutp
90
93
  await promises_1.default.copyFile(bundleOutputPath, node_path_1.default.join(appWorkingDirectory, 'main.jsbundle'));
91
94
  // export:embed --assets-dest on iOS uses the app root as target directory,
92
95
  // so we just need to copy the assets to the app root.
93
- await (0, utils_1.copyDirAsync)(assetRoot, appWorkingDirectory);
96
+ if (await (0, utils_1.directoryExistsAsync)(assetRoot)) {
97
+ await (0, utils_1.copyDirAsync)(assetRoot, appWorkingDirectory);
98
+ }
94
99
  }
95
100
  //#region Internals
96
101
  async function updateBinaryPlistAsync(plistPath, options, updater) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/repack-app",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Repacking tool for Expo apps",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",