create-next-style-guide 0.1.5 → 0.1.6
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/LICENSE +21 -0
- package/README.md +189 -0
- package/package.json +16 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 alidanial7
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/nextjs/nextjs-original.svg" width="72" alt="Next.js" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Next Style Guide</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Ship an opinionated Next.js app in minutes</strong><br/>
|
|
9
|
+
App Router · route-colocated _components/ · Zod/Yup · Cursor rules · docs that match the code
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/create-next-style-guide"><img src="https://img.shields.io/npm/v/create-next-style-guide?style=for-the-badge&label=npm&color=CB3837" alt="npm" /></a>
|
|
14
|
+
<a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node-%3E%3D20-339933?style=for-the-badge&logo=nodedotjs&logoColor=white" alt="Node" /></a>
|
|
15
|
+
<a href="https://nextjs.org/"><img src="https://img.shields.io/badge/Next.js-16-black?style=for-the-badge&logo=nextdotjs&logoColor=white" alt="Next.js" /></a>
|
|
16
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-2ea44f?style=for-the-badge" alt="License" /></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="https://img.shields.io/badge/pnpm-workspace-F69220?style=flat-square&logo=pnpm&logoColor=white" alt="pnpm" />
|
|
21
|
+
<a href="https://www.npmjs.com/package/create-next-style-guide"><img src="https://img.shields.io/badge/CLI-create--next--style--guide-111827?style=flat-square" alt="CLI" /></a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
Opinionated **Next.js** scaffold CLI: lean App Router layout, feature installers, agent rules, and docs that match what you enabled.
|
|
27
|
+
|
|
28
|
+
> Toggle options at create time — unused files and rules are not left behind.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## ✨ Why this template
|
|
33
|
+
|
|
34
|
+
| | | |
|
|
35
|
+
|:---:|:---|:---|
|
|
36
|
+
| 🏗️ | **App-colocated layout** | Thin routes · `_components/` per route · shared `components/` + `lib/` |
|
|
37
|
+
| 🎛️ | **Feature installers** | Flip options; prune what you did not pick |
|
|
38
|
+
| 🤖 | **Agent-ready** | Slim `AGENTS.md` + glob-scoped `.cursor/rules/` |
|
|
39
|
+
| 📚 | **Docs that match the code** | Generated `docs/style-guide/` |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 🚀 Quick start
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm create next-style-guide
|
|
47
|
+
# or
|
|
48
|
+
npx create-next-style-guide@latest
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Interactive prompts, or skip with a preset:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx create-next-style-guide@latest my-app --yes --preset api-app
|
|
55
|
+
npx create-next-style-guide@latest shop --yes --preset marketing
|
|
56
|
+
npx create-next-style-guide@latest admin --yes --preset dashboard
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Presets
|
|
60
|
+
|
|
61
|
+
| Preset | Focus |
|
|
62
|
+
|:---|:---|
|
|
63
|
+
| `minimal` | Base App Router only |
|
|
64
|
+
| `api-app` | Tailwind · shadcn:starter · dark · JWT · Query · Zustand · endpoints · Vitest · CI |
|
|
65
|
+
| `marketing` | Tailwind · shadcn:minimal · dark · SEO · i18n · Vercel · Vitest · CI |
|
|
66
|
+
| `dashboard` | Tailwind · shadcn:starter · dark · Query · Zustand (no endpoints) · Vitest · CI |
|
|
67
|
+
| `custom` | Answer every prompt (default in interactive mode) |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 📦 What you get
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
my-app/
|
|
75
|
+
├── src/
|
|
76
|
+
│ ├── app/ # App Router + _components/
|
|
77
|
+
│ ├── components/ # shared UI (≥2 routes)
|
|
78
|
+
│ ├── lib/ # env + helpers
|
|
79
|
+
│ ├── utils/ · providers/ · hooks/ · types/ · constants/
|
|
80
|
+
├── docs/style-guide/
|
|
81
|
+
├── AGENTS.md
|
|
82
|
+
├── .cursor/rules/
|
|
83
|
+
└── …
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Options
|
|
87
|
+
|
|
88
|
+
| | Choice |
|
|
89
|
+
|:---:|:---|
|
|
90
|
+
| 🎛️ | Preset: `minimal` / `api-app` / `marketing` / `dashboard` / `custom` |
|
|
91
|
+
| 📦 | Package manager: `pnpm` / `npm` / `yarn` |
|
|
92
|
+
| 🎨 | Styling: `none` / `tailwind` / `mui` |
|
|
93
|
+
| 🧩 | shadcn (Tailwind only): `minimal` (button) / `starter` (button · input · card · dialog) |
|
|
94
|
+
| ✅ | Validation: `zod` / `yup` |
|
|
95
|
+
| 🔑 | Auth: `none` / `jwt` / `authjs` |
|
|
96
|
+
| 🗃️ | Client store: `none` / `zustand` / `redux` |
|
|
97
|
+
| 🌙 | Dark mode (Tailwind + next-themes) |
|
|
98
|
+
| ✨ | Icons: `none` / `lucide` / `tabler` |
|
|
99
|
+
| 📡 | TanStack Query |
|
|
100
|
+
| 🔌 | OpenAPI endpoints codegen |
|
|
101
|
+
| 📨 | API envelope unwrap |
|
|
102
|
+
| 🔎 | SEO (public-routes, sitemap, robots) |
|
|
103
|
+
| 🌐 | i18n (next-intl) |
|
|
104
|
+
| 🧪 | Vitest (+ optional Playwright) |
|
|
105
|
+
| 🧹 | ESLint / Prettier / Husky |
|
|
106
|
+
| 🚀 | Deploy: `none` / `vercel` / `docker` |
|
|
107
|
+
| 🤖 | GitHub Actions CI |
|
|
108
|
+
|
|
109
|
+
Flags: `--preset`, `--pm`, `--store`, `--styling`, `--shadcn`, `--shadcn-set`, `--deploy`, `--dark-mode`, `--validation`, `--auth`, `--seo`, `--i18n`, `--testing`, `--playwright`, `--api-envelope`, `--icons`, … (+ `--no-*`).
|
|
110
|
+
|
|
111
|
+
Default scaffold is a **neutral base** (no endpoints/envelope/store). Use presets for common stacks.
|
|
112
|
+
|
|
113
|
+
Upgrade an existing app’s agent surface:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npx create-next-style-guide upgrade --diff .
|
|
117
|
+
npx create-next-style-guide upgrade --apply .
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Walkthrough: [`docs/examples/api-app-crud.md`](docs/examples/api-app-crud.md).
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 🗂️ Repo layout
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
next-style-guide/
|
|
128
|
+
├── cli/ # create-next-style-guide
|
|
129
|
+
│ ├── src/ # prompts, scaffold, installers
|
|
130
|
+
│ ├── template/ # base app
|
|
131
|
+
│ └── addons/ # optional feature packs
|
|
132
|
+
├── scripts/smoke.sh
|
|
133
|
+
├── AGENTS.md
|
|
134
|
+
└── VERSION
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 🛠️ Contributors
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
pnpm install
|
|
143
|
+
pnpm typecheck
|
|
144
|
+
pnpm smoke # uses rg if available, else grep
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Local CLI without publishing:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
pnpm --filter create-next-style-guide build
|
|
151
|
+
node cli/dist/index.js my-app --yes --no-install
|
|
152
|
+
# or
|
|
153
|
+
pnpm --filter create-next-style-guide dev
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
See [`AGENTS.md`](AGENTS.md).
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 🚢 Release (npm via GitHub Actions)
|
|
161
|
+
|
|
162
|
+
Latest on npm: [`create-next-style-guide`](https://www.npmjs.com/package/create-next-style-guide) — version tracked in [`VERSION`](VERSION).
|
|
163
|
+
|
|
164
|
+
Pushing a version tag publishes the package.
|
|
165
|
+
|
|
166
|
+
1. **Secret once:** GitHub repo → Settings → Secrets and variables → Actions → `NPM_TOKEN`
|
|
167
|
+
Create a [granular npm token](https://www.npmjs.com/settings/~/tokens) with **Read and write** + **Bypass 2FA** for publish.
|
|
168
|
+
2. Commit your changes on `main`.
|
|
169
|
+
3. Tag and push (semver after current `VERSION`):
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# example: VERSION is 0.1.4 → next tag
|
|
173
|
+
git tag v0.1.5
|
|
174
|
+
git push origin v0.1.5
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Workflow [`.github/workflows/publish.yml`](.github/workflows/publish.yml) runs typecheck + smoke, publishes, then commits `VERSION` + root/`cli` `package.json` back to `main`. On pack/publish, root `README.md` + `LICENSE` are copied into `cli/` so the [npm package page](https://www.npmjs.com/package/create-next-style-guide) shows the same docs.
|
|
178
|
+
|
|
179
|
+
Tag format: `v` + semver (`v0.1.5`, `v1.0.0-beta.1`, …).
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## 🤝 Contributing
|
|
184
|
+
|
|
185
|
+
Issues and PRs → [github.com/alidanial7/next-style-guide](https://github.com/alidanial7/next-style-guide)
|
|
186
|
+
|
|
187
|
+
## 📄 License
|
|
188
|
+
|
|
189
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-next-style-guide",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Scaffold a Next.js app with next-style-guide conventions",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"create-next-style-guide": "dist/index.js"
|
|
9
9
|
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/alidanial7/next-style-guide.git",
|
|
13
|
+
"directory": "cli"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/alidanial7/next-style-guide#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/alidanial7/next-style-guide/issues"
|
|
18
|
+
},
|
|
10
19
|
"files": [
|
|
11
20
|
"dist",
|
|
12
21
|
"template",
|
|
13
|
-
"addons"
|
|
22
|
+
"addons",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
14
25
|
],
|
|
15
26
|
"exports": {
|
|
16
27
|
".": "./dist/index.js"
|
|
@@ -23,7 +34,9 @@
|
|
|
23
34
|
"build": "tsup",
|
|
24
35
|
"start": "node dist/index.js",
|
|
25
36
|
"typecheck": "tsc --noEmit",
|
|
26
|
-
"
|
|
37
|
+
"sync-npm-meta": "node ./scripts/sync-npm-meta.mjs",
|
|
38
|
+
"prepack": "node ./scripts/sync-npm-meta.mjs",
|
|
39
|
+
"prepublishOnly": "pnpm build && node ./scripts/sync-npm-meta.mjs"
|
|
27
40
|
},
|
|
28
41
|
"dependencies": {
|
|
29
42
|
"@clack/prompts": "^0.9.1",
|