@mpgd/cli 0.8.0 → 0.10.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/game-acceptance.d.ts +14 -0
- package/dist/game-acceptance.js +318 -5
- package/dist/gameplay-e2e.d.ts +121 -0
- package/dist/gameplay-e2e.js +684 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +57 -3
- package/package.json +11 -11
- package/templates/phaser-game/README.md +14 -9
- package/templates/phaser-game/agent/acceptance.md +13 -7
- package/templates/phaser-game/agent/game-manifest.json +1 -1
- package/templates/phaser-game/apps/target-devvit/README.md +21 -8
- package/templates/phaser-game/apps/target-devvit/package.json +3 -3
- package/templates/phaser-game/apps/target-devvit/src/server/index.ts +5 -352
- package/templates/phaser-game/apps/target-devvit/src/server/postOperationStore.ts +2 -2
- package/templates/phaser-game/mpgd.game.json +42 -0
- package/templates/phaser-game/mpgd.targets.json +0 -1
- package/templates/phaser-game/src/main.ts +2 -0
- package/templates/phaser-game/src/platform/devvitEntrypoint.ts +104 -29
- package/templates/phaser-game/src/platform/devvitInlineMode.css +133 -0
- package/templates/phaser-game/src/runtime/createGame.ts +6 -0
- package/templates/phaser-game/vite.shared.ts +6 -11
- package/templates/phaser-game/src/platform/devvitInlinePreview.css +0 -75
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
body.devvit-inline-mode-host {
|
|
2
|
+
min-width: 320px;
|
|
3
|
+
min-height: 100vh;
|
|
4
|
+
margin: 0;
|
|
5
|
+
background: #0f172a;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
body.devvit-inline-mode-gameplay {
|
|
9
|
+
overflow-y: auto;
|
|
10
|
+
overscroll-behavior-y: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
body.devvit-inline-mode-gameplay #game {
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body.devvit-inline-mode-gameplay #game,
|
|
18
|
+
body.devvit-inline-mode-gameplay canvas {
|
|
19
|
+
touch-action: pan-y !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.devvit-inline-gameplay-loading {
|
|
23
|
+
position: fixed;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
inset: 0;
|
|
26
|
+
display: grid;
|
|
27
|
+
place-items: center;
|
|
28
|
+
margin: 0;
|
|
29
|
+
background: #0f172a;
|
|
30
|
+
color: #cbd5e1;
|
|
31
|
+
font: 700 0.875rem/1.5 Inter, ui-sans-serif, system-ui, sans-serif;
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.devvit-launch-screen,
|
|
36
|
+
.devvit-launch-screen * {
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.devvit-launch-screen {
|
|
41
|
+
min-height: 100vh;
|
|
42
|
+
display: grid;
|
|
43
|
+
place-content: center;
|
|
44
|
+
justify-items: start;
|
|
45
|
+
gap: 0.75rem;
|
|
46
|
+
padding: clamp(1.25rem, 5vw, 3rem);
|
|
47
|
+
background:
|
|
48
|
+
radial-gradient(circle at 85% 15%, rgb(56 189 248 / 0.2), transparent 38%),
|
|
49
|
+
linear-gradient(145deg, #0f172a, #172554);
|
|
50
|
+
color: #f8fafc;
|
|
51
|
+
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.devvit-launch-screen__eyebrow,
|
|
55
|
+
.devvit-launch-screen__description,
|
|
56
|
+
.devvit-launch-screen__status,
|
|
57
|
+
.devvit-launch-screen h1 {
|
|
58
|
+
margin: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.devvit-launch-screen__eyebrow {
|
|
62
|
+
color: #7dd3fc;
|
|
63
|
+
font-size: 0.75rem;
|
|
64
|
+
font-weight: 700;
|
|
65
|
+
letter-spacing: 0.12em;
|
|
66
|
+
text-transform: uppercase;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.devvit-launch-screen h1 {
|
|
70
|
+
max-width: 18ch;
|
|
71
|
+
font-size: clamp(2rem, 9vw, 4.5rem);
|
|
72
|
+
line-height: 0.95;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.devvit-launch-screen__description {
|
|
76
|
+
max-width: 36rem;
|
|
77
|
+
color: #cbd5e1;
|
|
78
|
+
line-height: 1.5;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.devvit-launch-screen__actions {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-wrap: wrap;
|
|
84
|
+
gap: 0.75rem;
|
|
85
|
+
margin-top: 0.5rem;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.devvit-launch-screen__button {
|
|
89
|
+
min-height: 2.75rem;
|
|
90
|
+
padding: 0.65rem 1.25rem;
|
|
91
|
+
border: 1px solid transparent;
|
|
92
|
+
border-radius: 999px;
|
|
93
|
+
color: #082f49;
|
|
94
|
+
background: #7dd3fc;
|
|
95
|
+
font: inherit;
|
|
96
|
+
font-weight: 800;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.devvit-launch-screen__button--secondary {
|
|
101
|
+
border-color: #7dd3fc;
|
|
102
|
+
color: #e0f2fe;
|
|
103
|
+
background: rgb(15 23 42 / 0.64);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.devvit-launch-screen__button:disabled {
|
|
107
|
+
cursor: wait;
|
|
108
|
+
opacity: 0.65;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.devvit-launch-screen__button:focus-visible {
|
|
112
|
+
outline: 3px solid #f8fafc;
|
|
113
|
+
outline-offset: 3px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.devvit-launch-screen__status {
|
|
117
|
+
min-height: 1.5em;
|
|
118
|
+
color: #fda4af;
|
|
119
|
+
font-size: 0.875rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@media (hover: hover) {
|
|
123
|
+
.devvit-launch-screen__button:not(:disabled):hover {
|
|
124
|
+
filter: brightness(1.1);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (max-width: 420px) {
|
|
129
|
+
.devvit-launch-screen__actions,
|
|
130
|
+
.devvit-launch-screen__button {
|
|
131
|
+
width: 100%;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -7,6 +7,7 @@ import { starterContextKey, type StarterContext } from './gameContext';
|
|
|
7
7
|
|
|
8
8
|
export function createStarterGame(input: {
|
|
9
9
|
readonly mountId: string;
|
|
10
|
+
readonly preserveBrowserTouchGestures?: boolean;
|
|
10
11
|
readonly context: StarterContext;
|
|
11
12
|
}): Phaser.Game {
|
|
12
13
|
const game = new Phaser.Game({
|
|
@@ -15,6 +16,11 @@ export function createStarterGame(input: {
|
|
|
15
16
|
width: 960,
|
|
16
17
|
height: 540,
|
|
17
18
|
backgroundColor: '#07111f',
|
|
19
|
+
input: {
|
|
20
|
+
touch: {
|
|
21
|
+
capture: input.preserveBrowserTouchGestures !== true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
18
24
|
scale: {
|
|
19
25
|
mode: Phaser.Scale.FIT,
|
|
20
26
|
autoCenter: Phaser.Scale.CENTER_BOTH,
|
|
@@ -51,12 +51,8 @@ export function createGameViteSharedConfig(
|
|
|
51
51
|
alias: {
|
|
52
52
|
...createCatalogAliases({
|
|
53
53
|
gameRoot: input.gameRoot,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
: { productCatalogFile: input.productCatalogFile }),
|
|
57
|
-
...(input.adPlacementsFile === undefined
|
|
58
|
-
? {}
|
|
59
|
-
: { adPlacementsFile: input.adPlacementsFile }),
|
|
54
|
+
productCatalogFile: input.productCatalogFile,
|
|
55
|
+
adPlacementsFile: input.adPlacementsFile,
|
|
60
56
|
}),
|
|
61
57
|
'#mpgd-platform-gateway': resolve(input.gameRoot, buildGatewayModule),
|
|
62
58
|
},
|
|
@@ -99,8 +95,8 @@ export function resolveBuildGatewayModule(input: {
|
|
|
99
95
|
|
|
100
96
|
function createCatalogAliases(input: {
|
|
101
97
|
readonly gameRoot: string;
|
|
102
|
-
readonly productCatalogFile
|
|
103
|
-
readonly adPlacementsFile
|
|
98
|
+
readonly productCatalogFile: string | undefined;
|
|
99
|
+
readonly adPlacementsFile: string | undefined;
|
|
104
100
|
}): Record<string, string> {
|
|
105
101
|
const productCatalogFile = readConfiguredPath(
|
|
106
102
|
input.productCatalogFile ?? process.env.MPGD_PRODUCT_CATALOG_FILE,
|
|
@@ -209,9 +205,8 @@ function resolveCatalogBaseDir(path: string, pairedPath: string, gameRoot: strin
|
|
|
209
205
|
}
|
|
210
206
|
}
|
|
211
207
|
|
|
212
|
-
|
|
208
|
+
throw new Error(
|
|
213
209
|
`Could not locate catalog files (${path}, ${pairedPath}) in any expected directory; `
|
|
214
|
-
|
|
210
|
+
+ `checked: ${candidates.filter((candidate) => candidate !== undefined).join(', ')}.`,
|
|
215
211
|
);
|
|
216
|
-
return gameRoot;
|
|
217
212
|
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
body.devvit-preview-host {
|
|
2
|
-
min-width: 320px;
|
|
3
|
-
min-height: 100vh;
|
|
4
|
-
margin: 0;
|
|
5
|
-
background: #0f172a;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.devvit-preview,
|
|
9
|
-
.devvit-preview * {
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.devvit-preview {
|
|
14
|
-
min-height: 100vh;
|
|
15
|
-
display: grid;
|
|
16
|
-
place-content: center;
|
|
17
|
-
justify-items: start;
|
|
18
|
-
gap: 0.75rem;
|
|
19
|
-
padding: clamp(1.25rem, 5vw, 3rem);
|
|
20
|
-
background:
|
|
21
|
-
radial-gradient(circle at 85% 15%, rgb(56 189 248 / 0.2), transparent 38%),
|
|
22
|
-
linear-gradient(145deg, #0f172a, #172554);
|
|
23
|
-
color: #f8fafc;
|
|
24
|
-
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.devvit-preview__eyebrow,
|
|
28
|
-
.devvit-preview__description,
|
|
29
|
-
.devvit-preview h1 {
|
|
30
|
-
margin: 0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.devvit-preview__eyebrow {
|
|
34
|
-
color: #7dd3fc;
|
|
35
|
-
font-size: 0.75rem;
|
|
36
|
-
font-weight: 700;
|
|
37
|
-
letter-spacing: 0.12em;
|
|
38
|
-
text-transform: uppercase;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.devvit-preview h1 {
|
|
42
|
-
max-width: 18ch;
|
|
43
|
-
font-size: clamp(2rem, 9vw, 4.5rem);
|
|
44
|
-
line-height: 0.95;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.devvit-preview__description {
|
|
48
|
-
max-width: 36rem;
|
|
49
|
-
color: #cbd5e1;
|
|
50
|
-
line-height: 1.5;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.devvit-preview__button {
|
|
54
|
-
min-height: 2.75rem;
|
|
55
|
-
margin-top: 0.5rem;
|
|
56
|
-
padding: 0.65rem 1.25rem;
|
|
57
|
-
border: 0;
|
|
58
|
-
border-radius: 999px;
|
|
59
|
-
color: #082f49;
|
|
60
|
-
background: #7dd3fc;
|
|
61
|
-
font: inherit;
|
|
62
|
-
font-weight: 800;
|
|
63
|
-
cursor: pointer;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.devvit-preview__button:focus-visible {
|
|
67
|
-
outline: 3px solid #f8fafc;
|
|
68
|
-
outline-offset: 3px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@media (hover: hover) {
|
|
72
|
-
.devvit-preview__button:hover {
|
|
73
|
-
filter: brightness(1.1);
|
|
74
|
-
}
|
|
75
|
-
}
|