rnbuilder 0.5.30 → 0.5.32

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.30 darwin-arm64 node-v16.19.0
23
+ rnbuilder/0.5.32 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]`
@@ -62,7 +63,7 @@ EXAMPLE
62
63
  hello world from ./src/build.ts!
63
64
  ```
64
65
 
65
- _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/build.ts)_
66
+ _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.32/src/commands/build.ts)_
66
67
 
67
68
  ## `rnbuilder codepush [BUILD]`
68
69
 
@@ -81,7 +82,7 @@ EXAMPLE
81
82
  Push changes to existing apps ./src/firebase-sync-udids.ts!
82
83
  ```
83
84
 
84
- _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/codepush.ts)_
85
+ _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.32/src/commands/codepush.ts)_
85
86
 
86
87
  ## `rnbuilder help [COMMAND]`
87
88
 
@@ -113,7 +114,7 @@ EXAMPLE
113
114
  initialize environment for first run from ./src/initialize.ts!
114
115
  ```
115
116
 
116
- _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/initialize.ts)_
117
+ _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.32/src/commands/initialize.ts)_
117
118
 
118
119
  ## `rnbuilder match-nuke [BUILD]`
119
120
 
@@ -132,7 +133,7 @@ EXAMPLE
132
133
  Nuke certificates ./src/match-nuke.ts!
133
134
  ```
134
135
 
135
- _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/match-nuke.ts)_
136
+ _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.32/src/commands/match-nuke.ts)_
136
137
 
137
138
  ## `rnbuilder onesignal [BUILD]`
138
139
 
@@ -151,7 +152,7 @@ EXAMPLE
151
152
  Create and upload push certificate to One Signal from ./src/commands/onesignal.ts!
152
153
  ```
153
154
 
154
- _See code: [src/commands/onesignal.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/onesignal.ts)_
155
+ _See code: [src/commands/onesignal.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.32/src/commands/onesignal.ts)_
155
156
 
156
157
  ## `rnbuilder setup [SETUP]`
157
158
 
@@ -169,7 +170,26 @@ EXAMPLE
169
170
  hello world from ./src/setup.ts!
170
171
  ```
171
172
 
172
- _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/setup.ts)_
173
+ _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.32/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.32/src/commands/submit-review.ts)_
173
193
 
174
194
  ## `rnbuilder sync-udids [BUILD]`
175
195
 
@@ -188,5 +208,5 @@ EXAMPLE
188
208
  Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!
189
209
  ```
190
210
 
191
- _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/sync-udids.ts)_
211
+ _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.32/src/commands/sync-udids.ts)_
192
212
  <!-- commandsstop -->
@@ -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.30","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"}]},"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.32","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.30",
4
+ "version": "0.5.32",
5
5
  "author": "Tuan Luong @r0b0t3d",
6
6
  "bin": {
7
7
  "rnbuilder": "./bin/run"