@mpgd/cli 0.36.2 → 0.38.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 +3 -0
- package/dist/native-build-info.json +2 -2
- package/dist/native-build-target.js +214 -146
- package/package.json +14 -13
- package/templates/phaser-game/agent/acceptance.md +13 -0
- package/templates/phaser-game/agent/brief.md +9 -0
- package/templates/phaser-game/agent/game-manifest.json +30 -2
- package/templates/phaser-game/docs/MPGD_KIT_WORKFLOWS.md +16 -0
- package/templates/phaser-game/mpgd.targets.json +11 -0
- package/templates/phaser-game/package.json +2 -1
- package/templates/phaser-game/src/main.ts +43 -8
- package/templates/phaser-game/src/platform/buildGateways/crazygames.ts +14 -0
- package/templates/phaser-game/src/platform/gameServices.ts +12 -0
- package/templates/phaser-game/src/platform/runtimeDetector.ts +1 -0
- package/templates/phaser-game/src/runtime/createGame.ts +27 -0
- package/templates/phaser-game/src/runtime/gameContext.ts +2 -0
- package/templates/phaser-game/src/scenes/BootScene.ts +4 -1
- package/templates/phaser-game/src/scenes/PlayScene.ts +38 -6
- package/templates/phaser-game/vite.runtime-target-config.ts +2 -0
- package/templates/phaser-game/vite.shared.ts +7 -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 existsSync22, lstatSync as
|
|
3
|
+
import { cpSync as cpSync4, existsSync as existsSync22, lstatSync as lstatSync12, mkdirSync as mkdirSync12, mkdtempSync as mkdtempSync5, readdirSync as readdirSync8, readFileSync as readFileSync21, realpathSync as realpathSync9, rmSync as rmSync11, statSync as statSync7, writeFileSync as writeFileSync14 } 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 join10, 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,13 @@ 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
|
+
},
|
|
1874
1881
|
"tiktok-minigame": {
|
|
1875
1882
|
identityUpgrade: "unsupported",
|
|
1876
1883
|
presentation: "available",
|
|
@@ -1940,7 +1947,7 @@ function normalizeTargetIntegrationConfig(config2) {
|
|
|
1940
1947
|
}
|
|
1941
1948
|
function assertTargetIntegrationRuntimeBounds(runtime, config2, label) {
|
|
1942
1949
|
const integrations = normalizeTargetIntegrationConfig(config2);
|
|
1943
|
-
if (runtime !== "tiktok-minigame" && runtime !== "verse8-web" && runtime !== "web-preview" && runtime !== "wechat-minigame") {
|
|
1950
|
+
if (runtime !== "tiktok-minigame" && runtime !== "verse8-web" && runtime !== "crazygames-web" && runtime !== "web-preview" && runtime !== "wechat-minigame") {
|
|
1944
1951
|
return integrations;
|
|
1945
1952
|
}
|
|
1946
1953
|
const upperBounds = integrationUpperBoundsByRuntime[runtime];
|
|
@@ -2044,6 +2051,11 @@ function createEffectiveTargetConfig(input) {
|
|
|
2044
2051
|
};
|
|
2045
2052
|
}
|
|
2046
2053
|
function resolveAuthoritativeGameServicesConfig(config2, platformTarget) {
|
|
2054
|
+
if (config2.runtime === "crazygames-web") {
|
|
2055
|
+
const interstitialAds = platformTarget?.crazyGamesLaunch === "full" && config2.features.interstitialAds && config2.monetization.interstitialAds;
|
|
2056
|
+
const monetization = { ...disabledAuthoritativeMonetization, interstitialAds };
|
|
2057
|
+
return { ...config2, features: { ...config2.features, ...monetization }, monetization };
|
|
2058
|
+
}
|
|
2047
2059
|
if (platformTarget?.authoritativeGameServices !== false) {
|
|
2048
2060
|
return config2;
|
|
2049
2061
|
}
|
|
@@ -2224,10 +2236,44 @@ function requireCanonicalAppVersion(value) {
|
|
|
2224
2236
|
return gameVersion;
|
|
2225
2237
|
}
|
|
2226
2238
|
|
|
2239
|
+
// node_modules/.cache/mpgd-native-build/tools/target/crazygames-artifact.js
|
|
2240
|
+
import { lstatSync as lstatSync4, readdirSync as readdirSync2, readFileSync as readFileSync7 } from "node:fs";
|
|
2241
|
+
import { join as join4 } from "node:path";
|
|
2242
|
+
function assertCrazyGamesArtifact(root) {
|
|
2243
|
+
let files = 0;
|
|
2244
|
+
let bytes = 0;
|
|
2245
|
+
function visit(directory) {
|
|
2246
|
+
for (const name of readdirSync2(directory)) {
|
|
2247
|
+
const path10 = join4(directory, name);
|
|
2248
|
+
const stat = lstatSync4(path10);
|
|
2249
|
+
if (stat.isDirectory()) {
|
|
2250
|
+
visit(path10);
|
|
2251
|
+
} else if (stat.isFile()) {
|
|
2252
|
+
files += 1;
|
|
2253
|
+
bytes += stat.size;
|
|
2254
|
+
} else {
|
|
2255
|
+
throw new Error("CrazyGames artifacts must contain regular files and directories.");
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
visit(root);
|
|
2260
|
+
if (files > 1500 || bytes > 25e7) {
|
|
2261
|
+
throw new Error("CrazyGames submission exceeds 1500 files or 250 MB.");
|
|
2262
|
+
}
|
|
2263
|
+
const index = readFileSync7(join4(root, "index.html"), "utf8");
|
|
2264
|
+
for (const match of index.matchAll(/\b(?:src|href)\s*=\s*(?:["']([^"']+)["']|([^\s"'`=<>]+))/giu)) {
|
|
2265
|
+
const path10 = match[1] ?? match[2];
|
|
2266
|
+
if (path10?.startsWith("/") || /^https?:/iu.test(path10 ?? "")) {
|
|
2267
|
+
throw new Error("CrazyGames index assets must use relative paths.");
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
return { files, bytes };
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2227
2273
|
// node_modules/.cache/mpgd-native-build/tools/target/effective-config.js
|
|
2228
2274
|
import { createHash as createHash3 } from "node:crypto";
|
|
2229
|
-
import { existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as
|
|
2230
|
-
import { dirname as dirname5, join as
|
|
2275
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as readFileSync10, writeFileSync as writeFileSync4 } from "node:fs";
|
|
2276
|
+
import { dirname as dirname5, join as join5 } from "node:path";
|
|
2231
2277
|
|
|
2232
2278
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/target-name.js
|
|
2233
2279
|
var deploymentTargetNamePattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
@@ -2284,11 +2330,11 @@ function readConfiguredPath(value) {
|
|
|
2284
2330
|
}
|
|
2285
2331
|
|
|
2286
2332
|
// node_modules/.cache/mpgd-native-build/tools/io.js
|
|
2287
|
-
import { readFileSync as
|
|
2333
|
+
import { readFileSync as readFileSync8 } from "node:fs";
|
|
2288
2334
|
import { resolve as resolve5 } from "node:path";
|
|
2289
2335
|
import { pathToFileURL } from "node:url";
|
|
2290
2336
|
function readJsonFile(path10) {
|
|
2291
|
-
return JSON.parse(
|
|
2337
|
+
return JSON.parse(readFileSync8(resolve5(path10), "utf8"));
|
|
2292
2338
|
}
|
|
2293
2339
|
function isCliEntrypoint(metaUrl) {
|
|
2294
2340
|
const scriptPath = process.argv[1];
|
|
@@ -2372,12 +2418,12 @@ function isValidHostname(hostname) {
|
|
|
2372
2418
|
}
|
|
2373
2419
|
|
|
2374
2420
|
// node_modules/.cache/mpgd-native-build/tools/target/minigame-package-budget.js
|
|
2375
|
-
import { lstatSync as
|
|
2421
|
+
import { lstatSync as lstatSync5, readdirSync as readdirSync3 } from "node:fs";
|
|
2376
2422
|
import { isAbsolute as isAbsolute3, relative as relative4, resolve as resolve6, sep as sep2 } from "node:path";
|
|
2377
2423
|
var miniGameMainPackageLimitBytes = 4 * 1024 * 1024;
|
|
2378
2424
|
function assertMiniGamePackageBudget(input) {
|
|
2379
2425
|
const artifactRoot = resolve6(input.artifactRoot);
|
|
2380
|
-
const rootStat =
|
|
2426
|
+
const rootStat = lstatSync5(artifactRoot);
|
|
2381
2427
|
if (!rootStat.isDirectory() || rootStat.isSymbolicLink()) {
|
|
2382
2428
|
throw new Error(`Mini-game artifact root must be a real directory: ${artifactRoot}`);
|
|
2383
2429
|
}
|
|
@@ -2406,7 +2452,7 @@ function assertMiniGamePackageBudget(input) {
|
|
|
2406
2452
|
}
|
|
2407
2453
|
for (const subpackage of subpackages) {
|
|
2408
2454
|
const directory = resolveArtifactPath(artifactRoot, subpackage.root);
|
|
2409
|
-
if (!
|
|
2455
|
+
if (!lstatSync5(directory).isDirectory()) {
|
|
2410
2456
|
throw new Error(`Mini-game subpackage root must be a directory: ${subpackage.root}`);
|
|
2411
2457
|
}
|
|
2412
2458
|
}
|
|
@@ -2441,9 +2487,9 @@ function listMiniGameArtifactFiles(artifactRoot) {
|
|
|
2441
2487
|
if (directory === void 0) {
|
|
2442
2488
|
throw new Error("Mini-game artifact traversal lost its current directory.");
|
|
2443
2489
|
}
|
|
2444
|
-
for (const entry of
|
|
2490
|
+
for (const entry of readdirSync3(directory, { withFileTypes: true })) {
|
|
2445
2491
|
const path10 = resolve6(directory, entry.name);
|
|
2446
|
-
const stat =
|
|
2492
|
+
const stat = lstatSync5(path10);
|
|
2447
2493
|
if (stat.isSymbolicLink()) {
|
|
2448
2494
|
throw new Error(`Mini-game artifacts must not contain symbolic links: ${path10}`);
|
|
2449
2495
|
}
|
|
@@ -2524,7 +2570,7 @@ function resolveArtifactPath(root, path10) {
|
|
|
2524
2570
|
throw new Error(`Mini-game path escapes its artifact root: ${path10}`);
|
|
2525
2571
|
}
|
|
2526
2572
|
try {
|
|
2527
|
-
const stat =
|
|
2573
|
+
const stat = lstatSync5(resolved);
|
|
2528
2574
|
if (stat.isSymbolicLink()) {
|
|
2529
2575
|
throw new Error(`Mini-game path must not be a symbolic link: ${path10}`);
|
|
2530
2576
|
}
|
|
@@ -2768,6 +2814,11 @@ var assertPlatformTargetsConfig = /* @__PURE__ */ (() => {
|
|
|
2768
2814
|
path: _path + ".installable",
|
|
2769
2815
|
expected: "(boolean | undefined)",
|
|
2770
2816
|
value: input.installable
|
|
2817
|
+
}, _errorFactory)) && (void 0 === input.crazyGamesLaunch || "basic" === input.crazyGamesLaunch || "full" === input.crazyGamesLaunch || _assertGuard_13._assertGuard(_exceptionable, {
|
|
2818
|
+
method: "typia.createAssert",
|
|
2819
|
+
path: _path + ".crazyGamesLaunch",
|
|
2820
|
+
expected: '("basic" | "full" | undefined)',
|
|
2821
|
+
value: input.crazyGamesLaunch
|
|
2771
2822
|
}, _errorFactory)) && (void 0 === input.staticDir || "string" === typeof input.staticDir || _assertGuard_13._assertGuard(_exceptionable, {
|
|
2772
2823
|
method: "typia.createAssert",
|
|
2773
2824
|
path: _path + ".staticDir",
|
|
@@ -2990,7 +3041,7 @@ var assertPlatformTargetsConfig = /* @__PURE__ */ (() => {
|
|
|
2990
3041
|
});
|
|
2991
3042
|
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
3043
|
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);
|
|
3044
|
+
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
3045
|
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
3046
|
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
3047
|
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 +3144,15 @@ function assertPlatformTargetConfigShape(input, target2) {
|
|
|
3093
3144
|
if (input.adapter === "microsoft-store" && target2 !== "microsoft-store") {
|
|
3094
3145
|
throw new Error(`Platform target ${target2} cannot use the reserved microsoft-store adapter.`);
|
|
3095
3146
|
}
|
|
3147
|
+
if (target2 === "crazygames" && (input.kind !== "web" || input.adapter !== "crazygames")) {
|
|
3148
|
+
throw new Error("crazygames target must use the web kind and crazygames adapter.");
|
|
3149
|
+
}
|
|
3150
|
+
if (input.adapter === "crazygames" && (input.kind !== "web" || input.installable !== false)) {
|
|
3151
|
+
throw new Error("CrazyGames requires a web target with installable: false.");
|
|
3152
|
+
}
|
|
3153
|
+
if (input.crazyGamesLaunch !== void 0 && (input.adapter !== "crazygames" || !["basic", "full"].includes(input.crazyGamesLaunch))) {
|
|
3154
|
+
throw new Error("crazyGamesLaunch must be basic or full on a CrazyGames target.");
|
|
3155
|
+
}
|
|
3096
3156
|
switch (input.kind) {
|
|
3097
3157
|
case "web":
|
|
3098
3158
|
assertString(input.output, `${target2}.output`);
|
|
@@ -3307,20 +3367,20 @@ function assertTargetKind(input, target2) {
|
|
|
3307
3367
|
import * as _assertGuard_14 from "typia/lib/internal/_assertGuard";
|
|
3308
3368
|
import * as _accessExpressionAsString_14 from "typia/lib/internal/_accessExpressionAsString";
|
|
3309
3369
|
import { createHash as createHash2 } from "node:crypto";
|
|
3310
|
-
import { readFileSync as
|
|
3370
|
+
import { readFileSync as readFileSync9 } from "node:fs";
|
|
3311
3371
|
import typia4 from "typia";
|
|
3312
3372
|
var __typia_transform__accessExpressionAsString2 = _accessExpressionAsString_14._accessExpressionAsString;
|
|
3313
3373
|
var defaultTargetConfigMatrixFile = "packages/target-config/targets.json";
|
|
3314
3374
|
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"]);
|
|
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"]);
|
|
3316
3376
|
const _ip0 = (input) => "boolean" === typeof input["iap"];
|
|
3317
3377
|
const _ip1 = (input) => void 0 === input["bannerAds"] || "boolean" === typeof input["bannerAds"];
|
|
3318
3378
|
const _ip2 = (input) => "boolean" === typeof input["rewardedAds"];
|
|
3319
3379
|
const _ip3 = (input) => "boolean" === typeof input["interstitialAds"];
|
|
3320
3380
|
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")';
|
|
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")';
|
|
3324
3384
|
const _ap0 = (input, _path, _exceptionable = true) => "boolean" === typeof input["iap"] || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3325
3385
|
method: "typia.createAssert",
|
|
3326
3386
|
path: _path + ".iap",
|
|
@@ -3351,8 +3411,8 @@ var assertTargetConfigMatrix = /* @__PURE__ */ (() => {
|
|
|
3351
3411
|
expected: "boolean",
|
|
3352
3412
|
value: input["localization"]
|
|
3353
3413
|
}, _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")';
|
|
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")';
|
|
3356
3416
|
const _ae2 = '("action-required" | "approval-required" | "available" | "configuration-required" | "disabled" | "temporarily-unavailable" | "unsupported")';
|
|
3357
3417
|
const _ao0 = (input, _path, _exceptionable = true) => ("string" === typeof input.version || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3358
3418
|
method: "typia.createAssert",
|
|
@@ -3612,15 +3672,15 @@ var assertTargetConfigMatrix = /* @__PURE__ */ (() => {
|
|
|
3612
3672
|
};
|
|
3613
3673
|
})();
|
|
3614
3674
|
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"]);
|
|
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"]);
|
|
3616
3676
|
const _ip0 = (input) => "boolean" === typeof input["iap"];
|
|
3617
3677
|
const _ip1 = (input) => void 0 === input["bannerAds"] || "boolean" === typeof input["bannerAds"];
|
|
3618
3678
|
const _ip2 = (input) => "boolean" === typeof input["rewardedAds"];
|
|
3619
3679
|
const _ip3 = (input) => "boolean" === typeof input["interstitialAds"];
|
|
3620
3680
|
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")';
|
|
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")';
|
|
3624
3684
|
const _ap0 = (input, _path, _exceptionable = true) => "boolean" === typeof input["iap"] || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3625
3685
|
method: "typia.createAssert",
|
|
3626
3686
|
path: _path + ".iap",
|
|
@@ -3651,8 +3711,8 @@ var assertTargetConfigExtensions = /* @__PURE__ */ (() => {
|
|
|
3651
3711
|
expected: "boolean",
|
|
3652
3712
|
value: input["localization"]
|
|
3653
3713
|
}, _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")';
|
|
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")';
|
|
3656
3716
|
const _ae2 = '("action-required" | "approval-required" | "available" | "configuration-required" | "disabled" | "temporarily-unavailable" | "unsupported")';
|
|
3657
3717
|
const _ao0 = (input, _path, _exceptionable = true) => (1 === input.schemaVersion || _assertGuard_14._assertGuard(_exceptionable, {
|
|
3658
3718
|
method: "typia.createAssert",
|
|
@@ -3926,6 +3986,7 @@ var releaseProfileByRuntime = {
|
|
|
3926
3986
|
"apps-in-toss": "apps-in-toss",
|
|
3927
3987
|
"devvit-web": "devvit",
|
|
3928
3988
|
"verse8-web": "verse8",
|
|
3989
|
+
"crazygames-web": "crazygames",
|
|
3929
3990
|
"wechat-minigame": "wechat-minigame",
|
|
3930
3991
|
"tiktok-minigame": "tiktok-minigame"
|
|
3931
3992
|
};
|
|
@@ -3935,7 +3996,7 @@ function loadTargetConfigMatrix(baseFile = process.env[targetConfigMatrixFileEnv
|
|
|
3935
3996
|
return base;
|
|
3936
3997
|
}
|
|
3937
3998
|
const normalizedExtensionsFile = extensionsFile.trim();
|
|
3938
|
-
const fileContent =
|
|
3999
|
+
const fileContent = readFileSync9(normalizedExtensionsFile);
|
|
3939
4000
|
const extensions = assertTargetConfigExtensions(JSON.parse(fileContent.toString("utf8")));
|
|
3940
4001
|
const collisions = Object.keys(extensions.targets).filter((target2) => base.targets[target2] !== void 0);
|
|
3941
4002
|
if (collisions.length > 0) {
|
|
@@ -4049,7 +4110,7 @@ function writeEffectiveTargetConfigs(options = {}) {
|
|
|
4049
4110
|
}
|
|
4050
4111
|
return writeEffectiveTargetConfig(target2, config2, outputDir);
|
|
4051
4112
|
});
|
|
4052
|
-
const indexPath =
|
|
4113
|
+
const indexPath = join5(outputDir, "index.json");
|
|
4053
4114
|
const previousArtifacts = readExistingArtifactIndex(indexPath, matrix.version).artifacts;
|
|
4054
4115
|
const artifactsByTarget = new Map(previousArtifacts.filter((artifact) => matrix.targets[artifact.target] !== void 0).map((artifact) => [artifact.target, artifact]));
|
|
4055
4116
|
for (const artifact of artifacts) {
|
|
@@ -4072,7 +4133,7 @@ function readExistingArtifactIndex(path10, version) {
|
|
|
4072
4133
|
artifacts: []
|
|
4073
4134
|
};
|
|
4074
4135
|
}
|
|
4075
|
-
const parsed = JSON.parse(
|
|
4136
|
+
const parsed = JSON.parse(readFileSync10(path10, "utf8"));
|
|
4076
4137
|
if (parsed.version !== version) {
|
|
4077
4138
|
return {
|
|
4078
4139
|
version,
|
|
@@ -4083,7 +4144,7 @@ function readExistingArtifactIndex(path10, version) {
|
|
|
4083
4144
|
}
|
|
4084
4145
|
function writeEffectiveTargetConfig(target2, config2, outputDir) {
|
|
4085
4146
|
assertDeploymentTargetName(target2);
|
|
4086
|
-
const path10 =
|
|
4147
|
+
const path10 = join5(outputDir, `${target2}.json`);
|
|
4087
4148
|
const content = `${JSON.stringify(config2, null, 2)}
|
|
4088
4149
|
`;
|
|
4089
4150
|
mkdirSync4(dirname5(path10), { recursive: true });
|
|
@@ -4139,7 +4200,8 @@ function toEffectivePlatformTargetMetadata(config2) {
|
|
|
4139
4200
|
case "web":
|
|
4140
4201
|
return {
|
|
4141
4202
|
...base,
|
|
4142
|
-
output: config2.output
|
|
4203
|
+
output: config2.output,
|
|
4204
|
+
...config2.crazyGamesLaunch === void 0 ? {} : { crazyGamesLaunch: config2.crazyGamesLaunch }
|
|
4143
4205
|
};
|
|
4144
4206
|
case "capacitor-android":
|
|
4145
4207
|
case "capacitor-ios":
|
|
@@ -4178,6 +4240,7 @@ function platformKindForRuntime(runtime) {
|
|
|
4178
4240
|
case "devvit-web":
|
|
4179
4241
|
return "devvit-web";
|
|
4180
4242
|
case "verse8-web":
|
|
4243
|
+
case "crazygames-web":
|
|
4181
4244
|
return "web";
|
|
4182
4245
|
case "wechat-minigame":
|
|
4183
4246
|
return "wechat-minigame";
|
|
@@ -4201,6 +4264,8 @@ function platformAdapterForRuntime(runtime) {
|
|
|
4201
4264
|
return "devvit";
|
|
4202
4265
|
case "verse8-web":
|
|
4203
4266
|
return "verse8";
|
|
4267
|
+
case "crazygames-web":
|
|
4268
|
+
return "crazygames";
|
|
4204
4269
|
case "wechat-minigame":
|
|
4205
4270
|
return "wechat";
|
|
4206
4271
|
case "tiktok-minigame":
|
|
@@ -4216,7 +4281,7 @@ import * as _assertGuard_16 from "typia/lib/internal/_assertGuard";
|
|
|
4216
4281
|
import * as _accessExpressionAsString_16 from "typia/lib/internal/_accessExpressionAsString";
|
|
4217
4282
|
import { execFileSync } from "node:child_process";
|
|
4218
4283
|
import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
|
|
4219
|
-
import { existsSync as existsSync8, readFileSync as
|
|
4284
|
+
import { existsSync as existsSync8, readFileSync as readFileSync12, realpathSync as realpathSync5, renameSync, rmSync as rmSync4, writeFileSync as writeFileSync6 } from "node:fs";
|
|
4220
4285
|
import { isAbsolute as isAbsolute5, relative as relative5, resolve as resolve8 } from "node:path";
|
|
4221
4286
|
import typia6 from "typia";
|
|
4222
4287
|
|
|
@@ -4537,7 +4602,7 @@ function assertReleaseManifest(input) {
|
|
|
4537
4602
|
|
|
4538
4603
|
// node_modules/.cache/mpgd-native-build/tools/target/release-manifest-lock.js
|
|
4539
4604
|
import { randomUUID } from "node:crypto";
|
|
4540
|
-
import { closeSync, existsSync as existsSync7, lstatSync as
|
|
4605
|
+
import { closeSync, existsSync as existsSync7, lstatSync as lstatSync6, mkdirSync as mkdirSync5, openSync, readFileSync as readFileSync11, statSync, unlinkSync, writeFileSync as writeFileSync5 } from "node:fs";
|
|
4541
4606
|
import path2 from "node:path";
|
|
4542
4607
|
var maximumWaitMs = 3e4;
|
|
4543
4608
|
var pollingIntervalMs = 50;
|
|
@@ -4567,7 +4632,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4567
4632
|
}
|
|
4568
4633
|
let observed;
|
|
4569
4634
|
try {
|
|
4570
|
-
observed =
|
|
4635
|
+
observed = lstatSync6(lockFile);
|
|
4571
4636
|
} catch (statError) {
|
|
4572
4637
|
if (statError.code === "ENOENT") {
|
|
4573
4638
|
continue;
|
|
@@ -4579,7 +4644,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4579
4644
|
}
|
|
4580
4645
|
if (canRecoverLock(lockFile)) {
|
|
4581
4646
|
try {
|
|
4582
|
-
const current =
|
|
4647
|
+
const current = lstatSync6(lockFile);
|
|
4583
4648
|
if (current.dev === observed.dev && current.ino === observed.ino && current.mtimeMs === observed.mtimeMs) {
|
|
4584
4649
|
unlinkSync(lockFile);
|
|
4585
4650
|
}
|
|
@@ -4600,7 +4665,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4600
4665
|
return action();
|
|
4601
4666
|
} finally {
|
|
4602
4667
|
if (existsSync7(lockFile)) {
|
|
4603
|
-
const contents =
|
|
4668
|
+
const contents = readFileSync11(lockFile, "utf8");
|
|
4604
4669
|
if (contents.includes(token)) {
|
|
4605
4670
|
unlinkSync(lockFile);
|
|
4606
4671
|
}
|
|
@@ -4610,7 +4675,7 @@ function withReleaseManifestLock(file, action) {
|
|
|
4610
4675
|
function canRecoverLock(lockFile) {
|
|
4611
4676
|
let record;
|
|
4612
4677
|
try {
|
|
4613
|
-
record = JSON.parse(
|
|
4678
|
+
record = JSON.parse(readFileSync11(lockFile, "utf8"));
|
|
4614
4679
|
} catch {
|
|
4615
4680
|
return Date.now() - statSync(lockFile).mtimeMs > incompleteLockGraceMs;
|
|
4616
4681
|
}
|
|
@@ -5159,7 +5224,7 @@ function requirePortableArtifactPath(path10) {
|
|
|
5159
5224
|
}
|
|
5160
5225
|
function readFileBytes(path10) {
|
|
5161
5226
|
try {
|
|
5162
|
-
return
|
|
5227
|
+
return readFileSync12(path10);
|
|
5163
5228
|
} catch (error) {
|
|
5164
5229
|
throw new Error(`Failed to read icon manifest ${path10}: ${formatError5(error)}`);
|
|
5165
5230
|
}
|
|
@@ -5447,7 +5512,7 @@ function requireNonEmptyString(input, label) {
|
|
|
5447
5512
|
|
|
5448
5513
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/microsoft-store-pwa-release.js
|
|
5449
5514
|
import { createHash as createHash5 } from "node:crypto";
|
|
5450
|
-
import { closeSync as closeSync2, existsSync as existsSync9, openSync as openSync2, readdirSync as
|
|
5515
|
+
import { closeSync as closeSync2, existsSync as existsSync9, openSync as openSync2, readdirSync as readdirSync4, readFileSync as readFileSync13, readSync, statSync as statSync2 } from "node:fs";
|
|
5451
5516
|
import { relative as relative6, resolve as resolve9, sep as sep3 } from "node:path";
|
|
5452
5517
|
function assertMicrosoftStorePwaProvenance(input) {
|
|
5453
5518
|
return {
|
|
@@ -5618,7 +5683,7 @@ function listPrecacheEntries(artifactRoot) {
|
|
|
5618
5683
|
if (directory === void 0) {
|
|
5619
5684
|
throw new Error("PWA artifact traversal lost its directory.");
|
|
5620
5685
|
}
|
|
5621
|
-
for (const entry of
|
|
5686
|
+
for (const entry of readdirSync4(directory, { withFileTypes: true })) {
|
|
5622
5687
|
const path10 = resolve9(directory, entry.name);
|
|
5623
5688
|
if (entry.isSymbolicLink()) {
|
|
5624
5689
|
throw new Error(`PWA artifact must not contain symbolic links: ${path10}`);
|
|
@@ -5632,7 +5697,7 @@ function listPrecacheEntries(artifactRoot) {
|
|
|
5632
5697
|
}
|
|
5633
5698
|
return files.filter((path10) => !path10.endsWith(".map") && !path10.endsWith(`${sep3}pwa-release.json`) && !path10.endsWith(`${sep3}service-worker.js`)).map((path10) => ({
|
|
5634
5699
|
url: toPrecacheUrl(artifactRoot, path10),
|
|
5635
|
-
source:
|
|
5700
|
+
source: readFileSync13(path10)
|
|
5636
5701
|
})).sort((left, right) => compareCodeUnits(left.url, right.url));
|
|
5637
5702
|
}
|
|
5638
5703
|
function normalizePrecacheEntries(entries) {
|
|
@@ -5733,8 +5798,8 @@ function readPwaId(input) {
|
|
|
5733
5798
|
|
|
5734
5799
|
// node_modules/.cache/mpgd-native-build/tools/target/minigame-artifact.js
|
|
5735
5800
|
import { createHash as createHash6 } from "node:crypto";
|
|
5736
|
-
import { copyFileSync as copyFileSync2, cpSync as cpSync2, existsSync as existsSync10, constants as fsConstants, lstatSync as
|
|
5737
|
-
import { basename as basename3, dirname as dirname6, extname, isAbsolute as isAbsolute6, join as
|
|
5801
|
+
import { copyFileSync as copyFileSync2, cpSync as cpSync2, existsSync as existsSync10, constants as fsConstants, lstatSync as lstatSync7, mkdirSync as mkdirSync6, mkdtempSync, readdirSync as readdirSync5, readFileSync as readFileSync14, realpathSync as realpathSync6, renameSync as renameSync2, rmSync as rmSync5, writeFileSync as writeFileSync8 } from "node:fs";
|
|
5802
|
+
import { basename as basename3, dirname as dirname6, extname, isAbsolute as isAbsolute6, join as join6, relative as relative7, resolve as resolve11, sep as sep4 } from "node:path";
|
|
5738
5803
|
import { parse } from "acorn";
|
|
5739
5804
|
var miniGameArtifactEvidenceFileName = "mpgd-minigame-artifact.json";
|
|
5740
5805
|
var miniGameEffectiveTargetConfigFileName = "mpgd-effective-target-config.json";
|
|
@@ -5798,14 +5863,14 @@ function assembleMiniGameArtifact(input) {
|
|
|
5798
5863
|
assertMiniGameArtifactOutputDirectory(artifactRoot, input.projectRoot);
|
|
5799
5864
|
const artifactParent = dirname6(artifactRoot);
|
|
5800
5865
|
mkdirSync6(artifactParent, { recursive: true });
|
|
5801
|
-
const stagingRoot = mkdtempSync(
|
|
5866
|
+
const stagingRoot = mkdtempSync(join6(artifactParent, `.${basename3(artifactRoot)}-staging-`));
|
|
5802
5867
|
let projectFilesRoot;
|
|
5803
5868
|
const stagingInput = { ...input, artifactRoot: stagingRoot };
|
|
5804
5869
|
try {
|
|
5805
|
-
projectFilesRoot = mkdtempSync(
|
|
5870
|
+
projectFilesRoot = mkdtempSync(join6(artifactParent, `.${basename3(artifactRoot)}-project-files-`));
|
|
5806
5871
|
copyMiniGameBundleOutput(input.runtimeBundleRoot, stagingRoot);
|
|
5807
5872
|
copyMiniGameBundleOutput(input.gameBundleRoot, stagingRoot);
|
|
5808
|
-
copyMiniGameArtifactFile(input.effectiveTargetConfigSource,
|
|
5873
|
+
copyMiniGameArtifactFile(input.effectiveTargetConfigSource, join6(stagingRoot, miniGameEffectiveTargetConfigFileName), miniGameEffectiveTargetConfigFileName);
|
|
5809
5874
|
stageMiniGameIconEvidence(input.generatedIcons, stagingRoot);
|
|
5810
5875
|
input.writeProjectFiles(projectFilesRoot);
|
|
5811
5876
|
copyMiniGameBundleOutput(projectFilesRoot, stagingRoot);
|
|
@@ -5839,7 +5904,7 @@ function assertMiniGameArtifactOutputDirectory(artifactRoot, projectRoot) {
|
|
|
5839
5904
|
let candidate = artifact;
|
|
5840
5905
|
while (candidate !== project) {
|
|
5841
5906
|
if (existsSync10(candidate)) {
|
|
5842
|
-
const status =
|
|
5907
|
+
const status = lstatSync7(candidate);
|
|
5843
5908
|
if (status.isSymbolicLink()) {
|
|
5844
5909
|
throw new Error("Mini-game artifact output must not traverse a symbolic link: " + candidate);
|
|
5845
5910
|
}
|
|
@@ -5896,16 +5961,16 @@ function assertDisjointMiniGameTargetOutputs(targets, resolvePath, protectedOutp
|
|
|
5896
5961
|
}
|
|
5897
5962
|
function writeMiniGameArtifactEvidence(input) {
|
|
5898
5963
|
const artifactRoot = resolve11(input.artifactRoot);
|
|
5899
|
-
const evidencePath =
|
|
5964
|
+
const evidencePath = join6(artifactRoot, miniGameArtifactEvidenceFileName);
|
|
5900
5965
|
rmSync5(evidencePath, { force: true });
|
|
5901
5966
|
const files = listMiniGameArtifactFiles(artifactRoot).map((file) => ({
|
|
5902
5967
|
path: file.path,
|
|
5903
5968
|
size: file.bytes,
|
|
5904
|
-
sha256: sha2563(
|
|
5969
|
+
sha256: sha2563(readFileSync14(join6(artifactRoot, file.path)))
|
|
5905
5970
|
}));
|
|
5906
5971
|
const effectiveTargetConfig = requireEvidenceFile(artifactRoot, files, miniGameEffectiveTargetConfigFileName);
|
|
5907
5972
|
const iconManifest = requireEvidenceFile(artifactRoot, files, miniGameIconManifestFileName);
|
|
5908
|
-
const gameConfig = readJson(
|
|
5973
|
+
const gameConfig = readJson(join6(artifactRoot, "game.json"), "Mini-game game.json");
|
|
5909
5974
|
let packageSize = assertMiniGamePackageBudget({
|
|
5910
5975
|
artifactRoot,
|
|
5911
5976
|
gameConfig,
|
|
@@ -5933,7 +5998,7 @@ function writeMiniGameArtifactEvidence(input) {
|
|
|
5933
5998
|
}
|
|
5934
5999
|
function verifyMiniGameArtifactEvidence(input) {
|
|
5935
6000
|
const artifactRoot = resolve11(input.artifactRoot);
|
|
5936
|
-
const evidencePath =
|
|
6001
|
+
const evidencePath = join6(artifactRoot, miniGameArtifactEvidenceFileName);
|
|
5937
6002
|
const parsed = readJson(evidencePath, "Mini-game artifact evidence");
|
|
5938
6003
|
const evidence = assertMiniGameArtifactEvidenceShape(parsed);
|
|
5939
6004
|
for (const [field, expected] of [
|
|
@@ -5964,7 +6029,7 @@ function verifyMiniGameArtifactEvidence(input) {
|
|
|
5964
6029
|
if (actual === void 0 || actual.bytes !== file.size) {
|
|
5965
6030
|
throw new Error(`Mini-game artifact evidence size mismatch: ${file.path}`);
|
|
5966
6031
|
}
|
|
5967
|
-
if (sha2563(
|
|
6032
|
+
if (sha2563(readFileSync14(join6(artifactRoot, file.path))) !== file.sha256) {
|
|
5968
6033
|
throw new Error(`Mini-game artifact evidence digest mismatch: ${file.path}`);
|
|
5969
6034
|
}
|
|
5970
6035
|
}
|
|
@@ -5972,7 +6037,7 @@ function verifyMiniGameArtifactEvidence(input) {
|
|
|
5972
6037
|
verifyNamedDigest(artifactRoot, evidence.iconManifest, miniGameIconManifestFileName, "icon manifest");
|
|
5973
6038
|
const packageSize = assertMiniGamePackageBudget({
|
|
5974
6039
|
artifactRoot,
|
|
5975
|
-
gameConfig: readJson(
|
|
6040
|
+
gameConfig: readJson(join6(artifactRoot, "game.json"), "Mini-game game.json"),
|
|
5976
6041
|
budget: input.budget
|
|
5977
6042
|
});
|
|
5978
6043
|
if (JSON.stringify(packageSize) !== JSON.stringify(evidence.packageSize)) {
|
|
@@ -5985,14 +6050,14 @@ function stageMiniGameIconEvidence(generated, artifactRoot) {
|
|
|
5985
6050
|
const files = [
|
|
5986
6051
|
{
|
|
5987
6052
|
source: generated.manifestPath,
|
|
5988
|
-
destination:
|
|
6053
|
+
destination: join6(artifactRoot, miniGameIconManifestFileName),
|
|
5989
6054
|
relativePath: miniGameIconManifestFileName
|
|
5990
6055
|
},
|
|
5991
6056
|
...generated.manifest.outputs.map((output) => {
|
|
5992
6057
|
assertMiniGameArtifactRelativePath(output.path, "Mini-game icon output");
|
|
5993
6058
|
return {
|
|
5994
|
-
source:
|
|
5995
|
-
destination:
|
|
6059
|
+
source: join6(generated.outputDir, basename3(output.path)),
|
|
6060
|
+
destination: join6(artifactRoot, output.path),
|
|
5996
6061
|
relativePath: output.path
|
|
5997
6062
|
};
|
|
5998
6063
|
})
|
|
@@ -6023,7 +6088,7 @@ function configuredNonMiniGameOutputs(targets, resolvePath) {
|
|
|
6023
6088
|
return Object.entries(targets).flatMap(([name, target2]) => {
|
|
6024
6089
|
const viteOutput = {
|
|
6025
6090
|
name: `${name} Vite output`,
|
|
6026
|
-
path: resolvePath(
|
|
6091
|
+
path: resolvePath(join6(target2.gameApp, "dist"))
|
|
6027
6092
|
};
|
|
6028
6093
|
switch (target2.kind) {
|
|
6029
6094
|
case "web":
|
|
@@ -6045,7 +6110,7 @@ function configuredNonMiniGameOutputs(targets, resolvePath) {
|
|
|
6045
6110
|
{ name: `${name} web staging output`, path: resolvePath(target2.webDir) },
|
|
6046
6111
|
{
|
|
6047
6112
|
name: `${name} wrapper build output`,
|
|
6048
|
-
path: resolvePath(
|
|
6113
|
+
path: resolvePath(join6(target2.wrapperApp, "dist"))
|
|
6049
6114
|
}
|
|
6050
6115
|
];
|
|
6051
6116
|
case "wechat-minigame":
|
|
@@ -6086,12 +6151,12 @@ function copyMiniGameBundleOutput(sourceRoot, artifactRoot) {
|
|
|
6086
6151
|
if (!existsSync10(source)) {
|
|
6087
6152
|
throw new Error(`Mini-game bundle output does not exist: ${source}`);
|
|
6088
6153
|
}
|
|
6089
|
-
for (const entry of
|
|
6090
|
-
const destination =
|
|
6154
|
+
for (const entry of readdirSync5(source)) {
|
|
6155
|
+
const destination = join6(artifactRoot, entry);
|
|
6091
6156
|
if (existsSync10(destination)) {
|
|
6092
6157
|
throw new Error(`Mini-game bundle outputs collide at ${entry}.`);
|
|
6093
6158
|
}
|
|
6094
|
-
cpSync2(
|
|
6159
|
+
cpSync2(join6(source, entry), destination, {
|
|
6095
6160
|
recursive: true,
|
|
6096
6161
|
errorOnExist: true,
|
|
6097
6162
|
force: false
|
|
@@ -6101,7 +6166,7 @@ function copyMiniGameBundleOutput(sourceRoot, artifactRoot) {
|
|
|
6101
6166
|
function replaceMiniGameArtifact(stagingRoot, artifactRoot) {
|
|
6102
6167
|
let backupRoot;
|
|
6103
6168
|
if (existsSync10(artifactRoot)) {
|
|
6104
|
-
backupRoot = mkdtempSync(
|
|
6169
|
+
backupRoot = mkdtempSync(join6(dirname6(artifactRoot), `.${basename3(artifactRoot)}-backup-`));
|
|
6105
6170
|
rmSync5(backupRoot, { force: true, recursive: true });
|
|
6106
6171
|
renameSync2(artifactRoot, backupRoot);
|
|
6107
6172
|
}
|
|
@@ -6141,11 +6206,11 @@ function assertMiniGameRequiredFiles(artifactRoot) {
|
|
|
6141
6206
|
miniGameEffectiveTargetConfigFileName,
|
|
6142
6207
|
miniGameIconManifestFileName
|
|
6143
6208
|
]) {
|
|
6144
|
-
if (!existsSync10(
|
|
6209
|
+
if (!existsSync10(join6(artifactRoot, file))) {
|
|
6145
6210
|
throw new Error(`Mini-game artifact is missing required file: ${file}`);
|
|
6146
6211
|
}
|
|
6147
6212
|
}
|
|
6148
|
-
const entry =
|
|
6213
|
+
const entry = readFileSync14(join6(artifactRoot, "game.js"), "utf8");
|
|
6149
6214
|
if (entry !== "require('./runtime.js');\nrequire('./game.bundle.js');\n") {
|
|
6150
6215
|
throw new Error("Mini-game game.js must load runtime.js before game.bundle.js.");
|
|
6151
6216
|
}
|
|
@@ -6155,7 +6220,7 @@ function assertMiniGameJavaScriptSafety(artifactRoot, forbiddenMarkers, forbidde
|
|
|
6155
6220
|
const gameOwnedGlobals = new Set(forbiddenGameBundleGlobals);
|
|
6156
6221
|
const noForbiddenGlobals = /* @__PURE__ */ new Set();
|
|
6157
6222
|
for (const file of javascript) {
|
|
6158
|
-
const source =
|
|
6223
|
+
const source = readFileSync14(join6(artifactRoot, file.path), "utf8");
|
|
6159
6224
|
assertMiniGameJavaScriptAstSafety(source, file.path, file.path === "runtime.js" ? noForbiddenGlobals : gameOwnedGlobals);
|
|
6160
6225
|
for (const { pattern, label } of forbiddenJavaScriptPatterns) {
|
|
6161
6226
|
if (pattern.test(source)) {
|
|
@@ -8164,7 +8229,7 @@ function createEvidence(input, files, effectiveTargetConfig, iconManifest, packa
|
|
|
8164
8229
|
}
|
|
8165
8230
|
function requireEvidenceFile(artifactRoot, files, path10) {
|
|
8166
8231
|
const file = files.find((candidate) => candidate.path === path10);
|
|
8167
|
-
if (file === void 0 || !existsSync10(
|
|
8232
|
+
if (file === void 0 || !existsSync10(join6(artifactRoot, path10))) {
|
|
8168
8233
|
throw new Error(`Mini-game artifact is missing required evidence file: ${path10}`);
|
|
8169
8234
|
}
|
|
8170
8235
|
return file;
|
|
@@ -8234,14 +8299,14 @@ function verifyNamedDigest(artifactRoot, reference, expectedPath, label) {
|
|
|
8234
8299
|
if (reference.path !== expectedPath) {
|
|
8235
8300
|
throw new Error(`Mini-game artifact ${label} path mismatch.`);
|
|
8236
8301
|
}
|
|
8237
|
-
const digest = sha2563(
|
|
8302
|
+
const digest = sha2563(readFileSync14(join6(artifactRoot, reference.path)));
|
|
8238
8303
|
if (digest !== reference.sha256) {
|
|
8239
8304
|
throw new Error(`Mini-game artifact ${label} digest mismatch.`);
|
|
8240
8305
|
}
|
|
8241
8306
|
}
|
|
8242
8307
|
function readJson(path10, label) {
|
|
8243
8308
|
try {
|
|
8244
|
-
return JSON.parse(
|
|
8309
|
+
return JSON.parse(readFileSync14(path10, "utf8"));
|
|
8245
8310
|
} catch (error) {
|
|
8246
8311
|
throw new Error(`${label} is unreadable: ${formatError6(error)}`);
|
|
8247
8312
|
}
|
|
@@ -8275,16 +8340,16 @@ function formatError6(error) {
|
|
|
8275
8340
|
|
|
8276
8341
|
// node_modules/.cache/mpgd-native-build/tools/target/minigame-project-files.js
|
|
8277
8342
|
import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync9 } from "node:fs";
|
|
8278
|
-
import { join as
|
|
8343
|
+
import { join as join7 } from "node:path";
|
|
8279
8344
|
var wechatStagingAppId2 = "wx0000000000000000";
|
|
8280
8345
|
function writeWechatMiniGameProjectFiles(input) {
|
|
8281
8346
|
assertWechatAppId(input.appId, input.production);
|
|
8282
8347
|
mkdirSync7(input.artifactRoot, { recursive: true });
|
|
8283
|
-
writeFileSync9(
|
|
8284
|
-
writeJson(
|
|
8348
|
+
writeFileSync9(join7(input.artifactRoot, "game.js"), "require('./runtime.js');\nrequire('./game.bundle.js');\n");
|
|
8349
|
+
writeJson(join7(input.artifactRoot, "game.json"), {
|
|
8285
8350
|
deviceOrientation: input.orientation
|
|
8286
8351
|
});
|
|
8287
|
-
writeJson(
|
|
8352
|
+
writeJson(join7(input.artifactRoot, "project.config.json"), {
|
|
8288
8353
|
description: "Experimental mpgd Phaser Canvas Mini Game validation build.",
|
|
8289
8354
|
setting: {
|
|
8290
8355
|
urlCheck: input.production,
|
|
@@ -8348,7 +8413,7 @@ function configuredFileExists(baseDir, file) {
|
|
|
8348
8413
|
|
|
8349
8414
|
// node_modules/.cache/mpgd-native-build/tools/target/native-build-attempt.js
|
|
8350
8415
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
8351
|
-
import { existsSync as existsSync12, mkdirSync as mkdirSync8, readFileSync as
|
|
8416
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync8, readFileSync as readFileSync15, renameSync as renameSync3, rmSync as rmSync6, writeFileSync as writeFileSync10 } from "node:fs";
|
|
8352
8417
|
import path3 from "node:path";
|
|
8353
8418
|
function nativeBuildAttemptPath(gameRoot, target2) {
|
|
8354
8419
|
assertDeploymentTargetName(target2);
|
|
@@ -8359,7 +8424,7 @@ function readNativeBuildAttempt(gameRoot, target2) {
|
|
|
8359
8424
|
if (!existsSync12(file)) {
|
|
8360
8425
|
return void 0;
|
|
8361
8426
|
}
|
|
8362
|
-
const parsed = JSON.parse(
|
|
8427
|
+
const parsed = JSON.parse(readFileSync15(file, "utf8"));
|
|
8363
8428
|
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
8364
8429
|
throw new Error("Native build status must be an object.");
|
|
8365
8430
|
}
|
|
@@ -8425,13 +8490,13 @@ function isProcessAlive(pid) {
|
|
|
8425
8490
|
}
|
|
8426
8491
|
|
|
8427
8492
|
// node_modules/.cache/mpgd-native-build/tools/target/native-build-execution.js
|
|
8428
|
-
import { existsSync as existsSync21, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, readdirSync as
|
|
8493
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, readdirSync as readdirSync7, rmSync as rmSync10, statSync as statSync6 } from "node:fs";
|
|
8429
8494
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
8430
|
-
import { dirname as dirname8, isAbsolute as isAbsolute9, join as
|
|
8495
|
+
import { dirname as dirname8, isAbsolute as isAbsolute9, join as join9 } from "node:path";
|
|
8431
8496
|
|
|
8432
8497
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/ios-signing-session.js
|
|
8433
8498
|
import { createHash as createHash8, randomBytes } from "node:crypto";
|
|
8434
|
-
import { chmodSync, constants, copyFileSync as copyFileSync3, existsSync as existsSync13, lstatSync as
|
|
8499
|
+
import { chmodSync, constants, copyFileSync as copyFileSync3, existsSync as existsSync13, lstatSync as lstatSync8, mkdirSync as mkdirSync9, mkdtempSync as mkdtempSync2, readFileSync as readFileSync16, rmSync as rmSync7, writeFileSync as writeFileSync11 } from "node:fs";
|
|
8435
8500
|
import { tmpdir } from "node:os";
|
|
8436
8501
|
import path4 from "node:path";
|
|
8437
8502
|
import { fileURLToPath } from "node:url";
|
|
@@ -8851,7 +8916,7 @@ async function prepareIosSigningSession(input) {
|
|
|
8851
8916
|
timeoutMs: 3e4,
|
|
8852
8917
|
signal: input.signal
|
|
8853
8918
|
});
|
|
8854
|
-
const profile2 = inspectIosDistributionProfile(parseIosProfilePlist(
|
|
8919
|
+
const profile2 = inspectIosDistributionProfile(parseIosProfilePlist(readFileSync16(decodedXml, "utf8")), { bundleId: input.bundleId, teamId: input.teamId, certificateSha256 });
|
|
8855
8920
|
const profileDirectory = path4.join(ownedRoot, "Library", "Developer", "Xcode", "UserData", "Provisioning Profiles");
|
|
8856
8921
|
mkdirSync9(profileDirectory, { recursive: true, mode: 448 });
|
|
8857
8922
|
const destination = path4.join(profileDirectory, `${profile2.uuid}.mobileprovision`);
|
|
@@ -8859,7 +8924,7 @@ async function prepareIosSigningSession(input) {
|
|
|
8859
8924
|
throw new Error("The iOS provisioning profile destination must not be a symlink.");
|
|
8860
8925
|
}
|
|
8861
8926
|
if (existsSync13(destination)) {
|
|
8862
|
-
if (!
|
|
8927
|
+
if (!readFileSync16(destination).equals(readFileSync16(profileFile))) {
|
|
8863
8928
|
throw new Error("An existing iOS provisioning profile has the same UUID but different bytes.");
|
|
8864
8929
|
}
|
|
8865
8930
|
} else {
|
|
@@ -8944,13 +9009,13 @@ function removeOwnedSigningMaterial(root, profile2) {
|
|
|
8944
9009
|
}
|
|
8945
9010
|
}
|
|
8946
9011
|
function fileDigest(file) {
|
|
8947
|
-
return createHash8("sha256").update(
|
|
9012
|
+
return createHash8("sha256").update(readFileSync16(file)).digest("hex");
|
|
8948
9013
|
}
|
|
8949
9014
|
function requiredCredentialFile(file, label) {
|
|
8950
9015
|
const absolute = path4.resolve(file);
|
|
8951
9016
|
let stat;
|
|
8952
9017
|
try {
|
|
8953
|
-
stat =
|
|
9018
|
+
stat = lstatSync8(absolute);
|
|
8954
9019
|
} catch {
|
|
8955
9020
|
throw new Error(`${label} is missing or unreadable.`);
|
|
8956
9021
|
}
|
|
@@ -8961,7 +9026,7 @@ function requiredCredentialFile(file, label) {
|
|
|
8961
9026
|
}
|
|
8962
9027
|
function isSymlink(file) {
|
|
8963
9028
|
try {
|
|
8964
|
-
return
|
|
9029
|
+
return lstatSync8(file).isSymbolicLink();
|
|
8965
9030
|
} catch {
|
|
8966
9031
|
return false;
|
|
8967
9032
|
}
|
|
@@ -9108,13 +9173,13 @@ function runCommand(command, args) {
|
|
|
9108
9173
|
|
|
9109
9174
|
// node_modules/.cache/mpgd-native-build/tools/target/native-build-stage.js
|
|
9110
9175
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
9111
|
-
import { cpSync as cpSync3, existsSync as existsSync15, lstatSync as
|
|
9176
|
+
import { cpSync as cpSync3, existsSync as existsSync15, lstatSync as lstatSync9, realpathSync as realpathSync7, rmSync as rmSync8 } from "node:fs";
|
|
9112
9177
|
import path5 from "node:path";
|
|
9113
9178
|
function createNativeShellStage(input) {
|
|
9114
9179
|
const sourceShell = realpathSync7(input.shellApp);
|
|
9115
9180
|
const declaredShell = path5.resolve(input.shellApp);
|
|
9116
9181
|
const declaredWeb = path5.resolve(input.webDir);
|
|
9117
|
-
if (!
|
|
9182
|
+
if (!lstatSync9(sourceShell).isDirectory()) {
|
|
9118
9183
|
throw new Error("Native shell must be a directory.");
|
|
9119
9184
|
}
|
|
9120
9185
|
const webRelative = path5.relative(declaredShell, declaredWeb);
|
|
@@ -9126,7 +9191,7 @@ function createNativeShellStage(input) {
|
|
|
9126
9191
|
for (const segment of webRelative.split(path5.sep)) {
|
|
9127
9192
|
checkedPath = path5.join(checkedPath, segment);
|
|
9128
9193
|
try {
|
|
9129
|
-
if (
|
|
9194
|
+
if (lstatSync9(checkedPath).isSymbolicLink()) {
|
|
9130
9195
|
throw new Error("Native web directory must not traverse a symbolic link.");
|
|
9131
9196
|
}
|
|
9132
9197
|
} catch (error) {
|
|
@@ -9135,7 +9200,7 @@ function createNativeShellStage(input) {
|
|
|
9135
9200
|
}
|
|
9136
9201
|
}
|
|
9137
9202
|
}
|
|
9138
|
-
if (existsSync15(sourceWeb) && !
|
|
9203
|
+
if (existsSync15(sourceWeb) && !lstatSync9(sourceWeb).isDirectory()) {
|
|
9139
9204
|
throw new Error("Native web directory must be a directory when it exists.");
|
|
9140
9205
|
}
|
|
9141
9206
|
const stage = path5.join(path5.dirname(sourceShell), `.mpgd-native-stage-${randomUUID4()}`);
|
|
@@ -9152,7 +9217,7 @@ function createNativeShellStage(input) {
|
|
|
9152
9217
|
if (segments.some((segment) => [".gradle", "DerivedData", "Pods", "build"].includes(segment))) {
|
|
9153
9218
|
return false;
|
|
9154
9219
|
}
|
|
9155
|
-
if (relative10 !== "" &&
|
|
9220
|
+
if (relative10 !== "" && lstatSync9(source).isSymbolicLink() && segments[0] !== "node_modules") {
|
|
9156
9221
|
throw new Error(`Native shell symlink is unsupported in mutable project inputs: ${relative10}.`);
|
|
9157
9222
|
}
|
|
9158
9223
|
return true;
|
|
@@ -9172,7 +9237,7 @@ function createNativeShellStage(input) {
|
|
|
9172
9237
|
}
|
|
9173
9238
|
|
|
9174
9239
|
// node_modules/.cache/mpgd-native-build/tools/target/native-shell-csp.js
|
|
9175
|
-
import { existsSync as existsSync16, lstatSync as
|
|
9240
|
+
import { existsSync as existsSync16, lstatSync as lstatSync10, readFileSync as readFileSync17, writeFileSync as writeFileSync12 } from "node:fs";
|
|
9176
9241
|
import path6 from "node:path";
|
|
9177
9242
|
var capacitorShellContentSecurityPolicy = [
|
|
9178
9243
|
"default-src 'self'",
|
|
@@ -9218,10 +9283,10 @@ ${capacitorShellCspMetaTag}${html.slice(insertAt)}`;
|
|
|
9218
9283
|
}
|
|
9219
9284
|
function applyCapacitorShellCsp(webDir) {
|
|
9220
9285
|
const indexFile = path6.join(webDir, "index.html");
|
|
9221
|
-
if (!existsSync16(indexFile) ||
|
|
9286
|
+
if (!existsSync16(indexFile) || lstatSync10(indexFile).isSymbolicLink()) {
|
|
9222
9287
|
throw new Error("Capacitor shell web bundle must contain a regular index.html.");
|
|
9223
9288
|
}
|
|
9224
|
-
const html =
|
|
9289
|
+
const html = readFileSync17(indexFile, "utf8");
|
|
9225
9290
|
const hardened = injectCapacitorShellCsp(html);
|
|
9226
9291
|
if (hardened !== html) {
|
|
9227
9292
|
writeFileSync12(indexFile, hardened);
|
|
@@ -9230,7 +9295,7 @@ function applyCapacitorShellCsp(webDir) {
|
|
|
9230
9295
|
|
|
9231
9296
|
// node_modules/.cache/mpgd-native-build/tools/target/native-ios-inspection.js
|
|
9232
9297
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
9233
|
-
import { existsSync as existsSync17, mkdtempSync as mkdtempSync3, readFileSync as
|
|
9298
|
+
import { existsSync as existsSync17, mkdtempSync as mkdtempSync3, readFileSync as readFileSync18, rmSync as rmSync9, statSync as statSync4 } from "node:fs";
|
|
9234
9299
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
9235
9300
|
import path7 from "node:path";
|
|
9236
9301
|
function inspectSignedIosArchive(archive, input) {
|
|
@@ -9312,7 +9377,7 @@ ${signingInfo.stderr}`;
|
|
|
9312
9377
|
return { ...observed, teamId: input.expectedTeamId, signed: true };
|
|
9313
9378
|
}
|
|
9314
9379
|
function assertNoDebugServer(file) {
|
|
9315
|
-
const value = JSON.parse(
|
|
9380
|
+
const value = JSON.parse(readFileSync18(file, "utf8"));
|
|
9316
9381
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
9317
9382
|
throw new Error("Signed iOS app has malformed Capacitor configuration.");
|
|
9318
9383
|
}
|
|
@@ -9390,11 +9455,11 @@ function resolveIosSigningPlan(environment, mode) {
|
|
|
9390
9455
|
}
|
|
9391
9456
|
|
|
9392
9457
|
// node_modules/.cache/mpgd-native-build/tools/target/native-release-identity.js
|
|
9393
|
-
import { existsSync as existsSync20, readFileSync as
|
|
9394
|
-
import { dirname as dirname7, isAbsolute as isAbsolute8, join as
|
|
9458
|
+
import { existsSync as existsSync20, readFileSync as readFileSync20 } from "node:fs";
|
|
9459
|
+
import { dirname as dirname7, isAbsolute as isAbsolute8, join as join8, relative as relative8, resolve as resolve13 } from "node:path";
|
|
9395
9460
|
|
|
9396
9461
|
// node_modules/.cache/mpgd-native-build/packages/cli/src/capacitor-shell-starter.js
|
|
9397
|
-
import { chmodSync as chmodSync2, existsSync as existsSync19, lstatSync as
|
|
9462
|
+
import { chmodSync as chmodSync2, existsSync as existsSync19, lstatSync as lstatSync11, mkdirSync as mkdirSync10, readdirSync as readdirSync6, readFileSync as readFileSync19, realpathSync as realpathSync8, renameSync as renameSync4, unlinkSync as unlinkSync2, writeFileSync as writeFileSync13 } from "node:fs";
|
|
9398
9463
|
import path9 from "node:path";
|
|
9399
9464
|
import { DOMParser as DOMParser2 } from "@xmldom/xmldom";
|
|
9400
9465
|
|
|
@@ -9928,7 +9993,7 @@ function resolvesAndroidClass(nativeDirectory, qualified, sourceFiles, visited,
|
|
|
9928
9993
|
if (!isNativeFile(nativeDirectory, relative10)) {
|
|
9929
9994
|
continue;
|
|
9930
9995
|
}
|
|
9931
|
-
const source = stripSourceCommentsAndStrings(
|
|
9996
|
+
const source = stripSourceCommentsAndStrings(readFileSync19(path9.join(nativeDirectory, relative10), "utf8"));
|
|
9932
9997
|
const declaredPackage = /\bpackage\s+([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)+)\s*;?/u.exec(source)?.[1];
|
|
9933
9998
|
if (declaredPackage !== packageName) {
|
|
9934
9999
|
continue;
|
|
@@ -9985,10 +10050,10 @@ function listNativeFiles(nativeDirectory, relativeRoot, extension) {
|
|
|
9985
10050
|
while (pending.length > 0) {
|
|
9986
10051
|
const relative10 = pending.pop() ?? "";
|
|
9987
10052
|
const full = path9.join(nativeDirectory, relative10);
|
|
9988
|
-
if (!existsSync19(full) ||
|
|
10053
|
+
if (!existsSync19(full) || lstatSync11(full).isSymbolicLink()) {
|
|
9989
10054
|
continue;
|
|
9990
10055
|
}
|
|
9991
|
-
for (const entry of
|
|
10056
|
+
for (const entry of readdirSync6(full, { withFileTypes: true })) {
|
|
9992
10057
|
if (entry.isSymbolicLink()) {
|
|
9993
10058
|
continue;
|
|
9994
10059
|
}
|
|
@@ -10198,7 +10263,7 @@ function assertReferencedIosFiles(nativeDirectory, project, infoRelative) {
|
|
|
10198
10263
|
throw new Error(`Existing ios project is incomplete; referenced app file ${relative10} is missing.`);
|
|
10199
10264
|
}
|
|
10200
10265
|
}
|
|
10201
|
-
const info =
|
|
10266
|
+
const info = readFileSync19(path9.join(nativeDirectory, infoRelative), "utf8");
|
|
10202
10267
|
assertSceneDelegateFiles(nativeDirectory, info, "Release", compiledSources);
|
|
10203
10268
|
return compiledSources;
|
|
10204
10269
|
}
|
|
@@ -10386,11 +10451,11 @@ function isNativeEntry(directory, relative10) {
|
|
|
10386
10451
|
let current = directory;
|
|
10387
10452
|
for (const segment of within.split(path9.sep)) {
|
|
10388
10453
|
current = path9.join(current, segment);
|
|
10389
|
-
if (!existsSync19(current) ||
|
|
10454
|
+
if (!existsSync19(current) || lstatSync11(current).isSymbolicLink()) {
|
|
10390
10455
|
return false;
|
|
10391
10456
|
}
|
|
10392
10457
|
}
|
|
10393
|
-
return
|
|
10458
|
+
return lstatSync11(file).isFile() || lstatSync11(file).isDirectory();
|
|
10394
10459
|
}
|
|
10395
10460
|
function assertSceneDelegateFiles(nativeDirectory, source, label, compiledSources) {
|
|
10396
10461
|
const values = parsePlistDictionary(source, label);
|
|
@@ -10419,7 +10484,7 @@ function assertSceneDelegateFiles(nativeDirectory, source, label, compiledSource
|
|
|
10419
10484
|
if (!compiledSources.has(relative10)) {
|
|
10420
10485
|
return false;
|
|
10421
10486
|
}
|
|
10422
|
-
const text = stripSourceCommentsAndStrings(
|
|
10487
|
+
const text = stripSourceCommentsAndStrings(readFileSync19(path9.join(nativeDirectory, relative10), "utf8"));
|
|
10423
10488
|
return hasUsableTopLevelSwiftSceneDelegate(text, className);
|
|
10424
10489
|
})) {
|
|
10425
10490
|
throw new Error(`Existing ios project ${label} scene delegate ${delegate} is missing from App Sources.`);
|
|
@@ -10447,7 +10512,7 @@ function assertAndroidManifestResources(nativeDirectory) {
|
|
|
10447
10512
|
const manifestFiles = ["main", "release"].map((sourceSet) => path9.join(nativeDirectory, `app/src/${sourceSet}/AndroidManifest.xml`)).filter((file) => existsSync19(file));
|
|
10448
10513
|
const resourceRoots = ["main", "release"].map((sourceSet) => path9.join(nativeDirectory, `app/src/${sourceSet}/res`));
|
|
10449
10514
|
const references = manifestFiles.flatMap((file) => {
|
|
10450
|
-
const manifest =
|
|
10515
|
+
const manifest = readFileSync19(file, "utf8").replace(/<!--[\s\S]*?-->/gu, "");
|
|
10451
10516
|
return [...manifest.matchAll(/(?<![\w+])@([a-z]+)\/([A-Za-z_][A-Za-z0-9_.]*)/gu)];
|
|
10452
10517
|
});
|
|
10453
10518
|
for (const reference of references) {
|
|
@@ -10457,16 +10522,16 @@ function assertAndroidManifestResources(nativeDirectory) {
|
|
|
10457
10522
|
if (!existsSync19(resourceRoot)) {
|
|
10458
10523
|
return false;
|
|
10459
10524
|
}
|
|
10460
|
-
const folders =
|
|
10525
|
+
const folders = readdirSync6(resourceRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
10461
10526
|
return folders.some((folder) => {
|
|
10462
10527
|
const densityFallback = (type === "mipmap" || type === "drawable") && new RegExp(`^${type}-(?:ldpi|mdpi|hdpi|xhdpi|xxhdpi|xxxhdpi|nodpi|anydpi)$`, "u").test(folder);
|
|
10463
10528
|
if (folder === type || densityFallback) {
|
|
10464
|
-
return
|
|
10529
|
+
return readdirSync6(path9.join(resourceRoot, folder)).some((file) => file === `${name}.xml` || file.startsWith(`${name}.`));
|
|
10465
10530
|
}
|
|
10466
10531
|
if (folder !== "values") {
|
|
10467
10532
|
return false;
|
|
10468
10533
|
}
|
|
10469
|
-
return
|
|
10534
|
+
return readdirSync6(path9.join(resourceRoot, folder)).some((file) => file.endsWith(".xml") && readAndroidValueResource(path9.join(resourceRoot, folder, file), type, name).length > 0);
|
|
10470
10535
|
});
|
|
10471
10536
|
});
|
|
10472
10537
|
if (!found) {
|
|
@@ -10479,7 +10544,7 @@ function assertNativeDisplayName(nativeDirectory, platform, expectedDisplayName,
|
|
|
10479
10544
|
if (platform === "ios" && !isNativeFile(nativeDirectory, relative10)) {
|
|
10480
10545
|
throw new Error(`Existing ${platform} project is incomplete; native display name resource is missing.`);
|
|
10481
10546
|
}
|
|
10482
|
-
const source = platform === "ios" ?
|
|
10547
|
+
const source = platform === "ios" ? readFileSync19(path9.join(nativeDirectory, relative10), "utf8") : "";
|
|
10483
10548
|
const labels = platform === "ios" ? [parsePlistDictionary(source, "Release").get("CFBundleDisplayName")].filter((value) => value?.tagName === "string").map((value) => value?.textContent ?? "") : [];
|
|
10484
10549
|
if (platform === "ios" && (labels.length !== 1 || labels[0] !== expectedDisplayName)) {
|
|
10485
10550
|
throw new Error(`Existing ${platform} project display name differs or cannot be read safely.`);
|
|
@@ -10516,7 +10581,7 @@ function assertNativeDisplayName(nativeDirectory, platform, expectedDisplayName,
|
|
|
10516
10581
|
throw new Error("Existing android Release application label differs from the requested name.");
|
|
10517
10582
|
}
|
|
10518
10583
|
const appBuildFile = ["app/build.gradle", "app/build.gradle.kts"].map((relative11) => path9.join(nativeDirectory, relative11)).find((file) => existsSync19(file));
|
|
10519
|
-
const appGradle = appBuildFile === void 0 ? "" :
|
|
10584
|
+
const appGradle = appBuildFile === void 0 ? "" : readFileSync19(appBuildFile, "utf8");
|
|
10520
10585
|
const manifestPackage = main.parentNode?.getAttribute("package");
|
|
10521
10586
|
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
10587
|
const launcherNames = /* @__PURE__ */ new Set();
|
|
@@ -10559,13 +10624,13 @@ function assertAndroidReleaseDisplayName(shellApp, expectedDisplayName) {
|
|
|
10559
10624
|
function assertAndroidReleaseLauncherIntegrity(shellApp) {
|
|
10560
10625
|
const nativeDirectory = path9.join(shellApp, "android");
|
|
10561
10626
|
const gradleRelative = requireOneNativeFile(nativeDirectory, ["app/build.gradle", "app/build.gradle.kts"], "android");
|
|
10562
|
-
const gradle =
|
|
10627
|
+
const gradle = readFileSync19(path9.join(nativeDirectory, gradleRelative), "utf8");
|
|
10563
10628
|
assertAndroidLauncherClasses(nativeDirectory, gradle);
|
|
10564
10629
|
}
|
|
10565
10630
|
function assertIosReleaseDisplayName(shellApp, expectedDisplayName) {
|
|
10566
10631
|
const nativeDirectory = path9.join(shellApp, "ios");
|
|
10567
10632
|
const projectFile = path9.join(nativeDirectory, "App/App.xcodeproj/project.pbxproj");
|
|
10568
|
-
const project =
|
|
10633
|
+
const project = readFileSync19(projectFile, "utf8");
|
|
10569
10634
|
const infoRelative = path9.join("App", readIosReleaseInfoPlist(project));
|
|
10570
10635
|
if (!isNativeFile(nativeDirectory, infoRelative)) {
|
|
10571
10636
|
throw new Error("Existing ios project Release Info.plist is missing or unsafe.");
|
|
@@ -10587,9 +10652,9 @@ function assertIosArchiveScheme(shellApp) {
|
|
|
10587
10652
|
if (!isNativeFile(nativeDirectory, projectRelative) || !isNativeFile(nativeDirectory, schemeRelative)) {
|
|
10588
10653
|
throw new Error("Existing ios project shared App archive scheme is missing or unsafe.");
|
|
10589
10654
|
}
|
|
10590
|
-
const project =
|
|
10655
|
+
const project = readFileSync19(path9.join(nativeDirectory, projectRelative), "utf8");
|
|
10591
10656
|
const appTargetId = readIosAppTargetId(project);
|
|
10592
|
-
const schemeSource =
|
|
10657
|
+
const schemeSource = readFileSync19(path9.join(nativeDirectory, schemeRelative), "utf8");
|
|
10593
10658
|
const scheme = parseXml(schemeSource, "ios project App archive scheme").documentElement;
|
|
10594
10659
|
if (scheme?.tagName !== "Scheme") {
|
|
10595
10660
|
throw new Error("Existing ios project App archive scheme is malformed.");
|
|
@@ -10616,7 +10681,7 @@ function hasAndroidMergerDirectiveDeep(element) {
|
|
|
10616
10681
|
return hasAndroidMergerDirective(element) || childElements(element).some(hasAndroidMergerDirectiveDeep);
|
|
10617
10682
|
}
|
|
10618
10683
|
function readAndroidApplication(file, required = true) {
|
|
10619
|
-
const root = parseXml(
|
|
10684
|
+
const root = parseXml(readFileSync19(file, "utf8"), "android manifest").documentElement;
|
|
10620
10685
|
const application = root === null ? void 0 : childElements(root).find((element) => element.tagName === "application");
|
|
10621
10686
|
if (root?.tagName !== "manifest" || required && application === void 0) {
|
|
10622
10687
|
throw new Error("Existing android project manifest application is missing.");
|
|
@@ -10645,9 +10710,9 @@ function readAndroidString(nativeDirectory, key) {
|
|
|
10645
10710
|
throw new Error("Existing android project application label is unsupported.");
|
|
10646
10711
|
}
|
|
10647
10712
|
const overlay = path9.join(nativeDirectory, "app/src/release/res/values");
|
|
10648
|
-
const overlayValues = existsSync19(overlay) &&
|
|
10713
|
+
const overlayValues = existsSync19(overlay) && lstatSync11(overlay).isDirectory() ? readdirSync6(overlay).filter((file) => file.endsWith(".xml")).flatMap((file) => readAndroidValueResource(path9.join(overlay, file), "string", key)) : [];
|
|
10649
10714
|
const main = path9.join(nativeDirectory, "app/src/main/res/values");
|
|
10650
|
-
const mainValues = existsSync19(main) &&
|
|
10715
|
+
const mainValues = existsSync19(main) && lstatSync11(main).isDirectory() ? readdirSync6(main).filter((file) => file.endsWith(".xml")).flatMap((file) => readAndroidValueResource(path9.join(main, file), "string", key)) : [];
|
|
10651
10716
|
const values = overlayValues.length > 0 ? overlayValues : mainValues;
|
|
10652
10717
|
if (values.length !== 1) {
|
|
10653
10718
|
throw new Error("Existing android project application label resource is missing or ambiguous.");
|
|
@@ -10659,7 +10724,7 @@ function readAndroidString(nativeDirectory, key) {
|
|
|
10659
10724
|
return values[0] ?? "";
|
|
10660
10725
|
}
|
|
10661
10726
|
function readAndroidValueResource(file, type, name) {
|
|
10662
|
-
const root = parseXml(
|
|
10727
|
+
const root = parseXml(readFileSync19(file, "utf8"), "android values resource").documentElement;
|
|
10663
10728
|
if (root?.tagName !== "resources") {
|
|
10664
10729
|
throw new Error("Existing android values resource is malformed.");
|
|
10665
10730
|
}
|
|
@@ -10727,11 +10792,11 @@ function isNativeFile(directory, relative10) {
|
|
|
10727
10792
|
let current = directory;
|
|
10728
10793
|
for (const segment of within.split(path9.sep)) {
|
|
10729
10794
|
current = path9.join(current, segment);
|
|
10730
|
-
if (!existsSync19(current) ||
|
|
10795
|
+
if (!existsSync19(current) || lstatSync11(current).isSymbolicLink()) {
|
|
10731
10796
|
return false;
|
|
10732
10797
|
}
|
|
10733
10798
|
}
|
|
10734
|
-
return
|
|
10799
|
+
return lstatSync11(file).isFile();
|
|
10735
10800
|
}
|
|
10736
10801
|
|
|
10737
10802
|
// node_modules/.cache/mpgd-native-build/tools/target/native-release-identity.js
|
|
@@ -10743,14 +10808,14 @@ function assertNativeReleaseIdentity(input) {
|
|
|
10743
10808
|
assertNativeVersionMatchesGameVersion(expected, input.environment, input.required);
|
|
10744
10809
|
if (expected.kind === "android") {
|
|
10745
10810
|
const candidates = [
|
|
10746
|
-
|
|
10747
|
-
|
|
10811
|
+
join8(input.shellApp, "android/app/build.gradle"),
|
|
10812
|
+
join8(input.shellApp, "android/app/build.gradle.kts")
|
|
10748
10813
|
].filter((file) => existsSync20(file));
|
|
10749
10814
|
if (candidates.length !== 1) {
|
|
10750
10815
|
throw new Error("Android native release requires exactly one Gradle app build file.");
|
|
10751
10816
|
}
|
|
10752
10817
|
assertAndroidIdentity(candidates[0] ?? "", expected);
|
|
10753
|
-
assertAndroidAppliedScripts(candidates[0] ?? "",
|
|
10818
|
+
assertAndroidAppliedScripts(candidates[0] ?? "", join8(input.shellApp, "android"));
|
|
10754
10819
|
if (input.required) {
|
|
10755
10820
|
const name = requireValue(input.metadata?.displayName, "Android target metadata displayName");
|
|
10756
10821
|
assertAndroidReleaseDisplayName(input.shellApp, name);
|
|
@@ -10758,7 +10823,7 @@ function assertNativeReleaseIdentity(input) {
|
|
|
10758
10823
|
}
|
|
10759
10824
|
return;
|
|
10760
10825
|
}
|
|
10761
|
-
assertIosIdentity(
|
|
10826
|
+
assertIosIdentity(join8(input.shellApp, "ios/App/App.xcodeproj/project.pbxproj"), expected);
|
|
10762
10827
|
if (input.required) {
|
|
10763
10828
|
const name = requireValue(input.metadata?.displayName, "iOS target metadata displayName");
|
|
10764
10829
|
assertIosReleaseDisplayName(input.shellApp, name);
|
|
@@ -10897,7 +10962,7 @@ function assertAndroidAppliedScripts(appBuild, androidRoot) {
|
|
|
10897
10962
|
throw new Error("Native release preflight cannot resolve an applied Gradle script.");
|
|
10898
10963
|
}
|
|
10899
10964
|
};
|
|
10900
|
-
const rootFiles = ["build.gradle", "build.gradle.kts"].map((name) =>
|
|
10965
|
+
const rootFiles = ["build.gradle", "build.gradle.kts"].map((name) => join8(androidRoot, name)).filter((file) => existsSync20(file));
|
|
10901
10966
|
if (rootFiles.length !== 1) {
|
|
10902
10967
|
throw new Error("Native release preflight requires one Android root Gradle build file.");
|
|
10903
10968
|
}
|
|
@@ -10907,7 +10972,7 @@ function assertAndroidAppliedScripts(appBuild, androidRoot) {
|
|
|
10907
10972
|
if (/\b(?:afterEvaluate|projectsEvaluated)\b/u.test(rootCode) && /\b(?:project|subprojects|allprojects|android)\b/u.test(rootCode)) {
|
|
10908
10973
|
throw new Error("Native release preflight cannot resolve root Gradle app callbacks.");
|
|
10909
10974
|
}
|
|
10910
|
-
const settingsFiles = ["settings.gradle", "settings.gradle.kts"].map((name) =>
|
|
10975
|
+
const settingsFiles = ["settings.gradle", "settings.gradle.kts"].map((name) => join8(androidRoot, name)).filter((file) => existsSync20(file));
|
|
10911
10976
|
if (settingsFiles.length !== 1) {
|
|
10912
10977
|
throw new Error("Native release preflight requires one Android settings Gradle file.");
|
|
10913
10978
|
}
|
|
@@ -10931,7 +10996,7 @@ function assertIosIdentity(file, expected) {
|
|
|
10931
10996
|
assertIosSetting(releaseSettings, "MARKETING_VERSION", expected.marketingVersion, file);
|
|
10932
10997
|
assertIosSetting(releaseSettings, "CURRENT_PROJECT_VERSION", expected.buildNumber, file);
|
|
10933
10998
|
const plistRelative = readIosReleaseInfoPlist(source);
|
|
10934
|
-
const plist =
|
|
10999
|
+
const plist = join8(dirname7(dirname7(file)), plistRelative);
|
|
10935
11000
|
assertIosReleasePlistIdentity(readRequiredFile(plist, "iOS Release Info.plist"));
|
|
10936
11001
|
}
|
|
10937
11002
|
function assertIosSetting(settings, key, expected, file) {
|
|
@@ -11234,7 +11299,7 @@ function readRequiredFile(file, label) {
|
|
|
11234
11299
|
if (!existsSync20(file)) {
|
|
11235
11300
|
throw new Error(`Missing ${label}: ${file}`);
|
|
11236
11301
|
}
|
|
11237
|
-
return
|
|
11302
|
+
return readFileSync20(file, "utf8");
|
|
11238
11303
|
}
|
|
11239
11304
|
function requireFinalSemVer2(value, label) {
|
|
11240
11305
|
const normalized = requireValue(value, label);
|
|
@@ -11376,7 +11441,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11376
11441
|
"CODE_SIGNING_ALLOWED=NO"
|
|
11377
11442
|
], environment, `${stagedShell}/ios`);
|
|
11378
11443
|
} else if (plan.mode === "simulator") {
|
|
11379
|
-
const buildRoot = mkdtempSync4(
|
|
11444
|
+
const buildRoot = mkdtempSync4(join9(tmpdir3(), "mpgd-ios-simulator-"));
|
|
11380
11445
|
releaseArtifact = `${artifactRoot}/App.app`;
|
|
11381
11446
|
try {
|
|
11382
11447
|
input.run("xcodebuild", [
|
|
@@ -11390,7 +11455,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11390
11455
|
"-sdk",
|
|
11391
11456
|
"iphonesimulator",
|
|
11392
11457
|
`SYMROOT=${buildRoot}`,
|
|
11393
|
-
`OBJROOT=${
|
|
11458
|
+
`OBJROOT=${join9(buildRoot, "Intermediates.noindex")}`,
|
|
11394
11459
|
"INFOPLIST_FILE=App/Info-Smoke.plist",
|
|
11395
11460
|
"EXCLUDED_SOURCE_FILE_NAMES=Main.storyboard LaunchScreen.storyboard Assets.xcassets",
|
|
11396
11461
|
"ASSETCATALOG_COMPILER_APPICON_NAME=",
|
|
@@ -11434,7 +11499,7 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11434
11499
|
inspectSignedIosArchive(input.targetPath(archiveArtifact), expectedIosIdentity);
|
|
11435
11500
|
releaseArtifact = archiveArtifact;
|
|
11436
11501
|
if (plan.mode === "store-export") {
|
|
11437
|
-
const exportRoot = mkdtempSync4(
|
|
11502
|
+
const exportRoot = mkdtempSync4(join9(tmpdir3(), "mpgd-ios-export-"));
|
|
11438
11503
|
try {
|
|
11439
11504
|
input.run("xcodebuild", [
|
|
11440
11505
|
"-exportArchive",
|
|
@@ -11445,12 +11510,12 @@ function executeIosBuildWithEnvironment(input, stagedShell, environment) {
|
|
|
11445
11510
|
"-exportOptionsPlist",
|
|
11446
11511
|
requireString(signing.exportOptionsPlist, "iOS export options plist")
|
|
11447
11512
|
], environment, `${stagedShell}/ios`);
|
|
11448
|
-
const exportedIpas =
|
|
11513
|
+
const exportedIpas = readdirSync7(exportRoot).filter((name) => name.endsWith(".ipa"));
|
|
11449
11514
|
if (exportedIpas.length !== 1) {
|
|
11450
11515
|
throw new Error("iOS store export must produce exactly one IPA.");
|
|
11451
11516
|
}
|
|
11452
11517
|
releaseArtifact = `${artifactRoot}/App.ipa`;
|
|
11453
|
-
input.copyFile(
|
|
11518
|
+
input.copyFile(join9(exportRoot, exportedIpas[0] ?? ""), input.targetPath(releaseArtifact));
|
|
11454
11519
|
inspectSignedIosIpa(input.targetPath(releaseArtifact), expectedIosIdentity);
|
|
11455
11520
|
} finally {
|
|
11456
11521
|
rmSync10(exportRoot, { recursive: true, force: true });
|
|
@@ -11628,7 +11693,7 @@ assertProductionTargetReadiness({
|
|
|
11628
11693
|
...runtimeTargetConfigMatrix.targets[targetName] === void 0 ? {} : { targetPolicy: runtimeTargetConfigMatrix.targets[targetName] },
|
|
11629
11694
|
...gameServicesUrl === void 0 ? {} : { gameServicesUrl }
|
|
11630
11695
|
});
|
|
11631
|
-
var nativeWebBundle = nativePlan === void 0 ? void 0 : mkdtempSync5(
|
|
11696
|
+
var nativeWebBundle = nativePlan === void 0 ? void 0 : mkdtempSync5(join10(tmpdir4(), "mpgd-native-web-"));
|
|
11632
11697
|
var nativeArtifactRoot = nativeAttempt === void 0 ? void 0 : `release-output/native/${targetName}/${safeArtifactFileStem(profile)}/${nativeAttempt.runId}`;
|
|
11633
11698
|
var nativeCompleted = false;
|
|
11634
11699
|
var runtimeTargetConfigMatrixFile = createRuntimeTargetConfigMatrixFile(runtimeTargetConfigMatrix);
|
|
@@ -11676,10 +11741,10 @@ try {
|
|
|
11676
11741
|
case "wechat-minigame": {
|
|
11677
11742
|
const outputConfigPath = requireString2(target.output, `${targetName}.output`);
|
|
11678
11743
|
const output = targetPath(outputConfigPath);
|
|
11679
|
-
const bundleRoot = mkdtempSync5(
|
|
11744
|
+
const bundleRoot = mkdtempSync5(join10(tmpdir4(), "mpgd-wechat-bundles-"));
|
|
11680
11745
|
try {
|
|
11681
|
-
const runtimeBundleRoot =
|
|
11682
|
-
const gameBundleRoot =
|
|
11746
|
+
const runtimeBundleRoot = join10(bundleRoot, "runtime");
|
|
11747
|
+
const gameBundleRoot = join10(bundleRoot, "game");
|
|
11683
11748
|
buildMiniGameBundle("runtime", runtimeBundleRoot, bundleRoot, gameApp, profile, env);
|
|
11684
11749
|
buildMiniGameBundle("game", gameBundleRoot, bundleRoot, gameApp, profile, env);
|
|
11685
11750
|
const effectiveTargetConfig = generateEffectiveTargetConfigArtifact(targetName, env);
|
|
@@ -11751,6 +11816,9 @@ try {
|
|
|
11751
11816
|
} else {
|
|
11752
11817
|
assertInstallableWebArtifact(output);
|
|
11753
11818
|
}
|
|
11819
|
+
if (target.adapter === "crazygames") {
|
|
11820
|
+
assertCrazyGamesArtifact(output);
|
|
11821
|
+
}
|
|
11754
11822
|
writeManifest(targetName, profile, outputConfigPath, env);
|
|
11755
11823
|
break;
|
|
11756
11824
|
}
|
|
@@ -11824,8 +11892,8 @@ try {
|
|
|
11824
11892
|
rmSync11(dirname9(runtimeTargetConfigMatrixFile), { force: true, recursive: true });
|
|
11825
11893
|
}
|
|
11826
11894
|
function createRuntimeTargetConfigMatrixFile(matrix) {
|
|
11827
|
-
const directory = mkdtempSync5(
|
|
11828
|
-
const file =
|
|
11895
|
+
const directory = mkdtempSync5(join10(tmpdir4(), "mpgd-target-config-matrix-"));
|
|
11896
|
+
const file = join10(directory, "matrix.json");
|
|
11829
11897
|
writeFileSync14(file, `${JSON.stringify(matrix)}
|
|
11830
11898
|
`);
|
|
11831
11899
|
return file;
|
|
@@ -11928,14 +11996,14 @@ function copyIosSyncSwiftPackage(shellApp, releaseArtifact, packageName, swiftPa
|
|
|
11928
11996
|
}
|
|
11929
11997
|
function rewriteIosSyncSwiftPackagePath(releaseArtifact, packageName, swiftPackageName) {
|
|
11930
11998
|
const packageFile = targetPath(`${releaseArtifact}/App/CapApp-SPM/Package.swift`);
|
|
11931
|
-
const contents =
|
|
11999
|
+
const contents = readFileSync21(packageFile, "utf8");
|
|
11932
12000
|
const originalPath = readSwiftPackagePath(packageFile, swiftPackageName);
|
|
11933
12001
|
const rewrittenPath = `../../node_modules/${packageName}`;
|
|
11934
12002
|
const marker = `.package(name: "${swiftPackageName}", path: "`;
|
|
11935
12003
|
writeFileSync14(packageFile, contents.replace(`${marker}${originalPath}"`, `${marker}${rewrittenPath}"`));
|
|
11936
12004
|
}
|
|
11937
12005
|
function readSwiftPackagePath(packageFile, swiftPackageName) {
|
|
11938
|
-
const contents =
|
|
12006
|
+
const contents = readFileSync21(packageFile, "utf8");
|
|
11939
12007
|
const marker = `.package(name: "${swiftPackageName}", path: "`;
|
|
11940
12008
|
const index = contents.indexOf(marker);
|
|
11941
12009
|
if (index < 0 || contents.indexOf(marker, index + marker.length) >= 0) {
|
|
@@ -11956,7 +12024,7 @@ function removeFilesByExtension(directory, extension) {
|
|
|
11956
12024
|
if (!existsSync22(directory)) {
|
|
11957
12025
|
return;
|
|
11958
12026
|
}
|
|
11959
|
-
for (const file of
|
|
12027
|
+
for (const file of readdirSync8(directory)) {
|
|
11960
12028
|
const target2 = `${directory}/${file}`;
|
|
11961
12029
|
if (file.endsWith(extension) && statSync7(target2).isFile()) {
|
|
11962
12030
|
rmSync11(target2, { force: true });
|
|
@@ -12004,9 +12072,9 @@ function findEmbeddedIconManifestArtifactPath(artifact) {
|
|
|
12004
12072
|
}
|
|
12005
12073
|
function findNamedArtifactFiles(root, fileName) {
|
|
12006
12074
|
const matches = [];
|
|
12007
|
-
for (const entry of
|
|
12008
|
-
const path10 =
|
|
12009
|
-
const stat =
|
|
12075
|
+
for (const entry of readdirSync8(root)) {
|
|
12076
|
+
const path10 = join10(root, entry);
|
|
12077
|
+
const stat = lstatSync12(path10);
|
|
12010
12078
|
if (stat.isSymbolicLink()) {
|
|
12011
12079
|
continue;
|
|
12012
12080
|
}
|
|
@@ -12055,7 +12123,7 @@ function isMiniGameTarget(target2) {
|
|
|
12055
12123
|
return target2.kind === "wechat-minigame" || target2.kind === "tiktok-minigame";
|
|
12056
12124
|
}
|
|
12057
12125
|
function buildMiniGameBundle(bundleKind, outputDir, stagingRoot, gameApp2, profile2, commandEnv) {
|
|
12058
|
-
const viteConfig =
|
|
12126
|
+
const viteConfig = join10(gameApp2, "vite.minigame.config.ts");
|
|
12059
12127
|
if (!existsSync22(viteConfig)) {
|
|
12060
12128
|
throw new Error(`Mini-game target requires a game-owned vite.minigame.config.ts: ${viteConfig}`);
|
|
12061
12129
|
}
|
|
@@ -12092,7 +12160,7 @@ function targetPath(path10) {
|
|
|
12092
12160
|
return resolveFromPlatformTargetsBase(configBaseDir, path10);
|
|
12093
12161
|
}
|
|
12094
12162
|
function findFileByExtension(directory, extension) {
|
|
12095
|
-
const files =
|
|
12163
|
+
const files = readdirSync8(directory).filter((file) => file.endsWith(extension)).sort();
|
|
12096
12164
|
if (files.length === 0) {
|
|
12097
12165
|
throw new Error(`Missing ${extension} artifact in ${directory}.`);
|
|
12098
12166
|
}
|