@dreamboard-games/cli 0.1.30-alpha.4 → 0.1.30-alpha.40

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.
Files changed (156) hide show
  1. package/README.md +32 -113
  2. package/dist/agent-verifier/agent-workspace-verifier.mjs +2084 -57
  3. package/dist/agent-verifier/agent-workspace-verifier.mjs.map +1 -1
  4. package/dist/agent-verifier/{chunk-XQXDOBYB.mjs → chunk-4I2WWAPK.mjs} +27 -10
  5. package/dist/agent-verifier/chunk-4I2WWAPK.mjs.map +1 -0
  6. package/dist/agent-verifier/{chunk-C3VW3DTA.mjs → chunk-BWBN2TDJ.mjs} +535 -633
  7. package/dist/agent-verifier/chunk-BWBN2TDJ.mjs.map +1 -0
  8. package/dist/agent-verifier/{chunk-TAEQKBJB.mjs → chunk-GWRZRWCF.mjs} +1 -1
  9. package/dist/agent-verifier/chunk-GWRZRWCF.mjs.map +1 -0
  10. package/dist/agent-verifier/chunk-HUBV22JQ.mjs +89 -0
  11. package/dist/agent-verifier/chunk-HUBV22JQ.mjs.map +1 -0
  12. package/dist/agent-verifier/{chunk-MW2QIWWA.mjs → chunk-KAA3B4DI.mjs} +215 -223
  13. package/dist/agent-verifier/chunk-KAA3B4DI.mjs.map +1 -0
  14. package/dist/agent-verifier/{chunk-27EEIZCI.mjs → chunk-KDAQ4CZY.mjs} +34 -27
  15. package/dist/agent-verifier/chunk-KDAQ4CZY.mjs.map +1 -0
  16. package/dist/agent-verifier/{chunk-IAYRNVUC.mjs → chunk-LMW66VBH.mjs} +2 -13
  17. package/dist/agent-verifier/{chunk-IAYRNVUC.mjs.map → chunk-LMW66VBH.mjs.map} +1 -1
  18. package/dist/agent-verifier/{chunk-776W3UGV.mjs → chunk-LROY5SN2.mjs} +7 -45
  19. package/dist/agent-verifier/chunk-LROY5SN2.mjs.map +1 -0
  20. package/dist/agent-verifier/{chunk-H76MT5UR.mjs → chunk-M7UVBANQ.mjs} +2 -1
  21. package/dist/agent-verifier/chunk-M7UVBANQ.mjs.map +1 -0
  22. package/dist/agent-verifier/{chunk-5NYBTZB4.mjs → chunk-MIRGCMUC.mjs} +112 -26
  23. package/dist/agent-verifier/chunk-MIRGCMUC.mjs.map +1 -0
  24. package/dist/agent-verifier/{chunk-NAK77WXW.mjs → chunk-MYMVXTZT.mjs} +4 -5
  25. package/dist/agent-verifier/chunk-MYMVXTZT.mjs.map +1 -0
  26. package/dist/agent-verifier/chunk-OJFZVGEL.mjs +492 -0
  27. package/dist/agent-verifier/chunk-OJFZVGEL.mjs.map +1 -0
  28. package/dist/agent-verifier/{chunk-XKCJBIRY.mjs → chunk-QD4SQNUP.mjs} +2 -2
  29. package/dist/agent-verifier/{chunk-QBAF7EYR.mjs → chunk-TTB7AIHZ.mjs} +4 -4
  30. package/dist/agent-verifier/{chunk-QBAF7EYR.mjs.map → chunk-TTB7AIHZ.mjs.map} +1 -1
  31. package/dist/agent-verifier/{chunk-F2DIOJJZ.mjs → chunk-XCQQIPCO.mjs} +5 -46
  32. package/dist/agent-verifier/chunk-XCQQIPCO.mjs.map +1 -0
  33. package/dist/agent-verifier/{global-config-NYCSCAUI.mjs → global-config-2NUESNEQ.mjs} +5 -5
  34. package/dist/agent-verifier/{keychain-backend-A3MRWLPF.mjs → keychain-backend-FF4I6ODB.mjs} +11 -6
  35. package/dist/agent-verifier/keychain-backend-FF4I6ODB.mjs.map +1 -0
  36. package/dist/agent-verifier/{local-files-QVJ2H3MH.mjs → local-files-OF4QFISU.mjs} +8 -8
  37. package/dist/agent-verifier/{chunk-UIOLGH4A.mjs → local-typecheck-DHVLM37Z.mjs} +4 -4
  38. package/dist/agent-verifier/local-typecheck-DHVLM37Z.mjs.map +1 -0
  39. package/dist/agent-verifier/{materialize-workspace-OZKOQCSQ.mjs → materialize-workspace-JBDL6LF4.mjs} +22 -22
  40. package/dist/agent-verifier/materialize-workspace-JBDL6LF4.mjs.map +1 -0
  41. package/dist/agent-verifier/{chunk-Z6OZWUIZ.mjs → reducer-bundle-preflight-GLUJKTWU.mjs} +75 -24
  42. package/dist/agent-verifier/reducer-bundle-preflight-GLUJKTWU.mjs.map +1 -0
  43. package/dist/agent-verifier/{chunk-YDIOW2BO.mjs → reducer-contract-preflight-WVQQPW5F.mjs} +7 -6
  44. package/dist/agent-verifier/reducer-contract-preflight-WVQQPW5F.mjs.map +1 -0
  45. package/dist/agent-verifier/{chunk-ON62IGWK.mjs → reducer-native-test-harness-XQUPIT5D.mjs} +480 -703
  46. package/dist/agent-verifier/reducer-native-test-harness-XQUPIT5D.mjs.map +1 -0
  47. package/dist/agent-verifier/static-scaffold-U5DXE23S.mjs +24 -0
  48. package/dist/agent-verifier/{workspace-codegen-WPZHMATU.mjs → workspace-codegen-SPPVHURX.mjs} +3 -3
  49. package/dist/agent-verifier/{workspace-dependencies-B6A2ZX55.mjs → workspace-dependencies-5HEEKZFP.mjs} +5 -3
  50. package/dist/authoring-compatibility-internal.js +12 -0
  51. package/dist/chunk-5IYJOVUA.js +3902 -0
  52. package/dist/chunk-5IYJOVUA.js.map +1 -0
  53. package/dist/chunk-6NYVJYN4.js +313 -0
  54. package/dist/chunk-6NYVJYN4.js.map +1 -0
  55. package/dist/chunk-EQNBQVIW.js +204 -0
  56. package/dist/chunk-EQNBQVIW.js.map +1 -0
  57. package/dist/{chunk-M4SCKH5M.js → chunk-USZAPMQ4.js} +2488 -4993
  58. package/dist/chunk-USZAPMQ4.js.map +1 -0
  59. package/dist/{global-config-YBFEGJQG.js → global-config-RBMW7IVA.js} +3 -2
  60. package/dist/index.js +3099 -6188
  61. package/dist/index.js.map +1 -1
  62. package/dist/internal.js +35 -9
  63. package/dist/internal.js.map +1 -1
  64. package/dist/{keychain-backend-JHTXAKWC.js → keychain-backend-FSNTNTZE.js} +11 -6
  65. package/dist/keychain-backend-FSNTNTZE.js.map +1 -0
  66. package/package.json +9 -19
  67. package/release/authoring-release-set.json +38 -0
  68. package/skills/dreamboard/SKILL.md +32 -30
  69. package/skills/dreamboard/references/building-your-first-game.md +16 -16
  70. package/skills/dreamboard/references/cli.md +54 -54
  71. package/skills/dreamboard/references/manifest-authoring.md +11 -3
  72. package/skills/dreamboard/references/quickstart.md +19 -16
  73. package/skills/dreamboard/references/testing.md +6 -13
  74. package/dist/agent-verifier/chunk-27EEIZCI.mjs.map +0 -1
  75. package/dist/agent-verifier/chunk-5NYBTZB4.mjs.map +0 -1
  76. package/dist/agent-verifier/chunk-776W3UGV.mjs.map +0 -1
  77. package/dist/agent-verifier/chunk-C3VW3DTA.mjs.map +0 -1
  78. package/dist/agent-verifier/chunk-F2DIOJJZ.mjs.map +0 -1
  79. package/dist/agent-verifier/chunk-G42BGGG2.mjs +0 -70
  80. package/dist/agent-verifier/chunk-G42BGGG2.mjs.map +0 -1
  81. package/dist/agent-verifier/chunk-H76MT5UR.mjs.map +0 -1
  82. package/dist/agent-verifier/chunk-IDVQXGAO.mjs +0 -222
  83. package/dist/agent-verifier/chunk-IDVQXGAO.mjs.map +0 -1
  84. package/dist/agent-verifier/chunk-JO5AMVZU.mjs +0 -1744
  85. package/dist/agent-verifier/chunk-JO5AMVZU.mjs.map +0 -1
  86. package/dist/agent-verifier/chunk-KDBSVLCF.mjs +0 -624
  87. package/dist/agent-verifier/chunk-KDBSVLCF.mjs.map +0 -1
  88. package/dist/agent-verifier/chunk-MW2QIWWA.mjs.map +0 -1
  89. package/dist/agent-verifier/chunk-NAK77WXW.mjs.map +0 -1
  90. package/dist/agent-verifier/chunk-ON62IGWK.mjs.map +0 -1
  91. package/dist/agent-verifier/chunk-QZH6IEZS.mjs +0 -39
  92. package/dist/agent-verifier/chunk-QZH6IEZS.mjs.map +0 -1
  93. package/dist/agent-verifier/chunk-TAEQKBJB.mjs.map +0 -1
  94. package/dist/agent-verifier/chunk-UIOLGH4A.mjs.map +0 -1
  95. package/dist/agent-verifier/chunk-XQXDOBYB.mjs.map +0 -1
  96. package/dist/agent-verifier/chunk-YDIOW2BO.mjs.map +0 -1
  97. package/dist/agent-verifier/chunk-Z6OZWUIZ.mjs.map +0 -1
  98. package/dist/agent-verifier/compile-576O7TYP.mjs +0 -312
  99. package/dist/agent-verifier/compile-576O7TYP.mjs.map +0 -1
  100. package/dist/agent-verifier/keychain-backend-A3MRWLPF.mjs.map +0 -1
  101. package/dist/agent-verifier/local-typecheck-2JWG5IGL.mjs +0 -10
  102. package/dist/agent-verifier/materialize-workspace-OZKOQCSQ.mjs.map +0 -1
  103. package/dist/agent-verifier/reducer-bundle-preflight-7NYZF5ZT.mjs +0 -20
  104. package/dist/agent-verifier/reducer-contract-preflight-COD2CO22.mjs +0 -11
  105. package/dist/agent-verifier/reducer-native-test-harness-QC7HZUK4.mjs +0 -50
  106. package/dist/agent-verifier/static-scaffold-JBUE3ROP.mjs +0 -27
  107. package/dist/agent-verifier/sync-C6S3OGCD.mjs +0 -588
  108. package/dist/agent-verifier/sync-C6S3OGCD.mjs.map +0 -1
  109. package/dist/agent-verifier/test-Y5UGQV7J.mjs +0 -353
  110. package/dist/agent-verifier/test-Y5UGQV7J.mjs.map +0 -1
  111. package/dist/agent-verifier/workspace-codegen-WPZHMATU.mjs.map +0 -1
  112. package/dist/agent-verifier/workspace-dependencies-B6A2ZX55.mjs.map +0 -1
  113. package/dist/chunk-3NRROR4P.js +0 -432
  114. package/dist/chunk-3NRROR4P.js.map +0 -1
  115. package/dist/chunk-M4SCKH5M.js.map +0 -1
  116. package/dist/dev-host/components/drawer.tsx +0 -132
  117. package/dist/dev-host/components/input.tsx +0 -21
  118. package/dist/dev-host/dev-api-proxy-plugin.ts +0 -328
  119. package/dist/dev-host/dev-author-dom-warnings.ts +0 -100
  120. package/dist/dev-host/dev-diagnostics.ts +0 -62
  121. package/dist/dev-host/dev-fallback-stylesheet.ts +0 -53
  122. package/dist/dev-host/dev-hmr-guard-plugin.ts +0 -47
  123. package/dist/dev-host/dev-host-controller.ts +0 -674
  124. package/dist/dev-host/dev-host-player-query.ts +0 -17
  125. package/dist/dev-host/dev-host-session-transport.ts +0 -52
  126. package/dist/dev-host/dev-host-storage.ts +0 -56
  127. package/dist/dev-host/dev-log-relay-plugin.ts +0 -510
  128. package/dist/dev-host/dev-runtime-config.ts +0 -14
  129. package/dist/dev-host/dev-runtime-platform.ts +0 -335
  130. package/dist/dev-host/dev-virtual-modules-plugin.ts +0 -64
  131. package/dist/dev-host/host-main.css +0 -224
  132. package/dist/dev-host/host-main.tsx +0 -948
  133. package/dist/dev-host/index.html +0 -56
  134. package/dist/dev-host/lib/utils.ts +0 -6
  135. package/dist/dev-host/plugin-main.ts +0 -61
  136. package/dist/dev-host/plugin.html +0 -24
  137. package/dist/dev-host/shared-styles.css +0 -144
  138. package/dist/dev-host/start-dev-server.ts +0 -140
  139. package/dist/dev-host/virtual-modules.d.ts +0 -27
  140. package/dist/global-config-YBFEGJQG.js.map +0 -1
  141. package/dist/keychain-backend-JHTXAKWC.js.map +0 -1
  142. package/skills/dreamboard/scripts/events-extract.mjs +0 -218
  143. /package/dist/agent-verifier/{chunk-XKCJBIRY.mjs.map → chunk-QD4SQNUP.mjs.map} +0 -0
  144. /package/dist/agent-verifier/{global-config-NYCSCAUI.mjs.map → global-config-2NUESNEQ.mjs.map} +0 -0
  145. /package/dist/agent-verifier/{local-files-QVJ2H3MH.mjs.map → local-files-OF4QFISU.mjs.map} +0 -0
  146. /package/dist/agent-verifier/{local-typecheck-2JWG5IGL.mjs.map → static-scaffold-U5DXE23S.mjs.map} +0 -0
  147. /package/dist/agent-verifier/{reducer-bundle-preflight-7NYZF5ZT.mjs.map → workspace-codegen-SPPVHURX.mjs.map} +0 -0
  148. /package/dist/agent-verifier/{reducer-contract-preflight-COD2CO22.mjs.map → workspace-dependencies-5HEEKZFP.mjs.map} +0 -0
  149. /package/dist/{agent-verifier/reducer-native-test-harness-QC7HZUK4.mjs.map → authoring-compatibility-internal.js.map} +0 -0
  150. /package/dist/{agent-verifier/static-scaffold-JBUE3ROP.mjs.map → global-config-RBMW7IVA.js.map} +0 -0
  151. /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.framework.json +0 -0
  152. /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.json +0 -0
  153. /package/{dist/scaffold → scaffold}/assets/static/ui/index.tsx +0 -0
  154. /package/{dist/scaffold → scaffold}/assets/static/ui/style.css +0 -0
  155. /package/{dist/scaffold → scaffold}/assets/static/ui/tsconfig.framework.json +0 -0
  156. /package/{dist/scaffold → scaffold}/assets/static/ui/tsconfig.json +0 -0
@@ -1,335 +0,0 @@
1
- import { createRequire } from "node:module";
2
- import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import { existsSync } from "node:fs";
5
- import type { Alias, ServerOptions } from "vite";
6
- import { resolveDevDiagnosticsLevel } from "./dev-diagnostics.js";
7
-
8
- export interface DevRuntimePlatformOptions {
9
- importMetaUrl: string;
10
- projectRoot: string;
11
- debug: boolean;
12
- port?: number;
13
- host?: string | boolean;
14
- allowedHosts?: string[];
15
- tailwindCssEntry: string;
16
- }
17
-
18
- export interface DevRuntimePlatform {
19
- devHostRoot: string;
20
- repoRoot: string;
21
- cliRoot: string;
22
- diagnosticsLevel: ReturnType<typeof resolveDevDiagnosticsLevel>;
23
- viteLogLevel: "info" | "warn";
24
- serverConfig: ServerOptions;
25
- resolveDedupe: string[];
26
- resolveAlias: Alias[];
27
- optimizeDepsExclude: string[];
28
- }
29
-
30
- export function createDevRuntimePlatform(
31
- options: DevRuntimePlatformOptions,
32
- ): DevRuntimePlatform {
33
- const devHostRoot = resolveDevHostRoot(options.importMetaUrl);
34
- const cliRoot = resolveCliRoot(options.importMetaUrl);
35
- const repoRoot = resolveRepoRoot(cliRoot);
36
- const require = createRequire(options.importMetaUrl);
37
- const diagnosticsLevel = resolveDevDiagnosticsLevel(options.debug);
38
- const sdkRoot = resolvePackageRoot(
39
- require,
40
- cliRoot,
41
- "@dreamboard-games/sdk",
42
- "@dreamboard-games/sdk",
43
- "node_modules/@dreamboard-games/sdk",
44
- );
45
- const apiClientClientGen = resolvePackageSubpath(
46
- require,
47
- cliRoot,
48
- "@dreamboard-games/api-client/client.gen",
49
- "@dreamboard-games/api-client/client.gen",
50
- "node_modules/@dreamboard-games/api-client/dist/client.gen.js",
51
- );
52
- const uiHostRuntimeRoot = resolveUiHostRuntimeRoot(require, cliRoot);
53
-
54
- return {
55
- devHostRoot,
56
- repoRoot,
57
- cliRoot,
58
- diagnosticsLevel,
59
- viteLogLevel: diagnosticsLevel === "verbose" ? "info" : "warn",
60
- serverConfig: {
61
- host: options.host ?? "localhost",
62
- allowedHosts: options.allowedHosts,
63
- port: options.port ?? 5352,
64
- strictPort: false,
65
- watch: {
66
- ignored: createProjectOnlyWatchIgnored(options.projectRoot),
67
- },
68
- headers: {
69
- "Access-Control-Allow-Origin": "*",
70
- "Access-Control-Allow-Methods": "GET, OPTIONS",
71
- },
72
- fs: {
73
- allow: [options.projectRoot, repoRoot],
74
- },
75
- },
76
- resolveDedupe: ["react", "react-dom", "@dreamboard-games/sdk"],
77
- resolveAlias: [
78
- {
79
- find: /^react$/,
80
- replacement: resolveCliDependency(
81
- require,
82
- cliRoot,
83
- "react",
84
- "node_modules/react/index.js",
85
- ),
86
- },
87
- {
88
- find: /^react\/jsx-runtime$/,
89
- replacement: resolveCliDependency(
90
- require,
91
- cliRoot,
92
- "react/jsx-runtime",
93
- "node_modules/react/jsx-runtime.js",
94
- ),
95
- },
96
- {
97
- find: /^react\/jsx-dev-runtime$/,
98
- replacement: resolveCliDependency(
99
- require,
100
- cliRoot,
101
- "react/jsx-dev-runtime",
102
- "node_modules/react/jsx-dev-runtime.js",
103
- ),
104
- },
105
- {
106
- find: /^react-dom$/,
107
- replacement: resolveCliDependency(
108
- require,
109
- cliRoot,
110
- "react-dom",
111
- "node_modules/react-dom/index.js",
112
- ),
113
- },
114
- {
115
- find: /^react-dom\/client$/,
116
- replacement: resolveCliDependency(
117
- require,
118
- cliRoot,
119
- "react-dom/client",
120
- "node_modules/react-dom/client.js",
121
- ),
122
- },
123
- {
124
- find: /^@dreamboard-games\/sdk\/ui$/,
125
- replacement: path.resolve(sdkRoot, "dist/ui.js"),
126
- },
127
- {
128
- find: /^@dreamboard-games\/sdk\/ui\/components$/,
129
- replacement: path.resolve(sdkRoot, "dist/ui/components.js"),
130
- },
131
- {
132
- find: /^@dreamboard-games\/sdk\/runtime$/,
133
- replacement: path.resolve(sdkRoot, "dist/runtime.js"),
134
- },
135
- {
136
- find: /^@dreamboard-games\/sdk\/runtime\/runtime-api$/,
137
- replacement: path.resolve(sdkRoot, "dist/runtime/runtime-api.js"),
138
- },
139
- {
140
- find: /^@dreamboard-games\/sdk\/runtime\/primitives$/,
141
- replacement: path.resolve(sdkRoot, "dist/runtime/primitives.js"),
142
- },
143
- {
144
- find: /^@dreamboard-games\/sdk\/runtime\/workspace-contract$/,
145
- replacement: path.resolve(
146
- sdkRoot,
147
- "dist/runtime/workspace-contract.js",
148
- ),
149
- },
150
- {
151
- find: /^@dreamboard-games\/ui-host-runtime\/components$/,
152
- replacement: path.resolve(uiHostRuntimeRoot, "src/components/index.ts"),
153
- },
154
- {
155
- find: /^@dreamboard-games\/ui-host-runtime\/runtime$/,
156
- replacement: path.resolve(uiHostRuntimeRoot, "src/runtime/index.ts"),
157
- },
158
- {
159
- find: /^@dreamboard\/manifest-contract$/,
160
- replacement: path.resolve(
161
- options.projectRoot,
162
- "shared/manifest-contract.ts",
163
- ),
164
- },
165
- {
166
- find: /^#dreamboard\/ui-contract$/,
167
- replacement: path.resolve(
168
- options.projectRoot,
169
- "shared/generated/ui-contract.ts",
170
- ),
171
- },
172
- {
173
- find: /^@dreamboard-games\/sdk\/ui\/plugin-styles\.css$/,
174
- replacement: resolveCliDependency(
175
- require,
176
- cliRoot,
177
- "@dreamboard-games/sdk/ui/plugin-styles.css",
178
- "node_modules/@dreamboard-games/sdk/dist/ui/plugin-styles.css",
179
- ),
180
- },
181
- {
182
- find: /^@dreamboard-games\/api-client\/client\.gen$/,
183
- replacement: apiClientClientGen,
184
- },
185
- {
186
- find: /^@shared\/(.*)$/,
187
- replacement: path.resolve(options.projectRoot, "shared/$1"),
188
- },
189
- {
190
- find: /^tailwindcss$/,
191
- replacement: options.tailwindCssEntry,
192
- },
193
- ],
194
- // Author SDKs are resolved from the project, not the CLI root. Let Vite
195
- // transform them fresh so its CLI-scoped dependency cache cannot pin an
196
- // older local snapshot after `dreamboard sync`.
197
- optimizeDepsExclude: [
198
- "@dreamboard-games/sdk",
199
- "@dreamboard-games/sdk/ui",
200
- "@dreamboard-games/sdk/runtime",
201
- "@dreamboard-games/sdk/runtime/primitives",
202
- "@dreamboard-games/sdk/runtime/workspace-contract",
203
- "@dreamboard-games/sdk/reducer",
204
- "@dreamboard-games/sdk/types",
205
- ],
206
- };
207
- }
208
-
209
- function createProjectOnlyWatchIgnored(
210
- projectRoot: string,
211
- ): (file: string) => boolean {
212
- const normalizedProjectRoot = path.resolve(projectRoot);
213
-
214
- return (file) => {
215
- const normalizedFile = path.resolve(file);
216
- const relativePath = path.relative(normalizedProjectRoot, normalizedFile);
217
- const isInsideProject =
218
- relativePath === "" ||
219
- (relativePath.length > 0 &&
220
- !relativePath.startsWith("..") &&
221
- !path.isAbsolute(relativePath));
222
-
223
- if (!isInsideProject) {
224
- return true;
225
- }
226
-
227
- const pathSegments = relativePath.split(path.sep);
228
- return (
229
- pathSegments.includes(".dreamboard") ||
230
- pathSegments.includes("node_modules")
231
- );
232
- };
233
- }
234
-
235
- function resolveUiHostRuntimeRoot(
236
- require: NodeJS.Require,
237
- cliRoot: string,
238
- ): string {
239
- try {
240
- return path.dirname(
241
- require.resolve("@dreamboard-games/ui-host-runtime/package.json"),
242
- );
243
- } catch {
244
- return path.resolve(cliRoot, "dist/runtime-packages/ui-host-runtime");
245
- }
246
- }
247
-
248
- function resolvePackageRoot(
249
- require: NodeJS.Require,
250
- cliRoot: string,
251
- specifier: string,
252
- publicSpecifier: string,
253
- fallbackRelativePath: string,
254
- ): string {
255
- try {
256
- return path.dirname(require.resolve(`${specifier}/package.json`));
257
- } catch {
258
- try {
259
- return path.dirname(require.resolve(`${publicSpecifier}/package.json`));
260
- } catch {
261
- return path.resolve(cliRoot, "..", "..", fallbackRelativePath);
262
- }
263
- }
264
- }
265
-
266
- function resolvePackageSubpath(
267
- require: NodeJS.Require,
268
- cliRoot: string,
269
- specifier: string,
270
- publicSpecifier: string,
271
- fallbackRelativePath: string,
272
- ): string {
273
- try {
274
- return require.resolve(specifier);
275
- } catch {
276
- try {
277
- return require.resolve(publicSpecifier);
278
- } catch {
279
- return path.resolve(cliRoot, fallbackRelativePath);
280
- }
281
- }
282
- }
283
-
284
- function resolveCliDependency(
285
- require: NodeJS.Require,
286
- cliRoot: string,
287
- specifier: string,
288
- fallbackRelativePath: string,
289
- ): string {
290
- try {
291
- return require.resolve(specifier);
292
- } catch {
293
- return path.resolve(cliRoot, fallbackRelativePath);
294
- }
295
- }
296
-
297
- function resolveDevHostRoot(importMetaUrl: string): string {
298
- const currentDir = path.dirname(fileURLToPath(importMetaUrl));
299
- const packagedDirCandidate = path.resolve(currentDir, "dev-host");
300
- if (existsSync(packagedDirCandidate)) return packagedDirCandidate;
301
- const sourceDirCandidate = path.resolve(currentDir, "../src/dev-host");
302
- return existsSync(sourceDirCandidate) ? sourceDirCandidate : currentDir;
303
- }
304
-
305
- function resolveCliRoot(importMetaUrl: string): string {
306
- let currentDir = path.dirname(fileURLToPath(importMetaUrl));
307
-
308
- while (true) {
309
- if (existsSync(path.join(currentDir, "package.json"))) {
310
- return currentDir;
311
- }
312
-
313
- const parentDir = path.dirname(currentDir);
314
- if (parentDir === currentDir) {
315
- return path.resolve(resolveDevHostRoot(importMetaUrl), "../..");
316
- }
317
- currentDir = parentDir;
318
- }
319
- }
320
-
321
- function resolveRepoRoot(cliRoot: string): string {
322
- let currentDir = cliRoot;
323
-
324
- while (true) {
325
- if (existsSync(path.join(currentDir, "pnpm-workspace.yaml"))) {
326
- return currentDir;
327
- }
328
-
329
- const parentDir = path.dirname(currentDir);
330
- if (parentDir === currentDir) {
331
- return cliRoot;
332
- }
333
- currentDir = parentDir;
334
- }
335
- }
@@ -1,64 +0,0 @@
1
- import path from "node:path";
2
- import { normalizePath, type Plugin } from "vite";
3
- import type { DreamboardDevRuntimeConfig } from "./dev-runtime-config.js";
4
-
5
- export function createVirtualDevModulesPlugin(options: {
6
- projectRoot: string;
7
- runtimeConfig: DreamboardDevRuntimeConfig;
8
- generatedFallbackStylesheetPath: string | null;
9
- }): Plugin {
10
- const configModuleId = "virtual:dreamboard-dev-config";
11
- const resolvedConfigModuleId = `\0${configModuleId}`;
12
- const projectEntryModuleId = "virtual:dreamboard-project-entry";
13
- const resolvedProjectEntryModuleId = `\0${projectEntryModuleId}`;
14
- const projectAppPath = path.resolve(options.projectRoot, "ui/App.tsx");
15
- const projectStylePath = path.resolve(options.projectRoot, "ui/style.css");
16
-
17
- return {
18
- name: "dreamboard-dev-virtual-modules",
19
- resolveId(id) {
20
- if (id === configModuleId) {
21
- return resolvedConfigModuleId;
22
- }
23
- if (id === projectEntryModuleId) {
24
- return resolvedProjectEntryModuleId;
25
- }
26
- return null;
27
- },
28
- load(id) {
29
- if (id === resolvedConfigModuleId) {
30
- return `export const devConfig = ${JSON.stringify(options.runtimeConfig)};\nexport default devConfig;\n`;
31
- }
32
- if (id === resolvedProjectEntryModuleId) {
33
- const fallbackImport = options.generatedFallbackStylesheetPath
34
- ? `import "/@fs/${normalizePath(options.generatedFallbackStylesheetPath)}";\n`
35
- : "";
36
- return `${fallbackImport}import { createElement } from "react";
37
- import { createRoot } from "react-dom/client";
38
- import { ErrorBoundary } from "@dreamboard-games/sdk/ui";
39
- import { PluginRuntime } from "@dreamboard-games/sdk/runtime";
40
- import "/@fs/${normalizePath(projectStylePath)}";
41
- import App from "/@fs/${normalizePath(projectAppPath)}";
42
-
43
- const rootElement = document.getElementById("root");
44
- if (!rootElement) {
45
- throw new Error("Dreamboard dev plugin root element was not found.");
46
- }
47
-
48
- createRoot(rootElement).render(
49
- createElement(
50
- ErrorBoundary,
51
- null,
52
- createElement(
53
- PluginRuntime,
54
- null,
55
- createElement(App),
56
- ),
57
- ),
58
- );
59
- `;
60
- }
61
- return null;
62
- },
63
- };
64
- }
@@ -1,224 +0,0 @@
1
- @import "./shared-styles.css";
2
- @import url("https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Patrick+Hand&display=swap");
3
-
4
- :root {
5
- color-scheme: light;
6
- --background: oklch(0.985 0.005 85);
7
- --foreground: oklch(0.25 0 0);
8
- --card: oklch(0.985 0.005 85);
9
- --card-foreground: oklch(0.25 0 0);
10
- --popover: oklch(0.985 0.005 85);
11
- --popover-foreground: oklch(0.25 0 0);
12
- --primary: oklch(0.6 0.2 25);
13
- --primary-foreground: oklch(1 0 0);
14
- --secondary: oklch(0.92 0.01 85);
15
- --secondary-foreground: oklch(0.25 0 0);
16
- --muted: oklch(0.92 0.01 85);
17
- --muted-foreground: oklch(0.5 0 0);
18
- --accent: oklch(0.97 0.05 100);
19
- --accent-foreground: oklch(0.25 0 0);
20
- --destructive: oklch(0.6 0.2 25);
21
- --destructive-foreground: oklch(1 0 0);
22
- --border: oklch(0.25 0 0);
23
- --input: oklch(0.25 0 0);
24
- --ring: oklch(0.45 0.15 250);
25
- --radius: 0.75rem;
26
- --font-display: "Kalam", cursive;
27
- --font-sans: "Patrick Hand", cursive;
28
- }
29
-
30
- html,
31
- body,
32
- #app {
33
- height: 100%;
34
- min-height: 100%;
35
- margin: 0;
36
- }
37
-
38
- body {
39
- min-height: 100vh;
40
- background-color: #f5f1e7;
41
- background-image:
42
- radial-gradient(
43
- circle at top left,
44
- rgba(255, 255, 255, 0.9),
45
- transparent 40%
46
- ),
47
- radial-gradient(#dcd5c9 1px, transparent 1px);
48
- background-size: 100% 100%, 24px 24px;
49
- background-attachment: fixed, fixed;
50
- color: #1f2937;
51
- font-family: var(--font-sans);
52
- }
53
-
54
- #app {
55
- display: block;
56
- }
57
-
58
- #app > * {
59
- min-height: 100%;
60
- }
61
-
62
- h1,
63
- h2,
64
- h3,
65
- h4,
66
- h5,
67
- h6 {
68
- font-family: var(--font-display);
69
- font-weight: 700;
70
- }
71
-
72
- .wobbly-border {
73
- border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
74
- }
75
-
76
- .wobbly-border-md {
77
- border-radius: 25px 8px 25px 8px / 8px 25px 8px 25px;
78
- }
79
-
80
- .wobbly-border-lg {
81
- border-radius: 45px 15px 45px 15px / 15px 45px 15px 45px;
82
- }
83
-
84
- .hard-shadow {
85
- box-shadow: 4px 4px 0 0 #2d2d2d;
86
- }
87
-
88
- .hard-shadow-lg {
89
- box-shadow: 8px 8px 0 0 #2d2d2d;
90
- }
91
-
92
- /* Calm secondary CTA inside the dev drawer — the player switcher is
93
- * already the panel's single wobbly+shadow stamp, so the primary action
94
- * here is intentionally quiet. */
95
- .dev-calm-button {
96
- display: inline-flex;
97
- align-items: center;
98
- justify-content: center;
99
- height: 2.5rem;
100
- padding: 0 1rem;
101
- border-radius: 0.5rem;
102
- border: 2px solid #2d2d2d;
103
- background-color: #2d2d2d;
104
- color: #fff8e8;
105
- font-family: var(--font-sans);
106
- font-size: 0.875rem;
107
- font-weight: 700;
108
- letter-spacing: 0.02em;
109
- transition:
110
- background-color 0.15s ease,
111
- transform 0.05s ease;
112
- }
113
-
114
- .dev-calm-button:hover:not(:disabled) {
115
- background-color: #1f1f1f;
116
- }
117
-
118
- .dev-calm-button:active:not(:disabled) {
119
- transform: translateY(1px);
120
- }
121
-
122
- .dev-calm-button:disabled {
123
- opacity: 0.5;
124
- cursor: not-allowed;
125
- }
126
-
127
- /* Tame HostHistoryNavigator into a text link inside the dev drawer.
128
- *
129
- * The upstream Button ships with `wobbly-border-md` + `hard-shadow`
130
- * baked into its base classes; twMerge cannot strip custom utilities so
131
- * we brute-force a flat link-style treatment with !important on multiple
132
- * selector forms. */
133
- .dev-history-shell button,
134
- .dev-history-shell [data-slot="button"],
135
- .dev-history-shell .wobbly-border-md,
136
- .dev-history-shell .hard-shadow {
137
- height: auto !important;
138
- padding: 0.25rem 0 !important;
139
- background: transparent !important;
140
- border: none !important;
141
- box-shadow: none !important;
142
- border-radius: 0 !important;
143
- font-size: 0.75rem !important;
144
- font-weight: 700 !important;
145
- color: oklch(0.5 0 0) !important;
146
- gap: 0.4rem !important;
147
- text-transform: uppercase;
148
- letter-spacing: 0.12em;
149
- }
150
-
151
- .dev-history-shell button:hover,
152
- .dev-history-shell [data-slot="button"]:hover {
153
- background: transparent !important;
154
- color: oklch(0.25 0 0) !important;
155
- box-shadow: none !important;
156
- transform: none !important;
157
- }
158
-
159
- .dev-history-shell [data-slot="badge"] {
160
- background-color: rgba(45, 45, 45, 0.08);
161
- color: oklch(0.25 0 0);
162
- border-color: transparent;
163
- padding: 0 0.4rem;
164
- font-size: 0.65rem;
165
- letter-spacing: 0;
166
- }
167
-
168
- /* Calm copy buttons inside the Debug fold so they're text-tabular, not
169
- * three wobbly stamps. */
170
- .dev-host-debug-shell button,
171
- .dev-host-debug-shell .wobbly-border-md,
172
- .dev-host-debug-shell .hard-shadow {
173
- border-radius: 0.375rem !important;
174
- box-shadow: none !important;
175
- border-width: 1px !important;
176
- border-color: rgba(45, 45, 45, 0.12) !important;
177
- background-color: transparent !important;
178
- }
179
-
180
- .dev-host-debug-shell button:hover {
181
- background-color: rgba(45, 45, 45, 0.04) !important;
182
- transform: none !important;
183
- box-shadow: none !important;
184
- }
185
-
186
- /* Seed input — pull off the upstream wobbly+thick border in favour of a
187
- * calm flat rectangle that matches the rest of the panel chrome. */
188
- .dev-seed-input {
189
- border-radius: 0.5rem !important;
190
- border-width: 1.5px !important;
191
- border-color: rgba(45, 45, 45, 0.18) !important;
192
- background-color: #fff !important;
193
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
194
- }
195
-
196
- .dev-seed-input:focus,
197
- .dev-seed-input:focus-visible {
198
- border-color: rgba(45, 45, 45, 0.4) !important;
199
- box-shadow: 0 0 0 3px rgba(45, 93, 161, 0.12) !important;
200
- }
201
-
202
- /* Edge handle — calm strip at rest, soft glow on hover. */
203
- .dev-edge-handle .dev-edge-strip {
204
- transition:
205
- background-color 200ms ease,
206
- box-shadow 200ms ease,
207
- width 200ms ease,
208
- height 200ms ease;
209
- }
210
-
211
- .dev-edge-handle:hover .dev-edge-strip,
212
- .dev-edge-handle:focus-visible .dev-edge-strip {
213
- width: 6px;
214
- height: 7rem;
215
- background-color: #2d5da1;
216
- box-shadow:
217
- 0 0 0 2px rgba(45, 93, 161, 0.18),
218
- 0 0 14px 4px rgba(45, 93, 161, 0.55),
219
- 0 0 28px 8px rgba(45, 93, 161, 0.25);
220
- }
221
-
222
- .dev-edge-handle:focus-visible {
223
- outline: none;
224
- }