react-native-update-cli 1.44.3 → 1.44.6

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/lib/api.js CHANGED
@@ -41,9 +41,9 @@ _export(exports, {
41
41
  }
42
42
  });
43
43
  const _nodefetch = /*#__PURE__*/ _interop_require_default(require("node-fetch"));
44
- const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
45
- const _nodeutil = /*#__PURE__*/ _interop_require_default(require("node:util"));
46
- const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
44
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
45
+ const _util = /*#__PURE__*/ _interop_require_default(require("util"));
46
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
47
47
  const _progress = /*#__PURE__*/ _interop_require_default(require("progress"));
48
48
  const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
49
49
  const _tcpping = /*#__PURE__*/ _interop_require_default(require("tcp-ping"));
@@ -56,7 +56,7 @@ function _interop_require_default(obj) {
56
56
  default: obj
57
57
  };
58
58
  }
59
- const tcpPing = _nodeutil.default.promisify(_tcpping.default.ping);
59
+ const tcpPing = _util.default.promisify(_tcpping.default.ping);
60
60
  let session;
61
61
  let savedSession;
62
62
  const host = process.env.PUSHY_REGISTRY || process.env.RNU_API || _constants.defaultEndpoint;
@@ -66,9 +66,9 @@ const replaceSession = (newSession)=>{
66
66
  session = newSession;
67
67
  };
68
68
  const loadSession = async ()=>{
69
- if (_nodefs.default.existsSync(_constants.credentialFile)) {
69
+ if (_fs.default.existsSync(_constants.credentialFile)) {
70
70
  try {
71
- replaceSession(JSON.parse(_nodefs.default.readFileSync(_constants.credentialFile, 'utf8')));
71
+ replaceSession(JSON.parse(_fs.default.readFileSync(_constants.credentialFile, 'utf8')));
72
72
  savedSession = session;
73
73
  } catch (e) {
74
74
  console.error(`Failed to parse file ${_constants.credentialFile}. Try to remove it manually.`);
@@ -81,13 +81,13 @@ const saveSession = ()=>{
81
81
  if (session !== savedSession) {
82
82
  const current = session;
83
83
  const data = JSON.stringify(current, null, 4);
84
- _nodefs.default.writeFileSync(_constants.credentialFile, data, 'utf8');
84
+ _fs.default.writeFileSync(_constants.credentialFile, data, 'utf8');
85
85
  savedSession = current;
86
86
  }
87
87
  };
88
88
  const closeSession = ()=>{
89
- if (_nodefs.default.existsSync(_constants.credentialFile)) {
90
- _nodefs.default.unlinkSync(_constants.credentialFile);
89
+ if (_fs.default.existsSync(_constants.credentialFile)) {
90
+ _fs.default.unlinkSync(_constants.credentialFile);
91
91
  savedSession = undefined;
92
92
  }
93
93
  session = undefined;
@@ -134,7 +134,7 @@ const put = queryWithBody('PUT');
134
134
  const doDelete = queryWithBody('DELETE');
135
135
  async function uploadFile(fn, key) {
136
136
  const { url, backupUrl, formData, maxSize } = await post('/upload', {
137
- ext: _nodepath.default.extname(fn)
137
+ ext: _path.default.extname(fn)
138
138
  });
139
139
  let realUrl = url;
140
140
  if (backupUrl) {
@@ -153,7 +153,7 @@ async function uploadFile(fn, key) {
153
153
  }
154
154
  // console.log({realUrl});
155
155
  }
156
- const fileSize = _nodefs.default.statSync(fn).size;
156
+ const fileSize = _fs.default.statSync(fn).size;
157
157
  if (maxSize && fileSize > (0, _filesizeparser.default)(maxSize)) {
158
158
  const readableFileSize = `${(fileSize / 1048576).toFixed(1)}m`;
159
159
  throw new Error((0, _i18n.t)('fileSizeExceeded', {
@@ -171,7 +171,7 @@ async function uploadFile(fn, key) {
171
171
  for (const [k, v] of Object.entries(formData)){
172
172
  form.append(k, v);
173
173
  }
174
- const fileStream = _nodefs.default.createReadStream(fn);
174
+ const fileStream = _fs.default.createReadStream(fn);
175
175
  fileStream.on('data', (data)=>{
176
176
  bar.tick(data.length);
177
177
  });
package/lib/app.js CHANGED
@@ -26,7 +26,7 @@ _export(exports, {
26
26
  }
27
27
  });
28
28
  const _utils = require("./utils");
29
- const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
29
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
30
30
  const _ttytable = /*#__PURE__*/ _interop_require_default(require("tty-table"));
31
31
  const _api = require("./api");
32
32
  const _i18n = require("./utils/i18n");
@@ -50,12 +50,12 @@ function checkPlatform(platform) {
50
50
  }
51
51
  function getSelectedApp(platform) {
52
52
  checkPlatform(platform);
53
- if (!_nodefs.default.existsSync('update.json')) {
53
+ if (!_fs.default.existsSync('update.json')) {
54
54
  throw new Error((0, _i18n.t)('appNotSelected', {
55
55
  platform
56
56
  }));
57
57
  }
58
- const updateInfo = JSON.parse(_nodefs.default.readFileSync('update.json', 'utf8'));
58
+ const updateInfo = JSON.parse(_fs.default.readFileSync('update.json', 'utf8'));
59
59
  if (!updateInfo[platform]) {
60
60
  throw new Error((0, _i18n.t)('appNotSelected', {
61
61
  platform
@@ -141,9 +141,9 @@ const commands = {
141
141
  const platform = checkPlatform(options.platform || await (0, _utils.question)((0, _i18n.t)('platformQuestion')));
142
142
  const id = args[0] ? Number.parseInt(args[0]) : (await chooseApp(platform)).id;
143
143
  let updateInfo = {};
144
- if (_nodefs.default.existsSync('update.json')) {
144
+ if (_fs.default.existsSync('update.json')) {
145
145
  try {
146
- updateInfo = JSON.parse(_nodefs.default.readFileSync('update.json', 'utf8'));
146
+ updateInfo = JSON.parse(_fs.default.readFileSync('update.json', 'utf8'));
147
147
  } catch (e) {
148
148
  console.error((0, _i18n.t)('failedToParseUpdateJson'));
149
149
  throw e;
@@ -154,6 +154,6 @@ const commands = {
154
154
  appId: id,
155
155
  appKey
156
156
  };
157
- _nodefs.default.writeFileSync('update.json', JSON.stringify(updateInfo, null, 4), 'utf8');
157
+ _fs.default.writeFileSync('update.json', JSON.stringify(updateInfo, null, 4), 'utf8');
158
158
  }
159
159
  };
package/lib/bundle.js CHANGED
@@ -19,15 +19,15 @@ _export(exports, {
19
19
  return readEntry;
20
20
  }
21
21
  });
22
- const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
22
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
23
23
  const _utils = require("./utils");
24
24
  const _fsextra = /*#__PURE__*/ _interop_require_wildcard(require("fs-extra"));
25
25
  const _yazl = require("yazl");
26
26
  const _yauzl = require("yauzl");
27
27
  const _app = require("./app");
28
- const _nodechild_process = require("node:child_process");
28
+ const _child_process = require("child_process");
29
29
  const _satisfies = /*#__PURE__*/ _interop_require_default(require("semver/functions/satisfies"));
30
- const _nodeos = /*#__PURE__*/ _interop_require_default(require("node:os"));
30
+ const _os = /*#__PURE__*/ _interop_require_default(require("os"));
31
31
  const _depversions = require("./utils/dep-versions");
32
32
  const _i18n = require("./utils/i18n");
33
33
  const _constants = require("./utils/constants");
@@ -198,7 +198,7 @@ async function runReactNativeBundleCommand({ bundleName, dev, entryFile, outputF
198
198
  '--assets-dest',
199
199
  outputFolder,
200
200
  '--bundle-output',
201
- _nodepath.default.join(outputFolder, bundleName),
201
+ _path.default.join(outputFolder, bundleName),
202
202
  '--platform',
203
203
  platform,
204
204
  '--reset-cache'
@@ -223,7 +223,7 @@ async function runReactNativeBundleCommand({ bundleName, dev, entryFile, outputF
223
223
  reactNativeBundleArgs.push('--config', config);
224
224
  }
225
225
  }
226
- const reactNativeBundleProcess = (0, _nodechild_process.spawn)('node', reactNativeBundleArgs);
226
+ const reactNativeBundleProcess = (0, _child_process.spawn)('node', reactNativeBundleArgs);
227
227
  console.log(`Running bundle command: node ${reactNativeBundleArgs.join(' ')}`);
228
228
  return new Promise((resolve, reject)=>{
229
229
  reactNativeBundleProcess.stdout.on('data', (data)=>{
@@ -278,8 +278,8 @@ async function copyHarmonyBundle(outputFolder) {
278
278
  } catch (error) {
279
279
  await _fsextra.chmod(harmonyRawPath, 0o755);
280
280
  }
281
- await _fsextra.remove(_nodepath.default.join(harmonyRawPath, 'update.json'));
282
- await _fsextra.copy('update.json', _nodepath.default.join(harmonyRawPath, 'update.json'));
281
+ await _fsextra.remove(_path.default.join(harmonyRawPath, 'update.json'));
282
+ await _fsextra.copy('update.json', _path.default.join(harmonyRawPath, 'update.json'));
283
283
  await _fsextra.ensureDir(outputFolder);
284
284
  await _fsextra.copy(harmonyRawPath, outputFolder);
285
285
  } catch (error) {
@@ -292,9 +292,9 @@ async function copyHarmonyBundle(outputFolder) {
292
292
  }
293
293
  }
294
294
  function getHermesOSBin() {
295
- if (_nodeos.default.platform() === 'win32') return 'win64-bin';
296
- if (_nodeos.default.platform() === 'darwin') return 'osx-bin';
297
- if (_nodeos.default.platform() === 'linux') return 'linux64-bin';
295
+ if (_os.default.platform() === 'win32') return 'win64-bin';
296
+ if (_os.default.platform() === 'darwin') return 'osx-bin';
297
+ if (_os.default.platform() === 'linux') return 'linux64-bin';
298
298
  }
299
299
  async function checkGradleConfig() {
300
300
  let enableHermes = false;
@@ -320,12 +320,12 @@ async function checkGradleConfig() {
320
320
  async function compileHermesByteCode(bundleName, outputFolder, sourcemapOutput, shouldCleanSourcemap) {
321
321
  console.log((0, _i18n.t)('hermesEnabledCompiling'));
322
322
  // >= rn 0.69
323
- const rnDir = _nodepath.default.dirname(require.resolve('react-native', {
323
+ const rnDir = _path.default.dirname(require.resolve('react-native', {
324
324
  paths: [
325
325
  process.cwd()
326
326
  ]
327
327
  }));
328
- let hermesPath = _nodepath.default.join(rnDir, `/sdks/hermesc/${getHermesOSBin()}`);
328
+ let hermesPath = _path.default.join(rnDir, `/sdks/hermesc/${getHermesOSBin()}`);
329
329
  // < rn 0.69
330
330
  if (!_fsextra.existsSync(hermesPath)) {
331
331
  hermesPath = `node_modules/hermes-engine/${getHermesOSBin()}`;
@@ -334,19 +334,19 @@ async function compileHermesByteCode(bundleName, outputFolder, sourcemapOutput,
334
334
  const args = [
335
335
  '-emit-binary',
336
336
  '-out',
337
- _nodepath.default.join(outputFolder, bundleName),
338
- _nodepath.default.join(outputFolder, bundleName),
337
+ _path.default.join(outputFolder, bundleName),
338
+ _path.default.join(outputFolder, bundleName),
339
339
  '-O'
340
340
  ];
341
341
  if (sourcemapOutput) {
342
- _fsextra.copyFileSync(sourcemapOutput, _nodepath.default.join(outputFolder, `${bundleName}.txt.map`));
342
+ _fsextra.copyFileSync(sourcemapOutput, _path.default.join(outputFolder, `${bundleName}.txt.map`));
343
343
  args.push('-output-source-map');
344
344
  }
345
345
  console.log((0, _i18n.t)('runningHermesc', {
346
346
  command: hermesCommand,
347
347
  args: args.join(' ')
348
348
  }));
349
- (0, _nodechild_process.spawnSync)(hermesCommand, args, {
349
+ (0, _child_process.spawnSync)(hermesCommand, args, {
350
350
  stdio: 'ignore'
351
351
  });
352
352
  if (sourcemapOutput) {
@@ -355,10 +355,10 @@ async function compileHermesByteCode(bundleName, outputFolder, sourcemapOutput,
355
355
  return;
356
356
  }
357
357
  console.log((0, _i18n.t)('composingSourceMap'));
358
- (0, _nodechild_process.spawnSync)('node', [
358
+ (0, _child_process.spawnSync)('node', [
359
359
  composerPath,
360
- _nodepath.default.join(outputFolder, `${bundleName}.txt.map`),
361
- _nodepath.default.join(outputFolder, `${bundleName}.map`),
360
+ _path.default.join(outputFolder, `${bundleName}.txt.map`),
361
+ _path.default.join(outputFolder, `${bundleName}.map`),
362
362
  '-o',
363
363
  sourcemapOutput
364
364
  ], {
@@ -366,7 +366,7 @@ async function compileHermesByteCode(bundleName, outputFolder, sourcemapOutput,
366
366
  });
367
367
  }
368
368
  if (shouldCleanSourcemap) {
369
- _fsextra.removeSync(_nodepath.default.join(outputFolder, `${bundleName}.txt.map`));
369
+ _fsextra.removeSync(_path.default.join(outputFolder, `${bundleName}.txt.map`));
370
370
  }
371
371
  }
372
372
  async function copyDebugidForSentry(bundleName, outputFolder, sourcemapOutput) {
@@ -386,15 +386,15 @@ async function copyDebugidForSentry(bundleName, outputFolder, sourcemapOutput) {
386
386
  return;
387
387
  }
388
388
  console.log((0, _i18n.t)('copyingDebugId'));
389
- (0, _nodechild_process.spawnSync)('node', [
389
+ (0, _child_process.spawnSync)('node', [
390
390
  copyDebugidPath,
391
- _nodepath.default.join(outputFolder, `${bundleName}.txt.map`),
392
- _nodepath.default.join(outputFolder, `${bundleName}.map`)
391
+ _path.default.join(outputFolder, `${bundleName}.txt.map`),
392
+ _path.default.join(outputFolder, `${bundleName}.map`)
393
393
  ], {
394
394
  stdio: 'ignore'
395
395
  });
396
396
  }
397
- _fsextra.removeSync(_nodepath.default.join(outputFolder, `${bundleName}.txt.map`));
397
+ _fsextra.removeSync(_path.default.join(outputFolder, `${bundleName}.txt.map`));
398
398
  }
399
399
  async function uploadSourcemapForSentry(bundleName, outputFolder, sourcemapOutput, version) {
400
400
  if (sourcemapOutput) {
@@ -412,7 +412,7 @@ async function uploadSourcemapForSentry(bundleName, outputFolder, sourcemapOutpu
412
412
  if (!_fsextra.existsSync(sentryCliPath)) {
413
413
  return;
414
414
  }
415
- (0, _nodechild_process.spawnSync)('node', [
415
+ (0, _child_process.spawnSync)('node', [
416
416
  sentryCliPath,
417
417
  'releases',
418
418
  'set-commits',
@@ -425,16 +425,16 @@ async function uploadSourcemapForSentry(bundleName, outputFolder, sourcemapOutpu
425
425
  version
426
426
  }));
427
427
  console.log((0, _i18n.t)('uploadingSourcemap'));
428
- (0, _nodechild_process.spawnSync)('node', [
428
+ (0, _child_process.spawnSync)('node', [
429
429
  sentryCliPath,
430
430
  'releases',
431
431
  'files',
432
432
  version,
433
433
  'upload-sourcemaps',
434
434
  '--strip-prefix',
435
- _nodepath.default.join(process.cwd(), outputFolder),
436
- _nodepath.default.join(outputFolder, bundleName),
437
- _nodepath.default.join(outputFolder, `${bundleName}.map`)
435
+ _path.default.join(process.cwd(), outputFolder),
436
+ _path.default.join(outputFolder, bundleName),
437
+ _path.default.join(outputFolder, `${bundleName}.map`)
438
438
  ], {
439
439
  stdio: 'inherit'
440
440
  });
@@ -451,7 +451,7 @@ const ignorePackingExtensions = [
451
451
  ];
452
452
  async function pack(dir, output) {
453
453
  console.log((0, _i18n.t)('packing'));
454
- _fsextra.ensureDirSync(_nodepath.default.dirname(output));
454
+ _fsextra.ensureDirSync(_path.default.dirname(output));
455
455
  await new Promise((resolve, reject)=>{
456
456
  const zipfile = new _yazl.ZipFile();
457
457
  function addDirectory(root, rel) {
@@ -463,7 +463,7 @@ async function pack(dir, output) {
463
463
  if (ignorePackingFileNames.includes(name) || ignorePackingExtensions.some((ext)=>name.endsWith(`.${ext}`))) {
464
464
  continue;
465
465
  }
466
- const fullPath = _nodepath.default.join(root, name);
466
+ const fullPath = _path.default.join(root, name);
467
467
  const stat = _fsextra.statSync(fullPath);
468
468
  if (stat.isFile()) {
469
469
  //console.log('adding: ' + rel+name);
@@ -509,7 +509,7 @@ function basename(fn) {
509
509
  return m == null ? void 0 : m[1];
510
510
  }
511
511
  async function diffFromPPK(origin, next, output) {
512
- _fsextra.ensureDirSync(_nodepath.default.dirname(output));
512
+ _fsextra.ensureDirSync(_path.default.dirname(output));
513
513
  const originEntries = {};
514
514
  const originMap = {};
515
515
  let originSource;
@@ -621,7 +621,7 @@ async function diffFromPPK(origin, next, output) {
621
621
  await writePromise;
622
622
  }
623
623
  async function diffFromPackage(origin, next, output, originBundleName, transformPackagePath = (v)=>v) {
624
- _fsextra.ensureDirSync(_nodepath.default.dirname(output));
624
+ _fsextra.ensureDirSync(_path.default.dirname(output));
625
625
  const originEntries = {};
626
626
  const originMap = {};
627
627
  let originSource;
@@ -717,9 +717,9 @@ async function enumZipEntries(zipFn, callback, nestedPath = '') {
717
717
  const fullPath = nestedPath + entry.fileName;
718
718
  try {
719
719
  if (!entry.fileName.endsWith('/') && entry.fileName.toLowerCase().endsWith('.hap')) {
720
- const tempDir = _nodepath.default.join(_nodeos.default.tmpdir(), `nested_zip_${Date.now()}`);
720
+ const tempDir = _path.default.join(_os.default.tmpdir(), `nested_zip_${Date.now()}`);
721
721
  await _fsextra.ensureDir(tempDir);
722
- const tempZipPath = _nodepath.default.join(tempDir, 'temp.zip');
722
+ const tempZipPath = _path.default.join(tempDir, 'temp.zip');
723
723
  await new Promise((res, rej)=>{
724
724
  zipfile.openReadStream(entry, async (err, readStream)=>{
725
725
  if (err) return rej(err);
@@ -778,7 +778,7 @@ function diffArgsCheck(args, options, diffFn) {
778
778
  };
779
779
  }
780
780
  const commands = {
781
- bundle: async function({ options }) {
781
+ bundle: async ({ options })=>{
782
782
  const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)((0, _i18n.t)('platformPrompt')));
783
783
  const { bundleName, entryFile, intermediaDir, output, dev, sourcemap, taro, expo, rncli, disableHermes, name, description, metaInfo } = (0, _utils.translateOptions)({
784
784
  ...options,
@@ -790,7 +790,7 @@ const commands = {
790
790
  const bundleParams = await (0, _utils.checkPlugins)();
791
791
  const sourcemapPlugin = bundleParams.sourcemap;
792
792
  const isSentry = bundleParams.sentry;
793
- const sourcemapOutput = _nodepath.default.join(intermediaDir, `${bundleName}.map`);
793
+ const sourcemapOutput = _path.default.join(intermediaDir, `${bundleName}.map`);
794
794
  const realOutput = output.replace(/\$\{time\}/g, `${Date.now()}`);
795
795
  if (!platform) {
796
796
  throw new Error((0, _i18n.t)('platformRequired'));
@@ -810,7 +810,7 @@ const commands = {
810
810
  rncli
811
811
  }
812
812
  });
813
- await pack(_nodepath.default.resolve(intermediaDir), realOutput);
813
+ await pack(_path.default.resolve(intermediaDir), realOutput);
814
814
  if (name) {
815
815
  const versionName = await _versions.commands.publish({
816
816
  args: [
package/lib/user.js CHANGED
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "commands", {
10
10
  });
11
11
  const _utils = require("./utils");
12
12
  const _api = require("./api");
13
- const _nodecrypto = /*#__PURE__*/ _interop_require_default(require("node:crypto"));
13
+ const _crypto = /*#__PURE__*/ _interop_require_default(require("crypto"));
14
14
  const _i18n = require("./utils/i18n");
15
15
  function _interop_require_default(obj) {
16
16
  return obj && obj.__esModule ? obj : {
@@ -18,7 +18,7 @@ function _interop_require_default(obj) {
18
18
  };
19
19
  }
20
20
  function md5(str) {
21
- return _nodecrypto.default.createHash('md5').update(str).digest('hex');
21
+ return _crypto.default.createHash('md5').update(str).digest('hex');
22
22
  }
23
23
  const commands = {
24
24
  login: async ({ args })=>{
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "addGitIgnore", {
8
8
  return addGitIgnore;
9
9
  }
10
10
  });
11
- const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
12
  const _constants = require("./constants");
13
13
  const _i18n = require("./i18n");
14
14
  function _interop_require_default(obj) {
@@ -22,10 +22,10 @@ function addGitIgnore() {
22
22
  _constants.tempDir
23
23
  ];
24
24
  const gitignorePath = '.gitignore';
25
- if (!_nodefs.default.existsSync(gitignorePath)) {
25
+ if (!_fs.default.existsSync(gitignorePath)) {
26
26
  return;
27
27
  }
28
- const gitignoreContent = _nodefs.default.readFileSync(gitignorePath, 'utf-8');
28
+ const gitignoreContent = _fs.default.readFileSync(gitignorePath, 'utf-8');
29
29
  const gitignoreLines = gitignoreContent.split('\n');
30
30
  for (const line of gitignoreLines){
31
31
  const index = shouldIgnore.indexOf(line.trim());
@@ -41,6 +41,6 @@ function addGitIgnore() {
41
41
  line
42
42
  }));
43
43
  }
44
- _nodefs.default.writeFileSync(gitignorePath, gitignoreLines.join('\n'));
44
+ _fs.default.writeFileSync(gitignorePath, gitignoreLines.join('\n'));
45
45
  }
46
46
  }
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "checkLockFiles", {
8
8
  return checkLockFiles;
9
9
  }
10
10
  });
11
- const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
12
- const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
13
  const _i18n = require("./i18n");
14
14
  function _interop_require_default(obj) {
15
15
  return obj && obj.__esModule ? obj : {
@@ -25,10 +25,10 @@ const lockFiles = [
25
25
  ];
26
26
  // Function to check if a package.json has a workspaces field
27
27
  function hasWorkspaces(dir) {
28
- const pkgPath = _nodepath.default.join(dir, 'package.json');
29
- if (_nodefs.default.existsSync(pkgPath)) {
28
+ const pkgPath = _path.default.join(dir, 'package.json');
29
+ if (_fs.default.existsSync(pkgPath)) {
30
30
  try {
31
- const pkg = JSON.parse(_nodefs.default.readFileSync(pkgPath, 'utf-8'));
31
+ const pkg = JSON.parse(_fs.default.readFileSync(pkgPath, 'utf-8'));
32
32
  return !!pkg.workspaces;
33
33
  } catch (e) {
34
34
  // Ignore parsing errors
@@ -40,8 +40,8 @@ function hasWorkspaces(dir) {
40
40
  function findLockFilesInDir(directory) {
41
41
  const found = [];
42
42
  for (const file of lockFiles){
43
- const filePath = _nodepath.default.join(directory, file);
44
- if (_nodefs.default.existsSync(filePath)) {
43
+ const filePath = _path.default.join(directory, file);
44
+ if (_fs.default.existsSync(filePath)) {
45
45
  found.push(filePath);
46
46
  }
47
47
  }
@@ -54,14 +54,14 @@ function checkLockFiles() {
54
54
  // If no lock file in cwd, try to find monorepo root and check there
55
55
  if (foundLockFiles.length === 0) {
56
56
  // Search upwards for package.json with workspaces
57
- let currentDir = _nodepath.default.dirname(cwd); // Start searching from parent
57
+ let currentDir = _path.default.dirname(cwd); // Start searching from parent
58
58
  let projectRootDir = null;
59
59
  while(true){
60
60
  if (hasWorkspaces(currentDir)) {
61
61
  projectRootDir = currentDir;
62
62
  break;
63
63
  }
64
- const parentDir = _nodepath.default.dirname(currentDir);
64
+ const parentDir = _path.default.dirname(currentDir);
65
65
  if (parentDir === currentDir) {
66
66
  break;
67
67
  }
@@ -28,13 +28,13 @@ _export(exports, {
28
28
  return updateJson;
29
29
  }
30
30
  });
31
- const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
31
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
32
32
  function _interop_require_default(obj) {
33
33
  return obj && obj.__esModule ? obj : {
34
34
  default: obj
35
35
  };
36
36
  }
37
- const scriptName = _nodepath.default.basename(process.argv[1]);
37
+ const scriptName = _path.default.basename(process.argv[1]);
38
38
  const IS_CRESC = scriptName === 'cresc';
39
39
  const credentialFile = IS_CRESC ? '.cresc.token' : '.update';
40
40
  const updateJson = IS_CRESC ? 'cresc.config.json' : 'update.json';
package/lib/utils/git.js CHANGED
@@ -9,20 +9,20 @@ Object.defineProperty(exports, "getCommitInfo", {
9
9
  }
10
10
  });
11
11
  const _isomorphicgit = /*#__PURE__*/ _interop_require_default(require("isomorphic-git"));
12
- const _nodefs = /*#__PURE__*/ _interop_require_default(require("node:fs"));
13
- const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
12
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
13
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
14
14
  function _interop_require_default(obj) {
15
15
  return obj && obj.__esModule ? obj : {
16
16
  default: obj
17
17
  };
18
18
  }
19
19
  function findGitRoot(dir = process.cwd()) {
20
- const gitRoot = _nodefs.default.readdirSync(dir).find((dir)=>dir === '.git');
20
+ const gitRoot = _fs.default.readdirSync(dir).find((dir)=>dir === '.git');
21
21
  if (gitRoot) {
22
22
  // console.log({ gitRoot });
23
- return _nodepath.default.join(dir, gitRoot);
23
+ return _path.default.join(dir, gitRoot);
24
24
  }
25
- const parentDir = _nodepath.default.dirname(dir);
25
+ const parentDir = _path.default.dirname(dir);
26
26
  if (parentDir === dir) {
27
27
  return null;
28
28
  }
@@ -35,12 +35,12 @@ async function getCommitInfo() {
35
35
  }
36
36
  try {
37
37
  const remotes = await _isomorphicgit.default.listRemotes({
38
- fs: _nodefs.default,
38
+ fs: _fs.default,
39
39
  gitdir: gitRoot
40
40
  });
41
41
  const origin = remotes.find((remote)=>remote.remote === 'origin') || remotes[0];
42
42
  const { commit, oid } = (await _isomorphicgit.default.log({
43
- fs: _nodefs.default,
43
+ fs: _fs.default,
44
44
  gitdir: gitRoot,
45
45
  depth: 1
46
46
  }))[0];
@@ -35,13 +35,13 @@ _export(exports, {
35
35
  }
36
36
  });
37
37
  const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
38
- const _nodeos = /*#__PURE__*/ _interop_require_default(require("node:os"));
39
- const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
38
+ const _os = /*#__PURE__*/ _interop_require_default(require("os"));
39
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
40
40
  const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../package.json"));
41
41
  const _appinfoparser = /*#__PURE__*/ _interop_require_default(require("./app-info-parser"));
42
42
  const _satisfies = /*#__PURE__*/ _interop_require_default(require("semver/functions/satisfies"));
43
43
  const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
44
- const _latestversion = /*#__PURE__*/ _interop_require_default(require("@badisi/latest-version"));
44
+ const _latestversion = /*#__PURE__*/ _interop_require_default(require("../utils/latest-version"));
45
45
  const _checkplugin = require("./check-plugin");
46
46
  const _read = require("read");
47
47
  const _constants = require("./constants");
@@ -169,7 +169,7 @@ async function getIpaInfo(fn) {
169
169
  ...appCredential
170
170
  };
171
171
  }
172
- const localDir = _nodepath.default.resolve(_nodeos.default.homedir(), _constants.tempDir);
172
+ const localDir = _path.default.resolve(_os.default.homedir(), _constants.tempDir);
173
173
  _fsextra.default.ensureDirSync(localDir);
174
174
  function saveToLocal(originPath, destName) {
175
175
  // TODO