@mpgd/cli 0.37.0 → 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 +2 -0
- package/dist/native-build-info.json +2 -2
- package/dist/native-build-target.js +214 -146
- package/package.json +14 -14
- package/templates/phaser-game/agent/game-manifest.json +1 -0
- package/templates/phaser-game/docs/MPGD_KIT_WORKFLOWS.md +16 -0
- package/templates/phaser-game/mpgd.targets.json +11 -0
- package/templates/phaser-game/src/platform/buildGateways/crazygames.ts +14 -0
- package/templates/phaser-game/src/platform/runtimeDetector.ts +1 -0
- package/templates/phaser-game/src/scenes/BootScene.ts +4 -1
- package/templates/phaser-game/src/scenes/PlayScene.ts +1 -0
- package/templates/phaser-game/vite.runtime-target-config.ts +2 -0
- package/templates/phaser-game/vite.shared.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpgd/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Gunshi CLI for mpgd-kit starter generation and target workflow orchestration.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -54,26 +54,26 @@
|
|
|
54
54
|
"typia": "13.0.2",
|
|
55
55
|
"undici": "^7.29.1",
|
|
56
56
|
"vite": "8.1.3",
|
|
57
|
-
"@mpgd/catalog": "0.7.
|
|
58
|
-
"@mpgd/
|
|
59
|
-
"@mpgd/
|
|
57
|
+
"@mpgd/catalog": "0.7.8",
|
|
58
|
+
"@mpgd/target-config": "0.18.0",
|
|
59
|
+
"@mpgd/phaser-assets": "0.7.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/node": "^24.0.0",
|
|
63
63
|
"@types/semver": "^7.8.0",
|
|
64
64
|
"ttsc": "0.30.4",
|
|
65
65
|
"typescript": "7.0.2",
|
|
66
|
-
"@mpgd/adapter-
|
|
67
|
-
"@mpgd/adapter-
|
|
68
|
-
"@mpgd/adapter-capacitor": "0.7.
|
|
69
|
-
"@mpgd/
|
|
70
|
-
"@mpgd/adapter-verse8": "0.4.
|
|
71
|
-
"@mpgd/
|
|
72
|
-
"@mpgd/
|
|
73
|
-
"@mpgd/adapter-devvit": "0.9.15",
|
|
74
|
-
"@mpgd/platform": "0.15.0",
|
|
66
|
+
"@mpgd/adapter-ait": "0.13.1",
|
|
67
|
+
"@mpgd/adapter-browser": "0.8.0",
|
|
68
|
+
"@mpgd/adapter-capacitor": "0.7.1",
|
|
69
|
+
"@mpgd/adapter-devvit": "0.9.16",
|
|
70
|
+
"@mpgd/adapter-verse8": "0.4.1",
|
|
71
|
+
"@mpgd/analytics": "0.4.2",
|
|
72
|
+
"@mpgd/game-runtime": "0.4.0",
|
|
75
73
|
"@mpgd/bridge": "0.11.0",
|
|
76
|
-
"@mpgd/game-services": "0.18.
|
|
74
|
+
"@mpgd/game-services": "0.18.1",
|
|
75
|
+
"@mpgd/i18n": "0.6.7",
|
|
76
|
+
"@mpgd/platform": "0.16.0"
|
|
77
77
|
},
|
|
78
78
|
"main": "./dist/index.js",
|
|
79
79
|
"types": "./dist/index.d.ts",
|
|
@@ -104,6 +104,22 @@ state behind target services. Treat client commerce as pending; authoritative
|
|
|
104
104
|
grants belong in a game-owned Agent8 server purchase event with consume-once
|
|
105
105
|
catalog handling and verified completion logic for leaderboards.
|
|
106
106
|
|
|
107
|
+
### CrazyGames
|
|
108
|
+
|
|
109
|
+
Use the browser adapter's `/crazygames` entry point and the non-installable
|
|
110
|
+
`crazygames` web target. `crazyGamesLaunch: "basic"` disables monetization;
|
|
111
|
+
change it to `"full"` only after Full Launch approval. Configured midgame
|
|
112
|
+
interstitials use the shared advertising presentation contract. SDK callbacks
|
|
113
|
+
must never grant rewards or purchases: those capabilities remain disabled.
|
|
114
|
+
|
|
115
|
+
Playable scenes own gameplay scopes through the game runtime. Keep loading,
|
|
116
|
+
gameplay, and host `muteAudio` policy behind `PlatformGateway`; the host handles
|
|
117
|
+
focus reporting. Build and smoke with `pnpm exec mpgd target build crazygames`
|
|
118
|
+
and `pnpm exec mpgd target smoke crazygames`, providing `--kit-path` and the
|
|
119
|
+
project's `--targets-file`. See the kit's
|
|
120
|
+
[CrazyGames guide](https://github.com/imjlk/mpgd-kit/blob/main/docs/CRAZYGAMES.md)
|
|
121
|
+
and [official SDK documentation](https://docs.crazygames.com/sdk/intro/).
|
|
122
|
+
|
|
107
123
|
### Apps in Toss
|
|
108
124
|
|
|
109
125
|
Use official Apps in Toss documentation/MCP before SDK or review-flow changes.
|
|
@@ -22,6 +22,17 @@
|
|
|
22
22
|
"icon": { "profile": "web-preview" },
|
|
23
23
|
"output": "artifacts/verse8"
|
|
24
24
|
},
|
|
25
|
+
"crazygames": {
|
|
26
|
+
"kind": "web",
|
|
27
|
+
"gameApp": ".",
|
|
28
|
+
"adapter": "crazygames",
|
|
29
|
+
"icon": {
|
|
30
|
+
"profile": "web-preview"
|
|
31
|
+
},
|
|
32
|
+
"installable": false,
|
|
33
|
+
"crazyGamesLaunch": "basic",
|
|
34
|
+
"output": "artifacts/crazygames"
|
|
35
|
+
},
|
|
25
36
|
"android": {
|
|
26
37
|
"kind": "capacitor-android",
|
|
27
38
|
"gameApp": ".",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createCrazyGamesPlatformGateway } from '@mpgd/adapter-browser/crazygames';
|
|
2
|
+
import { resolveAdPlacementPlatformId, type AdPlacements } from '@mpgd/catalog';
|
|
3
|
+
import adPlacementsJson from '@mpgd/catalog/placements.json';
|
|
4
|
+
import type { PlatformGateway } from '@mpgd/platform';
|
|
5
|
+
import type { RuntimeConfig } from '../runtimeDetector';
|
|
6
|
+
|
|
7
|
+
export async function createBuildGateway(runtime: RuntimeConfig): Promise<PlatformGateway> {
|
|
8
|
+
const placements = (adPlacementsJson as AdPlacements).placements;
|
|
9
|
+
return createCrazyGamesPlatformGateway({
|
|
10
|
+
launch: __MPGD_PLATFORM_TARGET__?.crazyGamesLaunch ?? 'basic',
|
|
11
|
+
placementIds: placements.filter((placement) => placement.type === 'interstitial'
|
|
12
|
+
&& resolveAdPlacementPlatformId(placement, runtime.configTarget) !== undefined).map((placement) => placement.id),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -2,6 +2,8 @@ import Phaser from 'phaser';
|
|
|
2
2
|
|
|
3
3
|
import { loadPhaserAssets } from '@mpgd/phaser-assets';
|
|
4
4
|
|
|
5
|
+
import { starterContextKey, type StarterContext } from '../runtime/gameContext';
|
|
6
|
+
|
|
5
7
|
import { starterAssets } from '../assets/manifest';
|
|
6
8
|
|
|
7
9
|
export class BootScene extends Phaser.Scene {
|
|
@@ -14,6 +16,7 @@ export class BootScene extends Phaser.Scene {
|
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
create(): void {
|
|
17
|
-
this.
|
|
19
|
+
const context = this.registry.get(starterContextKey) as StarterContext;
|
|
20
|
+
this.scene.start(context.launchIntent.entry === 'free-play' ? 'PlayScene' : 'LobbyScene');
|
|
18
21
|
}
|
|
19
22
|
}
|
|
@@ -31,6 +31,7 @@ export class PlayScene extends Phaser.Scene {
|
|
|
31
31
|
this.context = this.registry.get(starterContextKey) as StarterContext;
|
|
32
32
|
bindPhaserGameScene({
|
|
33
33
|
controller: this.context.gameRuntime.execution,
|
|
34
|
+
gameplayScope: this.context.gameRuntime.createGameplayScope(),
|
|
34
35
|
scene: this,
|
|
35
36
|
renderingPolicy: 'visibility',
|
|
36
37
|
audioOwner: 'game',
|
|
@@ -20,6 +20,7 @@ const runtimeKinds = valueSet({
|
|
|
20
20
|
'apps-in-toss': true,
|
|
21
21
|
'devvit-web': true,
|
|
22
22
|
'verse8-web': true,
|
|
23
|
+
'crazygames-web': true,
|
|
23
24
|
'wechat-minigame': true,
|
|
24
25
|
'tiktok-minigame': true,
|
|
25
26
|
} satisfies Record<TargetRuntimeKind, true>);
|
|
@@ -32,6 +33,7 @@ const releaseProfiles = valueSet({
|
|
|
32
33
|
'apps-in-toss': true,
|
|
33
34
|
devvit: true,
|
|
34
35
|
verse8: true,
|
|
36
|
+
crazygames: true,
|
|
35
37
|
'wechat-minigame': true,
|
|
36
38
|
'tiktok-minigame': true,
|
|
37
39
|
} satisfies Record<ReleaseProfile, true>);
|
|
@@ -14,6 +14,7 @@ import { resolveTextSelectionMode } from './src/platform/textSelection';
|
|
|
14
14
|
interface RuntimePlatformTargetMetadata {
|
|
15
15
|
readonly kind: string;
|
|
16
16
|
readonly adapter: string;
|
|
17
|
+
readonly crazyGamesLaunch?: 'basic' | 'full';
|
|
17
18
|
readonly authoritativeGameServices?: boolean;
|
|
18
19
|
readonly integrations?: Record<string, unknown>;
|
|
19
20
|
}
|
|
@@ -151,6 +152,8 @@ export function resolveBuildGatewayModule(input: {
|
|
|
151
152
|
return input.debug && input.buildId === devvitSandboxBuildId
|
|
152
153
|
? 'src/platform/buildGateways/redditSandbox.ts'
|
|
153
154
|
: 'src/platform/buildGateways/reddit.ts';
|
|
155
|
+
case 'crazygames':
|
|
156
|
+
return 'src/platform/buildGateways/crazygames.ts';
|
|
154
157
|
case 'verse8':
|
|
155
158
|
return 'src/platform/buildGateways/verse8.ts';
|
|
156
159
|
case 'microsoft-store':
|
|
@@ -245,6 +248,9 @@ function readRuntimePlatformTarget(
|
|
|
245
248
|
throw new Error(`Platform target ${configTarget} must define kind and adapter.`);
|
|
246
249
|
}
|
|
247
250
|
|
|
251
|
+
if (target.crazyGamesLaunch !== undefined && (target.adapter !== 'crazygames' || !['basic', 'full'].includes(target.crazyGamesLaunch as string))) {
|
|
252
|
+
throw new Error(`Invalid CrazyGames launch setting for ${configTarget}.`);
|
|
253
|
+
}
|
|
248
254
|
if (target.integrations !== undefined && !isRecord(target.integrations)) {
|
|
249
255
|
throw new Error(`Platform target ${configTarget} integrations must be an object.`);
|
|
250
256
|
}
|
|
@@ -262,6 +268,7 @@ function readRuntimePlatformTarget(
|
|
|
262
268
|
...(target.authoritativeGameServices === undefined
|
|
263
269
|
? {}
|
|
264
270
|
: { authoritativeGameServices: target.authoritativeGameServices }),
|
|
271
|
+
...(target.crazyGamesLaunch === undefined ? {} : { crazyGamesLaunch: target.crazyGamesLaunch as 'basic' | 'full' }),
|
|
265
272
|
...(target.integrations === undefined ? {} : { integrations: target.integrations }),
|
|
266
273
|
};
|
|
267
274
|
}
|