rnbuilder 0.5.29 → 0.5.31

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.29 darwin-arm64 node-v16.19.0
23
+ rnbuilder/0.5.31 darwin-arm64 node-v16.19.0
24
24
  $ rnbuilder --help [COMMAND]
25
25
  USAGE
26
26
  $ rnbuilder COMMAND
@@ -36,6 +36,7 @@ USAGE
36
36
  * [`rnbuilder match-nuke [BUILD]`](#rnbuilder-match-nuke-build)
37
37
  * [`rnbuilder onesignal [BUILD]`](#rnbuilder-onesignal-build)
38
38
  * [`rnbuilder setup [SETUP]`](#rnbuilder-setup-setup)
39
+ * [`rnbuilder submit-review [BUILD]`](#rnbuilder-submit-review-build)
39
40
  * [`rnbuilder sync-udids [BUILD]`](#rnbuilder-sync-udids-build)
40
41
 
41
42
  ## `rnbuilder build [BUILD]`
@@ -53,6 +54,7 @@ OPTIONS
53
54
  -g, --ignore_git_reset Ignore git reset when building
54
55
  -h, --help show CLI help
55
56
  -i, --installr=installr If enabled, the build will be uploaded to installR
57
+ -s, --ignore_cleanup Ignore cleanup when building
56
58
  -t, --target=android|ios Set the build target: android, ios or both
57
59
  -v, --version=version Set the version number for this build
58
60
 
@@ -61,7 +63,7 @@ EXAMPLE
61
63
  hello world from ./src/build.ts!
62
64
  ```
63
65
 
64
- _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/build.ts)_
66
+ _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.31/src/commands/build.ts)_
65
67
 
66
68
  ## `rnbuilder codepush [BUILD]`
67
69
 
@@ -80,7 +82,7 @@ EXAMPLE
80
82
  Push changes to existing apps ./src/firebase-sync-udids.ts!
81
83
  ```
82
84
 
83
- _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/codepush.ts)_
85
+ _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.31/src/commands/codepush.ts)_
84
86
 
85
87
  ## `rnbuilder help [COMMAND]`
86
88
 
@@ -112,7 +114,7 @@ EXAMPLE
112
114
  initialize environment for first run from ./src/initialize.ts!
113
115
  ```
114
116
 
115
- _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/initialize.ts)_
117
+ _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.31/src/commands/initialize.ts)_
116
118
 
117
119
  ## `rnbuilder match-nuke [BUILD]`
118
120
 
@@ -131,7 +133,7 @@ EXAMPLE
131
133
  Nuke certificates ./src/match-nuke.ts!
132
134
  ```
133
135
 
134
- _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/match-nuke.ts)_
136
+ _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.31/src/commands/match-nuke.ts)_
135
137
 
136
138
  ## `rnbuilder onesignal [BUILD]`
137
139
 
@@ -150,7 +152,7 @@ EXAMPLE
150
152
  Create and upload push certificate to One Signal from ./src/commands/onesignal.ts!
151
153
  ```
152
154
 
153
- _See code: [src/commands/onesignal.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/onesignal.ts)_
155
+ _See code: [src/commands/onesignal.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.31/src/commands/onesignal.ts)_
154
156
 
155
157
  ## `rnbuilder setup [SETUP]`
156
158
 
@@ -168,7 +170,26 @@ EXAMPLE
168
170
  hello world from ./src/setup.ts!
169
171
  ```
170
172
 
171
- _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/setup.ts)_
173
+ _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.31/src/commands/setup.ts)_
174
+
175
+ ## `rnbuilder submit-review [BUILD]`
176
+
177
+ Push changes to existing apps
178
+
179
+ ```
180
+ USAGE
181
+ $ rnbuilder submit-review [BUILD]
182
+
183
+ OPTIONS
184
+ -c, --client=client Select client that you want to push update
185
+ -h, --help show CLI help
186
+
187
+ EXAMPLE
188
+ $ rnbuilder codepush
189
+ Push changes to existing apps ./src/firebase-sync-udids.ts!
190
+ ```
191
+
192
+ _See code: [src/commands/submit-review.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.31/src/commands/submit-review.ts)_
172
193
 
173
194
  ## `rnbuilder sync-udids [BUILD]`
174
195
 
@@ -187,5 +208,5 @@ EXAMPLE
187
208
  Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!
188
209
  ```
189
210
 
190
- _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/sync-udids.ts)_
211
+ _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.31/src/commands/sync-udids.ts)_
191
212
  <!-- commandsstop -->
@@ -11,6 +11,7 @@ export default class Build extends Command {
11
11
  version: flags.IOptionFlag<string | undefined>;
12
12
  installr: flags.IOptionFlag<string | undefined>;
13
13
  ignore_git_reset: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
+ ignore_cleanup: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
15
  };
15
16
  static args: {
16
17
  name: string;
@@ -206,17 +206,19 @@ class Build extends command_1.Command {
206
206
  shell.exec('bundle update cocoapods');
207
207
  shell.cd('../');
208
208
  }
209
- shell.exec('yarn install');
210
209
  // Clean fastlane builds
211
210
  shell.exec('rm -rf fastlane/builds');
212
- // Clean android if any
213
- if (target.includes('android')) {
214
- shell.cd('./android');
215
- shell.exec('./gradlew clean');
216
- shell.cd('../');
217
- }
218
- if (target.includes('ios')) {
219
- shell.exec('npx pod-install');
211
+ if (!flags.ignore_cleanup) {
212
+ shell.exec('yarn install');
213
+ // Clean android if any
214
+ if (target.includes('android')) {
215
+ shell.cd('./android');
216
+ shell.exec('./gradlew clean');
217
+ shell.cd('../');
218
+ }
219
+ if (target.includes('ios')) {
220
+ shell.exec('npx pod-install');
221
+ }
220
222
  }
221
223
  if (client) {
222
224
  client.forEach((c) => {
@@ -272,5 +274,9 @@ Build.flags = {
272
274
  char: 'g',
273
275
  description: 'Ignore git reset when building',
274
276
  }),
277
+ ignore_cleanup: command_1.flags.boolean({
278
+ char: 's',
279
+ description: 'Ignore cleanup when building',
280
+ }),
275
281
  };
276
282
  Build.args = [{ name: 'build' }];
@@ -0,0 +1,14 @@
1
+ import { Command, flags } from '@oclif/command';
2
+ export default class CodePush extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
7
+ client: flags.IOptionFlag<string | undefined>;
8
+ };
9
+ static args: {
10
+ name: string;
11
+ }[];
12
+ askForMissingFields: (flags: any) => Promise<any>;
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* eslint-disable no-negated-condition */
4
+ const command_1 = require("@oclif/command");
5
+ const shell = require("shelljs");
6
+ const inquirer = require("inquirer");
7
+ const common_1 = require("../utils/common");
8
+ class CodePush extends command_1.Command {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.askForMissingFields = async (flags) => {
12
+ const questions = [];
13
+ if (!flags.client) {
14
+ const clients = common_1.getDirectories('./fastlane/clients');
15
+ if (clients.length > 0) {
16
+ questions.push({
17
+ type: 'checkbox-plus',
18
+ name: 'client',
19
+ message: 'What is the client?',
20
+ pageSize: 100,
21
+ highlight: true,
22
+ searchable: true,
23
+ default: [],
24
+ source: (answersSoFar, input) => {
25
+ input = input || '';
26
+ return new Promise(resolve => {
27
+ const result = clients.filter(client => client.includes(input.toLowerCase()));
28
+ resolve(result);
29
+ });
30
+ },
31
+ validate: (input) => {
32
+ return new Promise(resolve => {
33
+ if (input.length === 0) {
34
+ resolve('You need to select at least 1 client');
35
+ }
36
+ else {
37
+ resolve(true);
38
+ }
39
+ });
40
+ },
41
+ });
42
+ }
43
+ }
44
+ let result = flags;
45
+ if (questions.length > 0) {
46
+ const answers = await inquirer.prompt(questions);
47
+ result = Object.assign(Object.assign({}, flags), answers);
48
+ }
49
+ return result;
50
+ };
51
+ }
52
+ async run() {
53
+ const { flags } = this.parse(CodePush);
54
+ const params = await this.askForMissingFields(flags);
55
+ const { client, target } = params;
56
+ if (client) {
57
+ client.forEach((c) => {
58
+ const appVersion = common_1.getAppVersion('prod', client, target);
59
+ shell.cd(`fastlane/clients/${c}`);
60
+ shell.exec('pwd');
61
+ shell.exec(`bundle exec fastlane ios submit_review app_version:${appVersion.version} build_number:${appVersion.build}`);
62
+ shell.cd('../../..');
63
+ shell.exec('pwd');
64
+ });
65
+ }
66
+ else {
67
+ const appVersion = common_1.getAppVersion('prod', client, target);
68
+ shell.cd('fastlane');
69
+ shell.exec(`bundle exec fastlane ios submit_review app_version:${appVersion.version} build_number:${appVersion.build}`);
70
+ }
71
+ }
72
+ }
73
+ exports.default = CodePush;
74
+ CodePush.description = 'Push changes to existing apps';
75
+ CodePush.examples = [
76
+ `$ rnbuilder codepush
77
+ Push changes to existing apps ./src/firebase-sync-udids.ts!
78
+ `,
79
+ ];
80
+ CodePush.flags = {
81
+ help: command_1.flags.help({ char: 'h' }),
82
+ client: command_1.flags.string({
83
+ char: 'c',
84
+ description: 'Select client that you want to push update',
85
+ }),
86
+ };
87
+ CodePush.args = [{ name: 'build' }];
@@ -1 +1 @@
1
- {"version":"0.5.29","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"}]},"onesignal":{"id":"onesignal","description":"Create and upload push cerfiticate to One Signal","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder onesignal\n Create and upload push certificate to One Signal from ./src/commands/onesignal.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.31","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},"ignore_cleanup":{"name":"ignore_cleanup","type":"boolean","char":"s","description":"Ignore cleanup 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"}]},"onesignal":{"id":"onesignal","description":"Create and upload push cerfiticate to One Signal","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder onesignal\n Create and upload push certificate to One Signal from ./src/commands/onesignal.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"}]},"submit-review":{"id":"submit-review","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"}]},"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.29",
4
+ "version": "0.5.31",
5
5
  "author": "Tuan Luong @r0b0t3d",
6
6
  "bin": {
7
7
  "rnbuilder": "./bin/run"