rnbuilder 0.5.28 → 0.5.30

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.28 darwin-arm64 node-v16.19.0
23
+ rnbuilder/0.5.30 darwin-arm64 node-v16.19.0
24
24
  $ rnbuilder --help [COMMAND]
25
25
  USAGE
26
26
  $ rnbuilder COMMAND
@@ -34,6 +34,7 @@ USAGE
34
34
  * [`rnbuilder help [COMMAND]`](#rnbuilder-help-command)
35
35
  * [`rnbuilder initialize`](#rnbuilder-initialize)
36
36
  * [`rnbuilder match-nuke [BUILD]`](#rnbuilder-match-nuke-build)
37
+ * [`rnbuilder onesignal [BUILD]`](#rnbuilder-onesignal-build)
37
38
  * [`rnbuilder setup [SETUP]`](#rnbuilder-setup-setup)
38
39
  * [`rnbuilder sync-udids [BUILD]`](#rnbuilder-sync-udids-build)
39
40
 
@@ -52,6 +53,7 @@ OPTIONS
52
53
  -g, --ignore_git_reset Ignore git reset when building
53
54
  -h, --help show CLI help
54
55
  -i, --installr=installr If enabled, the build will be uploaded to installR
56
+ -s, --ignore_cleanup Ignore cleanup when building
55
57
  -t, --target=android|ios Set the build target: android, ios or both
56
58
  -v, --version=version Set the version number for this build
57
59
 
@@ -60,7 +62,7 @@ EXAMPLE
60
62
  hello world from ./src/build.ts!
61
63
  ```
62
64
 
63
- _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/build.ts)_
65
+ _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/build.ts)_
64
66
 
65
67
  ## `rnbuilder codepush [BUILD]`
66
68
 
@@ -79,7 +81,7 @@ EXAMPLE
79
81
  Push changes to existing apps ./src/firebase-sync-udids.ts!
80
82
  ```
81
83
 
82
- _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/codepush.ts)_
84
+ _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/codepush.ts)_
83
85
 
84
86
  ## `rnbuilder help [COMMAND]`
85
87
 
@@ -111,7 +113,7 @@ EXAMPLE
111
113
  initialize environment for first run from ./src/initialize.ts!
112
114
  ```
113
115
 
114
- _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/initialize.ts)_
116
+ _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/initialize.ts)_
115
117
 
116
118
  ## `rnbuilder match-nuke [BUILD]`
117
119
 
@@ -130,7 +132,26 @@ EXAMPLE
130
132
  Nuke certificates ./src/match-nuke.ts!
131
133
  ```
132
134
 
133
- _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/match-nuke.ts)_
135
+ _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/match-nuke.ts)_
136
+
137
+ ## `rnbuilder onesignal [BUILD]`
138
+
139
+ Create and upload push cerfiticate to One Signal
140
+
141
+ ```
142
+ USAGE
143
+ $ rnbuilder onesignal [BUILD]
144
+
145
+ OPTIONS
146
+ -c, --client=client Select client that you want to sync udids
147
+ -h, --help show CLI help
148
+
149
+ EXAMPLE
150
+ $ rnbuilder onesignal
151
+ Create and upload push certificate to One Signal from ./src/commands/onesignal.ts!
152
+ ```
153
+
154
+ _See code: [src/commands/onesignal.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/onesignal.ts)_
134
155
 
135
156
  ## `rnbuilder setup [SETUP]`
136
157
 
@@ -148,7 +169,7 @@ EXAMPLE
148
169
  hello world from ./src/setup.ts!
149
170
  ```
150
171
 
151
- _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/setup.ts)_
172
+ _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/setup.ts)_
152
173
 
153
174
  ## `rnbuilder sync-udids [BUILD]`
154
175
 
@@ -167,5 +188,5 @@ EXAMPLE
167
188
  Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!
168
189
  ```
169
190
 
170
- _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/sync-udids.ts)_
191
+ _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.30/src/commands/sync-udids.ts)_
171
192
  <!-- 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 OneSignalCertificate 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,79 @@
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
+ inquirer.registerPrompt('checkbox-plus', require('inquirer-checkbox-plus-prompt'));
9
+ class OneSignalCertificate extends command_1.Command {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.askForMissingFields = async (flags) => {
13
+ const questions = [];
14
+ if (!flags.client) {
15
+ const clients = common_1.getDirectories('./fastlane/clients');
16
+ if (clients.length > 0) {
17
+ questions.push({
18
+ type: 'checkbox-plus',
19
+ name: 'client',
20
+ message: 'What is the client?',
21
+ pageSize: 100,
22
+ highlight: true,
23
+ searchable: true,
24
+ default: [],
25
+ source: (answersSoFar, input) => {
26
+ input = input || '';
27
+ return new Promise(resolve => {
28
+ const result = clients.filter(client => client.includes(input.toLowerCase()));
29
+ resolve(result);
30
+ });
31
+ },
32
+ validate: (input) => {
33
+ return new Promise(resolve => {
34
+ if (input.length === 0) {
35
+ resolve('You need to select at least 1 client');
36
+ }
37
+ else {
38
+ resolve(true);
39
+ }
40
+ });
41
+ },
42
+ });
43
+ }
44
+ }
45
+ let result = flags;
46
+ if (questions.length > 0) {
47
+ const answers = await inquirer.prompt(questions);
48
+ result = Object.assign(Object.assign({}, flags), answers);
49
+ }
50
+ return result;
51
+ };
52
+ }
53
+ async run() {
54
+ const { flags } = this.parse(OneSignalCertificate);
55
+ const params = await this.askForMissingFields(flags);
56
+ const { client } = params;
57
+ shell.cd('fastlane');
58
+ shell.exec('bundle install');
59
+ if (client) {
60
+ shell.cd(`clients/${client}`);
61
+ }
62
+ shell.exec('bundle exec fastlane sync_onesignal');
63
+ }
64
+ }
65
+ exports.default = OneSignalCertificate;
66
+ OneSignalCertificate.description = 'Create and upload push cerfiticate to One Signal';
67
+ OneSignalCertificate.examples = [
68
+ `$ rnbuilder onesignal
69
+ Create and upload push certificate to One Signal from ./src/commands/onesignal.ts!
70
+ `,
71
+ ];
72
+ OneSignalCertificate.flags = {
73
+ help: command_1.flags.help({ char: 'h' }),
74
+ client: command_1.flags.string({
75
+ char: 'c',
76
+ description: 'Select client that you want to sync udids',
77
+ }),
78
+ };
79
+ OneSignalCertificate.args = [{ name: 'build' }];
@@ -1 +1 @@
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"}]}}}
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"}]}}}
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.28",
4
+ "version": "0.5.30",
5
5
  "author": "Tuan Luong @r0b0t3d",
6
6
  "bin": {
7
7
  "rnbuilder": "./bin/run"