@teispace/next-maker 1.11.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +196 -272
  3. package/dist/index.js +341 -223
  4. package/dist/index.js.map +4 -4
  5. package/dist/src/commands/component.d.ts +3 -0
  6. package/dist/src/commands/component.d.ts.map +1 -0
  7. package/dist/src/commands/feature.d.ts.map +1 -1
  8. package/dist/src/commands/hook.d.ts +3 -0
  9. package/dist/src/commands/hook.d.ts.map +1 -0
  10. package/dist/src/commands/index.d.ts.map +1 -1
  11. package/dist/src/commands/locale.d.ts +3 -0
  12. package/dist/src/commands/locale.d.ts.map +1 -0
  13. package/dist/src/commands/page.d.ts +3 -0
  14. package/dist/src/commands/page.d.ts.map +1 -0
  15. package/dist/src/commands/service.d.ts.map +1 -1
  16. package/dist/src/commands/slice.d.ts.map +1 -1
  17. package/dist/src/config/paths.d.ts +4 -0
  18. package/dist/src/config/paths.d.ts.map +1 -1
  19. package/dist/src/detection/existence.checker.d.ts +9 -0
  20. package/dist/src/detection/existence.checker.d.ts.map +1 -0
  21. package/dist/src/detection/index.d.ts +4 -0
  22. package/dist/src/detection/index.d.ts.map +1 -0
  23. package/dist/src/{services/feature/detection.service.d.ts → detection/project.detector.d.ts} +1 -2
  24. package/dist/src/detection/project.detector.d.ts.map +1 -0
  25. package/dist/src/generators/component.generator.d.ts +9 -0
  26. package/dist/src/generators/component.generator.d.ts.map +1 -0
  27. package/dist/src/generators/crud-service.generator.d.ts +6 -0
  28. package/dist/src/generators/crud-service.generator.d.ts.map +1 -0
  29. package/dist/src/generators/feature.generator.d.ts +7 -0
  30. package/dist/src/generators/feature.generator.d.ts.map +1 -0
  31. package/dist/src/generators/hook.generator.d.ts +8 -0
  32. package/dist/src/generators/hook.generator.d.ts.map +1 -0
  33. package/dist/src/generators/index.d.ts +14 -0
  34. package/dist/src/generators/index.d.ts.map +1 -0
  35. package/dist/src/generators/locale.generator.d.ts +10 -0
  36. package/dist/src/generators/locale.generator.d.ts.map +1 -0
  37. package/dist/src/generators/page.generator.d.ts +10 -0
  38. package/dist/src/generators/page.generator.d.ts.map +1 -0
  39. package/dist/src/generators/service.generator.d.ts +6 -0
  40. package/dist/src/generators/service.generator.d.ts.map +1 -0
  41. package/dist/src/generators/slice.generator.d.ts +11 -0
  42. package/dist/src/generators/slice.generator.d.ts.map +1 -0
  43. package/dist/src/generators/templates/barrel.template.d.ts +12 -0
  44. package/dist/src/generators/templates/barrel.template.d.ts.map +1 -0
  45. package/dist/src/generators/templates/component.template.d.ts +5 -0
  46. package/dist/src/generators/templates/component.template.d.ts.map +1 -0
  47. package/dist/src/generators/templates/crud-service.template.d.ts +10 -0
  48. package/dist/src/generators/templates/crud-service.template.d.ts.map +1 -0
  49. package/dist/src/generators/templates/custom-hook.template.d.ts +5 -0
  50. package/dist/src/generators/templates/custom-hook.template.d.ts.map +1 -0
  51. package/dist/src/generators/templates/hook.template.d.ts +9 -0
  52. package/dist/src/generators/templates/hook.template.d.ts.map +1 -0
  53. package/dist/src/generators/templates/page.template.d.ts +18 -0
  54. package/dist/src/generators/templates/page.template.d.ts.map +1 -0
  55. package/dist/src/generators/templates/persist.template.d.ts +6 -0
  56. package/dist/src/generators/templates/persist.template.d.ts.map +1 -0
  57. package/dist/src/generators/templates/selectors.template.d.ts +6 -0
  58. package/dist/src/generators/templates/selectors.template.d.ts.map +1 -0
  59. package/dist/src/generators/templates/service.template.d.ts +5 -0
  60. package/dist/src/generators/templates/service.template.d.ts.map +1 -0
  61. package/dist/src/generators/templates/shared-component.template.d.ts +10 -0
  62. package/dist/src/generators/templates/shared-component.template.d.ts.map +1 -0
  63. package/dist/src/generators/templates/slice.template.d.ts +6 -0
  64. package/dist/src/generators/templates/slice.template.d.ts.map +1 -0
  65. package/dist/src/generators/templates/types.template.d.ts +5 -0
  66. package/dist/src/generators/templates/types.template.d.ts.map +1 -0
  67. package/dist/src/generators/types.d.ts +19 -0
  68. package/dist/src/generators/types.d.ts.map +1 -0
  69. package/dist/src/modifiers/api-registration.modifier.d.ts +6 -0
  70. package/dist/src/modifiers/api-registration.modifier.d.ts.map +1 -0
  71. package/dist/src/modifiers/app-paths.modifier.d.ts +5 -0
  72. package/dist/src/modifiers/app-paths.modifier.d.ts.map +1 -0
  73. package/dist/src/modifiers/crud-api-registration.modifier.d.ts +5 -0
  74. package/dist/src/modifiers/crud-api-registration.modifier.d.ts.map +1 -0
  75. package/dist/src/modifiers/helpers.d.ts +14 -0
  76. package/dist/src/modifiers/helpers.d.ts.map +1 -0
  77. package/dist/src/modifiers/index.d.ts +7 -0
  78. package/dist/src/modifiers/index.d.ts.map +1 -0
  79. package/dist/src/modifiers/root-reducer.modifier.d.ts +7 -0
  80. package/dist/src/modifiers/root-reducer.modifier.d.ts.map +1 -0
  81. package/dist/src/modifiers/translation.modifier.d.ts +5 -0
  82. package/dist/src/modifiers/translation.modifier.d.ts.map +1 -0
  83. package/dist/src/modifiers/types.d.ts +15 -0
  84. package/dist/src/modifiers/types.d.ts.map +1 -0
  85. package/dist/src/pipelines/feature.pipeline.d.ts +14 -0
  86. package/dist/src/pipelines/feature.pipeline.d.ts.map +1 -0
  87. package/dist/src/pipelines/index.d.ts +9 -0
  88. package/dist/src/pipelines/index.d.ts.map +1 -0
  89. package/dist/src/pipelines/runner.d.ts +7 -0
  90. package/dist/src/pipelines/runner.d.ts.map +1 -0
  91. package/dist/src/pipelines/service.pipeline.d.ts +8 -0
  92. package/dist/src/pipelines/service.pipeline.d.ts.map +1 -0
  93. package/dist/src/pipelines/slice.pipeline.d.ts +9 -0
  94. package/dist/src/pipelines/slice.pipeline.d.ts.map +1 -0
  95. package/dist/src/pipelines/types.d.ts +12 -0
  96. package/dist/src/pipelines/types.d.ts.map +1 -0
  97. package/dist/src/prompts/component.prompt.d.ts +6 -0
  98. package/dist/src/prompts/component.prompt.d.ts.map +1 -0
  99. package/dist/src/prompts/hook.prompt.d.ts +5 -0
  100. package/dist/src/prompts/hook.prompt.d.ts.map +1 -0
  101. package/dist/src/prompts/locale.prompt.d.ts +9 -0
  102. package/dist/src/prompts/locale.prompt.d.ts.map +1 -0
  103. package/dist/src/prompts/page.prompt.d.ts +7 -0
  104. package/dist/src/prompts/page.prompt.d.ts.map +1 -0
  105. package/dist/src/services/init/cleanup/dark-mode.cleanup.d.ts +3 -0
  106. package/dist/src/services/init/cleanup/dark-mode.cleanup.d.ts.map +1 -0
  107. package/dist/src/services/init/cleanup/http.cleanup.d.ts +3 -0
  108. package/dist/src/services/init/cleanup/http.cleanup.d.ts.map +1 -0
  109. package/dist/src/services/init/cleanup/i18n.cleanup.d.ts +3 -0
  110. package/dist/src/services/init/cleanup/i18n.cleanup.d.ts.map +1 -0
  111. package/dist/src/services/init/cleanup/index.d.ts +3 -0
  112. package/dist/src/services/init/cleanup/index.d.ts.map +1 -0
  113. package/dist/src/services/init/cleanup/misc.cleanup.d.ts +13 -0
  114. package/dist/src/services/init/cleanup/misc.cleanup.d.ts.map +1 -0
  115. package/dist/src/services/init/cleanup/redux.cleanup.d.ts +3 -0
  116. package/dist/src/services/init/cleanup/redux.cleanup.d.ts.map +1 -0
  117. package/package.json +9 -7
  118. package/dist/src/services/common/api-registration.service.d.ts +0 -7
  119. package/dist/src/services/common/api-registration.service.d.ts.map +0 -1
  120. package/dist/src/services/feature/detection.service.d.ts.map +0 -1
  121. package/dist/src/services/feature/registration.service.d.ts +0 -6
  122. package/dist/src/services/feature/registration.service.d.ts.map +0 -1
  123. package/dist/src/services/feature/templates.service.d.ts +0 -11
  124. package/dist/src/services/feature/templates.service.d.ts.map +0 -1
  125. package/dist/src/services/init/cleanup.service.d.ts +0 -3
  126. package/dist/src/services/init/cleanup.service.d.ts.map +0 -1
  127. package/dist/src/services/service/detection.service.d.ts +0 -2
  128. package/dist/src/services/service/detection.service.d.ts.map +0 -1
  129. package/dist/src/services/service/service.service.d.ts +0 -8
  130. package/dist/src/services/service/service.service.d.ts.map +0 -1
  131. package/dist/src/services/slice/detection.service.d.ts +0 -2
  132. package/dist/src/services/slice/detection.service.d.ts.map +0 -1
  133. package/dist/src/services/slice/slice.service.d.ts +0 -7
  134. package/dist/src/services/slice/slice.service.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @teispace/next-maker
2
2
 
3
- A powerful CLI tool to scaffold Next.js applications with modern best practices and generate feature-based architecture components including Redux slices and API services.
3
+ A powerful CLI tool to scaffold Next.js applications with modern best practices and generate feature-based architecture components including pages, components, Redux slices, API services, and locales.
4
4
 
5
5
  ## Installation
6
6
 
@@ -31,31 +31,25 @@ npx @teispace/next-maker init [project-name]
31
31
 
32
32
  During initialization, you'll be prompted to configure:
33
33
 
34
- - 📦 **Package Manager** (npm, yarn, pnpm, bun)
35
- - 🔗 **GitHub Repository** (optional - configures remote origin)
36
- - 🌐 **HTTP Client** (axios, fetch, both, or none)
37
- - 🌙 **Dark Mode** (next-themes integration)
38
- - 🔄 **Redux Toolkit** (with redux-persist)
39
- - 🌍 **Internationalization** (next-intl)
40
- - 📋 **Community Files** (CODE_OF_CONDUCT, CONTRIBUTING, etc.)
41
- - 🐳 **Docker** support
42
- - 🔧 **CI/CD** configuration
43
- - 🎯 **Pre-commit hooks** (Husky)
34
+ - **Package Manager** (npm, yarn, pnpm, bun)
35
+ - **GitHub Repository** (optional - configures remote origin)
36
+ - **HTTP Client** (axios, fetch, both, or none)
37
+ - **Dark Mode** (next-themes integration)
38
+ - **Redux Toolkit** (with redux-persist)
39
+ - **Internationalization** (next-intl)
40
+ - **Community Files** (CODE_OF_CONDUCT, CONTRIBUTING, etc.)
41
+ - **Docker** support
42
+ - **CI/CD** configuration
43
+ - **Pre-commit hooks** (Husky)
44
44
 
45
45
  **Core Features:**
46
46
 
47
- - Next.js 16+ with App Router
48
- - 🔷 TypeScript (strict mode)
49
- - 🎨 Tailwind CSS v4
50
- - 📡 Result-based HTTP clients
51
- - 🏗️ Feature-based DDD architecture
52
- - 🎯 ESLint + Prettier configured
53
-
54
- **Example:**
55
-
56
- ```bash
57
- npx @teispace/next-maker init my-awesome-app
58
- ```
47
+ - Next.js 16+ with App Router
48
+ - TypeScript (strict mode)
49
+ - Tailwind CSS v4
50
+ - Result-based HTTP clients
51
+ - Feature-based DDD architecture
52
+ - ESLint + Prettier configured
59
53
 
60
54
  ---
61
55
 
@@ -74,73 +68,97 @@ npx @teispace/next-maker setup [options]
74
68
  - `--redux` - Setup Redux Toolkit with persistence
75
69
  - `--i18n` - Setup next-intl for internationalization
76
70
 
77
- **Features:**
78
-
79
- Each setup command:
80
-
81
- - ✅ Checks if already configured (exits gracefully)
82
- - 📁 Copies necessary files from template
83
- - 🔧 Updates configuration files
84
- - 📦 Installs required packages
85
- - 🔗 Integrates with existing providers
86
-
87
71
  **Examples:**
88
72
 
89
73
  ```bash
90
74
  # Interactive menu
91
75
  npx @teispace/next-maker setup
92
76
 
93
- # Add HTTP clients (Interactive)
77
+ # Add specific features
94
78
  npx @teispace/next-maker setup --http-client
95
-
96
- # Add dark mode
97
79
  npx @teispace/next-maker setup --dark-theme
98
-
99
- # Add Redux
100
80
  npx @teispace/next-maker setup --redux
101
-
102
- # Add internationalization
103
81
  npx @teispace/next-maker setup --i18n
104
82
  ```
105
83
 
106
- **What Gets Setup:**
84
+ ---
85
+
86
+ ### 3. Generate a Page
87
+
88
+ Create a new page/route with locale-aware boilerplate, SEO metadata, and optional loading/error states.
89
+
90
+ ```bash
91
+ npx @teispace/next-maker page <name> [options]
92
+ ```
93
+
94
+ **Options:**
95
+
96
+ - `--dynamic <param>` - Create dynamic route (e.g., `--dynamic id` creates `[id]/page.tsx`)
97
+ - `--loading` - Generate `loading.tsx`
98
+ - `--error` - Generate `error.tsx`
99
+
100
+ **What it generates:**
101
+
102
+ - `page.tsx` with full locale support (if i18n is set up), `generateMetadata`, `setRequestLocale`
103
+ - Registers route in `src/lib/config/app-paths.ts`
104
+ - Adds translation namespace to `en.json` (if i18n)
105
+ - Optional `loading.tsx` and `error.tsx`
106
+
107
+ **Examples:**
108
+
109
+ ```bash
110
+ # Simple page
111
+ npx @teispace/next-maker page about
112
+
113
+ # Page with loading and error states
114
+ npx @teispace/next-maker page dashboard --loading --error
115
+
116
+ # Dynamic route (e.g., /products/[id])
117
+ npx @teispace/next-maker page products --dynamic id --loading --error
118
+ ```
119
+
120
+ ---
121
+
122
+ ### 4. Generate a Component
123
+
124
+ Create a shared component with automatic barrel export wiring across all index files.
125
+
126
+ ```bash
127
+ npx @teispace/next-maker component <name> [options]
128
+ ```
129
+
130
+ **Options:**
107
131
 
108
- **HTTP Client:**
132
+ - `--client` - Add `'use client'` directive
133
+ - `--i18n` - Add `useTranslations` hook
134
+ - `--feature <path>` - Generate inside a feature directory
109
135
 
110
- - Copies axios-client and/or fetch-client to `src/lib/utils/http/`
111
- - Updates `src/lib/utils/http/index.ts` with exports
112
- - Installs axios package (if selected)
136
+ **Generated structure (shared):**
113
137
 
114
- **Dark Theme:**
138
+ ```
139
+ src/components/common/MyButton/
140
+ ├── MyButton.tsx
141
+ └── index.ts
142
+ ```
115
143
 
116
- - Copies `CustomThemeProvider.tsx` to `src/providers/`
117
- - Adds `@custom-variant dark` to `src/styles/globals.css`
118
- - Adds CSS variables `--color-dark` and `--color-light`
119
- - Updates layout.tsx with `bg-light dark:bg-dark` classes
120
- - Integrates with RootProvider
121
- - Installs next-themes package
144
+ Auto-updates `src/components/common/index.ts` and `src/components/index.ts`.
122
145
 
123
- **Redux Toolkit:**
146
+ **Examples:**
124
147
 
125
- - Copies store configuration to `src/store/`
126
- - Creates hooks, persistor, and rootReducer
127
- - Copies `StoreProvider.tsx` to `src/providers/`
128
- - Integrates with RootProvider
129
- - Installs @reduxjs/toolkit, react-redux, redux-persist
148
+ ```bash
149
+ # Shared component
150
+ npx @teispace/next-maker component data-table --client
130
151
 
131
- **Internationalization:**
152
+ # Component with i18n
153
+ npx @teispace/next-maker component nav-bar --client --i18n
132
154
 
133
- - Copies i18n directory (`routing.ts`, `request.ts`, `navigation.ts`, `translations/`)
134
- - Copies `types/i18n.ts` and `lib/config/app-locales.ts`
135
- - Creates/updates `src/proxy.ts` (middleware)
136
- - Updates `next.config.ts` with createNextIntlPlugin
137
- - Updates RootProvider with NextIntlClientProvider
138
- - Creates `[locale]` route structure
139
- - Installs next-intl package
155
+ # Feature-specific component
156
+ npx @teispace/next-maker component user-card --client --feature src/features/auth
157
+ ```
140
158
 
141
159
  ---
142
160
 
143
- ### 3. Generate a Feature Module
161
+ ### 5. Generate a Feature Module
144
162
 
145
163
  Create a complete feature module following Domain-Driven Design principles.
146
164
 
@@ -182,7 +200,7 @@ src/features/user-dashboard/
182
200
  # Full feature with Redux and API service
183
201
  npx @teispace/next-maker feature user-profile --store persist --service axios
184
202
 
185
- # Feature with Redux only (no persistence)
203
+ # Feature with Redux only
186
204
  npx @teispace/next-maker feature shopping-cart --store no-persist --skip-service
187
205
 
188
206
  # Feature in custom location
@@ -191,7 +209,7 @@ npx @teispace/next-maker feature auth --store persist --service fetch --path src
191
209
 
192
210
  ---
193
211
 
194
- ### 4. Generate a Redux Slice
212
+ ### 6. Generate a Redux Slice
195
213
 
196
214
  Create a Redux Toolkit slice with persistence support.
197
215
 
@@ -205,18 +223,7 @@ npx @teispace/next-maker slice <name> [options]
205
223
  - `--no-persist` - Disable persistence
206
224
  - `--path <path>` - Custom path (default: create new feature)
207
225
 
208
- **Generated structure:**
209
-
210
- ```
211
- src/features/auth/store/auth/
212
- ├── auth.slice.ts
213
- ├── auth.selectors.ts
214
- ├── auth.types.ts
215
- ├── persist.ts (optional)
216
- └── index.ts
217
- ```
218
-
219
- **Auto-registers in rootReducer** with correct imports!
226
+ **Auto-registers in rootReducer** with correct imports.
220
227
 
221
228
  **Examples:**
222
229
 
@@ -226,16 +233,13 @@ npx @teispace/next-maker slice auth --persist
226
233
 
227
234
  # Add slice to existing feature
228
235
  npx @teispace/next-maker slice user-settings --path features/auth/store
229
-
230
- # Slice in custom location
231
- npx @teispace/next-maker slice theme --no-persist --path src/store/slices
232
236
  ```
233
237
 
234
238
  ---
235
239
 
236
- ### 5. Generate an API Service
240
+ ### 7. Generate an API Service
237
241
 
238
- Create an API service with HTTP client integration.
242
+ Create an API service with HTTP client integration. Supports both simple and full CRUD generation.
239
243
 
240
244
  ```bash
241
245
  npx @teispace/next-maker service <name> [options]
@@ -245,66 +249,82 @@ npx @teispace/next-maker service <name> [options]
245
249
 
246
250
  - `--axios` - Use AxiosClient
247
251
  - `--fetch` - Use FetchClient
252
+ - `--crud` - Generate full CRUD service (getAll, getById, create, update, delete)
248
253
  - `--path <path>` - Custom path (default: create new feature)
249
254
 
250
- **Generated structure:**
255
+ **CRUD mode** generates:
251
256
 
252
- ```
253
- src/features/payment/services/
254
- └── payment.service.ts
255
- ```
256
-
257
- **Validates HTTP client setup** before generation!
257
+ - Service with 5 methods: `getAll`, `getById`, `create`, `update`, `delete`
258
+ - DTO types: `Create<Name>Dto`, `Update<Name>Dto`, `<Name>` response interface
259
+ - Full API config with dynamic routes (`getById(id)`, `update(id)`, `delete(id)`)
258
260
 
259
261
  **Examples:**
260
262
 
261
263
  ```bash
262
- # Create new feature with service
264
+ # Simple service
263
265
  npx @teispace/next-maker service payment --axios
264
266
 
265
- # Add service to existing feature
266
- npx @teispace/next-maker service user --fetch --path features/auth/services
267
+ # Full CRUD service with types and endpoints
268
+ npx @teispace/next-maker service users --fetch --crud
267
269
 
268
- # Service in custom location
269
- npx @teispace/next-maker service analytics --axios --path src/api/services
270
+ # CRUD service in existing feature
271
+ npx @teispace/next-maker service orders --axios --crud --path features/products/services
270
272
  ```
271
273
 
272
274
  ---
273
275
 
274
- ## Usage Examples
276
+ ### 8. Add a Locale
275
277
 
276
- ### Quick Start - New Project
278
+ Add a new language/locale to your internationalized project.
277
279
 
278
280
  ```bash
279
- # Create a new Next.js app with interactive setup
280
- npx @teispace/next-maker my-project
281
+ npx @teispace/next-maker locale [code] [options]
282
+ ```
281
283
 
282
- # Navigate to the project
283
- cd my-project
284
+ **Options:**
284
285
 
285
- # Generate your first feature
286
- npx @teispace/next-maker feature auth --store persist --service axios
286
+ - `--copy-translations` - Copy English translations instead of empty values
287
287
 
288
- # Start development server
289
- npm run dev
288
+ **What it does:**
289
+
290
+ - Creates `src/i18n/translations/<code>.json` (empty or copied from English)
291
+ - Updates `SupportedLocale` type in `src/types/i18n.ts`
292
+ - Adds entry to `src/lib/config/app-locales.ts` with name, flag, country
293
+
294
+ **Examples:**
295
+
296
+ ```bash
297
+ # Add Spanish (interactive prompts for name, country, flag)
298
+ npx @teispace/next-maker locale es
299
+
300
+ # Add French with English translations as starting point
301
+ npx @teispace/next-maker locale fr --copy-translations
290
302
  ```
291
303
 
292
- ### Setup Existing Project
304
+ ---
305
+
306
+ ## Usage Examples
307
+
308
+ ### Quick Start - New Project
293
309
 
294
310
  ```bash
295
- # Add features to existing Next.js project
311
+ # Create a new Next.js app with interactive setup
312
+ npx @teispace/next-maker init my-project
313
+ cd my-project
296
314
 
297
- # Add HTTP clients if you initially selected 'none'
298
- npx @teispace/next-maker setup --http-client
315
+ # Generate pages
316
+ npx @teispace/next-maker page dashboard --loading --error
317
+ npx @teispace/next-maker page settings --loading
299
318
 
300
- # Add dark mode support
301
- npx @teispace/next-maker setup --dark-theme
319
+ # Generate features with CRUD
320
+ npx @teispace/next-maker feature users --store persist --service fetch
321
+ npx @teispace/next-maker service users --fetch --crud --path features/users/services
302
322
 
303
- # Add Redux state management
304
- npx @teispace/next-maker setup --redux
323
+ # Add a locale
324
+ npx @teispace/next-maker locale es
305
325
 
306
- # Add internationalization
307
- npx @teispace/next-maker setup --i18n
326
+ # Start development
327
+ npm run dev
308
328
  ```
309
329
 
310
330
  ### Feature-Based Development
@@ -312,152 +332,81 @@ npx @teispace/next-maker setup --i18n
312
332
  ```bash
313
333
  # E-commerce example
314
334
  npx @teispace/next-maker feature products --store persist --service axios
315
- npx @teispace/next-maker feature cart --store persist --skip-service
316
- npx @teispace/next-maker slice checkout --path features/cart/store
317
- npx @teispace/next-maker service orders --axios --path features/products/services
335
+ npx @teispace/next-maker service products --axios --crud --path features/products/services
336
+ npx @teispace/next-maker page products --dynamic id --loading --error
337
+ npx @teispace/next-maker component product-card --client --feature src/features/products
318
338
 
319
- # Dashboard example
320
- npx @teispace/next-maker feature dashboard --store no-persist --service fetch
321
- npx @teispace/next-maker slice analytics --path features/dashboard/store
322
- npx @teispace/next-maker service metrics --fetch --path features/dashboard/services
339
+ npx @teispace/next-maker feature cart --store persist --skip-service
340
+ npx @teispace/next-maker page checkout --loading --error
323
341
  ```
324
342
 
325
343
  ### Get Help
326
344
 
327
345
  ```bash
328
- # General help
329
346
  npx @teispace/next-maker --help
330
-
331
- # Command-specific help
332
- npx @teispace/next-maker init --help
333
- npx @teispace/next-maker setup --help
334
- npx @teispace/next-maker feature --help
335
- npx @teispace/next-maker slice --help
336
- npx @teispace/next-maker service --help
347
+ npx @teispace/next-maker page --help
348
+ npx @teispace/next-maker component --help
349
+ npx @teispace/next-maker locale --help
337
350
  ```
338
351
 
339
352
  ---
340
353
 
341
354
  ## Key Features
342
355
 
343
- ### 🚀 Post-Installation Setup
356
+ ### Pages with Full Locale Support
344
357
 
345
- Add features to your project anytime with the `setup` command:
358
+ Auto-generates `generateMetadata`, `setRequestLocale`, typed Props, SEO metadata, and translation namespace. Supports dynamic routes with `--dynamic`.
346
359
 
347
- - HTTP clients (axios/fetch) even if you initially chose "none"
348
- - Dark theme with automatic CSS and layout updates
349
- - Redux Toolkit with complete store configuration
350
- - Internationalization with routing and middleware
351
- - Smart detection prevents duplicate setups
352
- - Automatic package installation
360
+ ### Shared Components with Auto-Wiring
353
361
 
354
- ### 🏗️ Feature-First Architecture
362
+ Creates component in `src/components/common/<Name>/` and auto-updates all barrel exports so you can immediately `import { MyComponent } from '@/components'`.
355
363
 
356
- All generators follow a feature-based DDD approach by default, organizing code by business domain rather than technical layers.
364
+ ### CRUD Service Generation
357
365
 
358
- ### 🔄 Smart Redux Integration
366
+ `--crud` flag generates a complete service with 5 REST methods, typed DTOs, and full API config with dynamic route helpers.
359
367
 
360
- - Auto-registers slices in `rootReducer`
361
- - Correct import paths for any custom location
362
- - Optional redux-persist configuration
363
- - Demo actions included (setLoading, setError, resetState)
364
- - Can be added post-initialization via `setup --redux`
368
+ ### Locale Management
365
369
 
366
- ### 📡 HTTP Client Support
370
+ One command adds a new language: translation file, type update, and config entry. No manual file editing.
367
371
 
368
- - **AxiosClient**: Result-based error handling with `isOk()/isErr()`
369
- - **FetchClient**: Same Result pattern with native fetch
370
- - Auto-detects available clients
371
- - Type-safe API calls with generics
372
- - Can be added later via `setup --http-client`
372
+ ### Feature-First Architecture
373
373
 
374
- ### 🌙 Dark Mode Support
374
+ All generators follow a feature-based DDD approach, organizing code by business domain rather than technical layers.
375
375
 
376
- - next-themes integration with CustomThemeProvider
377
- - Automatic CSS variable setup (`--color-dark`, `--color-light`)
378
- - Tailwind CSS v4 custom variant (`@custom-variant dark`)
379
- - Layout className updates (`bg-light dark:bg-dark`)
380
- - Can be added via `setup --dark-theme`
376
+ ### Smart Redux Integration
381
377
 
382
- ### 🌍 Internationalization
378
+ Auto-registers slices in `rootReducer` with correct import paths and optional redux-persist configuration.
383
379
 
384
- - next-intl with routing middleware
385
- - Translation management system
386
- - Locale type safety
387
- - [locale] route structure
388
- - Can be added via `setup --i18n`
380
+ ### HTTP Client Support
389
381
 
390
- ### 🎯 Intelligent Path Handling
382
+ - **AxiosClient**: Result-based error handling
383
+ - **FetchClient**: Same Result pattern with native fetch
384
+ - Auto-detects available clients
391
385
 
392
- All commands support `--path` for custom locations:
386
+ ### Intelligent Path Handling
393
387
 
394
- - Relative: `features/auth` `src/features/auth`
395
- - Absolute: `src/modules/auth` → `src/modules/auth`
396
- - Auto-creates directory structure
397
- - Adapts imports based on location
388
+ All commands support `--path` for custom locations. Relative paths like `features/auth` are resolved to `src/features/auth`.
398
389
 
399
- ### Built-in Validations
390
+ ### Built-in Validations
400
391
 
401
- - Checks for required dependencies (Redux, HTTP clients)
402
- - Prevents duplicate generation and setups
392
+ - Checks for required dependencies (Redux, HTTP clients, i18n)
393
+ - Prevents duplicate generation
403
394
  - Validates naming conventions (kebab-case)
404
- - Ensures consistent project structure
405
- - Validates GitHub repository URLs
406
395
 
407
396
  ---
408
397
 
409
398
  ## Command Reference
410
399
 
411
- ### Generator Options (feature, slice, service)
412
-
413
- These commands support:
414
-
415
- - `[name]` - Resource name (kebab-case, prompted if omitted)
416
- - `--path <path>` - Custom generation path
417
- - `--help` - Show command help
418
-
419
- ### Init/App Options
420
-
421
- Interactive prompts guide you through:
422
-
423
- - Project name, description, version
424
- - Package manager selection
425
- - GitHub repository (optional)
426
- - HTTP client selection
427
- - Dark mode, Redux, i18n toggles
428
- - Docker, CI/CD, pre-commit hooks
429
-
430
- ### Setup Options
431
-
432
- ```bash
433
- --http-client <type> # Setup HTTP client (axios|fetch|both)
434
- --dark-theme # Setup dark theme support
435
- --redux # Setup Redux Toolkit
436
- --i18n # Setup internationalization
437
- ```
438
-
439
- ### Feature Options
440
-
441
- ```bash
442
- --store <persist|no-persist> # Generate Redux store
443
- --skip-store # Don't generate store
444
- --service <axios|fetch> # Generate API service
445
- --skip-service # Don't generate service
446
- ```
447
-
448
- ### Slice Options
449
-
450
- ```bash
451
- --persist # Enable redux-persist
452
- --no-persist # Disable persistence
453
- ```
454
-
455
- ### Service Options
456
-
457
- ```bash
458
- --axios # Use AxiosClient
459
- --fetch # Use FetchClient
460
- ```
400
+ | Command | Description |
401
+ | ------------------ | -------------------------------- |
402
+ | `init [name]` | Create a new Next.js application |
403
+ | `setup` | Add features to existing project |
404
+ | `page <name>` | Generate a new page/route |
405
+ | `component <name>` | Generate a shared component |
406
+ | `feature <name>` | Generate a feature module |
407
+ | `slice <name>` | Generate a Redux slice |
408
+ | `service <name>` | Generate an API service |
409
+ | `locale [code]` | Add a new locale/language |
461
410
 
462
411
  ---
463
412
 
@@ -469,6 +418,7 @@ Generated apps follow this structure:
469
418
  my-project/
470
419
  ├── src/
471
420
  │ ├── app/ # Next.js App Router
421
+ │ │ └── [locale]/ # Locale-aware routes (if i18n)
472
422
  │ ├── features/ # Feature modules (DDD)
473
423
  │ │ └── counter/
474
424
  │ │ ├── components/
@@ -477,21 +427,18 @@ my-project/
477
427
  │ │ ├── types/
478
428
  │ │ └── index.ts
479
429
  │ ├── components/ # Shared components
430
+ │ │ └── common/ # Reusable UI components
480
431
  │ ├── lib/
481
432
  │ │ ├── config/ # App configuration
482
433
  │ │ ├── utils/
483
434
  │ │ │ └── http/ # AxiosClient & FetchClient
484
- │ │ ├── errors/ # Error classes
485
- │ │ └── validations/ # Validation schemas
435
+ │ │ └── errors/ # Error classes
486
436
  │ ├── providers/ # React providers
487
437
  │ ├── store/ # Redux store setup
488
- │ ├── services/ # Global services
489
438
  │ ├── i18n/ # Internationalization
439
+ │ │ └── translations/ # Translation files
490
440
  │ └── styles/ # Global styles
491
441
  ├── public/ # Static assets
492
- ├── .husky/ # Git hooks
493
- ├── Dockerfile
494
- ├── docker-compose.yml
495
442
  └── package.json
496
443
  ```
497
444
 
@@ -501,20 +448,11 @@ my-project/
501
448
 
502
449
  **CLI:**
503
450
 
504
- - TypeScript - Type-safe development
505
- - esbuild - Fast bundling
506
- - Commander.js - CLI framework
507
- - Enquirer - Interactive prompts
451
+ - TypeScript, esbuild, Commander.js, Enquirer, Vitest
508
452
 
509
453
  **Generated Apps:**
510
454
 
511
- - Next.js 16+ - React framework
512
- - TypeScript - Static typing
513
- - Redux Toolkit - State management
514
- - Tailwind CSS v4 - Styling
515
- - next-intl - Internationalization
516
- - Axios - HTTP client
517
- - ESLint + Prettier - Code quality
455
+ - Next.js 16+, TypeScript, Redux Toolkit, Tailwind CSS v4, next-intl, Axios, ESLint + Prettier
518
456
 
519
457
  ---
520
458
 
@@ -525,46 +463,32 @@ my-project/
525
463
  ```bash
526
464
  git clone <repository-url>
527
465
  cd npm-packages/packages/next-maker
528
- yarn install
466
+ npm install
529
467
  ```
530
468
 
531
469
  ### Build
532
470
 
533
471
  ```bash
534
- yarn build
472
+ npm run build
535
473
  ```
536
474
 
537
- ### Test Locally
475
+ ### Test
538
476
 
539
477
  ```bash
540
- # Test app generation
541
- node dist/index.js init test-project
542
-
543
- # Navigate to test project
544
- cd test-project
545
-
546
- # Test setup commands
547
- node ../dist/index.js setup --http-client
548
- node ../dist/index.js setup --dark-theme
549
- node ../dist/index.js setup --redux
550
- node ../dist/index.js setup --i18n
551
-
552
- # Test feature generation
553
- node ../dist/index.js feature auth --store persist --service axios
554
-
555
- # Test slice generation
556
- node ../dist/index.js slice user-profile --persist
557
-
558
- # Test service generation
559
- node ../dist/index.js service payment --axios
478
+ npm test
479
+ npm run test:watch
560
480
  ```
561
481
 
562
- ### Link for Global Testing
482
+ ### Test Locally
563
483
 
564
484
  ```bash
565
- npm link
566
- next-maker feature my-feature
567
- npm unlink -g
485
+ node dist/index.js init test-project
486
+ cd test-project
487
+ node ../dist/index.js page dashboard --loading --error
488
+ node ../dist/index.js component sidebar --client
489
+ node ../dist/index.js feature auth --store persist --service axios
490
+ node ../dist/index.js service users --fetch --crud
491
+ node ../dist/index.js locale es
568
492
  ```
569
493
 
570
494
  ---