@mpgd/cli 0.38.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 +2 -0
- package/dist/index.js +2 -0
- package/dist/native-build-info.json +2 -2
- package/dist/native-build-target.js +261 -176
- package/package.json +13 -13
- 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 +21 -0
- package/templates/phaser-game/docs/MPGD_KIT_WORKFLOWS.md +6 -0
- package/templates/phaser-game/mpgd.targets.json +11 -0
- package/templates/phaser-game/src/main.ts +2 -0
- package/templates/phaser-game/src/platform/buildGateways/oneplay.ts +32 -0
- package/templates/phaser-game/src/platform/runtimeDetector.ts +1 -0
- package/templates/phaser-game/src/runtime/createGame.ts +3 -3
- package/templates/phaser-game/src/scenes/BootScene.ts +7 -1
- package/templates/phaser-game/src/scenes/PlayScene.ts +16 -0
- package/templates/phaser-game/vite.runtime-target-config.ts +2 -0
- package/templates/phaser-game/vite.shared.ts +2 -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
|
|
@@ -1878,6 +1878,13 @@ var integrationUpperBoundsByRuntime = {
|
|
|
1878
1878
|
inboundShare: "unsupported",
|
|
1879
1879
|
notifications: "unsupported"
|
|
1880
1880
|
},
|
|
1881
|
+
"oneplay-web": {
|
|
1882
|
+
identityUpgrade: "unsupported",
|
|
1883
|
+
presentation: "available",
|
|
1884
|
+
sharing: "unsupported",
|
|
1885
|
+
inboundShare: "unsupported",
|
|
1886
|
+
notifications: "unsupported"
|
|
1887
|
+
},
|
|
1881
1888
|
"tiktok-minigame": {
|
|
1882
1889
|
identityUpgrade: "unsupported",
|
|
1883
1890
|
presentation: "available",
|
|
@@ -1947,7 +1954,7 @@ function normalizeTargetIntegrationConfig(config2) {
|
|
|
1947
1954
|
}
|
|
1948
1955
|
function assertTargetIntegrationRuntimeBounds(runtime, config2, label) {
|
|
1949
1956
|
const integrations = normalizeTargetIntegrationConfig(config2);
|
|
1950
|
-
if (runtime !== "tiktok-minigame" && runtime !== "verse8-web" && runtime !== "crazygames-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") {
|
|
1951
1958
|
return integrations;
|
|
1952
1959
|
}
|
|
1953
1960
|
const upperBounds = integrationUpperBoundsByRuntime[runtime];
|
|
@@ -2051,6 +2058,19 @@ function createEffectiveTargetConfig(input) {
|
|
|
2051
2058
|
};
|
|
2052
2059
|
}
|
|
2053
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
|
+
}
|
|
2054
2074
|
if (config2.runtime === "crazygames-web") {
|
|
2055
2075
|
const interstitialAds = platformTarget?.crazyGamesLaunch === "full" && config2.features.interstitialAds && config2.monetization.interstitialAds;
|
|
2056
2076
|
const monetization = { ...disabledAuthoritativeMonetization, interstitialAds };
|
|
@@ -2270,10 +2290,47 @@ function assertCrazyGamesArtifact(root) {
|
|
|
2270
2290
|
return { files, bytes };
|
|
2271
2291
|
}
|
|
2272
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
|
+
|
|
2273
2330
|
// node_modules/.cache/mpgd-native-build/tools/target/effective-config.js
|
|
2274
2331
|
import { createHash as createHash3 } from "node:crypto";
|
|
2275
|
-
import { existsSync as
|
|
2276
|
-
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";
|
|
2277
2334
|
|
|
2278
2335
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/target-name.js
|
|
2279
2336
|
var deploymentTargetNamePattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
@@ -2330,11 +2387,11 @@ function readConfiguredPath(value) {
|
|
|
2330
2387
|
}
|
|
2331
2388
|
|
|
2332
2389
|
// node_modules/.cache/mpgd-native-build/tools/io.js
|
|
2333
|
-
import { readFileSync as
|
|
2390
|
+
import { readFileSync as readFileSync9 } from "node:fs";
|
|
2334
2391
|
import { resolve as resolve5 } from "node:path";
|
|
2335
2392
|
import { pathToFileURL } from "node:url";
|
|
2336
2393
|
function readJsonFile(path10) {
|
|
2337
|
-
return JSON.parse(
|
|
2394
|
+
return JSON.parse(readFileSync9(resolve5(path10), "utf8"));
|
|
2338
2395
|
}
|
|
2339
2396
|
function isCliEntrypoint(metaUrl) {
|
|
2340
2397
|
const scriptPath = process.argv[1];
|
|
@@ -3147,6 +3204,12 @@ function assertPlatformTargetConfigShape(input, target2) {
|
|
|
3147
3204
|
if (target2 === "crazygames" && (input.kind !== "web" || input.adapter !== "crazygames")) {
|
|
3148
3205
|
throw new Error("crazygames target must use the web kind and crazygames adapter.");
|
|
3149
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
|
+
}
|
|
3150
3213
|
if (input.adapter === "crazygames" && (input.kind !== "web" || input.installable !== false)) {
|
|
3151
3214
|
throw new Error("CrazyGames requires a web target with installable: false.");
|
|
3152
3215
|
}
|
|
@@ -3367,20 +3430,20 @@ function assertTargetKind(input, target2) {
|
|
|
3367
3430
|
import * as _assertGuard_14 from "typia/lib/internal/_assertGuard";
|
|
3368
3431
|
import * as _accessExpressionAsString_14 from "typia/lib/internal/_accessExpressionAsString";
|
|
3369
3432
|
import { createHash as createHash2 } from "node:crypto";
|
|
3370
|
-
import { readFileSync as
|
|
3433
|
+
import { readFileSync as readFileSync10 } from "node:fs";
|
|
3371
3434
|
import typia4 from "typia";
|
|
3372
3435
|
var __typia_transform__accessExpressionAsString2 = _accessExpressionAsString_14._accessExpressionAsString;
|
|
3373
3436
|
var defaultTargetConfigMatrixFile = "packages/target-config/targets.json";
|
|
3374
3437
|
var assertTargetConfigMatrix = /* @__PURE__ */ (() => {
|
|
3375
|
-
const _iv0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "crazygames-web", "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"]);
|
|
3376
3439
|
const _ip0 = (input) => "boolean" === typeof input["iap"];
|
|
3377
3440
|
const _ip1 = (input) => void 0 === input["bannerAds"] || "boolean" === typeof input["bannerAds"];
|
|
3378
3441
|
const _ip2 = (input) => "boolean" === typeof input["rewardedAds"];
|
|
3379
3442
|
const _ip3 = (input) => "boolean" === typeof input["interstitialAds"];
|
|
3380
3443
|
const _ip4 = (input) => "boolean" === typeof input["localization"];
|
|
3381
|
-
const _iv1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "crazygames", "devvit", "google-play", "microsoft-store", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3382
|
-
const _av0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "crazygames-web", "devvit-web", "microsoft-store-pwa", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3383
|
-
const _ae0 = '("apps-in-toss" | "capacitor-android" | "capacitor-ios" | "crazygames-web" | "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")';
|
|
3384
3447
|
const _ap0 = (input, _path, _exceptionable = true) => "boolean" === typeof input["iap"] || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3385
3448
|
method: "typia.createAssert",
|
|
3386
3449
|
path: _path + ".iap",
|
|
@@ -3411,8 +3474,8 @@ var assertTargetConfigMatrix = /* @__PURE__ */ (() => {
|
|
|
3411
3474
|
expected: "boolean",
|
|
3412
3475
|
value: input["localization"]
|
|
3413
3476
|
}, _errorFactory);
|
|
3414
|
-
const _av1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "crazygames", "devvit", "google-play", "microsoft-store", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3415
|
-
const _ae1 = '("app-store" | "apps-in-toss" | "crazygames" | "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")';
|
|
3416
3479
|
const _ae2 = '("action-required" | "approval-required" | "available" | "configuration-required" | "disabled" | "temporarily-unavailable" | "unsupported")';
|
|
3417
3480
|
const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.version || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3418
3481
|
method: "typia.createAssert",
|
|
@@ -3672,15 +3735,15 @@ var assertTargetConfigMatrix = /* @__PURE__ */ (() => {
|
|
|
3672
3735
|
};
|
|
3673
3736
|
})();
|
|
3674
3737
|
var assertTargetConfigExtensions = /* @__PURE__ */ (() => {
|
|
3675
|
-
const _iv0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "crazygames-web", "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"]);
|
|
3676
3739
|
const _ip0 = (input) => "boolean" === typeof input["iap"];
|
|
3677
3740
|
const _ip1 = (input) => void 0 === input["bannerAds"] || "boolean" === typeof input["bannerAds"];
|
|
3678
3741
|
const _ip2 = (input) => "boolean" === typeof input["rewardedAds"];
|
|
3679
3742
|
const _ip3 = (input) => "boolean" === typeof input["interstitialAds"];
|
|
3680
3743
|
const _ip4 = (input) => "boolean" === typeof input["localization"];
|
|
3681
|
-
const _iv1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "crazygames", "devvit", "google-play", "microsoft-store", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3682
|
-
const _av0 = /* @__PURE__ */ new Set(["apps-in-toss", "capacitor-android", "capacitor-ios", "crazygames-web", "devvit-web", "microsoft-store-pwa", "tiktok-minigame", "verse8-web", "web", "web-preview", "wechat-minigame"]);
|
|
3683
|
-
const _ae0 = '("apps-in-toss" | "capacitor-android" | "capacitor-ios" | "crazygames-web" | "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")';
|
|
3684
3747
|
const _ap0 = (input, _path, _exceptionable = true) => "boolean" === typeof input["iap"] || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3685
3748
|
method: "typia.createAssert",
|
|
3686
3749
|
path: _path + ".iap",
|
|
@@ -3711,8 +3774,8 @@ var assertTargetConfigExtensions = /* @__PURE__ */ (() => {
|
|
|
3711
3774
|
expected: "boolean",
|
|
3712
3775
|
value: input["localization"]
|
|
3713
3776
|
}, _errorFactory);
|
|
3714
|
-
const _av1 = /* @__PURE__ */ new Set(["app-store", "apps-in-toss", "crazygames", "devvit", "google-play", "microsoft-store", "tiktok-minigame", "verse8", "web", "web-preview", "wechat-minigame"]);
|
|
3715
|
-
const _ae1 = '("app-store" | "apps-in-toss" | "crazygames" | "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")';
|
|
3716
3779
|
const _ae2 = '("action-required" | "approval-required" | "available" | "configuration-required" | "disabled" | "temporarily-unavailable" | "unsupported")';
|
|
3717
3780
|
const _ao0 = (input, _path, _exceptionable = true) => (1 === input.schemaVersion || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3718
3781
|
method: "typia.createAssert",
|
|
@@ -3987,6 +4050,7 @@ var releaseProfileByRuntime = {
|
|
|
3987
4050
|
"devvit-web": "devvit",
|
|
3988
4051
|
"verse8-web": "verse8",
|
|
3989
4052
|
"crazygames-web": "crazygames",
|
|
4053
|
+
"oneplay-web": "oneplay",
|
|
3990
4054
|
"wechat-minigame": "wechat-minigame",
|
|
3991
4055
|
"tiktok-minigame": "tiktok-minigame"
|
|
3992
4056
|
};
|
|
@@ -3996,7 +4060,7 @@ function loadTargetConfigMatrix(baseFile = process.env[targetConfigMatrixFileEnv
|
|
|
3996
4060
|
return base;
|
|
3997
4061
|
}
|
|
3998
4062
|
const normalizedExtensionsFile = extensionsFile.trim();
|
|
3999
|
-
const fileContent =
|
|
4063
|
+
const fileContent = readFileSync10(normalizedExtensionsFile);
|
|
4000
4064
|
const extensions = assertTargetConfigExtensions(JSON.parse(fileContent.toString("utf8")));
|
|
4001
4065
|
const collisions = Object.keys(extensions.targets).filter((target2) => base.targets[target2] !== void 0);
|
|
4002
4066
|
if (collisions.length > 0) {
|
|
@@ -4110,7 +4174,7 @@ function writeEffectiveTargetConfigs(options = {}) {
|
|
|
4110
4174
|
}
|
|
4111
4175
|
return writeEffectiveTargetConfig(target2, config2, outputDir);
|
|
4112
4176
|
});
|
|
4113
|
-
const indexPath =
|
|
4177
|
+
const indexPath = join6(outputDir, "index.json");
|
|
4114
4178
|
const previousArtifacts = readExistingArtifactIndex(indexPath, matrix.version).artifacts;
|
|
4115
4179
|
const artifactsByTarget = new Map(previousArtifacts.filter((artifact) => matrix.targets[artifact.target] !== void 0).map((artifact) => [artifact.target, artifact]));
|
|
4116
4180
|
for (const artifact of artifacts) {
|
|
@@ -4123,17 +4187,17 @@ function writeEffectiveTargetConfigs(options = {}) {
|
|
|
4123
4187
|
const indexContent = `${JSON.stringify(index, null, 2)}
|
|
4124
4188
|
`;
|
|
4125
4189
|
mkdirSync4(dirname5(indexPath), { recursive: true });
|
|
4126
|
-
|
|
4190
|
+
writeFileSync5(indexPath, indexContent);
|
|
4127
4191
|
return index;
|
|
4128
4192
|
}
|
|
4129
4193
|
function readExistingArtifactIndex(path10, version) {
|
|
4130
|
-
if (!
|
|
4194
|
+
if (!existsSync7(path10)) {
|
|
4131
4195
|
return {
|
|
4132
4196
|
version,
|
|
4133
4197
|
artifacts: []
|
|
4134
4198
|
};
|
|
4135
4199
|
}
|
|
4136
|
-
const parsed = JSON.parse(
|
|
4200
|
+
const parsed = JSON.parse(readFileSync11(path10, "utf8"));
|
|
4137
4201
|
if (parsed.version !== version) {
|
|
4138
4202
|
return {
|
|
4139
4203
|
version,
|
|
@@ -4144,11 +4208,11 @@ function readExistingArtifactIndex(path10, version) {
|
|
|
4144
4208
|
}
|
|
4145
4209
|
function writeEffectiveTargetConfig(target2, config2, outputDir) {
|
|
4146
4210
|
assertDeploymentTargetName(target2);
|
|
4147
|
-
const path10 =
|
|
4211
|
+
const path10 = join6(outputDir, `${target2}.json`);
|
|
4148
4212
|
const content = `${JSON.stringify(config2, null, 2)}
|
|
4149
4213
|
`;
|
|
4150
4214
|
mkdirSync4(dirname5(path10), { recursive: true });
|
|
4151
|
-
|
|
4215
|
+
writeFileSync5(path10, content);
|
|
4152
4216
|
return {
|
|
4153
4217
|
target: target2,
|
|
4154
4218
|
path: path10,
|
|
@@ -4241,6 +4305,7 @@ function platformKindForRuntime(runtime) {
|
|
|
4241
4305
|
return "devvit-web";
|
|
4242
4306
|
case "verse8-web":
|
|
4243
4307
|
case "crazygames-web":
|
|
4308
|
+
case "oneplay-web":
|
|
4244
4309
|
return "web";
|
|
4245
4310
|
case "wechat-minigame":
|
|
4246
4311
|
return "wechat-minigame";
|
|
@@ -4266,6 +4331,8 @@ function platformAdapterForRuntime(runtime) {
|
|
|
4266
4331
|
return "verse8";
|
|
4267
4332
|
case "crazygames-web":
|
|
4268
4333
|
return "crazygames";
|
|
4334
|
+
case "oneplay-web":
|
|
4335
|
+
return "oneplay";
|
|
4269
4336
|
case "wechat-minigame":
|
|
4270
4337
|
return "wechat";
|
|
4271
4338
|
case "tiktok-minigame":
|
|
@@ -4281,7 +4348,7 @@ import * as _assertGuard_16 from "typia/lib/internal/_assertGuard";
|
|
|
4281
4348
|
import * as _accessExpressionAsString_16 from "typia/lib/internal/_accessExpressionAsString";
|
|
4282
4349
|
import { execFileSync } from "node:child_process";
|
|
4283
4350
|
import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
|
|
4284
|
-
import { existsSync as
|
|
4351
|
+
import { existsSync as existsSync9, readFileSync as readFileSync13, realpathSync as realpathSync5, renameSync, rmSync as rmSync4, writeFileSync as writeFileSync7 } from "node:fs";
|
|
4285
4352
|
import { isAbsolute as isAbsolute5, relative as relative5, resolve as resolve8 } from "node:path";
|
|
4286
4353
|
import typia6 from "typia";
|
|
4287
4354
|
|
|
@@ -4602,7 +4669,7 @@ function assertReleaseManifest(input) {
|
|
|
4602
4669
|
|
|
4603
4670
|
// node_modules/.cache/mpgd-native-build/tools/target/release-manifest-lock.js
|
|
4604
4671
|
import { randomUUID } from "node:crypto";
|
|
4605
|
-
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";
|
|
4606
4673
|
import path2 from "node:path";
|
|
4607
4674
|
var maximumWaitMs = 3e4;
|
|
4608
4675
|
var pollingIntervalMs = 50;
|
|
@@ -4617,7 +4684,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4617
4684
|
try {
|
|
4618
4685
|
const descriptor = openSync(lockFile, "wx", 384);
|
|
4619
4686
|
try {
|
|
4620
|
-
|
|
4687
|
+
writeFileSync6(descriptor, `${JSON.stringify({ pid: process.pid, token })}
|
|
4621
4688
|
`);
|
|
4622
4689
|
} catch (error) {
|
|
4623
4690
|
unlinkSync(lockFile);
|
|
@@ -4664,8 +4731,8 @@ function withReleaseManifestLock(file, action) {
|
|
|
4664
4731
|
try {
|
|
4665
4732
|
return action();
|
|
4666
4733
|
} finally {
|
|
4667
|
-
if (
|
|
4668
|
-
const contents =
|
|
4734
|
+
if (existsSync8(lockFile)) {
|
|
4735
|
+
const contents = readFileSync12(lockFile, "utf8");
|
|
4669
4736
|
if (contents.includes(token)) {
|
|
4670
4737
|
unlinkSync(lockFile);
|
|
4671
4738
|
}
|
|
@@ -4675,7 +4742,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4675
4742
|
function canRecoverLock(lockFile) {
|
|
4676
4743
|
let record;
|
|
4677
4744
|
try {
|
|
4678
|
-
record = JSON.parse(
|
|
4745
|
+
record = JSON.parse(readFileSync12(lockFile, "utf8"));
|
|
4679
4746
|
} catch {
|
|
4680
4747
|
return Date.now() - statSync(lockFile).mtimeMs > incompleteLockGraceMs;
|
|
4681
4748
|
}
|
|
@@ -4901,14 +4968,14 @@ var assertAdPlacements = /* @__PURE__ */ (() => {
|
|
|
4901
4968
|
path: _path + ".placements",
|
|
4902
4969
|
expected: "ReadonlyArray<AdPlacementEntry>",
|
|
4903
4970
|
value: input.placements
|
|
4904
|
-
}, _errorFactory)) && input.placements.every((elem,
|
|
4971
|
+
}, _errorFactory)) && input.placements.every((elem, _index3) => ("object" === typeof elem && null !== elem || _assertGuard_16._assertGuard(_exceptionable, {
|
|
4905
4972
|
method: "typia.createAssert",
|
|
4906
|
-
path: _path + ".placements[" +
|
|
4973
|
+
path: _path + ".placements[" + _index3 + "]",
|
|
4907
4974
|
expected: _ae0,
|
|
4908
4975
|
value: elem
|
|
4909
|
-
}, _errorFactory)) && _au0(elem, _path + ".placements[" +
|
|
4976
|
+
}, _errorFactory)) && _au0(elem, _path + ".placements[" + _index3 + "]", _exceptionable) || _assertGuard_16._assertGuard(_exceptionable, {
|
|
4910
4977
|
method: "typia.createAssert",
|
|
4911
|
-
path: _path + ".placements[" +
|
|
4978
|
+
path: _path + ".placements[" + _index3 + "]",
|
|
4912
4979
|
expected: _ae0,
|
|
4913
4980
|
value: elem
|
|
4914
4981
|
}, _errorFactory)) || _assertGuard_16._assertGuard(_exceptionable, {
|
|
@@ -4916,6 +4983,21 @@ var assertAdPlacements = /* @__PURE__ */ (() => {
|
|
|
4916
4983
|
path: _path + ".placements",
|
|
4917
4984
|
expected: "ReadonlyArray<AdPlacementEntry>",
|
|
4918
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
|
|
4919
5001
|
}, _errorFactory));
|
|
4920
5002
|
const _ao1 = (input, _path, _exceptionable = true) => _ao2(input, _path, _exceptionable) && (("rewarded" === input.type || _assertGuard_16._assertGuard(_exceptionable, {
|
|
4921
5003
|
method: "typia.createAssert",
|
|
@@ -5045,7 +5127,7 @@ var assertAdPlacements = /* @__PURE__ */ (() => {
|
|
|
5045
5127
|
value: input
|
|
5046
5128
|
}, _errorFactory);
|
|
5047
5129
|
})();
|
|
5048
|
-
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));
|
|
5049
5131
|
const _io1 = (input) => _io2(input) && ("rewarded" === input.type && (void 0 === input.reward || "object" === typeof input.reward && null !== input.reward && _iu1(input.reward)));
|
|
5050
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));
|
|
5051
5133
|
const _io3 = (input) => "number" === typeof input.cooldownSeconds && (void 0 === input.maxPerSession || "number" === typeof input.maxPerSession) && (void 0 === input.minStageInterval || "number" === typeof input.minStageInterval);
|
|
@@ -5224,7 +5306,7 @@ function requirePortableArtifactPath(path10) {
|
|
|
5224
5306
|
}
|
|
5225
5307
|
function readFileBytes(path10) {
|
|
5226
5308
|
try {
|
|
5227
|
-
return
|
|
5309
|
+
return readFileSync13(path10);
|
|
5228
5310
|
} catch (error) {
|
|
5229
5311
|
throw new Error(`Failed to read icon manifest ${path10}: ${formatError5(error)}`);
|
|
5230
5312
|
}
|
|
@@ -5250,7 +5332,7 @@ function writeReleaseManifestWithProvenance(input, provenance) {
|
|
|
5250
5332
|
const manifest = makeEffectiveConfigPathsPortable(mergeManifest(outputPath, nextManifest), platformTargets2.baseDir);
|
|
5251
5333
|
const temporary = `${outputPath}.${randomUUID2()}.tmp`;
|
|
5252
5334
|
try {
|
|
5253
|
-
|
|
5335
|
+
writeFileSync7(temporary, `${JSON.stringify(manifest, null, 2)}
|
|
5254
5336
|
`, { flag: "wx" });
|
|
5255
5337
|
renameSync(temporary, outputPath);
|
|
5256
5338
|
} finally {
|
|
@@ -5260,7 +5342,7 @@ function writeReleaseManifestWithProvenance(input, provenance) {
|
|
|
5260
5342
|
});
|
|
5261
5343
|
}
|
|
5262
5344
|
function mergeManifest(outputPath, nextManifest) {
|
|
5263
|
-
if (!
|
|
5345
|
+
if (!existsSync9(outputPath)) {
|
|
5264
5346
|
return nextManifest;
|
|
5265
5347
|
}
|
|
5266
5348
|
let previous;
|
|
@@ -5477,7 +5559,7 @@ if (process.env.MPGD_NATIVE_PACKAGED_BUILD !== "1" && isCliEntrypoint(import.met
|
|
|
5477
5559
|
}
|
|
5478
5560
|
|
|
5479
5561
|
// node_modules/.cache/mpgd-native-build/tools/target/microsoft-store-pwa.js
|
|
5480
|
-
import { writeFileSync as
|
|
5562
|
+
import { writeFileSync as writeFileSync8 } from "node:fs";
|
|
5481
5563
|
import { resolve as resolve10 } from "node:path";
|
|
5482
5564
|
|
|
5483
5565
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/microsoft-store-pwa-e2e.js
|
|
@@ -5512,7 +5594,7 @@ function requireNonEmptyString(input, label) {
|
|
|
5512
5594
|
|
|
5513
5595
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/microsoft-store-pwa-release.js
|
|
5514
5596
|
import { createHash as createHash5 } from "node:crypto";
|
|
5515
|
-
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";
|
|
5516
5598
|
import { relative as relative6, resolve as resolve9, sep as sep3 } from "node:path";
|
|
5517
5599
|
function assertMicrosoftStorePwaProvenance(input) {
|
|
5518
5600
|
return {
|
|
@@ -5697,7 +5779,7 @@ function listPrecacheEntries(artifactRoot) {
|
|
|
5697
5779
|
}
|
|
5698
5780
|
return files.filter((path10) => !path10.endsWith(".map") && !path10.endsWith(`${sep3}pwa-release.json`) && !path10.endsWith(`${sep3}service-worker.js`)).map((path10) => ({
|
|
5699
5781
|
url: toPrecacheUrl(artifactRoot, path10),
|
|
5700
|
-
source:
|
|
5782
|
+
source: readFileSync14(path10)
|
|
5701
5783
|
})).sort((left, right) => compareCodeUnits(left.url, right.url));
|
|
5702
5784
|
}
|
|
5703
5785
|
function normalizePrecacheEntries(entries) {
|
|
@@ -5781,9 +5863,9 @@ function writeMicrosoftStorePwaArtifacts(input) {
|
|
|
5781
5863
|
revision,
|
|
5782
5864
|
precacheUrls
|
|
5783
5865
|
});
|
|
5784
|
-
|
|
5866
|
+
writeFileSync8(`${artifactRoot}/pwa-release.json`, `${JSON.stringify(evidence, null, 2)}
|
|
5785
5867
|
`);
|
|
5786
|
-
|
|
5868
|
+
writeFileSync8(`${artifactRoot}/service-worker.js`, createMicrosoftStorePwaServiceWorker(evidence));
|
|
5787
5869
|
return evidence;
|
|
5788
5870
|
}
|
|
5789
5871
|
function compareCodeUnits2(left, right) {
|
|
@@ -5798,8 +5880,8 @@ function readPwaId(input) {
|
|
|
5798
5880
|
|
|
5799
5881
|
// node_modules/.cache/mpgd-native-build/tools/target/minigame-artifact.js
|
|
5800
5882
|
import { createHash as createHash6 } from "node:crypto";
|
|
5801
|
-
import { copyFileSync as copyFileSync2, cpSync as cpSync2, existsSync as
|
|
5802
|
-
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";
|
|
5803
5885
|
import { parse } from "acorn";
|
|
5804
5886
|
var miniGameArtifactEvidenceFileName = "mpgd-minigame-artifact.json";
|
|
5805
5887
|
var miniGameEffectiveTargetConfigFileName = "mpgd-effective-target-config.json";
|
|
@@ -5863,14 +5945,14 @@ function assembleMiniGameArtifact(input) {
|
|
|
5863
5945
|
assertMiniGameArtifactOutputDirectory(artifactRoot, input.projectRoot);
|
|
5864
5946
|
const artifactParent = dirname6(artifactRoot);
|
|
5865
5947
|
mkdirSync6(artifactParent, { recursive: true });
|
|
5866
|
-
const stagingRoot = mkdtempSync(
|
|
5948
|
+
const stagingRoot = mkdtempSync(join7(artifactParent, `.${basename3(artifactRoot)}-staging-`));
|
|
5867
5949
|
let projectFilesRoot;
|
|
5868
5950
|
const stagingInput = { ...input, artifactRoot: stagingRoot };
|
|
5869
5951
|
try {
|
|
5870
|
-
projectFilesRoot = mkdtempSync(
|
|
5952
|
+
projectFilesRoot = mkdtempSync(join7(artifactParent, `.${basename3(artifactRoot)}-project-files-`));
|
|
5871
5953
|
copyMiniGameBundleOutput(input.runtimeBundleRoot, stagingRoot);
|
|
5872
5954
|
copyMiniGameBundleOutput(input.gameBundleRoot, stagingRoot);
|
|
5873
|
-
copyMiniGameArtifactFile(input.effectiveTargetConfigSource,
|
|
5955
|
+
copyMiniGameArtifactFile(input.effectiveTargetConfigSource, join7(stagingRoot, miniGameEffectiveTargetConfigFileName), miniGameEffectiveTargetConfigFileName);
|
|
5874
5956
|
stageMiniGameIconEvidence(input.generatedIcons, stagingRoot);
|
|
5875
5957
|
input.writeProjectFiles(projectFilesRoot);
|
|
5876
5958
|
copyMiniGameBundleOutput(projectFilesRoot, stagingRoot);
|
|
@@ -5903,7 +5985,7 @@ function assertMiniGameArtifactOutputDirectory(artifactRoot, projectRoot) {
|
|
|
5903
5985
|
assertMiniGameArtifactRelativePath(portableProjectRelativePath, "Mini-game artifact output");
|
|
5904
5986
|
let candidate = artifact;
|
|
5905
5987
|
while (candidate !== project) {
|
|
5906
|
-
if (
|
|
5988
|
+
if (existsSync11(candidate)) {
|
|
5907
5989
|
const status = lstatSync7(candidate);
|
|
5908
5990
|
if (status.isSymbolicLink()) {
|
|
5909
5991
|
throw new Error("Mini-game artifact output must not traverse a symbolic link: " + candidate);
|
|
@@ -5961,16 +6043,16 @@ function assertDisjointMiniGameTargetOutputs(targets, resolvePath, protectedOutp
|
|
|
5961
6043
|
}
|
|
5962
6044
|
function writeMiniGameArtifactEvidence(input) {
|
|
5963
6045
|
const artifactRoot = resolve11(input.artifactRoot);
|
|
5964
|
-
const evidencePath =
|
|
6046
|
+
const evidencePath = join7(artifactRoot, miniGameArtifactEvidenceFileName);
|
|
5965
6047
|
rmSync5(evidencePath, { force: true });
|
|
5966
6048
|
const files = listMiniGameArtifactFiles(artifactRoot).map((file) => ({
|
|
5967
6049
|
path: file.path,
|
|
5968
6050
|
size: file.bytes,
|
|
5969
|
-
sha256: sha2563(
|
|
6051
|
+
sha256: sha2563(readFileSync15(join7(artifactRoot, file.path)))
|
|
5970
6052
|
}));
|
|
5971
6053
|
const effectiveTargetConfig = requireEvidenceFile(artifactRoot, files, miniGameEffectiveTargetConfigFileName);
|
|
5972
6054
|
const iconManifest = requireEvidenceFile(artifactRoot, files, miniGameIconManifestFileName);
|
|
5973
|
-
const gameConfig = readJson(
|
|
6055
|
+
const gameConfig = readJson(join7(artifactRoot, "game.json"), "Mini-game game.json");
|
|
5974
6056
|
let packageSize = assertMiniGamePackageBudget({
|
|
5975
6057
|
artifactRoot,
|
|
5976
6058
|
gameConfig,
|
|
@@ -5980,7 +6062,7 @@ function writeMiniGameArtifactEvidence(input) {
|
|
|
5980
6062
|
for (let attempt = 0; attempt < 10; attempt += 1) {
|
|
5981
6063
|
const serialized = `${JSON.stringify(evidence, null, 2)}
|
|
5982
6064
|
`;
|
|
5983
|
-
|
|
6065
|
+
writeFileSync9(evidencePath, serialized);
|
|
5984
6066
|
packageSize = assertMiniGamePackageBudget({
|
|
5985
6067
|
artifactRoot,
|
|
5986
6068
|
gameConfig,
|
|
@@ -5998,7 +6080,7 @@ function writeMiniGameArtifactEvidence(input) {
|
|
|
5998
6080
|
}
|
|
5999
6081
|
function verifyMiniGameArtifactEvidence(input) {
|
|
6000
6082
|
const artifactRoot = resolve11(input.artifactRoot);
|
|
6001
|
-
const evidencePath =
|
|
6083
|
+
const evidencePath = join7(artifactRoot, miniGameArtifactEvidenceFileName);
|
|
6002
6084
|
const parsed = readJson(evidencePath, "Mini-game artifact evidence");
|
|
6003
6085
|
const evidence = assertMiniGameArtifactEvidenceShape(parsed);
|
|
6004
6086
|
for (const [field, expected] of [
|
|
@@ -6029,7 +6111,7 @@ function verifyMiniGameArtifactEvidence(input) {
|
|
|
6029
6111
|
if (actual === void 0 || actual.bytes !== file.size) {
|
|
6030
6112
|
throw new Error(`Mini-game artifact evidence size mismatch: ${file.path}`);
|
|
6031
6113
|
}
|
|
6032
|
-
if (sha2563(
|
|
6114
|
+
if (sha2563(readFileSync15(join7(artifactRoot, file.path))) !== file.sha256) {
|
|
6033
6115
|
throw new Error(`Mini-game artifact evidence digest mismatch: ${file.path}`);
|
|
6034
6116
|
}
|
|
6035
6117
|
}
|
|
@@ -6037,7 +6119,7 @@ function verifyMiniGameArtifactEvidence(input) {
|
|
|
6037
6119
|
verifyNamedDigest(artifactRoot, evidence.iconManifest, miniGameIconManifestFileName, "icon manifest");
|
|
6038
6120
|
const packageSize = assertMiniGamePackageBudget({
|
|
6039
6121
|
artifactRoot,
|
|
6040
|
-
gameConfig: readJson(
|
|
6122
|
+
gameConfig: readJson(join7(artifactRoot, "game.json"), "Mini-game game.json"),
|
|
6041
6123
|
budget: input.budget
|
|
6042
6124
|
});
|
|
6043
6125
|
if (JSON.stringify(packageSize) !== JSON.stringify(evidence.packageSize)) {
|
|
@@ -6050,14 +6132,14 @@ function stageMiniGameIconEvidence(generated, artifactRoot) {
|
|
|
6050
6132
|
const files = [
|
|
6051
6133
|
{
|
|
6052
6134
|
source: generated.manifestPath,
|
|
6053
|
-
destination:
|
|
6135
|
+
destination: join7(artifactRoot, miniGameIconManifestFileName),
|
|
6054
6136
|
relativePath: miniGameIconManifestFileName
|
|
6055
6137
|
},
|
|
6056
6138
|
...generated.manifest.outputs.map((output) => {
|
|
6057
6139
|
assertMiniGameArtifactRelativePath(output.path, "Mini-game icon output");
|
|
6058
6140
|
return {
|
|
6059
|
-
source:
|
|
6060
|
-
destination:
|
|
6141
|
+
source: join7(generated.outputDir, basename3(output.path)),
|
|
6142
|
+
destination: join7(artifactRoot, output.path),
|
|
6061
6143
|
relativePath: output.path
|
|
6062
6144
|
};
|
|
6063
6145
|
})
|
|
@@ -6069,7 +6151,7 @@ function stageMiniGameIconEvidence(generated, artifactRoot) {
|
|
|
6069
6151
|
throw new Error(`Mini-game icon outputs collide at ${file.relativePath}.`);
|
|
6070
6152
|
}
|
|
6071
6153
|
plannedPaths.add(comparisonKey);
|
|
6072
|
-
if (
|
|
6154
|
+
if (existsSync11(file.destination)) {
|
|
6073
6155
|
throw new Error(`Mini-game artifact files collide at ${file.relativePath}.`);
|
|
6074
6156
|
}
|
|
6075
6157
|
}
|
|
@@ -6078,7 +6160,7 @@ function stageMiniGameIconEvidence(generated, artifactRoot) {
|
|
|
6078
6160
|
}
|
|
6079
6161
|
}
|
|
6080
6162
|
function copyMiniGameArtifactFile(source, destination, relativePath) {
|
|
6081
|
-
if (
|
|
6163
|
+
if (existsSync11(destination)) {
|
|
6082
6164
|
throw new Error(`Mini-game artifact files collide at ${relativePath}.`);
|
|
6083
6165
|
}
|
|
6084
6166
|
mkdirSync6(dirname6(destination), { recursive: true });
|
|
@@ -6088,7 +6170,7 @@ function configuredNonMiniGameOutputs(targets, resolvePath) {
|
|
|
6088
6170
|
return Object.entries(targets).flatMap(([name, target2]) => {
|
|
6089
6171
|
const viteOutput = {
|
|
6090
6172
|
name: `${name} Vite output`,
|
|
6091
|
-
path: resolvePath(
|
|
6173
|
+
path: resolvePath(join7(target2.gameApp, "dist"))
|
|
6092
6174
|
};
|
|
6093
6175
|
switch (target2.kind) {
|
|
6094
6176
|
case "web":
|
|
@@ -6110,7 +6192,7 @@ function configuredNonMiniGameOutputs(targets, resolvePath) {
|
|
|
6110
6192
|
{ name: `${name} web staging output`, path: resolvePath(target2.webDir) },
|
|
6111
6193
|
{
|
|
6112
6194
|
name: `${name} wrapper build output`,
|
|
6113
|
-
path: resolvePath(
|
|
6195
|
+
path: resolvePath(join7(target2.wrapperApp, "dist"))
|
|
6114
6196
|
}
|
|
6115
6197
|
];
|
|
6116
6198
|
case "wechat-minigame":
|
|
@@ -6136,7 +6218,7 @@ function canonicalizeThroughExistingAncestor2(path10) {
|
|
|
6136
6218
|
const normalizedPath = resolve11(path10);
|
|
6137
6219
|
const suffix = [];
|
|
6138
6220
|
let existingAncestor = normalizedPath;
|
|
6139
|
-
while (!
|
|
6221
|
+
while (!existsSync11(existingAncestor)) {
|
|
6140
6222
|
const parent = dirname6(existingAncestor);
|
|
6141
6223
|
if (parent === existingAncestor) {
|
|
6142
6224
|
throw new Error(`Cannot resolve an existing ancestor for mini-game output: ${path10}`);
|
|
@@ -6148,15 +6230,15 @@ function canonicalizeThroughExistingAncestor2(path10) {
|
|
|
6148
6230
|
}
|
|
6149
6231
|
function copyMiniGameBundleOutput(sourceRoot, artifactRoot) {
|
|
6150
6232
|
const source = resolve11(sourceRoot);
|
|
6151
|
-
if (!
|
|
6233
|
+
if (!existsSync11(source)) {
|
|
6152
6234
|
throw new Error(`Mini-game bundle output does not exist: ${source}`);
|
|
6153
6235
|
}
|
|
6154
6236
|
for (const entry of readdirSync5(source)) {
|
|
6155
|
-
const destination =
|
|
6156
|
-
if (
|
|
6237
|
+
const destination = join7(artifactRoot, entry);
|
|
6238
|
+
if (existsSync11(destination)) {
|
|
6157
6239
|
throw new Error(`Mini-game bundle outputs collide at ${entry}.`);
|
|
6158
6240
|
}
|
|
6159
|
-
cpSync2(
|
|
6241
|
+
cpSync2(join7(source, entry), destination, {
|
|
6160
6242
|
recursive: true,
|
|
6161
6243
|
errorOnExist: true,
|
|
6162
6244
|
force: false
|
|
@@ -6165,8 +6247,8 @@ function copyMiniGameBundleOutput(sourceRoot, artifactRoot) {
|
|
|
6165
6247
|
}
|
|
6166
6248
|
function replaceMiniGameArtifact(stagingRoot, artifactRoot) {
|
|
6167
6249
|
let backupRoot;
|
|
6168
|
-
if (
|
|
6169
|
-
backupRoot = mkdtempSync(
|
|
6250
|
+
if (existsSync11(artifactRoot)) {
|
|
6251
|
+
backupRoot = mkdtempSync(join7(dirname6(artifactRoot), `.${basename3(artifactRoot)}-backup-`));
|
|
6170
6252
|
rmSync5(backupRoot, { force: true, recursive: true });
|
|
6171
6253
|
renameSync2(artifactRoot, backupRoot);
|
|
6172
6254
|
}
|
|
@@ -6206,11 +6288,11 @@ function assertMiniGameRequiredFiles(artifactRoot) {
|
|
|
6206
6288
|
miniGameEffectiveTargetConfigFileName,
|
|
6207
6289
|
miniGameIconManifestFileName
|
|
6208
6290
|
]) {
|
|
6209
|
-
if (!
|
|
6291
|
+
if (!existsSync11(join7(artifactRoot, file))) {
|
|
6210
6292
|
throw new Error(`Mini-game artifact is missing required file: ${file}`);
|
|
6211
6293
|
}
|
|
6212
6294
|
}
|
|
6213
|
-
const entry =
|
|
6295
|
+
const entry = readFileSync15(join7(artifactRoot, "game.js"), "utf8");
|
|
6214
6296
|
if (entry !== "require('./runtime.js');\nrequire('./game.bundle.js');\n") {
|
|
6215
6297
|
throw new Error("Mini-game game.js must load runtime.js before game.bundle.js.");
|
|
6216
6298
|
}
|
|
@@ -6220,7 +6302,7 @@ function assertMiniGameJavaScriptSafety(artifactRoot, forbiddenMarkers, forbidde
|
|
|
6220
6302
|
const gameOwnedGlobals = new Set(forbiddenGameBundleGlobals);
|
|
6221
6303
|
const noForbiddenGlobals = /* @__PURE__ */ new Set();
|
|
6222
6304
|
for (const file of javascript) {
|
|
6223
|
-
const source =
|
|
6305
|
+
const source = readFileSync15(join7(artifactRoot, file.path), "utf8");
|
|
6224
6306
|
assertMiniGameJavaScriptAstSafety(source, file.path, file.path === "runtime.js" ? noForbiddenGlobals : gameOwnedGlobals);
|
|
6225
6307
|
for (const { pattern, label } of forbiddenJavaScriptPatterns) {
|
|
6226
6308
|
if (pattern.test(source)) {
|
|
@@ -8229,7 +8311,7 @@ function createEvidence(input, files, effectiveTargetConfig, iconManifest, packa
|
|
|
8229
8311
|
}
|
|
8230
8312
|
function requireEvidenceFile(artifactRoot, files, path10) {
|
|
8231
8313
|
const file = files.find((candidate) => candidate.path === path10);
|
|
8232
|
-
if (file === void 0 || !
|
|
8314
|
+
if (file === void 0 || !existsSync11(join7(artifactRoot, path10))) {
|
|
8233
8315
|
throw new Error(`Mini-game artifact is missing required evidence file: ${path10}`);
|
|
8234
8316
|
}
|
|
8235
8317
|
return file;
|
|
@@ -8299,14 +8381,14 @@ function verifyNamedDigest(artifactRoot, reference, expectedPath, label) {
|
|
|
8299
8381
|
if (reference.path !== expectedPath) {
|
|
8300
8382
|
throw new Error(`Mini-game artifact ${label} path mismatch.`);
|
|
8301
8383
|
}
|
|
8302
|
-
const digest = sha2563(
|
|
8384
|
+
const digest = sha2563(readFileSync15(join7(artifactRoot, reference.path)));
|
|
8303
8385
|
if (digest !== reference.sha256) {
|
|
8304
8386
|
throw new Error(`Mini-game artifact ${label} digest mismatch.`);
|
|
8305
8387
|
}
|
|
8306
8388
|
}
|
|
8307
8389
|
function readJson(path10, label) {
|
|
8308
8390
|
try {
|
|
8309
|
-
return JSON.parse(
|
|
8391
|
+
return JSON.parse(readFileSync15(path10, "utf8"));
|
|
8310
8392
|
} catch (error) {
|
|
8311
8393
|
throw new Error(`${label} is unreadable: ${formatError6(error)}`);
|
|
8312
8394
|
}
|
|
@@ -8339,17 +8421,17 @@ function formatError6(error) {
|
|
|
8339
8421
|
}
|
|
8340
8422
|
|
|
8341
8423
|
// node_modules/.cache/mpgd-native-build/tools/target/minigame-project-files.js
|
|
8342
|
-
import { mkdirSync as mkdirSync7, writeFileSync as
|
|
8343
|
-
import { join as
|
|
8424
|
+
import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync10 } from "node:fs";
|
|
8425
|
+
import { join as join8 } from "node:path";
|
|
8344
8426
|
var wechatStagingAppId2 = "wx0000000000000000";
|
|
8345
8427
|
function writeWechatMiniGameProjectFiles(input) {
|
|
8346
8428
|
assertWechatAppId(input.appId, input.production);
|
|
8347
8429
|
mkdirSync7(input.artifactRoot, { recursive: true });
|
|
8348
|
-
|
|
8349
|
-
writeJson(
|
|
8430
|
+
writeFileSync10(join8(input.artifactRoot, "game.js"), "require('./runtime.js');\nrequire('./game.bundle.js');\n");
|
|
8431
|
+
writeJson(join8(input.artifactRoot, "game.json"), {
|
|
8350
8432
|
deviceOrientation: input.orientation
|
|
8351
8433
|
});
|
|
8352
|
-
writeJson(
|
|
8434
|
+
writeJson(join8(input.artifactRoot, "project.config.json"), {
|
|
8353
8435
|
description: "Experimental mpgd Phaser Canvas Mini Game validation build.",
|
|
8354
8436
|
setting: {
|
|
8355
8437
|
urlCheck: input.production,
|
|
@@ -8374,12 +8456,12 @@ function assertWechatAppId(appId, production) {
|
|
|
8374
8456
|
}
|
|
8375
8457
|
}
|
|
8376
8458
|
function writeJson(path10, input) {
|
|
8377
|
-
|
|
8459
|
+
writeFileSync10(path10, `${JSON.stringify(input, null, 2)}
|
|
8378
8460
|
`);
|
|
8379
8461
|
}
|
|
8380
8462
|
|
|
8381
8463
|
// node_modules/.cache/mpgd-native-build/tools/target/monetization-catalog-env.js
|
|
8382
|
-
import { existsSync as
|
|
8464
|
+
import { existsSync as existsSync12 } from "node:fs";
|
|
8383
8465
|
import { isAbsolute as isAbsolute7, resolve as resolve12 } from "node:path";
|
|
8384
8466
|
function normalizeMonetizationCatalogEnv(baseEnv, fallbackBaseDir = process.cwd()) {
|
|
8385
8467
|
const configuredFiles = configuredMonetizationCatalogFilePaths(baseEnv);
|
|
@@ -8408,12 +8490,12 @@ function resolveConfiguredBaseDir(baseEnv, fallbackBaseDir, productCatalogFile,
|
|
|
8408
8490
|
return fallbackBaseDir;
|
|
8409
8491
|
}
|
|
8410
8492
|
function configuredFileExists(baseDir, file) {
|
|
8411
|
-
return
|
|
8493
|
+
return existsSync12(isAbsolute7(file) ? file : resolve12(baseDir, file));
|
|
8412
8494
|
}
|
|
8413
8495
|
|
|
8414
8496
|
// node_modules/.cache/mpgd-native-build/tools/target/native-build-attempt.js
|
|
8415
8497
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
8416
|
-
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";
|
|
8417
8499
|
import path3 from "node:path";
|
|
8418
8500
|
function nativeBuildAttemptPath(gameRoot, target2) {
|
|
8419
8501
|
assertDeploymentTargetName(target2);
|
|
@@ -8421,10 +8503,10 @@ function nativeBuildAttemptPath(gameRoot, target2) {
|
|
|
8421
8503
|
}
|
|
8422
8504
|
function readNativeBuildAttempt(gameRoot, target2) {
|
|
8423
8505
|
const file = nativeBuildAttemptPath(gameRoot, target2);
|
|
8424
|
-
if (!
|
|
8506
|
+
if (!existsSync13(file)) {
|
|
8425
8507
|
return void 0;
|
|
8426
8508
|
}
|
|
8427
|
-
const parsed = JSON.parse(
|
|
8509
|
+
const parsed = JSON.parse(readFileSync16(file, "utf8"));
|
|
8428
8510
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
8429
8511
|
throw new Error("Native build status must be an object.");
|
|
8430
8512
|
}
|
|
@@ -8473,7 +8555,7 @@ function writeRecord(file, record) {
|
|
|
8473
8555
|
mkdirSync8(path3.dirname(file), { recursive: true });
|
|
8474
8556
|
const temporary = `${file}.${randomUUID3()}.tmp`;
|
|
8475
8557
|
try {
|
|
8476
|
-
|
|
8558
|
+
writeFileSync11(temporary, `${JSON.stringify(record, null, 2)}
|
|
8477
8559
|
`, { flag: "wx" });
|
|
8478
8560
|
renameSync3(temporary, file);
|
|
8479
8561
|
} finally {
|
|
@@ -8490,13 +8572,13 @@ function isProcessAlive(pid) {
|
|
|
8490
8572
|
}
|
|
8491
8573
|
|
|
8492
8574
|
// node_modules/.cache/mpgd-native-build/tools/target/native-build-execution.js
|
|
8493
|
-
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";
|
|
8494
8576
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
8495
|
-
import { dirname as dirname8, isAbsolute as isAbsolute9, join as
|
|
8577
|
+
import { dirname as dirname8, isAbsolute as isAbsolute9, join as join10 } from "node:path";
|
|
8496
8578
|
|
|
8497
8579
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/ios-signing-session.js
|
|
8498
8580
|
import { createHash as createHash8, randomBytes } from "node:crypto";
|
|
8499
|
-
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";
|
|
8500
8582
|
import { tmpdir } from "node:os";
|
|
8501
8583
|
import path4 from "node:path";
|
|
8502
8584
|
import { fileURLToPath } from "node:url";
|
|
@@ -8844,7 +8926,7 @@ async function prepareIosSigningSession(input) {
|
|
|
8844
8926
|
mode: 448
|
|
8845
8927
|
});
|
|
8846
8928
|
const helper = path4.join(path4.dirname(fileURLToPath(import.meta.url)), "ios-keychain-import.swift");
|
|
8847
|
-
if (!
|
|
8929
|
+
if (!existsSync14(helper)) {
|
|
8848
8930
|
throw new Error("The installed CLI is missing its iOS signing helper.");
|
|
8849
8931
|
}
|
|
8850
8932
|
const imported = await runReleaseProcess({
|
|
@@ -8916,15 +8998,15 @@ async function prepareIosSigningSession(input) {
|
|
|
8916
8998
|
timeoutMs: 3e4,
|
|
8917
8999
|
signal: input.signal
|
|
8918
9000
|
});
|
|
8919
|
-
const profile2 = inspectIosDistributionProfile(parseIosProfilePlist(
|
|
9001
|
+
const profile2 = inspectIosDistributionProfile(parseIosProfilePlist(readFileSync17(decodedXml, "utf8")), { bundleId: input.bundleId, teamId: input.teamId, certificateSha256 });
|
|
8920
9002
|
const profileDirectory = path4.join(ownedRoot, "Library", "Developer", "Xcode", "UserData", "Provisioning Profiles");
|
|
8921
9003
|
mkdirSync9(profileDirectory, { recursive: true, mode: 448 });
|
|
8922
9004
|
const destination = path4.join(profileDirectory, `${profile2.uuid}.mobileprovision`);
|
|
8923
9005
|
if (isSymlink(destination)) {
|
|
8924
9006
|
throw new Error("The iOS provisioning profile destination must not be a symlink.");
|
|
8925
9007
|
}
|
|
8926
|
-
if (
|
|
8927
|
-
if (!
|
|
9008
|
+
if (existsSync14(destination)) {
|
|
9009
|
+
if (!readFileSync17(destination).equals(readFileSync17(profileFile))) {
|
|
8928
9010
|
throw new Error("An existing iOS provisioning profile has the same UUID but different bytes.");
|
|
8929
9011
|
}
|
|
8930
9012
|
} else {
|
|
@@ -8933,7 +9015,7 @@ async function prepareIosSigningSession(input) {
|
|
|
8933
9015
|
installedProfile = { path: destination, sha256: profileSha256 };
|
|
8934
9016
|
chmodSync(destination, 384);
|
|
8935
9017
|
}
|
|
8936
|
-
|
|
9018
|
+
writeFileSync12(exportOptionsPlist, exportPlist(input.teamId, input.bundleId, profile2.uuid, certificateSha1), { mode: 384, flag: "wx" });
|
|
8937
9019
|
environment.MPGD_IOS_PROVISIONING_PROFILE_SPECIFIER = profile2.uuid;
|
|
8938
9020
|
environment.MPGD_IOS_SIGNING_IDENTITY = certificateSha1;
|
|
8939
9021
|
environment.MPGD_IOS_SIGNING_KEYCHAIN = keychainFile;
|
|
@@ -8986,7 +9068,7 @@ function removeOwnedSigningMaterial(root, profile2) {
|
|
|
8986
9068
|
const errors = [];
|
|
8987
9069
|
if (profile2 !== void 0) {
|
|
8988
9070
|
try {
|
|
8989
|
-
if (
|
|
9071
|
+
if (existsSync14(profile2.path) || isSymlink(profile2.path)) {
|
|
8990
9072
|
if (isSymlink(profile2.path) || fileDigest(profile2.path) !== profile2.sha256) {
|
|
8991
9073
|
throw new Error("Owned iOS provisioning profile changed before cleanup.");
|
|
8992
9074
|
}
|
|
@@ -9009,7 +9091,7 @@ function removeOwnedSigningMaterial(root, profile2) {
|
|
|
9009
9091
|
}
|
|
9010
9092
|
}
|
|
9011
9093
|
function fileDigest(file) {
|
|
9012
|
-
return createHash8("sha256").update(
|
|
9094
|
+
return createHash8("sha256").update(readFileSync17(file)).digest("hex");
|
|
9013
9095
|
}
|
|
9014
9096
|
function requiredCredentialFile(file, label) {
|
|
9015
9097
|
const absolute = path4.resolve(file);
|
|
@@ -9045,7 +9127,7 @@ function exportPlist(teamId, bundleId, profileUuid, certificateSha1) {
|
|
|
9045
9127
|
|
|
9046
9128
|
// node_modules/.cache/mpgd-native-build/tools/target/native-android-inspection.js
|
|
9047
9129
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
9048
|
-
import { existsSync as
|
|
9130
|
+
import { existsSync as existsSync15, statSync as statSync3 } from "node:fs";
|
|
9049
9131
|
|
|
9050
9132
|
// node_modules/.cache/mpgd-native-build/tools/target/native-inspection-environment.js
|
|
9051
9133
|
var allowedInspectionEnvironmentNames = [
|
|
@@ -9081,10 +9163,10 @@ function nativeInspectionEnvironment(source = process.env) {
|
|
|
9081
9163
|
|
|
9082
9164
|
// node_modules/.cache/mpgd-native-build/tools/target/native-android-inspection.js
|
|
9083
9165
|
function inspectSignedAndroidBundle(input) {
|
|
9084
|
-
if (!
|
|
9166
|
+
if (!existsSync15(input.bundle) || !statSync3(input.bundle).isFile()) {
|
|
9085
9167
|
throw new Error("Signed Android app bundle is missing.");
|
|
9086
9168
|
}
|
|
9087
|
-
if (input.bundletoolJar !== void 0 && !
|
|
9169
|
+
if (input.bundletoolJar !== void 0 && !existsSync15(input.bundletoolJar)) {
|
|
9088
9170
|
throw new Error("Configured bundletool JAR is missing.");
|
|
9089
9171
|
}
|
|
9090
9172
|
const runner = input.runner ?? { run: runCommand };
|
|
@@ -9173,7 +9255,7 @@ function runCommand(command, args) {
|
|
|
9173
9255
|
|
|
9174
9256
|
// node_modules/.cache/mpgd-native-build/tools/target/native-build-stage.js
|
|
9175
9257
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
9176
|
-
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";
|
|
9177
9259
|
import path5 from "node:path";
|
|
9178
9260
|
function createNativeShellStage(input) {
|
|
9179
9261
|
const sourceShell = realpathSync7(input.shellApp);
|
|
@@ -9200,11 +9282,11 @@ function createNativeShellStage(input) {
|
|
|
9200
9282
|
}
|
|
9201
9283
|
}
|
|
9202
9284
|
}
|
|
9203
|
-
if (
|
|
9285
|
+
if (existsSync16(sourceWeb) && !lstatSync9(sourceWeb).isDirectory()) {
|
|
9204
9286
|
throw new Error("Native web directory must be a directory when it exists.");
|
|
9205
9287
|
}
|
|
9206
9288
|
const stage = path5.join(path5.dirname(sourceShell), `.mpgd-native-stage-${randomUUID4()}`);
|
|
9207
|
-
if (
|
|
9289
|
+
if (existsSync16(stage)) {
|
|
9208
9290
|
throw new Error("Native staging path already exists.");
|
|
9209
9291
|
}
|
|
9210
9292
|
try {
|
|
@@ -9237,7 +9319,7 @@ function createNativeShellStage(input) {
|
|
|
9237
9319
|
}
|
|
9238
9320
|
|
|
9239
9321
|
// node_modules/.cache/mpgd-native-build/tools/target/native-shell-csp.js
|
|
9240
|
-
import { existsSync as
|
|
9322
|
+
import { existsSync as existsSync17, lstatSync as lstatSync10, readFileSync as readFileSync18, writeFileSync as writeFileSync13 } from "node:fs";
|
|
9241
9323
|
import path6 from "node:path";
|
|
9242
9324
|
var capacitorShellContentSecurityPolicy = [
|
|
9243
9325
|
"default-src 'self'",
|
|
@@ -9283,26 +9365,26 @@ ${capacitorShellCspMetaTag}${html.slice(insertAt)}`;
|
|
|
9283
9365
|
}
|
|
9284
9366
|
function applyCapacitorShellCsp(webDir) {
|
|
9285
9367
|
const indexFile = path6.join(webDir, "index.html");
|
|
9286
|
-
if (!
|
|
9368
|
+
if (!existsSync17(indexFile) || lstatSync10(indexFile).isSymbolicLink()) {
|
|
9287
9369
|
throw new Error("Capacitor shell web bundle must contain a regular index.html.");
|
|
9288
9370
|
}
|
|
9289
|
-
const html =
|
|
9371
|
+
const html = readFileSync18(indexFile, "utf8");
|
|
9290
9372
|
const hardened = injectCapacitorShellCsp(html);
|
|
9291
9373
|
if (hardened !== html) {
|
|
9292
|
-
|
|
9374
|
+
writeFileSync13(indexFile, hardened);
|
|
9293
9375
|
}
|
|
9294
9376
|
}
|
|
9295
9377
|
|
|
9296
9378
|
// node_modules/.cache/mpgd-native-build/tools/target/native-ios-inspection.js
|
|
9297
9379
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
9298
|
-
import { existsSync as
|
|
9380
|
+
import { existsSync as existsSync18, mkdtempSync as mkdtempSync3, readFileSync as readFileSync19, rmSync as rmSync9, statSync as statSync4 } from "node:fs";
|
|
9299
9381
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
9300
9382
|
import path7 from "node:path";
|
|
9301
9383
|
function inspectSignedIosArchive(archive, input) {
|
|
9302
9384
|
return inspectSignedIosApplication(path7.join(archive, "Products/Applications/App.app"), input);
|
|
9303
9385
|
}
|
|
9304
9386
|
function inspectSignedIosIpa(ipa, input) {
|
|
9305
|
-
if (!
|
|
9387
|
+
if (!existsSync18(ipa) || !statSync4(ipa).isFile()) {
|
|
9306
9388
|
throw new Error("iOS store IPA is missing.");
|
|
9307
9389
|
}
|
|
9308
9390
|
const runner = input.runner ?? { run: runCommand2 };
|
|
@@ -9332,10 +9414,10 @@ function inspectSignedIosIpa(ipa, input) {
|
|
|
9332
9414
|
}
|
|
9333
9415
|
function inspectSignedIosApplication(appPath, input) {
|
|
9334
9416
|
const plist = path7.join(appPath, "Info.plist");
|
|
9335
|
-
if (!
|
|
9417
|
+
if (!existsSync18(plist) || !statSync4(plist).isFile()) {
|
|
9336
9418
|
throw new Error("Signed iOS app manifest is missing.");
|
|
9337
9419
|
}
|
|
9338
|
-
if (!
|
|
9420
|
+
if (!existsSync18(path7.join(appPath, "Assets.car")) || existsSync18(path7.join(appPath, "Info-Smoke.plist"))) {
|
|
9339
9421
|
throw new Error("Signed iOS app contains smoke assets or omits release icons.");
|
|
9340
9422
|
}
|
|
9341
9423
|
const runner = input.runner ?? { run: runCommand2 };
|
|
@@ -9366,18 +9448,18 @@ ${signingInfo.stderr}`;
|
|
|
9366
9448
|
path7.join(appPath, "capacitor.config.json"),
|
|
9367
9449
|
path7.join(appPath, "public/capacitor.config.json")
|
|
9368
9450
|
];
|
|
9369
|
-
if (!configFiles.some((file) =>
|
|
9451
|
+
if (!configFiles.some((file) => existsSync18(file))) {
|
|
9370
9452
|
throw new Error("Signed iOS app Capacitor configuration is missing.");
|
|
9371
9453
|
}
|
|
9372
9454
|
for (const configFile of configFiles) {
|
|
9373
|
-
if (
|
|
9455
|
+
if (existsSync18(configFile)) {
|
|
9374
9456
|
assertNoDebugServer(configFile);
|
|
9375
9457
|
}
|
|
9376
9458
|
}
|
|
9377
9459
|
return { ...observed, teamId: input.expectedTeamId, signed: true };
|
|
9378
9460
|
}
|
|
9379
9461
|
function assertNoDebugServer(file) {
|
|
9380
|
-
const value = JSON.parse(
|
|
9462
|
+
const value = JSON.parse(readFileSync19(file, "utf8"));
|
|
9381
9463
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
9382
9464
|
throw new Error("Signed iOS app has malformed Capacitor configuration.");
|
|
9383
9465
|
}
|
|
@@ -9406,7 +9488,7 @@ function runCommand2(command, args) {
|
|
|
9406
9488
|
|
|
9407
9489
|
// node_modules/.cache/mpgd-native-build/tools/target/native-ios-signing.js
|
|
9408
9490
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
9409
|
-
import { existsSync as
|
|
9491
|
+
import { existsSync as existsSync19, statSync as statSync5 } from "node:fs";
|
|
9410
9492
|
import path8 from "node:path";
|
|
9411
9493
|
function resolveIosSigningPlan(environment, mode) {
|
|
9412
9494
|
const teamId = environment.MPGD_IOS_TEAM_ID?.trim();
|
|
@@ -9441,7 +9523,7 @@ function resolveIosSigningPlan(environment, mode) {
|
|
|
9441
9523
|
throw new Error("iOS store export requires MPGD_IOS_EXPORT_OPTIONS_PLIST.");
|
|
9442
9524
|
}
|
|
9443
9525
|
const exportOptionsPlist = path8.resolve(configuredExportFile);
|
|
9444
|
-
if (!
|
|
9526
|
+
if (!existsSync19(exportOptionsPlist) || !statSync5(exportOptionsPlist).isFile()) {
|
|
9445
9527
|
throw new Error("iOS export options plist must be an existing host file.");
|
|
9446
9528
|
}
|
|
9447
9529
|
const method = spawnSync4("/usr/libexec/PlistBuddy", ["-c", "Print :method", exportOptionsPlist], {
|
|
@@ -9455,11 +9537,11 @@ function resolveIosSigningPlan(environment, mode) {
|
|
|
9455
9537
|
}
|
|
9456
9538
|
|
|
9457
9539
|
// node_modules/.cache/mpgd-native-build/tools/target/native-release-identity.js
|
|
9458
|
-
import { existsSync as
|
|
9459
|
-
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";
|
|
9460
9542
|
|
|
9461
9543
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/capacitor-shell-starter.js
|
|
9462
|
-
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";
|
|
9463
9545
|
import path9 from "node:path";
|
|
9464
9546
|
import { DOMParser as DOMParser2 } from "@xmldom/xmldom";
|
|
9465
9547
|
|
|
@@ -9883,7 +9965,7 @@ function assertAndroidLauncherClasses(nativeDirectory, gradle) {
|
|
|
9883
9965
|
const manifestPackage = manifestRoot?.getAttribute("package");
|
|
9884
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);
|
|
9885
9967
|
const releaseFile = path9.join(nativeDirectory, "app/src/release/AndroidManifest.xml");
|
|
9886
|
-
const release =
|
|
9968
|
+
const release = existsSync20(releaseFile) ? readAndroidApplication(releaseFile, false) : void 0;
|
|
9887
9969
|
if (release !== void 0) {
|
|
9888
9970
|
assertAndroidLauncherEnabled(release, "Release application");
|
|
9889
9971
|
}
|
|
@@ -9993,7 +10075,7 @@ function resolvesAndroidClass(nativeDirectory, qualified, sourceFiles, visited,
|
|
|
9993
10075
|
if (!isNativeFile(nativeDirectory, relative10)) {
|
|
9994
10076
|
continue;
|
|
9995
10077
|
}
|
|
9996
|
-
const source = stripSourceCommentsAndStrings(
|
|
10078
|
+
const source = stripSourceCommentsAndStrings(readFileSync20(path9.join(nativeDirectory, relative10), "utf8"));
|
|
9997
10079
|
const declaredPackage = /\bpackage\s+([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)+)\s*;?/u.exec(source)?.[1];
|
|
9998
10080
|
if (declaredPackage !== packageName) {
|
|
9999
10081
|
continue;
|
|
@@ -10050,7 +10132,7 @@ function listNativeFiles(nativeDirectory, relativeRoot, extension) {
|
|
|
10050
10132
|
while (pending.length > 0) {
|
|
10051
10133
|
const relative10 = pending.pop() ?? "";
|
|
10052
10134
|
const full = path9.join(nativeDirectory, relative10);
|
|
10053
|
-
if (!
|
|
10135
|
+
if (!existsSync20(full) || lstatSync11(full).isSymbolicLink()) {
|
|
10054
10136
|
continue;
|
|
10055
10137
|
}
|
|
10056
10138
|
for (const entry of readdirSync6(full, { withFileTypes: true })) {
|
|
@@ -10263,7 +10345,7 @@ function assertReferencedIosFiles(nativeDirectory, project, infoRelative) {
|
|
|
10263
10345
|
throw new Error(`Existing ios project is incomplete; referenced app file ${relative10} is missing.`);
|
|
10264
10346
|
}
|
|
10265
10347
|
}
|
|
10266
|
-
const info =
|
|
10348
|
+
const info = readFileSync20(path9.join(nativeDirectory, infoRelative), "utf8");
|
|
10267
10349
|
assertSceneDelegateFiles(nativeDirectory, info, "Release", compiledSources);
|
|
10268
10350
|
return compiledSources;
|
|
10269
10351
|
}
|
|
@@ -10451,7 +10533,7 @@ function isNativeEntry(directory, relative10) {
|
|
|
10451
10533
|
let current = directory;
|
|
10452
10534
|
for (const segment of within.split(path9.sep)) {
|
|
10453
10535
|
current = path9.join(current, segment);
|
|
10454
|
-
if (!
|
|
10536
|
+
if (!existsSync20(current) || lstatSync11(current).isSymbolicLink()) {
|
|
10455
10537
|
return false;
|
|
10456
10538
|
}
|
|
10457
10539
|
}
|
|
@@ -10484,7 +10566,7 @@ function assertSceneDelegateFiles(nativeDirectory, source, label, compiledSource
|
|
|
10484
10566
|
if (!compiledSources.has(relative10)) {
|
|
10485
10567
|
return false;
|
|
10486
10568
|
}
|
|
10487
|
-
const text = stripSourceCommentsAndStrings(
|
|
10569
|
+
const text = stripSourceCommentsAndStrings(readFileSync20(path9.join(nativeDirectory, relative10), "utf8"));
|
|
10488
10570
|
return hasUsableTopLevelSwiftSceneDelegate(text, className);
|
|
10489
10571
|
})) {
|
|
10490
10572
|
throw new Error(`Existing ios project ${label} scene delegate ${delegate} is missing from App Sources.`);
|
|
@@ -10509,17 +10591,17 @@ function hasUsableTopLevelSwiftSceneDelegate(source, className) {
|
|
|
10509
10591
|
return false;
|
|
10510
10592
|
}
|
|
10511
10593
|
function assertAndroidManifestResources(nativeDirectory) {
|
|
10512
|
-
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));
|
|
10513
10595
|
const resourceRoots = ["main", "release"].map((sourceSet) => path9.join(nativeDirectory, `app/src/${sourceSet}/res`));
|
|
10514
10596
|
const references = manifestFiles.flatMap((file) => {
|
|
10515
|
-
const manifest =
|
|
10597
|
+
const manifest = readFileSync20(file, "utf8").replace(/<!--[\s\S]*?-->/gu, "");
|
|
10516
10598
|
return [...manifest.matchAll(/(?<![\w+])@([a-z]+)\/([A-Za-z_][A-Za-z0-9_.]*)/gu)];
|
|
10517
10599
|
});
|
|
10518
10600
|
for (const reference of references) {
|
|
10519
10601
|
const type = reference[1] ?? "";
|
|
10520
10602
|
const name = reference[2] ?? "";
|
|
10521
10603
|
const found = resourceRoots.some((resourceRoot) => {
|
|
10522
|
-
if (!
|
|
10604
|
+
if (!existsSync20(resourceRoot)) {
|
|
10523
10605
|
return false;
|
|
10524
10606
|
}
|
|
10525
10607
|
const folders = readdirSync6(resourceRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
@@ -10544,7 +10626,7 @@ function assertNativeDisplayName(nativeDirectory, platform, expectedDisplayName,
|
|
|
10544
10626
|
if (platform === "ios" && !isNativeFile(nativeDirectory, relative10)) {
|
|
10545
10627
|
throw new Error(`Existing ${platform} project is incomplete; native display name resource is missing.`);
|
|
10546
10628
|
}
|
|
10547
|
-
const source = platform === "ios" ?
|
|
10629
|
+
const source = platform === "ios" ? readFileSync20(path9.join(nativeDirectory, relative10), "utf8") : "";
|
|
10548
10630
|
const labels = platform === "ios" ? [parsePlistDictionary(source, "Release").get("CFBundleDisplayName")].filter((value) => value?.tagName === "string").map((value) => value?.textContent ?? "") : [];
|
|
10549
10631
|
if (platform === "ios" && (labels.length !== 1 || labels[0] !== expectedDisplayName)) {
|
|
10550
10632
|
throw new Error(`Existing ${platform} project display name differs or cannot be read safely.`);
|
|
@@ -10570,7 +10652,7 @@ function assertNativeDisplayName(nativeDirectory, platform, expectedDisplayName,
|
|
|
10570
10652
|
}
|
|
10571
10653
|
}
|
|
10572
10654
|
const overlayFile = path9.join(nativeDirectory, "app/src/release/AndroidManifest.xml");
|
|
10573
|
-
if (
|
|
10655
|
+
if (existsSync20(overlayFile)) {
|
|
10574
10656
|
const release = readAndroidApplication(overlayFile, false);
|
|
10575
10657
|
if (release !== void 0) {
|
|
10576
10658
|
if (hasAndroidMergerDirective(release)) {
|
|
@@ -10580,8 +10662,8 @@ function assertNativeDisplayName(nativeDirectory, platform, expectedDisplayName,
|
|
|
10580
10662
|
if (releaseLabel !== null && resolveAndroidLabel(nativeDirectory, releaseLabel) !== expectedDisplayName) {
|
|
10581
10663
|
throw new Error("Existing android Release application label differs from the requested name.");
|
|
10582
10664
|
}
|
|
10583
|
-
const appBuildFile = ["app/build.gradle", "app/build.gradle.kts"].map((relative11) => path9.join(nativeDirectory, relative11)).find((file) =>
|
|
10584
|
-
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");
|
|
10585
10667
|
const manifestPackage = main.parentNode?.getAttribute("package");
|
|
10586
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);
|
|
10587
10669
|
const launcherNames = /* @__PURE__ */ new Set();
|
|
@@ -10624,13 +10706,13 @@ function assertAndroidReleaseDisplayName(shellApp, expectedDisplayName) {
|
|
|
10624
10706
|
function assertAndroidReleaseLauncherIntegrity(shellApp) {
|
|
10625
10707
|
const nativeDirectory = path9.join(shellApp, "android");
|
|
10626
10708
|
const gradleRelative = requireOneNativeFile(nativeDirectory, ["app/build.gradle", "app/build.gradle.kts"], "android");
|
|
10627
|
-
const gradle =
|
|
10709
|
+
const gradle = readFileSync20(path9.join(nativeDirectory, gradleRelative), "utf8");
|
|
10628
10710
|
assertAndroidLauncherClasses(nativeDirectory, gradle);
|
|
10629
10711
|
}
|
|
10630
10712
|
function assertIosReleaseDisplayName(shellApp, expectedDisplayName) {
|
|
10631
10713
|
const nativeDirectory = path9.join(shellApp, "ios");
|
|
10632
10714
|
const projectFile = path9.join(nativeDirectory, "App/App.xcodeproj/project.pbxproj");
|
|
10633
|
-
const project =
|
|
10715
|
+
const project = readFileSync20(projectFile, "utf8");
|
|
10634
10716
|
const infoRelative = path9.join("App", readIosReleaseInfoPlist(project));
|
|
10635
10717
|
if (!isNativeFile(nativeDirectory, infoRelative)) {
|
|
10636
10718
|
throw new Error("Existing ios project Release Info.plist is missing or unsafe.");
|
|
@@ -10652,9 +10734,9 @@ function assertIosArchiveScheme(shellApp) {
|
|
|
10652
10734
|
if (!isNativeFile(nativeDirectory, projectRelative) || !isNativeFile(nativeDirectory, schemeRelative)) {
|
|
10653
10735
|
throw new Error("Existing ios project shared App archive scheme is missing or unsafe.");
|
|
10654
10736
|
}
|
|
10655
|
-
const project =
|
|
10737
|
+
const project = readFileSync20(path9.join(nativeDirectory, projectRelative), "utf8");
|
|
10656
10738
|
const appTargetId = readIosAppTargetId(project);
|
|
10657
|
-
const schemeSource =
|
|
10739
|
+
const schemeSource = readFileSync20(path9.join(nativeDirectory, schemeRelative), "utf8");
|
|
10658
10740
|
const scheme = parseXml(schemeSource, "ios project App archive scheme").documentElement;
|
|
10659
10741
|
if (scheme?.tagName !== "Scheme") {
|
|
10660
10742
|
throw new Error("Existing ios project App archive scheme is malformed.");
|
|
@@ -10681,7 +10763,7 @@ function hasAndroidMergerDirectiveDeep(element) {
|
|
|
10681
10763
|
return hasAndroidMergerDirective(element) || childElements(element).some(hasAndroidMergerDirectiveDeep);
|
|
10682
10764
|
}
|
|
10683
10765
|
function readAndroidApplication(file, required = true) {
|
|
10684
|
-
const root = parseXml(
|
|
10766
|
+
const root = parseXml(readFileSync20(file, "utf8"), "android manifest").documentElement;
|
|
10685
10767
|
const application = root === null ? void 0 : childElements(root).find((element) => element.tagName === "application");
|
|
10686
10768
|
if (root?.tagName !== "manifest" || required && application === void 0) {
|
|
10687
10769
|
throw new Error("Existing android project manifest application is missing.");
|
|
@@ -10710,9 +10792,9 @@ function readAndroidString(nativeDirectory, key) {
|
|
|
10710
10792
|
throw new Error("Existing android project application label is unsupported.");
|
|
10711
10793
|
}
|
|
10712
10794
|
const overlay = path9.join(nativeDirectory, "app/src/release/res/values");
|
|
10713
|
-
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)) : [];
|
|
10714
10796
|
const main = path9.join(nativeDirectory, "app/src/main/res/values");
|
|
10715
|
-
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)) : [];
|
|
10716
10798
|
const values = overlayValues.length > 0 ? overlayValues : mainValues;
|
|
10717
10799
|
if (values.length !== 1) {
|
|
10718
10800
|
throw new Error("Existing android project application label resource is missing or ambiguous.");
|
|
@@ -10724,7 +10806,7 @@ function readAndroidString(nativeDirectory, key) {
|
|
|
10724
10806
|
return values[0] ?? "";
|
|
10725
10807
|
}
|
|
10726
10808
|
function readAndroidValueResource(file, type, name) {
|
|
10727
|
-
const root = parseXml(
|
|
10809
|
+
const root = parseXml(readFileSync20(file, "utf8"), "android values resource").documentElement;
|
|
10728
10810
|
if (root?.tagName !== "resources") {
|
|
10729
10811
|
throw new Error("Existing android values resource is malformed.");
|
|
10730
10812
|
}
|
|
@@ -10792,7 +10874,7 @@ function isNativeFile(directory, relative10) {
|
|
|
10792
10874
|
let current = directory;
|
|
10793
10875
|
for (const segment of within.split(path9.sep)) {
|
|
10794
10876
|
current = path9.join(current, segment);
|
|
10795
|
-
if (!
|
|
10877
|
+
if (!existsSync20(current) || lstatSync11(current).isSymbolicLink()) {
|
|
10796
10878
|
return false;
|
|
10797
10879
|
}
|
|
10798
10880
|
}
|
|
@@ -10808,14 +10890,14 @@ function assertNativeReleaseIdentity(input) {
|
|
|
10808
10890
|
assertNativeVersionMatchesGameVersion(expected, input.environment, input.required);
|
|
10809
10891
|
if (expected.kind === "android") {
|
|
10810
10892
|
const candidates = [
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
].filter((file) =>
|
|
10893
|
+
join9(input.shellApp, "android/app/build.gradle"),
|
|
10894
|
+
join9(input.shellApp, "android/app/build.gradle.kts")
|
|
10895
|
+
].filter((file) => existsSync21(file));
|
|
10814
10896
|
if (candidates.length !== 1) {
|
|
10815
10897
|
throw new Error("Android native release requires exactly one Gradle app build file.");
|
|
10816
10898
|
}
|
|
10817
10899
|
assertAndroidIdentity(candidates[0] ?? "", expected);
|
|
10818
|
-
assertAndroidAppliedScripts(candidates[0] ?? "",
|
|
10900
|
+
assertAndroidAppliedScripts(candidates[0] ?? "", join9(input.shellApp, "android"));
|
|
10819
10901
|
if (input.required) {
|
|
10820
10902
|
const name = requireValue(input.metadata?.displayName, "Android target metadata displayName");
|
|
10821
10903
|
assertAndroidReleaseDisplayName(input.shellApp, name);
|
|
@@ -10823,7 +10905,7 @@ function assertNativeReleaseIdentity(input) {
|
|
|
10823
10905
|
}
|
|
10824
10906
|
return;
|
|
10825
10907
|
}
|
|
10826
|
-
assertIosIdentity(
|
|
10908
|
+
assertIosIdentity(join9(input.shellApp, "ios/App/App.xcodeproj/project.pbxproj"), expected);
|
|
10827
10909
|
if (input.required) {
|
|
10828
10910
|
const name = requireValue(input.metadata?.displayName, "iOS target metadata displayName");
|
|
10829
10911
|
assertIosReleaseDisplayName(input.shellApp, name);
|
|
@@ -10962,7 +11044,7 @@ function assertAndroidAppliedScripts(appBuild, androidRoot) {
|
|
|
10962
11044
|
throw new Error("Native release preflight cannot resolve an applied Gradle script.");
|
|
10963
11045
|
}
|
|
10964
11046
|
};
|
|
10965
|
-
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));
|
|
10966
11048
|
if (rootFiles.length !== 1) {
|
|
10967
11049
|
throw new Error("Native release preflight requires one Android root Gradle build file.");
|
|
10968
11050
|
}
|
|
@@ -10972,7 +11054,7 @@ function assertAndroidAppliedScripts(appBuild, androidRoot) {
|
|
|
10972
11054
|
if (/\b(?:afterEvaluate|projectsEvaluated)\b/u.test(rootCode) && /\b(?:project|subprojects|allprojects|android)\b/u.test(rootCode)) {
|
|
10973
11055
|
throw new Error("Native release preflight cannot resolve root Gradle app callbacks.");
|
|
10974
11056
|
}
|
|
10975
|
-
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));
|
|
10976
11058
|
if (settingsFiles.length !== 1) {
|
|
10977
11059
|
throw new Error("Native release preflight requires one Android settings Gradle file.");
|
|
10978
11060
|
}
|
|
@@ -10996,7 +11078,7 @@ function assertIosIdentity(file, expected) {
|
|
|
10996
11078
|
assertIosSetting(releaseSettings, "MARKETING_VERSION", expected.marketingVersion, file);
|
|
10997
11079
|
assertIosSetting(releaseSettings, "CURRENT_PROJECT_VERSION", expected.buildNumber, file);
|
|
10998
11080
|
const plistRelative = readIosReleaseInfoPlist(source);
|
|
10999
|
-
const plist =
|
|
11081
|
+
const plist = join9(dirname7(dirname7(file)), plistRelative);
|
|
11000
11082
|
assertIosReleasePlistIdentity(readRequiredFile(plist, "iOS Release Info.plist"));
|
|
11001
11083
|
}
|
|
11002
11084
|
function assertIosSetting(settings, key, expected, file) {
|
|
@@ -11296,10 +11378,10 @@ function stripOptionalQuotes(value) {
|
|
|
11296
11378
|
return value;
|
|
11297
11379
|
}
|
|
11298
11380
|
function readRequiredFile(file, label) {
|
|
11299
|
-
if (!
|
|
11381
|
+
if (!existsSync21(file)) {
|
|
11300
11382
|
throw new Error(`Missing ${label}: ${file}`);
|
|
11301
11383
|
}
|
|
11302
|
-
return
|
|
11384
|
+
return readFileSync21(file, "utf8");
|
|
11303
11385
|
}
|
|
11304
11386
|
function requireFinalSemVer2(value, label) {
|
|
11305
11387
|
const normalized = requireValue(value, label);
|
|
@@ -11400,7 +11482,7 @@ function androidSignedReleaseGradleArgs(environment) {
|
|
|
11400
11482
|
if (initScript === void 0 || initScript === "") {
|
|
11401
11483
|
return ["bundleRelease", "--no-daemon"];
|
|
11402
11484
|
}
|
|
11403
|
-
if (!isAbsolute9(initScript) || !
|
|
11485
|
+
if (!isAbsolute9(initScript) || !existsSync22(initScript) || !statSync6(initScript).isFile()) {
|
|
11404
11486
|
throw new Error("Android upload signing init script must be an existing absolute file.");
|
|
11405
11487
|
}
|
|
11406
11488
|
return ["bundleRelease", "--no-daemon", "--init-script", initScript];
|
|
@@ -11441,7 +11523,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11441
11523
|
"CODE_SIGNING_ALLOWED=NO"
|
|
11442
11524
|
], environment, `${stagedShell}/ios`);
|
|
11443
11525
|
} else if (plan.mode === "simulator") {
|
|
11444
|
-
const buildRoot = mkdtempSync4(
|
|
11526
|
+
const buildRoot = mkdtempSync4(join10(tmpdir3(), "mpgd-ios-simulator-"));
|
|
11445
11527
|
releaseArtifact = `${artifactRoot}/App.app`;
|
|
11446
11528
|
try {
|
|
11447
11529
|
input.run("xcodebuild", [
|
|
@@ -11455,7 +11537,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11455
11537
|
"-sdk",
|
|
11456
11538
|
"iphonesimulator",
|
|
11457
11539
|
`SYMROOT=${buildRoot}`,
|
|
11458
|
-
`OBJROOT=${
|
|
11540
|
+
`OBJROOT=${join10(buildRoot, "Intermediates.noindex")}`,
|
|
11459
11541
|
"INFOPLIST_FILE=App/Info-Smoke.plist",
|
|
11460
11542
|
"EXCLUDED_SOURCE_FILE_NAMES=Main.storyboard LaunchScreen.storyboard Assets.xcassets",
|
|
11461
11543
|
"ASSETCATALOG_COMPILER_APPICON_NAME=",
|
|
@@ -11499,7 +11581,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11499
11581
|
inspectSignedIosArchive(input.targetPath(archiveArtifact), expectedIosIdentity);
|
|
11500
11582
|
releaseArtifact = archiveArtifact;
|
|
11501
11583
|
if (plan.mode === "store-export") {
|
|
11502
|
-
const exportRoot = mkdtempSync4(
|
|
11584
|
+
const exportRoot = mkdtempSync4(join10(tmpdir3(), "mpgd-ios-export-"));
|
|
11503
11585
|
try {
|
|
11504
11586
|
input.run("xcodebuild", [
|
|
11505
11587
|
"-exportArchive",
|
|
@@ -11515,7 +11597,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11515
11597
|
throw new Error("iOS store export must produce exactly one IPA.");
|
|
11516
11598
|
}
|
|
11517
11599
|
releaseArtifact = `${artifactRoot}/App.ipa`;
|
|
11518
|
-
input.copyFile(
|
|
11600
|
+
input.copyFile(join10(exportRoot, exportedIpas[0] ?? ""), input.targetPath(releaseArtifact));
|
|
11519
11601
|
inspectSignedIosIpa(input.targetPath(releaseArtifact), expectedIosIdentity);
|
|
11520
11602
|
} finally {
|
|
11521
11603
|
rmSync10(exportRoot, { recursive: true, force: true });
|
|
@@ -11693,7 +11775,7 @@ assertProductionTargetReadiness({
|
|
|
11693
11775
|
...runtimeTargetConfigMatrix.targets[targetName] === void 0 ? {} : { targetPolicy: runtimeTargetConfigMatrix.targets[targetName] },
|
|
11694
11776
|
...gameServicesUrl === void 0 ? {} : { gameServicesUrl }
|
|
11695
11777
|
});
|
|
11696
|
-
var nativeWebBundle = nativePlan === void 0 ? void 0 : mkdtempSync5(
|
|
11778
|
+
var nativeWebBundle = nativePlan === void 0 ? void 0 : mkdtempSync5(join11(tmpdir4(), "mpgd-native-web-"));
|
|
11697
11779
|
var nativeArtifactRoot = nativeAttempt === void 0 ? void 0 : `release-output/native/${targetName}/${safeArtifactFileStem(profile)}/${nativeAttempt.runId}`;
|
|
11698
11780
|
var nativeCompleted = false;
|
|
11699
11781
|
var runtimeTargetConfigMatrixFile = createRuntimeTargetConfigMatrixFile(runtimeTargetConfigMatrix);
|
|
@@ -11741,10 +11823,10 @@ try {
|
|
|
11741
11823
|
case "wechat-minigame": {
|
|
11742
11824
|
const outputConfigPath = requireString2(target.output, `${targetName}.output`);
|
|
11743
11825
|
const output = targetPath(outputConfigPath);
|
|
11744
|
-
const bundleRoot = mkdtempSync5(
|
|
11826
|
+
const bundleRoot = mkdtempSync5(join11(tmpdir4(), "mpgd-wechat-bundles-"));
|
|
11745
11827
|
try {
|
|
11746
|
-
const runtimeBundleRoot =
|
|
11747
|
-
const gameBundleRoot =
|
|
11828
|
+
const runtimeBundleRoot = join11(bundleRoot, "runtime");
|
|
11829
|
+
const gameBundleRoot = join11(bundleRoot, "game");
|
|
11748
11830
|
buildMiniGameBundle("runtime", runtimeBundleRoot, bundleRoot, gameApp, profile, env);
|
|
11749
11831
|
buildMiniGameBundle("game", gameBundleRoot, bundleRoot, gameApp, profile, env);
|
|
11750
11832
|
const effectiveTargetConfig = generateEffectiveTargetConfigArtifact(targetName, env);
|
|
@@ -11816,6 +11898,9 @@ try {
|
|
|
11816
11898
|
} else {
|
|
11817
11899
|
assertInstallableWebArtifact(output);
|
|
11818
11900
|
}
|
|
11901
|
+
if (target.adapter === "oneplay") {
|
|
11902
|
+
writeOnePlayHostingHeaders(output);
|
|
11903
|
+
}
|
|
11819
11904
|
if (target.adapter === "crazygames") {
|
|
11820
11905
|
assertCrazyGamesArtifact(output);
|
|
11821
11906
|
}
|
|
@@ -11892,9 +11977,9 @@ try {
|
|
|
11892
11977
|
rmSync11(dirname9(runtimeTargetConfigMatrixFile), { force: true, recursive: true });
|
|
11893
11978
|
}
|
|
11894
11979
|
function createRuntimeTargetConfigMatrixFile(matrix) {
|
|
11895
|
-
const directory = mkdtempSync5(
|
|
11896
|
-
const file =
|
|
11897
|
-
|
|
11980
|
+
const directory = mkdtempSync5(join11(tmpdir4(), "mpgd-target-config-matrix-"));
|
|
11981
|
+
const file = join11(directory, "matrix.json");
|
|
11982
|
+
writeFileSync15(file, `${JSON.stringify(matrix)}
|
|
11898
11983
|
`);
|
|
11899
11984
|
return file;
|
|
11900
11985
|
}
|
|
@@ -11914,7 +11999,7 @@ function replaceDirectory(source, destination) {
|
|
|
11914
11999
|
function mirrorAitRuntimeAssets(gameApp2, wrapperApp) {
|
|
11915
12000
|
const sourceAssets = `${gameApp2}/dist/assets`;
|
|
11916
12001
|
const destinationAssets = `${wrapperApp}/public/assets`;
|
|
11917
|
-
if (
|
|
12002
|
+
if (existsSync23(sourceAssets)) {
|
|
11918
12003
|
replaceDirectory(sourceAssets, destinationAssets);
|
|
11919
12004
|
} else {
|
|
11920
12005
|
rmSync11(destinationAssets, { recursive: true, force: true });
|
|
@@ -11996,14 +12081,14 @@ function copyIosSyncSwiftPackage(shellApp, releaseArtifact, packageName, swiftPa
|
|
|
11996
12081
|
}
|
|
11997
12082
|
function rewriteIosSyncSwiftPackagePath(releaseArtifact, packageName, swiftPackageName) {
|
|
11998
12083
|
const packageFile = targetPath(`${releaseArtifact}/App/CapApp-SPM/Package.swift`);
|
|
11999
|
-
const contents =
|
|
12084
|
+
const contents = readFileSync22(packageFile, "utf8");
|
|
12000
12085
|
const originalPath = readSwiftPackagePath(packageFile, swiftPackageName);
|
|
12001
12086
|
const rewrittenPath = `../../node_modules/${packageName}`;
|
|
12002
12087
|
const marker = `.package(name: "${swiftPackageName}", path: "`;
|
|
12003
|
-
|
|
12088
|
+
writeFileSync15(packageFile, contents.replace(`${marker}${originalPath}"`, `${marker}${rewrittenPath}"`));
|
|
12004
12089
|
}
|
|
12005
12090
|
function readSwiftPackagePath(packageFile, swiftPackageName) {
|
|
12006
|
-
const contents =
|
|
12091
|
+
const contents = readFileSync22(packageFile, "utf8");
|
|
12007
12092
|
const marker = `.package(name: "${swiftPackageName}", path: "`;
|
|
12008
12093
|
const index = contents.indexOf(marker);
|
|
12009
12094
|
if (index < 0 || contents.indexOf(marker, index + marker.length) >= 0) {
|
|
@@ -12021,7 +12106,7 @@ function copyFile(source, destination) {
|
|
|
12021
12106
|
cpSync4(source, destination);
|
|
12022
12107
|
}
|
|
12023
12108
|
function removeFilesByExtension(directory, extension) {
|
|
12024
|
-
if (!
|
|
12109
|
+
if (!existsSync23(directory)) {
|
|
12025
12110
|
return;
|
|
12026
12111
|
}
|
|
12027
12112
|
for (const file of readdirSync8(directory)) {
|
|
@@ -12036,7 +12121,7 @@ function safeArtifactFileStem(value) {
|
|
|
12036
12121
|
return stem.length === 0 ? "mpgd-kit" : stem;
|
|
12037
12122
|
}
|
|
12038
12123
|
function ensureCapacitorPlatform(shellApp, platform, commandEnv) {
|
|
12039
|
-
if (!
|
|
12124
|
+
if (!existsSync23(`${shellApp}/${platform}`)) {
|
|
12040
12125
|
run("pnpm", ["--dir", shellApp, "cap", "add", platform], commandEnv);
|
|
12041
12126
|
}
|
|
12042
12127
|
}
|
|
@@ -12073,7 +12158,7 @@ function findEmbeddedIconManifestArtifactPath(artifact) {
|
|
|
12073
12158
|
function findNamedArtifactFiles(root, fileName) {
|
|
12074
12159
|
const matches = [];
|
|
12075
12160
|
for (const entry of readdirSync8(root)) {
|
|
12076
|
-
const path10 =
|
|
12161
|
+
const path10 = join11(root, entry);
|
|
12077
12162
|
const stat = lstatSync12(path10);
|
|
12078
12163
|
if (stat.isSymbolicLink()) {
|
|
12079
12164
|
continue;
|
|
@@ -12123,8 +12208,8 @@ function isMiniGameTarget(target2) {
|
|
|
12123
12208
|
return target2.kind === "wechat-minigame" || target2.kind === "tiktok-minigame";
|
|
12124
12209
|
}
|
|
12125
12210
|
function buildMiniGameBundle(bundleKind, outputDir, stagingRoot, gameApp2, profile2, commandEnv) {
|
|
12126
|
-
const viteConfig =
|
|
12127
|
-
if (!
|
|
12211
|
+
const viteConfig = join11(gameApp2, "vite.minigame.config.ts");
|
|
12212
|
+
if (!existsSync23(viteConfig)) {
|
|
12128
12213
|
throw new Error(`Mini-game target requires a game-owned vite.minigame.config.ts: ${viteConfig}`);
|
|
12129
12214
|
}
|
|
12130
12215
|
run("pnpm", ["exec", "vite", "build", "--config", "vite.minigame.config.ts", "--mode", profile2], {
|