bsmnt 0.1.2 → 0.1.3

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 (42) hide show
  1. package/package.json +7 -2
  2. package/.changeset/README.md +0 -10
  3. package/.changeset/config.json +0 -16
  4. package/.cursor/rules/README.md +0 -184
  5. package/.cursor/rules/architecture.mdc +0 -437
  6. package/.cursor/rules/components.mdc +0 -436
  7. package/.cursor/rules/integrations.mdc +0 -447
  8. package/.cursor/rules/main.mdc +0 -278
  9. package/.cursor/rules/styling.mdc +0 -433
  10. package/.github/PULL_REQUEST_TEMPLATE.md +0 -14
  11. package/.github/workflows/.gitkeep +0 -0
  12. package/.github/workflows/ci.yml +0 -37
  13. package/.github/workflows/release.yml +0 -56
  14. package/.tldr/cache/call_graph.json +0 -7
  15. package/.tldr/languages.json +0 -6
  16. package/.tldr/status +0 -1
  17. package/.tldrignore +0 -84
  18. package/.vscode/extensions.json +0 -20
  19. package/.vscode/settings.json +0 -98
  20. package/CHANGELOG.md +0 -68
  21. package/CLAUDE.md +0 -156
  22. package/biome.json +0 -45
  23. package/bun.lock +0 -496
  24. package/changelog/04-02-26.md +0 -86
  25. package/changelog/05-02-26.md +0 -101
  26. package/changelog/09-02-26.md +0 -83
  27. package/docs/architecture.drawio +0 -250
  28. package/docs/architecture.mermaid +0 -85
  29. package/docs/fix-studio-hydration.md +0 -46
  30. package/docs/plans/2026-01-29-sanity-smart-merge-design.md +0 -196
  31. package/docs/plans/2026-01-29-sanity-smart-merge-implementation.md +0 -695
  32. package/docs/sanity-setup-steps.md +0 -199
  33. package/packages/cli/package.json +0 -16
  34. package/tasks/.last-branch +0 -1
  35. package/tasks/CLAUDE.md +0 -104
  36. package/tasks/archive/2026-02-09-next-starter-dynamic-layers/prd.json +0 -153
  37. package/tasks/archive/2026-02-09-next-starter-dynamic-layers/progress.txt +0 -115
  38. package/tasks/prd-next-starter-dynamic-layers.md +0 -184
  39. package/tasks/prd-project-restructure.md +0 -375
  40. package/tasks/prd.json +0 -289
  41. package/tasks/progress.txt +0 -309
  42. package/tasks/ralph.sh +0 -113
package/tasks/prd.json DELETED
@@ -1,289 +0,0 @@
1
- {
2
- "project": "basement-cli",
3
- "branchName": "BertovDev/project-restructure",
4
- "description": "Restructure basement-cli into a bun workspaces monorepo with separated CLI and template scaffolding packages",
5
- "userStories": [
6
- {
7
- "id": "US-001",
8
- "title": "Create monorepo skeleton with workspace config",
9
- "description": "As a maintainer, I want the project organized as a bun workspaces monorepo so packages are properly isolated.",
10
- "acceptanceCriteria": [
11
- "Create packages/cli/ directory",
12
- "Create packages/create-basement-app/ directory",
13
- "Create packages/create-basement-app/templates/ directory",
14
- "Create packages/create-basement-app/integrations/ directory",
15
- "Create packages/create-basement-app/template-hooks/ directory",
16
- "Create packages/create-basement-app/plugins/ directory",
17
- "Update root package.json: add \"workspaces\": [\"packages/*\"], keep existing name/version/type/scripts",
18
- "Root biome.json stays at root (shared across all packages)",
19
- "Create packages/cli/package.json with name @basementstudio/cli, bin basement pointing to ./bin/index.js, type module",
20
- "Create packages/create-basement-app/package.json with name @basementstudio/create-basement-app, type module",
21
- "Typecheck passes (no syntax errors in JS files)"
22
- ],
23
- "priority": 1,
24
- "passes": true,
25
- "notes": ""
26
- },
27
- {
28
- "id": "US-002",
29
- "title": "Move CLI code to packages/cli",
30
- "description": "As a developer, I want CLI argument parsing and command routing isolated in its own package.",
31
- "acceptanceCriteria": [
32
- "Move bin/index.js to packages/cli/bin/index.js",
33
- "Move src/commands/create.js to packages/cli/src/commands/create.js",
34
- "Move src/commands/add-integration.js to packages/cli/src/commands/add-integration.js",
35
- "Move src/commands/worktree.js to packages/cli/src/commands/worktree.js",
36
- "Move src/commands/setup-sanity.js to packages/cli/src/commands/setup-sanity.js",
37
- "Update all import paths in bin/index.js to reference new ../src/commands/ locations",
38
- "Update packages/cli/package.json dependencies: add fs-extra, ora, picocolors, prompts, tiged, dotenv from root package.json",
39
- "Remove chalk from packages/cli dependencies (standardize on picocolors)",
40
- "Replace any chalk usage in bin/index.js with picocolors",
41
- "Verify: node packages/cli/bin/index.js --help shows help text without errors",
42
- "Typecheck passes (no syntax errors)"
43
- ],
44
- "priority": 2,
45
- "passes": true,
46
- "notes": "bin/index.js uses chalk for banner - replace with picocolors. All src/commands/ files use picocolors already."
47
- },
48
- {
49
- "id": "US-003",
50
- "title": "Move merger code to create-basement-app package",
51
- "description": "As a maintainer, I want all scaffolding and merge logic in the create-basement-app package.",
52
- "acceptanceCriteria": [
53
- "Move src/mergers/index.js to packages/create-basement-app/src/mergers/index.js",
54
- "Move src/mergers/config.js to packages/create-basement-app/src/mergers/config.js",
55
- "Move src/mergers/layout-merger.js to packages/create-basement-app/src/mergers/layout-merger.js",
56
- "Move src/mergers/sitemap-merger.js to packages/create-basement-app/src/mergers/sitemap-merger.js",
57
- "Move src/mergers/check-integration-merger.js to packages/create-basement-app/src/mergers/check-integration-merger.js",
58
- "Delete orphaned src/mergers/next-config-merger.js (defined but never registered in CMS_MERGERS)",
59
- "Update import paths in packages/cli/src/commands/create.js to reference create-basement-app mergers",
60
- "Update import paths in packages/cli/src/commands/add-integration.js similarly",
61
- "Add fs-extra, picocolors, tiged as dependencies in packages/create-basement-app/package.json",
62
- "Create packages/create-basement-app/src/index.js that re-exports injectLayer, injectIntegration, formatMergeResults, getLayerConfig, getCmsConfig",
63
- "Typecheck passes (no syntax errors)"
64
- ],
65
- "priority": 3,
66
- "passes": true,
67
- "notes": "next-config-merger.js is orphaned (not in CMS_MERGERS) - delete it. Merger functions use __dirname to resolve layers/ path - this will need updating in later stories."
68
- },
69
- {
70
- "id": "US-004",
71
- "title": "Generate default template from next-starter",
72
- "description": "As a contributor, I want a complete default template so I can preview and test it independently.",
73
- "acceptanceCriteria": [
74
- "Clone basementstudio/next-starter#main into packages/create-basement-app/templates/default/ using tiged",
75
- "Rename .gitignore to _gitignore in the template (npm strips dotfiles from published packages)",
76
- "Template has a valid package.json with next, react, react-dom dependencies",
77
- "Template directory contains app/, components/, lib/ directories",
78
- "Delete any bun.lock or package-lock.json from the template",
79
- "The template is a complete Next.js project (not a partial overlay)",
80
- "Typecheck passes (no syntax errors)"
81
- ],
82
- "priority": 4,
83
- "passes": true,
84
- "notes": "Used gh repo clone (private repo requires auth). Cloned next-starter#main, removed .git, renamed .gitignore to _gitignore, deleted bun.lock, removed .tldr cache."
85
- },
86
- {
87
- "id": "US-005",
88
- "title": "Generate webgl template from default plus layer",
89
- "description": "As a contributor, I want a standalone WebGL template with R3F components and dependencies pre-configured.",
90
- "acceptanceCriteria": [
91
- "Copy packages/create-basement-app/templates/default/ to packages/create-basement-app/templates/webgl/",
92
- "Copy layers/webgl/app/page.tsx to templates/webgl/app/page.tsx (overwrite the default page)",
93
- "Copy layers/webgl/components/webgl/ directory into templates/webgl/components/webgl/",
94
- "Merge WebGL dependencies into templates/webgl/package.json: @react-three/fiber ^9.5.0, @react-three/drei ^10.7.7, three ^0.182.0, @radix-ui/react-navigation-menu ^1.2.5, leva ^0.9.35",
95
- "Merge WebGL devDependencies: @types/three ^0.182.0",
96
- "Rename .gitignore to _gitignore if not already done",
97
- "Template webgl/ is a complete Next.js project with WebGL components included",
98
- "Typecheck passes (no syntax errors)"
99
- ],
100
- "priority": 5,
101
- "passes": true,
102
- "notes": "Copied default template, overlaid WebGL page.tsx + 3 component files (canvas/dynamic.tsx, canvas/index.tsx, components/scene/index.tsx), injected 5 deps + 1 devDep into package.json."
103
- },
104
- {
105
- "id": "US-006",
106
- "title": "Generate webgpu template from default plus deps",
107
- "description": "As a contributor, I want a standalone WebGPU template with alpha R3F dependencies pre-configured.",
108
- "acceptanceCriteria": [
109
- "Copy packages/create-basement-app/templates/default/ to packages/create-basement-app/templates/webgpu/",
110
- "Merge WebGPU dependencies into templates/webgpu/package.json: @react-three/fiber 10.0.0-alpha.2, @react-three/drei ^11.0.0-alpha.4, three ^0.182.0, leva ^0.9.35, lucide-react ^0.474.0, @radix-ui/react-navigation-menu ^1.2.5",
111
- "Merge WebGPU devDependencies: @types/three ^0.182.0",
112
- "Rename .gitignore to _gitignore if not already done",
113
- "WebGPU template has no additional component files (deps-only, matching current behavior)",
114
- "Template webgpu/ is a complete Next.js project",
115
- "Typecheck passes (no syntax errors)"
116
- ],
117
- "priority": 6,
118
- "passes": true,
119
- "notes": "Copied default template, injected 6 deps + 1 devDep into package.json. Deps-only (no overlay files). Uses alpha R3F versions."
120
- },
121
- {
122
- "id": "US-007",
123
- "title": "Generate experiment template from default plus layer",
124
- "description": "As a contributor, I want a standalone experiment template with navigation components and dependencies.",
125
- "acceptanceCriteria": [
126
- "Copy packages/create-basement-app/templates/default/ to packages/create-basement-app/templates/experiment/",
127
- "Copy layers/experiment/components/layout/header/index.tsx to templates/experiment/components/layout/header/index.tsx (overwrite default header)",
128
- "Copy layers/experiment/components/layout/navigation-menu.tsx to templates/experiment/components/layout/navigation-menu.tsx",
129
- "Copy layers/experiment/lib/constants.ts to templates/experiment/lib/constants.ts",
130
- "Merge experiment dependencies into templates/experiment/package.json: @react-three/fiber ^9.5.0, @react-three/drei ^10.7.7, three ^0.172.0, class-variance-authority latest, leva ^0.9.35, lucide-react ^0.474.0, @radix-ui/react-navigation-menu ^1.2.5",
131
- "Merge experiment devDependencies: @types/three ^0.182.0",
132
- "Rename .gitignore to _gitignore if not already done",
133
- "Template experiment/ is a complete Next.js project with experiment navigation",
134
- "Typecheck passes (no syntax errors)"
135
- ],
136
- "priority": 7,
137
- "passes": true,
138
- "notes": "Copied default template, overlaid 3 files (header/index.tsx replace, navigation-menu.tsx additive, constants.ts additive), injected 6 deps + 1 devDep. Used actual LAYER_CONFIG values (three ^0.182.0, cva ^0.7.0 already satisfied by ^0.7.1)."
139
- },
140
- {
141
- "id": "US-008",
142
- "title": "Move Sanity integration files locally with config manifest",
143
- "description": "As a maintainer, I want Sanity integration files local to create-basement-app with a single config manifest.",
144
- "acceptanceCriteria": [
145
- "Copy all files from integrations/sanity/ to packages/create-basement-app/integrations/sanity/files/",
146
- "Move merger files to packages/create-basement-app/integrations/sanity/mergers/: layout-merger.js, sitemap-merger.js, check-integration-merger.js (copy from packages/create-basement-app/src/mergers/)",
147
- "Create packages/create-basement-app/integrations/sanity/config.js with single-source-of-truth config containing: name, dependencies (@sanity/asset-utils, @sanity/image-url, @sanity/visual-editing, next-sanity), devDependencies (sanity, @sanity/vision), scripts (sanity:extract, sanity:typegen), additivePaths, mergeFiles",
148
- "Sanity dependencies come from what is currently hardcoded in create.js lines 239-266",
149
- "Sanity scripts come from what is currently hardcoded in create.js lines 254-259",
150
- "Config additivePaths and mergeFiles match current CMS_CONFIG.sanity in config.js",
151
- "Typecheck passes (no syntax errors)"
152
- ],
153
- "priority": 8,
154
- "passes": true,
155
- "notes": "Copied 35 integration files to integrations/sanity/files/, 3 mergers to integrations/sanity/mergers/, created config.js with deps/devDeps/scripts/additivePaths/mergeFiles unified from create.js + CMS_CONFIG."
156
- },
157
- {
158
- "id": "US-009",
159
- "title": "Move BaseHub integration, template-hooks, and plugins",
160
- "description": "As a maintainer, I want all scaffolding assets co-located in create-basement-app.",
161
- "acceptanceCriteria": [
162
- "Copy integrations/basehub/ to packages/create-basement-app/integrations/basehub/files/",
163
- "Create packages/create-basement-app/integrations/basehub/config.js with: name, dependencies (basehub ^3.0.0), additivePaths",
164
- "Move template-hooks/*.ts to packages/create-basement-app/template-hooks/",
165
- "Create packages/create-basement-app/template-hooks/config.js exporting array of hook configs with: name, file, dependencies (e.g. use-battery needs lodash-es, use-device-perf needs detect-gpu + react-device-detect + zustand)",
166
- "Move plugins/*.grit to packages/create-basement-app/plugins/",
167
- "Typecheck passes (no syntax errors)"
168
- ],
169
- "priority": 9,
170
- "passes": true,
171
- "notes": "Copied basehub README to integrations/basehub/files/, created config.js with deps. Copied 4 hooks to template-hooks/ with config.js declaring npm deps. Copied 3 grit plugins + README to plugins/."
172
- },
173
- {
174
- "id": "US-010",
175
- "title": "Update merger paths to use create-basement-app locations",
176
- "description": "As a maintainer, I want the merger system to resolve files from create-basement-app paths instead of old root-relative paths.",
177
- "acceptanceCriteria": [
178
- "Update packages/create-basement-app/src/mergers/index.js: change layer path resolution from path.resolve(__dirname, '../../layers', layer) to path.resolve(__dirname, '../../templates', layer)",
179
- "Update injectIntegration to read integration files from local packages/create-basement-app/integrations/{cms}/files/ instead of cloning from remote GitHub branch via tiged",
180
- "Update CMS_MERGERS to import mergers from integrations/{cms}/mergers/ instead of co-located merger files",
181
- "Update packages/create-basement-app/src/mergers/config.js: CMS_CONFIG no longer needs 'branch' field (files are local now)",
182
- "Update packages/cli/src/commands/create.js: read CMS deps/scripts from integration config.js instead of hardcoded values",
183
- "Remove tiged dependency from create-basement-app if no longer needed (check if anything else uses it)",
184
- "Verify injectLayer still works by checking path resolution against templates/ directory structure",
185
- "Verify injectIntegration still works by checking path resolution against integrations/ directory structure",
186
- "Typecheck passes (no syntax errors)"
187
- ],
188
- "priority": 10,
189
- "passes": true,
190
- "notes": "Updated injectIntegration to use local fs.copy from integrations/{cms}/files/ instead of tiged remote clone. Updated injectLayer path from ../../layers to ../../templates. CMS_MERGERS now import from integrations/sanity/mergers/. Removed branch field from CMS_CONFIG. CLI create.js and add-integration.js now read CMS deps/scripts from integration config manifests. Removed tiged dep from create-basement-app."
191
- },
192
- {
193
- "id": "US-011",
194
- "title": "Update CLI create command to use centralized configs",
195
- "description": "As a maintainer, I want create.js to read all dependency info from config manifests with zero hardcoded versions.",
196
- "acceptanceCriteria": [
197
- "In packages/cli/src/commands/create.js: replace hardcoded Sanity deps (lines 239-266 equivalent) with import from integrations/sanity/config.js",
198
- "Replace hardcoded BaseHub deps with import from integrations/basehub/config.js",
199
- "Replace hardcoded animation deps with a new configs/animations.js manifest in create-basement-app: gsap -> {gsap: ^3.12.0, @gsap/react: ^2.0.0}, motion -> {motion: ^12.0.0}",
200
- "Replace hardcoded CMS scripts with import from integration config.js",
201
- "Hook copying reads from template-hooks/config.js for hook dependencies to inject",
202
- "Template prompt reads available template names by listing packages/create-basement-app/templates/ directory",
203
- "Zero hardcoded dependency version strings remain in create.js",
204
- "Remove unused inquirer from root package.json dependencies",
205
- "Remove dotenv if only used for CLI development (move to devDependencies or remove)",
206
- "Typecheck passes (no syntax errors)"
207
- ],
208
- "priority": 11,
209
- "passes": true,
210
- "notes": "Created animations.js config manifest. Animation deps, hook deps, CMS deps/scripts all config-driven. Template prompt dynamic from templates/ dir. Removed inquirer and chalk from root. dotenv kept (used at runtime in create.js for .env loading)."
211
- },
212
- {
213
- "id": "US-012",
214
- "title": "Update template download to copy local templates",
215
- "description": "As a maintainer, I want the CLI to copy templates from local create-basement-app instead of cloning from GitHub.",
216
- "acceptanceCriteria": [
217
- "In packages/cli/src/commands/create.js: replace tiged clone of basementstudio/next-starter#main with fs-extra copy from packages/create-basement-app/templates/{type}/",
218
- "Remove the separate layer injection step (step 3.2) since templates are already complete standalone projects",
219
- "Keep CMS integration injection step (step 3.5) since integrations still use the merge approach",
220
- "Rename _gitignore back to .gitignore after copying template to target dir",
221
- "Update spinner text from 'Downloading next-starter...' to 'Copying template...'",
222
- "Template copy is instant (no network call) which improves CLI speed",
223
- "Verify: running the CLI with each template type produces a valid project directory",
224
- "Typecheck passes (no syntax errors)"
225
- ],
226
- "priority": 12,
227
- "passes": true,
228
- "notes": "Replaced tiged remote clone with fs.copy from local templates. Removed layer injection step 3.2 (templates are standalone). Added _gitignore->. gitignore rename. Removed layer dep injection from hydration (already in template package.json). Removed tiged dep from CLI package."
229
- },
230
- {
231
- "id": "US-013",
232
- "title": "Clean up old root directories and dead code",
233
- "description": "As a maintainer, I want all old root-level directories removed since content has moved to packages.",
234
- "acceptanceCriteria": [
235
- "Delete root layers/ directory (files now in templates)",
236
- "Delete root integrations/ directory (files now in packages/create-basement-app/integrations/)",
237
- "Delete root template-hooks/ directory (files now in packages/create-basement-app/template-hooks/)",
238
- "Delete root plugins/ directory (files now in packages/create-basement-app/plugins/)",
239
- "Delete root src/ directory (code moved to packages/cli/src/ and packages/create-basement-app/src/)",
240
- "Delete root bin/ directory (moved to packages/cli/bin/)",
241
- "Remove chalk from root package.json dependencies",
242
- "Remove inquirer from root package.json dependencies",
243
- "Remove fs-extra, ora, picocolors, prompts, tiged, dotenv from root package.json (they're now in workspace packages)",
244
- "Root package.json only has: workspaces config, shared scripts (build, lint, typecheck), devDependencies (biome, changesets)",
245
- "Grep entire codebase for any remaining references to old paths (../../layers, ../../template-hooks, etc.) and fix them",
246
- "Typecheck passes (no syntax errors)"
247
- ],
248
- "priority": 13,
249
- "passes": true,
250
- "notes": "Deleted 6 root dirs (layers, integrations, template-hooks, plugins, src, bin). Cleaned root package.json: renamed to basement-starter-cli, added private:true, removed bin field, removed test script, removed all runtime deps (now in workspace packages). Removed dotenv from CLI. Added workspace:* dep. Added main field to create-basement-app. 8605 lines deleted."
251
- },
252
- {
253
- "id": "US-014",
254
- "title": "Update changeset config and CI for workspaces",
255
- "description": "As a maintainer, I want the release pipeline to publish both packages independently.",
256
- "acceptanceCriteria": [
257
- "Update .changeset/config.json for workspace-aware publishing (add access: public if scoped packages)",
258
- "Update .github/workflows/release.yml to build both packages before publishing",
259
- "Each package has its own changeset-compatible version field",
260
- "packages/cli/package.json has @basementstudio/create-basement-app as workspace dependency: workspace:*",
261
- "CLAUDE.md at project root updated to reflect new architecture (packages/, no more layers/, templates in create-basement-app/)",
262
- "README.md updated with new project structure overview",
263
- "Typecheck passes (no syntax errors)"
264
- ],
265
- "priority": 14,
266
- "passes": true,
267
- "notes": "Changeset config already workspace-ready (access: public, updateInternalDependencies: patch). Added NPM_TOKEN/NODE_AUTH_TOKEN to CI for npm publishing. Updated CLAUDE.md architecture, CLI flow, integration sources, plugin paths. Updated README.md with monorepo structure overview."
268
- },
269
- {
270
- "id": "US-015",
271
- "title": "End-to-end verification of restructured CLI",
272
- "description": "As a maintainer, I need to verify the restructured CLI produces working projects identical to the old version.",
273
- "acceptanceCriteria": [
274
- "Run npm link from packages/cli/ to install CLI locally",
275
- "Run: basement -c /tmp/test-default -d -no-cms -claude -no-hooks — project creates successfully with default template",
276
- "Run: basement -c /tmp/test-webgl -webgl -no-cms -claude -no-hooks — project has R3F components and deps",
277
- "Run: basement -c /tmp/test-webgpu -webgpu -no-cms -claude -no-hooks — project has WebGPU deps in package.json",
278
- "Run: basement -c /tmp/test-experiment -experiment -no-cms -claude -no-hooks — project has experiment header and nav",
279
- "All generated projects have valid package.json with correct dependencies",
280
- "All generated projects pass bun install without errors",
281
- "Clean up test projects after verification",
282
- "Typecheck passes (no syntax errors)"
283
- ],
284
- "priority": 15,
285
- "passes": true,
286
- "notes": "All 4 templates verified: default, webgl, webgpu, experiment. npm link + basement -c works for all. 26/26 checks pass (deps, .gitignore rename, template-specific files). bun install succeeds on generated projects."
287
- }
288
- ]
289
- }
@@ -1,309 +0,0 @@
1
- ## Codebase Patterns
2
- - This is a plain JS (ESM) CLI project - no TypeScript, no typecheck command. "Typecheck passes" = no syntax errors.
3
- - Config pattern: export const CONFIG object + getXConfig(name) helper that returns config or null
4
- - src/mergers/config.js holds all configuration (CMS_CONFIG, LAYER_CONFIG)
5
- - src/mergers/index.js holds injection/merge logic (injectIntegration for CMS, injectLayer for layers)
6
- - src/commands/create.js is the main CLI flow
7
- - next-starter uses package.json directly (no template rename needed)
8
- - Layer files are in templates/{type}/ directory, CMS integration files are LOCAL in integrations/{cms}/files/ (no more tiged remote clone)
9
- - ESM requires __dirname workaround: `const __dirname = path.dirname(fileURLToPath(import.meta.url))`
10
- - CLI binary is basement (defined in package.json bin field)
11
- - Dependency injection order in create.js: layer deps -> CMS deps -> animation deps
12
- - bin/index.js now uses picocolors (chalk replaced in US-002), all files use picocolors
13
- - CMS deps now come from integration config manifests (sanityConfig, basehubConfig) imported in create.js and add-integration.js
14
- - Layer deps still in LAYER_CONFIG in config.js — animation deps now in src/configs/animations.js (centralized in US-011)
15
- - Animation config pattern: ANIMATION_CONFIG object + getAnimationConfig(name) helper in src/configs/animations.js
16
- - Dependency injection order in create.js: layer deps -> CMS deps -> animation deps -> hook deps
17
- - Hook deps are now injected into target package.json during hydration (from hooksConfig)
18
- - Template prompt is dynamic: reads directory listing from create-basement-app/templates/
19
- - Hook prompt choices are config-driven: from hooksConfig (not fs.readdir)
20
- - inquirer and chalk removed from root package.json (unused — prompts and picocolors used instead)
21
- - Integration config pattern: `integrations/{cms}/config.js` exports `{name}Config` with deps, devDeps, scripts, additivePaths, mergeFiles
22
- - Sanity has 35 source files, 3 mergers, and a config manifest in packages/create-basement-app/integrations/sanity/
23
- - Sanity deps: @sanity/asset-utils, @sanity/image-url, @sanity/visual-editing, @sanity/vision, next-sanity (deps) + sanity (devDep)
24
- - next-config-merger.js was orphaned (deleted in US-003)
25
-
26
- - Hook deps: use-battery -> lodash-es; use-device-perf -> detect-gpu, react-device-detect, zustand; use-intersection-observer -> none; use-media -> none
27
- - BaseHub integration is minimal: basehub ^3.0.0 dep only, one additivePath, no mergeFiles, no scripts
28
- - Root biome.json `includes` now covers packages/** (updated in US-002)
29
- - `bun run lint` fails with "nested root configuration" error — templates/ contain their own biome.json with root:true, which conflicts with the root biome.json. This is pre-existing and expected (templates are standalone projects).
30
- - Empty directories in packages/ won't be tracked by git unless they have files - each has package.json
31
- - CLI commands now import mergers from ../../../create-basement-app/src/mergers/ (updated in US-003)
32
- - Merger code lives in packages/create-basement-app/src/mergers/ with barrel export at src/index.js
33
- - Old root dirs (layers, integrations, template-hooks, plugins, src, bin) deleted in US-013 — all code lives in packages/
34
- - injectIntegration resolves integration files via: path.resolve(__dirname, "../../integrations", cms, "files")
35
- - injectLayer resolves layer files via: path.resolve(__dirname, "../../templates", layer)
36
- - CMS_MERGERS imports from ../../integrations/sanity/mergers/ (not co-located ./layout-merger.js)
37
- - tiged fully removed from all packages (no longer needed anywhere)
38
- - CMS_CONFIG no longer has `branch` field (files are local, no remote clone needed)
39
- - Templates are standalone: fs.copy from create-basement-app/templates/{type}/ directly to target dir (no tiged, no layer overlay)
40
- - _gitignore must be renamed to .gitignore after copying template to target dir
41
- - Root package.json is now "basement-starter-cli" with private:true, no bin, no runtime deps — only workspaces + devDeps (biome, changesets)
42
- - dotenv removed from CLI (was only for dev .env loading from source tree)
43
- - packages/cli has workspace:* dep on @basementstudio/create-basement-app
44
- - packages/create-basement-app has "main": "src/index.js"
45
-
46
- ---
47
-
48
- ## 2026-02-11 - US-001
49
- - What was implemented: Monorepo skeleton with bun workspaces
50
- - Files changed:
51
- - package.json (added "workspaces": ["packages/*"])
52
- - packages/cli/package.json (new)
53
- - packages/create-basement-app/package.json (new)
54
- - packages/create-basement-app/templates/ (new dir)
55
- - packages/create-basement-app/integrations/ (new dir)
56
- - packages/create-basement-app/template-hooks/ (new dir)
57
- - packages/create-basement-app/plugins/ (new dir)
58
- - **Learnings for future iterations:**
59
- - biome.json includes list doesn't cover packages/ - will need updating when code moves there
60
- - bun workspaces use "workspaces" field in root package.json (same as npm/yarn)
61
- - Empty subdirectories (templates, integrations, etc.) are created but won't be git-tracked until they contain files
62
- ---
63
-
64
- ## 2026-02-11 - US-002
65
- - What was implemented: Moved CLI code (bin/index.js, src/commands/*) to packages/cli/
66
- - Files changed:
67
- - packages/cli/bin/index.js (new - copied from bin/index.js, chalk replaced with picocolors)
68
- - packages/cli/src/commands/create.js (new - copied from src/commands/create.js, merger paths updated)
69
- - packages/cli/src/commands/add-integration.js (new - copied, merger paths updated)
70
- - packages/cli/src/commands/worktree.js (new - copied as-is, no external imports to update)
71
- - packages/cli/src/commands/setup-sanity.js (new - copied as-is)
72
- - packages/cli/package.json (updated with runtime dependencies)
73
- - biome.json (added packages/** to includes)
74
- - package.json (fixed formatting for biome compliance)
75
- - **Learnings for future iterations:**
76
- - chalk.bold.hex("#FF4D00") has no picocolors equivalent - use ANSI escape codes: `\x1b[1m\x1b[38;2;255;77;0m${text}\x1b[0m`
77
- - Static imports in ESM fail at module load time even for --help - merger imports in create.js are mostly dynamic (await import) except getLayerConfig which is static
78
- - For intermediate stories, import paths to not-yet-moved modules use `../../../../src/mergers/` - these will be cleaned up in US-003
79
- - `node --check file.js` validates syntax without executing (useful for ESM files that would fail on missing deps)
80
- - dotenv path in create.js uses __dirname-relative resolution - needs updating when file moves
81
- ---
82
-
83
- ## 2026-02-11 - US-003
84
- - What was implemented: Moved all merger code to packages/create-basement-app/src/mergers/
85
- - Files changed:
86
- - packages/create-basement-app/src/mergers/index.js (new - copied from src/mergers/index.js)
87
- - packages/create-basement-app/src/mergers/config.js (new - copied from src/mergers/config.js)
88
- - packages/create-basement-app/src/mergers/layout-merger.js (new - copied from src/mergers/layout-merger.js)
89
- - packages/create-basement-app/src/mergers/sitemap-merger.js (new - copied from src/mergers/sitemap-merger.js)
90
- - packages/create-basement-app/src/mergers/check-integration-merger.js (new - copied from src/mergers/check-integration-merger.js)
91
- - packages/create-basement-app/src/index.js (new - barrel re-export of public API)
92
- - packages/create-basement-app/package.json (added fs-extra, picocolors, tiged deps)
93
- - packages/cli/src/commands/create.js (3 import paths updated to create-basement-app)
94
- - packages/cli/src/commands/add-integration.js (1 import path updated to create-basement-app)
95
- - src/mergers/next-config-merger.js (DELETED - orphaned, never in CMS_MERGERS)
96
- - **Learnings for future iterations:**
97
- - From packages/cli/src/commands/ to packages/create-basement-app/src/mergers/ the relative path is ../../../create-basement-app/src/mergers/
98
- - Old src/mergers/ files are preserved (not deleted) until US-013 cleanup to avoid breaking anything
99
- - index.js barrel export pattern: re-export named exports from submodules for clean public API
100
- - Merger code deps (fs-extra, tiged) need to be declared in create-basement-app's package.json since that's where the code now lives
101
- - next-starter is a PRIVATE repo — tiged can't clone it. Use `gh repo clone` instead for authenticated access.
102
- - Default template is the base for all other templates (webgl, webgpu, experiment will copy from it)
103
- - Template cleanup: remove .tldr cache, .tldrignore; rename .gitignore to _gitignore; delete bun.lock
104
- ---
105
-
106
- ## 2026-02-11 - US-004
107
- - What was implemented: Generated default template by cloning basementstudio/next-starter#main
108
- - Files changed:
109
- - packages/create-basement-app/templates/default/ (84 files — complete Next.js project)
110
- - Renamed .gitignore to _gitignore (npm strips dotfiles)
111
- - Deleted bun.lock (should not be committed in templates)
112
- - Removed .tldr/ cache and .tldrignore (repo-specific caches)
113
- - **Learnings for future iterations:**
114
- - basementstudio/next-starter is a private repo — `npx tiged` fails. Use `gh repo clone` with `--depth 1` for auth.
115
- - After cloning, remove .git/ before copying to template directory
116
- - next-starter includes .biome/plugins (Grit lint rules), .cursor/rules, .vscode, .github, .editorconfig — all part of the project template
117
- - Template package.json has: next 16.1.4, react 19.2.4, react-dom 19.2.4, plus tailwindcss, biome, zustand, etc.
118
- - Template includes lib/scripts/ for code generation (generate-component.ts, generate-page.ts)
119
- ---
120
-
121
- ## 2026-02-11 - US-005
122
- - What was implemented: Generated WebGL template from default template + layer overlay files
123
- - Files changed:
124
- - packages/create-basement-app/templates/webgl/ (87 files — complete Next.js project with WebGL)
125
- - app/page.tsx overwritten with WebGL version (imports DynamicCanvas)
126
- - components/webgl/canvas/dynamic.tsx (new — client-side dynamic loader for R3F canvas)
127
- - components/webgl/canvas/index.tsx (new — R3F Canvas with production GL settings)
128
- - components/webgl/components/scene/index.tsx (new — demo rotating orange cube)
129
- - package.json updated with WebGL deps: @react-three/fiber ^9.5.0, @react-three/drei ^10.7.7, three ^0.182.0, @radix-ui/react-navigation-menu ^1.2.5, leva ^0.9.35, @types/three ^0.182.0
130
- - **Learnings for future iterations:**
131
- - Template generation pattern: cp -r default/ {name}/, overlay files, edit package.json deps
132
- - WebGL layer has 1 replaceFile (app/page.tsx) and 3 additivePaths (canvas + scene components)
133
- - Dependencies are alphabetically sorted in package.json to keep diffs clean
134
- - _gitignore already present from default template copy (no need to rename again)
135
- - No bun.lock in templates (already cleaned in default template)
136
- ---
137
-
138
- ## 2026-02-11 - US-006
139
- - What was implemented: Generated WebGPU template from default template + alpha R3F dependencies
140
- - Files changed:
141
- - packages/create-basement-app/templates/webgpu/ (84 files — complete Next.js project, deps-only)
142
- - package.json updated with WebGPU deps: @react-three/fiber 10.0.0-alpha.2, @react-three/drei ^11.0.0-alpha.4, three ^0.182.0, leva ^0.9.35, lucide-react ^0.474.0, @radix-ui/react-navigation-menu ^1.2.5, @types/three ^0.182.0
143
- - **Learnings for future iterations:**
144
- - WebGPU is deps-only — no overlay files, simplest template generation (just copy + edit package.json)
145
- - WebGPU uses ALPHA versions of R3F (10.0.0-alpha.2 for fiber, ^11.0.0-alpha.4 for drei) — different from webgl which uses stable versions
146
- - File count matches default template exactly (84 files) since no components were added
147
- ---
148
-
149
- ## 2026-02-11 - US-007
150
- - What was implemented: Generated experiment template from default template + experiment layer overlay files
151
- - Files changed:
152
- - packages/create-basement-app/templates/experiment/ (86 files — complete Next.js project with experiment nav)
153
- - components/layout/header/index.tsx overwritten with experiment version (Radix NavigationMenu-based header with experiment links)
154
- - components/layout/navigation-menu.tsx (new — full Radix NavigationMenu component library with CVA styling)
155
- - lib/constants.ts (new — EXPERIMENTS array with route definitions)
156
- - package.json updated with experiment deps: @radix-ui/react-navigation-menu ^1.2.5, @react-three/fiber ^9.5.0, @react-three/drei ^10.7.7, three ^0.182.0, leva ^0.9.35, lucide-react ^0.474.0, @types/three ^0.182.0
157
- - **Learnings for future iterations:**
158
- - Experiment layer has 1 replaceFile (header/index.tsx) and 2 additivePaths (navigation-menu.tsx, constants.ts) — different from webgl which has 1 replace + 3 additive
159
- - class-variance-authority already exists in default template at ^0.7.1, LAYER_CONFIG declares ^0.7.0 — no need to downgrade, existing version satisfies the constraint
160
- - PRD notes said three ^0.172.0 but actual LAYER_CONFIG uses ^0.182.0 — always check the source code config, not PRD notes
161
- - Dependencies should be alphabetically sorted in package.json devDependencies too (caught and fixed @types/three ordering)
162
- - 86 files = 84 default + 2 additive files (navigation-menu.tsx + constants.ts). replaceFile doesn't change count.
163
- ---
164
-
165
- ## 2026-02-11 - US-008
166
- - What was implemented: Moved Sanity integration files locally into create-basement-app with a unified config manifest
167
- - Files changed:
168
- - packages/create-basement-app/integrations/sanity/config.js (new — single source of truth: deps, devDeps, scripts, additivePaths, mergeFiles)
169
- - packages/create-basement-app/integrations/sanity/files/ (35 files — complete Sanity integration: app/, components/, lib/)
170
- - packages/create-basement-app/integrations/sanity/mergers/layout-merger.js (copied from src/mergers/)
171
- - packages/create-basement-app/integrations/sanity/mergers/sitemap-merger.js (copied from src/mergers/)
172
- - packages/create-basement-app/integrations/sanity/mergers/check-integration-merger.js (copied from src/mergers/)
173
- - **Learnings for future iterations:**
174
- - Integration config pattern: export const {name}Config with name, dependencies, devDependencies, scripts, additivePaths, mergeFiles
175
- - Sanity has 5 deps, 1 devDep, 2 scripts, 9 additivePaths, 3 mergeFiles
176
- - additivePaths and mergeFiles were sourced from CMS_CONFIG.sanity in config.js; deps/scripts from hardcoded values in create.js lines 239-260
177
- - PRD acceptance criteria listed @sanity/vision as a dep, but in create.js it's actually listed alongside other @sanity/* deps (version ^5.7.0)
178
- - Mergers are COPIES (not moves) — originals in src/mergers/ stay until US-013 cleanup. US-010 will rewire imports.
179
- ---
180
-
181
- ## 2026-02-11 - US-009
182
- - What was implemented: Moved BaseHub integration, template-hooks, and plugins into packages/create-basement-app
183
- - Files changed:
184
- - packages/create-basement-app/integrations/basehub/config.js (new — basehubConfig with deps, additivePaths, mergeFiles)
185
- - packages/create-basement-app/integrations/basehub/files/README.md (copied from integrations/basehub/)
186
- - packages/create-basement-app/template-hooks/config.js (new — hooksConfig array with 4 hook entries + deps)
187
- - packages/create-basement-app/template-hooks/use-battery.ts (copied from template-hooks/)
188
- - packages/create-basement-app/template-hooks/use-device-perf.ts (copied from template-hooks/)
189
- - packages/create-basement-app/template-hooks/use-intersection-observer.ts (copied from template-hooks/)
190
- - packages/create-basement-app/template-hooks/use-media.ts (copied from template-hooks/)
191
- - packages/create-basement-app/plugins/no-anchor-element.grit (copied from plugins/)
192
- - packages/create-basement-app/plugins/no-unnecessary-forwardref.grit (copied from plugins/)
193
- - packages/create-basement-app/plugins/no-relative-parent-imports.grit (copied from plugins/)
194
- - packages/create-basement-app/plugins/README.md (copied from plugins/)
195
- - **Learnings for future iterations:**
196
- - BaseHub integration is minimal — only adds basehub: ^3.0.0 as a dependency, no scripts, no mergeFiles, one additivePath
197
- - Hook dependency discovery: use-battery imports lodash-es/isEqual; use-device-perf imports detect-gpu, react-device-detect, zustand; use-intersection-observer and use-media have zero npm deps
198
- - use-device-perf also has an internal dependency on use-battery (imports ./use-battery) — this is a file-level dep, not an npm dep
199
- - Hooks are currently just copied as files — create.js does NOT inject hook npm deps into the target project's package.json (that will need US-011 to wire up)
200
- - The config.js pattern for hooks mirrors the integration config pattern: name, file, dependencies, devDependencies
201
- ---
202
-
203
- ## 2026-02-11 - US-010
204
- - What was implemented: Updated merger paths to use local create-basement-app locations instead of remote GitHub clones
205
- - Files changed:
206
- - packages/create-basement-app/src/mergers/index.js (replaced tiged remote clone with local fs.copy from integrations/{cms}/files/; updated injectLayer path from ../../layers to ../../templates; removed os and tiged imports)
207
- - packages/create-basement-app/src/mergers/config.js (removed `branch` field from CMS_CONFIG for both sanity and basehub)
208
- - packages/cli/src/commands/create.js (added imports for sanityConfig/basehubConfig; replaced hardcoded CMS deps/devDeps/scripts with config manifest reads)
209
- - packages/cli/src/commands/add-integration.js (added imports for sanityConfig/basehubConfig; replaced hardcoded addDependencies function with config-driven approach)
210
- - packages/create-basement-app/package.json (removed tiged dependency)
211
- - CMS_MERGERS updated to import from ../../integrations/sanity/mergers/ instead of co-located ./layout-merger.js
212
- - **Learnings for future iterations:**
213
- - injectIntegration path resolution: path.resolve(__dirname, "../../integrations", cms, "files") from src/mergers/index.js
214
- - injectLayer path resolution: path.resolve(__dirname, "../../templates", layer) from src/mergers/index.js
215
- - CMS deps are now config-driven: import { sanityConfig } from "../../../create-basement-app/integrations/sanity/config.js"
216
- - The addDependencies function in add-integration.js was duplicating deps from create.js — both now use config manifests
217
- - tiged is still needed in packages/cli/ (for template download from GitHub in create.js) but NOT in create-basement-app
218
- - With this change, adding a new integration only requires: 1) files in integrations/{name}/files/, 2) config.js with deps, 3) optional mergers
219
- ---
220
-
221
- ## 2026-02-12 - US-011
222
- - What was implemented: Centralized all dependency configs — zero hardcoded version strings remain in create.js
223
- - Files changed:
224
- - packages/create-basement-app/src/configs/animations.js (new — ANIMATION_CONFIG with gsap and motion deps + getAnimationConfig helper)
225
- - packages/create-basement-app/src/index.js (added export for getAnimationConfig and ANIMATION_CONFIG)
226
- - packages/cli/src/commands/create.js (replaced hardcoded animation deps with config; added hooksConfig import; dynamic template discovery; hook dep injection into package.json; updated hooks source path to create-basement-app)
227
- - package.json (removed unused inquirer and chalk from root dependencies)
228
- - **Learnings for future iterations:**
229
- - Animation config follows same pattern as CMS config: ANIMATION_CONFIG object + getAnimationConfig(name) helper
230
- - Hook dependency injection is a NEW behavior: previously hooks were copied as files but their npm deps were NOT injected. Now hooksConfig is used to inject deps during hydration step.
231
- - Template prompt choices are dynamically generated from fs.readdir of templates/ dir, with a templateLabels lookup for friendly names
232
- - dotenv is kept in root deps (not just devDeps) because create.js loads .env at runtime for CLI dev — could be moved in US-013 cleanup
233
- - Biome auto-fix reorders imports alphabetically and formats long conditionals across multiple lines — run `biome check --write` after edits
234
- - Hook source path: from packages/cli/src/commands/ to create-basement-app/template-hooks/ is ../../../create-basement-app/template-hooks
235
- ---
236
-
237
- ## 2026-02-12 - US-012
238
- - What was implemented: Replaced tiged remote clone with local fs.copy from standalone templates
239
- - Files changed:
240
- - packages/cli/src/commands/create.js (replaced tiged clone with fs.copy; removed layer injection step 3.2; removed layer dep injection from hydration; added _gitignore rename; updated error messages)
241
- - packages/cli/package.json (removed tiged dependency)
242
- - **Learnings for future iterations:**
243
- - Templates are now fully standalone — no more two-step "download base + overlay layer" process
244
- - _gitignore -> .gitignore rename is needed because npm strips dotfiles from published packages
245
- - Layer deps no longer need injection during hydration — they're already in each template's package.json
246
- - tiged is no longer needed anywhere in packages/ (still referenced in old root src/ which will be cleaned in US-013)
247
- - The template copy is instant (no network call), making CLI significantly faster
248
- - Template path resolution from create.js: path.resolve(__dirname, "../../../create-basement-app/templates", type)
249
- ---
250
-
251
- ## 2026-02-12 - US-013
252
- - What was implemented: Deleted all old root directories and cleaned up dead code/dependencies
253
- - Files changed:
254
- - DELETED: bin/ (262 lines — old CLI entry point, now in packages/cli/bin/)
255
- - DELETED: src/ (4 commands + 5 mergers — all moved to packages/)
256
- - DELETED: layers/ (3 layer directories — content in packages/create-basement-app/templates/)
257
- - DELETED: integrations/ (sanity + basehub — content in packages/create-basement-app/integrations/)
258
- - DELETED: template-hooks/ (4 hooks — content in packages/create-basement-app/template-hooks/)
259
- - DELETED: plugins/ (3 grit rules + README — content in packages/create-basement-app/plugins/)
260
- - package.json (cleaned: renamed to basement-starter-cli, added private:true, removed bin field, removed test script, removed all runtime deps)
261
- - packages/cli/package.json (removed dotenv dep, added workspace:* dep on create-basement-app)
262
- - packages/cli/src/commands/create.js (removed dotenv import and config call)
263
- - packages/create-basement-app/package.json (removed unused picocolors dep, added "main": "src/index.js")
264
- - bun.lock (regenerated — 4 packages installed, 8 removed)
265
- - **Learnings for future iterations:**
266
- - 67 files changed, 8605 lines deleted — the bulk of this story is deletions
267
- - Root package.json should be private:true and have no bin/deps (those belong in workspace packages)
268
- - dotenv was loading .env from CLI source tree for dev convenience — not needed in production, removed
269
- - picocolors was declared in create-basement-app but never imported — always verify deps are actually used
270
- - workspace:* protocol links packages without publishing — bun resolves it to the local package
271
- - After cleanup, the project root only has: package.json, biome.json, bun.lock, .changeset/, .github/, packages/
272
- ---
273
-
274
- ## 2026-02-12 - US-014
275
- - What was implemented: Updated changeset config, CI workflow, CLAUDE.md, and README.md for workspace-aware publishing
276
- - Files changed:
277
- - .github/workflows/release.yml (added NPM_TOKEN and NODE_AUTH_TOKEN env vars for npm publishing)
278
- - CLAUDE.md (rewrote Architecture section for monorepo, updated CLI flow, integration sources, plugin paths, dev commands)
279
- - README.md (added Project Structure section with monorepo layout and package table)
280
- - **Learnings for future iterations:**
281
- - Changeset config was already workspace-ready — `access: "public"` and `updateInternalDependencies: "patch"` were set from the original single-package setup
282
- - CI release workflow needs both GITHUB_TOKEN (for PR creation) and NPM_TOKEN/NODE_AUTH_TOKEN (for npm publishing) — the original only had GITHUB_TOKEN
283
- - `changesets/action@v1` handles workspace publishing automatically — `changeset publish` publishes all packages with pending version bumps
284
- - `workspace:*` is resolved at publish time — changesets replace it with the actual semver version in the published package.json
285
- - Biome lint fails on this repo due to nested root configs in templates/ — this is pre-existing and not related to any story changes
286
- - CLAUDE.md Architecture section should match actual directory structure — the old section described layers/, integrations/, template-hooks/ at root which no longer exist
287
- ---
288
-
289
- ## 2026-02-12 - US-015
290
- - What was implemented: End-to-end verification of all 4 template types
291
- - Verification results:
292
- - npm link from packages/cli/ succeeded
293
- - basement -c /tmp/test-default -d -no-cms -no-animation -claude -no-hooks — SUCCESS
294
- - basement -c /tmp/test-webgl -webgl -no-cms -no-animation -claude -no-hooks — SUCCESS
295
- - basement -c /tmp/test-webgpu -webgpu -no-cms -no-animation -claude -no-hooks — SUCCESS
296
- - basement -c /tmp/test-experiment -experiment -no-cms -no-animation -claude -no-hooks — SUCCESS
297
- - 26/26 structural checks pass (deps, .gitignore rename, template-specific files/dirs)
298
- - bun install succeeds on generated projects (392 packages, 5.25s)
299
- - **Learnings:**
300
- - All templates produce valid Next.js projects with react@19.2.4, next@16.1.4, react-dom@19.2.4
301
- - _gitignore -> .gitignore rename works correctly for all templates
302
- - Local template copy is instant (no network call) — significantly faster than the old tiged-based approach
303
- - WebGL template includes components/webgl/ with canvas/ and components/ subdirectories
304
- - WebGPU template is deps-only (alpha R3F versions, no extra component files)
305
- - Experiment template includes navigation-menu.tsx and lib/constants.ts
306
-
307
- ## RESTRUCTURE COMPLETE — 15/15 stories pass
308
- ---
309
-