@mpgd/cli 0.37.0 → 0.39.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/dist/build-targets.d.ts +1 -1
- package/dist/build-targets.js +4 -0
- package/dist/index.js +4 -0
- package/dist/native-build-info.json +2 -2
- package/dist/native-build-target.js +358 -205
- package/package.json +14 -14
- package/templates/phaser-game/agent/acceptance.md +6 -0
- package/templates/phaser-game/agent/brief.md +4 -0
- package/templates/phaser-game/agent/game-manifest.json +22 -0
- package/templates/phaser-game/docs/MPGD_KIT_WORKFLOWS.md +22 -0
- package/templates/phaser-game/mpgd.targets.json +22 -0
- package/templates/phaser-game/src/main.ts +2 -0
- package/templates/phaser-game/src/platform/buildGateways/crazygames.ts +14 -0
- package/templates/phaser-game/src/platform/buildGateways/oneplay.ts +32 -0
- package/templates/phaser-game/src/platform/runtimeDetector.ts +2 -0
- package/templates/phaser-game/src/runtime/createGame.ts +3 -3
- package/templates/phaser-game/src/scenes/BootScene.ts +10 -1
- package/templates/phaser-game/src/scenes/PlayScene.ts +17 -0
- package/templates/phaser-game/vite.runtime-target-config.ts +4 -0
- package/templates/phaser-game/vite.shared.ts +9 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// node_modules/.cache/mpgd-native-build/tools/target/build-target.js
|
|
2
2
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
3
|
-
import { cpSync as cpSync4, existsSync as
|
|
3
|
+
import { cpSync as cpSync4, existsSync as existsSync23, lstatSync as lstatSync12, mkdirSync as mkdirSync12, mkdtempSync as mkdtempSync5, readdirSync as readdirSync8, readFileSync as readFileSync22, realpathSync as realpathSync9, rmSync as rmSync11, statSync as statSync7, writeFileSync as writeFileSync15 } from "node:fs";
|
|
4
4
|
import { tmpdir as tmpdir4 } from "node:os";
|
|
5
|
-
import { basename as basename4, dirname as dirname9, join as
|
|
5
|
+
import { basename as basename4, dirname as dirname9, join as join11, relative as relative9, resolve as resolve14 } from "node:path";
|
|
6
6
|
import { loadEnv } from "vite";
|
|
7
7
|
|
|
8
8
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/production-target-readiness.js
|
|
@@ -1871,6 +1871,20 @@ var targetIntegrations = [
|
|
|
1871
1871
|
"notifications"
|
|
1872
1872
|
];
|
|
1873
1873
|
var integrationUpperBoundsByRuntime = {
|
|
1874
|
+
"crazygames-web": {
|
|
1875
|
+
identityUpgrade: "unsupported",
|
|
1876
|
+
presentation: "available",
|
|
1877
|
+
sharing: "unsupported",
|
|
1878
|
+
inboundShare: "unsupported",
|
|
1879
|
+
notifications: "unsupported"
|
|
1880
|
+
},
|
|
1881
|
+
"oneplay-web": {
|
|
1882
|
+
identityUpgrade: "unsupported",
|
|
1883
|
+
presentation: "available",
|
|
1884
|
+
sharing: "unsupported",
|
|
1885
|
+
inboundShare: "unsupported",
|
|
1886
|
+
notifications: "unsupported"
|
|
1887
|
+
},
|
|
1874
1888
|
"tiktok-minigame": {
|
|
1875
1889
|
identityUpgrade: "unsupported",
|
|
1876
1890
|
presentation: "available",
|
|
@@ -1940,7 +1954,7 @@ function normalizeTargetIntegrationConfig(config2) {
|
|
|
1940
1954
|
}
|
|
1941
1955
|
function assertTargetIntegrationRuntimeBounds(runtime, config2, label) {
|
|
1942
1956
|
const integrations = normalizeTargetIntegrationConfig(config2);
|
|
1943
|
-
if (runtime !== "tiktok-minigame" && runtime !== "verse8-web" && runtime !== "web-preview" && runtime !== "wechat-minigame") {
|
|
1957
|
+
if (runtime !== "tiktok-minigame" && runtime !== "verse8-web" && runtime !== "crazygames-web" && runtime !== "oneplay-web" && runtime !== "web-preview" && runtime !== "wechat-minigame") {
|
|
1944
1958
|
return integrations;
|
|
1945
1959
|
}
|
|
1946
1960
|
const upperBounds = integrationUpperBoundsByRuntime[runtime];
|
|
@@ -2044,6 +2058,24 @@ function createEffectiveTargetConfig(input) {
|
|
|
2044
2058
|
};
|
|
2045
2059
|
}
|
|
2046
2060
|
function resolveAuthoritativeGameServicesConfig(config2, platformTarget) {
|
|
2061
|
+
if (config2.runtime === "oneplay-web") {
|
|
2062
|
+
const authority = platformTarget?.authoritativeGameServices === true;
|
|
2063
|
+
const iap = authority && config2.features.iap && config2.monetization.iap;
|
|
2064
|
+
const rewardedAds = authority && config2.features.rewardedAds && config2.monetization.rewardedAds;
|
|
2065
|
+
const interstitialAds = config2.features.interstitialAds && config2.monetization.interstitialAds;
|
|
2066
|
+
const monetization = {
|
|
2067
|
+
...disabledAuthoritativeMonetization,
|
|
2068
|
+
iap,
|
|
2069
|
+
rewardedAds,
|
|
2070
|
+
interstitialAds
|
|
2071
|
+
};
|
|
2072
|
+
return { ...config2, features: { ...config2.features, ...monetization }, monetization };
|
|
2073
|
+
}
|
|
2074
|
+
if (config2.runtime === "crazygames-web") {
|
|
2075
|
+
const interstitialAds = platformTarget?.crazyGamesLaunch === "full" && config2.features.interstitialAds && config2.monetization.interstitialAds;
|
|
2076
|
+
const monetization = { ...disabledAuthoritativeMonetization, interstitialAds };
|
|
2077
|
+
return { ...config2, features: { ...config2.features, ...monetization }, monetization };
|
|
2078
|
+
}
|
|
2047
2079
|
if (platformTarget?.authoritativeGameServices !== false) {
|
|
2048
2080
|
return config2;
|
|
2049
2081
|
}
|
|
@@ -2224,10 +2256,81 @@ function requireCanonicalAppVersion(value) {
|
|
|
2224
2256
|
return gameVersion;
|
|
2225
2257
|
}
|
|
2226
2258
|
|
|
2259
|
+
// node_modules/.cache/mpgd-native-build/tools/target/crazygames-artifact.js
|
|
2260
|
+
import { lstatSync as lstatSync4, readdirSync as readdirSync2, readFileSync as readFileSync7 } from "node:fs";
|
|
2261
|
+
import { join as join4 } from "node:path";
|
|
2262
|
+
function assertCrazyGamesArtifact(root) {
|
|
2263
|
+
let files = 0;
|
|
2264
|
+
let bytes = 0;
|
|
2265
|
+
function visit(directory) {
|
|
2266
|
+
for (const name of readdirSync2(directory)) {
|
|
2267
|
+
const path10 = join4(directory, name);
|
|
2268
|
+
const stat = lstatSync4(path10);
|
|
2269
|
+
if (stat.isDirectory()) {
|
|
2270
|
+
visit(path10);
|
|
2271
|
+
} else if (stat.isFile()) {
|
|
2272
|
+
files += 1;
|
|
2273
|
+
bytes += stat.size;
|
|
2274
|
+
} else {
|
|
2275
|
+
throw new Error("CrazyGames artifacts must contain regular files and directories.");
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
visit(root);
|
|
2280
|
+
if (files > 1500 || bytes > 25e7) {
|
|
2281
|
+
throw new Error("CrazyGames submission exceeds 1500 files or 250 MB.");
|
|
2282
|
+
}
|
|
2283
|
+
const index = readFileSync7(join4(root, "index.html"), "utf8");
|
|
2284
|
+
for (const match of index.matchAll(/\b(?:src|href)\s*=\s*(?:["']([^"']+)["']|([^\s"'`=<>]+))/giu)) {
|
|
2285
|
+
const path10 = match[1] ?? match[2];
|
|
2286
|
+
if (path10?.startsWith("/") || /^https?:/iu.test(path10 ?? "")) {
|
|
2287
|
+
throw new Error("CrazyGames index assets must use relative paths.");
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
return { files, bytes };
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
// node_modules/.cache/mpgd-native-build/tools/target/oneplay-artifact.js
|
|
2294
|
+
import { existsSync as existsSync6, readFileSync as readFileSync8, writeFileSync as writeFileSync4 } from "node:fs";
|
|
2295
|
+
import { join as join5 } from "node:path";
|
|
2296
|
+
var onePlayFrameAncestors = "https://*.onestore.co.kr https://*.onestore.net";
|
|
2297
|
+
function writeOnePlayHostingHeaders(root) {
|
|
2298
|
+
const path10 = join5(root, "_headers");
|
|
2299
|
+
if (!existsSync6(path10)) {
|
|
2300
|
+
writeFileSync4(path10, `/*
|
|
2301
|
+
Content-Security-Policy: frame-ancestors ${onePlayFrameAncestors}
|
|
2302
|
+
`);
|
|
2303
|
+
}
|
|
2304
|
+
assertOnePlayArtifact(root);
|
|
2305
|
+
}
|
|
2306
|
+
function assertOnePlayArtifact(root) {
|
|
2307
|
+
assertNonInstallableWebArtifact(root);
|
|
2308
|
+
const headers = readFileSync8(join5(root, "_headers"), "utf8");
|
|
2309
|
+
let rule = "";
|
|
2310
|
+
let allowed = false;
|
|
2311
|
+
for (const line of headers.split(/\r?\n/u)) {
|
|
2312
|
+
if (/^\S/u.test(line) && !line.startsWith("#")) {
|
|
2313
|
+
rule = line.trim();
|
|
2314
|
+
}
|
|
2315
|
+
const policy = /^\s+Content-Security-Policy:\s*(.+)$/iu.exec(line)?.[1];
|
|
2316
|
+
const directive = policy === void 0 ? void 0 : /(?:^|;)\s*frame-ancestors\s+([^;]+)/iu.exec(policy)?.[1];
|
|
2317
|
+
const origins = directive?.trim().split(/\s+/u);
|
|
2318
|
+
if (rule === "/*" && origins?.includes("https://*.onestore.co.kr") && origins.includes("https://*.onestore.net") && !origins.includes("'none'")) {
|
|
2319
|
+
allowed = true;
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
if (!allowed) {
|
|
2323
|
+
throw new Error("ONE play hosting headers must allow both ONE store domain families.");
|
|
2324
|
+
}
|
|
2325
|
+
if (/x-frame-options\s*:\s*(?:deny|sameorigin)/iu.test(headers)) {
|
|
2326
|
+
throw new Error("ONE play hosting headers contain a conflicting X-Frame-Options rule.");
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2227
2330
|
// node_modules/.cache/mpgd-native-build/tools/target/effective-config.js
|
|
2228
2331
|
import { createHash as createHash3 } from "node:crypto";
|
|
2229
|
-
import { existsSync as
|
|
2230
|
-
import { dirname as dirname5, join as
|
|
2332
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync4, readFileSync as readFileSync11, writeFileSync as writeFileSync5 } from "node:fs";
|
|
2333
|
+
import { dirname as dirname5, join as join6 } from "node:path";
|
|
2231
2334
|
|
|
2232
2335
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/target-name.js
|
|
2233
2336
|
var deploymentTargetNamePattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
@@ -2284,11 +2387,11 @@ function readConfiguredPath(value) {
|
|
|
2284
2387
|
}
|
|
2285
2388
|
|
|
2286
2389
|
// node_modules/.cache/mpgd-native-build/tools/io.js
|
|
2287
|
-
import { readFileSync as
|
|
2390
|
+
import { readFileSync as readFileSync9 } from "node:fs";
|
|
2288
2391
|
import { resolve as resolve5 } from "node:path";
|
|
2289
2392
|
import { pathToFileURL } from "node:url";
|
|
2290
2393
|
function readJsonFile(path10) {
|
|
2291
|
-
return JSON.parse(
|
|
2394
|
+
return JSON.parse(readFileSync9(resolve5(path10), "utf8"));
|
|
2292
2395
|
}
|
|
2293
2396
|
function isCliEntrypoint(metaUrl) {
|
|
2294
2397
|
const scriptPath = process.argv[1];
|
|
@@ -2372,12 +2475,12 @@ function isValidHostname(hostname) {
|
|
|
2372
2475
|
}
|
|
2373
2476
|
|
|
2374
2477
|
// node_modules/.cache/mpgd-native-build/tools/target/minigame-package-budget.js
|
|
2375
|
-
import { lstatSync as
|
|
2478
|
+
import { lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
|
|
2376
2479
|
import { isAbsolute as isAbsolute3, relative as relative4, resolve as resolve6, sep as sep2 } from "node:path";
|
|
2377
2480
|
var miniGameMainPackageLimitBytes = 4 * 1024 * 1024;
|
|
2378
2481
|
function assertMiniGamePackageBudget(input) {
|
|
2379
2482
|
const artifactRoot = resolve6(input.artifactRoot);
|
|
2380
|
-
const rootStat =
|
|
2483
|
+
const rootStat = lstatSync5(artifactRoot);
|
|
2381
2484
|
if (!rootStat.isDirectory() || rootStat.isSymbolicLink()) {
|
|
2382
2485
|
throw new Error(`Mini-game artifact root must be a real directory: ${artifactRoot}`);
|
|
2383
2486
|
}
|
|
@@ -2406,7 +2509,7 @@ function assertMiniGamePackageBudget(input) {
|
|
|
2406
2509
|
}
|
|
2407
2510
|
for (const subpackage of subpackages) {
|
|
2408
2511
|
const directory = resolveArtifactPath(artifactRoot, subpackage.root);
|
|
2409
|
-
if (!
|
|
2512
|
+
if (!lstatSync5(directory).isDirectory()) {
|
|
2410
2513
|
throw new Error(`Mini-game subpackage root must be a directory: ${subpackage.root}`);
|
|
2411
2514
|
}
|
|
2412
2515
|
}
|
|
@@ -2441,9 +2544,9 @@ function listMiniGameArtifactFiles(artifactRoot) {
|
|
|
2441
2544
|
if (directory === void 0) {
|
|
2442
2545
|
throw new Error("Mini-game artifact traversal lost its current directory.");
|
|
2443
2546
|
}
|
|
2444
|
-
for (const entry of
|
|
2547
|
+
for (const entry of readdirSync3(directory, { withFileTypes: true })) {
|
|
2445
2548
|
const path10 = resolve6(directory, entry.name);
|
|
2446
|
-
const stat =
|
|
2549
|
+
const stat = lstatSync5(path10);
|
|
2447
2550
|
if (stat.isSymbolicLink()) {
|
|
2448
2551
|
throw new Error(`Mini-game artifacts must not contain symbolic links: ${path10}`);
|
|
2449
2552
|
}
|
|
@@ -2524,7 +2627,7 @@ function resolveArtifactPath(root, path10) {
|
|
|
2524
2627
|
throw new Error(`Mini-game path escapes its artifact root: ${path10}`);
|
|
2525
2628
|
}
|
|
2526
2629
|
try {
|
|
2527
|
-
const stat =
|
|
2630
|
+
const stat = lstatSync5(resolved);
|
|
2528
2631
|
if (stat.isSymbolicLink()) {
|
|
2529
2632
|
throw new Error(`Mini-game path must not be a symbolic link: ${path10}`);
|
|
2530
2633
|
}
|
|
@@ -2768,6 +2871,11 @@ var assertPlatformTargetsConfig = /* @__PURE__ */ (() => {
|
|
|
2768
2871
|
path: _path + ".installable",
|
|
2769
2872
|
expected: "(boolean | undefined)",
|
|
2770
2873
|
value: input.installable
|
|
2874
|
+
}, _errorFactory)) && (void 0 === input.crazyGamesLaunch || "basic" === input.crazyGamesLaunch || "full" === input.crazyGamesLaunch || _assertGuard_13._assertGuard(_exceptionable, {
|
|
2875
|
+
method: "typia.createAssert",
|
|
2876
|
+
path: _path + ".crazyGamesLaunch",
|
|
2877
|
+
expected: '("basic" | "full" | undefined)',
|
|
2878
|
+
value: input.crazyGamesLaunch
|
|
2771
2879
|
}, _errorFactory)) && (void 0 === input.staticDir || "string" === typeof input.staticDir || _assertGuard_13._assertGuard(_exceptionable, {
|
|
2772
2880
|
method: "typia.createAssert",
|
|
2773
2881
|
path: _path + ".staticDir",
|
|
@@ -2990,7 +3098,7 @@ var assertPlatformTargetsConfig = /* @__PURE__ */ (() => {
|
|
|
2990
3098
|
});
|
|
2991
3099
|
const _io10 = (input) => _ip0(input) && _ip1(input) && _ip2(input) && _ip3(input) && _ip4(input) && _ip5(input) && ("tiktok-minigame" === input.kind || "wechat-minigame" === input.kind) && _ip8(input) && "canvas" === input.renderer && ("landscape" === input.orientation || "portrait" === input.orientation) && true === input.experimental && (void 0 === input.remoteAssetOrigins || Array.isArray(input.remoteAssetOrigins) && input.remoteAssetOrigins.every((elem) => "string" === typeof elem)) && ("object" === typeof input.packageBudget && null !== input.packageBudget && _io11(input.packageBudget));
|
|
2992
3100
|
const _io11 = (input) => "number" === typeof input.mainBytes && "number" === typeof input.totalBytes && (void 0 === input.independentSubpackageBytes || "number" === typeof input.independentSubpackageBytes);
|
|
2993
|
-
const _io12 = (input) => _ip0(input) && _ip1(input) && _ip2(input) && _ip3(input) && _ip4(input) && _ip5(input) && "web" === input.kind && _ip8(input) && (void 0 === input.installable || "boolean" === typeof input.installable) && (void 0 === input.staticDir || "string" === typeof input.staticDir);
|
|
3101
|
+
const _io12 = (input) => _ip0(input) && _ip1(input) && _ip2(input) && _ip3(input) && _ip4(input) && _ip5(input) && "web" === input.kind && _ip8(input) && (void 0 === input.installable || "boolean" === typeof input.installable) && (void 0 === input.crazyGamesLaunch || "basic" === input.crazyGamesLaunch || "full" === input.crazyGamesLaunch) && (void 0 === input.staticDir || "string" === typeof input.staticDir);
|
|
2994
3102
|
const _io2 = (input) => _ip0(input) && _ip1(input) && _ip2(input) && _ip3(input) && _ip4(input) && _ip5(input) && "apps-in-toss" === input.kind && _ip6(input) && _ip7(input) && ".ait" === input.artifact && (void 0 === input.navigationBar || "object" === typeof input.navigationBar && null !== input.navigationBar && false === Array.isArray(input.navigationBar) && _io7(input.navigationBar));
|
|
2995
3103
|
const _io3 = (input) => (void 0 === input.appName || "string" === typeof input.appName) && (void 0 === input.displayName || "string" === typeof input.displayName) && (void 0 === input.primaryColor || "string" === typeof input.primaryColor) && (void 0 === input.packageId || "string" === typeof input.packageId) && (void 0 === input.bundleId || "string" === typeof input.bundleId) && (void 0 === input.sdkMajor || "number" === typeof input.sdkMajor);
|
|
2996
3104
|
const _io4 = (input) => (void 0 === input.identityUpgrade || "action-required" === input.identityUpgrade || "approval-required" === input.identityUpgrade || "available" === input.identityUpgrade || "configuration-required" === input.identityUpgrade || "disabled" === input.identityUpgrade || "temporarily-unavailable" === input.identityUpgrade || "unsupported" === input.identityUpgrade) && (void 0 === input.presentation || "action-required" === input.presentation || "approval-required" === input.presentation || "available" === input.presentation || "configuration-required" === input.presentation || "disabled" === input.presentation || "temporarily-unavailable" === input.presentation || "unsupported" === input.presentation) && (void 0 === input.sharing || "action-required" === input.sharing || "approval-required" === input.sharing || "available" === input.sharing || "configuration-required" === input.sharing || "disabled" === input.sharing || "temporarily-unavailable" === input.sharing || "unsupported" === input.sharing) && (void 0 === input.inboundShare || "action-required" === input.inboundShare || "approval-required" === input.inboundShare || "available" === input.inboundShare || "configuration-required" === input.inboundShare || "disabled" === input.inboundShare || "temporarily-unavailable" === input.inboundShare || "unsupported" === input.inboundShare) && (void 0 === input.notifications || "action-required" === input.notifications || "approval-required" === input.notifications || "available" === input.notifications || "configuration-required" === input.notifications || "disabled" === input.notifications || "temporarily-unavailable" === input.notifications || "unsupported" === input.notifications) && (void 0 === input.presentationMode || "fullscreen" === input.presentationMode || "inline-expanded" === input.presentationMode);
|
|
@@ -3093,6 +3201,21 @@ function assertPlatformTargetConfigShape(input, target2) {
|
|
|
3093
3201
|
if (input.adapter === "microsoft-store" && target2 !== "microsoft-store") {
|
|
3094
3202
|
throw new Error(`Platform target ${target2} cannot use the reserved microsoft-store adapter.`);
|
|
3095
3203
|
}
|
|
3204
|
+
if (target2 === "crazygames" && (input.kind !== "web" || input.adapter !== "crazygames")) {
|
|
3205
|
+
throw new Error("crazygames target must use the web kind and crazygames adapter.");
|
|
3206
|
+
}
|
|
3207
|
+
if (target2 === "oneplay" && (input.kind !== "web" || input.adapter !== "oneplay")) {
|
|
3208
|
+
throw new Error("oneplay target must use the web kind and oneplay adapter.");
|
|
3209
|
+
}
|
|
3210
|
+
if (input.adapter === "oneplay" && (input.kind !== "web" || input.installable !== false)) {
|
|
3211
|
+
throw new Error("ONE play requires a web target with installable: false.");
|
|
3212
|
+
}
|
|
3213
|
+
if (input.adapter === "crazygames" && (input.kind !== "web" || input.installable !== false)) {
|
|
3214
|
+
throw new Error("CrazyGames requires a web target with installable: false.");
|
|
3215
|
+
}
|
|
3216
|
+
if (input.crazyGamesLaunch !== void 0 && (input.adapter !== "crazygames" || !["basic", "full"].includes(input.crazyGamesLaunch))) {
|
|
3217
|
+
throw new Error("crazyGamesLaunch must be basic or full on a CrazyGames target.");
|
|
3218
|
+
}
|
|
3096
3219
|
switch (input.kind) {
|
|
3097
3220
|
case "web":
|
|
3098
3221
|
assertString(input.output, `${target2}.output`);
|
|
@@ -3307,20 +3430,20 @@ function assertTargetKind(input, target2) {
|
|
|
3307
3430
|
import * as _assertGuard_14 from "typia/lib/internal/_assertGuard";
|
|
3308
3431
|
import * as _accessExpressionAsString_14 from "typia/lib/internal/_accessExpressionAsString";
|
|
3309
3432
|
import { createHash as createHash2 } from "node:crypto";
|
|
3310
|
-
import { readFileSync as
|
|
3433
|
+
import { readFileSync as readFileSync10 } from "node:fs";
|
|
3311
3434
|
import typia4 from "typia";
|
|
3312
3435
|
var __typia_transform__accessExpressionAsString2 = _accessExpressionAsString_14._accessExpressionAsString;
|
|
3313
3436
|
var defaultTargetConfigMatrixFile = "packages/target-config/targets.json";
|
|
3314
3437
|
var assertTargetConfigMatrix = /* @__PURE__ */ (() => {
|
|
3315
|
-
const _iv0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "devvit-web", "microsoft-store-pwa", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3438
|
+
const _iv0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "crazygames-web", "devvit-web", "microsoft-store-pwa", "oneplay-web", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3316
3439
|
const _ip0 = (input) => "boolean" === typeof input["iap"];
|
|
3317
3440
|
const _ip1 = (input) => void 0 === input["bannerAds"] || "boolean" === typeof input["bannerAds"];
|
|
3318
3441
|
const _ip2 = (input) => "boolean" === typeof input["rewardedAds"];
|
|
3319
3442
|
const _ip3 = (input) => "boolean" === typeof input["interstitialAds"];
|
|
3320
3443
|
const _ip4 = (input) => "boolean" === typeof input["localization"];
|
|
3321
|
-
const _iv1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "devvit", "google-play", "microsoft-store", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3322
|
-
const _av0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "devvit-web", "microsoft-store-pwa", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3323
|
-
const _ae0 = '("apps-in-toss" | "capacitor-android" | "capacitor-ios" | "devvit-web" | "microsoft-store-pwa" | "tiktok-minigame" | "verse8-web" | "web" | "web-preview" | "wechat-minigame")';
|
|
3444
|
+
const _iv1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "crazygames", "devvit", "google-play", "microsoft-store", "oneplay", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3445
|
+
const _av0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "crazygames-web", "devvit-web", "microsoft-store-pwa", "oneplay-web", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3446
|
+
const _ae0 = '("apps-in-toss" | "capacitor-android" | "capacitor-ios" | "crazygames-web" | "devvit-web" | "microsoft-store-pwa" | "oneplay-web" | "tiktok-minigame" | "verse8-web" | "web" | "web-preview" | "wechat-minigame")';
|
|
3324
3447
|
const _ap0 = (input, _path, _exceptionable = true) => "boolean" === typeof input["iap"] || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3325
3448
|
method: "typia.createAssert",
|
|
3326
3449
|
path: _path + ".iap",
|
|
@@ -3351,8 +3474,8 @@ var assertTargetConfigMatrix = /* @__PURE__ */ (() => {
|
|
|
3351
3474
|
expected: "boolean",
|
|
3352
3475
|
value: input["localization"]
|
|
3353
3476
|
}, _errorFactory);
|
|
3354
|
-
const _av1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "devvit", "google-play", "microsoft-store", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3355
|
-
const _ae1 = '("app-store" | "apps-in-toss" | "devvit" | "google-play" | "microsoft-store" | "tiktok-minigame" | "verse8" | "web" | "web-preview" | "wechat-minigame")';
|
|
3477
|
+
const _av1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "crazygames", "devvit", "google-play", "microsoft-store", "oneplay", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3478
|
+
const _ae1 = '("app-store" | "apps-in-toss" | "crazygames" | "devvit" | "google-play" | "microsoft-store" | "oneplay" | "tiktok-minigame" | "verse8" | "web" | "web-preview" | "wechat-minigame")';
|
|
3356
3479
|
const _ae2 = '("action-required" | "approval-required" | "available" | "configuration-required" | "disabled" | "temporarily-unavailable" | "unsupported")';
|
|
3357
3480
|
const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.version || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3358
3481
|
method: "typia.createAssert",
|
|
@@ -3612,15 +3735,15 @@ var assertTargetConfigMatrix = /* @__PURE__ */ (() => {
|
|
|
3612
3735
|
};
|
|
3613
3736
|
})();
|
|
3614
3737
|
var assertTargetConfigExtensions = /* @__PURE__ */ (() => {
|
|
3615
|
-
const _iv0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "devvit-web", "microsoft-store-pwa", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3738
|
+
const _iv0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "crazygames-web", "devvit-web", "microsoft-store-pwa", "oneplay-web", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3616
3739
|
const _ip0 = (input) => "boolean" === typeof input["iap"];
|
|
3617
3740
|
const _ip1 = (input) => void 0 === input["bannerAds"] || "boolean" === typeof input["bannerAds"];
|
|
3618
3741
|
const _ip2 = (input) => "boolean" === typeof input["rewardedAds"];
|
|
3619
3742
|
const _ip3 = (input) => "boolean" === typeof input["interstitialAds"];
|
|
3620
3743
|
const _ip4 = (input) => "boolean" === typeof input["localization"];
|
|
3621
|
-
const _iv1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "devvit", "google-play", "microsoft-store", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3622
|
-
const _av0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "devvit-web", "microsoft-store-pwa", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3623
|
-
const _ae0 = '("apps-in-toss" | "capacitor-android" | "capacitor-ios" | "devvit-web" | "microsoft-store-pwa" | "tiktok-minigame" | "verse8-web" | "web" | "web-preview" | "wechat-minigame")';
|
|
3744
|
+
const _iv1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "crazygames", "devvit", "google-play", "microsoft-store", "oneplay", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3745
|
+
const _av0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "crazygames-web", "devvit-web", "microsoft-store-pwa", "oneplay-web", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3746
|
+
const _ae0 = '("apps-in-toss" | "capacitor-android" | "capacitor-ios" | "crazygames-web" | "devvit-web" | "microsoft-store-pwa" | "oneplay-web" | "tiktok-minigame" | "verse8-web" | "web" | "web-preview" | "wechat-minigame")';
|
|
3624
3747
|
const _ap0 = (input, _path, _exceptionable = true) => "boolean" === typeof input["iap"] || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3625
3748
|
method: "typia.createAssert",
|
|
3626
3749
|
path: _path + ".iap",
|
|
@@ -3651,8 +3774,8 @@ var assertTargetConfigExtensions = /* @__PURE__ */ (() => {
|
|
|
3651
3774
|
expected: "boolean",
|
|
3652
3775
|
value: input["localization"]
|
|
3653
3776
|
}, _errorFactory);
|
|
3654
|
-
const _av1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "devvit", "google-play", "microsoft-store", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3655
|
-
const _ae1 = '("app-store" | "apps-in-toss" | "devvit" | "google-play" | "microsoft-store" | "tiktok-minigame" | "verse8" | "web" | "web-preview" | "wechat-minigame")';
|
|
3777
|
+
const _av1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "crazygames", "devvit", "google-play", "microsoft-store", "oneplay", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3778
|
+
const _ae1 = '("app-store" | "apps-in-toss" | "crazygames" | "devvit" | "google-play" | "microsoft-store" | "oneplay" | "tiktok-minigame" | "verse8" | "web" | "web-preview" | "wechat-minigame")';
|
|
3656
3779
|
const _ae2 = '("action-required" | "approval-required" | "available" | "configuration-required" | "disabled" | "temporarily-unavailable" | "unsupported")';
|
|
3657
3780
|
const _ao0 = (input, _path, _exceptionable = true) => (1 === input.schemaVersion || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3658
3781
|
method: "typia.createAssert",
|
|
@@ -3926,6 +4049,8 @@ var releaseProfileByRuntime = {
|
|
|
3926
4049
|
"apps-in-toss": "apps-in-toss",
|
|
3927
4050
|
"devvit-web": "devvit",
|
|
3928
4051
|
"verse8-web": "verse8",
|
|
4052
|
+
"crazygames-web": "crazygames",
|
|
4053
|
+
"oneplay-web": "oneplay",
|
|
3929
4054
|
"wechat-minigame": "wechat-minigame",
|
|
3930
4055
|
"tiktok-minigame": "tiktok-minigame"
|
|
3931
4056
|
};
|
|
@@ -3935,7 +4060,7 @@ function loadTargetConfigMatrix(baseFile = process.env[targetConfigMatrixFileEnv
|
|
|
3935
4060
|
return base;
|
|
3936
4061
|
}
|
|
3937
4062
|
const normalizedExtensionsFile = extensionsFile.trim();
|
|
3938
|
-
const fileContent =
|
|
4063
|
+
const fileContent = readFileSync10(normalizedExtensionsFile);
|
|
3939
4064
|
const extensions = assertTargetConfigExtensions(JSON.parse(fileContent.toString("utf8")));
|
|
3940
4065
|
const collisions = Object.keys(extensions.targets).filter((target2) => base.targets[target2] !== void 0);
|
|
3941
4066
|
if (collisions.length > 0) {
|
|
@@ -4049,7 +4174,7 @@ function writeEffectiveTargetConfigs(options = {}) {
|
|
|
4049
4174
|
}
|
|
4050
4175
|
return writeEffectiveTargetConfig(target2, config2, outputDir);
|
|
4051
4176
|
});
|
|
4052
|
-
const indexPath =
|
|
4177
|
+
const indexPath = join6(outputDir, "index.json");
|
|
4053
4178
|
const previousArtifacts = readExistingArtifactIndex(indexPath, matrix.version).artifacts;
|
|
4054
4179
|
const artifactsByTarget = new Map(previousArtifacts.filter((artifact) => matrix.targets[artifact.target] !== void 0).map((artifact) => [artifact.target, artifact]));
|
|
4055
4180
|
for (const artifact of artifacts) {
|
|
@@ -4062,17 +4187,17 @@ function writeEffectiveTargetConfigs(options = {}) {
|
|
|
4062
4187
|
const indexContent = `${JSON.stringify(index, null, 2)}
|
|
4063
4188
|
`;
|
|
4064
4189
|
mkdirSync4(dirname5(indexPath), { recursive: true });
|
|
4065
|
-
|
|
4190
|
+
writeFileSync5(indexPath, indexContent);
|
|
4066
4191
|
return index;
|
|
4067
4192
|
}
|
|
4068
4193
|
function readExistingArtifactIndex(path10, version) {
|
|
4069
|
-
if (!
|
|
4194
|
+
if (!existsSync7(path10)) {
|
|
4070
4195
|
return {
|
|
4071
4196
|
version,
|
|
4072
4197
|
artifacts: []
|
|
4073
4198
|
};
|
|
4074
4199
|
}
|
|
4075
|
-
const parsed = JSON.parse(
|
|
4200
|
+
const parsed = JSON.parse(readFileSync11(path10, "utf8"));
|
|
4076
4201
|
if (parsed.version !== version) {
|
|
4077
4202
|
return {
|
|
4078
4203
|
version,
|
|
@@ -4083,11 +4208,11 @@ function readExistingArtifactIndex(path10, version) {
|
|
|
4083
4208
|
}
|
|
4084
4209
|
function writeEffectiveTargetConfig(target2, config2, outputDir) {
|
|
4085
4210
|
assertDeploymentTargetName(target2);
|
|
4086
|
-
const path10 =
|
|
4211
|
+
const path10 = join6(outputDir, `${target2}.json`);
|
|
4087
4212
|
const content = `${JSON.stringify(config2, null, 2)}
|
|
4088
4213
|
`;
|
|
4089
4214
|
mkdirSync4(dirname5(path10), { recursive: true });
|
|
4090
|
-
|
|
4215
|
+
writeFileSync5(path10, content);
|
|
4091
4216
|
return {
|
|
4092
4217
|
target: target2,
|
|
4093
4218
|
path: path10,
|
|
@@ -4139,7 +4264,8 @@ function toEffectivePlatformTargetMetadata(config2) {
|
|
|
4139
4264
|
case "web":
|
|
4140
4265
|
return {
|
|
4141
4266
|
...base,
|
|
4142
|
-
output: config2.output
|
|
4267
|
+
output: config2.output,
|
|
4268
|
+
...config2.crazyGamesLaunch === void 0 ? {} : { crazyGamesLaunch: config2.crazyGamesLaunch }
|
|
4143
4269
|
};
|
|
4144
4270
|
case "capacitor-android":
|
|
4145
4271
|
case "capacitor-ios":
|
|
@@ -4178,6 +4304,8 @@ function platformKindForRuntime(runtime) {
|
|
|
4178
4304
|
case "devvit-web":
|
|
4179
4305
|
return "devvit-web";
|
|
4180
4306
|
case "verse8-web":
|
|
4307
|
+
case "crazygames-web":
|
|
4308
|
+
case "oneplay-web":
|
|
4181
4309
|
return "web";
|
|
4182
4310
|
case "wechat-minigame":
|
|
4183
4311
|
return "wechat-minigame";
|
|
@@ -4201,6 +4329,10 @@ function platformAdapterForRuntime(runtime) {
|
|
|
4201
4329
|
return "devvit";
|
|
4202
4330
|
case "verse8-web":
|
|
4203
4331
|
return "verse8";
|
|
4332
|
+
case "crazygames-web":
|
|
4333
|
+
return "crazygames";
|
|
4334
|
+
case "oneplay-web":
|
|
4335
|
+
return "oneplay";
|
|
4204
4336
|
case "wechat-minigame":
|
|
4205
4337
|
return "wechat";
|
|
4206
4338
|
case "tiktok-minigame":
|
|
@@ -4216,7 +4348,7 @@ import * as _assertGuard_16 from "typia/lib/internal/_assertGuard";
|
|
|
4216
4348
|
import * as _accessExpressionAsString_16 from "typia/lib/internal/_accessExpressionAsString";
|
|
4217
4349
|
import { execFileSync } from "node:child_process";
|
|
4218
4350
|
import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
|
|
4219
|
-
import { existsSync as
|
|
4351
|
+
import { existsSync as existsSync9, readFileSync as readFileSync13, realpathSync as realpathSync5, renameSync, rmSync as rmSync4, writeFileSync as writeFileSync7 } from "node:fs";
|
|
4220
4352
|
import { isAbsolute as isAbsolute5, relative as relative5, resolve as resolve8 } from "node:path";
|
|
4221
4353
|
import typia6 from "typia";
|
|
4222
4354
|
|
|
@@ -4537,7 +4669,7 @@ function assertReleaseManifest(input) {
|
|
|
4537
4669
|
|
|
4538
4670
|
// node_modules/.cache/mpgd-native-build/tools/target/release-manifest-lock.js
|
|
4539
4671
|
import { randomUUID } from "node:crypto";
|
|
4540
|
-
import { closeSync, existsSync as
|
|
4672
|
+
import { closeSync, existsSync as existsSync8, lstatSync as lstatSync6, mkdirSync as mkdirSync5, openSync, readFileSync as readFileSync12, statSync, unlinkSync, writeFileSync as writeFileSync6 } from "node:fs";
|
|
4541
4673
|
import path2 from "node:path";
|
|
4542
4674
|
var maximumWaitMs = 3e4;
|
|
4543
4675
|
var pollingIntervalMs = 50;
|
|
@@ -4552,7 +4684,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4552
4684
|
try {
|
|
4553
4685
|
const descriptor = openSync(lockFile, "wx", 384);
|
|
4554
4686
|
try {
|
|
4555
|
-
|
|
4687
|
+
writeFileSync6(descriptor, `${JSON.stringify({ pid: process.pid, token })}
|
|
4556
4688
|
`);
|
|
4557
4689
|
} catch (error) {
|
|
4558
4690
|
unlinkSync(lockFile);
|
|
@@ -4567,7 +4699,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4567
4699
|
}
|
|
4568
4700
|
let observed;
|
|
4569
4701
|
try {
|
|
4570
|
-
observed =
|
|
4702
|
+
observed = lstatSync6(lockFile);
|
|
4571
4703
|
} catch (statError) {
|
|
4572
4704
|
if (statError.code === "ENOENT") {
|
|
4573
4705
|
continue;
|
|
@@ -4579,7 +4711,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4579
4711
|
}
|
|
4580
4712
|
if (canRecoverLock(lockFile)) {
|
|
4581
4713
|
try {
|
|
4582
|
-
const current =
|
|
4714
|
+
const current = lstatSync6(lockFile);
|
|
4583
4715
|
if (current.dev === observed.dev && current.ino === observed.ino && current.mtimeMs === observed.mtimeMs) {
|
|
4584
4716
|
unlinkSync(lockFile);
|
|
4585
4717
|
}
|
|
@@ -4599,8 +4731,8 @@ function withReleaseManifestLock(file, action) {
|
|
|
4599
4731
|
try {
|
|
4600
4732
|
return action();
|
|
4601
4733
|
} finally {
|
|
4602
|
-
if (
|
|
4603
|
-
const contents =
|
|
4734
|
+
if (existsSync8(lockFile)) {
|
|
4735
|
+
const contents = readFileSync12(lockFile, "utf8");
|
|
4604
4736
|
if (contents.includes(token)) {
|
|
4605
4737
|
unlinkSync(lockFile);
|
|
4606
4738
|
}
|
|
@@ -4610,7 +4742,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4610
4742
|
function canRecoverLock(lockFile) {
|
|
4611
4743
|
let record;
|
|
4612
4744
|
try {
|
|
4613
|
-
record = JSON.parse(
|
|
4745
|
+
record = JSON.parse(readFileSync12(lockFile, "utf8"));
|
|
4614
4746
|
} catch {
|
|
4615
4747
|
return Date.now() - statSync(lockFile).mtimeMs > incompleteLockGraceMs;
|
|
4616
4748
|
}
|
|
@@ -4836,14 +4968,14 @@ var assertAdPlacements = /* @__PURE__ */ (() => {
|
|
|
4836
4968
|
path: _path + ".placements",
|
|
4837
4969
|
expected: "ReadonlyArray<AdPlacementEntry>",
|
|
4838
4970
|
value: input.placements
|
|
4839
|
-
}, _errorFactory)) && input.placements.every((elem,
|
|
4971
|
+
}, _errorFactory)) && input.placements.every((elem, _index3) => ("object" === typeof elem && null !== elem || _assertGuard_16._assertGuard(_exceptionable, {
|
|
4840
4972
|
method: "typia.createAssert",
|
|
4841
|
-
path: _path + ".placements[" +
|
|
4973
|
+
path: _path + ".placements[" + _index3 + "]",
|
|
4842
4974
|
expected: _ae0,
|
|
4843
4975
|
value: elem
|
|
4844
|
-
}, _errorFactory)) && _au0(elem, _path + ".placements[" +
|
|
4976
|
+
}, _errorFactory)) && _au0(elem, _path + ".placements[" + _index3 + "]", _exceptionable) || _assertGuard_16._assertGuard(_exceptionable, {
|
|
4845
4977
|
method: "typia.createAssert",
|
|
4846
|
-
path: _path + ".placements[" +
|
|
4978
|
+
path: _path + ".placements[" + _index3 + "]",
|
|
4847
4979
|
expected: _ae0,
|
|
4848
4980
|
value: elem
|
|
4849
4981
|
}, _errorFactory)) || _assertGuard_16._assertGuard(_exceptionable, {
|
|
@@ -4851,6 +4983,21 @@ var assertAdPlacements = /* @__PURE__ */ (() => {
|
|
|
4851
4983
|
path: _path + ".placements",
|
|
4852
4984
|
expected: "ReadonlyArray<AdPlacementEntry>",
|
|
4853
4985
|
value: input.placements
|
|
4986
|
+
}, _errorFactory)) && (void 0 === input.sharedPlatformPlacementTargets || (Array.isArray(input.sharedPlatformPlacementTargets) || _assertGuard_16._assertGuard(_exceptionable, {
|
|
4987
|
+
method: "typia.createAssert",
|
|
4988
|
+
path: _path + ".sharedPlatformPlacementTargets",
|
|
4989
|
+
expected: "(ReadonlyArray<string> | undefined)",
|
|
4990
|
+
value: input.sharedPlatformPlacementTargets
|
|
4991
|
+
}, _errorFactory)) && input.sharedPlatformPlacementTargets.every((elem, _index4) => "string" === typeof elem || _assertGuard_16._assertGuard(_exceptionable, {
|
|
4992
|
+
method: "typia.createAssert",
|
|
4993
|
+
path: _path + ".sharedPlatformPlacementTargets[" + _index4 + "]",
|
|
4994
|
+
expected: "string",
|
|
4995
|
+
value: elem
|
|
4996
|
+
}, _errorFactory)) || _assertGuard_16._assertGuard(_exceptionable, {
|
|
4997
|
+
method: "typia.createAssert",
|
|
4998
|
+
path: _path + ".sharedPlatformPlacementTargets",
|
|
4999
|
+
expected: "(ReadonlyArray<string> | undefined)",
|
|
5000
|
+
value: input.sharedPlatformPlacementTargets
|
|
4854
5001
|
}, _errorFactory));
|
|
4855
5002
|
const _ao1 = (input, _path, _exceptionable = true) => _ao2(input, _path, _exceptionable) && (("rewarded" === input.type || _assertGuard_16._assertGuard(_exceptionable, {
|
|
4856
5003
|
method: "typia.createAssert",
|
|
@@ -4980,7 +5127,7 @@ var assertAdPlacements = /* @__PURE__ */ (() => {
|
|
|
4980
5127
|
value: input
|
|
4981
5128
|
}, _errorFactory);
|
|
4982
5129
|
})();
|
|
4983
|
-
const _io0 = (input) => "string" === typeof input.version && (Array.isArray(input.placements) && input.placements.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem)));
|
|
5130
|
+
const _io0 = (input) => "string" === typeof input.version && (Array.isArray(input.placements) && input.placements.every((elem) => "object" === typeof elem && null !== elem && _iu0(elem))) && (void 0 === input.sharedPlatformPlacementTargets || Array.isArray(input.sharedPlatformPlacementTargets) && input.sharedPlatformPlacementTargets.every((elem) => "string" === typeof elem));
|
|
4984
5131
|
const _io1 = (input) => _io2(input) && ("rewarded" === input.type && (void 0 === input.reward || "object" === typeof input.reward && null !== input.reward && _iu1(input.reward)));
|
|
4985
5132
|
const _io2 = (input) => "string" === typeof input.id && ("object" === typeof input.frequencyCap && null !== input.frequencyCap && _io3(input.frequencyCap)) && ("object" === typeof input.platformPlacementIds && null !== input.platformPlacementIds && false === Array.isArray(input.platformPlacementIds) && _io4(input.platformPlacementIds));
|
|
4986
5133
|
const _io3 = (input) => "number" === typeof input.cooldownSeconds && (void 0 === input.maxPerSession || "number" === typeof input.maxPerSession) && (void 0 === input.minStageInterval || "number" === typeof input.minStageInterval);
|
|
@@ -5159,7 +5306,7 @@ function requirePortableArtifactPath(path10) {
|
|
|
5159
5306
|
}
|
|
5160
5307
|
function readFileBytes(path10) {
|
|
5161
5308
|
try {
|
|
5162
|
-
return
|
|
5309
|
+
return readFileSync13(path10);
|
|
5163
5310
|
} catch (error) {
|
|
5164
5311
|
throw new Error(`Failed to read icon manifest ${path10}: ${formatError5(error)}`);
|
|
5165
5312
|
}
|
|
@@ -5185,7 +5332,7 @@ function writeReleaseManifestWithProvenance(input, provenance) {
|
|
|
5185
5332
|
const manifest = makeEffectiveConfigPathsPortable(mergeManifest(outputPath, nextManifest), platformTargets2.baseDir);
|
|
5186
5333
|
const temporary = `${outputPath}.${randomUUID2()}.tmp`;
|
|
5187
5334
|
try {
|
|
5188
|
-
|
|
5335
|
+
writeFileSync7(temporary, `${JSON.stringify(manifest, null, 2)}
|
|
5189
5336
|
`, { flag: "wx" });
|
|
5190
5337
|
renameSync(temporary, outputPath);
|
|
5191
5338
|
} finally {
|
|
@@ -5195,7 +5342,7 @@ function writeReleaseManifestWithProvenance(input, provenance) {
|
|
|
5195
5342
|
});
|
|
5196
5343
|
}
|
|
5197
5344
|
function mergeManifest(outputPath, nextManifest) {
|
|
5198
|
-
if (!
|
|
5345
|
+
if (!existsSync9(outputPath)) {
|
|
5199
5346
|
return nextManifest;
|
|
5200
5347
|
}
|
|
5201
5348
|
let previous;
|
|
@@ -5412,7 +5559,7 @@ if (process.env.MPGD_NATIVE_PACKAGED_BUILD !== "1" && isCliEntrypoint(import.met
|
|
|
5412
5559
|
}
|
|
5413
5560
|
|
|
5414
5561
|
// node_modules/.cache/mpgd-native-build/tools/target/microsoft-store-pwa.js
|
|
5415
|
-
import { writeFileSync as
|
|
5562
|
+
import { writeFileSync as writeFileSync8 } from "node:fs";
|
|
5416
5563
|
import { resolve as resolve10 } from "node:path";
|
|
5417
5564
|
|
|
5418
5565
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/microsoft-store-pwa-e2e.js
|
|
@@ -5447,7 +5594,7 @@ function requireNonEmptyString(input, label) {
|
|
|
5447
5594
|
|
|
5448
5595
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/microsoft-store-pwa-release.js
|
|
5449
5596
|
import { createHash as createHash5 } from "node:crypto";
|
|
5450
|
-
import { closeSync as closeSync2, existsSync as
|
|
5597
|
+
import { closeSync as closeSync2, existsSync as existsSync10, openSync as openSync2, readdirSync as readdirSync4, readFileSync as readFileSync14, readSync, statSync as statSync2 } from "node:fs";
|
|
5451
5598
|
import { relative as relative6, resolve as resolve9, sep as sep3 } from "node:path";
|
|
5452
5599
|
function assertMicrosoftStorePwaProvenance(input) {
|
|
5453
5600
|
return {
|
|
@@ -5618,7 +5765,7 @@ function listPrecacheEntries(artifactRoot) {
|
|
|
5618
5765
|
if (directory === void 0) {
|
|
5619
5766
|
throw new Error("PWA artifact traversal lost its directory.");
|
|
5620
5767
|
}
|
|
5621
|
-
for (const entry of
|
|
5768
|
+
for (const entry of readdirSync4(directory, { withFileTypes: true })) {
|
|
5622
5769
|
const path10 = resolve9(directory, entry.name);
|
|
5623
5770
|
if (entry.isSymbolicLink()) {
|
|
5624
5771
|
throw new Error(`PWA artifact must not contain symbolic links: ${path10}`);
|
|
@@ -5632,7 +5779,7 @@ function listPrecacheEntries(artifactRoot) {
|
|
|
5632
5779
|
}
|
|
5633
5780
|
return files.filter((path10) => !path10.endsWith(".map") && !path10.endsWith(`${sep3}pwa-release.json`) && !path10.endsWith(`${sep3}service-worker.js`)).map((path10) => ({
|
|
5634
5781
|
url: toPrecacheUrl(artifactRoot, path10),
|
|
5635
|
-
source:
|
|
5782
|
+
source: readFileSync14(path10)
|
|
5636
5783
|
})).sort((left, right) => compareCodeUnits(left.url, right.url));
|
|
5637
5784
|
}
|
|
5638
5785
|
function normalizePrecacheEntries(entries) {
|
|
@@ -5716,9 +5863,9 @@ function writeMicrosoftStorePwaArtifacts(input) {
|
|
|
5716
5863
|
revision,
|
|
5717
5864
|
precacheUrls
|
|
5718
5865
|
});
|
|
5719
|
-
|
|
5866
|
+
writeFileSync8(`${artifactRoot}/pwa-release.json`, `${JSON.stringify(evidence, null, 2)}
|
|
5720
5867
|
`);
|
|
5721
|
-
|
|
5868
|
+
writeFileSync8(`${artifactRoot}/service-worker.js`, createMicrosoftStorePwaServiceWorker(evidence));
|
|
5722
5869
|
return evidence;
|
|
5723
5870
|
}
|
|
5724
5871
|
function compareCodeUnits2(left, right) {
|
|
@@ -5733,8 +5880,8 @@ function readPwaId(input) {
|
|
|
5733
5880
|
|
|
5734
5881
|
// node_modules/.cache/mpgd-native-build/tools/target/minigame-artifact.js
|
|
5735
5882
|
import { createHash as createHash6 } from "node:crypto";
|
|
5736
|
-
import { copyFileSync as copyFileSync2, cpSync as cpSync2, existsSync as
|
|
5737
|
-
import { basename as basename3, dirname as dirname6, extname, isAbsolute as isAbsolute6, join as
|
|
5883
|
+
import { copyFileSync as copyFileSync2, cpSync as cpSync2, existsSync as existsSync11, constants as fsConstants, lstatSync as lstatSync7, mkdirSync as mkdirSync6, mkdtempSync, readdirSync as readdirSync5, readFileSync as readFileSync15, realpathSync as realpathSync6, renameSync as renameSync2, rmSync as rmSync5, writeFileSync as writeFileSync9 } from "node:fs";
|
|
5884
|
+
import { basename as basename3, dirname as dirname6, extname, isAbsolute as isAbsolute6, join as join7, relative as relative7, resolve as resolve11, sep as sep4 } from "node:path";
|
|
5738
5885
|
import { parse } from "acorn";
|
|
5739
5886
|
var miniGameArtifactEvidenceFileName = "mpgd-minigame-artifact.json";
|
|
5740
5887
|
var miniGameEffectiveTargetConfigFileName = "mpgd-effective-target-config.json";
|
|
@@ -5798,14 +5945,14 @@ function assembleMiniGameArtifact(input) {
|
|
|
5798
5945
|
assertMiniGameArtifactOutputDirectory(artifactRoot, input.projectRoot);
|
|
5799
5946
|
const artifactParent = dirname6(artifactRoot);
|
|
5800
5947
|
mkdirSync6(artifactParent, { recursive: true });
|
|
5801
|
-
const stagingRoot = mkdtempSync(
|
|
5948
|
+
const stagingRoot = mkdtempSync(join7(artifactParent, `.${basename3(artifactRoot)}-staging-`));
|
|
5802
5949
|
let projectFilesRoot;
|
|
5803
5950
|
const stagingInput = { ...input, artifactRoot: stagingRoot };
|
|
5804
5951
|
try {
|
|
5805
|
-
projectFilesRoot = mkdtempSync(
|
|
5952
|
+
projectFilesRoot = mkdtempSync(join7(artifactParent, `.${basename3(artifactRoot)}-project-files-`));
|
|
5806
5953
|
copyMiniGameBundleOutput(input.runtimeBundleRoot, stagingRoot);
|
|
5807
5954
|
copyMiniGameBundleOutput(input.gameBundleRoot, stagingRoot);
|
|
5808
|
-
copyMiniGameArtifactFile(input.effectiveTargetConfigSource,
|
|
5955
|
+
copyMiniGameArtifactFile(input.effectiveTargetConfigSource, join7(stagingRoot, miniGameEffectiveTargetConfigFileName), miniGameEffectiveTargetConfigFileName);
|
|
5809
5956
|
stageMiniGameIconEvidence(input.generatedIcons, stagingRoot);
|
|
5810
5957
|
input.writeProjectFiles(projectFilesRoot);
|
|
5811
5958
|
copyMiniGameBundleOutput(projectFilesRoot, stagingRoot);
|
|
@@ -5838,8 +5985,8 @@ function assertMiniGameArtifactOutputDirectory(artifactRoot, projectRoot) {
|
|
|
5838
5985
|
assertMiniGameArtifactRelativePath(portableProjectRelativePath, "Mini-game artifact output");
|
|
5839
5986
|
let candidate = artifact;
|
|
5840
5987
|
while (candidate !== project) {
|
|
5841
|
-
if (
|
|
5842
|
-
const status =
|
|
5988
|
+
if (existsSync11(candidate)) {
|
|
5989
|
+
const status = lstatSync7(candidate);
|
|
5843
5990
|
if (status.isSymbolicLink()) {
|
|
5844
5991
|
throw new Error("Mini-game artifact output must not traverse a symbolic link: " + candidate);
|
|
5845
5992
|
}
|
|
@@ -5896,16 +6043,16 @@ function assertDisjointMiniGameTargetOutputs(targets, resolvePath, protectedOutp
|
|
|
5896
6043
|
}
|
|
5897
6044
|
function writeMiniGameArtifactEvidence(input) {
|
|
5898
6045
|
const artifactRoot = resolve11(input.artifactRoot);
|
|
5899
|
-
const evidencePath =
|
|
6046
|
+
const evidencePath = join7(artifactRoot, miniGameArtifactEvidenceFileName);
|
|
5900
6047
|
rmSync5(evidencePath, { force: true });
|
|
5901
6048
|
const files = listMiniGameArtifactFiles(artifactRoot).map((file) => ({
|
|
5902
6049
|
path: file.path,
|
|
5903
6050
|
size: file.bytes,
|
|
5904
|
-
sha256: sha2563(
|
|
6051
|
+
sha256: sha2563(readFileSync15(join7(artifactRoot, file.path)))
|
|
5905
6052
|
}));
|
|
5906
6053
|
const effectiveTargetConfig = requireEvidenceFile(artifactRoot, files, miniGameEffectiveTargetConfigFileName);
|
|
5907
6054
|
const iconManifest = requireEvidenceFile(artifactRoot, files, miniGameIconManifestFileName);
|
|
5908
|
-
const gameConfig = readJson(
|
|
6055
|
+
const gameConfig = readJson(join7(artifactRoot, "game.json"), "Mini-game game.json");
|
|
5909
6056
|
let packageSize = assertMiniGamePackageBudget({
|
|
5910
6057
|
artifactRoot,
|
|
5911
6058
|
gameConfig,
|
|
@@ -5915,7 +6062,7 @@ function writeMiniGameArtifactEvidence(input) {
|
|
|
5915
6062
|
for (let attempt = 0; attempt < 10; attempt += 1) {
|
|
5916
6063
|
const serialized = `${JSON.stringify(evidence, null, 2)}
|
|
5917
6064
|
`;
|
|
5918
|
-
|
|
6065
|
+
writeFileSync9(evidencePath, serialized);
|
|
5919
6066
|
packageSize = assertMiniGamePackageBudget({
|
|
5920
6067
|
artifactRoot,
|
|
5921
6068
|
gameConfig,
|
|
@@ -5933,7 +6080,7 @@ function writeMiniGameArtifactEvidence(input) {
|
|
|
5933
6080
|
}
|
|
5934
6081
|
function verifyMiniGameArtifactEvidence(input) {
|
|
5935
6082
|
const artifactRoot = resolve11(input.artifactRoot);
|
|
5936
|
-
const evidencePath =
|
|
6083
|
+
const evidencePath = join7(artifactRoot, miniGameArtifactEvidenceFileName);
|
|
5937
6084
|
const parsed = readJson(evidencePath, "Mini-game artifact evidence");
|
|
5938
6085
|
const evidence = assertMiniGameArtifactEvidenceShape(parsed);
|
|
5939
6086
|
for (const [field, expected] of [
|
|
@@ -5964,7 +6111,7 @@ function verifyMiniGameArtifactEvidence(input) {
|
|
|
5964
6111
|
if (actual === void 0 || actual.bytes !== file.size) {
|
|
5965
6112
|
throw new Error(`Mini-game artifact evidence size mismatch: ${file.path}`);
|
|
5966
6113
|
}
|
|
5967
|
-
if (sha2563(
|
|
6114
|
+
if (sha2563(readFileSync15(join7(artifactRoot, file.path))) !== file.sha256) {
|
|
5968
6115
|
throw new Error(`Mini-game artifact evidence digest mismatch: ${file.path}`);
|
|
5969
6116
|
}
|
|
5970
6117
|
}
|
|
@@ -5972,7 +6119,7 @@ function verifyMiniGameArtifactEvidence(input) {
|
|
|
5972
6119
|
verifyNamedDigest(artifactRoot, evidence.iconManifest, miniGameIconManifestFileName, "icon manifest");
|
|
5973
6120
|
const packageSize = assertMiniGamePackageBudget({
|
|
5974
6121
|
artifactRoot,
|
|
5975
|
-
gameConfig: readJson(
|
|
6122
|
+
gameConfig: readJson(join7(artifactRoot, "game.json"), "Mini-game game.json"),
|
|
5976
6123
|
budget: input.budget
|
|
5977
6124
|
});
|
|
5978
6125
|
if (JSON.stringify(packageSize) !== JSON.stringify(evidence.packageSize)) {
|
|
@@ -5985,14 +6132,14 @@ function stageMiniGameIconEvidence(generated, artifactRoot) {
|
|
|
5985
6132
|
const files = [
|
|
5986
6133
|
{
|
|
5987
6134
|
source: generated.manifestPath,
|
|
5988
|
-
destination:
|
|
6135
|
+
destination: join7(artifactRoot, miniGameIconManifestFileName),
|
|
5989
6136
|
relativePath: miniGameIconManifestFileName
|
|
5990
6137
|
},
|
|
5991
6138
|
...generated.manifest.outputs.map((output) => {
|
|
5992
6139
|
assertMiniGameArtifactRelativePath(output.path, "Mini-game icon output");
|
|
5993
6140
|
return {
|
|
5994
|
-
source:
|
|
5995
|
-
destination:
|
|
6141
|
+
source: join7(generated.outputDir, basename3(output.path)),
|
|
6142
|
+
destination: join7(artifactRoot, output.path),
|
|
5996
6143
|
relativePath: output.path
|
|
5997
6144
|
};
|
|
5998
6145
|
})
|
|
@@ -6004,7 +6151,7 @@ function stageMiniGameIconEvidence(generated, artifactRoot) {
|
|
|
6004
6151
|
throw new Error(`Mini-game icon outputs collide at ${file.relativePath}.`);
|
|
6005
6152
|
}
|
|
6006
6153
|
plannedPaths.add(comparisonKey);
|
|
6007
|
-
if (
|
|
6154
|
+
if (existsSync11(file.destination)) {
|
|
6008
6155
|
throw new Error(`Mini-game artifact files collide at ${file.relativePath}.`);
|
|
6009
6156
|
}
|
|
6010
6157
|
}
|
|
@@ -6013,7 +6160,7 @@ function stageMiniGameIconEvidence(generated, artifactRoot) {
|
|
|
6013
6160
|
}
|
|
6014
6161
|
}
|
|
6015
6162
|
function copyMiniGameArtifactFile(source, destination, relativePath) {
|
|
6016
|
-
if (
|
|
6163
|
+
if (existsSync11(destination)) {
|
|
6017
6164
|
throw new Error(`Mini-game artifact files collide at ${relativePath}.`);
|
|
6018
6165
|
}
|
|
6019
6166
|
mkdirSync6(dirname6(destination), { recursive: true });
|
|
@@ -6023,7 +6170,7 @@ function configuredNonMiniGameOutputs(targets, resolvePath) {
|
|
|
6023
6170
|
return Object.entries(targets).flatMap(([name, target2]) => {
|
|
6024
6171
|
const viteOutput = {
|
|
6025
6172
|
name: `${name} Vite output`,
|
|
6026
|
-
path: resolvePath(
|
|
6173
|
+
path: resolvePath(join7(target2.gameApp, "dist"))
|
|
6027
6174
|
};
|
|
6028
6175
|
switch (target2.kind) {
|
|
6029
6176
|
case "web":
|
|
@@ -6045,7 +6192,7 @@ function configuredNonMiniGameOutputs(targets, resolvePath) {
|
|
|
6045
6192
|
{ name: `${name} web staging output`, path: resolvePath(target2.webDir) },
|
|
6046
6193
|
{
|
|
6047
6194
|
name: `${name} wrapper build output`,
|
|
6048
|
-
path: resolvePath(
|
|
6195
|
+
path: resolvePath(join7(target2.wrapperApp, "dist"))
|
|
6049
6196
|
}
|
|
6050
6197
|
];
|
|
6051
6198
|
case "wechat-minigame":
|
|
@@ -6071,7 +6218,7 @@ function canonicalizeThroughExistingAncestor2(path10) {
|
|
|
6071
6218
|
const normalizedPath = resolve11(path10);
|
|
6072
6219
|
const suffix = [];
|
|
6073
6220
|
let existingAncestor = normalizedPath;
|
|
6074
|
-
while (!
|
|
6221
|
+
while (!existsSync11(existingAncestor)) {
|
|
6075
6222
|
const parent = dirname6(existingAncestor);
|
|
6076
6223
|
if (parent === existingAncestor) {
|
|
6077
6224
|
throw new Error(`Cannot resolve an existing ancestor for mini-game output: ${path10}`);
|
|
@@ -6083,15 +6230,15 @@ function canonicalizeThroughExistingAncestor2(path10) {
|
|
|
6083
6230
|
}
|
|
6084
6231
|
function copyMiniGameBundleOutput(sourceRoot, artifactRoot) {
|
|
6085
6232
|
const source = resolve11(sourceRoot);
|
|
6086
|
-
if (!
|
|
6233
|
+
if (!existsSync11(source)) {
|
|
6087
6234
|
throw new Error(`Mini-game bundle output does not exist: ${source}`);
|
|
6088
6235
|
}
|
|
6089
|
-
for (const entry of
|
|
6090
|
-
const destination =
|
|
6091
|
-
if (
|
|
6236
|
+
for (const entry of readdirSync5(source)) {
|
|
6237
|
+
const destination = join7(artifactRoot, entry);
|
|
6238
|
+
if (existsSync11(destination)) {
|
|
6092
6239
|
throw new Error(`Mini-game bundle outputs collide at ${entry}.`);
|
|
6093
6240
|
}
|
|
6094
|
-
cpSync2(
|
|
6241
|
+
cpSync2(join7(source, entry), destination, {
|
|
6095
6242
|
recursive: true,
|
|
6096
6243
|
errorOnExist: true,
|
|
6097
6244
|
force: false
|
|
@@ -6100,8 +6247,8 @@ function copyMiniGameBundleOutput(sourceRoot, artifactRoot) {
|
|
|
6100
6247
|
}
|
|
6101
6248
|
function replaceMiniGameArtifact(stagingRoot, artifactRoot) {
|
|
6102
6249
|
let backupRoot;
|
|
6103
|
-
if (
|
|
6104
|
-
backupRoot = mkdtempSync(
|
|
6250
|
+
if (existsSync11(artifactRoot)) {
|
|
6251
|
+
backupRoot = mkdtempSync(join7(dirname6(artifactRoot), `.${basename3(artifactRoot)}-backup-`));
|
|
6105
6252
|
rmSync5(backupRoot, { force: true, recursive: true });
|
|
6106
6253
|
renameSync2(artifactRoot, backupRoot);
|
|
6107
6254
|
}
|
|
@@ -6141,11 +6288,11 @@ function assertMiniGameRequiredFiles(artifactRoot) {
|
|
|
6141
6288
|
miniGameEffectiveTargetConfigFileName,
|
|
6142
6289
|
miniGameIconManifestFileName
|
|
6143
6290
|
]) {
|
|
6144
|
-
if (!
|
|
6291
|
+
if (!existsSync11(join7(artifactRoot, file))) {
|
|
6145
6292
|
throw new Error(`Mini-game artifact is missing required file: ${file}`);
|
|
6146
6293
|
}
|
|
6147
6294
|
}
|
|
6148
|
-
const entry =
|
|
6295
|
+
const entry = readFileSync15(join7(artifactRoot, "game.js"), "utf8");
|
|
6149
6296
|
if (entry !== "require('./runtime.js');\nrequire('./game.bundle.js');\n") {
|
|
6150
6297
|
throw new Error("Mini-game game.js must load runtime.js before game.bundle.js.");
|
|
6151
6298
|
}
|
|
@@ -6155,7 +6302,7 @@ function assertMiniGameJavaScriptSafety(artifactRoot, forbiddenMarkers, forbidde
|
|
|
6155
6302
|
const gameOwnedGlobals = new Set(forbiddenGameBundleGlobals);
|
|
6156
6303
|
const noForbiddenGlobals = /* @__PURE__ */ new Set();
|
|
6157
6304
|
for (const file of javascript) {
|
|
6158
|
-
const source =
|
|
6305
|
+
const source = readFileSync15(join7(artifactRoot, file.path), "utf8");
|
|
6159
6306
|
assertMiniGameJavaScriptAstSafety(source, file.path, file.path === "runtime.js" ? noForbiddenGlobals : gameOwnedGlobals);
|
|
6160
6307
|
for (const { pattern, label } of forbiddenJavaScriptPatterns) {
|
|
6161
6308
|
if (pattern.test(source)) {
|
|
@@ -8164,7 +8311,7 @@ function createEvidence(input, files, effectiveTargetConfig, iconManifest, packa
|
|
|
8164
8311
|
}
|
|
8165
8312
|
function requireEvidenceFile(artifactRoot, files, path10) {
|
|
8166
8313
|
const file = files.find((candidate) => candidate.path === path10);
|
|
8167
|
-
if (file === void 0 || !
|
|
8314
|
+
if (file === void 0 || !existsSync11(join7(artifactRoot, path10))) {
|
|
8168
8315
|
throw new Error(`Mini-game artifact is missing required evidence file: ${path10}`);
|
|
8169
8316
|
}
|
|
8170
8317
|
return file;
|
|
@@ -8234,14 +8381,14 @@ function verifyNamedDigest(artifactRoot, reference, expectedPath, label) {
|
|
|
8234
8381
|
if (reference.path !== expectedPath) {
|
|
8235
8382
|
throw new Error(`Mini-game artifact ${label} path mismatch.`);
|
|
8236
8383
|
}
|
|
8237
|
-
const digest = sha2563(
|
|
8384
|
+
const digest = sha2563(readFileSync15(join7(artifactRoot, reference.path)));
|
|
8238
8385
|
if (digest !== reference.sha256) {
|
|
8239
8386
|
throw new Error(`Mini-game artifact ${label} digest mismatch.`);
|
|
8240
8387
|
}
|
|
8241
8388
|
}
|
|
8242
8389
|
function readJson(path10, label) {
|
|
8243
8390
|
try {
|
|
8244
|
-
return JSON.parse(
|
|
8391
|
+
return JSON.parse(readFileSync15(path10, "utf8"));
|
|
8245
8392
|
} catch (error) {
|
|
8246
8393
|
throw new Error(`${label} is unreadable: ${formatError6(error)}`);
|
|
8247
8394
|
}
|
|
@@ -8274,17 +8421,17 @@ function formatError6(error) {
|
|
|
8274
8421
|
}
|
|
8275
8422
|
|
|
8276
8423
|
// node_modules/.cache/mpgd-native-build/tools/target/minigame-project-files.js
|
|
8277
|
-
import { mkdirSync as mkdirSync7, writeFileSync as
|
|
8278
|
-
import { join as
|
|
8424
|
+
import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync10 } from "node:fs";
|
|
8425
|
+
import { join as join8 } from "node:path";
|
|
8279
8426
|
var wechatStagingAppId2 = "wx0000000000000000";
|
|
8280
8427
|
function writeWechatMiniGameProjectFiles(input) {
|
|
8281
8428
|
assertWechatAppId(input.appId, input.production);
|
|
8282
8429
|
mkdirSync7(input.artifactRoot, { recursive: true });
|
|
8283
|
-
|
|
8284
|
-
writeJson(
|
|
8430
|
+
writeFileSync10(join8(input.artifactRoot, "game.js"), "require('./runtime.js');\nrequire('./game.bundle.js');\n");
|
|
8431
|
+
writeJson(join8(input.artifactRoot, "game.json"), {
|
|
8285
8432
|
deviceOrientation: input.orientation
|
|
8286
8433
|
});
|
|
8287
|
-
writeJson(
|
|
8434
|
+
writeJson(join8(input.artifactRoot, "project.config.json"), {
|
|
8288
8435
|
description: "Experimental mpgd Phaser Canvas Mini Game validation build.",
|
|
8289
8436
|
setting: {
|
|
8290
8437
|
urlCheck: input.production,
|
|
@@ -8309,12 +8456,12 @@ function assertWechatAppId(appId, production) {
|
|
|
8309
8456
|
}
|
|
8310
8457
|
}
|
|
8311
8458
|
function writeJson(path10, input) {
|
|
8312
|
-
|
|
8459
|
+
writeFileSync10(path10, `${JSON.stringify(input, null, 2)}
|
|
8313
8460
|
`);
|
|
8314
8461
|
}
|
|
8315
8462
|
|
|
8316
8463
|
// node_modules/.cache/mpgd-native-build/tools/target/monetization-catalog-env.js
|
|
8317
|
-
import { existsSync as
|
|
8464
|
+
import { existsSync as existsSync12 } from "node:fs";
|
|
8318
8465
|
import { isAbsolute as isAbsolute7, resolve as resolve12 } from "node:path";
|
|
8319
8466
|
function normalizeMonetizationCatalogEnv(baseEnv, fallbackBaseDir = process.cwd()) {
|
|
8320
8467
|
const configuredFiles = configuredMonetizationCatalogFilePaths(baseEnv);
|
|
@@ -8343,12 +8490,12 @@ function resolveConfiguredBaseDir(baseEnv, fallbackBaseDir, productCatalogFile,
|
|
|
8343
8490
|
return fallbackBaseDir;
|
|
8344
8491
|
}
|
|
8345
8492
|
function configuredFileExists(baseDir, file) {
|
|
8346
|
-
return
|
|
8493
|
+
return existsSync12(isAbsolute7(file) ? file : resolve12(baseDir, file));
|
|
8347
8494
|
}
|
|
8348
8495
|
|
|
8349
8496
|
// node_modules/.cache/mpgd-native-build/tools/target/native-build-attempt.js
|
|
8350
8497
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
8351
|
-
import { existsSync as
|
|
8498
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync8, readFileSync as readFileSync16, renameSync as renameSync3, rmSync as rmSync6, writeFileSync as writeFileSync11 } from "node:fs";
|
|
8352
8499
|
import path3 from "node:path";
|
|
8353
8500
|
function nativeBuildAttemptPath(gameRoot, target2) {
|
|
8354
8501
|
assertDeploymentTargetName(target2);
|
|
@@ -8356,10 +8503,10 @@ function nativeBuildAttemptPath(gameRoot, target2) {
|
|
|
8356
8503
|
}
|
|
8357
8504
|
function readNativeBuildAttempt(gameRoot, target2) {
|
|
8358
8505
|
const file = nativeBuildAttemptPath(gameRoot, target2);
|
|
8359
|
-
if (!
|
|
8506
|
+
if (!existsSync13(file)) {
|
|
8360
8507
|
return void 0;
|
|
8361
8508
|
}
|
|
8362
|
-
const parsed = JSON.parse(
|
|
8509
|
+
const parsed = JSON.parse(readFileSync16(file, "utf8"));
|
|
8363
8510
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
8364
8511
|
throw new Error("Native build status must be an object.");
|
|
8365
8512
|
}
|
|
@@ -8408,7 +8555,7 @@ function writeRecord(file, record) {
|
|
|
8408
8555
|
mkdirSync8(path3.dirname(file), { recursive: true });
|
|
8409
8556
|
const temporary = `${file}.${randomUUID3()}.tmp`;
|
|
8410
8557
|
try {
|
|
8411
|
-
|
|
8558
|
+
writeFileSync11(temporary, `${JSON.stringify(record, null, 2)}
|
|
8412
8559
|
`, { flag: "wx" });
|
|
8413
8560
|
renameSync3(temporary, file);
|
|
8414
8561
|
} finally {
|
|
@@ -8425,13 +8572,13 @@ function isProcessAlive(pid) {
|
|
|
8425
8572
|
}
|
|
8426
8573
|
|
|
8427
8574
|
// node_modules/.cache/mpgd-native-build/tools/target/native-build-execution.js
|
|
8428
|
-
import { existsSync as
|
|
8575
|
+
import { existsSync as existsSync22, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, readdirSync as readdirSync7, rmSync as rmSync10, statSync as statSync6 } from "node:fs";
|
|
8429
8576
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
8430
|
-
import { dirname as dirname8, isAbsolute as isAbsolute9, join as
|
|
8577
|
+
import { dirname as dirname8, isAbsolute as isAbsolute9, join as join10 } from "node:path";
|
|
8431
8578
|
|
|
8432
8579
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/ios-signing-session.js
|
|
8433
8580
|
import { createHash as createHash8, randomBytes } from "node:crypto";
|
|
8434
|
-
import { chmodSync, constants, copyFileSync as copyFileSync3, existsSync as
|
|
8581
|
+
import { chmodSync, constants, copyFileSync as copyFileSync3, existsSync as existsSync14, lstatSync as lstatSync8, mkdirSync as mkdirSync9, mkdtempSync as mkdtempSync2, readFileSync as readFileSync17, rmSync as rmSync7, writeFileSync as writeFileSync12 } from "node:fs";
|
|
8435
8582
|
import { tmpdir } from "node:os";
|
|
8436
8583
|
import path4 from "node:path";
|
|
8437
8584
|
import { fileURLToPath } from "node:url";
|
|
@@ -8779,7 +8926,7 @@ async function prepareIosSigningSession(input) {
|
|
|
8779
8926
|
mode: 448
|
|
8780
8927
|
});
|
|
8781
8928
|
const helper = path4.join(path4.dirname(fileURLToPath(import.meta.url)), "ios-keychain-import.swift");
|
|
8782
|
-
if (!
|
|
8929
|
+
if (!existsSync14(helper)) {
|
|
8783
8930
|
throw new Error("The installed CLI is missing its iOS signing helper.");
|
|
8784
8931
|
}
|
|
8785
8932
|
const imported = await runReleaseProcess({
|
|
@@ -8851,15 +8998,15 @@ async function prepareIosSigningSession(input) {
|
|
|
8851
8998
|
timeoutMs: 3e4,
|
|
8852
8999
|
signal: input.signal
|
|
8853
9000
|
});
|
|
8854
|
-
const profile2 = inspectIosDistributionProfile(parseIosProfilePlist(
|
|
9001
|
+
const profile2 = inspectIosDistributionProfile(parseIosProfilePlist(readFileSync17(decodedXml, "utf8")), { bundleId: input.bundleId, teamId: input.teamId, certificateSha256 });
|
|
8855
9002
|
const profileDirectory = path4.join(ownedRoot, "Library", "Developer", "Xcode", "UserData", "Provisioning Profiles");
|
|
8856
9003
|
mkdirSync9(profileDirectory, { recursive: true, mode: 448 });
|
|
8857
9004
|
const destination = path4.join(profileDirectory, `${profile2.uuid}.mobileprovision`);
|
|
8858
9005
|
if (isSymlink(destination)) {
|
|
8859
9006
|
throw new Error("The iOS provisioning profile destination must not be a symlink.");
|
|
8860
9007
|
}
|
|
8861
|
-
if (
|
|
8862
|
-
if (!
|
|
9008
|
+
if (existsSync14(destination)) {
|
|
9009
|
+
if (!readFileSync17(destination).equals(readFileSync17(profileFile))) {
|
|
8863
9010
|
throw new Error("An existing iOS provisioning profile has the same UUID but different bytes.");
|
|
8864
9011
|
}
|
|
8865
9012
|
} else {
|
|
@@ -8868,7 +9015,7 @@ async function prepareIosSigningSession(input) {
|
|
|
8868
9015
|
installedProfile = { path: destination, sha256: profileSha256 };
|
|
8869
9016
|
chmodSync(destination, 384);
|
|
8870
9017
|
}
|
|
8871
|
-
|
|
9018
|
+
writeFileSync12(exportOptionsPlist, exportPlist(input.teamId, input.bundleId, profile2.uuid, certificateSha1), { mode: 384, flag: "wx" });
|
|
8872
9019
|
environment.MPGD_IOS_PROVISIONING_PROFILE_SPECIFIER = profile2.uuid;
|
|
8873
9020
|
environment.MPGD_IOS_SIGNING_IDENTITY = certificateSha1;
|
|
8874
9021
|
environment.MPGD_IOS_SIGNING_KEYCHAIN = keychainFile;
|
|
@@ -8921,7 +9068,7 @@ function removeOwnedSigningMaterial(root, profile2) {
|
|
|
8921
9068
|
const errors = [];
|
|
8922
9069
|
if (profile2 !== void 0) {
|
|
8923
9070
|
try {
|
|
8924
|
-
if (
|
|
9071
|
+
if (existsSync14(profile2.path) || isSymlink(profile2.path)) {
|
|
8925
9072
|
if (isSymlink(profile2.path) || fileDigest(profile2.path) !== profile2.sha256) {
|
|
8926
9073
|
throw new Error("Owned iOS provisioning profile changed before cleanup.");
|
|
8927
9074
|
}
|
|
@@ -8944,13 +9091,13 @@ function removeOwnedSigningMaterial(root, profile2) {
|
|
|
8944
9091
|
}
|
|
8945
9092
|
}
|
|
8946
9093
|
function fileDigest(file) {
|
|
8947
|
-
return createHash8("sha256").update(
|
|
9094
|
+
return createHash8("sha256").update(readFileSync17(file)).digest("hex");
|
|
8948
9095
|
}
|
|
8949
9096
|
function requiredCredentialFile(file, label) {
|
|
8950
9097
|
const absolute = path4.resolve(file);
|
|
8951
9098
|
let stat;
|
|
8952
9099
|
try {
|
|
8953
|
-
stat =
|
|
9100
|
+
stat = lstatSync8(absolute);
|
|
8954
9101
|
} catch {
|
|
8955
9102
|
throw new Error(`${label} is missing or unreadable.`);
|
|
8956
9103
|
}
|
|
@@ -8961,7 +9108,7 @@ function requiredCredentialFile(file, label) {
|
|
|
8961
9108
|
}
|
|
8962
9109
|
function isSymlink(file) {
|
|
8963
9110
|
try {
|
|
8964
|
-
return
|
|
9111
|
+
return lstatSync8(file).isSymbolicLink();
|
|
8965
9112
|
} catch {
|
|
8966
9113
|
return false;
|
|
8967
9114
|
}
|
|
@@ -8980,7 +9127,7 @@ function exportPlist(teamId, bundleId, profileUuid, certificateSha1) {
|
|
|
8980
9127
|
|
|
8981
9128
|
// node_modules/.cache/mpgd-native-build/tools/target/native-android-inspection.js
|
|
8982
9129
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
8983
|
-
import { existsSync as
|
|
9130
|
+
import { existsSync as existsSync15, statSync as statSync3 } from "node:fs";
|
|
8984
9131
|
|
|
8985
9132
|
// node_modules/.cache/mpgd-native-build/tools/target/native-inspection-environment.js
|
|
8986
9133
|
var allowedInspectionEnvironmentNames = [
|
|
@@ -9016,10 +9163,10 @@ function nativeInspectionEnvironment(source = process.env) {
|
|
|
9016
9163
|
|
|
9017
9164
|
// node_modules/.cache/mpgd-native-build/tools/target/native-android-inspection.js
|
|
9018
9165
|
function inspectSignedAndroidBundle(input) {
|
|
9019
|
-
if (!
|
|
9166
|
+
if (!existsSync15(input.bundle) || !statSync3(input.bundle).isFile()) {
|
|
9020
9167
|
throw new Error("Signed Android app bundle is missing.");
|
|
9021
9168
|
}
|
|
9022
|
-
if (input.bundletoolJar !== void 0 && !
|
|
9169
|
+
if (input.bundletoolJar !== void 0 && !existsSync15(input.bundletoolJar)) {
|
|
9023
9170
|
throw new Error("Configured bundletool JAR is missing.");
|
|
9024
9171
|
}
|
|
9025
9172
|
const runner = input.runner ?? { run: runCommand };
|
|
@@ -9108,13 +9255,13 @@ function runCommand(command, args) {
|
|
|
9108
9255
|
|
|
9109
9256
|
// node_modules/.cache/mpgd-native-build/tools/target/native-build-stage.js
|
|
9110
9257
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
9111
|
-
import { cpSync as cpSync3, existsSync as
|
|
9258
|
+
import { cpSync as cpSync3, existsSync as existsSync16, lstatSync as lstatSync9, realpathSync as realpathSync7, rmSync as rmSync8 } from "node:fs";
|
|
9112
9259
|
import path5 from "node:path";
|
|
9113
9260
|
function createNativeShellStage(input) {
|
|
9114
9261
|
const sourceShell = realpathSync7(input.shellApp);
|
|
9115
9262
|
const declaredShell = path5.resolve(input.shellApp);
|
|
9116
9263
|
const declaredWeb = path5.resolve(input.webDir);
|
|
9117
|
-
if (!
|
|
9264
|
+
if (!lstatSync9(sourceShell).isDirectory()) {
|
|
9118
9265
|
throw new Error("Native shell must be a directory.");
|
|
9119
9266
|
}
|
|
9120
9267
|
const webRelative = path5.relative(declaredShell, declaredWeb);
|
|
@@ -9126,7 +9273,7 @@ function createNativeShellStage(input) {
|
|
|
9126
9273
|
for (const segment of webRelative.split(path5.sep)) {
|
|
9127
9274
|
checkedPath = path5.join(checkedPath, segment);
|
|
9128
9275
|
try {
|
|
9129
|
-
if (
|
|
9276
|
+
if (lstatSync9(checkedPath).isSymbolicLink()) {
|
|
9130
9277
|
throw new Error("Native web directory must not traverse a symbolic link.");
|
|
9131
9278
|
}
|
|
9132
9279
|
} catch (error) {
|
|
@@ -9135,11 +9282,11 @@ function createNativeShellStage(input) {
|
|
|
9135
9282
|
}
|
|
9136
9283
|
}
|
|
9137
9284
|
}
|
|
9138
|
-
if (
|
|
9285
|
+
if (existsSync16(sourceWeb) && !lstatSync9(sourceWeb).isDirectory()) {
|
|
9139
9286
|
throw new Error("Native web directory must be a directory when it exists.");
|
|
9140
9287
|
}
|
|
9141
9288
|
const stage = path5.join(path5.dirname(sourceShell), `.mpgd-native-stage-${randomUUID4()}`);
|
|
9142
|
-
if (
|
|
9289
|
+
if (existsSync16(stage)) {
|
|
9143
9290
|
throw new Error("Native staging path already exists.");
|
|
9144
9291
|
}
|
|
9145
9292
|
try {
|
|
@@ -9152,7 +9299,7 @@ function createNativeShellStage(input) {
|
|
|
9152
9299
|
if (segments.some((segment) => [".gradle", "DerivedData", "Pods", "build"].includes(segment))) {
|
|
9153
9300
|
return false;
|
|
9154
9301
|
}
|
|
9155
|
-
if (relative10 !== "" &&
|
|
9302
|
+
if (relative10 !== "" && lstatSync9(source).isSymbolicLink() && segments[0] !== "node_modules") {
|
|
9156
9303
|
throw new Error(`Native shell symlink is unsupported in mutable project inputs: ${relative10}.`);
|
|
9157
9304
|
}
|
|
9158
9305
|
return true;
|
|
@@ -9172,7 +9319,7 @@ function createNativeShellStage(input) {
|
|
|
9172
9319
|
}
|
|
9173
9320
|
|
|
9174
9321
|
// node_modules/.cache/mpgd-native-build/tools/target/native-shell-csp.js
|
|
9175
|
-
import { existsSync as
|
|
9322
|
+
import { existsSync as existsSync17, lstatSync as lstatSync10, readFileSync as readFileSync18, writeFileSync as writeFileSync13 } from "node:fs";
|
|
9176
9323
|
import path6 from "node:path";
|
|
9177
9324
|
var capacitorShellContentSecurityPolicy = [
|
|
9178
9325
|
"default-src 'self'",
|
|
@@ -9218,26 +9365,26 @@ ${capacitorShellCspMetaTag}${html.slice(insertAt)}`;
|
|
|
9218
9365
|
}
|
|
9219
9366
|
function applyCapacitorShellCsp(webDir) {
|
|
9220
9367
|
const indexFile = path6.join(webDir, "index.html");
|
|
9221
|
-
if (!
|
|
9368
|
+
if (!existsSync17(indexFile) || lstatSync10(indexFile).isSymbolicLink()) {
|
|
9222
9369
|
throw new Error("Capacitor shell web bundle must contain a regular index.html.");
|
|
9223
9370
|
}
|
|
9224
|
-
const html =
|
|
9371
|
+
const html = readFileSync18(indexFile, "utf8");
|
|
9225
9372
|
const hardened = injectCapacitorShellCsp(html);
|
|
9226
9373
|
if (hardened !== html) {
|
|
9227
|
-
|
|
9374
|
+
writeFileSync13(indexFile, hardened);
|
|
9228
9375
|
}
|
|
9229
9376
|
}
|
|
9230
9377
|
|
|
9231
9378
|
// node_modules/.cache/mpgd-native-build/tools/target/native-ios-inspection.js
|
|
9232
9379
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
9233
|
-
import { existsSync as
|
|
9380
|
+
import { existsSync as existsSync18, mkdtempSync as mkdtempSync3, readFileSync as readFileSync19, rmSync as rmSync9, statSync as statSync4 } from "node:fs";
|
|
9234
9381
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
9235
9382
|
import path7 from "node:path";
|
|
9236
9383
|
function inspectSignedIosArchive(archive, input) {
|
|
9237
9384
|
return inspectSignedIosApplication(path7.join(archive, "Products/Applications/App.app"), input);
|
|
9238
9385
|
}
|
|
9239
9386
|
function inspectSignedIosIpa(ipa, input) {
|
|
9240
|
-
if (!
|
|
9387
|
+
if (!existsSync18(ipa) || !statSync4(ipa).isFile()) {
|
|
9241
9388
|
throw new Error("iOS store IPA is missing.");
|
|
9242
9389
|
}
|
|
9243
9390
|
const runner = input.runner ?? { run: runCommand2 };
|
|
@@ -9267,10 +9414,10 @@ function inspectSignedIosIpa(ipa, input) {
|
|
|
9267
9414
|
}
|
|
9268
9415
|
function inspectSignedIosApplication(appPath, input) {
|
|
9269
9416
|
const plist = path7.join(appPath, "Info.plist");
|
|
9270
|
-
if (!
|
|
9417
|
+
if (!existsSync18(plist) || !statSync4(plist).isFile()) {
|
|
9271
9418
|
throw new Error("Signed iOS app manifest is missing.");
|
|
9272
9419
|
}
|
|
9273
|
-
if (!
|
|
9420
|
+
if (!existsSync18(path7.join(appPath, "Assets.car")) || existsSync18(path7.join(appPath, "Info-Smoke.plist"))) {
|
|
9274
9421
|
throw new Error("Signed iOS app contains smoke assets or omits release icons.");
|
|
9275
9422
|
}
|
|
9276
9423
|
const runner = input.runner ?? { run: runCommand2 };
|
|
@@ -9301,18 +9448,18 @@ ${signingInfo.stderr}`;
|
|
|
9301
9448
|
path7.join(appPath, "capacitor.config.json"),
|
|
9302
9449
|
path7.join(appPath, "public/capacitor.config.json")
|
|
9303
9450
|
];
|
|
9304
|
-
if (!configFiles.some((file) =>
|
|
9451
|
+
if (!configFiles.some((file) => existsSync18(file))) {
|
|
9305
9452
|
throw new Error("Signed iOS app Capacitor configuration is missing.");
|
|
9306
9453
|
}
|
|
9307
9454
|
for (const configFile of configFiles) {
|
|
9308
|
-
if (
|
|
9455
|
+
if (existsSync18(configFile)) {
|
|
9309
9456
|
assertNoDebugServer(configFile);
|
|
9310
9457
|
}
|
|
9311
9458
|
}
|
|
9312
9459
|
return { ...observed, teamId: input.expectedTeamId, signed: true };
|
|
9313
9460
|
}
|
|
9314
9461
|
function assertNoDebugServer(file) {
|
|
9315
|
-
const value = JSON.parse(
|
|
9462
|
+
const value = JSON.parse(readFileSync19(file, "utf8"));
|
|
9316
9463
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
9317
9464
|
throw new Error("Signed iOS app has malformed Capacitor configuration.");
|
|
9318
9465
|
}
|
|
@@ -9341,7 +9488,7 @@ function runCommand2(command, args) {
|
|
|
9341
9488
|
|
|
9342
9489
|
// node_modules/.cache/mpgd-native-build/tools/target/native-ios-signing.js
|
|
9343
9490
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
9344
|
-
import { existsSync as
|
|
9491
|
+
import { existsSync as existsSync19, statSync as statSync5 } from "node:fs";
|
|
9345
9492
|
import path8 from "node:path";
|
|
9346
9493
|
function resolveIosSigningPlan(environment, mode) {
|
|
9347
9494
|
const teamId = environment.MPGD_IOS_TEAM_ID?.trim();
|
|
@@ -9376,7 +9523,7 @@ function resolveIosSigningPlan(environment, mode) {
|
|
|
9376
9523
|
throw new Error("iOS store export requires MPGD_IOS_EXPORT_OPTIONS_PLIST.");
|
|
9377
9524
|
}
|
|
9378
9525
|
const exportOptionsPlist = path8.resolve(configuredExportFile);
|
|
9379
|
-
if (!
|
|
9526
|
+
if (!existsSync19(exportOptionsPlist) || !statSync5(exportOptionsPlist).isFile()) {
|
|
9380
9527
|
throw new Error("iOS export options plist must be an existing host file.");
|
|
9381
9528
|
}
|
|
9382
9529
|
const method = spawnSync4("/usr/libexec/PlistBuddy", ["-c", "Print :method", exportOptionsPlist], {
|
|
@@ -9390,11 +9537,11 @@ function resolveIosSigningPlan(environment, mode) {
|
|
|
9390
9537
|
}
|
|
9391
9538
|
|
|
9392
9539
|
// node_modules/.cache/mpgd-native-build/tools/target/native-release-identity.js
|
|
9393
|
-
import { existsSync as
|
|
9394
|
-
import { dirname as dirname7, isAbsolute as isAbsolute8, join as
|
|
9540
|
+
import { existsSync as existsSync21, readFileSync as readFileSync21 } from "node:fs";
|
|
9541
|
+
import { dirname as dirname7, isAbsolute as isAbsolute8, join as join9, relative as relative8, resolve as resolve13 } from "node:path";
|
|
9395
9542
|
|
|
9396
9543
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/capacitor-shell-starter.js
|
|
9397
|
-
import { chmodSync as chmodSync2, existsSync as
|
|
9544
|
+
import { chmodSync as chmodSync2, existsSync as existsSync20, lstatSync as lstatSync11, mkdirSync as mkdirSync10, readdirSync as readdirSync6, readFileSync as readFileSync20, realpathSync as realpathSync8, renameSync as renameSync4, unlinkSync as unlinkSync2, writeFileSync as writeFileSync14 } from "node:fs";
|
|
9398
9545
|
import path9 from "node:path";
|
|
9399
9546
|
import { DOMParser as DOMParser2 } from "@xmldom/xmldom";
|
|
9400
9547
|
|
|
@@ -9818,7 +9965,7 @@ function assertAndroidLauncherClasses(nativeDirectory, gradle) {
|
|
|
9818
9965
|
const manifestPackage = manifestRoot?.getAttribute("package");
|
|
9819
9966
|
const namespace = /\bnamespace\s*(?:=\s*)?["']([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)+)["']/u.exec(stripGradleComments(gradle))?.[1] ?? (manifestPackage === null || manifestPackage === "" ? void 0 : manifestPackage);
|
|
9820
9967
|
const releaseFile = path9.join(nativeDirectory, "app/src/release/AndroidManifest.xml");
|
|
9821
|
-
const release =
|
|
9968
|
+
const release = existsSync20(releaseFile) ? readAndroidApplication(releaseFile, false) : void 0;
|
|
9822
9969
|
if (release !== void 0) {
|
|
9823
9970
|
assertAndroidLauncherEnabled(release, "Release application");
|
|
9824
9971
|
}
|
|
@@ -9928,7 +10075,7 @@ function resolvesAndroidClass(nativeDirectory, qualified, sourceFiles, visited,
|
|
|
9928
10075
|
if (!isNativeFile(nativeDirectory, relative10)) {
|
|
9929
10076
|
continue;
|
|
9930
10077
|
}
|
|
9931
|
-
const source = stripSourceCommentsAndStrings(
|
|
10078
|
+
const source = stripSourceCommentsAndStrings(readFileSync20(path9.join(nativeDirectory, relative10), "utf8"));
|
|
9932
10079
|
const declaredPackage = /\bpackage\s+([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)+)\s*;?/u.exec(source)?.[1];
|
|
9933
10080
|
if (declaredPackage !== packageName) {
|
|
9934
10081
|
continue;
|
|
@@ -9985,10 +10132,10 @@ function listNativeFiles(nativeDirectory, relativeRoot, extension) {
|
|
|
9985
10132
|
while (pending.length > 0) {
|
|
9986
10133
|
const relative10 = pending.pop() ?? "";
|
|
9987
10134
|
const full = path9.join(nativeDirectory, relative10);
|
|
9988
|
-
if (!
|
|
10135
|
+
if (!existsSync20(full) || lstatSync11(full).isSymbolicLink()) {
|
|
9989
10136
|
continue;
|
|
9990
10137
|
}
|
|
9991
|
-
for (const entry of
|
|
10138
|
+
for (const entry of readdirSync6(full, { withFileTypes: true })) {
|
|
9992
10139
|
if (entry.isSymbolicLink()) {
|
|
9993
10140
|
continue;
|
|
9994
10141
|
}
|
|
@@ -10198,7 +10345,7 @@ function assertReferencedIosFiles(nativeDirectory, project, infoRelative) {
|
|
|
10198
10345
|
throw new Error(`Existing ios project is incomplete; referenced app file ${relative10} is missing.`);
|
|
10199
10346
|
}
|
|
10200
10347
|
}
|
|
10201
|
-
const info =
|
|
10348
|
+
const info = readFileSync20(path9.join(nativeDirectory, infoRelative), "utf8");
|
|
10202
10349
|
assertSceneDelegateFiles(nativeDirectory, info, "Release", compiledSources);
|
|
10203
10350
|
return compiledSources;
|
|
10204
10351
|
}
|
|
@@ -10386,11 +10533,11 @@ function isNativeEntry(directory, relative10) {
|
|
|
10386
10533
|
let current = directory;
|
|
10387
10534
|
for (const segment of within.split(path9.sep)) {
|
|
10388
10535
|
current = path9.join(current, segment);
|
|
10389
|
-
if (!
|
|
10536
|
+
if (!existsSync20(current) || lstatSync11(current).isSymbolicLink()) {
|
|
10390
10537
|
return false;
|
|
10391
10538
|
}
|
|
10392
10539
|
}
|
|
10393
|
-
return
|
|
10540
|
+
return lstatSync11(file).isFile() || lstatSync11(file).isDirectory();
|
|
10394
10541
|
}
|
|
10395
10542
|
function assertSceneDelegateFiles(nativeDirectory, source, label, compiledSources) {
|
|
10396
10543
|
const values = parsePlistDictionary(source, label);
|
|
@@ -10419,7 +10566,7 @@ function assertSceneDelegateFiles(nativeDirectory, source, label, compiledSource
|
|
|
10419
10566
|
if (!compiledSources.has(relative10)) {
|
|
10420
10567
|
return false;
|
|
10421
10568
|
}
|
|
10422
|
-
const text = stripSourceCommentsAndStrings(
|
|
10569
|
+
const text = stripSourceCommentsAndStrings(readFileSync20(path9.join(nativeDirectory, relative10), "utf8"));
|
|
10423
10570
|
return hasUsableTopLevelSwiftSceneDelegate(text, className);
|
|
10424
10571
|
})) {
|
|
10425
10572
|
throw new Error(`Existing ios project ${label} scene delegate ${delegate} is missing from App Sources.`);
|
|
@@ -10444,29 +10591,29 @@ function hasUsableTopLevelSwiftSceneDelegate(source, className) {
|
|
|
10444
10591
|
return false;
|
|
10445
10592
|
}
|
|
10446
10593
|
function assertAndroidManifestResources(nativeDirectory) {
|
|
10447
|
-
const manifestFiles = ["main", "release"].map((sourceSet) => path9.join(nativeDirectory, `app/src/${sourceSet}/AndroidManifest.xml`)).filter((file) =>
|
|
10594
|
+
const manifestFiles = ["main", "release"].map((sourceSet) => path9.join(nativeDirectory, `app/src/${sourceSet}/AndroidManifest.xml`)).filter((file) => existsSync20(file));
|
|
10448
10595
|
const resourceRoots = ["main", "release"].map((sourceSet) => path9.join(nativeDirectory, `app/src/${sourceSet}/res`));
|
|
10449
10596
|
const references = manifestFiles.flatMap((file) => {
|
|
10450
|
-
const manifest =
|
|
10597
|
+
const manifest = readFileSync20(file, "utf8").replace(/<!--[\s\S]*?-->/gu, "");
|
|
10451
10598
|
return [...manifest.matchAll(/(?<![\w+])@([a-z]+)\/([A-Za-z_][A-Za-z0-9_.]*)/gu)];
|
|
10452
10599
|
});
|
|
10453
10600
|
for (const reference of references) {
|
|
10454
10601
|
const type = reference[1] ?? "";
|
|
10455
10602
|
const name = reference[2] ?? "";
|
|
10456
10603
|
const found = resourceRoots.some((resourceRoot) => {
|
|
10457
|
-
if (!
|
|
10604
|
+
if (!existsSync20(resourceRoot)) {
|
|
10458
10605
|
return false;
|
|
10459
10606
|
}
|
|
10460
|
-
const folders =
|
|
10607
|
+
const folders = readdirSync6(resourceRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
10461
10608
|
return folders.some((folder) => {
|
|
10462
10609
|
const densityFallback = (type === "mipmap" || type === "drawable") && new RegExp(`^${type}-(?:ldpi|mdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|nodpi|anydpi)$`, "u").test(folder);
|
|
10463
10610
|
if (folder === type || densityFallback) {
|
|
10464
|
-
return
|
|
10611
|
+
return readdirSync6(path9.join(resourceRoot, folder)).some((file) => file === `${name}.xml` || file.startsWith(`${name}.`));
|
|
10465
10612
|
}
|
|
10466
10613
|
if (folder !== "values") {
|
|
10467
10614
|
return false;
|
|
10468
10615
|
}
|
|
10469
|
-
return
|
|
10616
|
+
return readdirSync6(path9.join(resourceRoot, folder)).some((file) => file.endsWith(".xml") && readAndroidValueResource(path9.join(resourceRoot, folder, file), type, name).length > 0);
|
|
10470
10617
|
});
|
|
10471
10618
|
});
|
|
10472
10619
|
if (!found) {
|
|
@@ -10479,7 +10626,7 @@ function assertNativeDisplayName(nativeDirectory, platform, expectedDisplayName,
|
|
|
10479
10626
|
if (platform === "ios" && !isNativeFile(nativeDirectory, relative10)) {
|
|
10480
10627
|
throw new Error(`Existing ${platform} project is incomplete; native display name resource is missing.`);
|
|
10481
10628
|
}
|
|
10482
|
-
const source = platform === "ios" ?
|
|
10629
|
+
const source = platform === "ios" ? readFileSync20(path9.join(nativeDirectory, relative10), "utf8") : "";
|
|
10483
10630
|
const labels = platform === "ios" ? [parsePlistDictionary(source, "Release").get("CFBundleDisplayName")].filter((value) => value?.tagName === "string").map((value) => value?.textContent ?? "") : [];
|
|
10484
10631
|
if (platform === "ios" && (labels.length !== 1 || labels[0] !== expectedDisplayName)) {
|
|
10485
10632
|
throw new Error(`Existing ${platform} project display name differs or cannot be read safely.`);
|
|
@@ -10505,7 +10652,7 @@ function assertNativeDisplayName(nativeDirectory, platform, expectedDisplayName,
|
|
|
10505
10652
|
}
|
|
10506
10653
|
}
|
|
10507
10654
|
const overlayFile = path9.join(nativeDirectory, "app/src/release/AndroidManifest.xml");
|
|
10508
|
-
if (
|
|
10655
|
+
if (existsSync20(overlayFile)) {
|
|
10509
10656
|
const release = readAndroidApplication(overlayFile, false);
|
|
10510
10657
|
if (release !== void 0) {
|
|
10511
10658
|
if (hasAndroidMergerDirective(release)) {
|
|
@@ -10515,8 +10662,8 @@ function assertNativeDisplayName(nativeDirectory, platform, expectedDisplayName,
|
|
|
10515
10662
|
if (releaseLabel !== null && resolveAndroidLabel(nativeDirectory, releaseLabel) !== expectedDisplayName) {
|
|
10516
10663
|
throw new Error("Existing android Release application label differs from the requested name.");
|
|
10517
10664
|
}
|
|
10518
|
-
const appBuildFile = ["app/build.gradle", "app/build.gradle.kts"].map((relative11) => path9.join(nativeDirectory, relative11)).find((file) =>
|
|
10519
|
-
const appGradle = appBuildFile === void 0 ? "" :
|
|
10665
|
+
const appBuildFile = ["app/build.gradle", "app/build.gradle.kts"].map((relative11) => path9.join(nativeDirectory, relative11)).find((file) => existsSync20(file));
|
|
10666
|
+
const appGradle = appBuildFile === void 0 ? "" : readFileSync20(appBuildFile, "utf8");
|
|
10520
10667
|
const manifestPackage = main.parentNode?.getAttribute("package");
|
|
10521
10668
|
const namespace = /\bnamespace\s*(?:=\s*)?["']([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)+)["']/u.exec(stripGradleComments(appGradle))?.[1] ?? (manifestPackage === null || manifestPackage === "" ? void 0 : manifestPackage);
|
|
10522
10669
|
const launcherNames = /* @__PURE__ */ new Set();
|
|
@@ -10559,13 +10706,13 @@ function assertAndroidReleaseDisplayName(shellApp, expectedDisplayName) {
|
|
|
10559
10706
|
function assertAndroidReleaseLauncherIntegrity(shellApp) {
|
|
10560
10707
|
const nativeDirectory = path9.join(shellApp, "android");
|
|
10561
10708
|
const gradleRelative = requireOneNativeFile(nativeDirectory, ["app/build.gradle", "app/build.gradle.kts"], "android");
|
|
10562
|
-
const gradle =
|
|
10709
|
+
const gradle = readFileSync20(path9.join(nativeDirectory, gradleRelative), "utf8");
|
|
10563
10710
|
assertAndroidLauncherClasses(nativeDirectory, gradle);
|
|
10564
10711
|
}
|
|
10565
10712
|
function assertIosReleaseDisplayName(shellApp, expectedDisplayName) {
|
|
10566
10713
|
const nativeDirectory = path9.join(shellApp, "ios");
|
|
10567
10714
|
const projectFile = path9.join(nativeDirectory, "App/App.xcodeproj/project.pbxproj");
|
|
10568
|
-
const project =
|
|
10715
|
+
const project = readFileSync20(projectFile, "utf8");
|
|
10569
10716
|
const infoRelative = path9.join("App", readIosReleaseInfoPlist(project));
|
|
10570
10717
|
if (!isNativeFile(nativeDirectory, infoRelative)) {
|
|
10571
10718
|
throw new Error("Existing ios project Release Info.plist is missing or unsafe.");
|
|
@@ -10587,9 +10734,9 @@ function assertIosArchiveScheme(shellApp) {
|
|
|
10587
10734
|
if (!isNativeFile(nativeDirectory, projectRelative) || !isNativeFile(nativeDirectory, schemeRelative)) {
|
|
10588
10735
|
throw new Error("Existing ios project shared App archive scheme is missing or unsafe.");
|
|
10589
10736
|
}
|
|
10590
|
-
const project =
|
|
10737
|
+
const project = readFileSync20(path9.join(nativeDirectory, projectRelative), "utf8");
|
|
10591
10738
|
const appTargetId = readIosAppTargetId(project);
|
|
10592
|
-
const schemeSource =
|
|
10739
|
+
const schemeSource = readFileSync20(path9.join(nativeDirectory, schemeRelative), "utf8");
|
|
10593
10740
|
const scheme = parseXml(schemeSource, "ios project App archive scheme").documentElement;
|
|
10594
10741
|
if (scheme?.tagName !== "Scheme") {
|
|
10595
10742
|
throw new Error("Existing ios project App archive scheme is malformed.");
|
|
@@ -10616,7 +10763,7 @@ function hasAndroidMergerDirectiveDeep(element) {
|
|
|
10616
10763
|
return hasAndroidMergerDirective(element) || childElements(element).some(hasAndroidMergerDirectiveDeep);
|
|
10617
10764
|
}
|
|
10618
10765
|
function readAndroidApplication(file, required = true) {
|
|
10619
|
-
const root = parseXml(
|
|
10766
|
+
const root = parseXml(readFileSync20(file, "utf8"), "android manifest").documentElement;
|
|
10620
10767
|
const application = root === null ? void 0 : childElements(root).find((element) => element.tagName === "application");
|
|
10621
10768
|
if (root?.tagName !== "manifest" || required && application === void 0) {
|
|
10622
10769
|
throw new Error("Existing android project manifest application is missing.");
|
|
@@ -10645,9 +10792,9 @@ function readAndroidString(nativeDirectory, key) {
|
|
|
10645
10792
|
throw new Error("Existing android project application label is unsupported.");
|
|
10646
10793
|
}
|
|
10647
10794
|
const overlay = path9.join(nativeDirectory, "app/src/release/res/values");
|
|
10648
|
-
const overlayValues =
|
|
10795
|
+
const overlayValues = existsSync20(overlay) && lstatSync11(overlay).isDirectory() ? readdirSync6(overlay).filter((file) => file.endsWith(".xml")).flatMap((file) => readAndroidValueResource(path9.join(overlay, file), "string", key)) : [];
|
|
10649
10796
|
const main = path9.join(nativeDirectory, "app/src/main/res/values");
|
|
10650
|
-
const mainValues =
|
|
10797
|
+
const mainValues = existsSync20(main) && lstatSync11(main).isDirectory() ? readdirSync6(main).filter((file) => file.endsWith(".xml")).flatMap((file) => readAndroidValueResource(path9.join(main, file), "string", key)) : [];
|
|
10651
10798
|
const values = overlayValues.length > 0 ? overlayValues : mainValues;
|
|
10652
10799
|
if (values.length !== 1) {
|
|
10653
10800
|
throw new Error("Existing android project application label resource is missing or ambiguous.");
|
|
@@ -10659,7 +10806,7 @@ function readAndroidString(nativeDirectory, key) {
|
|
|
10659
10806
|
return values[0] ?? "";
|
|
10660
10807
|
}
|
|
10661
10808
|
function readAndroidValueResource(file, type, name) {
|
|
10662
|
-
const root = parseXml(
|
|
10809
|
+
const root = parseXml(readFileSync20(file, "utf8"), "android values resource").documentElement;
|
|
10663
10810
|
if (root?.tagName !== "resources") {
|
|
10664
10811
|
throw new Error("Existing android values resource is malformed.");
|
|
10665
10812
|
}
|
|
@@ -10727,11 +10874,11 @@ function isNativeFile(directory, relative10) {
|
|
|
10727
10874
|
let current = directory;
|
|
10728
10875
|
for (const segment of within.split(path9.sep)) {
|
|
10729
10876
|
current = path9.join(current, segment);
|
|
10730
|
-
if (!
|
|
10877
|
+
if (!existsSync20(current) || lstatSync11(current).isSymbolicLink()) {
|
|
10731
10878
|
return false;
|
|
10732
10879
|
}
|
|
10733
10880
|
}
|
|
10734
|
-
return
|
|
10881
|
+
return lstatSync11(file).isFile();
|
|
10735
10882
|
}
|
|
10736
10883
|
|
|
10737
10884
|
// node_modules/.cache/mpgd-native-build/tools/target/native-release-identity.js
|
|
@@ -10743,14 +10890,14 @@ function assertNativeReleaseIdentity(input) {
|
|
|
10743
10890
|
assertNativeVersionMatchesGameVersion(expected, input.environment, input.required);
|
|
10744
10891
|
if (expected.kind === "android") {
|
|
10745
10892
|
const candidates = [
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
].filter((file) =>
|
|
10893
|
+
join9(input.shellApp, "android/app/build.gradle"),
|
|
10894
|
+
join9(input.shellApp, "android/app/build.gradle.kts")
|
|
10895
|
+
].filter((file) => existsSync21(file));
|
|
10749
10896
|
if (candidates.length !== 1) {
|
|
10750
10897
|
throw new Error("Android native release requires exactly one Gradle app build file.");
|
|
10751
10898
|
}
|
|
10752
10899
|
assertAndroidIdentity(candidates[0] ?? "", expected);
|
|
10753
|
-
assertAndroidAppliedScripts(candidates[0] ?? "",
|
|
10900
|
+
assertAndroidAppliedScripts(candidates[0] ?? "", join9(input.shellApp, "android"));
|
|
10754
10901
|
if (input.required) {
|
|
10755
10902
|
const name = requireValue(input.metadata?.displayName, "Android target metadata displayName");
|
|
10756
10903
|
assertAndroidReleaseDisplayName(input.shellApp, name);
|
|
@@ -10758,7 +10905,7 @@ function assertNativeReleaseIdentity(input) {
|
|
|
10758
10905
|
}
|
|
10759
10906
|
return;
|
|
10760
10907
|
}
|
|
10761
|
-
assertIosIdentity(
|
|
10908
|
+
assertIosIdentity(join9(input.shellApp, "ios/App/App.xcodeproj/project.pbxproj"), expected);
|
|
10762
10909
|
if (input.required) {
|
|
10763
10910
|
const name = requireValue(input.metadata?.displayName, "iOS target metadata displayName");
|
|
10764
10911
|
assertIosReleaseDisplayName(input.shellApp, name);
|
|
@@ -10897,7 +11044,7 @@ function assertAndroidAppliedScripts(appBuild, androidRoot) {
|
|
|
10897
11044
|
throw new Error("Native release preflight cannot resolve an applied Gradle script.");
|
|
10898
11045
|
}
|
|
10899
11046
|
};
|
|
10900
|
-
const rootFiles = ["build.gradle", "build.gradle.kts"].map((name) =>
|
|
11047
|
+
const rootFiles = ["build.gradle", "build.gradle.kts"].map((name) => join9(androidRoot, name)).filter((file) => existsSync21(file));
|
|
10901
11048
|
if (rootFiles.length !== 1) {
|
|
10902
11049
|
throw new Error("Native release preflight requires one Android root Gradle build file.");
|
|
10903
11050
|
}
|
|
@@ -10907,7 +11054,7 @@ function assertAndroidAppliedScripts(appBuild, androidRoot) {
|
|
|
10907
11054
|
if (/\b(?:afterEvaluate|projectsEvaluated)\b/u.test(rootCode) && /\b(?:project|subprojects|allprojects|android)\b/u.test(rootCode)) {
|
|
10908
11055
|
throw new Error("Native release preflight cannot resolve root Gradle app callbacks.");
|
|
10909
11056
|
}
|
|
10910
|
-
const settingsFiles = ["settings.gradle", "settings.gradle.kts"].map((name) =>
|
|
11057
|
+
const settingsFiles = ["settings.gradle", "settings.gradle.kts"].map((name) => join9(androidRoot, name)).filter((file) => existsSync21(file));
|
|
10911
11058
|
if (settingsFiles.length !== 1) {
|
|
10912
11059
|
throw new Error("Native release preflight requires one Android settings Gradle file.");
|
|
10913
11060
|
}
|
|
@@ -10931,7 +11078,7 @@ function assertIosIdentity(file, expected) {
|
|
|
10931
11078
|
assertIosSetting(releaseSettings, "MARKETING_VERSION", expected.marketingVersion, file);
|
|
10932
11079
|
assertIosSetting(releaseSettings, "CURRENT_PROJECT_VERSION", expected.buildNumber, file);
|
|
10933
11080
|
const plistRelative = readIosReleaseInfoPlist(source);
|
|
10934
|
-
const plist =
|
|
11081
|
+
const plist = join9(dirname7(dirname7(file)), plistRelative);
|
|
10935
11082
|
assertIosReleasePlistIdentity(readRequiredFile(plist, "iOS Release Info.plist"));
|
|
10936
11083
|
}
|
|
10937
11084
|
function assertIosSetting(settings, key, expected, file) {
|
|
@@ -11231,10 +11378,10 @@ function stripOptionalQuotes(value) {
|
|
|
11231
11378
|
return value;
|
|
11232
11379
|
}
|
|
11233
11380
|
function readRequiredFile(file, label) {
|
|
11234
|
-
if (!
|
|
11381
|
+
if (!existsSync21(file)) {
|
|
11235
11382
|
throw new Error(`Missing ${label}: ${file}`);
|
|
11236
11383
|
}
|
|
11237
|
-
return
|
|
11384
|
+
return readFileSync21(file, "utf8");
|
|
11238
11385
|
}
|
|
11239
11386
|
function requireFinalSemVer2(value, label) {
|
|
11240
11387
|
const normalized = requireValue(value, label);
|
|
@@ -11335,7 +11482,7 @@ function androidSignedReleaseGradleArgs(environment) {
|
|
|
11335
11482
|
if (initScript === void 0 || initScript === "") {
|
|
11336
11483
|
return ["bundleRelease", "--no-daemon"];
|
|
11337
11484
|
}
|
|
11338
|
-
if (!isAbsolute9(initScript) || !
|
|
11485
|
+
if (!isAbsolute9(initScript) || !existsSync22(initScript) || !statSync6(initScript).isFile()) {
|
|
11339
11486
|
throw new Error("Android upload signing init script must be an existing absolute file.");
|
|
11340
11487
|
}
|
|
11341
11488
|
return ["bundleRelease", "--no-daemon", "--init-script", initScript];
|
|
@@ -11376,7 +11523,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11376
11523
|
"CODE_SIGNING_ALLOWED=NO"
|
|
11377
11524
|
], environment, `${stagedShell}/ios`);
|
|
11378
11525
|
} else if (plan.mode === "simulator") {
|
|
11379
|
-
const buildRoot = mkdtempSync4(
|
|
11526
|
+
const buildRoot = mkdtempSync4(join10(tmpdir3(), "mpgd-ios-simulator-"));
|
|
11380
11527
|
releaseArtifact = `${artifactRoot}/App.app`;
|
|
11381
11528
|
try {
|
|
11382
11529
|
input.run("xcodebuild", [
|
|
@@ -11390,7 +11537,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11390
11537
|
"-sdk",
|
|
11391
11538
|
"iphonesimulator",
|
|
11392
11539
|
`SYMROOT=${buildRoot}`,
|
|
11393
|
-
`OBJROOT=${
|
|
11540
|
+
`OBJROOT=${join10(buildRoot, "Intermediates.noindex")}`,
|
|
11394
11541
|
"INFOPLIST_FILE=App/Info-Smoke.plist",
|
|
11395
11542
|
"EXCLUDED_SOURCE_FILE_NAMES=Main.storyboard LaunchScreen.storyboard Assets.xcassets",
|
|
11396
11543
|
"ASSETCATALOG_COMPILER_APPICON_NAME=",
|
|
@@ -11434,7 +11581,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11434
11581
|
inspectSignedIosArchive(input.targetPath(archiveArtifact), expectedIosIdentity);
|
|
11435
11582
|
releaseArtifact = archiveArtifact;
|
|
11436
11583
|
if (plan.mode === "store-export") {
|
|
11437
|
-
const exportRoot = mkdtempSync4(
|
|
11584
|
+
const exportRoot = mkdtempSync4(join10(tmpdir3(), "mpgd-ios-export-"));
|
|
11438
11585
|
try {
|
|
11439
11586
|
input.run("xcodebuild", [
|
|
11440
11587
|
"-exportArchive",
|
|
@@ -11445,12 +11592,12 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11445
11592
|
"-exportOptionsPlist",
|
|
11446
11593
|
requireString(signing.exportOptionsPlist, "iOS export options plist")
|
|
11447
11594
|
], environment, `${stagedShell}/ios`);
|
|
11448
|
-
const exportedIpas =
|
|
11595
|
+
const exportedIpas = readdirSync7(exportRoot).filter((name) => name.endsWith(".ipa"));
|
|
11449
11596
|
if (exportedIpas.length !== 1) {
|
|
11450
11597
|
throw new Error("iOS store export must produce exactly one IPA.");
|
|
11451
11598
|
}
|
|
11452
11599
|
releaseArtifact = `${artifactRoot}/App.ipa`;
|
|
11453
|
-
input.copyFile(
|
|
11600
|
+
input.copyFile(join10(exportRoot, exportedIpas[0] ?? ""), input.targetPath(releaseArtifact));
|
|
11454
11601
|
inspectSignedIosIpa(input.targetPath(releaseArtifact), expectedIosIdentity);
|
|
11455
11602
|
} finally {
|
|
11456
11603
|
rmSync10(exportRoot, { recursive: true, force: true });
|
|
@@ -11628,7 +11775,7 @@ assertProductionTargetReadiness({
|
|
|
11628
11775
|
...runtimeTargetConfigMatrix.targets[targetName] === void 0 ? {} : { targetPolicy: runtimeTargetConfigMatrix.targets[targetName] },
|
|
11629
11776
|
...gameServicesUrl === void 0 ? {} : { gameServicesUrl }
|
|
11630
11777
|
});
|
|
11631
|
-
var nativeWebBundle = nativePlan === void 0 ? void 0 : mkdtempSync5(
|
|
11778
|
+
var nativeWebBundle = nativePlan === void 0 ? void 0 : mkdtempSync5(join11(tmpdir4(), "mpgd-native-web-"));
|
|
11632
11779
|
var nativeArtifactRoot = nativeAttempt === void 0 ? void 0 : `release-output/native/${targetName}/${safeArtifactFileStem(profile)}/${nativeAttempt.runId}`;
|
|
11633
11780
|
var nativeCompleted = false;
|
|
11634
11781
|
var runtimeTargetConfigMatrixFile = createRuntimeTargetConfigMatrixFile(runtimeTargetConfigMatrix);
|
|
@@ -11676,10 +11823,10 @@ try {
|
|
|
11676
11823
|
case "wechat-minigame": {
|
|
11677
11824
|
const outputConfigPath = requireString2(target.output, `${targetName}.output`);
|
|
11678
11825
|
const output = targetPath(outputConfigPath);
|
|
11679
|
-
const bundleRoot = mkdtempSync5(
|
|
11826
|
+
const bundleRoot = mkdtempSync5(join11(tmpdir4(), "mpgd-wechat-bundles-"));
|
|
11680
11827
|
try {
|
|
11681
|
-
const runtimeBundleRoot =
|
|
11682
|
-
const gameBundleRoot =
|
|
11828
|
+
const runtimeBundleRoot = join11(bundleRoot, "runtime");
|
|
11829
|
+
const gameBundleRoot = join11(bundleRoot, "game");
|
|
11683
11830
|
buildMiniGameBundle("runtime", runtimeBundleRoot, bundleRoot, gameApp, profile, env);
|
|
11684
11831
|
buildMiniGameBundle("game", gameBundleRoot, bundleRoot, gameApp, profile, env);
|
|
11685
11832
|
const effectiveTargetConfig = generateEffectiveTargetConfigArtifact(targetName, env);
|
|
@@ -11751,6 +11898,12 @@ try {
|
|
|
11751
11898
|
} else {
|
|
11752
11899
|
assertInstallableWebArtifact(output);
|
|
11753
11900
|
}
|
|
11901
|
+
if (target.adapter === "oneplay") {
|
|
11902
|
+
writeOnePlayHostingHeaders(output);
|
|
11903
|
+
}
|
|
11904
|
+
if (target.adapter === "crazygames") {
|
|
11905
|
+
assertCrazyGamesArtifact(output);
|
|
11906
|
+
}
|
|
11754
11907
|
writeManifest(targetName, profile, outputConfigPath, env);
|
|
11755
11908
|
break;
|
|
11756
11909
|
}
|
|
@@ -11824,9 +11977,9 @@ try {
|
|
|
11824
11977
|
rmSync11(dirname9(runtimeTargetConfigMatrixFile), { force: true, recursive: true });
|
|
11825
11978
|
}
|
|
11826
11979
|
function createRuntimeTargetConfigMatrixFile(matrix) {
|
|
11827
|
-
const directory = mkdtempSync5(
|
|
11828
|
-
const file =
|
|
11829
|
-
|
|
11980
|
+
const directory = mkdtempSync5(join11(tmpdir4(), "mpgd-target-config-matrix-"));
|
|
11981
|
+
const file = join11(directory, "matrix.json");
|
|
11982
|
+
writeFileSync15(file, `${JSON.stringify(matrix)}
|
|
11830
11983
|
`);
|
|
11831
11984
|
return file;
|
|
11832
11985
|
}
|
|
@@ -11846,7 +11999,7 @@ function replaceDirectory(source, destination) {
|
|
|
11846
11999
|
function mirrorAitRuntimeAssets(gameApp2, wrapperApp) {
|
|
11847
12000
|
const sourceAssets = `${gameApp2}/dist/assets`;
|
|
11848
12001
|
const destinationAssets = `${wrapperApp}/public/assets`;
|
|
11849
|
-
if (
|
|
12002
|
+
if (existsSync23(sourceAssets)) {
|
|
11850
12003
|
replaceDirectory(sourceAssets, destinationAssets);
|
|
11851
12004
|
} else {
|
|
11852
12005
|
rmSync11(destinationAssets, { recursive: true, force: true });
|
|
@@ -11928,14 +12081,14 @@ function copyIosSyncSwiftPackage(shellApp, releaseArtifact, packageName, swiftPa
|
|
|
11928
12081
|
}
|
|
11929
12082
|
function rewriteIosSyncSwiftPackagePath(releaseArtifact, packageName, swiftPackageName) {
|
|
11930
12083
|
const packageFile = targetPath(`${releaseArtifact}/App/CapApp-SPM/Package.swift`);
|
|
11931
|
-
const contents =
|
|
12084
|
+
const contents = readFileSync22(packageFile, "utf8");
|
|
11932
12085
|
const originalPath = readSwiftPackagePath(packageFile, swiftPackageName);
|
|
11933
12086
|
const rewrittenPath = `../../node_modules/${packageName}`;
|
|
11934
12087
|
const marker = `.package(name: "${swiftPackageName}", path: "`;
|
|
11935
|
-
|
|
12088
|
+
writeFileSync15(packageFile, contents.replace(`${marker}${originalPath}"`, `${marker}${rewrittenPath}"`));
|
|
11936
12089
|
}
|
|
11937
12090
|
function readSwiftPackagePath(packageFile, swiftPackageName) {
|
|
11938
|
-
const contents =
|
|
12091
|
+
const contents = readFileSync22(packageFile, "utf8");
|
|
11939
12092
|
const marker = `.package(name: "${swiftPackageName}", path: "`;
|
|
11940
12093
|
const index = contents.indexOf(marker);
|
|
11941
12094
|
if (index < 0 || contents.indexOf(marker, index + marker.length) >= 0) {
|
|
@@ -11953,10 +12106,10 @@ function copyFile(source, destination) {
|
|
|
11953
12106
|
cpSync4(source, destination);
|
|
11954
12107
|
}
|
|
11955
12108
|
function removeFilesByExtension(directory, extension) {
|
|
11956
|
-
if (!
|
|
12109
|
+
if (!existsSync23(directory)) {
|
|
11957
12110
|
return;
|
|
11958
12111
|
}
|
|
11959
|
-
for (const file of
|
|
12112
|
+
for (const file of readdirSync8(directory)) {
|
|
11960
12113
|
const target2 = `${directory}/${file}`;
|
|
11961
12114
|
if (file.endsWith(extension) && statSync7(target2).isFile()) {
|
|
11962
12115
|
rmSync11(target2, { force: true });
|
|
@@ -11968,7 +12121,7 @@ function safeArtifactFileStem(value) {
|
|
|
11968
12121
|
return stem.length === 0 ? "mpgd-kit" : stem;
|
|
11969
12122
|
}
|
|
11970
12123
|
function ensureCapacitorPlatform(shellApp, platform, commandEnv) {
|
|
11971
|
-
if (!
|
|
12124
|
+
if (!existsSync23(`${shellApp}/${platform}`)) {
|
|
11972
12125
|
run("pnpm", ["--dir", shellApp, "cap", "add", platform], commandEnv);
|
|
11973
12126
|
}
|
|
11974
12127
|
}
|
|
@@ -12004,9 +12157,9 @@ function findEmbeddedIconManifestArtifactPath(artifact) {
|
|
|
12004
12157
|
}
|
|
12005
12158
|
function findNamedArtifactFiles(root, fileName) {
|
|
12006
12159
|
const matches = [];
|
|
12007
|
-
for (const entry of
|
|
12008
|
-
const path10 =
|
|
12009
|
-
const stat =
|
|
12160
|
+
for (const entry of readdirSync8(root)) {
|
|
12161
|
+
const path10 = join11(root, entry);
|
|
12162
|
+
const stat = lstatSync12(path10);
|
|
12010
12163
|
if (stat.isSymbolicLink()) {
|
|
12011
12164
|
continue;
|
|
12012
12165
|
}
|
|
@@ -12055,8 +12208,8 @@ function isMiniGameTarget(target2) {
|
|
|
12055
12208
|
return target2.kind === "wechat-minigame" || target2.kind === "tiktok-minigame";
|
|
12056
12209
|
}
|
|
12057
12210
|
function buildMiniGameBundle(bundleKind, outputDir, stagingRoot, gameApp2, profile2, commandEnv) {
|
|
12058
|
-
const viteConfig =
|
|
12059
|
-
if (!
|
|
12211
|
+
const viteConfig = join11(gameApp2, "vite.minigame.config.ts");
|
|
12212
|
+
if (!existsSync23(viteConfig)) {
|
|
12060
12213
|
throw new Error(`Mini-game target requires a game-owned vite.minigame.config.ts: ${viteConfig}`);
|
|
12061
12214
|
}
|
|
12062
12215
|
run("pnpm", ["exec", "vite", "build", "--config", "vite.minigame.config.ts", "--mode", profile2], {
|
|
@@ -12092,7 +12245,7 @@ function targetPath(path10) {
|
|
|
12092
12245
|
return resolveFromPlatformTargetsBase(configBaseDir, path10);
|
|
12093
12246
|
}
|
|
12094
12247
|
function findFileByExtension(directory, extension) {
|
|
12095
|
-
const files =
|
|
12248
|
+
const files = readdirSync8(directory).filter((file) => file.endsWith(extension)).sort();
|
|
12096
12249
|
if (files.length === 0) {
|
|
12097
12250
|
throw new Error(`Missing ${extension} artifact in ${directory}.`);
|
|
12098
12251
|
}
|