@expo/repack-app 0.0.4 → 0.0.5

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.
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.findLatestBuildToolsDirAsync = exports.createResignedApkAsync = exports.createBinaryBasedResourcesAsync = exports.createProtoBasedResourcesAsync = exports.getAndroidBuildToolsAsync = void 0;
7
- const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
7
+ const steps_1 = require("@expo/steps");
8
8
  const glob_1 = require("glob");
9
9
  const node_assert_1 = __importDefault(require("node:assert"));
10
10
  const promises_1 = __importDefault(require("node:fs/promises"));
@@ -33,12 +33,8 @@ async function createProtoBasedResourcesAsync(options) {
33
33
  const { sourceAppPath, workingDirectory } = options;
34
34
  const { aapt2Path } = await getAndroidBuildToolsAsync(options);
35
35
  const protoApkPath = node_path_1.default.join(workingDirectory, 'proto.apk');
36
- await (0, spawn_async_1.default)(aapt2Path, ['convert', '-o', protoApkPath, '--output-format', 'proto', '--keep-raw-values', sourceAppPath], {
37
- stdio: options.verbose ? 'inherit' : 'ignore',
38
- });
39
- await (0, spawn_async_1.default)('unzip', [protoApkPath, '-d', workingDirectory], {
40
- stdio: options.verbose ? 'inherit' : 'ignore',
41
- });
36
+ await (0, steps_1.spawnAsync)(aapt2Path, ['convert', '-o', protoApkPath, '--output-format', 'proto', '--keep-raw-values', sourceAppPath], options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
37
+ await (0, steps_1.spawnAsync)('unzip', [protoApkPath, '-d', workingDirectory], options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
42
38
  const removeFiles = await (0, glob_1.glob)('**/*', {
43
39
  cwd: workingDirectory,
44
40
  maxDepth: 1,
@@ -60,11 +56,10 @@ async function createBinaryBasedResourcesAsync(options) {
60
56
  const { aapt2Path } = await getAndroidBuildToolsAsync(options);
61
57
  const protoUpdatedApkPath = node_path_1.default.join(workingDirectory, 'proto-updated.apk');
62
58
  const binaryApkPath = node_path_1.default.join(workingDirectory, 'binary.apk');
63
- await (0, spawn_async_1.default)('zip', ['-r', '-0', protoUpdatedApkPath, 'resources.pb', 'AndroidManifest.xml', 'res'], {
64
- cwd: workingDirectory,
65
- stdio: options.verbose ? 'inherit' : 'ignore',
66
- });
67
- await (0, spawn_async_1.default)(aapt2Path, [
59
+ await (0, steps_1.spawnAsync)('zip', ['-r', '-0', protoUpdatedApkPath, 'resources.pb', 'AndroidManifest.xml', 'res'], options.verbose
60
+ ? { logger: options.logger, stdio: 'pipe', cwd: workingDirectory }
61
+ : { cwd: workingDirectory });
62
+ await (0, steps_1.spawnAsync)(aapt2Path, [
68
63
  'convert',
69
64
  '-o',
70
65
  binaryApkPath,
@@ -72,9 +67,7 @@ async function createBinaryBasedResourcesAsync(options) {
72
67
  'binary',
73
68
  '--keep-raw-values',
74
69
  protoUpdatedApkPath,
75
- ], {
76
- stdio: options.verbose ? 'inherit' : 'ignore',
77
- });
70
+ ], options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
78
71
  return binaryApkPath;
79
72
  }
80
73
  exports.createBinaryBasedResourcesAsync = createBinaryBasedResourcesAsync;
@@ -91,24 +84,16 @@ async function createResignedApkAsync(binaryApkPath, appConfigPath, options, sig
91
84
  const resignedApkPath = node_path_1.default.join(workingDirectory, 'resigned.apk');
92
85
  const resignedApkUnalignedPath = node_path_1.default.join(workingDirectory, 'resigned-unaligned.apk');
93
86
  await promises_1.default.mkdir(unzipWorkingDirectory, { recursive: true });
94
- await (0, spawn_async_1.default)('unzip', [options.sourceAppPath, '-d', unzipWorkingDirectory], {
95
- stdio: options.verbose ? 'inherit' : 'ignore',
96
- });
97
- await (0, spawn_async_1.default)('unzip', ['-o', binaryApkPath, '-d', unzipWorkingDirectory], {
98
- stdio: options.verbose ? 'inherit' : 'ignore',
99
- });
87
+ await (0, steps_1.spawnAsync)('unzip', [options.sourceAppPath, '-d', unzipWorkingDirectory], options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
88
+ await (0, steps_1.spawnAsync)('unzip', ['-o', binaryApkPath, '-d', unzipWorkingDirectory], options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
100
89
  await promises_1.default.copyFile(appConfigPath, node_path_1.default.join(unzipWorkingDirectory, 'assets', 'app.config'));
101
- await (0, spawn_async_1.default)('zip', ['-r', '-0', resignedApkUnalignedPath, 'lib', 'resources.arsc'], {
102
- cwd: unzipWorkingDirectory,
103
- stdio: options.verbose ? 'inherit' : 'ignore',
104
- });
105
- await (0, spawn_async_1.default)('zip', ['-r', resignedApkUnalignedPath, '.', '-x', 'lib/*', '-x', 'resources.arsc'], {
106
- cwd: unzipWorkingDirectory,
107
- stdio: options.verbose ? 'inherit' : 'ignore',
108
- });
109
- await (0, spawn_async_1.default)(zipalignPath, ['-v', '-p', '4', resignedApkUnalignedPath, resignedApkPath], {
110
- stdio: options.verbose ? 'inherit' : 'ignore',
111
- });
90
+ await (0, steps_1.spawnAsync)('zip', ['-r', '-0', resignedApkUnalignedPath, 'lib', 'resources.arsc'], options.verbose
91
+ ? { logger: options.logger, stdio: 'pipe', cwd: unzipWorkingDirectory }
92
+ : { cwd: unzipWorkingDirectory });
93
+ await (0, steps_1.spawnAsync)('zip', ['-r', resignedApkUnalignedPath, '.', '-x', 'lib/*', '-x', 'resources.arsc'], options.verbose
94
+ ? { logger: options.logger, stdio: 'pipe', cwd: unzipWorkingDirectory }
95
+ : { cwd: unzipWorkingDirectory });
96
+ await (0, steps_1.spawnAsync)(zipalignPath, ['-v', '-p', '4', resignedApkUnalignedPath, resignedApkPath], options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
112
97
  const signerArgs = [
113
98
  'sign',
114
99
  '--ks',
@@ -123,9 +108,7 @@ async function createResignedApkAsync(binaryApkPath, appConfigPath, options, sig
123
108
  signerArgs.push('--key-pass', signingOptions.keyPassword);
124
109
  }
125
110
  signerArgs.push(resignedApkPath);
126
- await (0, spawn_async_1.default)(apksignerPath, signerArgs, {
127
- stdio: options.verbose ? 'inherit' : 'ignore',
128
- });
111
+ await (0, steps_1.spawnAsync)(apksignerPath, signerArgs, options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
129
112
  return resignedApkPath;
130
113
  }
131
114
  exports.createResignedApkAsync = createResignedApkAsync;
@@ -11,37 +11,36 @@ const picocolors_1 = __importDefault(require("picocolors"));
11
11
  const build_tools_1 = require("./build-tools");
12
12
  const resources_1 = require("./resources");
13
13
  const expo_1 = require("../expo");
14
- const log_1 = __importDefault(require("../log"));
15
14
  const utils_1 = require("../utils");
16
15
  /**
17
16
  * Repack an Android app.
18
17
  */
19
18
  async function repackAppAndroidAsync(_options) {
20
19
  const options = await (0, utils_1.normalizeOptionAsync)(_options);
21
- const { workingDirectory } = options;
20
+ const { workingDirectory, logger } = options;
22
21
  await promises_1.default.mkdir(workingDirectory, { recursive: true });
23
22
  const { exp } = (0, config_1.getConfig)(options.projectRoot, {
24
23
  isPublicConfig: true,
25
24
  skipSDKVersionRequirement: true,
26
25
  });
27
26
  const updatesRuntimeVersion = await (0, expo_1.resolveRuntimeVersionAsync)(options, exp);
28
- log_1.default.log(picocolors_1.default.dim(`Resolved runtime version: ${updatesRuntimeVersion}`));
29
- log_1.default.time(`Unzipping APK and creating proto based resources`);
27
+ logger.info(picocolors_1.default.dim(`Resolved runtime version: ${updatesRuntimeVersion}`));
28
+ logger.info(`Unzipping APK and creating proto based resources`);
30
29
  const { androidManiestFilePath, resourcesPbFilePath } = await (0, build_tools_1.createProtoBasedResourcesAsync)(options);
31
- log_1.default.timeEnd(`Unzipping APK and creating proto based resources`);
32
- log_1.default.time(`Updating Androidmanifest.xml`);
30
+ logger.info(`Finished unzipping APK and creating proto based resources ✅`);
31
+ logger.info(`Updating Androidmanifest.xml`);
33
32
  await (0, resources_1.updateAndroidManifestAsync)(exp, androidManiestFilePath, options, updatesRuntimeVersion);
34
- log_1.default.timeEnd(`Updating Androidmanifest.xml`);
35
- log_1.default.time(`Updating resources.pb`);
33
+ logger.info(`Finished updating Androidmanifest.xml ✅`);
34
+ logger.info(`Updating resources.pb`);
36
35
  await (0, resources_1.updateResourcesAsync)(exp, resourcesPbFilePath);
37
- log_1.default.timeEnd(`Updating resources.pb`);
38
- log_1.default.time(`Creating binary based resources`);
36
+ logger.info(`Finished updating resources.pb ✅`);
37
+ logger.info(`Creating binary based resources`);
39
38
  const binaryApkPath = await (0, build_tools_1.createBinaryBasedResourcesAsync)(options);
40
- log_1.default.timeEnd(`Creating binary based resources`);
41
- log_1.default.time(`Generating app.config`);
39
+ logger.info(`Finished creating binary based resources ✅`);
40
+ logger.info(`Generating app config`);
42
41
  const appConfigPath = await (0, expo_1.generateAppConfigAsync)(options, exp);
43
- log_1.default.timeEnd(`Generating app.config`);
44
- log_1.default.time(`Creating updated apk`);
42
+ logger.info(`Finished generating app config ✅`);
43
+ logger.info(`Creating updated apk`);
45
44
  const outputApk = await (0, build_tools_1.createResignedApkAsync)(binaryApkPath, appConfigPath, options, {
46
45
  keyStorePath: options.androidSigningOptions?.keyStorePath ??
47
46
  node_path_1.default.resolve(__dirname, '../assets/debug.keystore'),
@@ -49,7 +48,7 @@ async function repackAppAndroidAsync(_options) {
49
48
  keyAlias: options.androidSigningOptions?.keyAlias,
50
49
  keyPassword: options.androidSigningOptions?.keyPassword,
51
50
  });
52
- log_1.default.timeEnd(`Creating updated apk`);
51
+ logger.info(`Finished creating updated apk ✅`);
53
52
  await promises_1.default.rename(outputApk, options.outputPath);
54
53
  if (!options.skipWorkingDirCleanup) {
55
54
  try {
package/build/cli.js CHANGED
@@ -3,11 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const logger_1 = require("@expo/logger");
6
7
  const commander_1 = require("commander");
7
8
  const picocolors_1 = __importDefault(require("picocolors"));
8
9
  const index_1 = require("./index");
9
- const index_2 = require("./ios/index");
10
- const log_1 = __importDefault(require("./log"));
11
10
  const program = new commander_1.Command('repack-app')
12
11
  .requiredOption('-p, --platform <platform>', 'Platform to repack the app for')
13
12
  .requiredOption('--source-app <path>', 'Path to the source app file')
@@ -27,6 +26,7 @@ const program = new commander_1.Command('repack-app')
27
26
  .argument('<project-root>', 'Path to the project root')
28
27
  .parse(process.argv);
29
28
  async function runAsync() {
29
+ const logger = (0, logger_1.createLogger)({ name: 'repack-app' });
30
30
  const platform = program.opts().platform;
31
31
  const projectRoot = program.args[0];
32
32
  if (platform === 'android') {
@@ -44,8 +44,9 @@ async function runAsync() {
44
44
  keyPassword: program.opts().ksKeyPass,
45
45
  },
46
46
  androidBuildToolsDir: program.opts().androidBuildToolsDir,
47
+ logger,
47
48
  });
48
- log_1.default.log(picocolors_1.default.green(`Updated APK created at ${outputPath}`));
49
+ logger.info(picocolors_1.default.green(`Updated APK created at ${outputPath}`));
49
50
  }
50
51
  else if (platform === 'ios') {
51
52
  const options = {
@@ -59,14 +60,10 @@ async function runAsync() {
59
60
  signingIdentity: program.opts().signingIdentity,
60
61
  provisioningProfile: program.opts().provisioningProfile,
61
62
  },
63
+ logger,
62
64
  };
63
65
  const outputPath = await (0, index_1.repackAppIosAsync)(options);
64
- log_1.default.log(picocolors_1.default.green(`Updated IPA created at ${outputPath}`));
65
- if (options.iosSigningOptions?.signingIdentity &&
66
- options.iosSigningOptions?.provisioningProfile) {
67
- log_1.default.log(picocolors_1.default.green(`Resigning the IPA at ${outputPath}`));
68
- await (0, index_2.resignIpaAsync)(outputPath, options.iosSigningOptions, options);
69
- }
66
+ logger.info(picocolors_1.default.green(`Updated IPA created at ${outputPath}`));
70
67
  }
71
68
  else {
72
69
  throw new Error(`Unsupported platform: ${platform}`);
package/build/expo.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.resolveRuntimeVersionAsync = exports.generateAppConfigAsync = void 0;
7
- const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
7
+ const steps_1 = require("@expo/steps");
8
8
  const promises_1 = __importDefault(require("node:fs/promises"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
10
  const resolve_from_1 = __importDefault(require("resolve-from"));
@@ -25,7 +25,7 @@ async function resolveRuntimeVersionAsync(options, config) {
25
25
  const { projectRoot } = options;
26
26
  const cli = resolve_from_1.default.silent(projectRoot, 'expo-updates/bin/cli') ??
27
27
  (0, resolve_from_1.default)(projectRoot, 'expo-updates/bin/cli.js');
28
- const proc = await (0, spawn_async_1.default)(cli, ['runtimeversion:resolve', '--platform', 'android', '--workflow', 'managed'], {
28
+ const proc = await (0, steps_1.spawnAsync)(cli, ['runtimeversion:resolve', '--platform', 'android', '--workflow', 'managed'], {
29
29
  cwd: projectRoot,
30
30
  });
31
31
  const runtimeVersion = JSON.parse(proc.stdout).runtimeVersion;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createIpaAsync = exports.updateFilesAsync = exports.unzipIpaAsync = void 0;
7
- const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
7
+ const steps_1 = require("@expo/steps");
8
8
  const node_assert_1 = __importDefault(require("node:assert"));
9
9
  const promises_1 = __importDefault(require("node:fs/promises"));
10
10
  const node_path_1 = __importDefault(require("node:path"));
@@ -14,9 +14,7 @@ const utils_1 = require("../utils");
14
14
  */
15
15
  async function unzipIpaAsync(options) {
16
16
  const unzipWorkingDirectory = node_path_1.default.join(options.workingDirectory, 'unzip');
17
- await (0, spawn_async_1.default)('unzip', [options.sourceAppPath, '-d', unzipWorkingDirectory], {
18
- stdio: options.verbose ? 'inherit' : 'ignore',
19
- });
17
+ await (0, steps_1.spawnAsync)('unzip', [options.sourceAppPath, '-d', unzipWorkingDirectory], options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
20
18
  const appWorkingDirectory = node_path_1.default.join(unzipWorkingDirectory, 'Payload', 'HelloWorld.app');
21
19
  (0, node_assert_1.default)(await (0, utils_1.directoryExistsAsync)(appWorkingDirectory));
22
20
  return appWorkingDirectory;
@@ -43,10 +41,9 @@ async function createIpaAsync(options, appWorkingDirectory) {
43
41
  await promises_1.default.mkdir(node_path_1.default.join(workingDirectory, 'Payload'), { recursive: true });
44
42
  await promises_1.default.rename(appWorkingDirectory, node_path_1.default.join(workingDirectory, 'Payload', node_path_1.default.basename(appWorkingDirectory)));
45
43
  const outputIpaPath = node_path_1.default.join(workingDirectory, 'repacked.ipa');
46
- await (0, spawn_async_1.default)('zip', ['-r', outputIpaPath, 'Payload'], {
47
- cwd: workingDirectory,
48
- stdio: options.verbose ? 'inherit' : 'ignore',
49
- });
44
+ await (0, steps_1.spawnAsync)('zip', ['-r', outputIpaPath, 'Payload'], options.verbose
45
+ ? { logger: options.logger, stdio: 'pipe', cwd: workingDirectory }
46
+ : { cwd: workingDirectory });
50
47
  return outputIpaPath;
51
48
  }
52
49
  exports.createIpaAsync = createIpaAsync;
@@ -5,45 +5,49 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.resignIpaAsync = exports.repackAppIosAsync = void 0;
7
7
  const config_1 = require("@expo/config");
8
- const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
8
+ const steps_1 = require("@expo/steps");
9
9
  const promises_1 = __importDefault(require("node:fs/promises"));
10
10
  const node_path_1 = __importDefault(require("node:path"));
11
11
  const picocolors_1 = __importDefault(require("picocolors"));
12
12
  const build_tools_1 = require("./build-tools");
13
13
  const resources_1 = require("./resources");
14
14
  const expo_1 = require("../expo");
15
- const log_1 = __importDefault(require("../log"));
16
15
  const utils_1 = require("../utils");
17
16
  /**
18
17
  * Repack an iOS app.
19
18
  */
20
19
  async function repackAppIosAsync(_options) {
21
20
  const options = await (0, utils_1.normalizeOptionAsync)(_options);
22
- const { workingDirectory } = options;
21
+ const { workingDirectory, logger } = options;
23
22
  await promises_1.default.mkdir(workingDirectory, { recursive: true });
24
23
  const { exp } = (0, config_1.getConfig)(options.projectRoot, {
25
24
  isPublicConfig: true,
26
25
  skipSDKVersionRequirement: true,
27
26
  });
28
27
  const updatesRuntimeVersion = await (0, expo_1.resolveRuntimeVersionAsync)(options, exp);
29
- log_1.default.log(picocolors_1.default.dim(`Resolved runtime version: ${updatesRuntimeVersion}`));
30
- log_1.default.time(`Unzipping IPA`);
28
+ logger.info(picocolors_1.default.dim(`Resolved runtime version: ${updatesRuntimeVersion}`));
29
+ logger.info(`Unzipping IPA`);
31
30
  let appWorkingDirectory = await (0, build_tools_1.unzipIpaAsync)(options);
32
31
  appWorkingDirectory = await (0, build_tools_1.updateFilesAsync)(exp, appWorkingDirectory);
33
- log_1.default.timeEnd(`Unzipping IPA`);
34
- log_1.default.time(`Updating Info.plist`);
32
+ logger.info(`Finished unzipping IPA ✅`);
33
+ logger.info(`Updating Info.plist`);
35
34
  await (0, resources_1.updateInfoPlistAsync)(exp, node_path_1.default.join(appWorkingDirectory, 'Info.plist'), options);
36
- log_1.default.timeEnd(`Updating Info.plist`);
37
- log_1.default.time(`Updating Expo.plist`);
35
+ logger.info(`Finished updating Info.plist ✅`);
36
+ logger.info(`Updating Expo.plist`);
38
37
  await (0, resources_1.updateExpoPlistAsync)(exp, node_path_1.default.join(appWorkingDirectory, 'Expo.plist'), updatesRuntimeVersion, options);
39
- log_1.default.timeEnd(`Updating Expo.plist`);
40
- log_1.default.time(`Generating app.config`);
38
+ logger.info(`Finished updating Expo.plist ✅`);
39
+ logger.info(`Generating app.config`);
41
40
  const appConfigPath = await (0, expo_1.generateAppConfigAsync)(options, exp);
42
41
  await promises_1.default.copyFile(appConfigPath, node_path_1.default.join(appWorkingDirectory, 'EXConstants.bundle', 'app.config'));
43
- log_1.default.timeEnd(`Generating app.config`);
44
- log_1.default.time(`Creating updated ipa`);
42
+ logger.info(`Finished generating app.config ✅`);
43
+ logger.info(`Creating updated ipa`);
45
44
  const outputIpa = await (0, build_tools_1.createIpaAsync)(options, appWorkingDirectory);
46
- log_1.default.timeEnd(`Creating updated ipa`);
45
+ logger.info(`Finished creating updated ipa ✅`);
46
+ if (options.iosSigningOptions) {
47
+ logger.info(`Resigning the IPA at ${outputIpa}`);
48
+ await resignIpaAsync(outputIpa, options.iosSigningOptions, options);
49
+ logger.info(`Finished resigning the IPA ✅`);
50
+ }
47
51
  await promises_1.default.rename(outputIpa, options.outputPath);
48
52
  if (!options.skipWorkingDirCleanup) {
49
53
  try {
@@ -68,8 +72,6 @@ async function resignIpaAsync(ipaPath, signingOptions, options) {
68
72
  if (signingOptions.keychainPath) {
69
73
  args.push(`keychain_path:${signingOptions.keychainPath}`);
70
74
  }
71
- await (0, spawn_async_1.default)('fastlane', args, {
72
- stdio: options.verbose ? 'inherit' : 'ignore',
73
- });
75
+ await (0, steps_1.spawnAsync)('fastlane', args, { logger: options.logger, stdio: 'pipe' });
74
76
  }
75
77
  exports.resignIpaAsync = resignIpaAsync;
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.updateExpoPlistAsync = exports.updateInfoPlistAsync = void 0;
7
7
  const plist_1 = __importDefault(require("@expo/plist"));
8
- const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
8
+ const steps_1 = require("@expo/steps");
9
9
  const node_assert_1 = __importDefault(require("node:assert"));
10
10
  const promises_1 = __importDefault(require("node:fs/promises"));
11
11
  const utils_1 = require("../utils");
@@ -62,16 +62,12 @@ async function updateExpoPlistAsync(config, expoPlistPath, runtimeVersion, optio
62
62
  exports.updateExpoPlistAsync = updateExpoPlistAsync;
63
63
  //#region Internals
64
64
  async function updateBinaryPlistAsync(plistPath, options, updater) {
65
- await (0, spawn_async_1.default)('plutil', ['-convert', 'xml1', plistPath], {
66
- stdio: options.verbose ? 'inherit' : 'ignore',
67
- });
65
+ await (0, steps_1.spawnAsync)('plutil', ['-convert', 'xml1', plistPath], options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
68
66
  const contents = await promises_1.default.readFile(plistPath, 'utf8');
69
67
  const data = await plist_1.default.parse(contents);
70
68
  const updatedData = updater(data);
71
69
  const updatedContents = plist_1.default.build(updatedData);
72
70
  await promises_1.default.writeFile(plistPath, updatedContents);
73
- await (0, spawn_async_1.default)('plutil', ['-convert', 'binary1', plistPath], {
74
- stdio: options.verbose ? 'inherit' : 'ignore',
75
- });
71
+ await (0, steps_1.spawnAsync)('plutil', ['-convert', 'binary1', plistPath], options.verbose ? { logger: options.logger, stdio: 'pipe' } : undefined);
76
72
  }
77
73
  //#endregion
package/build/types.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference types="bunyan" />
2
+ import type { bunyan } from '@expo/logger';
1
3
  export interface Options {
2
4
  /**
3
5
  * The platform to repack the app for.
@@ -11,6 +13,10 @@ export interface Options {
11
13
  * The prebuilt app file path that acts as a source for repacking.
12
14
  */
13
15
  sourceAppPath: string;
16
+ /**
17
+ * The bunyan logger instance.
18
+ */
19
+ logger: bunyan;
14
20
  /**
15
21
  * Working directory.
16
22
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/repack-app",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Repacking tool for Expo apps",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -26,8 +26,9 @@
26
26
  "license": "BUSL-1.1",
27
27
  "dependencies": {
28
28
  "@expo/config": "^8.5.6",
29
- "@expo/spawn-async": "^1.7.2",
30
- "commander": "^12.0.0",
29
+ "@expo/logger": "^1.0.57",
30
+ "@expo/steps": "^1.0.108",
31
+ "commander": "^11.0.0",
31
32
  "glob": "^10.3.12",
32
33
  "picocolors": "^1.0.0",
33
34
  "protobufjs": "^7.2.6",
package/build/log.d.ts DELETED
@@ -1,13 +0,0 @@
1
- export declare function log(...message: string[]): void;
2
- export declare function warn(...message: string[]): void;
3
- export declare function error(...message: string[]): void;
4
- export declare function time(label?: string): void;
5
- export declare function timeEnd(label?: string): void;
6
- declare const _default: {
7
- log: typeof log;
8
- warn: typeof warn;
9
- error: typeof error;
10
- time: typeof time;
11
- timeEnd: typeof timeEnd;
12
- };
13
- export default _default;
package/build/log.js DELETED
@@ -1,34 +0,0 @@
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.timeEnd = exports.time = exports.error = exports.warn = exports.log = void 0;
7
- const picocolors_1 = __importDefault(require("picocolors"));
8
- function log(...message) {
9
- console.log(...message);
10
- }
11
- exports.log = log;
12
- function warn(...message) {
13
- console.warn(...message.map((value) => picocolors_1.default.yellow(value)));
14
- }
15
- exports.warn = warn;
16
- function error(...message) {
17
- console.error(...message);
18
- }
19
- exports.error = error;
20
- function time(label) {
21
- console.time(label);
22
- }
23
- exports.time = time;
24
- function timeEnd(label) {
25
- console.timeEnd(label);
26
- }
27
- exports.timeEnd = timeEnd;
28
- exports.default = {
29
- log,
30
- warn,
31
- error,
32
- time,
33
- timeEnd,
34
- };