rnbuilder 0.5.3 → 0.5.7
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 +25 -5
- package/lib/commands/build.d.ts +2 -1
- package/lib/commands/build.js +23 -12
- package/lib/commands/match-nuke.d.ts +14 -0
- package/lib/commands/match-nuke.js +57 -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.5.
|
|
23
|
+
rnbuilder/0.5.7 darwin-arm64 node-v16.13.0
|
|
24
24
|
$ rnbuilder --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ rnbuilder COMMAND
|
|
@@ -33,6 +33,7 @@ USAGE
|
|
|
33
33
|
* [`rnbuilder codepush [BUILD]`](#rnbuilder-codepush-build)
|
|
34
34
|
* [`rnbuilder help [COMMAND]`](#rnbuilder-help-command)
|
|
35
35
|
* [`rnbuilder initialize`](#rnbuilder-initialize)
|
|
36
|
+
* [`rnbuilder match-nuke [BUILD]`](#rnbuilder-match-nuke-build)
|
|
36
37
|
* [`rnbuilder sync-udids [BUILD]`](#rnbuilder-sync-udids-build)
|
|
37
38
|
|
|
38
39
|
## `rnbuilder build [BUILD]`
|
|
@@ -57,7 +58,7 @@ EXAMPLE
|
|
|
57
58
|
hello world from ./src/build.ts!
|
|
58
59
|
```
|
|
59
60
|
|
|
60
|
-
_See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.
|
|
61
|
+
_See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.7/src/commands/build.ts)_
|
|
61
62
|
|
|
62
63
|
## `rnbuilder codepush [BUILD]`
|
|
63
64
|
|
|
@@ -76,7 +77,7 @@ EXAMPLE
|
|
|
76
77
|
Push changes to existing apps ./src/firebase-sync-udids.ts!
|
|
77
78
|
```
|
|
78
79
|
|
|
79
|
-
_See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.
|
|
80
|
+
_See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.7/src/commands/codepush.ts)_
|
|
80
81
|
|
|
81
82
|
## `rnbuilder help [COMMAND]`
|
|
82
83
|
|
|
@@ -108,7 +109,26 @@ EXAMPLE
|
|
|
108
109
|
initialize environment for first run from ./src/initialize.ts!
|
|
109
110
|
```
|
|
110
111
|
|
|
111
|
-
_See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.
|
|
112
|
+
_See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.7/src/commands/initialize.ts)_
|
|
113
|
+
|
|
114
|
+
## `rnbuilder match-nuke [BUILD]`
|
|
115
|
+
|
|
116
|
+
Nuke certificates
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
USAGE
|
|
120
|
+
$ rnbuilder match-nuke [BUILD]
|
|
121
|
+
|
|
122
|
+
OPTIONS
|
|
123
|
+
-c, --client=client Select client that you want to sync udids
|
|
124
|
+
-h, --help show CLI help
|
|
125
|
+
|
|
126
|
+
EXAMPLE
|
|
127
|
+
$ rnbuilder match-nuke
|
|
128
|
+
Nuke certificates ./src/match-nuke.ts!
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
_See code: [src/commands/match-nuke.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.7/src/commands/match-nuke.ts)_
|
|
112
132
|
|
|
113
133
|
## `rnbuilder sync-udids [BUILD]`
|
|
114
134
|
|
|
@@ -127,5 +147,5 @@ EXAMPLE
|
|
|
127
147
|
Sync device UDIDs from firebase from ./src/firebase-sync-udids.ts!
|
|
128
148
|
```
|
|
129
149
|
|
|
130
|
-
_See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.
|
|
150
|
+
_See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.7/src/commands/sync-udids.ts)_
|
|
131
151
|
<!-- commandsstop -->
|
package/lib/commands/build.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export default class Build extends Command {
|
|
|
15
15
|
name: string;
|
|
16
16
|
}[];
|
|
17
17
|
askForMissingFields: (flags: any) => Promise<any>;
|
|
18
|
-
|
|
18
|
+
updateAppVersion(targets: string[], client?: string, versionNumber?: string): void;
|
|
19
|
+
runPlatforms(target: string[], parameters: any, otherParams: any): void;
|
|
19
20
|
run(): Promise<void>;
|
|
20
21
|
}
|
package/lib/commands/build.js
CHANGED
|
@@ -136,26 +136,26 @@ class Build extends command_1.Command {
|
|
|
136
136
|
return result;
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
target.forEach((t) => {
|
|
139
|
+
updateAppVersion(targets, client, versionNumber) {
|
|
140
|
+
const appVersions = require(process.cwd() + '/app.json');
|
|
141
|
+
targets.forEach((t) => {
|
|
144
142
|
const appVersion = utils_1.getAppVersion(client, t);
|
|
145
143
|
const newVersion = Object.assign(Object.assign({}, appVersion), { build: appVersion.build + 1, buildDate: new Date().toDateString() });
|
|
146
|
-
if (
|
|
147
|
-
newVersion.version =
|
|
144
|
+
if (versionNumber) {
|
|
145
|
+
newVersion.version = versionNumber;
|
|
148
146
|
}
|
|
149
|
-
const appVersions = require(process.cwd() + '/app.json');
|
|
150
147
|
if (client) {
|
|
151
148
|
appVersions[client] = Object.assign(Object.assign({}, appVersions[client]), { [t]: newVersion });
|
|
152
149
|
}
|
|
153
150
|
else {
|
|
154
151
|
appVersions[t] = newVersion;
|
|
155
152
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
});
|
|
154
|
+
const json = JSON.stringify(appVersions, null, 2);
|
|
155
|
+
fs.writeFileSync(process.cwd() + '/app.json', json);
|
|
156
|
+
}
|
|
157
|
+
runPlatforms(target, parameters, otherParams) {
|
|
158
|
+
target.forEach((t) => {
|
|
159
159
|
shell.exec(`bundle exec fastlane ${t} build ${parameters.join(' ')} --env ${otherParams.env}`);
|
|
160
160
|
});
|
|
161
161
|
}
|
|
@@ -164,6 +164,15 @@ class Build extends command_1.Command {
|
|
|
164
164
|
const params = await this.askForMissingFields(flags);
|
|
165
165
|
const { client, target } = params, otherParams = tslib_1.__rest(params, ["client", "target"]);
|
|
166
166
|
const parameters = utils_1.buildKeyValuePairs(otherParams);
|
|
167
|
+
if (client) {
|
|
168
|
+
client.forEach((c) => {
|
|
169
|
+
this.updateAppVersion(target, c, otherParams.version_number);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
this.updateAppVersion(target, undefined, otherParams.version_number);
|
|
174
|
+
}
|
|
175
|
+
shell.exec('git add . && git commit -m "bump version" && git push');
|
|
167
176
|
shell.cd('fastlane');
|
|
168
177
|
shell.exec('bundle update --bundler');
|
|
169
178
|
shell.exec('bundle install');
|
|
@@ -171,7 +180,9 @@ class Build extends command_1.Command {
|
|
|
171
180
|
shell.exec('bundle update cocoapods');
|
|
172
181
|
if (client) {
|
|
173
182
|
client.forEach((c) => {
|
|
174
|
-
|
|
183
|
+
shell.cd(`clients/${c}`);
|
|
184
|
+
this.runPlatforms(target, parameters, otherParams);
|
|
185
|
+
shell.cd('../..');
|
|
175
186
|
});
|
|
176
187
|
}
|
|
177
188
|
else {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command, flags } from '@oclif/command';
|
|
2
|
+
export default class MatchNuke 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,57 @@
|
|
|
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 utils_1 = require("../utils");
|
|
8
|
+
class MatchNuke extends command_1.Command {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.askForMissingFields = async (flags) => {
|
|
12
|
+
const questions = [];
|
|
13
|
+
if (!flags.client) {
|
|
14
|
+
const clients = utils_1.getDirectories('./fastlane/clients');
|
|
15
|
+
if (clients.length > 0) {
|
|
16
|
+
questions.push({
|
|
17
|
+
type: 'list',
|
|
18
|
+
name: 'client',
|
|
19
|
+
message: 'What is the client?',
|
|
20
|
+
choices: clients,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
let result = flags;
|
|
25
|
+
if (questions.length > 0) {
|
|
26
|
+
const answers = await inquirer.prompt(questions);
|
|
27
|
+
result = Object.assign(Object.assign({}, flags), answers);
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
async run() {
|
|
33
|
+
const { flags } = this.parse(MatchNuke);
|
|
34
|
+
const params = await this.askForMissingFields(flags);
|
|
35
|
+
const { client } = params;
|
|
36
|
+
let envPath = 'fastlane';
|
|
37
|
+
if (client) {
|
|
38
|
+
envPath += `/clients/${client}/fastlane`;
|
|
39
|
+
}
|
|
40
|
+
require('dotenv').config({ path: process.cwd() + '/' + envPath + '/.env' });
|
|
41
|
+
shell.cd('fastlane');
|
|
42
|
+
const command = `bundle exec fastlane run match_nuke type:adhoc username:${process.env.APPLE_ID} team_id:${process.env.APPLE_TEAM_ID} git_url:${process.env.MATCH_GIT_URL} git_branch:${process.env.CLIENT} app_identifier:${process.env.APP_IDENTIFIER}.staging`;
|
|
43
|
+
console.log({ command });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = MatchNuke;
|
|
47
|
+
MatchNuke.description = 'Nuke certificates';
|
|
48
|
+
MatchNuke.examples = [
|
|
49
|
+
`$ rnbuilder match-nuke
|
|
50
|
+
Nuke certificates ./src/match-nuke.ts!
|
|
51
|
+
`,
|
|
52
|
+
];
|
|
53
|
+
MatchNuke.flags = {
|
|
54
|
+
help: command_1.flags.help({ char: 'h' }),
|
|
55
|
+
client: command_1.flags.string({ char: 'c', description: 'Select client that you want to sync udids' }),
|
|
56
|
+
};
|
|
57
|
+
MatchNuke.args = [{ name: 'build' }];
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.5.
|
|
1
|
+
{"version":"0.5.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":[]},"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"}]},"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"}]}}}
|