rnbuilder 0.5.28 → 0.5.29

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.29 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
 
@@ -60,7 +61,7 @@ EXAMPLE
60
61
  hello world from ./src/build.ts!
61
62
  ```
62
63
 
63
- _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/build.ts)_
64
+ _See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/build.ts)_
64
65
 
65
66
  ## `rnbuilder codepush [BUILD]`
66
67
 
@@ -79,7 +80,7 @@ EXAMPLE
79
80
  Push changes to existing apps ./src/firebase-sync-udids.ts!
80
81
  ```
81
82
 
82
- _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/codepush.ts)_
83
+ _See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/codepush.ts)_
83
84
 
84
85
  ## `rnbuilder help [COMMAND]`
85
86
 
@@ -111,7 +112,7 @@ EXAMPLE
111
112
  initialize environment for first run from ./src/initialize.ts!
112
113
  ```
113
114
 
114
- _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/initialize.ts)_
115
+ _See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/initialize.ts)_
115
116
 
116
117
  ## `rnbuilder match-nuke [BUILD]`
117
118
 
@@ -130,7 +131,26 @@ EXAMPLE
130
131
  Nuke certificates ./src/match-nuke.ts!
131
132
  ```
132
133
 
133
- _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/match-nuke.ts)_
134
+ _See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/match-nuke.ts)_
135
+
136
+ ## `rnbuilder onesignal [BUILD]`
137
+
138
+ Create and upload push cerfiticate to One Signal
139
+
140
+ ```
141
+ USAGE
142
+ $ rnbuilder onesignal [BUILD]
143
+
144
+ OPTIONS
145
+ -c, --client=client Select client that you want to sync udids
146
+ -h, --help show CLI help
147
+
148
+ EXAMPLE
149
+ $ rnbuilder onesignal
150
+ Create and upload push certificate to One Signal from ./src/commands/onesignal.ts!
151
+ ```
152
+
153
+ _See code: [src/commands/onesignal.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/onesignal.ts)_
134
154
 
135
155
  ## `rnbuilder setup [SETUP]`
136
156
 
@@ -148,7 +168,7 @@ EXAMPLE
148
168
  hello world from ./src/setup.ts!
149
169
  ```
150
170
 
151
- _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/setup.ts)_
171
+ _See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/setup.ts)_
152
172
 
153
173
  ## `rnbuilder sync-udids [BUILD]`
154
174
 
@@ -167,5 +187,5 @@ EXAMPLE
167
187
  Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!
168
188
  ```
169
189
 
170
- _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.28/src/commands/sync-udids.ts)_
190
+ _See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.29/src/commands/sync-udids.ts)_
171
191
  <!-- commandsstop -->
@@ -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.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"}]}}}
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.29",
5
5
  "author": "Tuan Luong @r0b0t3d",
6
6
  "bin": {
7
7
  "rnbuilder": "./bin/run"