react-native-update-cli 2.2.0 → 2.2.1
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 +30 -45
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, '--assets-dest', outputFolder, '--bundle-output', _path.default.join(outputFolder, platform === 'harmony' ? 'bundle.harmony.js' : bundleName));
|
|
187
|
+
if (platform !== 'harmony') {
|
|
188
|
+
reactNativeBundleArgs.push('--platform', platform, '--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,34 @@ async function runReactNativeBundleCommand({
|
|
|
166
163
|
bundleCommand = 'build';
|
|
167
164
|
}
|
|
168
165
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
166
|
+
reactNativeBundleArgs.push(
|
|
167
|
+
cliPath,
|
|
168
|
+
bundleCommand,
|
|
169
|
+
'--assets-dest',
|
|
170
|
+
outputFolder,
|
|
171
|
+
'--bundle-output',
|
|
172
|
+
path.join(
|
|
173
|
+
outputFolder,
|
|
174
|
+
platform === 'harmony' ? 'bundle.harmony.js' : bundleName,
|
|
175
|
+
),
|
|
176
|
+
);
|
|
178
177
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
if (platform !== 'harmony') {
|
|
179
|
+
reactNativeBundleArgs.push('--platform', platform, '--reset-cache');
|
|
180
|
+
}
|
|
182
181
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
182
|
+
if (cli.taro) {
|
|
183
|
+
reactNativeBundleArgs.push('--type', 'rn');
|
|
186
184
|
} else {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
bundleCommand,
|
|
190
|
-
'--assets-dest',
|
|
191
|
-
outputFolder,
|
|
192
|
-
'--bundle-output',
|
|
193
|
-
path.join(outputFolder, bundleName),
|
|
194
|
-
'--platform',
|
|
195
|
-
platform,
|
|
196
|
-
'--reset-cache',
|
|
197
|
-
]);
|
|
198
|
-
|
|
199
|
-
if (cli.taro) {
|
|
200
|
-
reactNativeBundleArgs.push(...['--type', 'rn']);
|
|
201
|
-
} else {
|
|
202
|
-
reactNativeBundleArgs.push(...['--dev', dev, '--entry-file', entryFile]);
|
|
203
|
-
}
|
|
185
|
+
reactNativeBundleArgs.push('--dev', dev, '--entry-file', entryFile);
|
|
186
|
+
}
|
|
204
187
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
188
|
+
if (sourcemapOutput) {
|
|
189
|
+
reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
|
|
190
|
+
}
|
|
208
191
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
192
|
+
if (config) {
|
|
193
|
+
reactNativeBundleArgs.push('--config', config);
|
|
212
194
|
}
|
|
213
195
|
|
|
214
196
|
const reactNativeBundleProcess = spawn('node', reactNativeBundleArgs);
|
|
@@ -814,7 +796,10 @@ async function diffFromPackage(
|
|
|
814
796
|
}
|
|
815
797
|
});
|
|
816
798
|
|
|
817
|
-
zipfile.addBuffer(
|
|
799
|
+
zipfile.addBuffer(
|
|
800
|
+
Buffer.from(JSON.stringify({ copies, copiesv2 })),
|
|
801
|
+
'__diff.json',
|
|
802
|
+
);
|
|
818
803
|
zipfile.end();
|
|
819
804
|
await writePromise;
|
|
820
805
|
}
|