@dreamboard-games/cli 0.1.30-alpha.11 → 0.1.30-alpha.13

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 (143) hide show
  1. package/README.md +2 -6
  2. package/dist/agent-verifier/agent-workspace-verifier.mjs +18 -17
  3. package/dist/agent-verifier/agent-workspace-verifier.mjs.map +1 -1
  4. package/dist/agent-verifier/{chunk-TLYGTHXU.mjs → chunk-5GCZZ6NW.mjs} +3 -3
  5. package/dist/agent-verifier/{chunk-YR664DJX.mjs → chunk-A67WUYN2.mjs} +42 -68
  6. package/dist/agent-verifier/chunk-A67WUYN2.mjs.map +1 -0
  7. package/dist/agent-verifier/chunk-AXXUGU7Q.mjs +255 -0
  8. package/dist/agent-verifier/chunk-AXXUGU7Q.mjs.map +1 -0
  9. package/dist/agent-verifier/chunk-CO3BRUD6.mjs +342 -0
  10. package/dist/agent-verifier/chunk-CO3BRUD6.mjs.map +1 -0
  11. package/dist/agent-verifier/chunk-DPYC2NDB.mjs +59 -0
  12. package/dist/agent-verifier/chunk-DPYC2NDB.mjs.map +1 -0
  13. package/dist/agent-verifier/{chunk-4GU3PCHV.mjs → chunk-DWLTCUUX.mjs} +576 -393
  14. package/dist/agent-verifier/chunk-DWLTCUUX.mjs.map +1 -0
  15. package/dist/agent-verifier/{chunk-COB56ESI.mjs → chunk-G2ECODRB.mjs} +2 -2
  16. package/dist/agent-verifier/{chunk-6XRC5PWB.mjs → chunk-H3XNWKJU.mjs} +217 -232
  17. package/dist/agent-verifier/chunk-H3XNWKJU.mjs.map +1 -0
  18. package/dist/agent-verifier/{chunk-Z6OZWUIZ.mjs → chunk-HLHT57AW.mjs} +64 -16
  19. package/dist/agent-verifier/chunk-HLHT57AW.mjs.map +1 -0
  20. package/dist/agent-verifier/{chunk-YDIOW2BO.mjs → chunk-INIK6LHK.mjs} +2 -2
  21. package/dist/agent-verifier/{chunk-VLOIZDR6.mjs → chunk-JPN62WDY.mjs} +199 -190
  22. package/dist/agent-verifier/chunk-JPN62WDY.mjs.map +1 -0
  23. package/dist/agent-verifier/{chunk-UWJIZML3.mjs → chunk-LKQ557TJ.mjs} +30 -23
  24. package/dist/agent-verifier/chunk-LKQ557TJ.mjs.map +1 -0
  25. package/dist/agent-verifier/{chunk-NAK77WXW.mjs → chunk-MYMVXTZT.mjs} +4 -5
  26. package/dist/agent-verifier/chunk-MYMVXTZT.mjs.map +1 -0
  27. package/dist/agent-verifier/{chunk-UIJ2NDG6.mjs → chunk-NFL3Z4Z7.mjs} +31 -238
  28. package/dist/agent-verifier/chunk-NFL3Z4Z7.mjs.map +1 -0
  29. package/dist/agent-verifier/{chunk-XKCJBIRY.mjs → chunk-QD4SQNUP.mjs} +2 -2
  30. package/dist/agent-verifier/{chunk-IAYRNVUC.mjs → chunk-RDYXWXXC.mjs} +1 -3
  31. package/dist/agent-verifier/{chunk-QBAF7EYR.mjs → chunk-TTB7AIHZ.mjs} +4 -4
  32. package/dist/agent-verifier/{chunk-QBAF7EYR.mjs.map → chunk-TTB7AIHZ.mjs.map} +1 -1
  33. package/dist/agent-verifier/chunk-V6AQDR7W.mjs +89 -0
  34. package/dist/agent-verifier/chunk-V6AQDR7W.mjs.map +1 -0
  35. package/dist/agent-verifier/{chunk-RHI6S4SU.mjs → chunk-V7ABTZXW.mjs} +1 -3
  36. package/dist/agent-verifier/{chunk-RHI6S4SU.mjs.map → chunk-V7ABTZXW.mjs.map} +1 -1
  37. package/dist/agent-verifier/chunk-WAFBU5U7.mjs +467 -0
  38. package/dist/agent-verifier/chunk-WAFBU5U7.mjs.map +1 -0
  39. package/dist/agent-verifier/{chunk-3IJBOLGT.mjs → chunk-WSIYUUSD.mjs} +2 -2
  40. package/dist/agent-verifier/{compile-WZ7X6I2A.mjs → compile-H6KCBCVH.mjs} +22 -18
  41. package/dist/agent-verifier/compile-H6KCBCVH.mjs.map +1 -0
  42. package/dist/agent-verifier/{global-config-XHL7BCKN.mjs → global-config-6UGFPLDA.mjs} +4 -3
  43. package/dist/agent-verifier/{keychain-backend-A3MRWLPF.mjs → keychain-backend-BQLW5VEC.mjs} +11 -6
  44. package/dist/agent-verifier/keychain-backend-BQLW5VEC.mjs.map +1 -0
  45. package/dist/agent-verifier/{local-files-ZW52HSVT.mjs → local-files-WPHUV6GU.mjs} +6 -6
  46. package/dist/agent-verifier/{materialize-workspace-BKZLLFI4.mjs → materialize-workspace-EHCQB4UU.mjs} +17 -17
  47. package/dist/agent-verifier/materialize-workspace-EHCQB4UU.mjs.map +1 -0
  48. package/dist/agent-verifier/{reducer-bundle-preflight-7NYZF5ZT.mjs → reducer-bundle-preflight-3DSXIELT.mjs} +4 -4
  49. package/dist/agent-verifier/reducer-contract-preflight-FQB7M4PU.mjs +11 -0
  50. package/dist/agent-verifier/{reducer-native-test-harness-D4VWPIAC.mjs → reducer-native-test-harness-GY2CCQWN.mjs} +12 -9
  51. package/dist/agent-verifier/{static-scaffold-JCRBDKEH.mjs → static-scaffold-3O543YTZ.mjs} +7 -9
  52. package/dist/agent-verifier/{sync-ELLJEWMB.mjs → sync-URBFMM6H.mjs} +24 -22
  53. package/dist/agent-verifier/{sync-ELLJEWMB.mjs.map → sync-URBFMM6H.mjs.map} +1 -1
  54. package/dist/agent-verifier/{test-OSXBPLSP.mjs → test-LQAGEQLY.mjs} +19 -17
  55. package/dist/agent-verifier/test-LQAGEQLY.mjs.map +1 -0
  56. package/dist/agent-verifier/{workspace-codegen-WPZHMATU.mjs → workspace-codegen-4IWICKLB.mjs} +3 -3
  57. package/dist/agent-verifier/{workspace-dependencies-ULZZZPNX.mjs → workspace-dependencies-ZMHPHVQV.mjs} +2 -2
  58. package/dist/authoring-compatibility-internal.js +12 -0
  59. package/dist/{agent-verifier/chunk-W2MDP5ZN.mjs → chunk-AVOAT522.js} +118 -21
  60. package/dist/chunk-AVOAT522.js.map +1 -0
  61. package/dist/chunk-EV7Q6BIF.js +4298 -0
  62. package/dist/chunk-EV7Q6BIF.js.map +1 -0
  63. package/dist/chunk-FFO2IJL3.js +204 -0
  64. package/dist/chunk-FFO2IJL3.js.map +1 -0
  65. package/dist/{chunk-P5TITCD3.js → chunk-GS6A7T53.js} +2240 -4554
  66. package/dist/chunk-GS6A7T53.js.map +1 -0
  67. package/dist/{global-config-WPJRXVDO.js → global-config-NLGAFSRU.js} +3 -2
  68. package/dist/global-config-NLGAFSRU.js.map +1 -0
  69. package/dist/index.js +1371 -3545
  70. package/dist/index.js.map +1 -1
  71. package/dist/internal.js +14 -8
  72. package/dist/{keychain-backend-JHTXAKWC.js → keychain-backend-47LZ5IX5.js} +11 -6
  73. package/dist/keychain-backend-47LZ5IX5.js.map +1 -0
  74. package/package.json +9 -19
  75. package/release/authoring-release-set.json +38 -0
  76. package/skills/dreamboard/references/manifest-authoring.md +11 -3
  77. package/dist/agent-verifier/chunk-4GU3PCHV.mjs.map +0 -1
  78. package/dist/agent-verifier/chunk-6XRC5PWB.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-KK47X7RV.mjs +0 -14
  82. package/dist/agent-verifier/chunk-KK47X7RV.mjs.map +0 -1
  83. package/dist/agent-verifier/chunk-NAK77WXW.mjs.map +0 -1
  84. package/dist/agent-verifier/chunk-UIJ2NDG6.mjs.map +0 -1
  85. package/dist/agent-verifier/chunk-UWJIZML3.mjs.map +0 -1
  86. package/dist/agent-verifier/chunk-VLOIZDR6.mjs.map +0 -1
  87. package/dist/agent-verifier/chunk-W2MDP5ZN.mjs.map +0 -1
  88. package/dist/agent-verifier/chunk-YR664DJX.mjs.map +0 -1
  89. package/dist/agent-verifier/chunk-Z6OZWUIZ.mjs.map +0 -1
  90. package/dist/agent-verifier/compile-WZ7X6I2A.mjs.map +0 -1
  91. package/dist/agent-verifier/keychain-backend-A3MRWLPF.mjs.map +0 -1
  92. package/dist/agent-verifier/materialize-workspace-BKZLLFI4.mjs.map +0 -1
  93. package/dist/agent-verifier/reducer-contract-preflight-COD2CO22.mjs +0 -11
  94. package/dist/agent-verifier/test-OSXBPLSP.mjs.map +0 -1
  95. package/dist/chunk-GXM7RRZJ.js +0 -433
  96. package/dist/chunk-GXM7RRZJ.js.map +0 -1
  97. package/dist/chunk-P5TITCD3.js.map +0 -1
  98. package/dist/dev-host/components/drawer.tsx +0 -132
  99. package/dist/dev-host/components/input.tsx +0 -21
  100. package/dist/dev-host/dev-api-proxy-plugin.ts +0 -328
  101. package/dist/dev-host/dev-author-dom-warnings.ts +0 -100
  102. package/dist/dev-host/dev-diagnostics.ts +0 -62
  103. package/dist/dev-host/dev-fallback-stylesheet.ts +0 -53
  104. package/dist/dev-host/dev-hmr-guard-plugin.ts +0 -47
  105. package/dist/dev-host/dev-host-controller.ts +0 -674
  106. package/dist/dev-host/dev-host-player-query.ts +0 -17
  107. package/dist/dev-host/dev-host-session-transport.ts +0 -52
  108. package/dist/dev-host/dev-host-storage.ts +0 -56
  109. package/dist/dev-host/dev-log-relay-plugin.ts +0 -510
  110. package/dist/dev-host/dev-runtime-config.ts +0 -14
  111. package/dist/dev-host/dev-runtime-platform.ts +0 -335
  112. package/dist/dev-host/dev-virtual-modules-plugin.ts +0 -64
  113. package/dist/dev-host/host-main.css +0 -224
  114. package/dist/dev-host/host-main.tsx +0 -948
  115. package/dist/dev-host/index.html +0 -56
  116. package/dist/dev-host/lib/utils.ts +0 -6
  117. package/dist/dev-host/plugin-main.ts +0 -61
  118. package/dist/dev-host/plugin.html +0 -24
  119. package/dist/dev-host/shared-styles.css +0 -144
  120. package/dist/dev-host/start-dev-server.ts +0 -140
  121. package/dist/dev-host/virtual-modules.d.ts +0 -27
  122. package/dist/keychain-backend-JHTXAKWC.js.map +0 -1
  123. /package/dist/agent-verifier/{chunk-TLYGTHXU.mjs.map → chunk-5GCZZ6NW.mjs.map} +0 -0
  124. /package/dist/agent-verifier/{chunk-COB56ESI.mjs.map → chunk-G2ECODRB.mjs.map} +0 -0
  125. /package/dist/agent-verifier/{chunk-YDIOW2BO.mjs.map → chunk-INIK6LHK.mjs.map} +0 -0
  126. /package/dist/agent-verifier/{chunk-XKCJBIRY.mjs.map → chunk-QD4SQNUP.mjs.map} +0 -0
  127. /package/dist/agent-verifier/{chunk-IAYRNVUC.mjs.map → chunk-RDYXWXXC.mjs.map} +0 -0
  128. /package/dist/agent-verifier/{chunk-3IJBOLGT.mjs.map → chunk-WSIYUUSD.mjs.map} +0 -0
  129. /package/dist/agent-verifier/{global-config-XHL7BCKN.mjs.map → global-config-6UGFPLDA.mjs.map} +0 -0
  130. /package/dist/agent-verifier/{local-files-ZW52HSVT.mjs.map → local-files-WPHUV6GU.mjs.map} +0 -0
  131. /package/dist/agent-verifier/{reducer-bundle-preflight-7NYZF5ZT.mjs.map → reducer-bundle-preflight-3DSXIELT.mjs.map} +0 -0
  132. /package/dist/agent-verifier/{reducer-contract-preflight-COD2CO22.mjs.map → reducer-contract-preflight-FQB7M4PU.mjs.map} +0 -0
  133. /package/dist/agent-verifier/{reducer-native-test-harness-D4VWPIAC.mjs.map → reducer-native-test-harness-GY2CCQWN.mjs.map} +0 -0
  134. /package/dist/agent-verifier/{static-scaffold-JCRBDKEH.mjs.map → static-scaffold-3O543YTZ.mjs.map} +0 -0
  135. /package/dist/agent-verifier/{workspace-codegen-WPZHMATU.mjs.map → workspace-codegen-4IWICKLB.mjs.map} +0 -0
  136. /package/dist/agent-verifier/{workspace-dependencies-ULZZZPNX.mjs.map → workspace-dependencies-ZMHPHVQV.mjs.map} +0 -0
  137. /package/dist/{global-config-WPJRXVDO.js.map → authoring-compatibility-internal.js.map} +0 -0
  138. /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.framework.json +0 -0
  139. /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.json +0 -0
  140. /package/{dist/scaffold → scaffold}/assets/static/ui/index.tsx +0 -0
  141. /package/{dist/scaffold → scaffold}/assets/static/ui/style.css +0 -0
  142. /package/{dist/scaffold → scaffold}/assets/static/ui/tsconfig.framework.json +0 -0
  143. /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
- }