@dreamboard-games/cli 0.1.30-alpha.3 → 0.1.30-alpha.31
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/README.md +27 -108
- package/dist/agent-verifier/agent-workspace-verifier.mjs +1988 -57
- package/dist/agent-verifier/agent-workspace-verifier.mjs.map +1 -1
- package/dist/agent-verifier/{chunk-XQXDOBYB.mjs → chunk-4I2WWAPK.mjs} +27 -10
- package/dist/agent-verifier/chunk-4I2WWAPK.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-O4YCPU7C.mjs → chunk-BWBN2TDJ.mjs} +539 -641
- package/dist/agent-verifier/chunk-BWBN2TDJ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-TAEQKBJB.mjs → chunk-GWRZRWCF.mjs} +1 -1
- package/dist/agent-verifier/chunk-GWRZRWCF.mjs.map +1 -0
- package/dist/agent-verifier/chunk-H6XDQJ3N.mjs +11 -0
- package/dist/agent-verifier/chunk-HUBV22JQ.mjs +89 -0
- package/dist/agent-verifier/chunk-HUBV22JQ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-VS573ERH.mjs → chunk-JZTH3EMV.mjs} +2 -2
- package/dist/agent-verifier/{chunk-XGWCY624.mjs → chunk-KDAQ4CZY.mjs} +34 -27
- package/dist/agent-verifier/chunk-KDAQ4CZY.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-IAYRNVUC.mjs → chunk-LMW66VBH.mjs} +2 -13
- package/dist/agent-verifier/{chunk-IAYRNVUC.mjs.map → chunk-LMW66VBH.mjs.map} +1 -1
- package/dist/agent-verifier/{chunk-776W3UGV.mjs → chunk-M6YNQZCC.mjs} +4 -13
- package/dist/agent-verifier/chunk-M6YNQZCC.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-H76MT5UR.mjs → chunk-M7UVBANQ.mjs} +2 -1
- package/dist/agent-verifier/chunk-M7UVBANQ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-SH5JKYOB.mjs → chunk-MIRGCMUC.mjs} +112 -26
- package/dist/agent-verifier/chunk-MIRGCMUC.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-NAK77WXW.mjs → chunk-MYMVXTZT.mjs} +4 -5
- package/dist/agent-verifier/chunk-MYMVXTZT.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-7WWGFAAU.mjs → chunk-NBRUEJUK.mjs} +215 -223
- package/dist/agent-verifier/chunk-NBRUEJUK.mjs.map +1 -0
- package/dist/agent-verifier/chunk-OJFZVGEL.mjs +492 -0
- package/dist/agent-verifier/chunk-OJFZVGEL.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-LUZ7KE6H.mjs → chunk-QD4SQNUP.mjs} +4 -8
- package/dist/agent-verifier/{chunk-LUZ7KE6H.mjs.map → chunk-QD4SQNUP.mjs.map} +1 -1
- package/dist/agent-verifier/chunk-TTB7AIHZ.mjs +214 -0
- package/dist/agent-verifier/chunk-TTB7AIHZ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-F2DIOJJZ.mjs → chunk-XCQQIPCO.mjs} +5 -46
- package/dist/agent-verifier/chunk-XCQQIPCO.mjs.map +1 -0
- package/dist/agent-verifier/{global-config-Y2NTSK4R.mjs → global-config-2NUESNEQ.mjs} +6 -6
- package/dist/agent-verifier/{keychain-backend-SPQWGKZN.mjs → keychain-backend-FF4I6ODB.mjs} +12 -7
- package/dist/agent-verifier/keychain-backend-FF4I6ODB.mjs.map +1 -0
- package/dist/agent-verifier/{local-files-JFOQQZDL.mjs → local-files-OF4QFISU.mjs} +10 -10
- package/dist/agent-verifier/{chunk-UIOLGH4A.mjs → local-typecheck-DHVLM37Z.mjs} +4 -4
- package/dist/agent-verifier/local-typecheck-DHVLM37Z.mjs.map +1 -0
- package/dist/agent-verifier/{materialize-workspace-ZAVGQQSF.mjs → materialize-workspace-MAGKDMK5.mjs} +23 -22
- package/dist/agent-verifier/materialize-workspace-MAGKDMK5.mjs.map +1 -0
- package/dist/agent-verifier/{project-state-K576C2TE.mjs → project-state-XKUSCFSV.mjs} +2 -2
- package/dist/agent-verifier/{prompt-MJRJMOGQ.mjs → prompt-VKHMCQT6.mjs} +2 -2
- package/dist/agent-verifier/{chunk-A64ZZUZV.mjs → reducer-bundle-preflight-GLUJKTWU.mjs} +76 -25
- package/dist/agent-verifier/reducer-bundle-preflight-GLUJKTWU.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-JGT4P4UD.mjs → reducer-contract-preflight-WVQQPW5F.mjs} +7 -6
- package/dist/agent-verifier/reducer-contract-preflight-WVQQPW5F.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-E7SSWJXJ.mjs → reducer-native-test-harness-UFMSNNDY.mjs} +463 -686
- package/dist/agent-verifier/reducer-native-test-harness-UFMSNNDY.mjs.map +1 -0
- package/dist/agent-verifier/static-scaffold-CLRRWXON.mjs +24 -0
- package/dist/agent-verifier/workspace-codegen-SPPVHURX.mjs +10 -0
- package/dist/agent-verifier/{workspace-dependencies-NOOQBK6I.mjs → workspace-dependencies-5HEEKZFP.mjs} +6 -4
- package/dist/authoring-compatibility-internal.js +12 -0
- package/dist/chunk-2H7UOFLK.js +11 -0
- package/dist/chunk-6NYVJYN4.js +313 -0
- package/dist/chunk-6NYVJYN4.js.map +1 -0
- package/dist/chunk-EQNBQVIW.js +204 -0
- package/dist/chunk-EQNBQVIW.js.map +1 -0
- package/dist/chunk-X244CUU4.js +3815 -0
- package/dist/chunk-X244CUU4.js.map +1 -0
- package/dist/{chunk-TAQKH67O.js → chunk-YNJVKC2T.js} +2587 -7278
- package/dist/chunk-YNJVKC2T.js.map +1 -0
- package/dist/{global-config-S4ZIPECE.js → global-config-RBMW7IVA.js} +4 -3
- package/dist/index.js +3099 -6187
- package/dist/index.js.map +1 -1
- package/dist/internal.js +36 -10
- package/dist/internal.js.map +1 -1
- package/dist/{keychain-backend-HDF4TZDL.js → keychain-backend-FSNTNTZE.js} +12 -7
- package/dist/keychain-backend-FSNTNTZE.js.map +1 -0
- package/dist/{prompt-NDV3AE5L.js → prompt-GMZABCJC.js} +2 -2
- package/package.json +9 -19
- package/release/authoring-release-set.json +38 -0
- package/skills/dreamboard/SKILL.md +30 -28
- package/skills/dreamboard/references/building-your-first-game.md +15 -15
- package/skills/dreamboard/references/cli.md +46 -47
- package/skills/dreamboard/references/manifest-authoring.md +11 -3
- package/skills/dreamboard/references/quickstart.md +16 -13
- package/skills/dreamboard/references/testing.md +6 -13
- package/dist/agent-verifier/chunk-3UKQVWLV.mjs +0 -1744
- package/dist/agent-verifier/chunk-3UKQVWLV.mjs.map +0 -1
- package/dist/agent-verifier/chunk-776W3UGV.mjs.map +0 -1
- package/dist/agent-verifier/chunk-7WWGFAAU.mjs.map +0 -1
- package/dist/agent-verifier/chunk-A64ZZUZV.mjs.map +0 -1
- package/dist/agent-verifier/chunk-E7SSWJXJ.mjs.map +0 -1
- package/dist/agent-verifier/chunk-F2DIOJJZ.mjs.map +0 -1
- package/dist/agent-verifier/chunk-G42BGGG2.mjs +0 -70
- package/dist/agent-verifier/chunk-G42BGGG2.mjs.map +0 -1
- package/dist/agent-verifier/chunk-H76MT5UR.mjs.map +0 -1
- package/dist/agent-verifier/chunk-HGMUAL33.mjs +0 -39
- package/dist/agent-verifier/chunk-HGMUAL33.mjs.map +0 -1
- package/dist/agent-verifier/chunk-JGT4P4UD.mjs.map +0 -1
- package/dist/agent-verifier/chunk-NAK77WXW.mjs.map +0 -1
- package/dist/agent-verifier/chunk-O4YCPU7C.mjs.map +0 -1
- package/dist/agent-verifier/chunk-S34FRJHS.mjs +0 -222
- package/dist/agent-verifier/chunk-S34FRJHS.mjs.map +0 -1
- package/dist/agent-verifier/chunk-SH5JKYOB.mjs.map +0 -1
- package/dist/agent-verifier/chunk-SKI2ESE5.mjs +0 -44
- package/dist/agent-verifier/chunk-TAEQKBJB.mjs.map +0 -1
- package/dist/agent-verifier/chunk-UIOLGH4A.mjs.map +0 -1
- package/dist/agent-verifier/chunk-UIZNWRM6.mjs +0 -2432
- package/dist/agent-verifier/chunk-UIZNWRM6.mjs.map +0 -1
- package/dist/agent-verifier/chunk-W3N3QJ4V.mjs +0 -624
- package/dist/agent-verifier/chunk-W3N3QJ4V.mjs.map +0 -1
- package/dist/agent-verifier/chunk-XGWCY624.mjs.map +0 -1
- package/dist/agent-verifier/chunk-XQXDOBYB.mjs.map +0 -1
- package/dist/agent-verifier/compile-TEQVA46V.mjs +0 -312
- package/dist/agent-verifier/compile-TEQVA46V.mjs.map +0 -1
- package/dist/agent-verifier/keychain-backend-SPQWGKZN.mjs.map +0 -1
- package/dist/agent-verifier/local-typecheck-XVGWI75X.mjs +0 -10
- package/dist/agent-verifier/materialize-workspace-ZAVGQQSF.mjs.map +0 -1
- package/dist/agent-verifier/reducer-bundle-preflight-LXNJUBKL.mjs +0 -20
- package/dist/agent-verifier/reducer-contract-preflight-TUMQ43JV.mjs +0 -11
- package/dist/agent-verifier/reducer-native-test-harness-CHX5MBL5.mjs +0 -50
- package/dist/agent-verifier/static-scaffold-R7SVDRQI.mjs +0 -27
- package/dist/agent-verifier/sync-THAI546U.mjs +0 -588
- package/dist/agent-verifier/sync-THAI546U.mjs.map +0 -1
- package/dist/agent-verifier/test-AFAQFKOB.mjs +0 -353
- package/dist/agent-verifier/test-AFAQFKOB.mjs.map +0 -1
- package/dist/agent-verifier/workspace-codegen-2ZMQRIKJ.mjs +0 -10
- package/dist/agent-verifier/workspace-dependencies-NOOQBK6I.mjs.map +0 -1
- package/dist/chunk-N7XPNNUI.js +0 -432
- package/dist/chunk-N7XPNNUI.js.map +0 -1
- package/dist/chunk-SEGVTWSK.js +0 -44
- package/dist/chunk-SEGVTWSK.js.map +0 -1
- package/dist/chunk-TAQKH67O.js.map +0 -1
- package/dist/dev-host/components/drawer.tsx +0 -132
- package/dist/dev-host/components/input.tsx +0 -21
- package/dist/dev-host/dev-api-proxy-plugin.ts +0 -328
- package/dist/dev-host/dev-author-dom-warnings.ts +0 -100
- package/dist/dev-host/dev-diagnostics.ts +0 -62
- package/dist/dev-host/dev-fallback-stylesheet.ts +0 -53
- package/dist/dev-host/dev-hmr-guard-plugin.ts +0 -47
- package/dist/dev-host/dev-host-controller.ts +0 -674
- package/dist/dev-host/dev-host-player-query.ts +0 -17
- package/dist/dev-host/dev-host-session-transport.ts +0 -52
- package/dist/dev-host/dev-host-storage.ts +0 -56
- package/dist/dev-host/dev-log-relay-plugin.ts +0 -510
- package/dist/dev-host/dev-runtime-config.ts +0 -14
- package/dist/dev-host/dev-runtime-platform.ts +0 -335
- package/dist/dev-host/dev-virtual-modules-plugin.ts +0 -64
- package/dist/dev-host/host-main.css +0 -224
- package/dist/dev-host/host-main.tsx +0 -948
- package/dist/dev-host/index.html +0 -56
- package/dist/dev-host/lib/utils.ts +0 -6
- package/dist/dev-host/plugin-main.ts +0 -61
- package/dist/dev-host/plugin.html +0 -24
- package/dist/dev-host/shared-styles.css +0 -144
- package/dist/dev-host/start-dev-server.ts +0 -140
- package/dist/dev-host/virtual-modules.d.ts +0 -27
- package/dist/global-config-S4ZIPECE.js.map +0 -1
- package/dist/keychain-backend-HDF4TZDL.js.map +0 -1
- package/skills/dreamboard/scripts/events-extract.mjs +0 -218
- /package/dist/agent-verifier/{chunk-SKI2ESE5.mjs.map → chunk-H6XDQJ3N.mjs.map} +0 -0
- /package/dist/agent-verifier/{chunk-VS573ERH.mjs.map → chunk-JZTH3EMV.mjs.map} +0 -0
- /package/dist/agent-verifier/{global-config-Y2NTSK4R.mjs.map → global-config-2NUESNEQ.mjs.map} +0 -0
- /package/dist/agent-verifier/{local-files-JFOQQZDL.mjs.map → local-files-OF4QFISU.mjs.map} +0 -0
- /package/dist/agent-verifier/{local-typecheck-XVGWI75X.mjs.map → project-state-XKUSCFSV.mjs.map} +0 -0
- /package/dist/agent-verifier/{prompt-MJRJMOGQ.mjs.map → prompt-VKHMCQT6.mjs.map} +0 -0
- /package/dist/agent-verifier/{project-state-K576C2TE.mjs.map → static-scaffold-CLRRWXON.mjs.map} +0 -0
- /package/dist/agent-verifier/{reducer-bundle-preflight-LXNJUBKL.mjs.map → workspace-codegen-SPPVHURX.mjs.map} +0 -0
- /package/dist/agent-verifier/{reducer-contract-preflight-TUMQ43JV.mjs.map → workspace-dependencies-5HEEKZFP.mjs.map} +0 -0
- /package/dist/{agent-verifier/reducer-native-test-harness-CHX5MBL5.mjs.map → authoring-compatibility-internal.js.map} +0 -0
- /package/dist/{agent-verifier/static-scaffold-R7SVDRQI.mjs.map → chunk-2H7UOFLK.js.map} +0 -0
- /package/dist/{agent-verifier/workspace-codegen-2ZMQRIKJ.mjs.map → global-config-RBMW7IVA.js.map} +0 -0
- /package/dist/{prompt-NDV3AE5L.js.map → prompt-GMZABCJC.js.map} +0 -0
- /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.framework.json +0 -0
- /package/{dist/scaffold → scaffold}/assets/static/app/tsconfig.json +0 -0
- /package/{dist/scaffold → scaffold}/assets/static/ui/index.tsx +0 -0
- /package/{dist/scaffold → scaffold}/assets/static/ui/style.css +0 -0
- /package/{dist/scaffold → scaffold}/assets/static/ui/tsconfig.framework.json +0 -0
- /package/{dist/scaffold → scaffold}/assets/static/ui/tsconfig.json +0 -0
|
@@ -1,49 +1,89 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
REDUCER_TESTING_TYPES_WRAPPER_CONTENT
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XCQQIPCO.mjs";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./chunk-776W3UGV.mjs";
|
|
6
|
+
ensureDir
|
|
7
|
+
} from "./chunk-LMW66VBH.mjs";
|
|
9
8
|
import {
|
|
10
9
|
isDynamicSeedPath,
|
|
11
10
|
materializeManifest
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BWBN2TDJ.mjs";
|
|
13
12
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from "./chunk-IAYRNVUC.mjs";
|
|
13
|
+
normalizeOwnedProjectPath,
|
|
14
|
+
readWorkspaceTextFile,
|
|
15
|
+
readWorkspaceTextFileIfExists,
|
|
16
|
+
removeWorkspacePath,
|
|
17
|
+
resolveWorkspacePath,
|
|
18
|
+
unlinkWorkspaceFile,
|
|
19
|
+
workspacePathExists,
|
|
20
|
+
writeWorkspaceTextFile
|
|
21
|
+
} from "./chunk-OJFZVGEL.mjs";
|
|
24
22
|
import {
|
|
25
23
|
FRAMEWORK_PNPM_OVERRIDES,
|
|
26
24
|
FRAMEWORK_REACT_DEPENDENCIES,
|
|
27
25
|
FRAMEWORK_ZOD_VERSION
|
|
28
26
|
} from "./chunk-ZEELHSY3.mjs";
|
|
29
27
|
import {
|
|
30
|
-
MANIFEST_TYPECHECK_CONFIG_FILE
|
|
31
|
-
|
|
32
|
-
PROJECT_DIR_NAME
|
|
33
|
-
} from "./chunk-H76MT5UR.mjs";
|
|
28
|
+
MANIFEST_TYPECHECK_CONFIG_FILE
|
|
29
|
+
} from "./chunk-M7UVBANQ.mjs";
|
|
34
30
|
|
|
35
31
|
// src/services/project/static-scaffold.ts
|
|
36
|
-
import { existsSync
|
|
37
|
-
import { readdir, readFile,
|
|
32
|
+
import { existsSync } from "fs";
|
|
33
|
+
import { readdir, readFile, rmdir } from "fs/promises";
|
|
38
34
|
import path from "path";
|
|
39
35
|
import { fileURLToPath } from "url";
|
|
40
|
-
|
|
36
|
+
|
|
37
|
+
// src/release/authoring-release-set.generated.ts
|
|
38
|
+
var AUTHORING_RELEASE_SET = {
|
|
39
|
+
"schemaVersion": 1,
|
|
40
|
+
"channel": "public",
|
|
41
|
+
"packages": {
|
|
42
|
+
"cli": {
|
|
43
|
+
"name": "@dreamboard-games/cli",
|
|
44
|
+
"version": "0.1.30-alpha.31"
|
|
45
|
+
},
|
|
46
|
+
"sdk": {
|
|
47
|
+
"name": "@dreamboard-games/sdk",
|
|
48
|
+
"version": "0.4.0-alpha.6"
|
|
49
|
+
},
|
|
50
|
+
"apiClient": {
|
|
51
|
+
"name": "@dreamboard-games/api-client",
|
|
52
|
+
"version": "0.3.0-alpha.4"
|
|
53
|
+
},
|
|
54
|
+
"devHost": {
|
|
55
|
+
"name": "@dreamboard-games/dev-host",
|
|
56
|
+
"version": "0.1.30-alpha.19"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"protocols": {
|
|
60
|
+
"authoringAdapter": 1,
|
|
61
|
+
"devHost": 1,
|
|
62
|
+
"verifier": 1
|
|
63
|
+
},
|
|
64
|
+
"schemas": {
|
|
65
|
+
"scaffold": 2,
|
|
66
|
+
"manifest": 2,
|
|
67
|
+
"generatedArtifacts": 1
|
|
68
|
+
},
|
|
69
|
+
"registry": {
|
|
70
|
+
"kind": "public-npm",
|
|
71
|
+
"portable": true
|
|
72
|
+
},
|
|
73
|
+
"packageManager": "pnpm@10.4.1",
|
|
74
|
+
"releaseSetId": "sha256:d4c979aab04c28c64e3b2f069051eecd00b968ec67fcbe5a7b133ca370e24462"
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// src/services/project/static-scaffold.ts
|
|
78
|
+
var DREAMBOARD_SCAFFOLD_REFRESH_COMMAND = "dreamboard project create or dreamboard project clone";
|
|
41
79
|
var DREAMBOARD_GITIGNORE_BLOCK = [
|
|
42
80
|
"# Dreamboard local state",
|
|
43
81
|
".dreamboard/state.json",
|
|
44
82
|
".dreamboard/snapshot.json",
|
|
45
83
|
".dreamboard/dev/",
|
|
46
84
|
".dreamboard/generated/",
|
|
85
|
+
"node_modules/",
|
|
86
|
+
"ui/node_modules/",
|
|
47
87
|
""
|
|
48
88
|
].join("\n");
|
|
49
89
|
var TESTING_TYPES_STUB = "export function defineScenario(scenario) { return scenario; }\n";
|
|
@@ -82,26 +122,25 @@ export default defineScenario({
|
|
|
82
122
|
"Sanity check that the scaffolded workspace boots into its initial phase.",
|
|
83
123
|
from: "initial-turn",
|
|
84
124
|
when: async () => undefined,
|
|
85
|
-
then: ({ expect,
|
|
125
|
+
then: ({ expect, players, state }) => {
|
|
86
126
|
const playerIds = players();
|
|
87
127
|
expect(playerIds).toHaveLength(playerIds.length);
|
|
88
128
|
expect(playerIds.length).toBeGreaterThanOrEqual(1);
|
|
89
129
|
expect(state()).toBe("setup");
|
|
90
|
-
for (const playerId of playerIds) {
|
|
91
|
-
expect(interactions(playerId)).toEqual([]);
|
|
92
|
-
}
|
|
93
130
|
},
|
|
94
131
|
});
|
|
95
132
|
`;
|
|
96
133
|
var STATIC_ASSET_ROOT = resolveStaticAssetRoot();
|
|
97
|
-
var
|
|
98
|
-
"@dreamboard-games/sdk":
|
|
134
|
+
var SDK_DEPENDENCY_RANGES = {
|
|
135
|
+
"@dreamboard-games/sdk": AUTHORING_RELEASE_SET.packages.sdk.version
|
|
99
136
|
};
|
|
100
|
-
var
|
|
101
|
-
"@dreamboard-games/
|
|
137
|
+
var DEV_HOST_DEPENDENCY_RANGES = {
|
|
138
|
+
"@dreamboard-games/dev-host": AUTHORING_RELEASE_SET.packages.devHost.version
|
|
102
139
|
};
|
|
103
|
-
var
|
|
104
|
-
"@dreamboard-games/
|
|
140
|
+
var DREAMBOARD_PACKAGE_OVERRIDES = {
|
|
141
|
+
"@dreamboard-games/api-client": AUTHORING_RELEASE_SET.packages.apiClient.version,
|
|
142
|
+
"@dreamboard-games/dev-host": AUTHORING_RELEASE_SET.packages.devHost.version,
|
|
143
|
+
"@dreamboard-games/sdk": AUTHORING_RELEASE_SET.packages.sdk.version
|
|
105
144
|
};
|
|
106
145
|
var FRAMEWORK_SCRIPTS = {
|
|
107
146
|
dev: "dreamboard dev",
|
|
@@ -128,50 +167,38 @@ var SHARED_DEV_DEPENDENCIES = {
|
|
|
128
167
|
async function scaffoldStaticWorkspace(projectRoot, mode, options = {}) {
|
|
129
168
|
await writeFrameworkStaticFiles(projectRoot, mode, options);
|
|
130
169
|
await ensureDreamboardGitignore(projectRoot);
|
|
131
|
-
await writeManifestTypecheckTsconfig(
|
|
132
|
-
path.join(projectRoot, MANIFEST_TYPECHECK_CONFIG_FILE)
|
|
133
|
-
);
|
|
170
|
+
await writeManifestTypecheckTsconfig(projectRoot);
|
|
134
171
|
await removeLegacyVendoredSdkPaths(projectRoot);
|
|
135
172
|
await removeLegacyDreamboardComponentPath(projectRoot);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
await
|
|
141
|
-
await ensureDir(scenariosDir);
|
|
142
|
-
await ensureDir(generatedDir);
|
|
143
|
-
await writeTestReadme(path.join(testDir, "README.md"));
|
|
144
|
-
await writeGeneratedTestingStubs(generatedDir, mode);
|
|
173
|
+
await ensureDir(resolveWorkspacePath(projectRoot, "test/bases"));
|
|
174
|
+
await ensureDir(resolveWorkspacePath(projectRoot, "test/scenarios"));
|
|
175
|
+
await ensureDir(resolveWorkspacePath(projectRoot, "test/generated"));
|
|
176
|
+
await writeTestReadme(projectRoot);
|
|
177
|
+
await writeGeneratedTestingStubs(projectRoot, mode);
|
|
145
178
|
const initialTestPlayerCount = await inferInitialTestPlayerCount(projectRoot);
|
|
146
|
-
await writeInitialBase(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
path.join(scenariosDir, "smoke-initial-turn.scenario.ts"),
|
|
153
|
-
mode
|
|
154
|
-
);
|
|
155
|
-
await writeTestingTypes(path.join(testDir, "testing-types.ts"), mode);
|
|
156
|
-
await writeTestTsconfig(path.join(testDir, "tsconfig.json"));
|
|
157
|
-
const staleDtsPath = path.join(testDir, "testing-types.d.ts");
|
|
158
|
-
if (await exists(staleDtsPath)) {
|
|
159
|
-
await unlink(staleDtsPath);
|
|
179
|
+
await writeInitialBase(projectRoot, mode, initialTestPlayerCount);
|
|
180
|
+
await writeInitialScenario(projectRoot, mode);
|
|
181
|
+
await writeTestingTypes(projectRoot, mode);
|
|
182
|
+
await writeTestTsconfig(projectRoot);
|
|
183
|
+
if (await workspacePathExists(projectRoot, "test/testing-types.d.ts")) {
|
|
184
|
+
await unlinkWorkspaceFile(projectRoot, "test/testing-types.d.ts");
|
|
160
185
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
await unlink(staleBaseScenariosPath);
|
|
186
|
+
if (await workspacePathExists(projectRoot, "test/base-scenarios.json")) {
|
|
187
|
+
await unlinkWorkspaceFile(projectRoot, "test/base-scenarios.json");
|
|
164
188
|
}
|
|
165
189
|
await migrateLegacyScenarioImports(projectRoot);
|
|
166
190
|
}
|
|
167
191
|
async function ensureDreamboardGitignore(projectRoot) {
|
|
168
|
-
const
|
|
169
|
-
|
|
192
|
+
const existing = await readWorkspaceTextFileIfExists(
|
|
193
|
+
projectRoot,
|
|
194
|
+
".gitignore"
|
|
195
|
+
);
|
|
170
196
|
if (existing?.includes(".dreamboard/state.json")) {
|
|
171
197
|
return;
|
|
172
198
|
}
|
|
173
|
-
await
|
|
174
|
-
|
|
199
|
+
await writeWorkspaceTextFile(
|
|
200
|
+
projectRoot,
|
|
201
|
+
".gitignore",
|
|
175
202
|
`${existing ? `${existing.trimEnd()}
|
|
176
203
|
|
|
177
204
|
` : ""}${DREAMBOARD_GITIGNORE_BLOCK}`
|
|
@@ -181,14 +208,18 @@ async function assertCliStaticScaffoldComplete(projectRoot, deletedPaths = []) {
|
|
|
181
208
|
const expectedEntries = await getExpectedStaticEntries(projectRoot);
|
|
182
209
|
const missingOrBlankPaths = [];
|
|
183
210
|
for (const entry of expectedEntries) {
|
|
184
|
-
const
|
|
185
|
-
|
|
211
|
+
const content = await readWorkspaceTextFileIfExists(
|
|
212
|
+
projectRoot,
|
|
213
|
+
entry.targetPath
|
|
214
|
+
);
|
|
186
215
|
if (content === null || content.trim().length === 0) {
|
|
187
216
|
missingOrBlankPaths.push(entry.targetPath);
|
|
188
217
|
}
|
|
189
218
|
}
|
|
190
219
|
const staticPaths = new Set(expectedEntries.map((entry) => entry.targetPath));
|
|
191
|
-
const deletedStaticPaths = deletedPaths.map(
|
|
220
|
+
const deletedStaticPaths = deletedPaths.map(normalizeOwnedProjectPath).filter(
|
|
221
|
+
(filePath) => filePath !== null && staticPaths.has(filePath)
|
|
222
|
+
).sort();
|
|
192
223
|
if (missingOrBlankPaths.length === 0 && deletedStaticPaths.length === 0) {
|
|
193
224
|
return;
|
|
194
225
|
}
|
|
@@ -202,54 +233,54 @@ async function assertCliStaticScaffoldComplete(projectRoot, deletedPaths = []) {
|
|
|
202
233
|
problems.push(`deleted: ${summarizePaths(deletedStaticPaths)}`);
|
|
203
234
|
}
|
|
204
235
|
throw new Error(
|
|
205
|
-
`CLI static scaffold is incomplete (${problems.join("; ")}).
|
|
236
|
+
`CLI static scaffold is incomplete (${problems.join("; ")}). Refresh the project scaffold with ${DREAMBOARD_SCAFFOLD_REFRESH_COMMAND} before building or testing.`
|
|
206
237
|
);
|
|
207
238
|
}
|
|
208
239
|
async function writeFrameworkStaticFiles(projectRoot, mode, options) {
|
|
209
240
|
const assetEntries = await getStaticAssetEntries();
|
|
210
241
|
for (const entry of assetEntries) {
|
|
211
|
-
const fullPath = path.join(projectRoot, entry.targetPath);
|
|
212
242
|
if (mode === "update" && isDynamicSeedPath(entry.targetPath)) {
|
|
213
|
-
const existing = await
|
|
243
|
+
const existing = await readWorkspaceTextFileIfExists(
|
|
244
|
+
projectRoot,
|
|
245
|
+
entry.targetPath
|
|
246
|
+
);
|
|
214
247
|
if (existing !== null && existing.trim().length > 0) {
|
|
215
248
|
continue;
|
|
216
249
|
}
|
|
217
250
|
}
|
|
218
|
-
await
|
|
251
|
+
await writeWorkspaceTextFile(projectRoot, entry.targetPath, entry.content);
|
|
219
252
|
}
|
|
220
253
|
for (const entry of await getDynamicStaticEntries(
|
|
221
254
|
projectRoot,
|
|
222
255
|
mode,
|
|
223
256
|
options
|
|
224
257
|
)) {
|
|
225
|
-
await
|
|
226
|
-
path.join(projectRoot, entry.targetPath),
|
|
227
|
-
entry.content
|
|
228
|
-
);
|
|
258
|
+
await writeWorkspaceTextFile(projectRoot, entry.targetPath, entry.content);
|
|
229
259
|
}
|
|
230
260
|
if (!options.localMaintainerRegistry) {
|
|
231
|
-
await
|
|
261
|
+
await removeWorkspacePath(projectRoot, ".npmrc", { force: true });
|
|
232
262
|
}
|
|
233
263
|
}
|
|
234
264
|
async function removeLegacyVendoredSdkPaths(projectRoot) {
|
|
235
|
-
await
|
|
265
|
+
await removeWorkspacePath(projectRoot, "app/sdk", {
|
|
236
266
|
recursive: true,
|
|
237
267
|
force: true
|
|
238
268
|
});
|
|
239
|
-
await
|
|
269
|
+
await removeWorkspacePath(projectRoot, "ui/sdk", {
|
|
240
270
|
recursive: true,
|
|
241
271
|
force: true
|
|
242
272
|
});
|
|
243
273
|
}
|
|
244
274
|
async function removeLegacyDreamboardComponentPath(projectRoot) {
|
|
245
|
-
const
|
|
275
|
+
const legacyIndexProjectPath = "ui/components/dreamboard/index.ts";
|
|
276
|
+
const legacyDirPath = resolveWorkspacePath(
|
|
277
|
+
projectRoot,
|
|
278
|
+
"ui/components/dreamboard"
|
|
279
|
+
);
|
|
280
|
+
const existing = await readWorkspaceTextFileIfExists(
|
|
246
281
|
projectRoot,
|
|
247
|
-
|
|
248
|
-
"components",
|
|
249
|
-
"dreamboard"
|
|
282
|
+
legacyIndexProjectPath
|
|
250
283
|
);
|
|
251
|
-
const legacyIndexPath = path.join(legacyDirPath, "index.ts");
|
|
252
|
-
const existing = await readTextFileIfExists(legacyIndexPath);
|
|
253
284
|
const removableLegacyContents = /* @__PURE__ */ new Set([
|
|
254
285
|
LEGACY_DREAMBOARD_COMPONENT_INDEX_CONTENT.trim(),
|
|
255
286
|
OLD_LEGACY_DREAMBOARD_COMPONENT_INDEX_CONTENT.trim(),
|
|
@@ -258,24 +289,26 @@ async function removeLegacyDreamboardComponentPath(projectRoot) {
|
|
|
258
289
|
if (existing === null || !removableLegacyContents.has(existing.trim())) {
|
|
259
290
|
return;
|
|
260
291
|
}
|
|
261
|
-
await
|
|
292
|
+
await unlinkWorkspaceFile(projectRoot, legacyIndexProjectPath);
|
|
262
293
|
const remainingEntries = await readdir(legacyDirPath).catch(() => []);
|
|
263
294
|
if (remainingEntries.length === 0) {
|
|
264
295
|
await rmdir(legacyDirPath);
|
|
265
296
|
}
|
|
266
297
|
}
|
|
267
|
-
async function writeTestReadme(
|
|
268
|
-
await
|
|
269
|
-
|
|
270
|
-
"
|
|
298
|
+
async function writeTestReadme(projectRoot) {
|
|
299
|
+
await writeWorkspaceTextFile(
|
|
300
|
+
projectRoot,
|
|
301
|
+
"test/README.md",
|
|
302
|
+
"# Dreamboard Test Workspace\n\nTypeScript bases live in `test/bases/*.base.ts` and scenarios live in `test/scenarios/*.scenario.ts`.\n\n1. Define reusable seeded bases with `defineBase({ id, seed, players, setupProfileId?, setup })`.\n2. Define scenarios with `defineScenario({ id, from, when, then })`.\n3. Scenario assertions can read `players()`, `state()`, `view(playerId)`, and `interactions(playerId)`.\n4. Run deterministic scenario tests: `dreamboard test`.\n5. Run a single scenario when needed: `dreamboard test --scenario <scenario-id>`.\n\nImport test helpers from `../testing-types`.\n\nGenerated artifacts are written to `test/generated/*` and should not be edited manually.\n"
|
|
271
303
|
);
|
|
272
304
|
}
|
|
273
|
-
async function writeInitialBase(
|
|
305
|
+
async function writeInitialBase(projectRoot, mode, players) {
|
|
274
306
|
if (mode === "update") {
|
|
275
307
|
return;
|
|
276
308
|
}
|
|
277
|
-
await
|
|
278
|
-
|
|
309
|
+
await writeWorkspaceTextFile(
|
|
310
|
+
projectRoot,
|
|
311
|
+
"test/bases/initial-turn.base.ts",
|
|
279
312
|
`import { defineBase } from "../testing-types";
|
|
280
313
|
|
|
281
314
|
export default defineBase({
|
|
@@ -287,44 +320,69 @@ export default defineBase({
|
|
|
287
320
|
`
|
|
288
321
|
);
|
|
289
322
|
}
|
|
290
|
-
async function writeInitialScenario(
|
|
323
|
+
async function writeInitialScenario(projectRoot, mode) {
|
|
291
324
|
if (mode === "new") {
|
|
292
|
-
await
|
|
325
|
+
await writeWorkspaceTextFile(
|
|
326
|
+
projectRoot,
|
|
327
|
+
"test/scenarios/smoke-initial-turn.scenario.ts",
|
|
328
|
+
INITIAL_SCENARIO_CONTENT
|
|
329
|
+
);
|
|
293
330
|
return;
|
|
294
331
|
}
|
|
295
|
-
const existing = await
|
|
296
|
-
|
|
297
|
-
|
|
332
|
+
const existing = await readWorkspaceTextFileIfExists(
|
|
333
|
+
projectRoot,
|
|
334
|
+
"test/scenarios/smoke-initial-turn.scenario.ts"
|
|
335
|
+
);
|
|
336
|
+
if (existing === null || existing.trim().length === 0 || existing.startsWith(GENERATED_SCENARIO_PREFIX)) {
|
|
337
|
+
await writeWorkspaceTextFile(
|
|
338
|
+
projectRoot,
|
|
339
|
+
"test/scenarios/smoke-initial-turn.scenario.ts",
|
|
340
|
+
INITIAL_SCENARIO_CONTENT
|
|
341
|
+
);
|
|
298
342
|
}
|
|
299
343
|
}
|
|
300
|
-
async function writeTestingTypes(
|
|
344
|
+
async function writeTestingTypes(projectRoot, mode) {
|
|
301
345
|
if (mode === "new") {
|
|
302
|
-
await
|
|
346
|
+
await writeWorkspaceTextFile(
|
|
347
|
+
projectRoot,
|
|
348
|
+
"test/testing-types.ts",
|
|
349
|
+
REDUCER_TESTING_TYPES_WRAPPER_CONTENT
|
|
350
|
+
);
|
|
303
351
|
return;
|
|
304
352
|
}
|
|
305
|
-
const existing = await
|
|
353
|
+
const existing = await readWorkspaceTextFileIfExists(
|
|
354
|
+
projectRoot,
|
|
355
|
+
"test/testing-types.ts"
|
|
356
|
+
);
|
|
306
357
|
if (shouldRefreshGeneratedTestingTypes(existing)) {
|
|
307
|
-
await
|
|
358
|
+
await writeWorkspaceTextFile(
|
|
359
|
+
projectRoot,
|
|
360
|
+
"test/testing-types.ts",
|
|
361
|
+
REDUCER_TESTING_TYPES_WRAPPER_CONTENT
|
|
362
|
+
);
|
|
308
363
|
}
|
|
309
364
|
}
|
|
310
|
-
async function writeGeneratedTestingStubs(
|
|
365
|
+
async function writeGeneratedTestingStubs(projectRoot, mode) {
|
|
311
366
|
const header = "// Generated by dreamboard scaffold. Do not edit by hand.\n";
|
|
312
367
|
await writeGeneratedTestingStubFile(
|
|
313
|
-
|
|
368
|
+
projectRoot,
|
|
369
|
+
"test/generated/base-states.generated.ts",
|
|
314
370
|
`${header}export const BASE_STATES = {} as const;
|
|
315
371
|
export const BASE_STATES_CONTRACT_FINGERPRINT = undefined;
|
|
316
372
|
`,
|
|
317
373
|
mode
|
|
318
374
|
);
|
|
319
375
|
await writeGeneratedTestingStubFile(
|
|
320
|
-
|
|
376
|
+
projectRoot,
|
|
377
|
+
"test/generated/base-states.generated.d.ts",
|
|
321
378
|
`${header}export declare const BASE_STATES: Record<string, unknown>;
|
|
322
379
|
export declare const BASE_STATES_CONTRACT_FINGERPRINT: string | undefined;
|
|
323
380
|
`,
|
|
324
381
|
mode
|
|
325
382
|
);
|
|
326
383
|
await writeGeneratedTestingStubFile(
|
|
327
|
-
|
|
384
|
+
projectRoot,
|
|
385
|
+
"test/generated/testing-contract.ts",
|
|
328
386
|
`${header}export type BaseId = string;
|
|
329
387
|
export type GameView = unknown;
|
|
330
388
|
export type InteractionId = string;
|
|
@@ -333,7 +391,6 @@ export type PhaseName = string;
|
|
|
333
391
|
export type PlayerId = string;
|
|
334
392
|
export type RejectionCode = string;
|
|
335
393
|
export type StateName = string;
|
|
336
|
-
export type TestRunner = "reducer" | "remote" | "browser";
|
|
337
394
|
export type ViewByPhase = Record<string, GameView>;
|
|
338
395
|
export type WorkspaceStageName<_Phase extends string = string> = string;
|
|
339
396
|
export type Expectation = { [matcher: string]: (...args: unknown[]) => unknown; not: Expectation };
|
|
@@ -344,32 +401,37 @@ export interface ScenarioGameApi { start(): Promise<void>; submit<Id extends Int
|
|
|
344
401
|
export interface BaseContext { game: ScenarioGameApi; players(): readonly PlayerId[]; seat(index: number): PlayerId; }
|
|
345
402
|
export interface SharedScenarioContext { game: ScenarioGameApi; players(): readonly PlayerId[]; seat(index: number): PlayerId; state(): StateName; view(playerId: PlayerId): GameView; interactions(playerId: PlayerId): readonly InteractionDescriptorFor[]; explain(playerId: PlayerId, interactionId: InteractionId): InteractionExplanation; expect: ExpectFn; }
|
|
346
403
|
export type ScenarioContext<Phase extends PhaseName | undefined = undefined> = Omit<SharedScenarioContext, "state" | "view"> & { state(): Phase extends PhaseName ? Phase : StateName; view(playerId: PlayerId): Phase extends PhaseName ? ViewByPhase[Phase] : GameView; };
|
|
347
|
-
export type ScenarioThenContext<
|
|
404
|
+
export type ScenarioThenContext<Phase extends PhaseName | undefined = undefined> = ScenarioContext<Phase>;
|
|
348
405
|
export interface BaseDefinition { id: string; seed?: number; players?: number; setupProfileId?: string; extends?: BaseId | string; setup: (ctx: BaseContext) => void | Promise<void>; }
|
|
349
|
-
export interface ScenarioDefinition<
|
|
406
|
+
export interface ScenarioDefinition<Phase extends PhaseName | undefined = undefined> { id: string; description?: string; from: BaseId | string; phase?: Phase; stage?: Phase extends PhaseName ? WorkspaceStageName<Phase> : never; when: (ctx: ScenarioContext<Phase>) => void | Promise<void>; then: (ctx: ScenarioThenContext<Phase>) => void | Promise<void>; }
|
|
350
407
|
`,
|
|
351
408
|
mode
|
|
352
409
|
);
|
|
353
410
|
await writeGeneratedTestingStubFile(
|
|
354
|
-
|
|
411
|
+
projectRoot,
|
|
412
|
+
"test/generated/scenario-manifest.generated.ts",
|
|
355
413
|
`${header}export const SCENARIO_MANIFEST = [] as const;
|
|
356
414
|
`,
|
|
357
415
|
mode
|
|
358
416
|
);
|
|
359
417
|
}
|
|
360
|
-
async function writeGeneratedTestingStubFile(
|
|
418
|
+
async function writeGeneratedTestingStubFile(projectRoot, projectPath, content, mode) {
|
|
361
419
|
if (mode === "new") {
|
|
362
|
-
await
|
|
420
|
+
await writeWorkspaceTextFile(projectRoot, projectPath, content);
|
|
363
421
|
return;
|
|
364
422
|
}
|
|
365
|
-
const existing = await
|
|
423
|
+
const existing = await readWorkspaceTextFileIfExists(
|
|
424
|
+
projectRoot,
|
|
425
|
+
projectPath
|
|
426
|
+
);
|
|
366
427
|
if (existing === null || existing.trim().length === 0 || existing.startsWith(GENERATED_SCENARIO_PREFIX)) {
|
|
367
|
-
await
|
|
428
|
+
await writeWorkspaceTextFile(projectRoot, projectPath, content);
|
|
368
429
|
}
|
|
369
430
|
}
|
|
370
|
-
async function writeTestTsconfig(
|
|
371
|
-
await
|
|
372
|
-
|
|
431
|
+
async function writeTestTsconfig(projectRoot) {
|
|
432
|
+
await writeWorkspaceTextFile(
|
|
433
|
+
projectRoot,
|
|
434
|
+
"test/tsconfig.json",
|
|
373
435
|
`${JSON.stringify(
|
|
374
436
|
{
|
|
375
437
|
compilerOptions: {
|
|
@@ -394,9 +456,10 @@ async function writeTestTsconfig(filePath) {
|
|
|
394
456
|
`
|
|
395
457
|
);
|
|
396
458
|
}
|
|
397
|
-
async function writeManifestTypecheckTsconfig(
|
|
398
|
-
await
|
|
399
|
-
|
|
459
|
+
async function writeManifestTypecheckTsconfig(projectRoot) {
|
|
460
|
+
await writeWorkspaceTextFile(
|
|
461
|
+
projectRoot,
|
|
462
|
+
MANIFEST_TYPECHECK_CONFIG_FILE,
|
|
400
463
|
`${JSON.stringify(
|
|
401
464
|
{
|
|
402
465
|
compilerOptions: {
|
|
@@ -418,11 +481,12 @@ async function writeManifestTypecheckTsconfig(filePath) {
|
|
|
418
481
|
);
|
|
419
482
|
}
|
|
420
483
|
async function migrateLegacyScenarioImports(projectRoot) {
|
|
421
|
-
|
|
422
|
-
|
|
484
|
+
if (!await workspacePathExists(projectRoot, "test/scenarios")) return;
|
|
485
|
+
const scenariosRoot = resolveWorkspacePath(projectRoot, "test/scenarios");
|
|
423
486
|
const scenarioFiles = await collectScenarioFiles(scenariosRoot);
|
|
424
487
|
for (const filePath of scenarioFiles) {
|
|
425
|
-
const
|
|
488
|
+
const projectPath = toWorkspaceProjectPath(projectRoot, filePath);
|
|
489
|
+
const content = await readWorkspaceTextFile(projectRoot, projectPath);
|
|
426
490
|
if (!content.includes("@dreamboard/cli/testing")) continue;
|
|
427
491
|
const relativeToTestingTypes = normalizeImportPath(
|
|
428
492
|
path.relative(
|
|
@@ -432,7 +496,7 @@ async function migrateLegacyScenarioImports(projectRoot) {
|
|
|
432
496
|
);
|
|
433
497
|
const migrated = content.replaceAll('"@dreamboard/cli/testing"', `"${relativeToTestingTypes}"`).replaceAll("'@dreamboard/cli/testing'", `'${relativeToTestingTypes}'`);
|
|
434
498
|
if (migrated !== content) {
|
|
435
|
-
await
|
|
499
|
+
await writeWorkspaceTextFile(projectRoot, projectPath, migrated);
|
|
436
500
|
}
|
|
437
501
|
}
|
|
438
502
|
}
|
|
@@ -446,8 +510,7 @@ function shouldRefreshGeneratedTestingTypes(existingContent) {
|
|
|
446
510
|
return existingContent.startsWith(GENERATED_TESTING_TYPES_PREFIX);
|
|
447
511
|
}
|
|
448
512
|
async function inferInitialTestPlayerCount(projectRoot) {
|
|
449
|
-
|
|
450
|
-
if (!await exists(manifestPath)) {
|
|
513
|
+
if (!await workspacePathExists(projectRoot, "manifest.ts")) {
|
|
451
514
|
return 4;
|
|
452
515
|
}
|
|
453
516
|
try {
|
|
@@ -494,9 +557,12 @@ async function getStaticAssetEntries() {
|
|
|
494
557
|
const files = await walkFiles(STATIC_ASSET_ROOT);
|
|
495
558
|
const entries = [];
|
|
496
559
|
for (const filePath of files) {
|
|
497
|
-
const targetPath =
|
|
498
|
-
path.relative(STATIC_ASSET_ROOT, filePath)
|
|
560
|
+
const targetPath = normalizeOwnedProjectPath(
|
|
561
|
+
path.relative(STATIC_ASSET_ROOT, filePath).replaceAll(path.sep, "/")
|
|
499
562
|
);
|
|
563
|
+
if (targetPath === null) {
|
|
564
|
+
throw new Error(`Unsafe static scaffold asset path: ${filePath}`);
|
|
565
|
+
}
|
|
500
566
|
entries.push({
|
|
501
567
|
targetPath,
|
|
502
568
|
content: await readFile(filePath, "utf8")
|
|
@@ -526,24 +592,12 @@ async function getDynamicStaticEntries(projectRoot, mode, options = {}) {
|
|
|
526
592
|
}
|
|
527
593
|
return entries;
|
|
528
594
|
}
|
|
529
|
-
async function readProjectLocalMaintainerRegistry(projectRoot) {
|
|
530
|
-
const projectConfigPath = path.join(
|
|
531
|
-
projectRoot,
|
|
532
|
-
PROJECT_DIR_NAME,
|
|
533
|
-
PROJECT_CONFIG_FILE
|
|
534
|
-
);
|
|
535
|
-
if (!await exists(projectConfigPath)) {
|
|
536
|
-
return null;
|
|
537
|
-
}
|
|
538
|
-
const projectConfig = await loadProjectConfig(projectRoot);
|
|
539
|
-
return projectConfig.localMaintainerRegistry ?? null;
|
|
540
|
-
}
|
|
541
595
|
async function getExpectedStaticEntries(projectRoot) {
|
|
542
596
|
const entries = [
|
|
543
|
-
...await getStaticAssetEntries()
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
597
|
+
...(await getStaticAssetEntries()).filter(
|
|
598
|
+
(entry) => entry.targetPath !== ".npmrc"
|
|
599
|
+
),
|
|
600
|
+
...await getDynamicStaticEntries(projectRoot, "update")
|
|
547
601
|
];
|
|
548
602
|
entries.sort(
|
|
549
603
|
(left, right) => left.targetPath.localeCompare(right.targetPath)
|
|
@@ -574,8 +628,9 @@ async function buildRootPackageJson(projectRoot, mode, options) {
|
|
|
574
628
|
...SDK_DEPENDENCY_RANGES,
|
|
575
629
|
...options.localMaintainerRegistry?.packages ?? {}
|
|
576
630
|
};
|
|
577
|
-
const
|
|
578
|
-
|
|
631
|
+
const existingPackageJson = mode === "update" && await workspacePathExists(projectRoot, "package.json") ? JSON.parse(
|
|
632
|
+
await readWorkspaceTextFile(projectRoot, "package.json")
|
|
633
|
+
) : null;
|
|
579
634
|
const {
|
|
580
635
|
dreamboardFrameworkVersion: _legacyFrameworkVersion,
|
|
581
636
|
...existingPackageJsonWithoutLegacyVersion
|
|
@@ -586,11 +641,13 @@ async function buildRootPackageJson(projectRoot, mode, options) {
|
|
|
586
641
|
...ROOT_APP_DEPENDENCIES
|
|
587
642
|
};
|
|
588
643
|
const frameworkDevDependencies = {
|
|
589
|
-
...SHARED_DEV_DEPENDENCIES
|
|
644
|
+
...SHARED_DEV_DEPENDENCIES,
|
|
645
|
+
...DEV_HOST_DEPENDENCY_RANGES
|
|
590
646
|
};
|
|
591
647
|
const nextPackageJson = {
|
|
592
648
|
...existingPackageJsonWithoutLegacyVersion,
|
|
593
649
|
private: true,
|
|
650
|
+
packageManager: AUTHORING_RELEASE_SET.packageManager,
|
|
594
651
|
scripts: {
|
|
595
652
|
...existingPackageJson?.scripts ?? {},
|
|
596
653
|
...FRAMEWORK_SCRIPTS
|
|
@@ -614,7 +671,8 @@ function mergePnpmConfig(existingPnpm) {
|
|
|
614
671
|
...existingPnpm ?? {},
|
|
615
672
|
overrides: {
|
|
616
673
|
...existingOverrides,
|
|
617
|
-
...FRAMEWORK_PNPM_OVERRIDES
|
|
674
|
+
...FRAMEWORK_PNPM_OVERRIDES,
|
|
675
|
+
...DREAMBOARD_PACKAGE_OVERRIDES
|
|
618
676
|
}
|
|
619
677
|
};
|
|
620
678
|
}
|
|
@@ -634,83 +692,18 @@ function buildUiPackageJson() {
|
|
|
634
692
|
)}
|
|
635
693
|
`;
|
|
636
694
|
}
|
|
637
|
-
function readPackageVersion(packageJsonPath, packageName) {
|
|
638
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
639
|
-
if (typeof packageJson.version !== "string" || packageJson.version.trim().length === 0) {
|
|
640
|
-
return null;
|
|
641
|
-
}
|
|
642
|
-
return `^${packageJson.version.trim()}`;
|
|
643
|
-
}
|
|
644
|
-
function findNearestPackageJsonPath(importMetaUrl = import.meta.url) {
|
|
645
|
-
let current = path.dirname(fileURLToPath(importMetaUrl));
|
|
646
|
-
while (true) {
|
|
647
|
-
const candidate = path.join(current, "package.json");
|
|
648
|
-
if (existsSync(candidate)) {
|
|
649
|
-
return candidate;
|
|
650
|
-
}
|
|
651
|
-
const parent = path.dirname(current);
|
|
652
|
-
if (parent === current) {
|
|
653
|
-
return null;
|
|
654
|
-
}
|
|
655
|
-
current = parent;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
function isSourceCheckoutCliPackageJsonPath(packageJsonPath, importMetaUrl = import.meta.url) {
|
|
659
|
-
try {
|
|
660
|
-
return path.resolve(packageJsonPath) === path.join(
|
|
661
|
-
resolveCliRepoRoot(importMetaUrl),
|
|
662
|
-
"apps",
|
|
663
|
-
"dreamboard-cli",
|
|
664
|
-
"package.json"
|
|
665
|
-
);
|
|
666
|
-
} catch {
|
|
667
|
-
return false;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
function readPackagedSdkDependencyRange(packageName, importMetaUrl = import.meta.url) {
|
|
671
|
-
const packageJsonPath = findNearestPackageJsonPath(importMetaUrl);
|
|
672
|
-
if (!packageJsonPath) {
|
|
673
|
-
return null;
|
|
674
|
-
}
|
|
675
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
676
|
-
const packagedRange = packageJson.dependencies?.[packageName];
|
|
677
|
-
if (typeof packagedRange !== "string" || packagedRange.trim().length === 0 || packagedRange.startsWith("workspace:") || packagedRange.startsWith("link:") || packagedRange.startsWith("file:") && !IS_PUBLISHED_BUILD && isSourceCheckoutCliPackageJsonPath(packageJsonPath, importMetaUrl)) {
|
|
678
|
-
return null;
|
|
679
|
-
}
|
|
680
|
-
return packagedRange.trim();
|
|
681
|
-
}
|
|
682
|
-
function stripLocalSnapshotSuffix(range) {
|
|
683
|
-
return range.replace(/-local\..*$/, "");
|
|
684
|
-
}
|
|
685
|
-
function resolveSdkDependencyRange(packageName, importMetaUrl = import.meta.url) {
|
|
686
|
-
const packagedRange = readPackagedSdkDependencyRange(
|
|
687
|
-
packageName,
|
|
688
|
-
importMetaUrl
|
|
689
|
-
);
|
|
690
|
-
if (packagedRange) {
|
|
691
|
-
return stripLocalSnapshotSuffix(packagedRange);
|
|
692
|
-
}
|
|
693
|
-
try {
|
|
694
|
-
const repoRoot = resolveCliRepoRoot(importMetaUrl);
|
|
695
|
-
const packageJsonPath = path.join(
|
|
696
|
-
repoRoot,
|
|
697
|
-
...SDK_PACKAGE_PATHS[packageName]
|
|
698
|
-
);
|
|
699
|
-
const repoRange = readPackageVersion(packageJsonPath, packageName);
|
|
700
|
-
if (repoRange) {
|
|
701
|
-
return stripLocalSnapshotSuffix(repoRange);
|
|
702
|
-
}
|
|
703
|
-
} catch {
|
|
704
|
-
}
|
|
705
|
-
return DEFAULT_SDK_DEPENDENCY_RANGES[packageName];
|
|
706
|
-
}
|
|
707
695
|
function normalizeImportPath(relativePath) {
|
|
708
696
|
const normalized = relativePath.replaceAll("\\", "/");
|
|
709
697
|
if (normalized.startsWith(".")) return normalized;
|
|
710
698
|
return `./${normalized}`;
|
|
711
699
|
}
|
|
712
|
-
function
|
|
713
|
-
|
|
700
|
+
function toWorkspaceProjectPath(projectRoot, filePath) {
|
|
701
|
+
const relativePath = path.relative(path.resolve(projectRoot), path.resolve(filePath)).replaceAll(path.sep, "/");
|
|
702
|
+
const projectPath = normalizeOwnedProjectPath(relativePath);
|
|
703
|
+
if (projectPath === null) {
|
|
704
|
+
throw new Error(`Unsafe project path: ${relativePath}`);
|
|
705
|
+
}
|
|
706
|
+
return projectPath;
|
|
714
707
|
}
|
|
715
708
|
function summarizePaths(paths) {
|
|
716
709
|
const maxShown = 5;
|
|
@@ -723,7 +716,6 @@ export {
|
|
|
723
716
|
scaffoldStaticWorkspace,
|
|
724
717
|
assertCliStaticScaffoldComplete,
|
|
725
718
|
migrateLegacyScenarioImports,
|
|
726
|
-
resolveStaticAssetRoot
|
|
727
|
-
resolveSdkDependencyRange
|
|
719
|
+
resolveStaticAssetRoot
|
|
728
720
|
};
|
|
729
|
-
//# sourceMappingURL=chunk-
|
|
721
|
+
//# sourceMappingURL=chunk-NBRUEJUK.mjs.map
|