rnbuilder 0.5.1 → 0.5.5
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 +5 -5
- package/lib/commands/build.d.ts +1 -0
- package/lib/commands/build.js +21 -15
- 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.5 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.5.
|
|
60
|
+
_See code: [src/commands/build.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.5/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.5.
|
|
79
|
+
_See code: [src/commands/codepush.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.5/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.5.
|
|
111
|
+
_See code: [src/commands/initialize.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.5/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.5.
|
|
130
|
+
_See code: [src/commands/sync-udids.ts](https://github.com/r0b0t3d/rnbuilder/blob/v0.5.5/src/commands/sync-udids.ts)_
|
|
131
131
|
<!-- 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
|
+
updateAppVersion(targets: string[], client?: string, versionNumber?: string): void;
|
|
18
19
|
runPlatforms(target: string[], parameters: any, otherParams: any): void;
|
|
19
20
|
run(): Promise<void>;
|
|
20
21
|
}
|
package/lib/commands/build.js
CHANGED
|
@@ -132,25 +132,29 @@ class Build extends command_1.Command {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
const appVersion = utils_1.getAppVersion(result.client, result.target);
|
|
136
|
-
const newVersion = Object.assign(Object.assign({}, appVersion), { build: appVersion.build + 1, buildDate: new Date().toDateString() });
|
|
137
|
-
if (result.version_number) {
|
|
138
|
-
newVersion.version = result.version_number;
|
|
139
|
-
}
|
|
140
|
-
const appVersions = require(process.cwd() + '/app.json');
|
|
141
|
-
if (result.client) {
|
|
142
|
-
appVersions[result.client] = Object.assign(Object.assign({}, appVersions[result.client]), { [result.target]: newVersion });
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
appVersions[result.target] = newVersion;
|
|
146
|
-
}
|
|
147
|
-
const json = JSON.stringify(appVersions, null, 2);
|
|
148
|
-
fs.writeFileSync(process.cwd() + '/app.json', json);
|
|
149
|
-
shell.exec('git add . && git commit -m "bump version" && git push');
|
|
150
135
|
}
|
|
151
136
|
return result;
|
|
152
137
|
};
|
|
153
138
|
}
|
|
139
|
+
updateAppVersion(targets, client, versionNumber) {
|
|
140
|
+
const appVersions = require(process.cwd() + '/app.json');
|
|
141
|
+
targets.forEach((t) => {
|
|
142
|
+
const appVersion = utils_1.getAppVersion(client, t);
|
|
143
|
+
const newVersion = Object.assign(Object.assign({}, appVersion), { build: appVersion.build + 1, buildDate: new Date().toDateString() });
|
|
144
|
+
if (versionNumber) {
|
|
145
|
+
newVersion.version = versionNumber;
|
|
146
|
+
}
|
|
147
|
+
if (client) {
|
|
148
|
+
appVersions[client] = Object.assign(Object.assign({}, appVersions[client]), { [t]: newVersion });
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
appVersions[t] = newVersion;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
const json = JSON.stringify(appVersions, null, 2);
|
|
155
|
+
fs.writeFileSync(process.cwd() + '/app.json', json);
|
|
156
|
+
shell.exec('git add . && git commit -m "bump version" && git push');
|
|
157
|
+
}
|
|
154
158
|
runPlatforms(target, parameters, otherParams) {
|
|
155
159
|
target.forEach((t) => {
|
|
156
160
|
shell.exec(`bundle exec fastlane ${t} build ${parameters.join(' ')} --env ${otherParams.env}`);
|
|
@@ -166,10 +170,12 @@ class Build extends command_1.Command {
|
|
|
166
170
|
shell.exec('bundle install');
|
|
167
171
|
shell.exec('bundle update fastlane');
|
|
168
172
|
shell.exec('bundle update cocoapods');
|
|
173
|
+
this.updateAppVersion(target, client, otherParams.version_number);
|
|
169
174
|
if (client) {
|
|
170
175
|
client.forEach((c) => {
|
|
171
176
|
shell.cd(`clients/${c}`);
|
|
172
177
|
this.runPlatforms(target, parameters, otherParams);
|
|
178
|
+
shell.cd('../..');
|
|
173
179
|
});
|
|
174
180
|
}
|
|
175
181
|
else {
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.5.
|
|
1
|
+
{"version":"0.5.5","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"}]}}}
|