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
|
@@ -1,221 +1,50 @@
|
|
|
1
|
-
# Basement Next Starter
|
|
1
|
+
# Basement Next Experiments 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 for experiments and rapid prototyping with Tailwind CSS 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) {
|
|
@@ -1,22 +1,39 @@
|
|
|
1
1
|
import { Wrapper } from "@/components/layout/wrapper"
|
|
2
2
|
import { Link } from "@/components/ui/link"
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
const COLORS = [
|
|
5
|
+
{ name: "black", value: "#000000" },
|
|
6
|
+
{ name: "white", value: "#ffffff" },
|
|
7
|
+
{ name: "orange", value: "#ff4d00" },
|
|
8
|
+
{ name: "blue", value: "#487cff" },
|
|
9
|
+
{ name: "green", value: "#00ff9b" },
|
|
10
|
+
{ name: "violet", value: "#f101a5" },
|
|
11
|
+
{ name: "pink", value: "#ff73a6" },
|
|
12
|
+
{ name: "gray", value: "#666666" },
|
|
13
|
+
] as const
|
|
14
|
+
|
|
15
|
+
const BREAKPOINTS = [
|
|
16
|
+
{ name: "mobile", value: 640 },
|
|
17
|
+
{ name: "tablet", value: 768 },
|
|
18
|
+
{ name: "tablet-lg", value: 1024 },
|
|
19
|
+
{ name: "desktop", value: 1440 },
|
|
20
|
+
{ name: "desktop-large", value: 1920 },
|
|
21
|
+
] as const
|
|
5
22
|
|
|
6
23
|
const TECH_STACK = [
|
|
7
|
-
{ description: "App Router
|
|
8
|
-
{ description: "
|
|
9
|
-
{ description: "Strict
|
|
10
|
-
{ description: "CSS-first
|
|
11
|
-
{ description: "
|
|
12
|
-
{ description: "Package
|
|
24
|
+
{ description: "App Router and modern React patterns", name: "Next.js" },
|
|
25
|
+
{ description: "Server and client components", name: "React" },
|
|
26
|
+
{ description: "Strict typechecking", name: "TypeScript" },
|
|
27
|
+
{ description: "CSS-first styling", name: "Tailwind CSS" },
|
|
28
|
+
{ description: "Linting and formatting", name: "Biome" },
|
|
29
|
+
{ description: "Package management and scripts", name: "Bun" },
|
|
13
30
|
]
|
|
14
31
|
|
|
15
32
|
const FEATURES = [
|
|
16
33
|
{
|
|
17
34
|
description:
|
|
18
|
-
"
|
|
19
|
-
title: "
|
|
35
|
+
"A small Tailwind setup with CSS variables, custom utilities, and theme-ready defaults.",
|
|
36
|
+
title: "Minimal Styling",
|
|
20
37
|
},
|
|
21
38
|
{
|
|
22
39
|
description:
|
|
@@ -30,7 +47,7 @@ const FEATURES = [
|
|
|
30
47
|
},
|
|
31
48
|
{
|
|
32
49
|
description:
|
|
33
|
-
"
|
|
50
|
+
"HTTPS dev support and sensible project defaults without extra generators.",
|
|
34
51
|
title: "Developer Experience",
|
|
35
52
|
},
|
|
36
53
|
{
|
|
@@ -44,13 +61,10 @@ const SCRIPTS = [
|
|
|
44
61
|
{ cmd: "bun dev", desc: "Start development server" },
|
|
45
62
|
{ cmd: "bun dev:https", desc: "Start with HTTPS" },
|
|
46
63
|
{ cmd: "bun build", desc: "Build for production" },
|
|
47
|
-
{ cmd: "bun generate", desc: "Scaffold components" },
|
|
48
64
|
{ cmd: "bun lint:fix", desc: "Fix lint issues" },
|
|
49
65
|
{ cmd: "bun typecheck", desc: "Type check with tsgo" },
|
|
50
66
|
]
|
|
51
67
|
|
|
52
|
-
const VERSION = "1.0.0"
|
|
53
|
-
|
|
54
68
|
export default function Home() {
|
|
55
69
|
return (
|
|
56
70
|
<Wrapper theme="dark">
|
|
@@ -58,7 +72,7 @@ export default function Home() {
|
|
|
58
72
|
<section className="flex min-h-[80vh] flex-col justify-center px-safe pt-header-height">
|
|
59
73
|
<div className="max-w-3xl">
|
|
60
74
|
<p className="font-mono text-contrast text-sm uppercase tracking-wider">
|
|
61
|
-
Next.js Starter Template
|
|
75
|
+
Next.js Starter Template
|
|
62
76
|
</p>
|
|
63
77
|
<h1 className="mt-4 font-semibold text-4xl leading-tight tracking-tight md:text-6xl">
|
|
64
78
|
Basement Next Starter
|
|
@@ -96,12 +110,7 @@ export default function Home() {
|
|
|
96
110
|
key={tech.name}
|
|
97
111
|
className="border border-secondary/10 p-6 transition-colors hover:border-secondary/30"
|
|
98
112
|
>
|
|
99
|
-
<
|
|
100
|
-
<span className="font-semibold text-lg">{tech.name}</span>
|
|
101
|
-
<span className="font-mono text-contrast text-sm">
|
|
102
|
-
v{tech.version}
|
|
103
|
-
</span>
|
|
104
|
-
</div>
|
|
113
|
+
<span className="font-semibold text-lg">{tech.name}</span>
|
|
105
114
|
<p className="mt-2 text-secondary/60 text-sm">
|
|
106
115
|
{tech.description}
|
|
107
116
|
</p>
|
|
@@ -137,15 +146,15 @@ export default function Home() {
|
|
|
137
146
|
Colors
|
|
138
147
|
</h3>
|
|
139
148
|
<div className="mt-4 flex flex-wrap gap-3">
|
|
140
|
-
{
|
|
141
|
-
<div key={name} className="flex items-center gap-2">
|
|
149
|
+
{COLORS.map((color) => (
|
|
150
|
+
<div key={color.name} className="flex items-center gap-2">
|
|
142
151
|
<div
|
|
143
152
|
className="size-8 rounded border border-secondary/20"
|
|
144
|
-
style={{ backgroundColor: value }}
|
|
153
|
+
style={{ backgroundColor: color.value }}
|
|
145
154
|
/>
|
|
146
155
|
<div className="font-mono text-xs">
|
|
147
|
-
<div className="text-secondary">{name}</div>
|
|
148
|
-
<div className="text-secondary/40">{value}</div>
|
|
156
|
+
<div className="text-secondary">{color.name}</div>
|
|
157
|
+
<div className="text-secondary/40">{color.value}</div>
|
|
149
158
|
</div>
|
|
150
159
|
</div>
|
|
151
160
|
))}
|
|
@@ -158,13 +167,15 @@ export default function Home() {
|
|
|
158
167
|
Breakpoints
|
|
159
168
|
</h3>
|
|
160
169
|
<div className="mt-4 flex flex-wrap gap-4">
|
|
161
|
-
{
|
|
170
|
+
{BREAKPOINTS.map((breakpoint) => (
|
|
162
171
|
<div
|
|
163
|
-
key={name}
|
|
172
|
+
key={breakpoint.name}
|
|
164
173
|
className="border border-secondary/10 px-4 py-2 font-mono text-sm"
|
|
165
174
|
>
|
|
166
|
-
<span className="text-secondary">{name}</span>
|
|
167
|
-
<span className="ml-2 text-secondary/40">
|
|
175
|
+
<span className="text-secondary">{breakpoint.name}</span>
|
|
176
|
+
<span className="ml-2 text-secondary/40">
|
|
177
|
+
{breakpoint.value}px
|
|
178
|
+
</span>
|
|
168
179
|
</div>
|
|
169
180
|
))}
|
|
170
181
|
</div>
|
|
@@ -178,19 +189,15 @@ export default function Home() {
|
|
|
178
189
|
<div className="mt-4 flex gap-8 font-mono text-sm">
|
|
179
190
|
<div>
|
|
180
191
|
<span className="text-secondary/40">Mobile:</span>{" "}
|
|
181
|
-
<span className="text-secondary">
|
|
182
|
-
{layout.columns.mobile} columns
|
|
183
|
-
</span>
|
|
192
|
+
<span className="text-secondary">4 columns</span>
|
|
184
193
|
</div>
|
|
185
194
|
<div>
|
|
186
195
|
<span className="text-secondary/40">Desktop:</span>{" "}
|
|
187
|
-
<span className="text-secondary">
|
|
188
|
-
{layout.columns.desktop} columns
|
|
189
|
-
</span>
|
|
196
|
+
<span className="text-secondary">12 columns</span>
|
|
190
197
|
</div>
|
|
191
198
|
<div>
|
|
192
199
|
<span className="text-secondary/40">Gap:</span>{" "}
|
|
193
|
-
<span className="text-secondary">
|
|
200
|
+
<span className="text-secondary">16px</span>
|
|
194
201
|
</div>
|
|
195
202
|
</div>
|
|
196
203
|
</div>
|
|
@@ -248,9 +255,9 @@ components/
|
|
|
248
255
|
└── ui/ # Image, Link, SanityImage
|
|
249
256
|
lib/
|
|
250
257
|
├── hooks/ # useDeviceDetection, useMediaBreakpoint
|
|
251
|
-
├── scripts/ # Dev
|
|
258
|
+
├── scripts/ # Dev tooling
|
|
252
259
|
├── store/ # Zustand global state
|
|
253
|
-
├── styles/ #
|
|
260
|
+
├── styles/ # Tailwind entry, global CSS, fonts
|
|
254
261
|
└── utils/ # Easings, math, strings, fetch`}
|
|
255
262
|
</pre>
|
|
256
263
|
</div>
|
|
@@ -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.
|
|
@@ -167,7 +168,7 @@ export function Image({
|
|
|
167
168
|
// Generate responsive sizes if not provided
|
|
168
169
|
const finalSizes =
|
|
169
170
|
sizes ||
|
|
170
|
-
`(max-width: ${
|
|
171
|
+
`(max-width: ${DESKTOP_BREAKPOINT}px) ${mobileSize}, ${desktopSize}`;
|
|
171
172
|
|
|
172
173
|
// Early return after hooks
|
|
173
174
|
if (!src) return null;
|
|
@@ -27,7 +27,7 @@ import { colors, themes, breakpoints } from '@/lib/styles/config'
|
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
bun dev # Start dev server
|
|
30
|
-
bun
|
|
31
|
-
bun
|
|
32
|
-
bun
|
|
30
|
+
bun build # Create production build
|
|
31
|
+
bun lint:fix # Fix lint issues
|
|
32
|
+
bun typecheck # Run type checks
|
|
33
33
|
```
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from "react"
|
|
2
2
|
import { useMedia } from "react-use"
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
const MOBILE_BREAKPOINT = 640
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Hook for detecting device capabilities and characteristics.
|
|
@@ -58,7 +59,7 @@ import { breakpoints } from "@/lib/styles/config"
|
|
|
58
59
|
* ```
|
|
59
60
|
*/
|
|
60
61
|
export function useDeviceDetection() {
|
|
61
|
-
const isMobile = useMedia(`(max-width: ${
|
|
62
|
+
const isMobile = useMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`, true)
|
|
62
63
|
const isReducedMotion = useMedia("(prefers-reduced-motion: reduce)")
|
|
63
64
|
const [dpr, setDpr] = useState<number | undefined>(undefined)
|
|
64
65
|
const [isSafari, setIsSafari] = useState<boolean | undefined>(undefined)
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { useMedia } from "react-use"
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const BREAKPOINTS = {
|
|
4
|
+
"desktop-large": 1920,
|
|
5
|
+
desktop: 1440,
|
|
6
|
+
"tablet-lg": 1024,
|
|
7
|
+
tablet: 768,
|
|
8
|
+
mobile: 640,
|
|
9
|
+
} as const
|
|
3
10
|
|
|
4
11
|
/**
|
|
5
12
|
* Hook for detecting if the viewport is at a specific breakpoint.
|
|
@@ -8,8 +15,8 @@ import { breakpoints } from "@/lib/styles/config"
|
|
|
8
15
|
* @returns True if the viewport is at the breakpoint
|
|
9
16
|
*/
|
|
10
17
|
export function useMediaBreakpoint(
|
|
11
|
-
breakpoint: keyof typeof
|
|
18
|
+
breakpoint: keyof typeof BREAKPOINTS,
|
|
12
19
|
defaultState = false
|
|
13
20
|
) {
|
|
14
|
-
return useMedia(`(min-width: ${
|
|
21
|
+
return useMedia(`(min-width: ${BREAKPOINTS[breakpoint]}px)`, defaultState)
|
|
15
22
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Cross-platform
|
|
3
|
-
* Replaces npm-run-all for running multiple processes simultaneously
|
|
4
|
-
* Works on Windows, macOS, and Linux using Bun's native APIs
|
|
2
|
+
* Cross-platform Next.js dev launcher.
|
|
5
3
|
*/
|
|
6
4
|
|
|
7
5
|
import { bunExecutable, colorEnv } from "./utils"
|
|
@@ -14,39 +12,21 @@ const nextDevArgs = [bunExecutable, "next", "dev"]
|
|
|
14
12
|
if (isHttps) nextDevArgs.push("--experimental-https")
|
|
15
13
|
if (isInspect) nextDevArgs.push("--inspect")
|
|
16
14
|
|
|
17
|
-
// Build environment with FORCE_COLOR
|
|
18
15
|
const devEnv = colorEnv()
|
|
19
16
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
stderr: "inherit",
|
|
27
|
-
env: devEnv,
|
|
28
|
-
}
|
|
29
|
-
),
|
|
30
|
-
|
|
31
|
-
// Next.js dev server
|
|
32
|
-
Bun.spawn(nextDevArgs, {
|
|
33
|
-
stdout: "inherit",
|
|
34
|
-
stderr: "inherit",
|
|
35
|
-
env: devEnv,
|
|
36
|
-
}),
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
// Handle graceful shutdown
|
|
17
|
+
const nextDevProcess = Bun.spawn(nextDevArgs, {
|
|
18
|
+
stdout: "inherit",
|
|
19
|
+
stderr: "inherit",
|
|
20
|
+
env: devEnv,
|
|
21
|
+
})
|
|
22
|
+
|
|
40
23
|
const cleanup = () => {
|
|
41
|
-
|
|
42
|
-
proc.kill()
|
|
43
|
-
}
|
|
24
|
+
nextDevProcess.kill()
|
|
44
25
|
process.exit(0)
|
|
45
26
|
}
|
|
46
27
|
|
|
47
28
|
process.on("SIGINT", cleanup)
|
|
48
29
|
process.on("SIGTERM", cleanup)
|
|
49
30
|
|
|
50
|
-
|
|
51
|
-
await Promise.race(processes.map((p) => p.exited))
|
|
31
|
+
await nextDevProcess.exited
|
|
52
32
|
cleanup()
|