create-nexora-next 0.4.7 → 0.4.8
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 +217 -35
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/steps/03-base-files.js +12 -15
- package/src/steps/04-providers.js +1 -1
- package/src/templates/files.js +0 -8
package/README.md
CHANGED
|
@@ -1,46 +1,228 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```
|
|
4
|
+
███╗ ██╗███████╗██╗ ██╗ ██████╗ ██████╗ █████╗
|
|
5
|
+
████╗ ██║██╔════╝╚██╗██╔╝██╔═══██╗██╔══██╗██╔══██╗
|
|
6
|
+
██╔██╗ ██║█████╗ ╚███╔╝ ██║ ██║██████╔╝███████║
|
|
7
|
+
██║╚██╗██║██╔══╝ ██╔██╗ ██║ ██║██╔══██╗██╔══██║
|
|
8
|
+
██║ ╚████║███████╗██╔╝ ██╗╚██████╔╝██║ ██║██║ ██║
|
|
9
|
+
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**The opinionated Next.js scaffold CLI by Rayan.**
|
|
13
|
+
One command. Full setup. Ship faster.
|
|
14
|
+
|
|
15
|
+
[](https://www.npmjs.com/package/create-nexora-next)
|
|
16
|
+
[](https://www.npmjs.com/package/create-nexora-next)
|
|
17
|
+
[](./LICENSE)
|
|
18
|
+
[](https://nodejs.org)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
4
23
|
|
|
5
24
|
## Usage
|
|
6
25
|
|
|
7
26
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
27
|
+
# npm
|
|
28
|
+
npx create-nexora-next@latest
|
|
29
|
+
|
|
30
|
+
# pnpm
|
|
31
|
+
pnpm dlx create-nexora-next@latest
|
|
32
|
+
|
|
33
|
+
# bun
|
|
34
|
+
bunx create-nexora-next@latest
|
|
35
|
+
|
|
36
|
+
# yarn
|
|
37
|
+
yarn dlx create-nexora-next@latest
|
|
11
38
|
```
|
|
12
39
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- `cn()`, `toSlug()`, `trycatch()`, and other utils
|
|
23
|
-
- Typed constants (`TZ_COOKIE`, `SITE_URL`)
|
|
24
|
-
- SEO metadata scaffold
|
|
25
|
-
- `SileoToaster` component
|
|
26
|
-
- Providers pattern (`src/components/providers/`)
|
|
27
|
-
- nuqs adapter (URL state management)
|
|
28
|
-
- Core deps: `zustand`, `zod`, `react-hook-form`, `date-fns`, `nuqs`, `cookies-next`, `nextjs-toploader`
|
|
29
|
-
- Dev deps: `prettier`, `prettier-plugin-tailwindcss`, `babel-plugin-react-compiler`
|
|
30
|
-
|
|
31
|
-
### Optional features (prompted)
|
|
32
|
-
|
|
33
|
-
| Feature | What gets installed / created |
|
|
40
|
+
The CLI will guide you through a short prompt sequence — pick your package manager, choose your features, and watch your project build itself.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## What's always included
|
|
45
|
+
|
|
46
|
+
Every project scaffolded with `create-nexora-next` comes with this baseline — no questions asked:
|
|
47
|
+
|
|
48
|
+
| What | Details |
|
|
34
49
|
|---|---|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
50
|
+
| **Next.js 16** | TypeScript · Tailwind CSS v4 · ESLint · App Router · `src/` dir · `~/` path alias |
|
|
51
|
+
| **shadcn/ui** | Initialised with defaults · `components.json` patched to `~/lib/utils/index.ts` |
|
|
52
|
+
| **Custom globals.css** | Squircle utilities · responsive container · skeleton animation · reduced motion |
|
|
53
|
+
| **Prettier** | `prettier-plugin-tailwindcss` for automatic class sorting |
|
|
54
|
+
| **Poppins font** | Via `next/font/google` with full weight range |
|
|
55
|
+
| **Utility functions** | `cn()` · `toSlug()` · `createInitials()` · `normalizeEmail()` · `sanitizeName()` · `trycatch()` |
|
|
56
|
+
| **Constants** | `SITE_URL` · `TZ_COOKIE` · locale constants (if i18n opted in) |
|
|
57
|
+
| **SEO scaffold** | `src/lib/seo/index.ts` — locale-aware if i18n enabled |
|
|
58
|
+
| **Sitemap** | `src/app/sitemap.ts` pre-wired to `SITE_URL` |
|
|
59
|
+
| **ESLint config** | Clean flat config with Next.js core web vitals + TypeScript rules |
|
|
60
|
+
| **Providers pattern** | Dynamic `src/components/providers/index.ts` — only includes what you opted into |
|
|
61
|
+
| **SileoToaster** | Toast notifications via `sileo` |
|
|
62
|
+
| **nuqs** | Type-safe URL search params adapter |
|
|
63
|
+
| **nextjs-toploader** | Page transition progress bar |
|
|
64
|
+
| **Folder structure** | `hooks/` · `components/{atoms,molecules,organisms,primitives,adapters,providers,ui}/` |
|
|
65
|
+
| **Core deps** | `zustand` · `zod` · `react-hook-form` · `date-fns` · `@date-fns/tz` · `clsx` · `tailwind-merge` |
|
|
66
|
+
| **Dev deps** | `prettier` · `prettier-plugin-tailwindcss` · `babel-plugin-react-compiler` |
|
|
67
|
+
| **Scripts** | `type-check` added to `package.json` → `tsc --pretty --noEmit` |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Optional features
|
|
72
|
+
|
|
73
|
+
Prompted during setup — only what you need gets installed:
|
|
74
|
+
|
|
75
|
+
### 🌍 Localization (`next-intl`)
|
|
76
|
+
- `src/i18n/{routing,request,navigation}.ts`
|
|
77
|
+
- `locales/en.json` with base translation keys
|
|
78
|
+
- `src/app/[locale]/page.tsx` + `src/app/[locale]/layout.tsx`
|
|
79
|
+
- Root `layout.tsx` replaced with passthrough shell
|
|
80
|
+
- Default `src/app/page.tsx` removed
|
|
81
|
+
- `next-intl.ts` config with typed `AppConfig`
|
|
82
|
+
- `src/lib/utils/locale-date-formats.ts`
|
|
83
|
+
- `LocaleProvider` + `TzProvider` (auto-detects and persists device timezone)
|
|
84
|
+
- `next.config.ts` updated with `createNextIntlPlugin`
|
|
85
|
+
|
|
86
|
+
### ⚡ TanStack Query
|
|
87
|
+
- `@tanstack/react-query` installed first (peer dep order guaranteed)
|
|
88
|
+
- `@tanstack/react-query-persist-client` + `@tanstack/query-async-storage-persister`
|
|
89
|
+
- Pre-configured `QueryClientProvider` with:
|
|
90
|
+
- 5-minute stale time
|
|
91
|
+
- Local storage persistence (24h)
|
|
92
|
+
- Mutation cache auto-invalidation via `meta.invalidateQueries`
|
|
93
|
+
- `@tanstack/eslint-plugin-query` as devDependency
|
|
94
|
+
|
|
95
|
+
### 🎨 Theming (`next-themes`)
|
|
96
|
+
- `ThemeProvider` with system default, class attribute, smooth transitions
|
|
97
|
+
|
|
98
|
+
### 🔐 Auth
|
|
99
|
+
- Proxy chain middleware (`src/proxy.ts`)
|
|
100
|
+
- `withProxyChain` + `authProxy` stub
|
|
101
|
+
- `src/lib/validators/{index,auth}.ts` — `LoginSchema`, `RegisterSchema`
|
|
102
|
+
- `src/apis/{client,server}/index.ts`
|
|
103
|
+
- `cookies-next` installed
|
|
104
|
+
|
|
105
|
+
### 🎭 Animations
|
|
106
|
+
- `motion` (formerly Framer Motion)
|
|
107
|
+
- `gsap`
|
|
108
|
+
|
|
109
|
+
### 🔄 Axios
|
|
110
|
+
- `axios` installed
|
|
111
|
+
- `src/lib/axios/axios.client.ts` — pre-configured client instance
|
|
112
|
+
- `src/lib/axios/axios.server.ts` — pre-configured server instance
|
|
113
|
+
|
|
114
|
+
### 🐶 Husky pre-commit hooks
|
|
115
|
+
Runs three checks on every commit:
|
|
116
|
+
```
|
|
117
|
+
📝 Lint → bun lint
|
|
118
|
+
🔍 Type check → bun type-check
|
|
119
|
+
🏗️ Build → bun run build
|
|
120
|
+
```
|
|
121
|
+
Fails fast with a clear error message. Shows timestamp on success.
|
|
122
|
+
|
|
123
|
+
### ⚛️ React Compiler
|
|
124
|
+
- `babel-plugin-react-compiler` (always installed as devDep)
|
|
125
|
+
- `reactCompiler: true` added to `next.config.ts` if opted in
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Project structure
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
my-app/
|
|
133
|
+
├── locales/
|
|
134
|
+
│ └── en.json # (i18n)
|
|
135
|
+
├── src/
|
|
136
|
+
│ ├── app/
|
|
137
|
+
│ │ ├── [locale]/
|
|
138
|
+
│ │ │ ├── layout.tsx # (i18n) full root layout
|
|
139
|
+
│ │ │ └── page.tsx # (i18n) localized home
|
|
140
|
+
│ │ ├── layout.tsx # passthrough shell (i18n) or full layout
|
|
141
|
+
│ │ ├── globals.css
|
|
142
|
+
│ │ └── sitemap.ts
|
|
143
|
+
│ ├── i18n/ # (i18n)
|
|
144
|
+
│ │ ├── routing.ts
|
|
145
|
+
│ │ ├── request.ts
|
|
146
|
+
│ │ └── navigation.ts
|
|
147
|
+
│ ├── components/
|
|
148
|
+
│ │ ├── adapters/
|
|
149
|
+
│ │ │ └── nuqs.adapter.tsx
|
|
150
|
+
│ │ ├── atoms/
|
|
151
|
+
│ │ ├── molecules/
|
|
152
|
+
│ │ ├── organisms/
|
|
153
|
+
│ │ ├── primitives/
|
|
154
|
+
│ │ ├── providers/
|
|
155
|
+
│ │ │ ├── index.ts # dynamic — opted-in providers only
|
|
156
|
+
│ │ │ ├── theme.provider.tsx # (theming)
|
|
157
|
+
│ │ │ ├── locale.provider.tsx # (i18n)
|
|
158
|
+
│ │ │ ├── tz.provider.tsx # (i18n)
|
|
159
|
+
│ │ │ └── query-client.provider.tsx # (query)
|
|
160
|
+
│ │ └── ui/
|
|
161
|
+
│ │ └── sileo.tsx
|
|
162
|
+
│ ├── constants/
|
|
163
|
+
│ │ └── index.ts
|
|
164
|
+
│ ├── hooks/
|
|
165
|
+
│ ├── lib/
|
|
166
|
+
│ │ ├── axios/ # (axios)
|
|
167
|
+
│ │ │ ├── axios.client.ts
|
|
168
|
+
│ │ │ └── axios.server.ts
|
|
169
|
+
│ │ ├── fonts.ts
|
|
170
|
+
│ │ ├── proxy/ # (auth or i18n)
|
|
171
|
+
│ │ │ ├── index.ts
|
|
172
|
+
│ │ │ └── auth.ts # (auth)
|
|
173
|
+
│ │ ├── seo/
|
|
174
|
+
│ │ │ └── index.ts
|
|
175
|
+
│ │ ├── utils/
|
|
176
|
+
│ │ │ ├── index.ts
|
|
177
|
+
│ │ │ └── locale-date-formats.ts # (i18n)
|
|
178
|
+
│ │ └── validators/ # (auth)
|
|
179
|
+
│ │ ├── index.ts
|
|
180
|
+
│ │ └── auth.ts
|
|
181
|
+
│ ├── apis/ # (auth)
|
|
182
|
+
│ │ ├── client/
|
|
183
|
+
│ │ └── server/
|
|
184
|
+
│ └── proxy.ts # (i18n or auth)
|
|
185
|
+
├── .env.local
|
|
186
|
+
├── .prettierrc
|
|
187
|
+
├── .husky/pre-commit # (husky)
|
|
188
|
+
├── components.json
|
|
189
|
+
├── eslint.config.mjs
|
|
190
|
+
├── next-intl.ts # (i18n)
|
|
191
|
+
└── next.config.ts
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## Error recovery
|
|
197
|
+
|
|
198
|
+
If any step fails during setup, the CLI **pauses and shows you the exact error**. Fix the issue then press **Enter** to retry that step — no need to restart from scratch.
|
|
199
|
+
|
|
200
|
+
---
|
|
42
201
|
|
|
43
202
|
## Requirements
|
|
44
203
|
|
|
45
|
-
- Node.js 18+
|
|
46
|
-
- npm
|
|
204
|
+
- **Node.js** 18+
|
|
205
|
+
- **Package manager** — npm · pnpm · bun · yarn
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Part of the Nexora family
|
|
210
|
+
|
|
211
|
+
| Package | Stack |
|
|
212
|
+
|---|---|
|
|
213
|
+
| `create-nexora-next` | Next.js |
|
|
214
|
+
| `create-nexora-go` | *(coming soon)* |
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Author
|
|
219
|
+
|
|
220
|
+
**Chiatiah Rayan** · [rayanstudio.dev](https://rayanstudio.dev) · [@bbrainttech](https://github.com/bbrainttech)
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
<div align="center">
|
|
225
|
+
|
|
226
|
+
Made with 🔥 by Rayan · MIT License
|
|
227
|
+
|
|
228
|
+
</div>
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -73,7 +73,7 @@ function printSummary(opts, projectName, pm) {
|
|
|
73
73
|
p.log.success(pc.bold(pc.green(` 🚀 ${projectName} is ready!`)))
|
|
74
74
|
console.log()
|
|
75
75
|
console.log(pc.bold(' What was set up:'))
|
|
76
|
-
console.log(row('Next.js
|
|
76
|
+
console.log(row('Next.js 16 + TypeScript + Tailwind + ESLint', true))
|
|
77
77
|
console.log(row('shadcn/ui + custom globals.css utilities', true))
|
|
78
78
|
console.log(row('Prettier + tailwind class sorting', true))
|
|
79
79
|
console.log(row('Poppins font + path alias ~/', true))
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
1
|
import fs from 'fs'
|
|
3
|
-
import
|
|
4
|
-
import { safeStep } from '../utils/safe-step.js'
|
|
2
|
+
import path from 'path'
|
|
5
3
|
import {
|
|
4
|
+
constantsTs,
|
|
6
5
|
envLocal,
|
|
7
|
-
|
|
6
|
+
eslintConfigMjs,
|
|
8
7
|
fontsTs,
|
|
9
|
-
|
|
10
|
-
utilsWithAxiosTs,
|
|
11
|
-
constantsTs,
|
|
12
|
-
seoTs,
|
|
13
|
-
seoWithLocaleTs,
|
|
14
|
-
sileoUiTsx,
|
|
15
|
-
sileoProviderTsx,
|
|
8
|
+
localeLayoutTs,
|
|
16
9
|
nuqsAdapterTsx,
|
|
10
|
+
prettierRc,
|
|
17
11
|
rootLayoutI18nTs,
|
|
18
12
|
rootLayoutTs,
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
seoTs,
|
|
14
|
+
seoWithLocaleTs,
|
|
15
|
+
sileoUiTsx,
|
|
21
16
|
sitemapTs,
|
|
17
|
+
utilsTs,
|
|
18
|
+
utilsWithAxiosTs
|
|
22
19
|
} from '../templates/files.js'
|
|
20
|
+
import { safeStep } from '../utils/safe-step.js'
|
|
21
|
+
import { mkdir, writeFile } from '../utils/writer.js'
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* @param {string} targetDir
|
|
@@ -56,8 +55,6 @@ export async function stepWriteBaseFiles(targetDir, opts) {
|
|
|
56
55
|
// src/components/ui/sileo.tsx
|
|
57
56
|
writeFile(p('src', 'components', 'ui', 'sileo.tsx'), sileoUiTsx)
|
|
58
57
|
|
|
59
|
-
// src/components/providers/sileo.provider.tsx
|
|
60
|
-
writeFile(p('src', 'components', 'providers', 'sileo.provider.tsx'), sileoProviderTsx)
|
|
61
58
|
|
|
62
59
|
// src/components/adapters/nuqs.adapter.tsx
|
|
63
60
|
writeFile(p('src', 'components', 'adapters', 'nuqs.adapter.tsx'), nuqsAdapterTsx)
|
|
@@ -17,7 +17,7 @@ export async function stepWriteProviders(targetDir, opts) {
|
|
|
17
17
|
await safeStep("Generating providers", () => {
|
|
18
18
|
const p = (...parts) => path.join(targetDir, ...parts);
|
|
19
19
|
|
|
20
|
-
// Dynamic providers/index.
|
|
20
|
+
// Dynamic providers/index.tsx
|
|
21
21
|
writeFile(
|
|
22
22
|
p("src", "components", "providers", "index.tsx"),
|
|
23
23
|
providersIndexTsx(opts),
|
package/src/templates/files.js
CHANGED
|
@@ -299,14 +299,6 @@ const SileoToaster = () => {
|
|
|
299
299
|
export { SileoToaster }
|
|
300
300
|
`
|
|
301
301
|
|
|
302
|
-
// ─── src/components/providers/sileo.provider.tsx ─────────────────────────────
|
|
303
|
-
export const sileoProviderTsx = `// Sileo root provider — wrap app-level providers here as needed
|
|
304
|
-
import type { PropsWithChildren } from 'react'
|
|
305
|
-
|
|
306
|
-
export default ({ children }: PropsWithChildren) => {
|
|
307
|
-
return <>{children}</>
|
|
308
|
-
}
|
|
309
|
-
`
|
|
310
302
|
|
|
311
303
|
// ─── src/components/providers/index.tsx (dynamic) ─────────────────────────────
|
|
312
304
|
export const providersIndexTsx = (opts) => {
|