bsmnt 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/2026-02-11-test-patch-bump.md +5 -0
- package/.changeset/README.md +10 -0
- package/.changeset/config.json +16 -0
- package/.cursor/rules/README.md +184 -0
- package/.cursor/rules/architecture.mdc +437 -0
- package/.cursor/rules/components.mdc +436 -0
- package/.cursor/rules/integrations.mdc +447 -0
- package/.cursor/rules/main.mdc +278 -0
- package/.cursor/rules/styling.mdc +433 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +14 -0
- package/.github/workflows/.gitkeep +0 -0
- package/.github/workflows/ci.yml +37 -0
- package/.github/workflows/release.yml +54 -0
- package/.tldr/cache/call_graph.json +7 -0
- package/.tldr/languages.json +6 -0
- package/.tldr/status +1 -0
- package/.tldrignore +84 -0
- package/.vscode/extensions.json +20 -0
- package/.vscode/settings.json +98 -0
- package/CHANGELOG.md +13 -0
- package/CLAUDE.md +138 -0
- package/README.md +176 -0
- package/bin/index.js +262 -0
- package/biome.json +44 -0
- package/bun.lock +496 -0
- package/changelog/04-02-26.md +86 -0
- package/changelog/05-02-26.md +101 -0
- package/changelog/09-02-26.md +83 -0
- package/docs/fix-studio-hydration.md +46 -0
- package/docs/plans/2026-01-29-sanity-smart-merge-design.md +196 -0
- package/docs/plans/2026-01-29-sanity-smart-merge-implementation.md +695 -0
- package/docs/sanity-setup-steps.md +199 -0
- package/integrations/basehub/README.md +3 -0
- package/integrations/sanity/app/api/draft-mode/disable/route.ts +7 -0
- package/integrations/sanity/app/api/draft-mode/enable/route.ts +21 -0
- package/integrations/sanity/app/api/revalidate/route.ts +37 -0
- package/integrations/sanity/app/layout.tsx +111 -0
- package/integrations/sanity/app/sitemap.ts +80 -0
- package/integrations/sanity/app/studio/[[...tool]]/page.tsx +8 -0
- package/integrations/sanity/app/studio/layout.tsx +7 -0
- package/integrations/sanity/components/ui/sanity-image/index.tsx +37 -0
- package/integrations/sanity/lib/integrations/README.md +58 -0
- package/integrations/sanity/lib/integrations/check-integration.ts +62 -0
- package/integrations/sanity/lib/integrations/sanity/README.md +144 -0
- package/integrations/sanity/lib/integrations/sanity/client.ts +30 -0
- package/integrations/sanity/lib/integrations/sanity/components/disable-draft-mode.tsx +29 -0
- package/integrations/sanity/lib/integrations/sanity/components/rich-text.tsx +73 -0
- package/integrations/sanity/lib/integrations/sanity/env.ts +38 -0
- package/integrations/sanity/lib/integrations/sanity/live/index.tsx +34 -0
- package/integrations/sanity/lib/integrations/sanity/queries.ts +99 -0
- package/integrations/sanity/lib/integrations/sanity/sanity.cli.ts +20 -0
- package/integrations/sanity/lib/integrations/sanity/sanity.config.ts +94 -0
- package/integrations/sanity/lib/integrations/sanity/sanity.types.ts +337 -0
- package/integrations/sanity/lib/integrations/sanity/schema.json +1850 -0
- package/integrations/sanity/lib/integrations/sanity/schemas/article.ts +132 -0
- package/integrations/sanity/lib/integrations/sanity/schemas/example.ts +203 -0
- package/integrations/sanity/lib/integrations/sanity/schemas/index.ts +37 -0
- package/integrations/sanity/lib/integrations/sanity/schemas/link.ts +127 -0
- package/integrations/sanity/lib/integrations/sanity/schemas/metadata.ts +68 -0
- package/integrations/sanity/lib/integrations/sanity/schemas/navigation.ts +39 -0
- package/integrations/sanity/lib/integrations/sanity/schemas/page.ts +77 -0
- package/integrations/sanity/lib/integrations/sanity/schemas/richText.ts +59 -0
- package/integrations/sanity/lib/integrations/sanity/structure.ts +5 -0
- package/integrations/sanity/lib/integrations/sanity/utils/image.ts +11 -0
- package/integrations/sanity/lib/integrations/sanity/utils/link.ts +61 -0
- package/integrations/sanity/lib/scripts/copy-sanity-mcp.ts +23 -0
- package/integrations/sanity/lib/scripts/generate-page.ts +310 -0
- package/integrations/sanity/lib/utils/metadata.ts +190 -0
- package/layers/experiment/components/layout/header/index.tsx +58 -0
- package/layers/experiment/components/layout/navigation-menu.tsx +127 -0
- package/layers/experiment/lib/constants.ts +12 -0
- package/layers/webgl/app/page.tsx +10 -0
- package/layers/webgl/components/webgl/canvas/dynamic.tsx +34 -0
- package/layers/webgl/components/webgl/canvas/index.tsx +43 -0
- package/layers/webgl/components/webgl/components/scene/index.tsx +21 -0
- package/layers/webgpu/.gitkeep +0 -0
- package/package.json +44 -0
- package/plugins/README.md +21 -0
- package/plugins/no-anchor-element.grit +11 -0
- package/plugins/no-relative-parent-imports.grit +6 -0
- package/plugins/no-unnecessary-forwardref.grit +5 -0
- package/src/commands/add-integration.js +325 -0
- package/src/commands/create.js +415 -0
- package/src/commands/setup-sanity.js +426 -0
- package/src/commands/worktree.js +805 -0
- package/src/mergers/check-integration-merger.js +105 -0
- package/src/mergers/config.js +137 -0
- package/src/mergers/index.js +355 -0
- package/src/mergers/layout-merger.js +223 -0
- package/src/mergers/next-config-merger.js +63 -0
- package/src/mergers/sitemap-merger.js +121 -0
- package/tasks/prd-next-starter-dynamic-layers.md +184 -0
- package/tasks/prd.json +153 -0
- package/tasks/progress.txt +115 -0
- package/template-hooks/use-battery.ts +126 -0
- package/template-hooks/use-device-perf.ts +184 -0
- package/template-hooks/use-intersection-observer.ts +32 -0
- package/template-hooks/use-media.ts +33 -0
package/bin/index.js
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import prompts from "prompts";
|
|
5
|
+
import { addIntegration } from "../src/commands/add-integration.js";
|
|
6
|
+
import { createProject } from "../src/commands/create.js";
|
|
7
|
+
import { worktreeCommand } from "../src/commands/worktree.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Parse CLI flags into options object
|
|
11
|
+
*/
|
|
12
|
+
function parseArgs(args) {
|
|
13
|
+
const options = {};
|
|
14
|
+
let projectName = null;
|
|
15
|
+
|
|
16
|
+
for (const arg of args) {
|
|
17
|
+
// Mode flags
|
|
18
|
+
if (arg === "-c" || arg === "--create" || arg === "-create") {
|
|
19
|
+
options.mode = "create";
|
|
20
|
+
} else if (arg === "-a" || arg === "--add" || arg === "-add") {
|
|
21
|
+
options.mode = "add";
|
|
22
|
+
} else if (arg === "-w" || arg === "--worktree" || arg === "-worktree") {
|
|
23
|
+
options.mode = "worktree";
|
|
24
|
+
}
|
|
25
|
+
// Worktree action flags
|
|
26
|
+
else if (arg === "-wc" || arg === "--worktree-create") {
|
|
27
|
+
options.mode = "worktree";
|
|
28
|
+
options.action = "create";
|
|
29
|
+
} else if (arg === "-wl" || arg === "--worktree-list") {
|
|
30
|
+
options.mode = "worktree";
|
|
31
|
+
options.action = "list";
|
|
32
|
+
} else if (arg === "-ws" || arg === "--worktree-switch") {
|
|
33
|
+
options.mode = "worktree";
|
|
34
|
+
options.action = "switch";
|
|
35
|
+
} else if (arg === "-wr" || arg === "--worktree-remove") {
|
|
36
|
+
options.mode = "worktree";
|
|
37
|
+
options.action = "remove";
|
|
38
|
+
} else if (arg === "-wp" || arg === "--worktree-prune") {
|
|
39
|
+
options.mode = "worktree";
|
|
40
|
+
options.action = "prune";
|
|
41
|
+
}
|
|
42
|
+
// Worktree option flags
|
|
43
|
+
else if (arg === "--delete-branch" || arg === "-db") {
|
|
44
|
+
options.deleteBranch = true;
|
|
45
|
+
} else if (arg === "-f" || arg === "--force") {
|
|
46
|
+
options.force = true;
|
|
47
|
+
}
|
|
48
|
+
// Branch name (for worktree commands)
|
|
49
|
+
else if (arg.startsWith("-b=") || arg.startsWith("--branch=")) {
|
|
50
|
+
options.branch = arg.split("=")[1];
|
|
51
|
+
}
|
|
52
|
+
// Template flags
|
|
53
|
+
else if (arg === "-d" || arg === "--default") {
|
|
54
|
+
options.template = "default";
|
|
55
|
+
} else if (arg === "-webgl" || arg === "--webgl") {
|
|
56
|
+
options.template = "webgl";
|
|
57
|
+
} else if (arg === "-webgpu" || arg === "--webgpu") {
|
|
58
|
+
options.template = "webgpu";
|
|
59
|
+
} else if (
|
|
60
|
+
arg === "-experiment" ||
|
|
61
|
+
arg === "--experiment" ||
|
|
62
|
+
arg === "-exp"
|
|
63
|
+
) {
|
|
64
|
+
options.template = "experiment";
|
|
65
|
+
}
|
|
66
|
+
// CMS flags
|
|
67
|
+
else if (arg === "-sanity" || arg === "--sanity") {
|
|
68
|
+
options.cms = "sanity";
|
|
69
|
+
} else if (arg === "-basehub" || arg === "--basehub") {
|
|
70
|
+
options.cms = "basehub";
|
|
71
|
+
} else if (arg === "-no-cms" || arg === "--no-cms") {
|
|
72
|
+
options.cms = "none";
|
|
73
|
+
}
|
|
74
|
+
// Animation flags
|
|
75
|
+
else if (arg === "-gsap" || arg === "--gsap") {
|
|
76
|
+
options.animation = "gsap";
|
|
77
|
+
} else if (arg === "-motion" || arg === "--motion") {
|
|
78
|
+
options.animation = "motion";
|
|
79
|
+
} else if (arg === "-no-animation" || arg === "--no-animation") {
|
|
80
|
+
options.animation = "none";
|
|
81
|
+
}
|
|
82
|
+
// Agent flags
|
|
83
|
+
else if (arg === "-claude" || arg === "--claude") {
|
|
84
|
+
options.agent = "claude";
|
|
85
|
+
} else if (arg === "-opencode" || arg === "--opencode") {
|
|
86
|
+
options.agent = "opencode";
|
|
87
|
+
}
|
|
88
|
+
// Skip hooks prompt
|
|
89
|
+
else if (arg === "-no-hooks" || arg === "--no-hooks") {
|
|
90
|
+
options.hooks = [];
|
|
91
|
+
}
|
|
92
|
+
// Help flag
|
|
93
|
+
else if (arg === "-h" || arg === "--help") {
|
|
94
|
+
options.help = true;
|
|
95
|
+
}
|
|
96
|
+
// Project name (first non-flag argument)
|
|
97
|
+
else if (!arg.startsWith("-") && !projectName) {
|
|
98
|
+
projectName = arg;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return { projectName, options };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function showHelp() {
|
|
106
|
+
console.log(`
|
|
107
|
+
${chalk.bold("Usage:")} basement [mode] [project-name] [flags]
|
|
108
|
+
|
|
109
|
+
${chalk.bold("Modes:")}
|
|
110
|
+
-c, --create Setup a new basement project
|
|
111
|
+
-a, --add Add integration to current project
|
|
112
|
+
-w, --worktree Manage git worktrees
|
|
113
|
+
|
|
114
|
+
${chalk.bold("Create Flags:")}
|
|
115
|
+
${chalk.cyan("Template:")}
|
|
116
|
+
-d, --default Use Default (Next.js) template
|
|
117
|
+
-webgl Use WebGL template
|
|
118
|
+
-webgpu Use WebGPU template
|
|
119
|
+
-exp, -experiment Use Experiment template
|
|
120
|
+
|
|
121
|
+
${chalk.cyan("CMS:")}
|
|
122
|
+
-sanity Use Sanity CMS
|
|
123
|
+
-basehub Use BaseHub CMS
|
|
124
|
+
-no-cms No CMS
|
|
125
|
+
|
|
126
|
+
${chalk.cyan("Animation:")}
|
|
127
|
+
-gsap Use GSAP
|
|
128
|
+
-motion Use Framer Motion
|
|
129
|
+
-no-animation No animation library
|
|
130
|
+
|
|
131
|
+
${chalk.cyan("Agent:")}
|
|
132
|
+
-claude Use Claude Code
|
|
133
|
+
-opencode Use OpenCode
|
|
134
|
+
|
|
135
|
+
${chalk.cyan("Other:")}
|
|
136
|
+
-no-hooks Skip hooks selection
|
|
137
|
+
-h, --help Show this help
|
|
138
|
+
|
|
139
|
+
${chalk.bold("Add Integration Flags:")}
|
|
140
|
+
-sanity Add Sanity CMS integration
|
|
141
|
+
-basehub Add BaseHub integration
|
|
142
|
+
|
|
143
|
+
${chalk.bold("Worktree Flags:")}
|
|
144
|
+
${chalk.cyan("Actions:")}
|
|
145
|
+
-wc, --worktree-create Create a new worktree
|
|
146
|
+
-wl, --worktree-list List all worktrees
|
|
147
|
+
-ws, --worktree-switch Switch to a worktree
|
|
148
|
+
-wr, --worktree-remove Remove a worktree
|
|
149
|
+
-wp, --worktree-prune Clean up stale worktrees
|
|
150
|
+
|
|
151
|
+
${chalk.cyan("Options:")}
|
|
152
|
+
-b=<name>, --branch=<name> Specify branch name (comma-separated for multiple)
|
|
153
|
+
-db, --delete-branch Delete branch when removing worktree
|
|
154
|
+
-f, --force Skip confirmation prompts
|
|
155
|
+
|
|
156
|
+
${chalk.bold("Examples:")}
|
|
157
|
+
${chalk.dim("# Interactive mode")}
|
|
158
|
+
basement
|
|
159
|
+
|
|
160
|
+
${chalk.dim("# Quick create with all flags")}
|
|
161
|
+
basement -c my-app -d -sanity -gsap -claude -no-hooks
|
|
162
|
+
|
|
163
|
+
${chalk.dim("# Add Sanity to current project")}
|
|
164
|
+
basement -a -sanity
|
|
165
|
+
|
|
166
|
+
${chalk.dim("# Interactive add integration")}
|
|
167
|
+
basement -a
|
|
168
|
+
|
|
169
|
+
${chalk.dim("# Create worktree interactively")}
|
|
170
|
+
basement -w
|
|
171
|
+
|
|
172
|
+
${chalk.dim("# Create worktree with branch name")}
|
|
173
|
+
basement -wc -b=feature/auth
|
|
174
|
+
|
|
175
|
+
${chalk.dim("# Create multiple worktrees at once")}
|
|
176
|
+
basement -wc -b=feature/auth,feature/dashboard,fix/bug-123
|
|
177
|
+
|
|
178
|
+
${chalk.dim("# List all worktrees")}
|
|
179
|
+
basement -wl
|
|
180
|
+
|
|
181
|
+
${chalk.dim("# Remove worktree and delete branch")}
|
|
182
|
+
basement -wr -b=feature/auth -db -f
|
|
183
|
+
`);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function showBanner() {
|
|
187
|
+
console.log(
|
|
188
|
+
chalk.bold.hex("#FF4D00")(`
|
|
189
|
+
██████╗ █████╗ ███████╗███████╗███╗ ███╗███████╗███╗ ██╗████████╗
|
|
190
|
+
██╔══██╗██╔══██╗██╔════╝██╔════╝████╗ ████║██╔════╝████╗ ██║╚══██╔══╝
|
|
191
|
+
██████╔╝███████║███████╗█████╗ ██╔████╔██║█████╗ ██╔██╗ ██║ ██║
|
|
192
|
+
██╔══██╗██╔══██║╚════██║██╔══╝ ██║╚██╔╝██║██╔══╝ ██║╚██╗██║ ██║
|
|
193
|
+
██████╔╝██║ ██║███████║███████╗██║ ╚═╝ ██║███████╗██║ ╚████║ ██║
|
|
194
|
+
╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝
|
|
195
|
+
`),
|
|
196
|
+
);
|
|
197
|
+
console.log(chalk.bold.hex("#FF4D00")("\n🚀 Welcome to basement-cli\n"));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
async function main() {
|
|
201
|
+
const args = process.argv.slice(2);
|
|
202
|
+
const { projectName, options } = parseArgs(args);
|
|
203
|
+
|
|
204
|
+
if (options.help) {
|
|
205
|
+
showHelp();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
showBanner();
|
|
210
|
+
|
|
211
|
+
try {
|
|
212
|
+
let mode = options.mode;
|
|
213
|
+
|
|
214
|
+
// If no mode specified, ask the user
|
|
215
|
+
if (!mode) {
|
|
216
|
+
const { selectedMode } = await prompts({
|
|
217
|
+
type: "select",
|
|
218
|
+
name: "selectedMode",
|
|
219
|
+
message: "What would you like to do?",
|
|
220
|
+
choices: [
|
|
221
|
+
{
|
|
222
|
+
title: "Setup basement project",
|
|
223
|
+
description:
|
|
224
|
+
"Create a new project with templates, CMS, and agent skills",
|
|
225
|
+
value: "create",
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
title: "Add integration",
|
|
229
|
+
description: "Add Sanity or other integrations to current project",
|
|
230
|
+
value: "add",
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
title: "Manage worktrees",
|
|
234
|
+
description: "Create, list, switch, or remove git worktrees",
|
|
235
|
+
value: "worktree",
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
if (!selectedMode) {
|
|
241
|
+
console.log(chalk.yellow("\n⚠ Operation cancelled.\n"));
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
mode = selectedMode;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Route to appropriate command
|
|
249
|
+
if (mode === "create") {
|
|
250
|
+
await createProject(projectName, options);
|
|
251
|
+
} else if (mode === "add") {
|
|
252
|
+
await addIntegration(options);
|
|
253
|
+
} else if (mode === "worktree") {
|
|
254
|
+
await worktreeCommand(options);
|
|
255
|
+
}
|
|
256
|
+
} catch (error) {
|
|
257
|
+
console.error(chalk.red("\n❌ An error occurred:"), error.message);
|
|
258
|
+
process.exit(1);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
main();
|
package/biome.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"ignoreUnknown": false,
|
|
10
|
+
"includes": [
|
|
11
|
+
"bin/**",
|
|
12
|
+
"src/**",
|
|
13
|
+
"integrations/**",
|
|
14
|
+
"layers/**",
|
|
15
|
+
"template-hooks/**",
|
|
16
|
+
"plugins/**",
|
|
17
|
+
"biome.json",
|
|
18
|
+
"package.json"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"formatter": {
|
|
22
|
+
"enabled": true,
|
|
23
|
+
"indentStyle": "tab"
|
|
24
|
+
},
|
|
25
|
+
"linter": {
|
|
26
|
+
"enabled": true,
|
|
27
|
+
"rules": {
|
|
28
|
+
"recommended": true
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"javascript": {
|
|
32
|
+
"formatter": {
|
|
33
|
+
"quoteStyle": "double"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"assist": {
|
|
37
|
+
"enabled": true,
|
|
38
|
+
"actions": {
|
|
39
|
+
"source": {
|
|
40
|
+
"organizeImports": "on"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|