rnbuilder 0.4.7 → 0.5.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/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.4.7 darwin-x64 node-v12.22.4
23
+ rnbuilder/0.5.1 darwin-arm64 node-v16.13.0
24
24
  $ rnbuilder --help [COMMAND]
25
25
  USAGE
26
26
  $ rnbuilder COMMAND
@@ -57,7 +57,7 @@ EXAMPLE
57
57
  hello world from ./src/build.ts!
58
58
  ```
59
59
 
60
- _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.4.7/src/commands/build.ts)_
60
+ _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.1/src/commands/build.ts)_
61
61
 
62
62
  ## `rnbuilder codepush [BUILD]`
63
63
 
@@ -76,7 +76,7 @@ EXAMPLE
76
76
  Push changes to existing apps ./src/firebase-sync-udids.ts!
77
77
  ```
78
78
 
79
- _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.4.7/src/commands/codepush.ts)_
79
+ _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.1/src/commands/codepush.ts)_
80
80
 
81
81
  ## `rnbuilder help [COMMAND]`
82
82
 
@@ -108,7 +108,7 @@ EXAMPLE
108
108
  initialize environment for first run from ./src/initialize.ts!
109
109
  ```
110
110
 
111
- _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.4.7/src/commands/initialize.ts)_
111
+ _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.1/src/commands/initialize.ts)_
112
112
 
113
113
  ## `rnbuilder sync-udids [BUILD]`
114
114
 
@@ -127,5 +127,5 @@ EXAMPLE
127
127
  Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!
128
128
  ```
129
129
 
130
- _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.4.7/src/commands/sync-udids.ts)_
130
+ _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.1/src/commands/sync-udids.ts)_
131
131
  <!-- commandsstop -->
@@ -15,5 +15,6 @@ export default class Build extends Command {
15
15
  name: string;
16
16
  }[];
17
17
  askForMissingFields: (flags: any) => Promise<any>;
18
+ runPlatforms(target: string[], parameters: any, otherParams: any): void;
18
19
  run(): Promise<void>;
19
20
  }
@@ -17,7 +17,7 @@ class Build extends command_1.Command {
17
17
  const clients = utils_1.getDirectories('./fastlane/clients');
18
18
  if (clients.length > 0) {
19
19
  questions.push({
20
- type: 'list',
20
+ type: 'checkbox',
21
21
  name: 'client',
22
22
  message: 'What is the client?',
23
23
  choices: clients,
@@ -26,10 +26,10 @@ class Build extends command_1.Command {
26
26
  }
27
27
  if (!flags.target) {
28
28
  questions.push({
29
- type: 'list',
29
+ type: 'checkbox',
30
30
  name: 'target',
31
31
  message: 'What is the build target?',
32
- // default: 'both',
32
+ default: ['android', 'ios'],
33
33
  choices: ['android', 'ios'],
34
34
  });
35
35
  }
@@ -67,19 +67,12 @@ class Build extends command_1.Command {
67
67
  }
68
68
  const postQuestions = [];
69
69
  if (result.env !== 'prod') {
70
- let envPath = 'fastlane';
71
- if (result.client) {
72
- envPath += `/clients/${result.client}/fastlane`;
73
- }
74
- require('dotenv').config({ path: process.cwd() + '/' + envPath + '/.env' });
75
- if (process.env.FIREBASE_SERVICE_ACCOUNT_FILE) {
76
- postQuestions.push({
77
- type: 'confirm',
78
- name: 'firebase',
79
- message: 'Would you like to upload to firebase?',
80
- default: true,
81
- });
82
- }
70
+ postQuestions.push({
71
+ type: 'confirm',
72
+ name: 'firebase',
73
+ message: 'Would you like to upload to firebase?',
74
+ default: true,
75
+ });
83
76
  if (process.env.INSTALLR_TOKEN) {
84
77
  postQuestions.push({
85
78
  type: 'confirm',
@@ -158,6 +151,11 @@ class Build extends command_1.Command {
158
151
  return result;
159
152
  };
160
153
  }
154
+ runPlatforms(target, parameters, otherParams) {
155
+ target.forEach((t) => {
156
+ shell.exec(`bundle exec fastlane ${t} build ${parameters.join(' ')} --env ${otherParams.env}`);
157
+ });
158
+ }
161
159
  async run() {
162
160
  const { flags } = this.parse(Build);
163
161
  const params = await this.askForMissingFields(flags);
@@ -169,9 +167,14 @@ class Build extends command_1.Command {
169
167
  shell.exec('bundle update fastlane');
170
168
  shell.exec('bundle update cocoapods');
171
169
  if (client) {
172
- shell.cd(`clients/${client}`);
170
+ client.forEach((c) => {
171
+ shell.cd(`clients/${c}`);
172
+ this.runPlatforms(target, parameters, otherParams);
173
+ });
174
+ }
175
+ else {
176
+ this.runPlatforms(target, parameters, otherParams);
173
177
  }
174
- shell.exec(`bundle exec fastlane ${target} build ${parameters.join(' ')} --env ${otherParams.env}`);
175
178
  }
176
179
  }
177
180
  exports.default = Build;
@@ -1 +1 @@
1
- {"version":"0.4.7","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":[]},"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.1","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":[]},"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.4.7",
4
+ "version": "0.5.1",
5
5
  "author": "Tuan Luong @r0b0t3d",
6
6
  "bin": {
7
7
  "rnbuilder": "./bin/run"