bsmnt 0.2.8 → 0.2.10
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 +84 -146
- package/package.json +2 -2
- package/src/helpers/integrate/sanity/files/lib/utils/metadata.ts +1 -1
- package/src/templates/next-default/README.md +28 -199
- package/src/templates/next-default/app/layout.tsx +2 -3
- package/src/templates/next-default/biome.json +1 -14
- package/src/templates/next-default/components/layout/theme/index.tsx +2 -5
- package/src/templates/next-default/components/layout/wrapper/index.tsx +1 -2
- package/src/templates/next-default/components/ui/README.md +2 -3
- package/src/templates/next-default/components/ui/image/index.tsx +3 -3
- package/src/templates/next-default/lib/README.md +3 -3
- package/src/templates/next-default/lib/hooks/use-device-detection.ts +3 -2
- package/src/templates/next-default/lib/hooks/use-media-breakpoint.ts +10 -3
- package/src/templates/next-default/lib/scripts/dev.ts +9 -29
- package/src/templates/next-default/lib/styles/README.md +7 -58
- package/src/templates/next-default/lib/styles/fonts.ts +7 -15
- package/src/templates/next-default/lib/styles/global.css +198 -0
- package/src/templates/next-default/lib/styles/index.css +3 -0
- package/src/templates/next-default/lib/styles/tokens.css +179 -0
- package/src/templates/next-default/lib/utils/global-css.d.ts +1 -0
- package/src/templates/next-default/lib/utils/metadata.ts +1 -1
- package/src/templates/next-default/lib/utils/viewport.ts +11 -5
- package/src/templates/next-default/next.config.ts +0 -1
- package/src/templates/next-default/package.json +10 -17
- package/src/templates/next-default/postcss.config.mjs +0 -14
- package/src/templates/next-default/tsconfig.tsbuildinfo +1 -0
- package/src/templates/next-experiments/README.md +29 -200
- package/src/templates/next-experiments/app/layout.tsx +2 -3
- package/src/templates/next-experiments/app/page.tsx +46 -39
- package/src/templates/next-experiments/biome.json +1 -14
- package/src/templates/next-experiments/components/layout/theme/index.tsx +2 -5
- package/src/templates/next-experiments/components/layout/wrapper/index.tsx +1 -2
- package/src/templates/next-experiments/components/ui/README.md +2 -3
- package/src/templates/next-experiments/components/ui/image/index.tsx +3 -2
- package/src/templates/next-experiments/lib/README.md +3 -3
- package/src/templates/next-experiments/lib/hooks/use-device-detection.ts +3 -2
- package/src/templates/next-experiments/lib/hooks/use-media-breakpoint.ts +10 -3
- package/src/templates/next-experiments/lib/scripts/dev.ts +9 -29
- package/src/templates/next-experiments/lib/styles/README.md +7 -58
- package/src/templates/next-experiments/lib/styles/fonts.ts +7 -15
- package/src/templates/next-experiments/lib/styles/global.css +198 -0
- package/src/templates/next-experiments/lib/styles/index.css +3 -0
- package/src/templates/next-experiments/lib/styles/tokens.css +179 -0
- package/src/templates/next-experiments/lib/utils/global-css.d.ts +1 -0
- package/src/templates/next-experiments/lib/utils/metadata.ts +1 -1
- package/src/templates/next-experiments/lib/utils/viewport.ts +11 -5
- package/src/templates/next-experiments/next.config.ts +0 -1
- package/src/templates/next-experiments/package.json +10 -21
- package/src/templates/next-experiments/postcss.config.mjs +0 -14
- package/src/templates/next-experiments/tsconfig.tsbuildinfo +1 -0
- package/src/templates/next-webgl/README.md +30 -200
- package/src/templates/next-webgl/app/layout.tsx +2 -3
- package/src/templates/next-webgl/biome.json +1 -14
- package/src/templates/next-webgl/components/layout/theme/index.tsx +2 -5
- package/src/templates/next-webgl/components/layout/wrapper/index.tsx +1 -2
- package/src/templates/next-webgl/components/ui/README.md +2 -3
- package/src/templates/next-webgl/components/ui/image/index.tsx +3 -3
- package/src/templates/next-webgl/lib/README.md +3 -3
- package/src/templates/next-webgl/lib/hooks/use-device-detection.ts +3 -2
- package/src/templates/next-webgl/lib/hooks/use-media-breakpoint.ts +10 -3
- package/src/templates/next-webgl/lib/scripts/dev.ts +9 -29
- package/src/templates/next-webgl/lib/styles/README.md +7 -58
- package/src/templates/next-webgl/lib/styles/fonts.ts +7 -15
- package/src/templates/next-webgl/lib/styles/global.css +198 -0
- package/src/templates/next-webgl/lib/styles/index.css +3 -0
- package/src/templates/next-webgl/lib/styles/tokens.css +179 -0
- package/src/templates/next-webgl/lib/utils/global-css.d.ts +1 -0
- package/src/templates/next-webgl/lib/utils/metadata.ts +1 -1
- package/src/templates/next-webgl/lib/utils/viewport.ts +11 -5
- package/src/templates/next-webgl/next.config.ts +0 -1
- package/src/templates/next-webgl/package.json +10 -19
- package/src/templates/next-webgl/postcss.config.mjs +0 -14
- package/src/templates/next-webgl/tsconfig.tsbuildinfo +1 -0
- package/src/templates/next-default/components/ui/image/image.module.css +0 -5
- package/src/templates/next-default/lib/scripts/generate-component.ts +0 -322
- package/src/templates/next-default/lib/scripts/generate-page.ts +0 -193
- package/src/templates/next-default/lib/scripts/generate.ts +0 -79
- package/src/templates/next-default/lib/store/app.ts +0 -11
- package/src/templates/next-default/lib/store/index.ts +0 -11
- package/src/templates/next-default/lib/styles/colors.ts +0 -63
- package/src/templates/next-default/lib/styles/config.ts +0 -34
- package/src/templates/next-default/lib/styles/css/global.css +0 -85
- package/src/templates/next-default/lib/styles/css/index.css +0 -6
- package/src/templates/next-default/lib/styles/css/reset.css +0 -166
- package/src/templates/next-default/lib/styles/css/root.css +0 -68
- package/src/templates/next-default/lib/styles/css/tailwind.css +0 -132
- package/src/templates/next-default/lib/styles/easings.ts +0 -21
- package/src/templates/next-default/lib/styles/index.ts +0 -12
- package/src/templates/next-default/lib/styles/layout.mjs +0 -27
- package/src/templates/next-default/lib/styles/scripts/README.md +0 -29
- package/src/templates/next-default/lib/styles/scripts/generate-root.ts +0 -57
- package/src/templates/next-default/lib/styles/scripts/generate-tailwind.ts +0 -162
- package/src/templates/next-default/lib/styles/scripts/postcss-functions.mjs +0 -168
- package/src/templates/next-default/lib/styles/scripts/setup-styles.ts +0 -24
- package/src/templates/next-default/lib/styles/scripts/utils.ts +0 -20
- package/src/templates/next-default/lib/styles/typography.ts +0 -36
- package/src/templates/next-default/lib/utils/css.d.ts +0 -21
- package/src/templates/next-default/lib/utils/math.test.ts +0 -221
- package/src/templates/next-default/lib/utils/strings.test.ts +0 -166
- package/src/templates/next-default/lib/utils/viewport.test.ts +0 -256
- package/src/templates/next-default/public/fonts/geist/Geist-Mono.woff2 +0 -0
- package/src/templates/next-experiments/components/ui/image/image.module.css +0 -5
- package/src/templates/next-experiments/lib/scripts/generate-component.ts +0 -322
- package/src/templates/next-experiments/lib/scripts/generate-page.ts +0 -193
- package/src/templates/next-experiments/lib/scripts/generate.ts +0 -79
- package/src/templates/next-experiments/lib/store/app.ts +0 -11
- package/src/templates/next-experiments/lib/store/index.ts +0 -11
- package/src/templates/next-experiments/lib/styles/colors.ts +0 -63
- package/src/templates/next-experiments/lib/styles/config.ts +0 -34
- package/src/templates/next-experiments/lib/styles/css/global.css +0 -85
- package/src/templates/next-experiments/lib/styles/css/index.css +0 -6
- package/src/templates/next-experiments/lib/styles/css/reset.css +0 -166
- package/src/templates/next-experiments/lib/styles/css/root.css +0 -68
- package/src/templates/next-experiments/lib/styles/css/tailwind.css +0 -132
- package/src/templates/next-experiments/lib/styles/easings.ts +0 -21
- package/src/templates/next-experiments/lib/styles/index.ts +0 -12
- package/src/templates/next-experiments/lib/styles/layout.mjs +0 -27
- package/src/templates/next-experiments/lib/styles/scripts/README.md +0 -29
- package/src/templates/next-experiments/lib/styles/scripts/generate-root.ts +0 -57
- package/src/templates/next-experiments/lib/styles/scripts/generate-tailwind.ts +0 -162
- package/src/templates/next-experiments/lib/styles/scripts/postcss-functions.mjs +0 -168
- package/src/templates/next-experiments/lib/styles/scripts/setup-styles.ts +0 -24
- package/src/templates/next-experiments/lib/styles/scripts/utils.ts +0 -20
- package/src/templates/next-experiments/lib/styles/typography.ts +0 -36
- package/src/templates/next-experiments/lib/utils/css.d.ts +0 -21
- package/src/templates/next-experiments/lib/utils/math.test.ts +0 -221
- package/src/templates/next-experiments/lib/utils/strings.test.ts +0 -166
- package/src/templates/next-experiments/lib/utils/viewport.test.ts +0 -256
- package/src/templates/next-experiments/public/fonts/geist/Geist-Mono.woff2 +0 -0
- package/src/templates/next-webgl/components/ui/image/image.module.css +0 -5
- package/src/templates/next-webgl/lib/scripts/generate-component.ts +0 -322
- package/src/templates/next-webgl/lib/scripts/generate-page.ts +0 -193
- package/src/templates/next-webgl/lib/scripts/generate.ts +0 -79
- package/src/templates/next-webgl/lib/store/app.ts +0 -11
- package/src/templates/next-webgl/lib/store/index.ts +0 -11
- package/src/templates/next-webgl/lib/styles/colors.ts +0 -63
- package/src/templates/next-webgl/lib/styles/config.ts +0 -34
- package/src/templates/next-webgl/lib/styles/css/global.css +0 -85
- package/src/templates/next-webgl/lib/styles/css/index.css +0 -6
- package/src/templates/next-webgl/lib/styles/css/reset.css +0 -166
- package/src/templates/next-webgl/lib/styles/css/root.css +0 -68
- package/src/templates/next-webgl/lib/styles/css/tailwind.css +0 -132
- package/src/templates/next-webgl/lib/styles/easings.ts +0 -21
- package/src/templates/next-webgl/lib/styles/index.ts +0 -12
- package/src/templates/next-webgl/lib/styles/layout.mjs +0 -27
- package/src/templates/next-webgl/lib/styles/scripts/README.md +0 -29
- package/src/templates/next-webgl/lib/styles/scripts/generate-root.ts +0 -57
- package/src/templates/next-webgl/lib/styles/scripts/generate-tailwind.ts +0 -162
- package/src/templates/next-webgl/lib/styles/scripts/postcss-functions.mjs +0 -168
- package/src/templates/next-webgl/lib/styles/scripts/setup-styles.ts +0 -24
- package/src/templates/next-webgl/lib/styles/scripts/utils.ts +0 -20
- package/src/templates/next-webgl/lib/styles/typography.ts +0 -36
- package/src/templates/next-webgl/lib/utils/css.d.ts +0 -21
- package/src/templates/next-webgl/lib/utils/math.test.ts +0 -221
- package/src/templates/next-webgl/lib/utils/strings.test.ts +0 -166
- package/src/templates/next-webgl/lib/utils/viewport.test.ts +0 -256
- package/src/templates/next-webgl/public/fonts/geist/Geist-Mono.woff2 +0 -0
package/README.md
CHANGED
|
@@ -1,137 +1,65 @@
|
|
|
1
|
-
# bsmnt
|
|
1
|
+
# bsmnt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<a href="https://basement.studio"><img alt="basement.studio logo" src="https://img.shields.io/badge/MADE%20BY%20basement.studio-000000.svg?style=for-the-badge&labelColor=000"></a>
|
|
4
|
+
<a href="https://www.npmjs.com/package/bsmnt"><img alt="NPM version" src="https://img.shields.io/npm/v/bsmnt.svg?style=for-the-badge&labelColor=000000"></a>
|
|
5
|
+
<a href="https://github.com/basementstudio/basement-cli"><img alt="License" src="https://img.shields.io/npm/l/bsmnt.svg?style=for-the-badge&labelColor=000000"></a>
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
bsmnt
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## What's in 1.0
|
|
10
|
-
|
|
11
|
-
### Instant project scaffolding from templates
|
|
12
|
-
|
|
13
|
-
Spin up a new project based on the stack we actually use. Pick a template, answer a few prompts, and you're running.
|
|
14
|
-
|
|
15
|
-
| Template | What you get |
|
|
16
|
-
|----------|-------------|
|
|
17
|
-
| **Default** | Next.js 16 + React 19 + Tailwind v4 + Biome + Zustand |
|
|
18
|
-
| **WebGL** | + React Three Fiber + Three.js + optional WebGPU renderer toggle |
|
|
19
|
-
| **Experiment** | + Creative coding setup with navigation UI |
|
|
7
|
+
`bsmnt` is a CLI for scaffolding basement projects, adding integrations, and installing optional hooks and agent setup.
|
|
20
8
|
|
|
21
|
-
|
|
9
|
+
## Overview
|
|
22
10
|
|
|
23
|
-
|
|
11
|
+
- Scaffold new projects from basement starter templates
|
|
12
|
+
- Add Sanity to an existing project
|
|
13
|
+
- Copy optional hooks into an existing codebase
|
|
14
|
+
- Set up supported agent tooling
|
|
24
15
|
|
|
25
|
-
|
|
16
|
+
## Templates
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
| Template | Includes |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Default | Next.js, React, TypeScript, Tailwind, Biome, and Zustand |
|
|
21
|
+
| WebGPU | Default stack plus React Three Fiber, Three.js, and 3D/WebGPU-ready setup |
|
|
22
|
+
| Experiment | Default stack plus creative coding utilities and navigation UI |
|
|
32
23
|
|
|
33
|
-
|
|
24
|
+
## Install
|
|
34
25
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Already have a project running? The `integrate` command injects Sanity into it. It detects your project structure (`app/` or `src/app/`) and smart-merges layout, sitemap, and integration files without overwriting your code.
|
|
38
|
-
|
|
39
|
-
Real-world validated — this is how we integrated Sanity into the ROX project.
|
|
26
|
+
Run without installing:
|
|
40
27
|
|
|
41
28
|
```bash
|
|
42
|
-
bsmnt
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### Agent skills out of the box
|
|
46
|
-
|
|
47
|
-
Pick your agent (Claude Code or OpenCode) and the CLI installs curated skills so it understands our stack from the start:
|
|
48
|
-
|
|
49
|
-
- React + Next.js performance patterns
|
|
50
|
-
- Web design and accessibility guidelines
|
|
51
|
-
- Frontend design standards
|
|
52
|
-
- WebGPU/TSL guides (for WebGL and Experiment templates)
|
|
53
|
-
- Sanity agent toolkit (when Sanity is selected)
|
|
54
|
-
|
|
55
|
-
For Claude Code + Sanity, it also registers the Sanity MCP server automatically.
|
|
56
|
-
|
|
57
|
-
## Project Structure
|
|
58
|
-
|
|
59
|
-
Single TypeScript package published as `bsmnt` on npm:
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
src/
|
|
63
|
-
├── index.ts # Commander program, prompts, routing
|
|
64
|
-
├── paths.ts # Centralized path resolution
|
|
65
|
-
├── configs/animations.ts # GSAP / Motion dependency configs
|
|
66
|
-
├── helpers/
|
|
67
|
-
│ ├── create/ # Project creation pipeline
|
|
68
|
-
│ ├── integrate/ # CMS integration injection
|
|
69
|
-
│ │ └── sanity/ # Sanity files, config, mergers
|
|
70
|
-
│ └── add/ # Hook injection
|
|
71
|
-
└── utils/ # detect-project, format-results
|
|
72
|
-
templates/ # Standalone project templates
|
|
73
|
-
template-hooks/ # Reusable React hooks
|
|
74
|
-
plugins/ # Biome linting rules (Grit patterns)
|
|
29
|
+
npx bsmnt
|
|
30
|
+
bunx bsmnt
|
|
75
31
|
```
|
|
76
32
|
|
|
77
|
-
|
|
33
|
+
Install globally:
|
|
78
34
|
|
|
79
35
|
```bash
|
|
80
36
|
npm install -g bsmnt
|
|
81
37
|
```
|
|
82
38
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
bun install
|
|
87
|
-
npm link .
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Release Channels
|
|
91
|
-
|
|
92
|
-
This repo follows a two-channel release model similar to the Next.js stable/canary approach, while keeping Changesets as the version source of truth.
|
|
93
|
-
|
|
94
|
-
- `latest` (stable): production releases from the Changesets release PR flow.
|
|
95
|
-
- `canary`: snapshot prereleases from `main` under npm dist-tag `canary` triggered manually.
|
|
96
|
-
|
|
97
|
-
Install stable:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
npm install -g bsmnt@latest
|
|
101
|
-
```
|
|
39
|
+
## Usage
|
|
102
40
|
|
|
103
|
-
|
|
41
|
+
Create a new project:
|
|
104
42
|
|
|
105
43
|
```bash
|
|
106
|
-
|
|
44
|
+
bsmnt
|
|
45
|
+
npx bsmnt
|
|
46
|
+
bunx bsmnt
|
|
107
47
|
```
|
|
108
48
|
|
|
109
|
-
|
|
49
|
+
Add Sanity to an existing project:
|
|
110
50
|
|
|
111
51
|
```bash
|
|
112
|
-
|
|
52
|
+
bsmnt integrate --sanity
|
|
53
|
+
npx bsmnt integrate --sanity
|
|
54
|
+
bunx bsmnt integrate --sanity
|
|
113
55
|
```
|
|
114
56
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
1. Add a changeset in your feature PR (`bun run changeset`).
|
|
118
|
-
2. Merge PR(s) into `main`.
|
|
119
|
-
3. GitHub Actions updates/opens the release PR with version/changelog changes.
|
|
120
|
-
4. Merge that release PR to publish to npm `latest`.
|
|
121
|
-
|
|
122
|
-
How to trigger canary releases:
|
|
123
|
-
|
|
124
|
-
1. Add a changeset in your feature PR (`bun run changeset`).
|
|
125
|
-
2. Merge the PR into `main`.
|
|
126
|
-
3. In GitHub Actions, run `Canary Release` with `workflow_dispatch` on the `main` branch.
|
|
127
|
-
4. The workflow publishes snapshot builds to npm tag `canary` when pending changesets exist.
|
|
128
|
-
|
|
129
|
-
## Usage
|
|
130
|
-
|
|
131
|
-
Interactive mode — answer prompts step by step:
|
|
57
|
+
Add hooks to an existing project:
|
|
132
58
|
|
|
133
59
|
```bash
|
|
134
|
-
bsmnt
|
|
60
|
+
bsmnt add
|
|
61
|
+
npx bsmnt add
|
|
62
|
+
bunx bsmnt add
|
|
135
63
|
```
|
|
136
64
|
|
|
137
65
|
Skip prompts with flags:
|
|
@@ -140,64 +68,74 @@ Skip prompts with flags:
|
|
|
140
68
|
bsmnt create my-app --webgpu --sanity --gsap --claude --no-hooks
|
|
141
69
|
```
|
|
142
70
|
|
|
143
|
-
|
|
71
|
+
## Command Summary
|
|
144
72
|
|
|
145
73
|
```bash
|
|
74
|
+
bsmnt
|
|
75
|
+
bsmnt create [project-name]
|
|
146
76
|
bsmnt integrate --sanity
|
|
77
|
+
bsmnt add
|
|
78
|
+
bsmnt --help
|
|
147
79
|
```
|
|
148
80
|
|
|
149
|
-
##
|
|
81
|
+
## Options
|
|
150
82
|
|
|
151
|
-
|
|
152
|
-
bsmnt [command]
|
|
83
|
+
### Global
|
|
153
84
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
85
|
+
| Option | Description |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| `-h, --help` | Show help |
|
|
88
|
+
| `-V, --version` | Show the CLI version |
|
|
158
89
|
|
|
159
|
-
|
|
160
|
-
-d, --default Next.js starter
|
|
161
|
-
--webgpu Three.js/WebGPU starter
|
|
162
|
-
--experiment Creative coding
|
|
90
|
+
### `create`
|
|
163
91
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
92
|
+
| Option | Description |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `-d, --default` | Use the default template |
|
|
95
|
+
| `--webgpu` | Use the WebGPU template |
|
|
96
|
+
| `--webgl` | Deprecated alias for `--webgpu` |
|
|
97
|
+
| `--experiment` | Use the experiment template |
|
|
98
|
+
| `--sanity` | Add Sanity |
|
|
99
|
+
| `--no-cms` | Skip CMS setup |
|
|
100
|
+
| `--gsap` | Use GSAP |
|
|
101
|
+
| `--motion` | Use Motion |
|
|
102
|
+
| `--no-animation` | Skip animation setup |
|
|
103
|
+
| `--claude` | Set up Claude Code |
|
|
104
|
+
| `--opencode` | Set up OpenCode |
|
|
105
|
+
| `--cursor` | Set up Cursor |
|
|
106
|
+
| `--codex` | Set up Codex |
|
|
107
|
+
| `--gemini` | Set up Gemini CLI |
|
|
108
|
+
| `--no-agent` | Skip agent setup |
|
|
109
|
+
| `--no-hooks` | Skip hook selection |
|
|
167
110
|
|
|
168
|
-
|
|
169
|
-
--gsap GSAP
|
|
170
|
-
--motion Framer Motion
|
|
171
|
-
--no-animation No animation library
|
|
111
|
+
### `integrate`
|
|
172
112
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
113
|
+
| Option | Description |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| `--sanity` | Add Sanity to the current project |
|
|
176
116
|
|
|
177
|
-
|
|
178
|
-
--no-hooks Skip hook selection
|
|
117
|
+
### `add`
|
|
179
118
|
|
|
180
|
-
|
|
181
|
-
-h, --help Show help
|
|
182
|
-
```
|
|
119
|
+
No command-specific flags currently.
|
|
183
120
|
|
|
184
|
-
##
|
|
121
|
+
## Templates
|
|
185
122
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
bun typecheck # Type check with tsgo
|
|
192
|
-
bun generate # Scaffold components/hooks
|
|
193
|
-
bun analyze # Bundle size analysis
|
|
194
|
-
```
|
|
123
|
+
- Default
|
|
124
|
+
- WebGPU
|
|
125
|
+
- Experiment
|
|
126
|
+
|
|
127
|
+
## Included Features
|
|
195
128
|
|
|
196
|
-
|
|
129
|
+
- Starter templates
|
|
130
|
+
- Optional Sanity integration
|
|
131
|
+
- Optional hooks
|
|
132
|
+
- Optional agent setup
|
|
133
|
+
|
|
134
|
+
## Local Development
|
|
197
135
|
|
|
198
136
|
```bash
|
|
199
|
-
bun
|
|
200
|
-
|
|
137
|
+
bun install
|
|
138
|
+
npm link .
|
|
201
139
|
```
|
|
202
140
|
|
|
203
141
|
## License
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bsmnt",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"packageManager": "bun@1.2.20",
|
|
5
5
|
"description": "CLI to scaffold basement projects and add integrations",
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lint": "biome check .",
|
|
31
31
|
"lint:fix": "biome check --write .",
|
|
32
32
|
"changeset": "changeset",
|
|
33
|
-
"version-packages": "changeset version
|
|
33
|
+
"version-packages": "changeset version",
|
|
34
34
|
"release": "changeset publish",
|
|
35
35
|
"prepublishOnly": "rm -rf dist && bun run build",
|
|
36
36
|
"default": "turbo run dev --filter=bsmnt-next-starter",
|
|
@@ -1,221 +1,50 @@
|
|
|
1
1
|
# Basement Next Starter
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Tech Stack
|
|
6
|
-
|
|
7
|
-
| Technology | Version | Description |
|
|
8
|
-
|------------|---------|-------------|
|
|
9
|
-
| Next.js | 16.1 | App Router, Turbopack |
|
|
10
|
-
| React | 19 | React Compiler enabled |
|
|
11
|
-
| TypeScript | 5.9 | Strict mode, `noUncheckedIndexedAccess` |
|
|
12
|
-
| Tailwind CSS | 4 | CSS-first configuration |
|
|
13
|
-
| Biome | 2.3 | Linting and formatting |
|
|
14
|
-
| Bun | 1.3 | Package manager and runtime |
|
|
15
|
-
| Zustand | 5.0 | State management |
|
|
3
|
+
Minimal Next.js starter with Tailwind CSS, TypeScript, and Basement defaults.
|
|
16
4
|
|
|
17
5
|
## Quick Start
|
|
18
6
|
|
|
19
7
|
```bash
|
|
20
|
-
|
|
21
|
-
bunx degit basementstudio/next-starter my-project
|
|
22
|
-
|
|
23
|
-
# Install dependencies
|
|
24
|
-
cd my-project && bun install
|
|
25
|
-
|
|
26
|
-
# Start development
|
|
8
|
+
bun install
|
|
27
9
|
bun dev
|
|
28
10
|
```
|
|
29
11
|
|
|
30
|
-
Open [http://localhost:3000](http://localhost:3000) to see the result.
|
|
31
|
-
|
|
32
12
|
## Scripts
|
|
33
13
|
|
|
34
14
|
| Command | Description |
|
|
35
15
|
|---------|-------------|
|
|
36
|
-
| `bun dev` | Start development server
|
|
37
|
-
| `bun dev:https` | Start
|
|
16
|
+
| `bun dev` | Start the development server |
|
|
17
|
+
| `bun dev:https` | Start the development server with HTTPS |
|
|
38
18
|
| `bun build` | Build for production |
|
|
39
|
-
| `bun start` | Start production server |
|
|
40
|
-
| `bun
|
|
41
|
-
| `bun lint` | Run Biome
|
|
42
|
-
| `bun
|
|
43
|
-
| `bun
|
|
44
|
-
| `bun
|
|
45
|
-
| `bun test` | Run tests with Bun |
|
|
46
|
-
| `bun analyze` | Analyze bundle size |
|
|
19
|
+
| `bun start` | Start the production server |
|
|
20
|
+
| `bun lint` | Run Biome |
|
|
21
|
+
| `bun lint:fix` | Run Biome with fixes |
|
|
22
|
+
| `bun format` | Format the codebase |
|
|
23
|
+
| `bun typecheck` | Run TypeScript |
|
|
24
|
+
| `bun analyze` | Analyze the Next.js bundle |
|
|
47
25
|
|
|
48
26
|
## Project Structure
|
|
49
27
|
|
|
50
|
-
```
|
|
51
|
-
app/
|
|
52
|
-
├── api/ # API routes (draft-mode, revalidate)
|
|
53
|
-
├── layout.tsx # Root layout with metadata, fonts
|
|
54
|
-
├── page.tsx # Homepage
|
|
55
|
-
├── sitemap.ts # Dynamic sitemap generation
|
|
56
|
-
└── robots.ts # SEO robots.txt
|
|
57
|
-
|
|
28
|
+
```txt
|
|
29
|
+
app/
|
|
58
30
|
components/
|
|
59
|
-
├── layout/
|
|
60
|
-
│ ├── header/ # Navigation header
|
|
61
|
-
│ ├── footer/ # Page footer
|
|
62
|
-
│ ├── wrapper/ # Page wrapper with theme
|
|
63
|
-
│ └── theme/ # Theme context provider
|
|
64
|
-
└── ui/
|
|
65
|
-
├── image/ # Enhanced Next.js Image wrapper
|
|
66
|
-
└── link/ # Smart Link component
|
|
67
|
-
|
|
68
31
|
lib/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
│ └── fonts.ts # Font loading (Geist Mono)
|
|
81
|
-
└── utils/ # Utility functions
|
|
82
|
-
├── easings.ts # 30+ animation easing functions
|
|
83
|
-
├── math.ts # Math utilities
|
|
84
|
-
├── strings.ts # String utilities
|
|
85
|
-
└── fetch.ts # Fetch utilities
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Features
|
|
89
|
-
|
|
90
|
-
### Design System
|
|
91
|
-
|
|
92
|
-
Pre-configured design tokens ready to use:
|
|
93
|
-
|
|
94
|
-
**Breakpoints:**
|
|
95
|
-
- `mobile`: 375px
|
|
96
|
-
- `tablet`: 620px
|
|
97
|
-
- `tablet-lg`: 1024px
|
|
98
|
-
- `desktop`: 1440px
|
|
99
|
-
- `desktop-large`: 1920px
|
|
100
|
-
|
|
101
|
-
**Grid:**
|
|
102
|
-
- Mobile: 4 columns
|
|
103
|
-
- Desktop: 12 columns
|
|
104
|
-
- Gap: 16px
|
|
105
|
-
|
|
106
|
-
**Colors:**
|
|
107
|
-
- Theme colors: `primary`, `secondary`, `contrast`
|
|
108
|
-
- Accent colors: `red`, `blue`, `green`, `violet`, `pink`
|
|
109
|
-
- Light/dark mode support
|
|
110
|
-
|
|
111
|
-
**Easings:**
|
|
112
|
-
30+ easing functions (quad, cubic, quart, quint, sine, expo, circ, back, elastic, bounce)
|
|
113
|
-
|
|
114
|
-
### Smart Components
|
|
115
|
-
|
|
116
|
-
**`<Image>`** - Enhanced Next.js Image wrapper:
|
|
117
|
-
- Automatic responsive sizes based on breakpoints
|
|
118
|
-
- Blur placeholder with shimmer effect
|
|
119
|
-
- Preload support for LCP images
|
|
120
|
-
- SVG handling
|
|
121
|
-
|
|
122
|
-
**`<Link>`** - Intelligent link component:
|
|
123
|
-
- Auto-detects external links (opens in new tab)
|
|
124
|
-
- Connection-aware prefetching (4G only, respects data saver)
|
|
125
|
-
- Falls back to button/div when no href
|
|
126
|
-
- Active state detection
|
|
127
|
-
|
|
128
|
-
**`<Wrapper>`** - Page layout component:
|
|
129
|
-
- Includes Header and Footer
|
|
130
|
-
- Theme provider integration
|
|
131
|
-
- Flexible content area
|
|
132
|
-
|
|
133
|
-
### Theme Support
|
|
134
|
-
|
|
135
|
-
Light/dark theme with CSS custom properties:
|
|
136
|
-
|
|
137
|
-
```tsx
|
|
138
|
-
import { Wrapper } from "@/components/layout/wrapper"
|
|
139
|
-
|
|
140
|
-
export default function Page() {
|
|
141
|
-
return (
|
|
142
|
-
<Wrapper theme="dark">
|
|
143
|
-
<section>Your content</section>
|
|
144
|
-
</Wrapper>
|
|
145
|
-
)
|
|
146
|
-
}
|
|
32
|
+
hooks/
|
|
33
|
+
integrations/
|
|
34
|
+
scripts/
|
|
35
|
+
store/
|
|
36
|
+
styles/
|
|
37
|
+
index.css
|
|
38
|
+
tokens.css
|
|
39
|
+
global.css
|
|
40
|
+
fonts.ts
|
|
41
|
+
cn.ts
|
|
42
|
+
utils/
|
|
147
43
|
```
|
|
148
44
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
```tsx
|
|
152
|
-
import { useTheme } from "@/components/layout/theme"
|
|
153
|
-
|
|
154
|
-
function Component() {
|
|
155
|
-
const { name, setThemeName } = useTheme()
|
|
156
|
-
// ...
|
|
157
|
-
}
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Performance Optimizations
|
|
161
|
-
|
|
162
|
-
- **React Compiler** - Automatic memoization (no manual `useMemo`/`useCallback`)
|
|
163
|
-
- **Turbopack** - Fast development builds
|
|
164
|
-
- **Bundle Analyzer** - `bun analyze` to inspect bundle size
|
|
165
|
-
- **Optimized Imports** - Auto-optimization for GSAP, Three.js, Lenis, Zustand
|
|
166
|
-
- **Security Headers** - CSP, HSTS, XSS protection pre-configured
|
|
167
|
-
- **Image Optimization** - AVIF, WebP with custom quality settings
|
|
168
|
-
|
|
169
|
-
### Developer Experience
|
|
170
|
-
|
|
171
|
-
- **Component Scaffolding** - `bun generate` to create components/hooks
|
|
172
|
-
- **HTTPS Dev Server** - `bun dev:https` for secure contexts
|
|
173
|
-
- **Strict TypeScript** - `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`
|
|
174
|
-
- **Biome** - Fast linting and formatting with custom rules
|
|
175
|
-
- **Tests** - Bun test runner with utilities
|
|
176
|
-
|
|
177
|
-
## Configuration
|
|
178
|
-
|
|
179
|
-
### Styles
|
|
180
|
-
|
|
181
|
-
Edit design tokens in `lib/styles/`:
|
|
182
|
-
|
|
183
|
-
- `colors.ts` - Theme and accent colors
|
|
184
|
-
- `layout.mjs` - Breakpoints, grid, spacing
|
|
185
|
-
- `typography.ts` - Font definitions
|
|
186
|
-
- `easings.ts` - CSS easing variables
|
|
187
|
-
|
|
188
|
-
After editing, regenerate CSS:
|
|
189
|
-
|
|
190
|
-
```bash
|
|
191
|
-
bun setup:styles
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Next.js
|
|
195
|
-
|
|
196
|
-
Configuration in `next.config.ts`:
|
|
197
|
-
|
|
198
|
-
- React Compiler enabled
|
|
199
|
-
- Typed routes
|
|
200
|
-
- SVG loader (@svgr/webpack)
|
|
201
|
-
- Security headers
|
|
202
|
-
- Image optimization settings
|
|
203
|
-
|
|
204
|
-
## Deployment
|
|
205
|
-
|
|
206
|
-
### Vercel (Recommended)
|
|
207
|
-
|
|
208
|
-
[](https://vercel.com/new/clone?repository-url=https://github.com/basementstudio/next-starter)
|
|
209
|
-
|
|
210
|
-
### Other Platforms
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
bun build
|
|
214
|
-
bun start
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
The app runs on port 3000 by default.
|
|
218
|
-
|
|
219
|
-
## License
|
|
45
|
+
## Styling
|
|
220
46
|
|
|
221
|
-
|
|
47
|
+
- Import `@/lib/styles/index.css` once in `app/layout.tsx`.
|
|
48
|
+
- Edit `lib/styles/tokens.css` for theme variables, breakpoints, and custom Tailwind utilities.
|
|
49
|
+
- Edit `lib/styles/global.css` for reset rules and app-wide global styles.
|
|
50
|
+
- `lib/styles/fonts.ts` handles font variables.
|
|
@@ -2,10 +2,9 @@ import type { Metadata, Viewport } from "next";
|
|
|
2
2
|
import { Geist } from "next/font/google";
|
|
3
3
|
import { type PropsWithChildren, Suspense } from "react";
|
|
4
4
|
import { Link } from "@/components/ui/link";
|
|
5
|
-
import { themes } from "@/lib/styles/colors";
|
|
6
5
|
import { fontsVariable } from "@/lib/styles/fonts";
|
|
7
6
|
import AppData from "@/package.json";
|
|
8
|
-
import "@/lib/styles/
|
|
7
|
+
import "@/lib/styles/index.css";
|
|
9
8
|
import { cn } from "@/lib/styles/cn";
|
|
10
9
|
|
|
11
10
|
const APP_NAME = AppData.name;
|
|
@@ -74,7 +73,7 @@ export const metadata: Metadata = {
|
|
|
74
73
|
|
|
75
74
|
export const viewport: Viewport = {
|
|
76
75
|
colorScheme: "normal",
|
|
77
|
-
themeColor:
|
|
76
|
+
themeColor: "#000000",
|
|
78
77
|
};
|
|
79
78
|
|
|
80
79
|
export default async function Layout({ children }: PropsWithChildren) {
|
|
@@ -214,20 +214,7 @@
|
|
|
214
214
|
}
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
"includes": ["
|
|
218
|
-
"linter": {
|
|
219
|
-
"rules": {
|
|
220
|
-
"correctness": {
|
|
221
|
-
"noUnknownProperty": "off"
|
|
222
|
-
},
|
|
223
|
-
"style": {
|
|
224
|
-
"noDescendingSpecificity": "off"
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"includes": ["lib/styles/css/root.css"],
|
|
217
|
+
"includes": ["lib/styles/tokens.css"],
|
|
231
218
|
"linter": {
|
|
232
219
|
"rules": {
|
|
233
220
|
"suspicious": {
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { usePathname } from "next/navigation"
|
|
4
4
|
import { createContext, useContext, useEffect, useState } from "react"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
export type ThemeName = "light" | "dark"
|
|
7
7
|
|
|
8
8
|
export const ThemeContext = createContext<{
|
|
9
9
|
name: ThemeName
|
|
10
|
-
theme: Themes[ThemeName]
|
|
11
10
|
setThemeName: (theme: ThemeName) => void
|
|
12
11
|
}>({
|
|
13
12
|
name: "light",
|
|
14
|
-
theme: themes.light,
|
|
15
13
|
setThemeName: () => {
|
|
16
14
|
void 0
|
|
17
15
|
},
|
|
@@ -55,7 +53,6 @@ export function Theme({
|
|
|
55
53
|
<ThemeContext.Provider
|
|
56
54
|
value={{
|
|
57
55
|
name: currentTheme,
|
|
58
|
-
theme: themes[currentTheme],
|
|
59
56
|
setThemeName: setCurrentTheme,
|
|
60
57
|
}}
|
|
61
58
|
>
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import cn from "clsx"
|
|
7
7
|
import { Footer } from "@/components/layout/footer"
|
|
8
8
|
import { Header } from "@/components/layout/header"
|
|
9
|
-
import { Theme } from "@/components/layout/theme"
|
|
10
|
-
import type { ThemeName } from "@/lib/styles/config"
|
|
9
|
+
import { Theme, type ThemeName } from "@/components/layout/theme"
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Props for the Wrapper component.
|
|
@@ -65,9 +65,8 @@ import { Link } from '@/components/ui/link'
|
|
|
65
65
|
<Link href="/about">Internal</Link>
|
|
66
66
|
<Link href="https://example.com">External</Link>
|
|
67
67
|
|
|
68
|
-
// ✅
|
|
69
|
-
|
|
70
|
-
<div className={cn(s.wrapper, 'flex items-center')} />
|
|
68
|
+
// ✅ Tailwind only
|
|
69
|
+
<div className="flex items-center" />
|
|
71
70
|
```
|
|
72
71
|
|
|
73
72
|
## Related
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
import cn from "clsx"
|
|
10
10
|
import NextImage, { type ImageProps as NextImageProps } from "next/image"
|
|
11
11
|
import type { CSSProperties, Ref } from "react"
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
const DESKTOP_BREAKPOINT = 1440
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Enhanced Image component props extending Next.js Image.
|
|
@@ -166,8 +167,7 @@ export function Image({
|
|
|
166
167
|
}: ImageProps) {
|
|
167
168
|
// Generate responsive sizes if not provided
|
|
168
169
|
const finalSizes =
|
|
169
|
-
sizes ||
|
|
170
|
-
`(max-width: ${breakpoints.desktop}px) ${mobileSize}, ${desktopSize}`
|
|
170
|
+
sizes || `(max-width: ${DESKTOP_BREAKPOINT}px) ${mobileSize}, ${desktopSize}`
|
|
171
171
|
|
|
172
172
|
// Early return after hooks
|
|
173
173
|
if (!src) return null
|