react-native-update-cli 1.44.5 → 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 +12 -12
- package/lib/app.js +6 -6
- package/lib/bundle.js +38 -38
- package/lib/user.js +2 -2
- package/lib/utils/add-gitignore.js +4 -4
- package/lib/utils/check-lockfile.js +9 -9
- package/lib/utils/constants.js +2 -2
- package/lib/utils/git.js +7 -7
- package/lib/utils/index.js +3 -3
- package/lib/utils/latest-version/cli.js +7 -7
- package/lib/utils/latest-version/index.js +25 -25
- package/package.json +1 -1
- package/src/api.ts +3 -3
- package/src/app.ts +18 -5
- package/src/bundle.ts +10 -6
- package/src/user.ts +1 -1
- package/src/utils/add-gitignore.ts +2 -2
- package/src/utils/check-lockfile.ts +2 -2
- package/src/utils/constants.ts +1 -1
- package/src/utils/git.ts +2 -2
- package/src/utils/index.ts +2 -2
- package/src/utils/latest-version/cli.ts +2 -2
- package/src/utils/latest-version/index.ts +6 -6
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
|
|
45
|
-
const
|
|
46
|
-
const
|
|
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 =
|
|
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 (
|
|
69
|
+
if (_fs.default.existsSync(_constants.credentialFile)) {
|
|
70
70
|
try {
|
|
71
|
-
replaceSession(JSON.parse(
|
|
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
|
-
|
|
84
|
+
_fs.default.writeFileSync(_constants.credentialFile, data, 'utf8');
|
|
85
85
|
savedSession = current;
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
const closeSession = ()=>{
|
|
89
|
-
if (
|
|
90
|
-
|
|
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:
|
|
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 =
|
|
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 =
|
|
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
|
|
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 (!
|
|
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(
|
|
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 (
|
|
144
|
+
if (_fs.default.existsSync('update.json')) {
|
|
145
145
|
try {
|
|
146
|
-
updateInfo = JSON.parse(
|
|
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
|
-
|
|
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
|
|
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
|
|
28
|
+
const _child_process = require("child_process");
|
|
29
29
|
const _satisfies = /*#__PURE__*/ _interop_require_default(require("semver/functions/satisfies"));
|
|
30
|
-
const
|
|
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
|
-
|
|
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,
|
|
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(
|
|
282
|
-
await _fsextra.copy('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 (
|
|
296
|
-
if (
|
|
297
|
-
if (
|
|
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 =
|
|
323
|
+
const rnDir = _path.default.dirname(require.resolve('react-native', {
|
|
324
324
|
paths: [
|
|
325
325
|
process.cwd()
|
|
326
326
|
]
|
|
327
327
|
}));
|
|
328
|
-
let hermesPath =
|
|
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
|
-
|
|
338
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
358
|
+
(0, _child_process.spawnSync)('node', [
|
|
359
359
|
composerPath,
|
|
360
|
-
|
|
361
|
-
|
|
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(
|
|
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,
|
|
389
|
+
(0, _child_process.spawnSync)('node', [
|
|
390
390
|
copyDebugidPath,
|
|
391
|
-
|
|
392
|
-
|
|
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(
|
|
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,
|
|
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,
|
|
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
|
-
|
|
436
|
-
|
|
437
|
-
|
|
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(
|
|
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 =
|
|
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(
|
|
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(
|
|
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 =
|
|
720
|
+
const tempDir = _path.default.join(_os.default.tmpdir(), `nested_zip_${Date.now()}`);
|
|
721
721
|
await _fsextra.ensureDir(tempDir);
|
|
722
|
-
const tempZipPath =
|
|
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
|
|
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 =
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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 (!
|
|
25
|
+
if (!_fs.default.existsSync(gitignorePath)) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
const gitignoreContent =
|
|
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
|
-
|
|
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
|
|
12
|
-
const
|
|
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 =
|
|
29
|
-
if (
|
|
28
|
+
const pkgPath = _path.default.join(dir, 'package.json');
|
|
29
|
+
if (_fs.default.existsSync(pkgPath)) {
|
|
30
30
|
try {
|
|
31
|
-
const pkg = JSON.parse(
|
|
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 =
|
|
44
|
-
if (
|
|
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 =
|
|
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 =
|
|
64
|
+
const parentDir = _path.default.dirname(currentDir);
|
|
65
65
|
if (parentDir === currentDir) {
|
|
66
66
|
break;
|
|
67
67
|
}
|
package/lib/utils/constants.js
CHANGED
|
@@ -28,13 +28,13 @@ _export(exports, {
|
|
|
28
28
|
return updateJson;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
const
|
|
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 =
|
|
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
|
|
13
|
-
const
|
|
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 =
|
|
20
|
+
const gitRoot = _fs.default.readdirSync(dir).find((dir)=>dir === '.git');
|
|
21
21
|
if (gitRoot) {
|
|
22
22
|
// console.log({ gitRoot });
|
|
23
|
-
return
|
|
23
|
+
return _path.default.join(dir, gitRoot);
|
|
24
24
|
}
|
|
25
|
-
const parentDir =
|
|
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:
|
|
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:
|
|
43
|
+
fs: _fs.default,
|
|
44
44
|
gitdir: gitRoot,
|
|
45
45
|
depth: 1
|
|
46
46
|
}))[0];
|
package/lib/utils/index.js
CHANGED
|
@@ -35,8 +35,8 @@ _export(exports, {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
38
|
-
const
|
|
39
|
-
const
|
|
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"));
|
|
@@ -169,7 +169,7 @@ async function getIpaInfo(fn) {
|
|
|
169
169
|
...appCredential
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
|
-
const localDir =
|
|
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
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
const _safe = require("@colors/colors/safe");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const _fs = require("fs");
|
|
7
|
+
const _path = require("path");
|
|
8
8
|
const _ = /*#__PURE__*/ _interop_require_default(require("."));
|
|
9
9
|
const _major = /*#__PURE__*/ _interop_require_default(require("semver/functions/major"));
|
|
10
10
|
const _diff = /*#__PURE__*/ _interop_require_default(require("semver/functions/diff"));
|
|
@@ -303,17 +303,17 @@ void (async ()=>{
|
|
|
303
303
|
args = args.filter((arg)=>!arg.startsWith('-'));
|
|
304
304
|
// If argument is a package.json file
|
|
305
305
|
if (args.length === 1 && args[0].endsWith('package.json')) {
|
|
306
|
-
if ((0,
|
|
307
|
-
process.chdir((0,
|
|
308
|
-
await checkVersions(JSON.parse((0,
|
|
306
|
+
if ((0, _fs.existsSync)(args[0])) {
|
|
307
|
+
process.chdir((0, _path.dirname)(args[0]));
|
|
308
|
+
await checkVersions(JSON.parse((0, _fs.readFileSync)(args[0]).toString()), skipMissing);
|
|
309
309
|
} else {
|
|
310
310
|
console.log((0, _safe.cyan)('No package.json file were found'));
|
|
311
311
|
}
|
|
312
312
|
} else {
|
|
313
313
|
// Check if a local package.json file exists
|
|
314
314
|
let localPkgJson;
|
|
315
|
-
if ((0,
|
|
316
|
-
localPkgJson = JSON.parse((0,
|
|
315
|
+
if ((0, _fs.existsSync)('package.json')) {
|
|
316
|
+
localPkgJson = JSON.parse((0, _fs.readFileSync)('package.json').toString());
|
|
317
317
|
}
|
|
318
318
|
// Check given arguments
|
|
319
319
|
if (args.length) {
|
|
@@ -16,11 +16,11 @@ _export(exports, {
|
|
|
16
16
|
return _default;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
const
|
|
20
|
-
const
|
|
19
|
+
const _fs = require("fs");
|
|
20
|
+
const _path = require("path");
|
|
21
21
|
const _globaldirs = require("global-dirs");
|
|
22
|
-
const
|
|
23
|
-
const
|
|
22
|
+
const _os = require("os");
|
|
23
|
+
const _url = require("url");
|
|
24
24
|
const _registryurl = /*#__PURE__*/ _interop_require_default(require("registry-auth-token/registry-url"));
|
|
25
25
|
const _registryauthtoken = /*#__PURE__*/ _interop_require_default(require("registry-auth-token"));
|
|
26
26
|
const _maxsatisfying = /*#__PURE__*/ _interop_require_default(require("semver/ranges/max-satisfying"));
|
|
@@ -40,7 +40,7 @@ const downloadMetadata = (pkgName, options)=>{
|
|
|
40
40
|
const pkgScope = i !== -1 ? pkgName.slice(0, i) : '';
|
|
41
41
|
var _options_registryUrl;
|
|
42
42
|
const registryUrl = (_options_registryUrl = options == null ? void 0 : options.registryUrl) != null ? _options_registryUrl : (0, _registryurl.default)(pkgScope);
|
|
43
|
-
const pkgUrl = new
|
|
43
|
+
const pkgUrl = new _url.URL(encodeURIComponent(pkgName).replace(/^%40/, '@'), registryUrl);
|
|
44
44
|
let requestOptions = {
|
|
45
45
|
headers: {
|
|
46
46
|
accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*'
|
|
@@ -110,34 +110,34 @@ const downloadMetadata = (pkgName, options)=>{
|
|
|
110
110
|
});
|
|
111
111
|
};
|
|
112
112
|
const getCacheDir = (name = '@badisi/latest-version')=>{
|
|
113
|
-
const homeDir = (0,
|
|
113
|
+
const homeDir = (0, _os.homedir)();
|
|
114
114
|
switch(process.platform){
|
|
115
115
|
case 'darwin':
|
|
116
|
-
return (0,
|
|
116
|
+
return (0, _path.join)(homeDir, 'Library', 'Caches', name);
|
|
117
117
|
case 'win32':
|
|
118
118
|
var _process_env_LOCALAPPDATA;
|
|
119
|
-
return (0,
|
|
119
|
+
return (0, _path.join)((_process_env_LOCALAPPDATA = process.env.LOCALAPPDATA) != null ? _process_env_LOCALAPPDATA : (0, _path.join)(homeDir, 'AppData', 'Local'), name, 'Cache');
|
|
120
120
|
default:
|
|
121
121
|
var _process_env_XDG_CACHE_HOME;
|
|
122
|
-
return (0,
|
|
122
|
+
return (0, _path.join)((_process_env_XDG_CACHE_HOME = process.env.XDG_CACHE_HOME) != null ? _process_env_XDG_CACHE_HOME : (0, _path.join)(homeDir, '.cache'), name);
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
const saveMetadataToCache = (pkg)=>{
|
|
126
|
-
const filePath = (0,
|
|
127
|
-
if (!(0,
|
|
128
|
-
(0,
|
|
126
|
+
const filePath = (0, _path.join)(getCacheDir(), `${pkg.name}.json`);
|
|
127
|
+
if (!(0, _fs.existsSync)((0, _path.dirname)(filePath))) {
|
|
128
|
+
(0, _fs.mkdirSync)((0, _path.dirname)(filePath), {
|
|
129
129
|
recursive: true
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
(0,
|
|
132
|
+
(0, _fs.writeFileSync)(filePath, JSON.stringify(pkg));
|
|
133
133
|
};
|
|
134
134
|
const getMetadataFromCache = (pkgName, options)=>{
|
|
135
135
|
var _options_cacheMaxAge;
|
|
136
136
|
const maxAge = (_options_cacheMaxAge = options == null ? void 0 : options.cacheMaxAge) != null ? _options_cacheMaxAge : ONE_DAY;
|
|
137
137
|
if (maxAge !== 0) {
|
|
138
|
-
const pkgCacheFilePath = (0,
|
|
139
|
-
if ((0,
|
|
140
|
-
const pkg = JSON.parse((0,
|
|
138
|
+
const pkgCacheFilePath = (0, _path.join)(getCacheDir(), `${pkgName}.json`);
|
|
139
|
+
if ((0, _fs.existsSync)(pkgCacheFilePath)) {
|
|
140
|
+
const pkg = JSON.parse((0, _fs.readFileSync)(pkgCacheFilePath).toString());
|
|
141
141
|
if (Date.now() - pkg.lastUpdateDate < maxAge) {
|
|
142
142
|
return pkg;
|
|
143
143
|
}
|
|
@@ -172,33 +172,33 @@ const getInstalledVersion = (pkgName, location = 'local')=>{
|
|
|
172
172
|
try {
|
|
173
173
|
if (location === 'globalNpm') {
|
|
174
174
|
var _require;
|
|
175
|
-
return (_require = require((0,
|
|
175
|
+
return (_require = require((0, _path.join)(_globaldirs.npm.packages, pkgName, 'package.json'))) == null ? void 0 : _require.version;
|
|
176
176
|
} else if (location === 'globalYarn') {
|
|
177
177
|
var _yarnGlobalPkg_dependencies, _require1;
|
|
178
178
|
// Make sure package is globally installed by Yarn
|
|
179
|
-
const yarnGlobalPkg = require((0,
|
|
179
|
+
const yarnGlobalPkg = require((0, _path.resolve)(_globaldirs.yarn.packages, '..', 'package.json'));
|
|
180
180
|
if (!(yarnGlobalPkg == null ? void 0 : (_yarnGlobalPkg_dependencies = yarnGlobalPkg.dependencies) == null ? void 0 : _yarnGlobalPkg_dependencies[pkgName])) {
|
|
181
181
|
return undefined;
|
|
182
182
|
}
|
|
183
|
-
return (_require1 = require((0,
|
|
183
|
+
return (_require1 = require((0, _path.join)(_globaldirs.yarn.packages, pkgName, 'package.json'))) == null ? void 0 : _require1.version;
|
|
184
184
|
} else {
|
|
185
185
|
/**
|
|
186
186
|
* Compute the local paths manually as require.resolve() and require.resolve.paths()
|
|
187
187
|
* cannot be trusted anymore.
|
|
188
188
|
* @see https://github.com/nodejs/node/issues/33460
|
|
189
189
|
* @see https://github.com/nodejs/loaders/issues/26
|
|
190
|
-
*/ const { root } = (0,
|
|
190
|
+
*/ const { root } = (0, _path.parse)(process.cwd());
|
|
191
191
|
let path = process.cwd();
|
|
192
192
|
const localPaths = [
|
|
193
|
-
(0,
|
|
193
|
+
(0, _path.join)(path, 'node_modules')
|
|
194
194
|
];
|
|
195
195
|
while(path !== root){
|
|
196
|
-
path = (0,
|
|
197
|
-
localPaths.push((0,
|
|
196
|
+
path = (0, _path.dirname)(path);
|
|
197
|
+
localPaths.push((0, _path.join)(path, 'node_modules'));
|
|
198
198
|
}
|
|
199
199
|
for (const localPath of localPaths){
|
|
200
|
-
const pkgPath = (0,
|
|
201
|
-
if ((0,
|
|
200
|
+
const pkgPath = (0, _path.join)(localPath, pkgName, 'package.json');
|
|
201
|
+
if ((0, _fs.existsSync)(pkgPath)) {
|
|
202
202
|
var _require2;
|
|
203
203
|
return (_require2 = require(pkgPath)) == null ? void 0 : _require2.version;
|
|
204
204
|
}
|
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fetch from 'node-fetch';
|
|
2
|
-
import fs from '
|
|
3
|
-
import util from '
|
|
4
|
-
import path from '
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import util from 'util';
|
|
4
|
+
import path from 'path';
|
|
5
5
|
import ProgressBar from 'progress';
|
|
6
6
|
import packageJson from '../package.json';
|
|
7
7
|
import tcpp from 'tcp-ping';
|
package/src/app.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { question } from './utils';
|
|
2
|
-
import fs from '
|
|
2
|
+
import fs from 'fs';
|
|
3
3
|
import Table from 'tty-table';
|
|
4
4
|
|
|
5
5
|
import { post, get, doDelete } from './api';
|
|
@@ -8,7 +8,6 @@ import { t } from './utils/i18n';
|
|
|
8
8
|
|
|
9
9
|
const validPlatforms = ['ios', 'android', 'harmony'];
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
export function checkPlatform(platform: Platform) {
|
|
13
12
|
if (!validPlatforms.includes(platform)) {
|
|
14
13
|
throw new Error(t('unsupportedPlatform', { platform }));
|
|
@@ -79,7 +78,13 @@ export const commands = {
|
|
|
79
78
|
options: { platform },
|
|
80
79
|
});
|
|
81
80
|
},
|
|
82
|
-
deleteApp: async ({
|
|
81
|
+
deleteApp: async ({
|
|
82
|
+
args,
|
|
83
|
+
options,
|
|
84
|
+
}: {
|
|
85
|
+
args: string[];
|
|
86
|
+
options: { platform: Platform };
|
|
87
|
+
}) => {
|
|
83
88
|
const { platform } = options;
|
|
84
89
|
const id = args[0] || chooseApp(platform);
|
|
85
90
|
if (!id) {
|
|
@@ -92,7 +97,13 @@ export const commands = {
|
|
|
92
97
|
const { platform } = options;
|
|
93
98
|
listApp(platform);
|
|
94
99
|
},
|
|
95
|
-
selectApp: async ({
|
|
100
|
+
selectApp: async ({
|
|
101
|
+
args,
|
|
102
|
+
options,
|
|
103
|
+
}: {
|
|
104
|
+
args: string[];
|
|
105
|
+
options: { platform: Platform };
|
|
106
|
+
}) => {
|
|
96
107
|
const platform = checkPlatform(
|
|
97
108
|
options.platform || (await question(t('platformQuestion'))),
|
|
98
109
|
);
|
|
@@ -100,7 +111,9 @@ export const commands = {
|
|
|
100
111
|
? Number.parseInt(args[0])
|
|
101
112
|
: (await chooseApp(platform)).id;
|
|
102
113
|
|
|
103
|
-
let updateInfo: Partial<
|
|
114
|
+
let updateInfo: Partial<
|
|
115
|
+
Record<Platform, { appId: number; appKey: string }>
|
|
116
|
+
> = {};
|
|
104
117
|
if (fs.existsSync('update.json')) {
|
|
105
118
|
try {
|
|
106
119
|
updateInfo = JSON.parse(fs.readFileSync('update.json', 'utf8'));
|
package/src/bundle.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import path from '
|
|
1
|
+
import path from 'path';
|
|
2
2
|
import { translateOptions } from './utils';
|
|
3
3
|
import * as fs from 'fs-extra';
|
|
4
4
|
import { ZipFile as YazlZipFile } from 'yazl';
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
} from 'yauzl';
|
|
10
10
|
import { question, checkPlugins } from './utils';
|
|
11
11
|
import { checkPlatform } from './app';
|
|
12
|
-
import { spawn, spawnSync } from '
|
|
12
|
+
import { spawn, spawnSync } from 'child_process';
|
|
13
13
|
import semverSatisfies from 'semver/functions/satisfies';
|
|
14
14
|
const g2js = require('gradle-to-js/lib/parser');
|
|
15
|
-
import os from '
|
|
15
|
+
import os from 'os';
|
|
16
16
|
const properties = require('properties');
|
|
17
17
|
import { depVersions } from './utils/dep-versions';
|
|
18
18
|
import { t } from './utils/i18n';
|
|
@@ -901,7 +901,7 @@ function diffArgsCheck(args: string[], options: any, diffFn: string) {
|
|
|
901
901
|
}
|
|
902
902
|
|
|
903
903
|
export const commands = {
|
|
904
|
-
bundle: async
|
|
904
|
+
bundle: async ({ options }) => {
|
|
905
905
|
const platform = checkPlatform(
|
|
906
906
|
options.platform || (await question(t('platformPrompt'))),
|
|
907
907
|
);
|
|
@@ -970,7 +970,7 @@ export const commands = {
|
|
|
970
970
|
metaInfo,
|
|
971
971
|
},
|
|
972
972
|
});
|
|
973
|
-
|
|
973
|
+
|
|
974
974
|
if (isSentry) {
|
|
975
975
|
await copyDebugidForSentry(bundleName, intermediaDir, sourcemapOutput);
|
|
976
976
|
await uploadSourcemapForSentry(
|
|
@@ -990,7 +990,11 @@ export const commands = {
|
|
|
990
990
|
},
|
|
991
991
|
});
|
|
992
992
|
if (isSentry) {
|
|
993
|
-
await copyDebugidForSentry(
|
|
993
|
+
await copyDebugidForSentry(
|
|
994
|
+
bundleName,
|
|
995
|
+
intermediaDir,
|
|
996
|
+
sourcemapOutput,
|
|
997
|
+
);
|
|
994
998
|
await uploadSourcemapForSentry(
|
|
995
999
|
bundleName,
|
|
996
1000
|
intermediaDir,
|
package/src/user.ts
CHANGED
package/src/utils/constants.ts
CHANGED
package/src/utils/git.ts
CHANGED
package/src/utils/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
|
-
import os from '
|
|
3
|
-
import path from '
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import path from 'path';
|
|
4
4
|
import pkg from '../../package.json';
|
|
5
5
|
import AppInfoParser from './app-info-parser';
|
|
6
6
|
import semverSatisfies from 'semver/functions/satisfies';
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
underline,
|
|
13
13
|
yellow,
|
|
14
14
|
} from '@colors/colors/safe';
|
|
15
|
-
import { existsSync, readFileSync } from '
|
|
16
|
-
import { dirname } from '
|
|
15
|
+
import { existsSync, readFileSync } from 'fs';
|
|
16
|
+
import { dirname } from 'path';
|
|
17
17
|
import latestVersion, {
|
|
18
18
|
type Package,
|
|
19
19
|
type PackageJson,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from '
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
2
2
|
import type {
|
|
3
3
|
RequestOptions as HttpRequestOptions,
|
|
4
4
|
Agent,
|
|
5
5
|
IncomingMessage,
|
|
6
|
-
} from '
|
|
7
|
-
import type { RequestOptions as HttpsRequestOptions } from '
|
|
8
|
-
import { join, dirname, resolve as pathResolve, parse } from '
|
|
6
|
+
} from 'http';
|
|
7
|
+
import type { RequestOptions as HttpsRequestOptions } from 'https';
|
|
8
|
+
import { join, dirname, resolve as pathResolve, parse } from 'path';
|
|
9
9
|
import { npm, yarn } from 'global-dirs';
|
|
10
|
-
import { homedir } from '
|
|
11
|
-
import { URL } from '
|
|
10
|
+
import { homedir } from 'os';
|
|
11
|
+
import { URL } from 'url';
|
|
12
12
|
|
|
13
13
|
import getRegistryUrl from 'registry-auth-token/registry-url';
|
|
14
14
|
import registryAuthToken from 'registry-auth-token';
|