@expo/repack-app 0.1.9 → 0.1.10

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.
@@ -12,8 +12,8 @@ const glob_1 = require("glob");
12
12
  const node_assert_1 = __importDefault(require("node:assert"));
13
13
  const promises_1 = __importDefault(require("node:fs/promises"));
14
14
  const node_path_1 = __importDefault(require("node:path"));
15
- const slugify_1 = __importDefault(require("slugify"));
16
15
  const utils_1 = require("../utils");
16
+ const xcode_utils_1 = require("./xcode-utils");
17
17
  /**
18
18
  * Extract the given iOS artifact and return the path to the .app directory.
19
19
  */
@@ -47,7 +47,7 @@ async function extractIosArtifactAsync(options) {
47
47
  */
48
48
  async function updateFilesAsync(config, appWorkingDirectory) {
49
49
  const { dir: parentDir, name } = node_path_1.default.parse(appWorkingDirectory);
50
- const sanitizedAppName = sanitizedName(config.name);
50
+ const sanitizedAppName = (0, xcode_utils_1.sanitizedName)(config.name);
51
51
  const newAppWorkingDirectory = node_path_1.default.join(parentDir, `${sanitizedAppName}.app`);
52
52
  // [0] Update the .app directory
53
53
  await promises_1.default.rename(node_path_1.default.join(parentDir, `${name}.app`), newAppWorkingDirectory);
@@ -108,16 +108,3 @@ end
108
108
  `;
109
109
  return fastfileContents.replace(/^\s*[\r\n]/gm, '');
110
110
  }
111
- /**
112
- * Synchronous logic as prebuild to sanitize the name of the app.
113
- */
114
- function sanitizedName(name) {
115
- // Default to the name `app` when every safe character has been sanitized
116
- return sanitizedNameForProjects(name) || sanitizedNameForProjects((0, slugify_1.default)(name)) || 'app';
117
- }
118
- function sanitizedNameForProjects(name) {
119
- return name
120
- .replace(/[\W_]+/g, '')
121
- .normalize('NFD')
122
- .replace(/[\u0300-\u036f]/g, '');
123
- }
@@ -12,6 +12,7 @@ const node_assert_1 = __importDefault(require("node:assert"));
12
12
  const promises_1 = __importDefault(require("node:fs/promises"));
13
13
  const node_path_1 = __importDefault(require("node:path"));
14
14
  const utils_1 = require("../utils");
15
+ const xcode_utils_1 = require("./xcode-utils");
15
16
  /**
16
17
  * Update the Info.plist file.
17
18
  */
@@ -42,7 +43,7 @@ async function updateInfoPlistAsync({ config, infoPlistPath, originalAppId, opti
42
43
  ...data,
43
44
  CFBundleDisplayName: config.name,
44
45
  CFBundleName: config.name,
45
- CFBundleExecutable: config.name,
46
+ CFBundleExecutable: (0, xcode_utils_1.sanitizedName)(config.name),
46
47
  CFBundleIdentifier: bundleIdentifier,
47
48
  };
48
49
  const userActivityTypes = data.NSUserActivityTypes?.map((activityType) => activityType.replace(originalAppId, bundleIdentifier));
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Synchronous logic as prebuild to sanitize the name of the app.
3
+ */
4
+ export declare function sanitizedName(name: string): string;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.sanitizedName = sanitizedName;
7
+ const slugify_1 = __importDefault(require("slugify"));
8
+ /**
9
+ * Synchronous logic as prebuild to sanitize the name of the app.
10
+ */
11
+ function sanitizedName(name) {
12
+ // Default to the name `app` when every safe character has been sanitized
13
+ return sanitizedNameForProjects(name) || sanitizedNameForProjects((0, slugify_1.default)(name)) || 'app';
14
+ }
15
+ function sanitizedNameForProjects(name) {
16
+ return name
17
+ .replace(/[\W_]+/g, '')
18
+ .normalize('NFD')
19
+ .replace(/[\u0300-\u036f]/g, '');
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/repack-app",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Repacking tool for Expo apps",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",