react-native-update-cli 1.32.2 → 1.33.0
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/bundle.js +18 -0
- package/lib/index.js +3 -2
- package/package.json +1 -1
- package/src/bundle.js +26 -0
- package/src/index.ts +6 -2
- package/src/.DS_Store +0 -0
- package/src/utils/.DS_Store +0 -0
package/lib/bundle.js
CHANGED
|
@@ -226,12 +226,30 @@ async function compileHermesByteCode(bundleName, outputFolder, sourcemapOutput)
|
|
|
226
226
|
'-O'
|
|
227
227
|
];
|
|
228
228
|
if (sourcemapOutput) {
|
|
229
|
+
_fsextra.copyFileSync(sourcemapOutput, _nodepath.default.join(outputFolder, bundleName + '.txt.map'));
|
|
229
230
|
args.push('-output-source-map');
|
|
230
231
|
}
|
|
231
232
|
console.log('Running hermesc: ' + hermesCommand + ' ' + args.join(' ') + '\n');
|
|
232
233
|
(0, _nodechild_process.spawnSync)(hermesCommand, args, {
|
|
233
234
|
stdio: 'ignore'
|
|
234
235
|
});
|
|
236
|
+
if (sourcemapOutput) {
|
|
237
|
+
const composerPath = 'node_modules/react-native/scripts/compose-source-maps.js';
|
|
238
|
+
if (!_fsextra.existsSync(composerPath)) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
console.log(`Composing source map`);
|
|
242
|
+
(0, _nodechild_process.spawnSync)('node', [
|
|
243
|
+
composerPath,
|
|
244
|
+
_nodepath.default.join(outputFolder, bundleName + '.txt.map'),
|
|
245
|
+
_nodepath.default.join(outputFolder, bundleName + '.map'),
|
|
246
|
+
'-o',
|
|
247
|
+
sourcemapOutput
|
|
248
|
+
], {
|
|
249
|
+
stdio: 'ignore'
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
_fsextra.removeSync(_nodepath.default.join(outputFolder, bundleName + '.txt.map'));
|
|
235
253
|
}
|
|
236
254
|
async function pack(dir, output) {
|
|
237
255
|
console.log('Packing');
|
package/lib/index.js
CHANGED
|
@@ -15,9 +15,10 @@ function _interop_require_default(obj) {
|
|
|
15
15
|
(0, _updatenotifier.default)({
|
|
16
16
|
pkg: _packagejson.default
|
|
17
17
|
}).notify({
|
|
18
|
-
isGlobal: true
|
|
18
|
+
isGlobal: true,
|
|
19
|
+
message: '建议运行 `{updateCommand}` 来更新命令行工具以获得功能、性能和安全性的持续改进'
|
|
19
20
|
});
|
|
20
|
-
function printUsage(
|
|
21
|
+
function printUsage() {
|
|
21
22
|
// const commandName = args[0];
|
|
22
23
|
// TODO: print usage of commandName, or print global usage.
|
|
23
24
|
console.log('Usage is under development now.');
|
package/package.json
CHANGED
package/src/bundle.js
CHANGED
|
@@ -226,6 +226,10 @@ async function compileHermesByteCode(
|
|
|
226
226
|
'-O',
|
|
227
227
|
];
|
|
228
228
|
if (sourcemapOutput) {
|
|
229
|
+
fs.copyFileSync(
|
|
230
|
+
sourcemapOutput,
|
|
231
|
+
path.join(outputFolder, bundleName + '.txt.map'),
|
|
232
|
+
);
|
|
229
233
|
args.push('-output-source-map');
|
|
230
234
|
}
|
|
231
235
|
console.log(
|
|
@@ -234,6 +238,28 @@ async function compileHermesByteCode(
|
|
|
234
238
|
spawnSync(hermesCommand, args, {
|
|
235
239
|
stdio: 'ignore',
|
|
236
240
|
});
|
|
241
|
+
if (sourcemapOutput) {
|
|
242
|
+
const composerPath =
|
|
243
|
+
'node_modules/react-native/scripts/compose-source-maps.js';
|
|
244
|
+
if (!fs.existsSync(composerPath)) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
console.log(`Composing source map`);
|
|
248
|
+
spawnSync(
|
|
249
|
+
'node',
|
|
250
|
+
[
|
|
251
|
+
composerPath,
|
|
252
|
+
path.join(outputFolder, bundleName + '.txt.map'),
|
|
253
|
+
path.join(outputFolder, bundleName + '.map'),
|
|
254
|
+
'-o',
|
|
255
|
+
sourcemapOutput,
|
|
256
|
+
],
|
|
257
|
+
{
|
|
258
|
+
stdio: 'ignore',
|
|
259
|
+
},
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
fs.removeSync(path.join(outputFolder, bundleName + '.txt.map'));
|
|
237
263
|
}
|
|
238
264
|
|
|
239
265
|
async function pack(dir, output) {
|
package/src/index.ts
CHANGED
|
@@ -5,9 +5,13 @@ import updateNotifier from 'update-notifier';
|
|
|
5
5
|
import { printVersionCommand } from './utils/index.js';
|
|
6
6
|
import pkg from '../package.json';
|
|
7
7
|
|
|
8
|
-
updateNotifier({ pkg }).notify({
|
|
8
|
+
updateNotifier({ pkg }).notify({
|
|
9
|
+
isGlobal: true,
|
|
10
|
+
message:
|
|
11
|
+
'建议运行 `{updateCommand}` 来更新命令行工具以获得功能、性能和安全性的持续改进',
|
|
12
|
+
});
|
|
9
13
|
|
|
10
|
-
function printUsage(
|
|
14
|
+
function printUsage() {
|
|
11
15
|
// const commandName = args[0];
|
|
12
16
|
// TODO: print usage of commandName, or print global usage.
|
|
13
17
|
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/utils/.DS_Store
DELETED
|
Binary file
|