expo-release-it 0.6.0 → 0.6.2
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/build/EnvUtil-DWWwkHaf.js +8 -0
- package/build/EnvUtil-DWWwkHaf.js.map +1 -0
- package/build/FastlaneOption-B9A0ECDL.js +35 -0
- package/build/FastlaneOption-B9A0ECDL.js.map +1 -0
- package/build/FileUtil-B9JnWobK.js +57 -0
- package/build/FileUtil-B9JnWobK.js.map +1 -0
- package/build/InqueryInputs-BGj-DlRa.js +112 -0
- package/build/InqueryInputs-BGj-DlRa.js.map +1 -0
- package/build/MetadataSyncUtil-j79hX3QT.js +42 -0
- package/build/MetadataSyncUtil-j79hX3QT.js.map +1 -0
- package/build/OptionHolder-H3HG0A95.js +99 -0
- package/build/OptionHolder-H3HG0A95.js.map +1 -0
- package/build/VersionUtil-BDB10Hpb.js +101 -0
- package/build/VersionUtil-BDB10Hpb.js.map +1 -0
- package/build/build-DLOdnj2j.js +88 -0
- package/build/build-DLOdnj2j.js.map +1 -0
- package/build/bump-0hlTovjE.js +122 -0
- package/build/bump-0hlTovjE.js.map +1 -0
- package/build/calculateElapsed-CynU9UU_.js +13 -0
- package/build/calculateElapsed-CynU9UU_.js.map +1 -0
- package/build/command/build.d.ts +7 -3
- package/build/command/build.js +23 -711
- package/build/command/bump.d.ts +7 -3
- package/build/command/bump.js +14 -486
- package/build/command/init.d.ts +7 -3
- package/build/command/init.js +13 -462
- package/build/command/pull.d.ts +7 -3
- package/build/command/pull.js +22 -696
- package/build/command/submit.d.ts +7 -3
- package/build/command/submit.js +23 -700
- package/build/command/upload.d.ts +7 -3
- package/build/command/upload.js +23 -705
- package/build/execShellScript-Bd5xbFX5.js +22 -0
- package/build/execShellScript-Bd5xbFX5.js.map +1 -0
- package/build/generateAppStoreConnectApiKeyFile-DjxlrcZn.js +18 -0
- package/build/generateAppStoreConnectApiKeyFile-DjxlrcZn.js.map +1 -0
- package/build/hydrateKeyholderFileValues-BoaRs3SC.js +11 -0
- package/build/hydrateKeyholderFileValues-BoaRs3SC.js.map +1 -0
- package/build/index.d.ts +3 -1
- package/build/index.js +62 -1247
- package/build/index.js.map +1 -1
- package/build/init-cjD4jZiy.js +148 -0
- package/build/init-cjD4jZiy.js.map +1 -0
- package/build/injectTemplatePlaceHolders-CpIvd0dG.js +16 -0
- package/build/injectTemplatePlaceHolders-CpIvd0dG.js.map +1 -0
- package/build/iterateAllFiles-CbEPek2B.js +15 -0
- package/build/iterateAllFiles-CbEPek2B.js.map +1 -0
- package/build/logger-DvQ7ScMQ.js +16 -0
- package/build/logger-DvQ7ScMQ.js.map +1 -0
- package/build/parseConfigFile-hMLUnLZR.js +29 -0
- package/build/parseConfigFile-hMLUnLZR.js.map +1 -0
- package/build/prepareAndroid-Cjz6r6o0.js +53 -0
- package/build/prepareAndroid-Cjz6r6o0.js.map +1 -0
- package/build/prepareIos-ByPLFHC8.js +33 -0
- package/build/prepareIos-ByPLFHC8.js.map +1 -0
- package/build/pull-BHSlClDy.js +70 -0
- package/build/pull-BHSlClDy.js.map +1 -0
- package/build/replaceStringIfNotContain-CgZ460_D.js +9 -0
- package/build/replaceStringIfNotContain-CgZ460_D.js.map +1 -0
- package/build/setup-CRNjdK5q.js +25 -0
- package/build/setup-CRNjdK5q.js.map +1 -0
- package/build/spinner-BVmbE9I_.js +15 -0
- package/build/spinner-BVmbE9I_.js.map +1 -0
- package/build/submit-5gTyWBU2.js +65 -0
- package/build/submit-5gTyWBU2.js.map +1 -0
- package/build/throwError-DMF6E5pu.js +14 -0
- package/build/throwError-DMF6E5pu.js.map +1 -0
- package/build/type/{ExpoReleaseItConfiguration.d.d.ts → ExpoReleaseItConfiguration.d.ts} +7 -5
- package/build/upload-S09j3abh.js +68 -0
- package/build/upload-S09j3abh.js.map +1 -0
- package/build/util/EnvUtil.d.ts +3 -1
- package/build/util/EnvUtil.js +3 -10
- package/build/util/FastlaneOption.d.ts +3 -1
- package/build/util/FastlaneOption.js +4 -118
- package/build/util/FileUtil.d.ts +4 -2
- package/build/util/FileUtil.js +3 -78
- package/build/util/MetadataSyncUtil.d.ts +3 -1
- package/build/util/MetadataSyncUtil.js +5 -177
- package/build/util/OptionHolder.d.ts +45 -43
- package/build/util/OptionHolder.js +3 -88
- package/build/util/calculateElapsed.d.ts +3 -1
- package/build/util/calculateElapsed.js +3 -12
- package/build/util/generateAppStoreConnectApiKeyFile.d.ts +3 -1
- package/build/util/generateAppStoreConnectApiKeyFile.js +4 -117
- package/build/util/injectTemplatePlaceHolders.d.ts +3 -1
- package/build/util/injectTemplatePlaceHolders.js +5 -137
- package/build/util/input/InqueryInputs.d.ts +19 -12
- package/build/util/input/InqueryInputs.js +4 -205
- package/build/util/iterateAllFiles.d.ts +3 -1
- package/build/util/iterateAllFiles.js +3 -34
- package/build/util/logger.d.ts +10 -8
- package/build/util/logger.js +3 -16
- package/build/util/parseConfigFile.d.ts +3 -1
- package/build/util/parseConfigFile.js +4 -151
- package/build/util/replaceStringIfNotContain.d.ts +5 -0
- package/build/util/replaceStringIfNotContain.js +3 -0
- package/build/util/setup/VersionUtil.d.ts +9 -4
- package/build/util/setup/VersionUtil.js +8 -253
- package/build/util/setup/execShellScript.d.ts +16 -14
- package/build/util/setup/execShellScript.js +3 -19
- package/build/util/setup/hydrateKeyholderFileValues.d.ts +3 -1
- package/build/util/setup/hydrateKeyholderFileValues.js +4 -101
- package/build/util/setup/prepareAndroid.d.ts +3 -1
- package/build/util/setup/prepareAndroid.js +12 -281
- package/build/util/setup/prepareIos.d.ts +3 -1
- package/build/util/setup/prepareIos.js +11 -263
- package/build/util/setup/setup.d.ts +3 -1
- package/build/util/setup/setup.js +11 -272
- package/build/util/spinner.d.ts +3 -1
- package/build/util/spinner.js +3 -14
- package/build/util/throwError.d.ts +3 -1
- package/build/util/throwError.js +4 -33
- package/package.json +5 -5
- package/build/command/build.js.map +0 -1
- package/build/command/bump.js.map +0 -1
- package/build/command/init.js.map +0 -1
- package/build/command/pull.js.map +0 -1
- package/build/command/submit.js.map +0 -1
- package/build/command/upload.js.map +0 -1
- package/build/type/ExpoReleaseItConfiguration.d.js +0 -1
- package/build/type/ExpoReleaseItConfiguration.d.js.map +0 -1
- package/build/util/EnvUtil.js.map +0 -1
- package/build/util/FastlaneOption.js.map +0 -1
- package/build/util/FileUtil.js.map +0 -1
- package/build/util/MetadataSyncUtil.js.map +0 -1
- package/build/util/OptionHolder.js.map +0 -1
- package/build/util/calculateElapsed.js.map +0 -1
- package/build/util/generateAppStoreConnectApiKeyFile.js.map +0 -1
- package/build/util/injectTemplatePlaceHolders.js.map +0 -1
- package/build/util/input/InqueryInputs.js.map +0 -1
- package/build/util/iterateAllFiles.js.map +0 -1
- package/build/util/logger.js.map +0 -1
- package/build/util/parseConfigFile.js.map +0 -1
- package/build/util/setup/VersionUtil.js.map +0 -1
- package/build/util/setup/execShellScript.js.map +0 -1
- package/build/util/setup/hydrateKeyholderFileValues.js.map +0 -1
- package/build/util/setup/prepareAndroid.js.map +0 -1
- package/build/util/setup/prepareIos.js.map +0 -1
- package/build/util/setup/setup.js.map +0 -1
- package/build/util/spinner.js.map +0 -1
- package/build/util/throwError.js.map +0 -1
package/build/command/pull.js
CHANGED
|
@@ -1,696 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"fs-extra": "^11.3.0",
|
|
24
|
-
ora: "^8.2.0",
|
|
25
|
-
react: "catalog:native",
|
|
26
|
-
"react-native": "catalog:native",
|
|
27
|
-
semver: "^7.7.1",
|
|
28
|
-
url: "^0.11.4"
|
|
29
|
-
},
|
|
30
|
-
devDependencies: {
|
|
31
|
-
"@commitlint/config-conventional": "^19.8.0",
|
|
32
|
-
"@release-it/conventional-changelog": "^10.0.1",
|
|
33
|
-
"@types/fs-extra": "^11.0.4",
|
|
34
|
-
"@types/semver": "^7.7.0",
|
|
35
|
-
"json-schema-to-typescript": "^15.0.4",
|
|
36
|
-
lefthook: "^1.11.11",
|
|
37
|
-
prettier: "catalog:",
|
|
38
|
-
"release-it": "^19.0.1",
|
|
39
|
-
"tiny-glob": "^0.2.9",
|
|
40
|
-
tsup: "^8.4.0",
|
|
41
|
-
typescript: "catalog:",
|
|
42
|
-
vitest: "^3.1.2"
|
|
43
|
-
},
|
|
44
|
-
bin: "./bin/expo-release-it.mjs",
|
|
45
|
-
files: [
|
|
46
|
-
"build",
|
|
47
|
-
"package.json",
|
|
48
|
-
"bin",
|
|
49
|
-
"template",
|
|
50
|
-
"expo-release-it.schema.json"
|
|
51
|
-
],
|
|
52
|
-
commitlint: {
|
|
53
|
-
extends: [
|
|
54
|
-
"@commitlint/config-conventional"
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
packageManager: "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// src/util/FileUtil.ts
|
|
61
|
-
import fs from "fs-extra";
|
|
62
|
-
import * as path from "path";
|
|
63
|
-
var join2 = path.join;
|
|
64
|
-
var resolve2 = path.resolve;
|
|
65
|
-
function exist(path2) {
|
|
66
|
-
return fs.existsSync(path2);
|
|
67
|
-
}
|
|
68
|
-
function isDir(path2) {
|
|
69
|
-
return exist(path2) && fs.lstatSync(path2).isDirectory();
|
|
70
|
-
}
|
|
71
|
-
function relativePath(from, to) {
|
|
72
|
-
return path.relative(from, to);
|
|
73
|
-
}
|
|
74
|
-
function isFile(path2) {
|
|
75
|
-
return exist(path2) && fs.lstatSync(path2).isFile();
|
|
76
|
-
}
|
|
77
|
-
function read(path2) {
|
|
78
|
-
return fs.readFileSync(path2, { encoding: "utf8" });
|
|
79
|
-
}
|
|
80
|
-
function readdir(path2) {
|
|
81
|
-
return fs.readdirSync(path2);
|
|
82
|
-
}
|
|
83
|
-
function readJsonSlow(path2) {
|
|
84
|
-
return fs.readJSONSync(path2);
|
|
85
|
-
}
|
|
86
|
-
function write(p, content) {
|
|
87
|
-
const dir = path.dirname(p);
|
|
88
|
-
if (!exist(dir)) {
|
|
89
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
90
|
-
}
|
|
91
|
-
return fs.writeFileSync(p, content);
|
|
92
|
-
}
|
|
93
|
-
function copy(src, dest, options) {
|
|
94
|
-
fs.copySync(src, dest, options);
|
|
95
|
-
}
|
|
96
|
-
function writeJson(path2, json) {
|
|
97
|
-
return write(path2, JSON.stringify(json, null, 2));
|
|
98
|
-
}
|
|
99
|
-
function remove(path2) {
|
|
100
|
-
if (!exist(path2)) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (fs.lstatSync(path2).isDirectory()) {
|
|
104
|
-
return fs.rmSync(path2, { force: true, recursive: true });
|
|
105
|
-
} else {
|
|
106
|
-
return fs.rmSync(path2, { force: true });
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
async function iterateDir(path2, fn) {
|
|
110
|
-
if (!isDir(path2)) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
for (const file of fs.readdirSync(path2)) {
|
|
114
|
-
await fn(file);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// src/util/OptionHolder.ts
|
|
119
|
-
import { fileURLToPath } from "url";
|
|
120
|
-
var OptionHolder = {
|
|
121
|
-
cli: {
|
|
122
|
-
version: package_default.version,
|
|
123
|
-
rootDir: resolve2(fileURLToPath(import.meta.url), "../.."),
|
|
124
|
-
templateDir: resolve2(fileURLToPath(import.meta.url), "../../template")
|
|
125
|
-
},
|
|
126
|
-
input: {
|
|
127
|
-
git: {}
|
|
128
|
-
},
|
|
129
|
-
keyholderMap: {},
|
|
130
|
-
templateDirNames: ["key"],
|
|
131
|
-
projectDir: "",
|
|
132
|
-
resourcesDir: "",
|
|
133
|
-
keyDir: "",
|
|
134
|
-
keyholderFilePath: "",
|
|
135
|
-
versionName: "",
|
|
136
|
-
versionCode: "",
|
|
137
|
-
tempDir: ""
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
// src/util/input/InqueryInputs.ts
|
|
141
|
-
import { select } from "@inquirer/prompts";
|
|
142
|
-
import { is } from "@mj-studio/js-util";
|
|
143
|
-
import chalk from "chalk";
|
|
144
|
-
var InqueryInputs = {
|
|
145
|
-
platform: async () => {
|
|
146
|
-
if (!OptionHolder.input.platform) {
|
|
147
|
-
OptionHolder.input.platform = await select({
|
|
148
|
-
message: constructInquirerFormattedMessage({
|
|
149
|
-
name: "Platform",
|
|
150
|
-
explanation: `Platform to run action`
|
|
151
|
-
}),
|
|
152
|
-
choices: [
|
|
153
|
-
{ name: "ios", value: "ios", description: "Release ios" },
|
|
154
|
-
{ name: "android", value: "android", description: "Release android" }
|
|
155
|
-
]
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
podinstall: async () => {
|
|
160
|
-
if (OptionHolder.input.platform === "ios") {
|
|
161
|
-
OptionHolder.input.pod = await select({
|
|
162
|
-
message: constructInquirerFormattedMessage({
|
|
163
|
-
name: "Install CocoaPods?"
|
|
164
|
-
}),
|
|
165
|
-
choices: [
|
|
166
|
-
{ name: "yes", value: true, description: "Install pods before release" },
|
|
167
|
-
{ name: "no", value: false, description: "Skip pods install" }
|
|
168
|
-
]
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
androidBuildOutput: async () => {
|
|
173
|
-
if (OptionHolder.input.platform === "android") {
|
|
174
|
-
if (!OptionHolder.input.androidOutput) {
|
|
175
|
-
OptionHolder.input.androidOutput = await select({
|
|
176
|
-
message: constructInquirerFormattedMessage({
|
|
177
|
-
name: "Android output artifact type"
|
|
178
|
-
}),
|
|
179
|
-
choices: [
|
|
180
|
-
{ name: "aab", value: "aab", description: "Build as App bundle" },
|
|
181
|
-
{ name: "apk", value: "apk", description: "Build as APK" }
|
|
182
|
-
]
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
uploadMetadata: async () => {
|
|
188
|
-
if (!is.boolean(OptionHolder.input.uploadMetadata)) {
|
|
189
|
-
OptionHolder.input.uploadMetadata = await select({
|
|
190
|
-
message: constructInquirerFormattedMessage({
|
|
191
|
-
name: "Upload Text Metadata(title, description, ...)"
|
|
192
|
-
}),
|
|
193
|
-
choices: [
|
|
194
|
-
{ name: "yes", value: true, description: "Upload" },
|
|
195
|
-
{ name: "no", value: false, description: "Don't Upload" }
|
|
196
|
-
]
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
uploadScreenshot: async () => {
|
|
201
|
-
if (!is.boolean(OptionHolder.input.uploadScreenshot)) {
|
|
202
|
-
OptionHolder.input.uploadScreenshot = await select({
|
|
203
|
-
message: constructInquirerFormattedMessage({
|
|
204
|
-
name: "Upload Screenshots & Images"
|
|
205
|
-
}),
|
|
206
|
-
choices: [
|
|
207
|
-
{ name: "yes", value: true, description: "Upload" },
|
|
208
|
-
{ name: "no", value: false, description: "Don't Upload" }
|
|
209
|
-
]
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
useLiveVersionIos: async () => {
|
|
214
|
-
if (!is.boolean(OptionHolder.input.useLiveVersionIos) && OptionHolder.input.platform === "ios") {
|
|
215
|
-
OptionHolder.input.useLiveVersionIos = await select({
|
|
216
|
-
message: constructInquirerFormattedMessage({
|
|
217
|
-
name: "Download metadatas from live version rather than draft"
|
|
218
|
-
}),
|
|
219
|
-
choices: [
|
|
220
|
-
{ name: "yes", value: true, description: "Download from live version" },
|
|
221
|
-
{ name: "no", value: false, description: "Download from draft" }
|
|
222
|
-
]
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
function constructInquirerFormattedMessage({
|
|
228
|
-
example,
|
|
229
|
-
explanation,
|
|
230
|
-
referUrl,
|
|
231
|
-
name
|
|
232
|
-
}) {
|
|
233
|
-
let ret = `${chalk.bold(name)}`;
|
|
234
|
-
if (explanation) {
|
|
235
|
-
ret += `
|
|
236
|
-
|
|
237
|
-
${chalk.italic.blue(explanation)}`;
|
|
238
|
-
}
|
|
239
|
-
if (example) {
|
|
240
|
-
ret += `
|
|
241
|
-
${chalk.italic(`${chalk.greenBright("example :")} ${example}`)}`;
|
|
242
|
-
}
|
|
243
|
-
if (referUrl) {
|
|
244
|
-
ret += `
|
|
245
|
-
${chalk.italic(`${chalk.greenBright("references :")} ${chalk.underline.blue(referUrl)}`)}`;
|
|
246
|
-
}
|
|
247
|
-
if (explanation) {
|
|
248
|
-
ret += "\n";
|
|
249
|
-
if (example || referUrl) {
|
|
250
|
-
ret += "\n";
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return ret;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// src/util/setup/hydrateKeyholderFileValues.ts
|
|
257
|
-
async function hydrateKeyholderFileValues() {
|
|
258
|
-
if (exist(OptionHolder.keyholderFilePath)) {
|
|
259
|
-
Object.assign(OptionHolder.keyholderMap, readJsonSlow(OptionHolder.keyholderFilePath));
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// src/util/logger.ts
|
|
264
|
-
import chalk2 from "chalk";
|
|
265
|
-
var logger = {
|
|
266
|
-
success: (...msg) => console.log(chalk2.green(`\u2714 ${msg.join(", ")}`)),
|
|
267
|
-
done: (...msg) => console.log(chalk2.green(`\u2714 ${msg.join(", ")} - Done`)),
|
|
268
|
-
error: (...msg) => console.log(chalk2.red(`\u2716 ${msg.join(", ")}`)),
|
|
269
|
-
warn: (...msg) => console.log(chalk2.yellow(`\u26A0 ${msg.join(", ")}`)),
|
|
270
|
-
info: (...msg) => console.log(chalk2.cyan(`\u2139 ${msg.join(", ")}`)),
|
|
271
|
-
title: (...msg) => console.log(chalk2.bold.blue(`
|
|
272
|
-
${msg.join(", ")}`)),
|
|
273
|
-
dim: (...msg) => console.log(chalk2.dim(msg.join(", ")))
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
// src/util/EnvUtil.ts
|
|
277
|
-
var isDev = process.env.NODE_ENV === "development";
|
|
278
|
-
var isWin = process.platform.startsWith("win");
|
|
279
|
-
var isTest = process.env.NODE_ENV === "test";
|
|
280
|
-
|
|
281
|
-
// src/util/throwError.ts
|
|
282
|
-
function throwError(message, e) {
|
|
283
|
-
if (e) {
|
|
284
|
-
logger.error(message, e);
|
|
285
|
-
} else {
|
|
286
|
-
logger.error(message);
|
|
287
|
-
}
|
|
288
|
-
if (isTest) {
|
|
289
|
-
throw new Error("throwError");
|
|
290
|
-
}
|
|
291
|
-
process.exit(1);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// src/util/setup/VersionUtil.ts
|
|
295
|
-
import semver from "semver";
|
|
296
|
-
import { padZero } from "@mj-studio/js-util";
|
|
297
|
-
var versionNameRegex = () => /const\s+VERSION_NAME\s*?=\s*?['"]([\d\.]*?)['"]\s*?;?/;
|
|
298
|
-
var versionCodeRegex = () => /const\s+VERSION_CODE\s*?=\s*?(\d+)\s*?;?/;
|
|
299
|
-
async function parseBinaryVersions() {
|
|
300
|
-
const files = readdir(OptionHolder.projectDir);
|
|
301
|
-
const jsConfigFiles = ["app.config.ts", "app.config.js", "app.config.cjs", "app.config.mjs"];
|
|
302
|
-
const jsonConfigFile = "app.json";
|
|
303
|
-
for (const jsConfigFile of jsConfigFiles) {
|
|
304
|
-
if (files.includes(jsConfigFile)) {
|
|
305
|
-
await parseFromJsConfigFile(jsConfigFile);
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
if (files.includes(jsonConfigFile)) {
|
|
310
|
-
await parseFromJsonConfigFile(jsonConfigFile);
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
throwError("expo config file not found");
|
|
314
|
-
async function parseFromJsConfigFile(filename) {
|
|
315
|
-
const filePath = resolve2(OptionHolder.projectDir, filename);
|
|
316
|
-
const content = read(filePath);
|
|
317
|
-
const VERSION_NAME = versionNameRegex().exec(content)?.[1];
|
|
318
|
-
const VERSION_CODE = versionCodeRegex().exec(content)?.[1];
|
|
319
|
-
if (!VERSION_NAME) {
|
|
320
|
-
throwError("cannot parse version name");
|
|
321
|
-
}
|
|
322
|
-
if (!VERSION_CODE) {
|
|
323
|
-
throwError("cannot parse version code");
|
|
324
|
-
}
|
|
325
|
-
if (!semver.valid(VERSION_NAME)) {
|
|
326
|
-
throwError("VERSION_NAME is not a valid semver format");
|
|
327
|
-
}
|
|
328
|
-
OptionHolder.versionName = VERSION_NAME;
|
|
329
|
-
OptionHolder.versionCode = VERSION_CODE;
|
|
330
|
-
}
|
|
331
|
-
async function parseFromJsonConfigFile(filename) {
|
|
332
|
-
const filePath = resolve2(OptionHolder.projectDir, filename);
|
|
333
|
-
const json = readJsonSlow(filePath);
|
|
334
|
-
const versionName = json.expo?.version + "";
|
|
335
|
-
const iosVersionCode = json.expo?.ios?.buildNumber + "";
|
|
336
|
-
const androidVersionCode = json.expo?.android?.versionCode + "";
|
|
337
|
-
if (!/\d+/.test(iosVersionCode)) {
|
|
338
|
-
throwError("app.json expo.ios.buildNumber is not an integer");
|
|
339
|
-
}
|
|
340
|
-
if (!/\d+/.test(androidVersionCode)) {
|
|
341
|
-
throwError("app.json expo.android.versionCode is not an integer");
|
|
342
|
-
}
|
|
343
|
-
if (iosVersionCode !== androidVersionCode) {
|
|
344
|
-
throwError("app.json expo.ios.buildNumber is not equal with expo.android.versionCode");
|
|
345
|
-
}
|
|
346
|
-
if (!semver.valid(versionName)) {
|
|
347
|
-
throwError("VERSION_NAME is not a valid semver format");
|
|
348
|
-
}
|
|
349
|
-
OptionHolder.versionName = versionName;
|
|
350
|
-
OptionHolder.versionCode = iosVersionCode;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
// src/util/parseConfigFile.ts
|
|
355
|
-
import { is as is2 } from "@mj-studio/js-util";
|
|
356
|
-
async function parseConfigFile() {
|
|
357
|
-
const candidates = [
|
|
358
|
-
join2(OptionHolder.resourcesDir, "expo-release-it.config.json"),
|
|
359
|
-
join2(OptionHolder.projectDir, "expo-release-it.config.json")
|
|
360
|
-
];
|
|
361
|
-
if (OptionHolder.input.config) {
|
|
362
|
-
candidates.unshift(OptionHolder.input.config);
|
|
363
|
-
}
|
|
364
|
-
const validConfigFilePath = candidates.find(
|
|
365
|
-
(candidate) => exist(candidate) && is2.object(readJsonSlow(candidate))
|
|
366
|
-
);
|
|
367
|
-
if (!validConfigFilePath) return;
|
|
368
|
-
const config = readJsonSlow(validConfigFilePath);
|
|
369
|
-
assignIfValueIsValidAndNotSetAlready(
|
|
370
|
-
OptionHolder.input,
|
|
371
|
-
"semverIncrement",
|
|
372
|
-
config.bump?.increment
|
|
373
|
-
);
|
|
374
|
-
assignIfValueIsValidAndNotSetAlready(
|
|
375
|
-
OptionHolder.input,
|
|
376
|
-
"androidOutput",
|
|
377
|
-
config.build?.androidBuildOutput ?? config.upload?.androidBuildOutput
|
|
378
|
-
);
|
|
379
|
-
assignIfValueIsValidAndNotSetAlready(OptionHolder.input, "pod", config.build?.iosPodInstall);
|
|
380
|
-
assignIfValueIsValidAndNotSetAlready(
|
|
381
|
-
OptionHolder.input,
|
|
382
|
-
"uploadMetadata",
|
|
383
|
-
config.upload?.uploadMetadata ?? config.submit?.uploadMetadata
|
|
384
|
-
);
|
|
385
|
-
assignIfValueIsValidAndNotSetAlready(
|
|
386
|
-
OptionHolder.input,
|
|
387
|
-
"uploadScreenshot",
|
|
388
|
-
config.upload?.uploadScreenshot ?? config.submit?.uploadScreenshot
|
|
389
|
-
);
|
|
390
|
-
assignIfValueIsValidAndNotSetAlready(OptionHolder.input.git, "commit", config.bump?.git?.commit);
|
|
391
|
-
assignIfValueIsValidAndNotSetAlready(
|
|
392
|
-
OptionHolder.input.git,
|
|
393
|
-
"commitMessage",
|
|
394
|
-
config.bump?.git?.commitMessage
|
|
395
|
-
);
|
|
396
|
-
assignIfValueIsValidAndNotSetAlready(OptionHolder.input.git, "tag", config.bump?.git?.tag);
|
|
397
|
-
assignIfValueIsValidAndNotSetAlready(
|
|
398
|
-
OptionHolder.input.git,
|
|
399
|
-
"tagName",
|
|
400
|
-
config.bump?.git?.tagName
|
|
401
|
-
);
|
|
402
|
-
assignIfValueIsValidAndNotSetAlready(OptionHolder.input.git, "push", config.bump?.git?.push);
|
|
403
|
-
}
|
|
404
|
-
function assignIfValueIsValidAndNotSetAlready(object, key, value) {
|
|
405
|
-
if (!object[key] && !(value === null || value === void 0)) {
|
|
406
|
-
object[key] = value;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
// src/util/setup/setup.ts
|
|
411
|
-
async function setup() {
|
|
412
|
-
await setupBasicOptions();
|
|
413
|
-
await parseConfigFile();
|
|
414
|
-
await hydrateKeyholderFileValues();
|
|
415
|
-
await parseBinaryVersions();
|
|
416
|
-
}
|
|
417
|
-
async function setupBasicOptions() {
|
|
418
|
-
OptionHolder.projectDir = isDev ? resolve2("example") : resolve2(".");
|
|
419
|
-
OptionHolder.resourcesDir = resolve2(OptionHolder.projectDir, "expo-release-it");
|
|
420
|
-
OptionHolder.keyDir = resolve2(OptionHolder.resourcesDir, "key");
|
|
421
|
-
OptionHolder.keyholderFilePath = resolve2(OptionHolder.resourcesDir, "keyholder.json");
|
|
422
|
-
OptionHolder.tempDir = resolve2(OptionHolder.resourcesDir, ".temp");
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
// src/util/setup/execShellScript.ts
|
|
426
|
-
import { execa } from "execa";
|
|
427
|
-
var exe = execa({
|
|
428
|
-
stdin: "pipe",
|
|
429
|
-
stdout: "inherit",
|
|
430
|
-
stderr: "inherit",
|
|
431
|
-
shell: false
|
|
432
|
-
});
|
|
433
|
-
var yesShell = (command, args = [], options) => {
|
|
434
|
-
const subProcess = exe(command, args, { ...options, stdin: "pipe" });
|
|
435
|
-
subProcess.stdin?.write("y\n");
|
|
436
|
-
subProcess.stdin?.end();
|
|
437
|
-
return subProcess;
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
// src/util/iterateAllFiles.ts
|
|
441
|
-
async function iterateAllFiles(root, callback) {
|
|
442
|
-
await go(root);
|
|
443
|
-
async function go(dirPath) {
|
|
444
|
-
const paths = readdir(dirPath).map((f) => join2(dirPath, f));
|
|
445
|
-
for (const p of paths) {
|
|
446
|
-
if (isFile(p)) {
|
|
447
|
-
await callback(p);
|
|
448
|
-
} else if (isDir(p)) {
|
|
449
|
-
await go(p);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
// src/util/injectTemplatePlaceHolders.ts
|
|
456
|
-
async function injectTemplatePlaceHolders(root) {
|
|
457
|
-
await iterateAllFiles(root, async (filePath) => {
|
|
458
|
-
let content = read(filePath);
|
|
459
|
-
for (const [key, value] of Object.entries(OptionHolder.keyholderMap)) {
|
|
460
|
-
content = content.replaceAll(`{{${key}}}`, value);
|
|
461
|
-
}
|
|
462
|
-
write(filePath, content);
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
// src/util/spinner.ts
|
|
467
|
-
import { oraPromise } from "ora";
|
|
468
|
-
import chalk3 from "chalk";
|
|
469
|
-
async function spinner(text, promise) {
|
|
470
|
-
return oraPromise(promise, {
|
|
471
|
-
text,
|
|
472
|
-
successText: chalk3.green(`${text} - Done`),
|
|
473
|
-
failText: chalk3.red(`${text} - Failed`)
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
// src/util/MetadataSyncUtil.ts
|
|
478
|
-
import chalk4 from "chalk";
|
|
479
|
-
function copyIosMetadata(to) {
|
|
480
|
-
const iosDir = join2(OptionHolder.projectDir, "ios");
|
|
481
|
-
const nativeDir = join2(iosDir, "fastlane");
|
|
482
|
-
const metadataNativeDir = join2(nativeDir, "metadata");
|
|
483
|
-
const screenshotsNativeDir = join2(nativeDir, "screenshots");
|
|
484
|
-
const resourcesDir = join2(OptionHolder.resourcesDir, "metadata/ios");
|
|
485
|
-
const metadataResourcesDir = join2(resourcesDir, "metadata");
|
|
486
|
-
const screenshotsResourcesDir = join2(resourcesDir, "screenshots");
|
|
487
|
-
if (to === "resources") {
|
|
488
|
-
if (exist(metadataNativeDir) && exist(screenshotsNativeDir)) {
|
|
489
|
-
copy(metadataNativeDir, metadataResourcesDir);
|
|
490
|
-
copy(screenshotsNativeDir, screenshotsResourcesDir);
|
|
491
|
-
logger.done(
|
|
492
|
-
`iOS Metadata saved in ${chalk4.inverse(relativePath(OptionHolder.projectDir, resourcesDir))}. You can edit inside contents.`
|
|
493
|
-
);
|
|
494
|
-
} else {
|
|
495
|
-
logger.warn(
|
|
496
|
-
`iOS Metadata not found in ${chalk4.inverse(relativePath(OptionHolder.projectDir, nativeDir))}`
|
|
497
|
-
);
|
|
498
|
-
}
|
|
499
|
-
} else {
|
|
500
|
-
if (exist(metadataResourcesDir) && exist(screenshotsResourcesDir)) {
|
|
501
|
-
copy(metadataResourcesDir, metadataNativeDir);
|
|
502
|
-
copy(screenshotsResourcesDir, screenshotsNativeDir);
|
|
503
|
-
logger.done(
|
|
504
|
-
`iOS Metadata copyed to ${chalk4.inverse(relativePath(OptionHolder.projectDir, nativeDir))}`
|
|
505
|
-
);
|
|
506
|
-
} else {
|
|
507
|
-
logger.warn(
|
|
508
|
-
`iOS Metadata not found in ${chalk4.inverse(relativePath(OptionHolder.projectDir, resourcesDir))}`
|
|
509
|
-
);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
function copyAndroidMetadata(to) {
|
|
514
|
-
const androidDir = join2(OptionHolder.projectDir, "android");
|
|
515
|
-
const nativeDir = join2(androidDir, "fastlane/metadata/android");
|
|
516
|
-
const resourcesDir = join2(OptionHolder.resourcesDir, "metadata/android");
|
|
517
|
-
if (to === "resouces") {
|
|
518
|
-
if (exist(nativeDir)) {
|
|
519
|
-
copy(nativeDir, resourcesDir);
|
|
520
|
-
logger.done(
|
|
521
|
-
`Android Metadata saved in ${chalk4.inverse(relativePath(OptionHolder.projectDir, resourcesDir))}. You can edit inside contents.`
|
|
522
|
-
);
|
|
523
|
-
} else {
|
|
524
|
-
logger.warn(
|
|
525
|
-
`Android Metadata not found in ${chalk4.inverse(relativePath(OptionHolder.projectDir, nativeDir))}`
|
|
526
|
-
);
|
|
527
|
-
}
|
|
528
|
-
} else {
|
|
529
|
-
if (exist(resourcesDir)) {
|
|
530
|
-
copy(resourcesDir, nativeDir);
|
|
531
|
-
logger.done(
|
|
532
|
-
`Android Metadata copyed to ${chalk4.inverse(relativePath(OptionHolder.projectDir, nativeDir))}`
|
|
533
|
-
);
|
|
534
|
-
} else {
|
|
535
|
-
logger.warn(
|
|
536
|
-
`Android Metadata not found in ${chalk4.inverse(relativePath(OptionHolder.projectDir, resourcesDir))}`
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
// src/util/setup/prepareIos.ts
|
|
543
|
-
async function prepareIos() {
|
|
544
|
-
const srcDir = resolve2(OptionHolder.cli.templateDir, "ios");
|
|
545
|
-
const destDir = resolve2(OptionHolder.projectDir, "ios");
|
|
546
|
-
await yesShell("expo", ["prebuild", "-p", "ios", "--no-install"], {
|
|
547
|
-
cwd: OptionHolder.projectDir
|
|
548
|
-
});
|
|
549
|
-
logger.success("Expo Prebuild - Done");
|
|
550
|
-
await spinner(
|
|
551
|
-
"Inject templates",
|
|
552
|
-
iterateDir(srcDir, async (file) => {
|
|
553
|
-
const filePath = resolve2(srcDir, file);
|
|
554
|
-
remove(resolve2(destDir, file));
|
|
555
|
-
copy(filePath, resolve2(destDir, file));
|
|
556
|
-
})
|
|
557
|
-
);
|
|
558
|
-
await spinner(
|
|
559
|
-
"Hydrate template placeholders",
|
|
560
|
-
injectTemplatePlaceHolders(resolve2(destDir, "fastlane"))
|
|
561
|
-
);
|
|
562
|
-
await exe("bundle", ["install"], { cwd: destDir });
|
|
563
|
-
logger.success("Bunder Install - Done");
|
|
564
|
-
copyIosMetadata("native");
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
// src/util/setup/prepareAndroid.ts
|
|
568
|
-
async function prepareAndroid() {
|
|
569
|
-
const srcDir = resolve2(OptionHolder.cli.templateDir, "android");
|
|
570
|
-
const destDir = resolve2(OptionHolder.projectDir, "android");
|
|
571
|
-
await yesShell("expo", ["prebuild", "-p", "android", "--no-install"], {
|
|
572
|
-
cwd: OptionHolder.projectDir
|
|
573
|
-
});
|
|
574
|
-
logger.success("Expo Prebuild - Done");
|
|
575
|
-
await spinner(
|
|
576
|
-
"Inject Templates",
|
|
577
|
-
iterateDir(srcDir, async (file) => {
|
|
578
|
-
const filePath = resolve2(srcDir, file);
|
|
579
|
-
remove(resolve2(destDir, file));
|
|
580
|
-
copy(filePath, resolve2(destDir, file));
|
|
581
|
-
})
|
|
582
|
-
);
|
|
583
|
-
await spinner("Overwrite Android Release Signing Config", replaceAndroidSigningConfig(destDir));
|
|
584
|
-
await spinner(
|
|
585
|
-
"Hydrate template placeholders",
|
|
586
|
-
injectTemplatePlaceHolders(resolve2(destDir, "fastlane"))
|
|
587
|
-
);
|
|
588
|
-
await exe("bundle", ["install"], { cwd: destDir });
|
|
589
|
-
logger.success("Bunder Install - Done");
|
|
590
|
-
copyAndroidMetadata("native");
|
|
591
|
-
}
|
|
592
|
-
async function replaceAndroidSigningConfig(destDir) {
|
|
593
|
-
const buildGradleDirPath = resolve2(destDir, "app");
|
|
594
|
-
const buildGradlePath = resolve2(destDir, "app", "build.gradle");
|
|
595
|
-
const {
|
|
596
|
-
android_keystore_store_password,
|
|
597
|
-
android_keystore_key_alias,
|
|
598
|
-
android_keystore_key_password
|
|
599
|
-
} = OptionHolder.keyholderMap;
|
|
600
|
-
const content = read(buildGradlePath).replace(
|
|
601
|
-
/signingConfigs.*?{.*?debug.*?{.*?}.*?}/s,
|
|
602
|
-
`
|
|
603
|
-
signingConfigs {
|
|
604
|
-
debug {
|
|
605
|
-
storeFile file('${relativePath(buildGradleDirPath, resolve2(OptionHolder.resourcesDir, "key", "android_release.keystore"))}')
|
|
606
|
-
storePassword '${android_keystore_store_password}'
|
|
607
|
-
keyAlias '${android_keystore_key_alias}'
|
|
608
|
-
keyPassword '${android_keystore_key_password}'
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
`
|
|
612
|
-
);
|
|
613
|
-
write(buildGradlePath, content);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
// src/util/generateAppStoreConnectApiKeyFile.ts
|
|
617
|
-
function generateAppStoreConnectApiKeyFile() {
|
|
618
|
-
const json = {
|
|
619
|
-
key: read(resolve2(OptionHolder.keyDir, "ios_app_store_connect_api_key.p8")),
|
|
620
|
-
key_id: OptionHolder.keyholderMap.ios_app_store_connect_api_key_id,
|
|
621
|
-
issuer_id: OptionHolder.keyholderMap.ios_app_store_connect_api_key_issuer_id
|
|
622
|
-
};
|
|
623
|
-
const file = join2(OptionHolder.tempDir, "app_store_connect_api.json");
|
|
624
|
-
writeJson(file, json);
|
|
625
|
-
return file;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
// src/command/pull.ts
|
|
629
|
-
async function pull({ options }) {
|
|
630
|
-
Object.assign(OptionHolder.input, options);
|
|
631
|
-
await setup();
|
|
632
|
-
await promptInputs();
|
|
633
|
-
if (OptionHolder.input.platform === "ios") {
|
|
634
|
-
await pullIosMetadata();
|
|
635
|
-
} else {
|
|
636
|
-
await pullAndroidMetadata();
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
async function promptInputs() {
|
|
640
|
-
await InqueryInputs.platform();
|
|
641
|
-
await InqueryInputs.useLiveVersionIos();
|
|
642
|
-
}
|
|
643
|
-
async function pullIosMetadata() {
|
|
644
|
-
await prepareIos();
|
|
645
|
-
const iosDir = join2(OptionHolder.projectDir, "ios");
|
|
646
|
-
const exeEnv = exe({
|
|
647
|
-
cwd: iosDir,
|
|
648
|
-
env: {
|
|
649
|
-
MATCH_PASSWORD: OptionHolder.keyholderMap.ios_match_password
|
|
650
|
-
}
|
|
651
|
-
});
|
|
652
|
-
await exeEnv("bundle", [
|
|
653
|
-
"exec",
|
|
654
|
-
"fastlane",
|
|
655
|
-
"deliver",
|
|
656
|
-
"download_metadata",
|
|
657
|
-
"-f",
|
|
658
|
-
"--api_key_path",
|
|
659
|
-
generateAppStoreConnectApiKeyFile()
|
|
660
|
-
]);
|
|
661
|
-
await exeEnv("bundle", [
|
|
662
|
-
"exec",
|
|
663
|
-
"fastlane",
|
|
664
|
-
"deliver",
|
|
665
|
-
"download_screenshots",
|
|
666
|
-
"-f",
|
|
667
|
-
"--api_key_path",
|
|
668
|
-
generateAppStoreConnectApiKeyFile(),
|
|
669
|
-
"--use_live_version",
|
|
670
|
-
OptionHolder.input.useLiveVersionIos + ""
|
|
671
|
-
]);
|
|
672
|
-
copyIosMetadata("resources");
|
|
673
|
-
}
|
|
674
|
-
async function pullAndroidMetadata() {
|
|
675
|
-
await prepareAndroid();
|
|
676
|
-
const androidDir = join2(OptionHolder.projectDir, "android");
|
|
677
|
-
await exe(
|
|
678
|
-
"bundle",
|
|
679
|
-
[
|
|
680
|
-
"exec",
|
|
681
|
-
"fastlane",
|
|
682
|
-
"supply",
|
|
683
|
-
"init",
|
|
684
|
-
"--json_key",
|
|
685
|
-
resolve2(OptionHolder.keyDir, "android_play_console_service_account.json"),
|
|
686
|
-
"--package_name",
|
|
687
|
-
OptionHolder.keyholderMap.android_package_name
|
|
688
|
-
],
|
|
689
|
-
{ cwd: androidDir }
|
|
690
|
-
);
|
|
691
|
-
copyAndroidMetadata("resouces");
|
|
692
|
-
}
|
|
693
|
-
export {
|
|
694
|
-
pull
|
|
695
|
-
};
|
|
696
|
-
//# sourceMappingURL=pull.js.map
|
|
1
|
+
import "../EnvUtil-DWWwkHaf.js";
|
|
2
|
+
import "../FileUtil-B9JnWobK.js";
|
|
3
|
+
import "../OptionHolder-H3HG0A95.js";
|
|
4
|
+
import "../InqueryInputs-BGj-DlRa.js";
|
|
5
|
+
import "../logger-DvQ7ScMQ.js";
|
|
6
|
+
import "../execShellScript-Bd5xbFX5.js";
|
|
7
|
+
import "../MetadataSyncUtil-j79hX3QT.js";
|
|
8
|
+
import "../iterateAllFiles-CbEPek2B.js";
|
|
9
|
+
import "../injectTemplatePlaceHolders-CpIvd0dG.js";
|
|
10
|
+
import "../replaceStringIfNotContain-CgZ460_D.js";
|
|
11
|
+
import "../spinner-BVmbE9I_.js";
|
|
12
|
+
import "../prepareAndroid-Cjz6r6o0.js";
|
|
13
|
+
import "../prepareIos-ByPLFHC8.js";
|
|
14
|
+
import "../parseConfigFile-hMLUnLZR.js";
|
|
15
|
+
import "../throwError-DMF6E5pu.js";
|
|
16
|
+
import "../VersionUtil-BDB10Hpb.js";
|
|
17
|
+
import "../hydrateKeyholderFileValues-BoaRs3SC.js";
|
|
18
|
+
import "../setup-CRNjdK5q.js";
|
|
19
|
+
import "../generateAppStoreConnectApiKeyFile-DjxlrcZn.js";
|
|
20
|
+
import { pull } from "../pull-BHSlClDy.js";
|
|
21
|
+
|
|
22
|
+
export { pull };
|