rnbuilder 0.5.26 → 0.5.28

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/README.md CHANGED
@@ -20,7 +20,7 @@ $ npm install -g rnbuilder
20
20
  $ rnbuilder COMMAND
21
21
  running command...
22
22
  $ rnbuilder (-v|--version|version)
23
- rnbuilder/0.5.26 darwin-arm64 node-v16.19.0
23
+ rnbuilder/0.5.28 darwin-arm64 node-v16.19.0
24
24
  $ rnbuilder --help [COMMAND]
25
25
  USAGE
26
26
  $ rnbuilder COMMAND
@@ -49,6 +49,7 @@ OPTIONS
49
49
  -b, --branch=branch Set the source branch used to build the app
50
50
  -c, --client=client Set client that you want to build app
51
51
  -e, --env=staging|adhoc|prod Set the environment: prod, adhoc, staging
52
+ -g, --ignore_git_reset Ignore git reset when building
52
53
  -h, --help show CLI help
53
54
  -i, --installr=installr If enabled, the build will be uploaded to installR
54
55
  -t, --target=android|ios Set the build target: android, ios or both
@@ -59,7 +60,7 @@ EXAMPLE
59
60
  hello world from ./src/build.ts!
60
61
  ```
61
62
 
62
- _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.26/src/commands/build.ts)_
63
+ _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/build.ts)_
63
64
 
64
65
  ## `rnbuilder codepush [BUILD]`
65
66
 
@@ -78,7 +79,7 @@ EXAMPLE
78
79
  Push changes to existing apps ./src/firebase-sync-udids.ts!
79
80
  ```
80
81
 
81
- _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.26/src/commands/codepush.ts)_
82
+ _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/codepush.ts)_
82
83
 
83
84
  ## `rnbuilder help [COMMAND]`
84
85
 
@@ -110,7 +111,7 @@ EXAMPLE
110
111
  initialize environment for first run from ./src/initialize.ts!
111
112
  ```
112
113
 
113
- _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.26/src/commands/initialize.ts)_
114
+ _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/initialize.ts)_
114
115
 
115
116
  ## `rnbuilder match-nuke [BUILD]`
116
117
 
@@ -129,7 +130,7 @@ EXAMPLE
129
130
  Nuke certificates ./src/match-nuke.ts!
130
131
  ```
131
132
 
132
- _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.26/src/commands/match-nuke.ts)_
133
+ _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/match-nuke.ts)_
133
134
 
134
135
  ## `rnbuilder setup [SETUP]`
135
136
 
@@ -147,7 +148,7 @@ EXAMPLE
147
148
  hello world from ./src/setup.ts!
148
149
  ```
149
150
 
150
- _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.26/src/commands/setup.ts)_
151
+ _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/setup.ts)_
151
152
 
152
153
  ## `rnbuilder sync-udids [BUILD]`
153
154
 
@@ -166,5 +167,5 @@ EXAMPLE
166
167
  Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!
167
168
  ```
168
169
 
169
- _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.26/src/commands/sync-udids.ts)_
170
+ _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/sync-udids.ts)_
170
171
  <!-- commandsstop -->
@@ -10,6 +10,7 @@ export default class Build extends Command {
10
10
  branch: flags.IOptionFlag<string | undefined>;
11
11
  version: flags.IOptionFlag<string | undefined>;
12
12
  installr: flags.IOptionFlag<string | undefined>;
13
+ ignore_git_reset: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
13
14
  };
14
15
  static args: {
15
16
  name: string;
@@ -197,14 +197,16 @@ class Build extends command_1.Command {
197
197
  const { client, target } = params, otherParams = tslib_1.__rest(params, ["client", "target"]);
198
198
  const jsonFile = this.getJsonFile(otherParams.env);
199
199
  const parameters = common_1.buildKeyValuePairs(Object.assign(Object.assign({}, otherParams), { json_file: jsonFile }));
200
- shell.exec(`git reset --hard && git checkout ${params.branch} && git pull`);
201
- shell.cd('fastlane');
202
- shell.exec('bundle update --bundler');
203
- shell.exec('bundle install');
204
- shell.exec('bundle update fastlane');
205
- shell.exec('bundle update cocoapods');
206
- shell.cd('../');
207
- shell.exec('yarn install && npx pod-install');
200
+ if (!flags.ignore_git_reset) {
201
+ shell.exec(`git reset --hard && git checkout ${params.branch} && git pull`);
202
+ shell.cd('fastlane');
203
+ shell.exec('bundle update --bundler');
204
+ shell.exec('bundle install');
205
+ shell.exec('bundle update fastlane');
206
+ shell.exec('bundle update cocoapods');
207
+ shell.cd('../');
208
+ }
209
+ shell.exec('yarn install');
208
210
  // Clean fastlane builds
209
211
  shell.exec('rm -rf fastlane/builds');
210
212
  // Clean android if any
@@ -213,6 +215,9 @@ class Build extends command_1.Command {
213
215
  shell.exec('./gradlew clean');
214
216
  shell.cd('../');
215
217
  }
218
+ if (target.includes('ios')) {
219
+ shell.exec('npx pod-install');
220
+ }
216
221
  if (client) {
217
222
  client.forEach((c) => {
218
223
  shell.cd(`fastlane/clients/${c}`);
@@ -263,5 +268,9 @@ Build.flags = {
263
268
  char: 'i',
264
269
  description: 'If enabled, the build will be uploaded to installR',
265
270
  }),
271
+ ignore_git_reset: command_1.flags.boolean({
272
+ char: 'g',
273
+ description: 'Ignore git reset when building',
274
+ }),
266
275
  };
267
276
  Build.args = [{ name: 'build' }];
package/lib/utils/env.js CHANGED
@@ -48,7 +48,8 @@ exports.saveEnvValues = (newValues, destFilePath) => {
48
48
  * @param {string} value Value to update/insert
49
49
  */
50
50
  exports.setEnvValue = (key, value, envVars) => {
51
- envVars[key] = Object.assign(Object.assign({}, envVars[key]), { value });
51
+ envVars[key] = Object.assign(Object.assign({}, envVars[key]), { key,
52
+ value });
52
53
  };
53
54
  exports.updateServiceDomain = (envVars, domain) => {
54
55
  const result = {};
@@ -56,7 +57,7 @@ exports.updateServiceDomain = (envVars, domain) => {
56
57
  var _a;
57
58
  let data = envVars[key];
58
59
  if ((_a = data.value) === null || _a === void 0 ? void 0 : _a.includes('[domain]')) {
59
- data = Object.assign(Object.assign({}, data), { value: data.value.replace('[domain]', domain) });
60
+ data = Object.assign(Object.assign({}, data), { key, value: data.value.replace('[domain]', domain) });
60
61
  }
61
62
  result[key] = data;
62
63
  });
@@ -1 +1 @@
1
- {"version":"0.5.26","commands":{"build":{"id":"build","description":"Build react native apps","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder build\nhello world from ./src/build.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"client":{"name":"client","type":"option","char":"c","description":"Set client that you want to build app"},"target":{"name":"target","type":"option","char":"t","description":"Set the build target: android, ios or both","options":["android","ios"]},"env":{"name":"env","type":"option","char":"e","description":"Set the environment: prod, adhoc, staging","options":["staging","adhoc","prod"]},"branch":{"name":"branch","type":"option","char":"b","description":"Set the source branch used to build the app"},"version":{"name":"version","type":"option","char":"v","description":"Set the version number for this build"},"installr":{"name":"installr","type":"option","char":"i","description":"If enabled, the build will be uploaded to installR"}},"args":[{"name":"build"}]},"codepush":{"id":"codepush","description":"Push changes to existing apps","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder codepush\n Push changes to existing apps ./src/firebase-sync-udids.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"client":{"name":"client","type":"option","char":"c","description":"Select client that you want to push update"}},"args":[{"name":"build"}]},"initialize":{"id":"initialize","description":"Initialize the environment for first run","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder initialize\ninitialize environment for first run from ./src/initialize.ts!\n"],"flags":{},"args":[]},"match-nuke":{"id":"match-nuke","description":"Nuke certificates","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder match-nuke\n Nuke certificates ./src/match-nuke.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"client":{"name":"client","type":"option","char":"c","description":"Select client that you want to sync udids"}},"args":[{"name":"build"}]},"setup":{"id":"setup","description":"Setup new client","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder build\nhello world from ./src/setup.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"setup"}]},"sync-udids":{"id":"sync-udids","description":"Sync device UDIDs from firebase","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder sync-udids\n Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"client":{"name":"client","type":"option","char":"c","description":"Select client that you want to sync udids"}},"args":[{"name":"build"}]}}}
1
+ {"version":"0.5.28","commands":{"build":{"id":"build","description":"Build react native apps","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder build\nhello world from ./src/build.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"client":{"name":"client","type":"option","char":"c","description":"Set client that you want to build app"},"target":{"name":"target","type":"option","char":"t","description":"Set the build target: android, ios or both","options":["android","ios"]},"env":{"name":"env","type":"option","char":"e","description":"Set the environment: prod, adhoc, staging","options":["staging","adhoc","prod"]},"branch":{"name":"branch","type":"option","char":"b","description":"Set the source branch used to build the app"},"version":{"name":"version","type":"option","char":"v","description":"Set the version number for this build"},"installr":{"name":"installr","type":"option","char":"i","description":"If enabled, the build will be uploaded to installR"},"ignore_git_reset":{"name":"ignore_git_reset","type":"boolean","char":"g","description":"Ignore git reset when building","allowNo":false}},"args":[{"name":"build"}]},"codepush":{"id":"codepush","description":"Push changes to existing apps","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder codepush\n Push changes to existing apps ./src/firebase-sync-udids.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"client":{"name":"client","type":"option","char":"c","description":"Select client that you want to push update"}},"args":[{"name":"build"}]},"initialize":{"id":"initialize","description":"Initialize the environment for first run","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder initialize\ninitialize environment for first run from ./src/initialize.ts!\n"],"flags":{},"args":[]},"match-nuke":{"id":"match-nuke","description":"Nuke certificates","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder match-nuke\n Nuke certificates ./src/match-nuke.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"client":{"name":"client","type":"option","char":"c","description":"Select client that you want to sync udids"}},"args":[{"name":"build"}]},"setup":{"id":"setup","description":"Setup new client","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder build\nhello world from ./src/setup.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"setup"}]},"sync-udids":{"id":"sync-udids","description":"Sync device UDIDs from firebase","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder sync-udids\n Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"client":{"name":"client","type":"option","char":"c","description":"Select client that you want to sync udids"}},"args":[{"name":"build"}]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rnbuilder",
3
3
  "description": "React Native builder tool",
4
- "version": "0.5.26",
4
+ "version": "0.5.28",
5
5
  "author": "Tuan Luong @r0b0t3d",
6
6
  "bin": {
7
7
  "rnbuilder": "./bin/run"