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 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
- Array.prototype.push.apply(reactNativeBundleArgs, envArgs.trim().split(/\s+/));
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 = undefined;
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
- if (platform === 'harmony') {
187
- Array.prototype.push.apply(reactNativeBundleArgs, [
188
- cliPath,
189
- bundleCommand,
190
- '--dev',
191
- dev,
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
- Array.prototype.push.apply(reactNativeBundleArgs, [
203
- cliPath,
204
- bundleCommand,
205
- '--assets-dest',
206
- outputFolder,
207
- '--bundle-output',
208
- _path.default.join(outputFolder, bundleName),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update-cli",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "command line tool for react-native-update (remote updates for react native)",
5
5
  "main": "index.js",
6
6
  "bin": {
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
- Array.prototype.push.apply(
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: string | undefined;
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 = undefined;
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
- if (platform === 'harmony') {
170
- Array.prototype.push.apply(reactNativeBundleArgs, [
171
- cliPath,
172
- bundleCommand,
173
- '--dev',
174
- dev,
175
- '--entry-file',
176
- entryFile,
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
- if (sourcemapOutput) {
180
- reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
181
- }
178
+ if (platform !== 'harmony') {
179
+ reactNativeBundleArgs.push('--platform', platform, '--reset-cache');
180
+ }
182
181
 
183
- if (config) {
184
- reactNativeBundleArgs.push('--config', config);
185
- }
182
+ if (cli.taro) {
183
+ reactNativeBundleArgs.push('--type', 'rn');
186
184
  } else {
187
- Array.prototype.push.apply(reactNativeBundleArgs, [
188
- cliPath,
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
- if (sourcemapOutput) {
206
- reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
207
- }
188
+ if (sourcemapOutput) {
189
+ reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
190
+ }
208
191
 
209
- if (config) {
210
- reactNativeBundleArgs.push('--config', config);
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(Buffer.from(JSON.stringify({ copies, copiesv2 })), '__diff.json');
799
+ zipfile.addBuffer(
800
+ Buffer.from(JSON.stringify({ copies, copiesv2 })),
801
+ '__diff.json',
802
+ );
818
803
  zipfile.end();
819
804
  await writePromise;
820
805
  }