@sitepong/fastnode 0.1.0
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 +81 -0
- package/bin/fastnode.js +13 -0
- package/bin/fastnode.ts +5 -0
- package/dist/actions/index.cjs +7405 -0
- package/dist/actions/index.cjs.map +1 -0
- package/dist/actions/index.d.cts +15 -0
- package/dist/actions/index.d.ts +15 -0
- package/dist/actions/index.mjs +7377 -0
- package/dist/actions/index.mjs.map +1 -0
- package/dist/cert/index.cjs +219 -0
- package/dist/cert/index.cjs.map +1 -0
- package/dist/cert/index.d.cts +4 -0
- package/dist/cert/index.d.ts +4 -0
- package/dist/cert/index.mjs +191 -0
- package/dist/cert/index.mjs.map +1 -0
- package/dist/cert-BmJGtYtb.d.cts +27 -0
- package/dist/cert-owkOFNW8.d.ts +27 -0
- package/dist/cli/index.cjs +7998 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +9 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.mjs +7972 -0
- package/dist/cli/index.mjs.map +1 -0
- package/dist/client/index.cjs +2592 -0
- package/dist/client/index.cjs.map +1 -0
- package/dist/client/index.d.cts +2 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.mjs +2582 -0
- package/dist/client/index.mjs.map +1 -0
- package/dist/context-CymLkfrS.d.cts +13 -0
- package/dist/context-CymLkfrS.d.ts +13 -0
- package/dist/core/index.cjs +281 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.mjs +254 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/deliver/index.cjs +328 -0
- package/dist/deliver/index.cjs.map +1 -0
- package/dist/deliver/index.d.cts +3 -0
- package/dist/deliver/index.d.ts +3 -0
- package/dist/deliver/index.mjs +322 -0
- package/dist/deliver/index.mjs.map +1 -0
- package/dist/enums-B609j2rb.d.cts +20 -0
- package/dist/enums-B609j2rb.d.ts +20 -0
- package/dist/frameit/index.cjs +247 -0
- package/dist/frameit/index.cjs.map +1 -0
- package/dist/frameit/index.d.cts +1 -0
- package/dist/frameit/index.d.ts +1 -0
- package/dist/frameit/index.mjs +242 -0
- package/dist/frameit/index.mjs.map +1 -0
- package/dist/gym/index.cjs +356 -0
- package/dist/gym/index.cjs.map +1 -0
- package/dist/gym/index.d.cts +2 -0
- package/dist/gym/index.d.ts +2 -0
- package/dist/gym/index.mjs +346 -0
- package/dist/gym/index.mjs.map +1 -0
- package/dist/index-1Vu2cRQ2.d.ts +99 -0
- package/dist/index-A5MimeQk.d.ts +72 -0
- package/dist/index-B0yhu_LZ.d.ts +76 -0
- package/dist/index-B9yXicrQ.d.ts +62 -0
- package/dist/index-BFdNOmPJ.d.cts +53 -0
- package/dist/index-BLubSlgK.d.cts +1513 -0
- package/dist/index-BN0ubxjZ.d.ts +70 -0
- package/dist/index-BQJIJlK7.d.cts +70 -0
- package/dist/index-BYonklf3.d.cts +84 -0
- package/dist/index-BYonklf3.d.ts +84 -0
- package/dist/index-BimqCmY8.d.cts +78 -0
- package/dist/index-BimqCmY8.d.ts +78 -0
- package/dist/index-BoU8qt8r.d.cts +59 -0
- package/dist/index-BoU8qt8r.d.ts +59 -0
- package/dist/index-C2yG3wXA.d.cts +95 -0
- package/dist/index-C2yG3wXA.d.ts +95 -0
- package/dist/index-CR3BFPIz.d.cts +77 -0
- package/dist/index-CR3BFPIz.d.ts +77 -0
- package/dist/index-CWNLnSOL.d.cts +99 -0
- package/dist/index-Cp6cjtd-.d.cts +65 -0
- package/dist/index-Cp6cjtd-.d.ts +65 -0
- package/dist/index-D1Izm7qt.d.ts +1513 -0
- package/dist/index-D5eihzwM.d.cts +76 -0
- package/dist/index-DImN9PWc.d.ts +155 -0
- package/dist/index-DfCUVJX1.d.cts +62 -0
- package/dist/index-DfirmFbC.d.ts +32 -0
- package/dist/index-DkvinY7_.d.ts +54 -0
- package/dist/index-DrUpRXRG.d.cts +155 -0
- package/dist/index-EcVvViW8.d.cts +72 -0
- package/dist/index-HRiaaX-Q.d.cts +54 -0
- package/dist/index-TfXqwuac.d.ts +53 -0
- package/dist/index-lt819Jgj.d.cts +32 -0
- package/dist/index.cjs +8464 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.mjs +8410 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lane/index.cjs +7641 -0
- package/dist/lane/index.cjs.map +1 -0
- package/dist/lane/index.d.cts +51 -0
- package/dist/lane/index.d.ts +51 -0
- package/dist/lane/index.mjs +7603 -0
- package/dist/lane/index.mjs.map +1 -0
- package/dist/match/index.cjs +942 -0
- package/dist/match/index.cjs.map +1 -0
- package/dist/match/index.d.cts +5 -0
- package/dist/match/index.d.ts +5 -0
- package/dist/match/index.mjs +913 -0
- package/dist/match/index.mjs.map +1 -0
- package/dist/pem/index.cjs +195 -0
- package/dist/pem/index.cjs.map +1 -0
- package/dist/pem/index.d.cts +3 -0
- package/dist/pem/index.d.ts +3 -0
- package/dist/pem/index.mjs +170 -0
- package/dist/pem/index.mjs.map +1 -0
- package/dist/pilot/index.cjs +206 -0
- package/dist/pilot/index.cjs.map +1 -0
- package/dist/pilot/index.d.cts +3 -0
- package/dist/pilot/index.d.ts +3 -0
- package/dist/pilot/index.mjs +196 -0
- package/dist/pilot/index.mjs.map +1 -0
- package/dist/precheck/index.cjs +277 -0
- package/dist/precheck/index.cjs.map +1 -0
- package/dist/precheck/index.d.cts +3 -0
- package/dist/precheck/index.d.ts +3 -0
- package/dist/precheck/index.mjs +274 -0
- package/dist/precheck/index.mjs.map +1 -0
- package/dist/produce/index.cjs +200 -0
- package/dist/produce/index.cjs.map +1 -0
- package/dist/produce/index.d.cts +3 -0
- package/dist/produce/index.d.ts +3 -0
- package/dist/produce/index.mjs +191 -0
- package/dist/produce/index.mjs.map +1 -0
- package/dist/scan/index.cjs +187 -0
- package/dist/scan/index.cjs.map +1 -0
- package/dist/scan/index.d.cts +1 -0
- package/dist/scan/index.d.ts +1 -0
- package/dist/scan/index.mjs +183 -0
- package/dist/scan/index.mjs.map +1 -0
- package/dist/sigh/index.cjs +203 -0
- package/dist/sigh/index.cjs.map +1 -0
- package/dist/sigh/index.d.cts +3 -0
- package/dist/sigh/index.d.ts +3 -0
- package/dist/sigh/index.mjs +198 -0
- package/dist/sigh/index.mjs.map +1 -0
- package/dist/snapshot/index.cjs +448 -0
- package/dist/snapshot/index.cjs.map +1 -0
- package/dist/snapshot/index.d.cts +1 -0
- package/dist/snapshot/index.d.ts +1 -0
- package/dist/snapshot/index.mjs +438 -0
- package/dist/snapshot/index.mjs.map +1 -0
- package/dist/trainer/index.cjs +395 -0
- package/dist/trainer/index.cjs.map +1 -0
- package/dist/trainer/index.d.cts +1 -0
- package/dist/trainer/index.d.ts +1 -0
- package/dist/trainer/index.mjs +372 -0
- package/dist/trainer/index.mjs.map +1 -0
- package/dist/xcode/index.cjs +188 -0
- package/dist/xcode/index.cjs.map +1 -0
- package/dist/xcode/index.d.cts +1 -0
- package/dist/xcode/index.d.ts +1 -0
- package/dist/xcode/index.mjs +176 -0
- package/dist/xcode/index.mjs.map +1 -0
- package/package.json +223 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var child_process = require('child_process');
|
|
4
|
+
var promises = require('fs/promises');
|
|
5
|
+
var path = require('path');
|
|
6
|
+
var os = require('os');
|
|
7
|
+
var crypto = require('crypto');
|
|
8
|
+
var plist = require('plist');
|
|
9
|
+
|
|
10
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var plist__default = /*#__PURE__*/_interopDefault(plist);
|
|
13
|
+
|
|
14
|
+
// src/gym/index.ts
|
|
15
|
+
|
|
16
|
+
// src/xcode/platform.ts
|
|
17
|
+
function requireMacOS(feature) {
|
|
18
|
+
if (process.platform !== "darwin") {
|
|
19
|
+
throw new Error(
|
|
20
|
+
`${feature} requires macOS. This operation uses Xcode command-line tools which are not available on ${process.platform}.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function findFirst(dir, ext) {
|
|
25
|
+
const entries = await promises.readdir(dir, { withFileTypes: true });
|
|
26
|
+
for (const entry of entries) {
|
|
27
|
+
if (entry.name.endsWith(ext) && !entry.name.startsWith(".")) {
|
|
28
|
+
return path.join(dir, entry.name);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
async function xcodebuildList(args) {
|
|
34
|
+
return new Promise((res, rej) => {
|
|
35
|
+
const proc = child_process.spawn("xcodebuild", ["-list", "-json", ...args], {
|
|
36
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
37
|
+
});
|
|
38
|
+
const chunks = [];
|
|
39
|
+
const errChunks = [];
|
|
40
|
+
proc.stdout.on("data", (d) => chunks.push(d));
|
|
41
|
+
proc.stderr.on("data", (d) => errChunks.push(d));
|
|
42
|
+
proc.on("error", rej);
|
|
43
|
+
proc.on("close", (code) => {
|
|
44
|
+
if (code !== 0) {
|
|
45
|
+
const stderr = Buffer.concat(errChunks).toString("utf-8").trim();
|
|
46
|
+
rej(new Error("xcodebuild -list failed (exit " + code + "):\n" + stderr));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const raw = Buffer.concat(chunks).toString("utf-8").trim();
|
|
50
|
+
try {
|
|
51
|
+
res(JSON.parse(raw));
|
|
52
|
+
} catch {
|
|
53
|
+
rej(new Error("Failed to parse xcodebuild -list JSON:\n" + raw));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async function detectValues(options) {
|
|
59
|
+
const searchDir = path.resolve(options.searchDir ?? process.cwd());
|
|
60
|
+
let workspace = options.workspace ?? null;
|
|
61
|
+
let project = options.project ?? null;
|
|
62
|
+
if (!workspace && !project) {
|
|
63
|
+
workspace = await findFirst(searchDir, ".xcworkspace");
|
|
64
|
+
}
|
|
65
|
+
if (!workspace && !project) {
|
|
66
|
+
project = await findFirst(searchDir, ".xcodeproj");
|
|
67
|
+
}
|
|
68
|
+
if (!workspace && !project) {
|
|
69
|
+
throw new Error(
|
|
70
|
+
"Could not find .xcworkspace or .xcodeproj in " + searchDir + ". Pass workspace or project explicitly."
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
const listArgs = [];
|
|
74
|
+
if (workspace) listArgs.push("-workspace", workspace);
|
|
75
|
+
else if (project) listArgs.push("-project", project);
|
|
76
|
+
const listOutput = await xcodebuildList(listArgs);
|
|
77
|
+
const schemes = listOutput.workspace?.schemes ?? listOutput.project?.schemes ?? [];
|
|
78
|
+
const configurations = listOutput.project?.configurations ?? [];
|
|
79
|
+
const targets = listOutput.project?.targets ?? [];
|
|
80
|
+
let scheme = options.scheme ?? null;
|
|
81
|
+
if (!scheme) {
|
|
82
|
+
if (schemes.length === 1) {
|
|
83
|
+
scheme = schemes[0];
|
|
84
|
+
} else if (schemes.length > 1) {
|
|
85
|
+
const refName = (workspace ? path.basename(workspace, ".xcworkspace") : null) ?? (project ? path.basename(project, ".xcodeproj") : null);
|
|
86
|
+
if (refName) {
|
|
87
|
+
const m = schemes.find((s) => s === refName);
|
|
88
|
+
if (m) scheme = m;
|
|
89
|
+
}
|
|
90
|
+
if (!scheme) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
"Multiple schemes found: " + schemes.join(", ") + ". Pass scheme explicitly."
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
throw new Error(
|
|
97
|
+
"No schemes found in the Xcode project. Make sure the scheme is shared."
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const configuration = options.configuration ?? "Release";
|
|
102
|
+
return {
|
|
103
|
+
workspace,
|
|
104
|
+
project,
|
|
105
|
+
scheme,
|
|
106
|
+
configuration,
|
|
107
|
+
schemes,
|
|
108
|
+
configurations,
|
|
109
|
+
targets
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function inferSigningStyle(config) {
|
|
113
|
+
if (config.signingStyle) return config.signingStyle;
|
|
114
|
+
if (config.provisioningProfiles && Object.keys(config.provisioningProfiles).length > 0) {
|
|
115
|
+
return "manual";
|
|
116
|
+
}
|
|
117
|
+
return "automatic";
|
|
118
|
+
}
|
|
119
|
+
function buildExportOptions(config) {
|
|
120
|
+
const opts = {
|
|
121
|
+
method: config.exportMethod
|
|
122
|
+
};
|
|
123
|
+
const signingStyle = inferSigningStyle(config);
|
|
124
|
+
opts.signingStyle = signingStyle;
|
|
125
|
+
if (config.teamId) {
|
|
126
|
+
opts.teamID = config.teamId;
|
|
127
|
+
}
|
|
128
|
+
if (signingStyle === "manual" && config.provisioningProfiles) {
|
|
129
|
+
opts.provisioningProfiles = config.provisioningProfiles;
|
|
130
|
+
}
|
|
131
|
+
if (config.signingCertificate) {
|
|
132
|
+
opts.signingCertificate = config.signingCertificate;
|
|
133
|
+
}
|
|
134
|
+
opts.uploadBitcode = config.includeBitcode ?? false;
|
|
135
|
+
opts.compileBitcode = config.includeBitcode ?? false;
|
|
136
|
+
opts.uploadSymbols = config.includeSymbols ?? true;
|
|
137
|
+
if (config.destination) {
|
|
138
|
+
opts.destination = config.destination;
|
|
139
|
+
}
|
|
140
|
+
if (config.thinning) {
|
|
141
|
+
opts.thinning = config.thinning;
|
|
142
|
+
}
|
|
143
|
+
if (config.catalystPlatform) {
|
|
144
|
+
opts.distributionBundleIdentifier = void 0;
|
|
145
|
+
}
|
|
146
|
+
if (config.additionalOptions) {
|
|
147
|
+
Object.assign(opts, config.additionalOptions);
|
|
148
|
+
}
|
|
149
|
+
return opts;
|
|
150
|
+
}
|
|
151
|
+
function generateExportOptionsPlistXml(config) {
|
|
152
|
+
const opts = buildExportOptions(config);
|
|
153
|
+
return plist__default.default.build(opts);
|
|
154
|
+
}
|
|
155
|
+
async function writeExportOptionsPlist(dir, config) {
|
|
156
|
+
const xml = generateExportOptionsPlistXml(config);
|
|
157
|
+
const plistPath = path.join(dir, "exportOptions.plist");
|
|
158
|
+
await promises.writeFile(plistPath, xml, "utf-8");
|
|
159
|
+
return plistPath;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// src/gym/index.ts
|
|
163
|
+
function runXcodebuild(args, onOutput) {
|
|
164
|
+
return new Promise((res, rej) => {
|
|
165
|
+
const proc = child_process.spawn("xcodebuild", args, {
|
|
166
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
167
|
+
});
|
|
168
|
+
const chunks = [];
|
|
169
|
+
const handleData = (data) => {
|
|
170
|
+
const text = data.toString("utf-8");
|
|
171
|
+
chunks.push(text);
|
|
172
|
+
if (onOutput) onOutput(text);
|
|
173
|
+
};
|
|
174
|
+
proc.stdout.on("data", handleData);
|
|
175
|
+
proc.stderr.on("data", handleData);
|
|
176
|
+
proc.on("error", rej);
|
|
177
|
+
proc.on("close", (code) => {
|
|
178
|
+
res({ exitCode: code ?? 1, output: chunks.join("") });
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
async function findFileWithExtension(dir, ext) {
|
|
183
|
+
let entries;
|
|
184
|
+
try {
|
|
185
|
+
entries = await promises.readdir(dir, { withFileTypes: true });
|
|
186
|
+
} catch {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
for (const entry of entries) {
|
|
190
|
+
const full = path.join(dir, entry.name);
|
|
191
|
+
if (entry.name.endsWith(ext) && !entry.isDirectory()) {
|
|
192
|
+
return full;
|
|
193
|
+
}
|
|
194
|
+
if (entry.isDirectory()) {
|
|
195
|
+
const found = await findFileWithExtension(full, ext);
|
|
196
|
+
if (found) return found;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
async function compressDsyms(dsymDir, outputPath) {
|
|
202
|
+
return new Promise((res, rej) => {
|
|
203
|
+
const proc = child_process.spawn("tar", ["-czf", outputPath, "-C", dsymDir, "."], {
|
|
204
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
205
|
+
});
|
|
206
|
+
proc.on("error", rej);
|
|
207
|
+
proc.on("close", (code) => {
|
|
208
|
+
if (code !== 0) rej(new Error("tar failed with exit code " + code));
|
|
209
|
+
else res(outputPath);
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
async function buildApp(options) {
|
|
214
|
+
requireMacOS("gym");
|
|
215
|
+
const detected = await detectValues({
|
|
216
|
+
workspace: options.workspace,
|
|
217
|
+
project: options.project,
|
|
218
|
+
scheme: options.scheme,
|
|
219
|
+
configuration: options.configuration
|
|
220
|
+
});
|
|
221
|
+
const { workspace, project, scheme, configuration } = detected;
|
|
222
|
+
const outputDir = path.resolve(
|
|
223
|
+
options.outputDirectory ?? path.join(process.cwd(), "output")
|
|
224
|
+
);
|
|
225
|
+
await promises.mkdir(outputDir, { recursive: true });
|
|
226
|
+
const archiveName = options.outputName ?? scheme;
|
|
227
|
+
const archivePath = options.archivePath ?? path.join(outputDir, archiveName + ".xcarchive");
|
|
228
|
+
const exportPath = path.join(outputDir, "export");
|
|
229
|
+
await promises.mkdir(exportPath, { recursive: true });
|
|
230
|
+
const tmpDir = path.join(os.tmpdir(), "fastnode-gym-" + crypto.randomUUID());
|
|
231
|
+
await promises.mkdir(tmpDir, { recursive: true });
|
|
232
|
+
const fullOutput = [];
|
|
233
|
+
const onOutput = (chunk) => {
|
|
234
|
+
fullOutput.push(chunk);
|
|
235
|
+
if (options.onOutput) options.onOutput(chunk);
|
|
236
|
+
};
|
|
237
|
+
try {
|
|
238
|
+
if (options.clean) {
|
|
239
|
+
const cleanArgs = ["clean"];
|
|
240
|
+
if (workspace) cleanArgs.push("-workspace", workspace);
|
|
241
|
+
else if (project) cleanArgs.push("-project", project);
|
|
242
|
+
cleanArgs.push("-scheme", scheme, "-configuration", configuration);
|
|
243
|
+
if (options.xcargs) cleanArgs.push(...options.xcargs.split(/\s+/));
|
|
244
|
+
const cleanResult = await runXcodebuild(cleanArgs, onOutput);
|
|
245
|
+
if (cleanResult.exitCode !== 0) {
|
|
246
|
+
return {
|
|
247
|
+
success: false,
|
|
248
|
+
exitCode: cleanResult.exitCode,
|
|
249
|
+
ipaPath: null,
|
|
250
|
+
pkgPath: null,
|
|
251
|
+
dsymPath: null,
|
|
252
|
+
archivePath,
|
|
253
|
+
output: fullOutput.join("")
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
const archiveArgs = ["archive"];
|
|
258
|
+
if (workspace) archiveArgs.push("-workspace", workspace);
|
|
259
|
+
else if (project) archiveArgs.push("-project", project);
|
|
260
|
+
archiveArgs.push("-scheme", scheme);
|
|
261
|
+
archiveArgs.push("-archivePath", archivePath);
|
|
262
|
+
archiveArgs.push("-configuration", configuration);
|
|
263
|
+
if (options.sdk) {
|
|
264
|
+
archiveArgs.push("-sdk", options.sdk);
|
|
265
|
+
}
|
|
266
|
+
if (options.destination) {
|
|
267
|
+
archiveArgs.push("-destination", options.destination);
|
|
268
|
+
}
|
|
269
|
+
if (options.derivedDataPath) {
|
|
270
|
+
archiveArgs.push("-derivedDataPath", options.derivedDataPath);
|
|
271
|
+
}
|
|
272
|
+
if (options.xcargs) {
|
|
273
|
+
archiveArgs.push(...options.xcargs.split(/\s+/));
|
|
274
|
+
}
|
|
275
|
+
const archiveResult = await runXcodebuild(archiveArgs, onOutput);
|
|
276
|
+
if (archiveResult.exitCode !== 0) {
|
|
277
|
+
return {
|
|
278
|
+
success: false,
|
|
279
|
+
exitCode: archiveResult.exitCode,
|
|
280
|
+
ipaPath: null,
|
|
281
|
+
pkgPath: null,
|
|
282
|
+
dsymPath: null,
|
|
283
|
+
archivePath,
|
|
284
|
+
output: fullOutput.join("")
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
const exportOptionsPlistPath = await writeExportOptionsPlist(tmpDir, {
|
|
288
|
+
exportMethod: options.exportMethod,
|
|
289
|
+
teamId: options.teamId,
|
|
290
|
+
provisioningProfiles: options.provisioningProfiles,
|
|
291
|
+
signingCertificate: options.codeSignIdentity,
|
|
292
|
+
includeBitcode: options.includeBitcode,
|
|
293
|
+
includeSymbols: options.includeSymbols,
|
|
294
|
+
additionalOptions: options.exportOptions
|
|
295
|
+
});
|
|
296
|
+
const exportArgs = [
|
|
297
|
+
"-exportArchive",
|
|
298
|
+
"-archivePath",
|
|
299
|
+
archivePath,
|
|
300
|
+
"-exportOptionsPlist",
|
|
301
|
+
exportOptionsPlistPath,
|
|
302
|
+
"-exportPath",
|
|
303
|
+
exportPath
|
|
304
|
+
];
|
|
305
|
+
if (options.xcargs) {
|
|
306
|
+
exportArgs.push(...options.xcargs.split(/\s+/));
|
|
307
|
+
}
|
|
308
|
+
const exportResult = await runXcodebuild(exportArgs, onOutput);
|
|
309
|
+
if (exportResult.exitCode !== 0) {
|
|
310
|
+
return {
|
|
311
|
+
success: false,
|
|
312
|
+
exitCode: exportResult.exitCode,
|
|
313
|
+
ipaPath: null,
|
|
314
|
+
pkgPath: null,
|
|
315
|
+
dsymPath: null,
|
|
316
|
+
archivePath,
|
|
317
|
+
output: fullOutput.join("")
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
let ipaPath = await findFileWithExtension(exportPath, ".ipa");
|
|
321
|
+
let pkgPath = await findFileWithExtension(exportPath, ".pkg");
|
|
322
|
+
let dsymPath = null;
|
|
323
|
+
const dsymsDir = path.join(archivePath, "dSYMs");
|
|
324
|
+
try {
|
|
325
|
+
const dsymStat = await promises.stat(dsymsDir);
|
|
326
|
+
if (dsymStat.isDirectory()) {
|
|
327
|
+
const dsymEntries = await promises.readdir(dsymsDir);
|
|
328
|
+
if (dsymEntries.length > 0) {
|
|
329
|
+
dsymPath = path.join(outputDir, archiveName + ".app.dSYM.zip");
|
|
330
|
+
await compressDsyms(dsymsDir, dsymPath);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
} catch {
|
|
334
|
+
}
|
|
335
|
+
return {
|
|
336
|
+
success: true,
|
|
337
|
+
exitCode: 0,
|
|
338
|
+
ipaPath,
|
|
339
|
+
pkgPath,
|
|
340
|
+
dsymPath,
|
|
341
|
+
archivePath,
|
|
342
|
+
output: fullOutput.join("")
|
|
343
|
+
};
|
|
344
|
+
} finally {
|
|
345
|
+
await promises.rm(tmpDir, { recursive: true, force: true }).catch(() => {
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
exports.buildApp = buildApp;
|
|
351
|
+
exports.buildExportOptions = buildExportOptions;
|
|
352
|
+
exports.detectValues = detectValues;
|
|
353
|
+
exports.generateExportOptionsPlistXml = generateExportOptionsPlistXml;
|
|
354
|
+
exports.writeExportOptionsPlist = writeExportOptionsPlist;
|
|
355
|
+
//# sourceMappingURL=index.cjs.map
|
|
356
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/xcode/platform.ts","../../src/gym/detect.ts","../../src/gym/export-options.ts","../../src/gym/index.ts"],"names":["readdir","join","spawn","resolve","basename","plist","writeFile","mkdir","tmpdir","randomUUID","stat","rm"],"mappings":";;;;;;;;;;;;;;;;AAAO,SAAS,aAAa,OAAA,EAAuB;AAClD,EAAA,IAAI,OAAA,CAAQ,aAAa,QAAA,EAAU;AACjC,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,EAAG,OAAO,CAAA,yFAAA,EACoB,OAAA,CAAQ,QAAQ,CAAA,CAAA;AAAA,KAChD;AAAA,EACF;AACF;AC2BA,eAAe,SAAA,CAAU,KAAa,GAAA,EAAqC;AACzE,EAAA,MAAM,UAAU,MAAMA,gBAAA,CAAQ,KAAK,EAAE,aAAA,EAAe,MAAM,CAAA;AAC1D,EAAA,KAAA,MAAW,SAAS,OAAA,EAAS;AAC3B,IAAA,IAAI,KAAA,CAAM,IAAA,CAAK,QAAA,CAAS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AA,EAAY,MAAM,CAAA;AAG5D,IAAA,IAAI,QAAA,GAA0B,IAAA;AAC9B,IAAA,MAAM,QAAA,GAAWN,SAAAA,CAAK,WAAA,EAAa,OAAO,CAAA;AAC1C,IAAA,IAAI;AACF,MAAA,MAAM,QAAA,GAAW,MAAMS,aAAA,CAAK,QAAQ,CAAA;AACpC,MAAA,IAAI,QAAA,CAAS,aAAY,EAAG;AAC1B,QAAA,MAAM,WAAA,GAAc,MAAMV,gBAAAA,CAAQ,QAAQ,CAAA;AAC1C,QAAA,IAAI,WAAA,CAAY,SAAS,CAAA,EAAG;AAC1B,UAAA,QAAA,GAAWC,SAAAA,CAAK,SAAA,EAAW,WAAA,GAAc,eAAe,CAAA;AACxD,UAAA,MAAM,aAAA,CAAc,UAAU,QAAQ,CAAA;AAAA,QACxC;AAAA,MACF;AAAA,IACF,CAAA,CAAA,MAAQ;AAAA,IAER;AAEA,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,IAAA;AAAA,MACT,QAAA,EAAU,CAAA;AAAA,MACV,OAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,MACA,MAAA,EAAQ,UAAA,CAAW,IAAA,CAAK,EAAE;AAAA,KAC5B;AAAA,EACF,CAAA,SAAE;AAEA,IAAA,MAAMU,WAAA,CAAG,MAAA,EAAQ,EAAE,SAAA,EAAW,IAAA,EAAM,OAAO,IAAA,EAAM,CAAA,CAAE,KAAA,CAAM,MAAM;AAAA,IAAC,CAAC,CAAA;AAAA,EACnE;AACF","file":"index.cjs","sourcesContent":["export function requireMacOS(feature: string): void {\n if (process.platform !== \"darwin\") {\n throw new Error(\n `${feature} requires macOS. This operation uses Xcode command-line tools ` +\n `which are not available on ${process.platform}.`\n );\n }\n}\n\nexport function isMacOS(): boolean {\n return process.platform === \"darwin\";\n}\n","import { readdir } from \"node:fs/promises\";\nimport { join, resolve, basename } from \"node:path\";\nimport { spawn } from \"node:child_process\";\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\nexport interface DetectedValues {\n workspace: string | null;\n project: string | null;\n scheme: string;\n configuration: string;\n schemes: string[];\n configurations: string[];\n targets: string[];\n}\n\nexport interface XcodeBuildListOutput {\n project?: {\n name: string;\n schemes: string[];\n configurations: string[];\n targets: string[];\n };\n workspace?: {\n name: string;\n schemes: string[];\n };\n}\n\n// ── Helpers ────────────────────────────────────────────────────────────────\n\n/**\n * Find the first file in `dir` matching the given extension.\n */\nasync function findFirst(dir: string, ext: string): Promise<string | null> {\n const entries = await readdir(dir, { withFileTypes: true });\n for (const entry of entries) {\n if (entry.name.endsWith(ext) && !entry.name.startsWith(\".\")) {\n return join(dir, entry.name);\n }\n }\n return null;\n}\n\n/**\n * Run `xcodebuild -list -json` and return parsed JSON.\n */\nasync function xcodebuildList(args: string[]): Promise<XcodeBuildListOutput> {\n return new Promise<XcodeBuildListOutput>((res, rej) => {\n const proc = spawn(\"xcodebuild\", [\"-list\", \"-json\", ...args], {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n const chunks: Buffer[] = [];\n const errChunks: Buffer[] = [];\n proc.stdout.on(\"data\", (d: Buffer) => chunks.push(d));\n proc.stderr.on(\"data\", (d: Buffer) => errChunks.push(d));\n proc.on(\"error\", rej);\n proc.on(\"close\", (code) => {\n if (code !== 0) {\n const stderr = Buffer.concat(errChunks).toString(\"utf-8\").trim();\n rej(new Error(\"xcodebuild -list failed (exit \" + code + \"):\\n\" + stderr));\n return;\n }\n const raw = Buffer.concat(chunks).toString(\"utf-8\").trim();\n try {\n res(JSON.parse(raw) as XcodeBuildListOutput);\n } catch {\n rej(new Error(\"Failed to parse xcodebuild -list JSON:\\n\" + raw));\n }\n });\n });\n}\n\n// ── Public API ─────────────────────────────────────────────────────────────\n\n/**\n * Auto-detect the Xcode workspace/project, scheme, and configuration.\n *\n * Workspace/project resolution:\n * 1. Explicit option\n * 2. First `.xcworkspace` in searchDir\n * 3. First `.xcodeproj` in searchDir\n *\n * Scheme resolution:\n * 1. Explicit option\n * 2. Sole scheme -> auto-select\n * 3. Scheme matching workspace/project name\n * 4. Error\n */\nexport async function detectValues(options: {\n workspace?: string;\n project?: string;\n scheme?: string;\n configuration?: string;\n searchDir?: string;\n}): Promise<DetectedValues> {\n const searchDir = resolve(options.searchDir ?? process.cwd());\n\n // ── Resolve workspace / project ───────────────────────────────────────\n\n let workspace = options.workspace ?? null;\n let project = options.project ?? null;\n\n if (!workspace && !project) {\n workspace = await findFirst(searchDir, \".xcworkspace\");\n }\n if (!workspace && !project) {\n project = await findFirst(searchDir, \".xcodeproj\");\n }\n if (!workspace && !project) {\n throw new Error(\n \"Could not find .xcworkspace or .xcodeproj in \" + searchDir +\n \". Pass workspace or project explicitly.\",\n );\n }\n\n // ── Run xcodebuild -list ──────────────────────────────────────────────\n\n const listArgs: string[] = [];\n if (workspace) listArgs.push(\"-workspace\", workspace);\n else if (project) listArgs.push(\"-project\", project);\n\n const listOutput = await xcodebuildList(listArgs);\n\n const schemes: string[] =\n listOutput.workspace?.schemes ?? listOutput.project?.schemes ?? [];\n const configurations: string[] =\n listOutput.project?.configurations ?? [];\n const targets: string[] = listOutput.project?.targets ?? [];\n\n // ── Resolve scheme ────────────────────────────────────────────────────\n\n let scheme = options.scheme ?? null;\n\n if (!scheme) {\n if (schemes.length === 1) {\n scheme = schemes[0];\n } else if (schemes.length > 1) {\n const refName =\n (workspace ? basename(workspace, \".xcworkspace\") : null) ??\n (project ? basename(project, \".xcodeproj\") : null);\n if (refName) {\n const m = schemes.find((s) => s === refName);\n if (m) scheme = m;\n }\n if (!scheme) {\n throw new Error(\n \"Multiple schemes found: \" + schemes.join(\", \") +\n \". Pass scheme explicitly.\",\n );\n }\n } else {\n throw new Error(\n \"No schemes found in the Xcode project. Make sure the scheme is shared.\",\n );\n }\n }\n\n const configuration = options.configuration ?? \"Release\";\n\n return {\n workspace,\n project,\n scheme,\n configuration,\n schemes,\n configurations,\n targets,\n };\n}\n","import { writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport plist from \"plist\";\nimport type { ExportMethod } from \"../types/index.js\";\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\nexport interface ExportOptionsPlistConfig {\n /** The export method: app-store, ad-hoc, development, enterprise, etc. */\n exportMethod: ExportMethod;\n /** Apple Developer team ID */\n teamId?: string;\n /**\n * Map of bundle identifier to provisioning profile name.\n * e.g. { \"com.example.app\": \"MyApp Distribution\" }\n */\n provisioningProfiles?: Record<string, string>;\n /** Whether to include bitcode (deprecated in Xcode 14+, defaults to false) */\n includeBitcode?: boolean;\n /** Whether to include symbols in the export (defaults to true) */\n includeSymbols?: boolean;\n /** Code signing identity, e.g. \"Apple Distribution: Company (TEAM_ID)\" */\n signingCertificate?: string;\n /** Signing style: \"manual\" or \"automatic\" */\n signingStyle?: \"manual\" | \"automatic\";\n /** Destination for export: \"export\" or \"upload\" */\n destination?: \"export\" | \"upload\";\n /** Whether to generate an app thinning report */\n thinning?: string;\n /** Catalyst platform: \"macos\" or \"ios\" */\n catalystPlatform?: string;\n /** Additional arbitrary keys to merge into the plist */\n additionalOptions?: Record<string, unknown>;\n}\n\n// ── Signing Style Inference ────────────────────────────────────────────────\n\nfunction inferSigningStyle(\n config: ExportOptionsPlistConfig,\n): \"manual\" | \"automatic\" {\n if (config.signingStyle) return config.signingStyle;\n // If provisioning profiles are specified, use manual signing\n if (\n config.provisioningProfiles &&\n Object.keys(config.provisioningProfiles).length > 0\n ) {\n return \"manual\";\n }\n return \"automatic\";\n}\n\n// ── Public API ─────────────────────────────────────────────────────────────\n\n/**\n * Build the exportOptions plist dictionary. Returns a plain object that can be\n * serialized to XML plist via the `plist` package.\n */\nexport function buildExportOptions(\n config: ExportOptionsPlistConfig,\n): Record<string, unknown> {\n const opts: Record<string, unknown> = {\n method: config.exportMethod,\n };\n\n const signingStyle = inferSigningStyle(config);\n opts.signingStyle = signingStyle;\n\n if (config.teamId) {\n opts.teamID = config.teamId;\n }\n\n if (signingStyle === \"manual\" && config.provisioningProfiles) {\n opts.provisioningProfiles = config.provisioningProfiles;\n }\n\n if (config.signingCertificate) {\n opts.signingCertificate = config.signingCertificate;\n }\n\n // Bitcode (default false for modern Xcode)\n opts.uploadBitcode = config.includeBitcode ?? false;\n opts.compileBitcode = config.includeBitcode ?? false;\n\n // Symbols (default true)\n opts.uploadSymbols = config.includeSymbols ?? true;\n\n if (config.destination) {\n opts.destination = config.destination;\n }\n\n if (config.thinning) {\n opts.thinning = config.thinning;\n }\n\n if (config.catalystPlatform) {\n // Apple expects \"macos\" or \"ios\"\n opts.distributionBundleIdentifier = undefined;\n }\n\n // Merge additional options last so they can override anything\n if (config.additionalOptions) {\n Object.assign(opts, config.additionalOptions);\n }\n\n return opts;\n}\n\n/**\n * Generate an exportOptions plist XML string from the given config.\n */\nexport function generateExportOptionsPlistXml(\n config: ExportOptionsPlistConfig,\n): string {\n const opts = buildExportOptions(config);\n return plist.build(opts as plist.PlistObject);\n}\n\n/**\n * Write an exportOptions.plist file to disk and return its path.\n *\n * @param dir - Directory to write the file into\n * @param config - Export options configuration\n * @returns The absolute path to the written plist file\n */\nexport async function writeExportOptionsPlist(\n dir: string,\n config: ExportOptionsPlistConfig,\n): Promise<string> {\n const xml = generateExportOptionsPlistXml(config);\n const plistPath = join(dir, \"exportOptions.plist\");\n await writeFile(plistPath, xml, \"utf-8\");\n return plistPath;\n}\n","import { spawn } from \"node:child_process\";\nimport { mkdir, readdir, rm, stat } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { tmpdir } from \"node:os\";\nimport { randomUUID } from \"node:crypto\";\n\nimport { requireMacOS } from \"../xcode/platform.js\";\nimport { detectValues } from \"./detect.js\";\nimport { writeExportOptionsPlist } from \"./export-options.js\";\nimport type { ExportMethod } from \"../types/index.js\";\n\n// ── Re-exports ─────────────────────────────────────────────────────────────\n\nexport { detectValues } from \"./detect.js\";\nexport type { DetectedValues, XcodeBuildListOutput } from \"./detect.js\";\nexport {\n buildExportOptions,\n generateExportOptionsPlistXml,\n writeExportOptionsPlist,\n} from \"./export-options.js\";\nexport type { ExportOptionsPlistConfig } from \"./export-options.js\";\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\nexport interface GymOptions {\n scheme: string;\n workspace?: string;\n project?: string;\n configuration?: string;\n exportMethod: ExportMethod;\n teamId?: string;\n provisioningProfiles?: Record<string, string>;\n codeSignIdentity?: string;\n outputDirectory?: string;\n outputName?: string;\n clean?: boolean;\n archivePath?: string;\n derivedDataPath?: string;\n xcargs?: string;\n buildPath?: string;\n includeBitcode?: boolean;\n includeSymbols?: boolean;\n exportOptions?: Record<string, unknown>;\n sdk?: string;\n destination?: string;\n catalystPlatform?: string;\n disableXcpretty?: boolean;\n onOutput?: (chunk: string) => void;\n}\n\nexport interface GymResult {\n success: boolean;\n exitCode: number;\n ipaPath: string | null;\n pkgPath: string | null;\n dsymPath: string | null;\n archivePath: string;\n output: string;\n}\n\n// ── Internal helpers ───────────────────────────────────────────────────────\n\n/**\n * Spawn xcodebuild with the given args, streaming stdout/stderr to the\n * optional `onOutput` callback and collecting full output.\n */\nfunction runXcodebuild(\n args: string[],\n onOutput?: (chunk: string) => void,\n): Promise<{ exitCode: number; output: string }> {\n return new Promise((res, rej) => {\n const proc = spawn(\"xcodebuild\", args, {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n const chunks: string[] = [];\n\n const handleData = (data: Buffer) => {\n const text = data.toString(\"utf-8\");\n chunks.push(text);\n if (onOutput) onOutput(text);\n };\n\n proc.stdout.on(\"data\", handleData);\n proc.stderr.on(\"data\", handleData);\n proc.on(\"error\", rej);\n proc.on(\"close\", (code) => {\n res({ exitCode: code ?? 1, output: chunks.join(\"\") });\n });\n });\n}\n\n/**\n * Recursively find the first file matching `ext` inside `dir`.\n */\nasync function findFileWithExtension(\n dir: string,\n ext: string,\n): Promise<string | null> {\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return null;\n }\n for (const entry of entries) {\n const full = join(dir, entry.name);\n if (entry.name.endsWith(ext) && !entry.isDirectory()) {\n return full;\n }\n if (entry.isDirectory()) {\n const found = await findFileWithExtension(full, ext);\n if (found) return found;\n }\n }\n return null;\n}\n\n/**\n * Compress a directory to a .tar.gz file and return its path.\n */\nasync function compressDsyms(\n dsymDir: string,\n outputPath: string,\n): Promise<string> {\n return new Promise((res, rej) => {\n const proc = spawn(\"tar\", [\"-czf\", outputPath, \"-C\", dsymDir, \".\"], {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n proc.on(\"error\", rej);\n proc.on(\"close\", (code) => {\n if (code !== 0) rej(new Error(\"tar failed with exit code \" + code));\n else res(outputPath);\n });\n });\n}\n\n// ── Main entry point ───────────────────────────────────────────────────────\n\n/**\n * Build an iOS/macOS app using xcodebuild archive + exportArchive.\n * This is the TypeScript equivalent of Fastlane's `gym` (alias `build_app`).\n *\n * Steps:\n * 1. requireMacOS(\"gym\")\n * 2. Detect values (workspace/project/scheme/config)\n * 3. Clean if requested\n * 4. Archive via `xcodebuild archive`\n * 5. Generate exportOptionsPlist\n * 6. Export via `xcodebuild -exportArchive`\n * 7. Find IPA/PKG, compress dSYMs\n * 8. Return GymResult\n */\nexport async function buildApp(options: GymOptions): Promise<GymResult> {\n requireMacOS(\"gym\");\n\n // ── 1. Detect values ──────────────────────────────────────────────────\n\n const detected = await detectValues({\n workspace: options.workspace,\n project: options.project,\n scheme: options.scheme,\n configuration: options.configuration,\n });\n\n const { workspace, project, scheme, configuration } = detected;\n\n // ── 2. Prepare paths ─────────────────────────────────────────────────\n\n const outputDir = resolve(\n options.outputDirectory ?? join(process.cwd(), \"output\"),\n );\n await mkdir(outputDir, { recursive: true });\n\n const archiveName = options.outputName ?? scheme;\n const archivePath =\n options.archivePath ?? join(outputDir, archiveName + \".xcarchive\");\n const exportPath = join(outputDir, \"export\");\n await mkdir(exportPath, { recursive: true });\n\n // Temp directory for the export options plist\n const tmpDir = join(tmpdir(), \"fastnode-gym-\" + randomUUID());\n await mkdir(tmpDir, { recursive: true });\n\n const fullOutput: string[] = [];\n const onOutput = (chunk: string) => {\n fullOutput.push(chunk);\n if (options.onOutput) options.onOutput(chunk);\n };\n\n try {\n // ── 3. Clean if requested ─────────────────────────────────────────\n\n if (options.clean) {\n const cleanArgs = [\"clean\"];\n if (workspace) cleanArgs.push(\"-workspace\", workspace);\n else if (project) cleanArgs.push(\"-project\", project);\n cleanArgs.push(\"-scheme\", scheme, \"-configuration\", configuration);\n if (options.xcargs) cleanArgs.push(...options.xcargs.split(/\\s+/));\n\n const cleanResult = await runXcodebuild(cleanArgs, onOutput);\n if (cleanResult.exitCode !== 0) {\n return {\n success: false,\n exitCode: cleanResult.exitCode,\n ipaPath: null,\n pkgPath: null,\n dsymPath: null,\n archivePath,\n output: fullOutput.join(\"\"),\n };\n }\n }\n\n // ── 4. Archive ────────────────────────────────────────────────────\n\n const archiveArgs: string[] = [\"archive\"];\n\n if (workspace) archiveArgs.push(\"-workspace\", workspace);\n else if (project) archiveArgs.push(\"-project\", project);\n\n archiveArgs.push(\"-scheme\", scheme);\n archiveArgs.push(\"-archivePath\", archivePath);\n archiveArgs.push(\"-configuration\", configuration);\n\n if (options.sdk) {\n archiveArgs.push(\"-sdk\", options.sdk);\n }\n if (options.destination) {\n archiveArgs.push(\"-destination\", options.destination);\n }\n if (options.derivedDataPath) {\n archiveArgs.push(\"-derivedDataPath\", options.derivedDataPath);\n }\n if (options.xcargs) {\n archiveArgs.push(...options.xcargs.split(/\\s+/));\n }\n\n const archiveResult = await runXcodebuild(archiveArgs, onOutput);\n if (archiveResult.exitCode !== 0) {\n return {\n success: false,\n exitCode: archiveResult.exitCode,\n ipaPath: null,\n pkgPath: null,\n dsymPath: null,\n archivePath,\n output: fullOutput.join(\"\"),\n };\n }\n\n // ── 5. Generate exportOptionsPlist ────────────────────────────────\n\n const exportOptionsPlistPath = await writeExportOptionsPlist(tmpDir, {\n exportMethod: options.exportMethod,\n teamId: options.teamId,\n provisioningProfiles: options.provisioningProfiles,\n signingCertificate: options.codeSignIdentity,\n includeBitcode: options.includeBitcode,\n includeSymbols: options.includeSymbols,\n additionalOptions: options.exportOptions,\n });\n\n // ── 6. Export archive ─────────────────────────────────────────────\n\n const exportArgs: string[] = [\n \"-exportArchive\",\n \"-archivePath\",\n archivePath,\n \"-exportOptionsPlist\",\n exportOptionsPlistPath,\n \"-exportPath\",\n exportPath,\n ];\n\n if (options.xcargs) {\n exportArgs.push(...options.xcargs.split(/\\s+/));\n }\n\n const exportResult = await runXcodebuild(exportArgs, onOutput);\n if (exportResult.exitCode !== 0) {\n return {\n success: false,\n exitCode: exportResult.exitCode,\n ipaPath: null,\n pkgPath: null,\n dsymPath: null,\n archivePath,\n output: fullOutput.join(\"\"),\n };\n }\n\n // ── 7. Find outputs ───────────────────────────────────────────────\n\n // Find IPA\n let ipaPath = await findFileWithExtension(exportPath, \".ipa\");\n\n // Find PKG (macOS installer)\n let pkgPath = await findFileWithExtension(exportPath, \".pkg\");\n\n // Compress dSYMs\n let dsymPath: string | null = null;\n const dsymsDir = join(archivePath, \"dSYMs\");\n try {\n const dsymStat = await stat(dsymsDir);\n if (dsymStat.isDirectory()) {\n const dsymEntries = await readdir(dsymsDir);\n if (dsymEntries.length > 0) {\n dsymPath = join(outputDir, archiveName + \".app.dSYM.zip\");\n await compressDsyms(dsymsDir, dsymPath);\n }\n }\n } catch {\n // No dSYMs directory — that's OK\n }\n\n return {\n success: true,\n exitCode: 0,\n ipaPath,\n pkgPath,\n dsymPath,\n archivePath,\n output: fullOutput.join(\"\"),\n };\n } finally {\n // Clean up temp directory\n await rm(tmpDir, { recursive: true, force: true }).catch(() => {});\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import '../enums-B609j2rb.cjs';
|
|
2
|
+
export { D as DetectedValues, E as ExportOptionsPlistConfig, G as GymOptions, a as GymResult, X as XcodeBuildListOutput, b as buildApp, c as buildExportOptions, d as detectValues, g as generateExportOptionsPlistXml, w as writeExportOptionsPlist } from '../index-DrUpRXRG.cjs';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import '../enums-B609j2rb.js';
|
|
2
|
+
export { D as DetectedValues, E as ExportOptionsPlistConfig, G as GymOptions, a as GymResult, X as XcodeBuildListOutput, b as buildApp, c as buildExportOptions, d as detectValues, g as generateExportOptionsPlistXml, w as writeExportOptionsPlist } from '../index-DImN9PWc.js';
|