@mpgd/cli 0.46.1 → 0.48.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/capacitor-shell-starter.d.ts +57 -1
- package/dist/capacitor-shell-starter.js +311 -34
- package/dist/command-launcher.d.ts +13 -0
- package/dist/command-launcher.js +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +149 -12
- package/dist/microsoft-store-submission.js +11 -6
- package/dist/native-build-info.json +2 -2
- package/dist/native-build-target.js +2413 -345
- package/dist/windows-host/Core/BridgeCommand.cs +17 -0
- package/dist/windows-host/Core/Mpgd.MicrosoftStore.Host.csproj +9 -0
- package/dist/windows-host/Core/NativeBridgeContracts.cs +33 -0
- package/dist/windows-host/Core/NativeBridgeHost.cs +162 -0
- package/dist/windows-host/Core/NativeBridgeOrigin.cs +19 -0
- package/dist/windows-host/Core/NativeBridgeProtocol.cs +335 -0
- package/dist/windows-host/Core/NativeBridgeRequestGate.cs +76 -0
- package/dist/windows-host/Core/NativeBridgeResult.cs +65 -0
- package/dist/windows-host/README.md +118 -0
- package/dist/windows-host/WinUI/DispatcherQueueBridgeDispatcher.cs +39 -0
- package/dist/windows-host/WinUI/WebView2DocumentTransport.cs +46 -0
- package/dist/windows-host/WinUI/WebView2NativeBridge.cs +185 -0
- package/dist/windows-host/WinUI/WindowStoreContext.cs +20 -0
- package/dist/windows-native-tools.d.ts +4 -0
- package/dist/windows-native-tools.js +21 -0
- package/native-tools/windows-msix/WindowsMsixAcceptance.psm1 +333 -0
- package/package.json +24 -14
- package/templates/lite-overlay/.agents/skills/use-mpgd-kit/SKILL.md +22 -0
- package/templates/lite-overlay/AGENTS.md +27 -0
- package/templates/lite-overlay/README.md +37 -0
- package/templates/lite-overlay/agent/acceptance.md +27 -0
- package/templates/lite-overlay/agent/brief.md +17 -0
- package/templates/lite-overlay/apps/target-devvit/README.md +134 -0
- package/templates/lite-overlay/docs/MPGD_KIT_WORKFLOWS.md +37 -0
- package/templates/lite-overlay/src/lite/tapGame.ts +77 -0
- package/templates/lite-overlay/src/platform/devvitEntrypoint.ts +116 -0
- package/templates/lite-overlay/src/platform/devvitInlineMode.css +146 -0
- package/templates/lite-overlay/src/runtime/createGame.ts +57 -0
- package/templates/phaser-game/README.md +5 -3
- package/templates/phaser-game/apps/target-ait/package.json +2 -2
- package/templates/phaser-game/apps/target-ait/src/main.ts +17 -0
- package/templates/phaser-game/apps/target-ait/src/runtime-config.types.ts +2 -0
- package/templates/phaser-game/apps/target-ait/vite.config.ts +27 -0
- package/templates/phaser-game/apps/target-devvit/package.json +2 -1
- package/templates/phaser-game/apps/target-devvit/src/server/bridge.ts +137 -18
- package/templates/phaser-game/apps/target-devvit/src/server/index.ts +35 -1
- package/templates/phaser-game/package.json +3 -1
- package/templates/phaser-game/pnpm-workspace.yaml +2 -0
- package/templates/phaser-game/src/env.d.ts +2 -0
- package/templates/phaser-game/src/main.ts +8 -1
- package/templates/phaser-game/src/platform/buildGateways/ait.ts +9 -0
- package/templates/phaser-game/src/platform/buildGateways/aitSandbox.ts +13 -1
- package/templates/phaser-game/src/platform/buildGateways/capacitorAndroid.ts +51 -2
- package/templates/phaser-game/src/platform/buildGateways/capacitorIos.ts +51 -2
- package/templates/phaser-game/src/platform/buildGateways/microsoftStore.ts +59 -26
- package/templates/phaser-game/src/platform/buildGateways/reddit.ts +36 -1
- package/templates/phaser-game/src/platform/buildGateways/verse8.ts +39 -2
- package/templates/phaser-game/src/platform/commerceAccountBinding.ts +79 -0
- package/templates/phaser-game/src/platform/commerceProducts.ts +69 -0
- package/templates/phaser-game/src/platform/gameServices.ts +22 -2
- package/templates/phaser-game/src/platform/monetizationJournal.ts +286 -0
- package/templates/phaser-game/src/platform/verse8Agent8Client.ts +22 -0
- package/templates/phaser-game/vite.shared.ts +40 -1
|
@@ -17,6 +17,8 @@ interface RuntimePlatformTargetMetadata {
|
|
|
17
17
|
readonly crazyGamesLaunch?: 'basic' | 'full';
|
|
18
18
|
readonly authoritativeGameServices?: boolean;
|
|
19
19
|
readonly integrations?: Record<string, unknown>;
|
|
20
|
+
/** An Apps in Toss target's `metadata.appName`, for the sandbox bridge only. */
|
|
21
|
+
readonly aitAppName?: string;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
// Sandbox gateways self-complete purchases and rewards without any backend
|
|
@@ -100,7 +102,10 @@ export function createGameViteSharedConfig<SharedPluginOption = PluginOption>(
|
|
|
100
102
|
__APP_TARGET__: JSON.stringify(appTarget),
|
|
101
103
|
__MPGD_CONFIG_TARGET__: JSON.stringify(configTarget),
|
|
102
104
|
__MPGD_PLATFORM_TARGET__:
|
|
103
|
-
platformTarget === undefined
|
|
105
|
+
platformTarget === undefined
|
|
106
|
+
? 'undefined'
|
|
107
|
+
: JSON.stringify(toEffectivePlatformTargetMetadata(platformTarget)),
|
|
108
|
+
__MPGD_AIT_APP_NAME__: JSON.stringify(resolveAitAppName(platformTarget)),
|
|
104
109
|
__MPGD_TARGET_CONFIG_MATRIX__:
|
|
105
110
|
runtimeTargetConfigMatrix === undefined
|
|
106
111
|
? 'undefined'
|
|
@@ -264,6 +269,8 @@ function readRuntimePlatformTarget(
|
|
|
264
269
|
throw new Error(`Platform target ${configTarget} authoritativeGameServices must be a boolean.`);
|
|
265
270
|
}
|
|
266
271
|
|
|
272
|
+
const aitAppName = readAitAppName(target);
|
|
273
|
+
|
|
267
274
|
return {
|
|
268
275
|
kind: target.kind,
|
|
269
276
|
adapter: target.adapter,
|
|
@@ -272,9 +279,41 @@ function readRuntimePlatformTarget(
|
|
|
272
279
|
: { authoritativeGameServices: target.authoritativeGameServices }),
|
|
273
280
|
...(target.crazyGamesLaunch === undefined ? {} : { crazyGamesLaunch: target.crazyGamesLaunch as 'basic' | 'full' }),
|
|
274
281
|
...(target.integrations === undefined ? {} : { integrations: target.integrations }),
|
|
282
|
+
...(aitAppName === undefined ? {} : { aitAppName }),
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function toEffectivePlatformTargetMetadata(
|
|
287
|
+
input: RuntimePlatformTargetMetadata,
|
|
288
|
+
): Omit<RuntimePlatformTargetMetadata, 'aitAppName'> {
|
|
289
|
+
return {
|
|
290
|
+
kind: input.kind,
|
|
291
|
+
adapter: input.adapter,
|
|
292
|
+
...(input.authoritativeGameServices === undefined
|
|
293
|
+
? {}
|
|
294
|
+
: { authoritativeGameServices: input.authoritativeGameServices }),
|
|
295
|
+
...(input.crazyGamesLaunch === undefined ? {} : { crazyGamesLaunch: input.crazyGamesLaunch }),
|
|
296
|
+
...(input.integrations === undefined ? {} : { integrations: input.integrations }),
|
|
275
297
|
};
|
|
276
298
|
}
|
|
277
299
|
|
|
300
|
+
/**
|
|
301
|
+
* The app name `intoss://` share links must carry in the Apps in Toss sandbox
|
|
302
|
+
* bridge, the one the wrapper's host bridge uses: `MPGD_AIT_APP_NAME`, else
|
|
303
|
+
* the target's `metadata.appName`, else the game name.
|
|
304
|
+
*/
|
|
305
|
+
function resolveAitAppName(platformTarget: RuntimePlatformTargetMetadata | undefined): string {
|
|
306
|
+
return process.env.MPGD_AIT_APP_NAME?.trim() || platformTarget?.aitAppName || '__GAME_NAME__';
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function readAitAppName(target: Record<string, unknown>): string | undefined {
|
|
310
|
+
const appName = target.kind === 'apps-in-toss' && isRecord(target.metadata)
|
|
311
|
+
? target.metadata.appName
|
|
312
|
+
: undefined;
|
|
313
|
+
|
|
314
|
+
return typeof appName === 'string' && appName.trim().length > 0 ? appName.trim() : undefined;
|
|
315
|
+
}
|
|
316
|
+
|
|
278
317
|
function isRecord(input: unknown): input is Record<string, unknown> {
|
|
279
318
|
return typeof input === 'object' && input !== null && !Array.isArray(input);
|
|
280
319
|
}
|