react-native-update-cli 2.2.0 → 2.2.2
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 +16 -48
- package/package.json +1 -1
- package/src/bundle.ts +24 -41
package/lib/bundle.js
CHANGED
|
@@ -102,10 +102,10 @@ async function runReactNativeBundleCommand({ bundleName, dev, entryFile, outputF
|
|
|
102
102
|
const reactNativeBundleArgs = [];
|
|
103
103
|
const envArgs = process.env.PUSHY_ENV_ARGS;
|
|
104
104
|
if (envArgs) {
|
|
105
|
-
|
|
105
|
+
reactNativeBundleArgs.push(...envArgs.trim().split(/\s+/));
|
|
106
106
|
}
|
|
107
107
|
_fsextra.emptyDirSync(outputFolder);
|
|
108
|
-
let cliPath;
|
|
108
|
+
let cliPath = '';
|
|
109
109
|
let usingExpo = false;
|
|
110
110
|
const getExpoCli = ()=>{
|
|
111
111
|
try {
|
|
@@ -123,7 +123,7 @@ async function runReactNativeBundleCommand({ bundleName, dev, entryFile, outputF
|
|
|
123
123
|
if ((0, _compareversions.satisfies)(expoCliVersion, '>= 0.10.17')) {
|
|
124
124
|
usingExpo = true;
|
|
125
125
|
} else {
|
|
126
|
-
cliPath =
|
|
126
|
+
cliPath = '';
|
|
127
127
|
}
|
|
128
128
|
} catch (e) {}
|
|
129
129
|
};
|
|
@@ -183,52 +183,20 @@ async function runReactNativeBundleCommand({ bundleName, dev, entryFile, outputF
|
|
|
183
183
|
} else if (cli.taro) {
|
|
184
184
|
bundleCommand = 'build';
|
|
185
185
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
'--entry-file',
|
|
193
|
-
entryFile
|
|
194
|
-
]);
|
|
195
|
-
if (sourcemapOutput) {
|
|
196
|
-
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
|
197
|
-
}
|
|
198
|
-
if (config) {
|
|
199
|
-
reactNativeBundleArgs.push('--config', config);
|
|
200
|
-
}
|
|
186
|
+
reactNativeBundleArgs.push(cliPath, bundleCommand);
|
|
187
|
+
if (platform !== 'harmony') {
|
|
188
|
+
reactNativeBundleArgs.push('--platform', platform, '--assets-dest', outputFolder, '--bundle-output', _path.default.join(outputFolder, bundleName), '--reset-cache');
|
|
189
|
+
}
|
|
190
|
+
if (cli.taro) {
|
|
191
|
+
reactNativeBundleArgs.push('--type', 'rn');
|
|
201
192
|
} else {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
'--platform',
|
|
210
|
-
platform,
|
|
211
|
-
'--reset-cache'
|
|
212
|
-
]);
|
|
213
|
-
if (cli.taro) {
|
|
214
|
-
reactNativeBundleArgs.push(...[
|
|
215
|
-
'--type',
|
|
216
|
-
'rn'
|
|
217
|
-
]);
|
|
218
|
-
} else {
|
|
219
|
-
reactNativeBundleArgs.push(...[
|
|
220
|
-
'--dev',
|
|
221
|
-
dev,
|
|
222
|
-
'--entry-file',
|
|
223
|
-
entryFile
|
|
224
|
-
]);
|
|
225
|
-
}
|
|
226
|
-
if (sourcemapOutput) {
|
|
227
|
-
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
|
228
|
-
}
|
|
229
|
-
if (config) {
|
|
230
|
-
reactNativeBundleArgs.push('--config', config);
|
|
231
|
-
}
|
|
193
|
+
reactNativeBundleArgs.push('--dev', dev, '--entry-file', entryFile);
|
|
194
|
+
}
|
|
195
|
+
if (sourcemapOutput) {
|
|
196
|
+
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
|
197
|
+
}
|
|
198
|
+
if (config) {
|
|
199
|
+
reactNativeBundleArgs.push('--config', config);
|
|
232
200
|
}
|
|
233
201
|
const reactNativeBundleProcess = (0, _child_process.spawn)('node', reactNativeBundleArgs);
|
|
234
202
|
console.log(`Running bundle command: node ${reactNativeBundleArgs.join(' ')}`);
|
package/package.json
CHANGED
package/src/bundle.ts
CHANGED
|
@@ -75,15 +75,12 @@ async function runReactNativeBundleCommand({
|
|
|
75
75
|
const envArgs = process.env.PUSHY_ENV_ARGS;
|
|
76
76
|
|
|
77
77
|
if (envArgs) {
|
|
78
|
-
|
|
79
|
-
reactNativeBundleArgs,
|
|
80
|
-
envArgs.trim().split(/\s+/),
|
|
81
|
-
);
|
|
78
|
+
reactNativeBundleArgs.push(...envArgs.trim().split(/\s+/));
|
|
82
79
|
}
|
|
83
80
|
|
|
84
81
|
fs.emptyDirSync(outputFolder);
|
|
85
82
|
|
|
86
|
-
let cliPath
|
|
83
|
+
let cliPath = '';
|
|
87
84
|
let usingExpo = false;
|
|
88
85
|
|
|
89
86
|
const getExpoCli = () => {
|
|
@@ -104,7 +101,7 @@ async function runReactNativeBundleCommand({
|
|
|
104
101
|
if (satisfies(expoCliVersion, '>= 0.10.17')) {
|
|
105
102
|
usingExpo = true;
|
|
106
103
|
} else {
|
|
107
|
-
cliPath =
|
|
104
|
+
cliPath = '';
|
|
108
105
|
}
|
|
109
106
|
} catch (e) {}
|
|
110
107
|
};
|
|
@@ -166,49 +163,32 @@ async function runReactNativeBundleCommand({
|
|
|
166
163
|
bundleCommand = 'build';
|
|
167
164
|
}
|
|
168
165
|
|
|
169
|
-
|
|
170
|
-
Array.prototype.push.apply(reactNativeBundleArgs, [
|
|
171
|
-
cliPath,
|
|
172
|
-
bundleCommand,
|
|
173
|
-
'--dev',
|
|
174
|
-
dev,
|
|
175
|
-
'--entry-file',
|
|
176
|
-
entryFile,
|
|
177
|
-
]);
|
|
178
|
-
|
|
179
|
-
if (sourcemapOutput) {
|
|
180
|
-
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
|
181
|
-
}
|
|
166
|
+
reactNativeBundleArgs.push(cliPath, bundleCommand);
|
|
182
167
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
Array.prototype.push.apply(reactNativeBundleArgs, [
|
|
188
|
-
cliPath,
|
|
189
|
-
bundleCommand,
|
|
168
|
+
if (platform !== 'harmony') {
|
|
169
|
+
reactNativeBundleArgs.push(
|
|
170
|
+
'--platform',
|
|
171
|
+
platform,
|
|
190
172
|
'--assets-dest',
|
|
191
173
|
outputFolder,
|
|
192
174
|
'--bundle-output',
|
|
193
175
|
path.join(outputFolder, bundleName),
|
|
194
|
-
'--platform',
|
|
195
|
-
platform,
|
|
196
176
|
'--reset-cache',
|
|
197
|
-
|
|
177
|
+
);
|
|
178
|
+
}
|
|
198
179
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
180
|
+
if (cli.taro) {
|
|
181
|
+
reactNativeBundleArgs.push('--type', 'rn');
|
|
182
|
+
} else {
|
|
183
|
+
reactNativeBundleArgs.push('--dev', dev, '--entry-file', entryFile);
|
|
184
|
+
}
|
|
204
185
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
186
|
+
if (sourcemapOutput) {
|
|
187
|
+
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
|
188
|
+
}
|
|
208
189
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
190
|
+
if (config) {
|
|
191
|
+
reactNativeBundleArgs.push('--config', config);
|
|
212
192
|
}
|
|
213
193
|
|
|
214
194
|
const reactNativeBundleProcess = spawn('node', reactNativeBundleArgs);
|
|
@@ -814,7 +794,10 @@ async function diffFromPackage(
|
|
|
814
794
|
}
|
|
815
795
|
});
|
|
816
796
|
|
|
817
|
-
zipfile.addBuffer(
|
|
797
|
+
zipfile.addBuffer(
|
|
798
|
+
Buffer.from(JSON.stringify({ copies, copiesv2 })),
|
|
799
|
+
'__diff.json',
|
|
800
|
+
);
|
|
818
801
|
zipfile.end();
|
|
819
802
|
await writePromise;
|
|
820
803
|
}
|