rnbuilder 0.6.4 → 0.6.6
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 +14 -11
- package/lib/commands/build.js +2 -0
- package/lib/commands/onesignal.d.ts +3 -0
- package/lib/commands/onesignal.js +9 -2
- package/lib/utils/common.d.ts +2 -0
- package/lib/utils/common.js +7 -2
- package/lib/utils/setup/fastlane.js +4 -2
- package/lib/utils/setup/launch-screen.js +8 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
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.6.
|
|
23
|
+
rnbuilder/0.6.6 darwin-arm64 node-v16.19.0
|
|
24
24
|
$ rnbuilder --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ rnbuilder COMMAND
|
|
@@ -63,7 +63,7 @@ EXAMPLE
|
|
|
63
63
|
hello world from ./src/build.ts!
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
_See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.
|
|
66
|
+
_See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.6/src/commands/build.ts)_
|
|
67
67
|
|
|
68
68
|
## `rnbuilder codepush [BUILD]`
|
|
69
69
|
|
|
@@ -82,7 +82,7 @@ EXAMPLE
|
|
|
82
82
|
Push changes to existing apps ./src/firebase-sync-udids.ts!
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
_See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.
|
|
85
|
+
_See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.6/src/commands/codepush.ts)_
|
|
86
86
|
|
|
87
87
|
## `rnbuilder help [COMMAND]`
|
|
88
88
|
|
|
@@ -114,7 +114,7 @@ EXAMPLE
|
|
|
114
114
|
initialize environment for first run from ./src/initialize.ts!
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
_See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.
|
|
117
|
+
_See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.6/src/commands/initialize.ts)_
|
|
118
118
|
|
|
119
119
|
## `rnbuilder match-nuke [BUILD]`
|
|
120
120
|
|
|
@@ -133,7 +133,7 @@ EXAMPLE
|
|
|
133
133
|
Nuke certificates ./src/match-nuke.ts!
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
_See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.
|
|
136
|
+
_See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.6/src/commands/match-nuke.ts)_
|
|
137
137
|
|
|
138
138
|
## `rnbuilder onesignal [BUILD]`
|
|
139
139
|
|
|
@@ -144,15 +144,18 @@ USAGE
|
|
|
144
144
|
$ rnbuilder onesignal [BUILD]
|
|
145
145
|
|
|
146
146
|
OPTIONS
|
|
147
|
-
-c, --client=client
|
|
148
|
-
-h, --help
|
|
147
|
+
-c, --client=client Select client that you want to sync udids
|
|
148
|
+
-h, --help show CLI help
|
|
149
|
+
--android_gcm_sender_id=android_gcm_sender_id
|
|
150
|
+
--android_token=android_token
|
|
151
|
+
--auth_token=auth_token Auth token for OneSignal
|
|
149
152
|
|
|
150
153
|
EXAMPLE
|
|
151
154
|
$ rnbuilder onesignal
|
|
152
155
|
Create and upload push certificate to One Signal from ./src/commands/onesignal.ts!
|
|
153
156
|
```
|
|
154
157
|
|
|
155
|
-
_See code: [src/commands/onesignal.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.
|
|
158
|
+
_See code: [src/commands/onesignal.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.6/src/commands/onesignal.ts)_
|
|
156
159
|
|
|
157
160
|
## `rnbuilder setup [SETUP]`
|
|
158
161
|
|
|
@@ -170,7 +173,7 @@ EXAMPLE
|
|
|
170
173
|
hello world from ./src/setup.ts!
|
|
171
174
|
```
|
|
172
175
|
|
|
173
|
-
_See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.
|
|
176
|
+
_See code: [src/commands/setup.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.6/src/commands/setup.ts)_
|
|
174
177
|
|
|
175
178
|
## `rnbuilder submit-review [SUBMIT-REVIEW]`
|
|
176
179
|
|
|
@@ -189,7 +192,7 @@ EXAMPLE
|
|
|
189
192
|
Push changes to existing apps ./src/firebase-sync-udids.ts!
|
|
190
193
|
```
|
|
191
194
|
|
|
192
|
-
_See code: [src/commands/submit-review.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.
|
|
195
|
+
_See code: [src/commands/submit-review.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.6/src/commands/submit-review.ts)_
|
|
193
196
|
|
|
194
197
|
## `rnbuilder sync-udids [BUILD]`
|
|
195
198
|
|
|
@@ -208,5 +211,5 @@ EXAMPLE
|
|
|
208
211
|
Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!
|
|
209
212
|
```
|
|
210
213
|
|
|
211
|
-
_See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.
|
|
214
|
+
_See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.6.6/src/commands/sync-udids.ts)_
|
|
212
215
|
<!-- commandsstop -->
|
package/lib/commands/build.js
CHANGED
|
@@ -5,6 +5,9 @@ export default class OneSignalCertificate extends Command {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
|
7
7
|
client: flags.IOptionFlag<string | undefined>;
|
|
8
|
+
auth_token: flags.IOptionFlag<string | undefined>;
|
|
9
|
+
android_token: flags.IOptionFlag<string | undefined>;
|
|
10
|
+
android_gcm_sender_id: flags.IOptionFlag<string | undefined>;
|
|
8
11
|
};
|
|
9
12
|
static args: {
|
|
10
13
|
name: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
3
4
|
/* eslint-disable no-negated-condition */
|
|
4
5
|
const command_1 = require("@oclif/command");
|
|
5
6
|
const shell = require("shelljs");
|
|
@@ -53,12 +54,13 @@ class OneSignalCertificate extends command_1.Command {
|
|
|
53
54
|
async run() {
|
|
54
55
|
const { flags } = this.parse(OneSignalCertificate);
|
|
55
56
|
const params = await this.askForMissingFields(flags);
|
|
56
|
-
const { client } = params;
|
|
57
|
+
const { client } = params, otherParams = tslib_1.__rest(params, ["client"]);
|
|
58
|
+
const parameters = common_1.buildKeyValuePairs(otherParams);
|
|
57
59
|
shell.exec('bundle install');
|
|
58
60
|
if (client) {
|
|
59
61
|
shell.cd(`fastlane/clients/${client}`);
|
|
60
62
|
}
|
|
61
|
-
shell.exec(
|
|
63
|
+
shell.exec(`bundle exec fastlane sync_onesignal ${parameters.join(' ')}`);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
exports.default = OneSignalCertificate;
|
|
@@ -74,5 +76,10 @@ OneSignalCertificate.flags = {
|
|
|
74
76
|
char: 'c',
|
|
75
77
|
description: 'Select client that you want to sync udids',
|
|
76
78
|
}),
|
|
79
|
+
auth_token: command_1.flags.string({
|
|
80
|
+
description: 'Auth token for OneSignal',
|
|
81
|
+
}),
|
|
82
|
+
android_token: command_1.flags.string(),
|
|
83
|
+
android_gcm_sender_id: command_1.flags.string(),
|
|
77
84
|
};
|
|
78
85
|
OneSignalCertificate.args = [{ name: 'build' }];
|
package/lib/utils/common.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export declare const getAppVersion: (env: string, client?: string | undefined, t
|
|
|
5
5
|
build: number;
|
|
6
6
|
};
|
|
7
7
|
export declare const copyDir: (src: string, dest: string) => Promise<unknown>;
|
|
8
|
+
export declare const ensureDir: (path: string) => void;
|
|
9
|
+
export declare const exists: (path: string) => boolean;
|
|
8
10
|
export declare const copyFile: (srcFile: string, destFile: string) => Promise<unknown>;
|
|
9
11
|
export declare const checkFileExists: (path: string) => boolean;
|
|
10
12
|
export declare const normalise: (input: string) => string;
|
package/lib/utils/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.capitalize = exports.normalise = exports.checkFileExists = exports.copyFile = exports.copyDir = exports.getAppVersion = exports.getDirectories = exports.buildKeyValuePairs = void 0;
|
|
3
|
+
exports.capitalize = exports.normalise = exports.checkFileExists = exports.copyFile = exports.exists = exports.ensureDir = exports.copyDir = exports.getAppVersion = exports.getDirectories = exports.buildKeyValuePairs = void 0;
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
exports.buildKeyValuePairs = (params) => Object.keys(params).map(key => `${key}:${params[key]}`);
|
|
6
6
|
exports.getDirectories = (path) => {
|
|
@@ -45,8 +45,13 @@ exports.copyDir = (src, dest) => new Promise((resolve, reject) => {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
|
+
exports.ensureDir = (path) => {
|
|
49
|
+
if (!fs.existsSync(path)) {
|
|
50
|
+
fs.mkdirSync(path, { recursive: true });
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.exists = (path) => fs.existsSync(path);
|
|
48
54
|
exports.copyFile = (srcFile, destFile) => new Promise((resolve, reject) => {
|
|
49
|
-
console.log('Copy file', srcFile, destFile);
|
|
50
55
|
fs.cp(srcFile, destFile, (err) => {
|
|
51
56
|
if (err) {
|
|
52
57
|
reject(err);
|
|
@@ -7,8 +7,10 @@ const inquirer = require("inquirer");
|
|
|
7
7
|
exports.setupFastlane = async ({ client }) => {
|
|
8
8
|
const clientDir = path.join(process.cwd(), `fastlane/clients/${client}`);
|
|
9
9
|
const fastlaneDir = path.join(clientDir, 'fastlane');
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
if (!common_1.exists(fastlaneDir)) {
|
|
11
|
+
// Copy template folders
|
|
12
|
+
await common_1.copyDir(path.join(process.cwd(), 'template/fastlane'), fastlaneDir);
|
|
13
|
+
}
|
|
12
14
|
const { firebaseServiceAccountFile, firebaseIosApp, firebaseAndroidApp, jsonKeyFile, } = await inquirer.prompt([
|
|
13
15
|
{
|
|
14
16
|
type: 'input',
|
|
@@ -89,10 +89,18 @@ exports.prepareLaunchScreen = async ({ iosAssetFolder, androidAssetFolder, }) =>
|
|
|
89
89
|
}
|
|
90
90
|
else if (launchScreen === 'fullscreen') {
|
|
91
91
|
if (inputFile) {
|
|
92
|
+
// ios
|
|
92
93
|
await common_1.copyDir('./template/BootSplashImage.imageset', path.join(iosAssetFolder, 'BootSplashImage.imageset'));
|
|
93
94
|
await sharp(inputFile)
|
|
94
95
|
.png()
|
|
95
96
|
.toFile(path.join(iosAssetFolder, 'BootSplashImage.imageset/splashTablet.png'));
|
|
97
|
+
// Android
|
|
98
|
+
common_1.ensureDir(path.join(androidAssetFolder, 'layout'));
|
|
99
|
+
common_1.ensureDir(path.join(androidAssetFolder, 'drawable'));
|
|
100
|
+
await common_1.copyFile('./template/splash.xml', path.join(androidAssetFolder, 'layout/splash.xml'));
|
|
101
|
+
await sharp(inputFile)
|
|
102
|
+
.png()
|
|
103
|
+
.toFile(path.join(androidAssetFolder, 'drawable/splash.png'));
|
|
96
104
|
}
|
|
97
105
|
}
|
|
98
106
|
return { launchScreen, launchScreenColor };
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.6.
|
|
1
|
+
{"version":"0.6.6","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"},"auth_token":{"name":"auth_token","type":"option","description":"Auth token for OneSignal"},"android_token":{"name":"android_token","type":"option"},"android_gcm_sender_id":{"name":"android_gcm_sender_id","type":"option"}},"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":"Submit ios for review","pluginName":"rnbuilder","pluginType":"core","aliases":[],"examples":["$ rnbuilder submit-review\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":"submit-review"}]},"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"}]}}}
|