nextjs-cms 0.7.1 → 0.7.2

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 (35) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +290 -290
  3. package/dist/cli/lib/db-config.js +10 -10
  4. package/dist/core/config/loader-with-jiti.d.ts.map +1 -1
  5. package/dist/core/config/loader-with-jiti.js +19 -15
  6. package/dist/core/db/table-checker/MysqlTable.js +8 -8
  7. package/dist/core/factories/section-factory-with-esbuild.d.ts.map +1 -1
  8. package/dist/core/factories/section-factory-with-esbuild.js +23 -9
  9. package/dist/core/factories/section-factory-with-jiti.d.ts.map +1 -1
  10. package/dist/core/factories/section-factory-with-jiti.js +51 -33
  11. package/dist/core/factories/section-name-validation.d.ts +10 -0
  12. package/dist/core/factories/section-name-validation.d.ts.map +1 -0
  13. package/dist/core/factories/section-name-validation.js +31 -0
  14. package/dist/core/sections/category.d.ts +36 -36
  15. package/dist/core/sections/category.d.ts.map +1 -1
  16. package/dist/core/sections/category.js +6 -1
  17. package/dist/core/sections/hasItems.d.ts +36 -36
  18. package/dist/core/sections/hasItems.d.ts.map +1 -1
  19. package/dist/core/sections/hasItems.js +6 -11
  20. package/dist/core/sections/section.d.ts +25 -18
  21. package/dist/core/sections/section.d.ts.map +1 -1
  22. package/dist/core/sections/section.js +34 -0
  23. package/dist/core/sections/simple.d.ts +6 -6
  24. package/dist/core/sections/simple.d.ts.map +1 -1
  25. package/dist/core/sections/simple.js +6 -1
  26. package/dist/core/submit/submit.js +1 -1
  27. package/dist/translations/client.d.ts +4 -4
  28. package/dist/translations/server.d.ts +4 -4
  29. package/package.json +1 -1
  30. package/dist/translations/dictionaries/ar.d.ts +0 -433
  31. package/dist/translations/dictionaries/ar.d.ts.map +0 -1
  32. package/dist/translations/dictionaries/ar.js +0 -444
  33. package/dist/translations/dictionaries/en.d.ts +0 -433
  34. package/dist/translations/dictionaries/en.d.ts.map +0 -1
  35. package/dist/translations/dictionaries/en.js +0 -444
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 nextjs-cms
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 nextjs-cms
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 CHANGED
@@ -1,291 +1,291 @@
1
- # nextjs-cms
2
-
3
- A headless and comprehensive type-safe content management system built with Nextjs. This package provides all the core functionality for building dynamic CMS-powered websites with authentication, database integration, and extensible content sections.
4
-
5
- ## Features
6
-
7
- - **Type-Safe API**: Built with tRPC for end-to-end type safety
8
- - **Authentication System**: JWT-based authentication with React hooks
9
- - **Database Integration**: Drizzle ORM with MySQL support
10
- - **Extensible Content Sections**: Modular section system with custom fields
11
- - **File Management**: Built-in file upload and management capabilities
12
- - **Internationalization**: Multi-language support with i18next
13
- - **Validation**: Zod schema validation throughout
14
- - **Testing**: Comprehensive unit and integration tests
15
-
16
- ## Installation
17
-
18
- Please install using the create-nextjs-cms package:
19
-
20
- ```bash
21
- npx create-nextjs-cms
22
- # or
23
- yarn create nextjs-cms
24
- # or
25
- pnpm create nextjs-cms
26
- # or
27
- bun create nextjs-cms
28
- ```
29
-
30
- ## Quick Start
31
-
32
- ### 1. Configure Your CMS
33
-
34
- Create a `cms.config.ts` file in your project root:
35
-
36
- ```typescript
37
- import { CMSConfig } from 'nextjs-cms/core/config'
38
-
39
- export default {
40
- ui: {
41
- title: 'My CMS Site',
42
- defaultTheme: 'dark',
43
- logo: '/logo.svg'
44
- },
45
- sections: {
46
- path: './sections',
47
- strict: false,
48
- category: { allowRecursiveDelete: false }
49
- },
50
- media: {
51
- upload: {
52
- path: './public/uploads',
53
- preserveExtension: true
54
- }
55
- }
56
- } satisfies CMSConfig
57
- ```
58
-
59
-
60
- ### 2. Create Content Sections
61
-
62
- Create a section file in your sections folder. Sections are created using helper functions (`simpleSection`, `hasItemsSection`, or `categorySection`), and fields are created using field helper functions.
63
-
64
- #### Simple Section Example
65
-
66
- ```typescript
67
- // sections/about.section.ts
68
- import { richTextField } from 'nextjs-cms/core/fields'
69
- import { simpleSection } from 'nextjs-cms/core/sections'
70
-
71
- const about = richTextField({
72
- name: 'about',
73
- label: 'About',
74
- required: true,
75
- order: 1,
76
- })
77
-
78
- export default simpleSection({
79
- name: 'about',
80
- order: 1,
81
- title: 'About Page',
82
- db: {
83
- table: 'about',
84
- },
85
- fields: [about],
86
- })
87
- ```
88
-
89
- #### Has Items Section Example
90
-
91
- ```typescript
92
- // sections/blog.section.ts
93
- import { textField, richTextField, dateField, photoField } from 'nextjs-cms/core/fields'
94
- import { hasItemsSection } from 'nextjs-cms/core/sections'
95
-
96
- const title = textField({
97
- name: 'title',
98
- label: 'Title',
99
- required: true,
100
- order: 1,
101
- })
102
-
103
- const content = richTextField({
104
- name: 'content',
105
- label: 'Content',
106
- required: true,
107
- order: 2,
108
- })
109
-
110
- const publishDate = dateField({
111
- name: 'publish_date',
112
- label: 'Publish Date',
113
- required: false,
114
- order: 3,
115
- })
116
-
117
- const coverPhoto = photoField({
118
- name: 'coverphoto',
119
- label: 'Cover Photo',
120
- required: false,
121
- order: 4,
122
- })
123
-
124
- export default hasItemsSection({
125
- name: 'blog',
126
- order: 1,
127
- headingField: title,
128
- title: {
129
- section: 'Blog',
130
- singular: 'Post',
131
- plural: 'Posts',
132
- },
133
- db: {
134
- table: 'blog',
135
- },
136
- fields: [title, content, publishDate, coverPhoto],
137
- })
138
- ```
139
-
140
- #### Category Section Example
141
-
142
- ```typescript
143
- // sections/categories.section.ts
144
- import { textField, photoField } from 'nextjs-cms/core/fields'
145
- import { categorySection } from 'nextjs-cms/core/sections'
146
-
147
- const title = textField({
148
- name: 'title',
149
- label: 'Title',
150
- required: true,
151
- order: 1,
152
- })
153
-
154
- const image = photoField({
155
- name: 'image',
156
- label: 'Image',
157
- required: false,
158
- order: 2,
159
- })
160
-
161
- export default categorySection({
162
- name: 'categories',
163
- order: 1,
164
- headingField: title,
165
- title: {
166
- section: 'Categories',
167
- singular: 'Category',
168
- plural: 'Categories',
169
- },
170
- db: {
171
- table: 'categories',
172
- },
173
- fields: [title, image],
174
- depth: 2, // Allow nested categories
175
- })
176
- ```
177
-
178
- ## API Reference
179
-
180
- ### Core Modules
181
-
182
- #### API (`nextjs-cms/api`)
183
- - **appRouter**: Main tRPC router with all CMS endpoints
184
- - **createCaller**: Server-side API caller factory
185
- - **createTRPCContext**: Context factory for tRPC requests
186
-
187
- #### Authentication (`nextjs-cms/auth`)
188
- - **JWT Management**: Token creation, verification, and refresh
189
- - **React Hooks**: `useAxiosPrivate`, `useRefreshToken`
190
- - **Server Actions**: Authentication utilities for server components
191
-
192
- #### Core (`nextjs-cms/core`)
193
- - **Config**: CMS configuration management (`CMSConfig`)
194
- - **Fields**: Content field helper functions (`textField`, `richTextField`, `dateField`, `photoField`, etc.)
195
- - **Sections**: Section helper functions (`simpleSection`, `hasItemsSection`, `categorySection`)
196
- - **Submit**: Form submission handlers (`SimpleSectionSubmit`)
197
- - **Factories**: Section factory for loading sections (`SectionFactory`)
198
-
199
- #### Database (`nextjs-cms/db`)
200
- - **Client**: Database connection and query utilities
201
- - **Schema**: Database schema definitions
202
- - **Migrations**: Drizzle migration helpers
203
-
204
- #### Validators (`nextjs-cms/validators`)
205
- Zod validators for all field types:
206
- - Text fields, numbers, dates
207
- - File uploads (images, documents, videos)
208
- - Rich text content
209
- - Select fields and checkboxes
210
-
211
- #### Translations (`nextjs-cms/translations`)
212
- - Multi-language support
213
- - Dictionary management
214
- - i18next integration
215
-
216
- ## Field Types
217
-
218
- The CMS supports various field types out of the box. Each field is created using a helper function that accepts a configuration object:
219
-
220
- - **Text**: `textField({ name, label, required, order, ... })` - Single-line text input
221
- - **TextArea**: `textAreaField({ name, label, required, order, ... })` - Multi-line text input
222
- - **RichText**: `richTextField({ name, label, required, order, ... })` - Rich text editor (TinyMCE)
223
- - **Number**: `numberField({ name, label, required, order, ... })` - Numeric input
224
- - **Date**: `dateField({ name, label, required, order, ... })` - Date picker
225
- - **Select**: `selectField({ name, label, required, order, options, ... })` - Dropdown selection
226
- - **SelectMultiple**: `selectMultipleField({ name, label, required, order, ... })` - Multi-select field
227
- - **Checkbox**: `checkboxField({ name, label, required, order, ... })` - Boolean checkbox
228
- - **Photo**: `photoField({ name, label, required, order, size, thumbnail, ... })` - Image upload
229
- - **Video**: `videoField({ name, label, required, order, ... })` - Video file upload
230
- - **Document**: `documentField({ name, label, required, order, type, ... })` - Document file upload
231
- - **Color**: `colorField({ name, label, required, order, ... })` - Color picker
232
- - **Map**: `mapField({ name, label, required, order, ... })` - Location/map field
233
- - **Tags**: `tagsField({ name, label, required, order, ... })` - Tag input field
234
- - **Password**: `passwordField({ name, label, required, order, ... })` - Password input
235
- - **FieldGroup**: `fieldGroup({ title, order, fields })` - Group multiple fields together
236
-
237
- ### Field Configuration
238
-
239
- All fields require at minimum:
240
- - `name`: string - Unique field identifier (used in database)
241
- - `label`: string - Display label for the field
242
- - `required`: boolean - Whether the field is required
243
- - `order`: number - Display order of the field
244
-
245
- Additional options vary by field type. See the API documentation for each field type for complete configuration options.
246
-
247
- ## Section Types
248
-
249
- ### Simple Section
250
- Basic content sections with a single record. Use `simpleSection()` for pages like "About", "Contact", or "Settings" that have only one instance.
251
-
252
- **Key characteristics:**
253
- - Single record (always has ID = 1)
254
- - No listing/browse page
255
- - Direct edit page
256
- - Requires `title` property
257
-
258
- **Example use cases:** About page, Privacy Policy, Site Settings
259
-
260
- ### Has Items Section
261
- Sections that can contain multiple items. Use `hasItemsSection()` for collections like blog posts, products, or articles.
262
-
263
- **Key characteristics:**
264
- - Multiple records
265
- - Browse/listing page with pagination
266
- - Individual item pages
267
- - Requires `headingField` and `title` object with `section`, `singular`, and `plural` properties
268
- - Optional `coverPhotoField`, `search`, and `gallery` configuration
269
-
270
- **Example use cases:** Blog posts, Products, News articles, Events
271
-
272
- ### Category Section
273
- Sections organized by categories with hierarchical structure. Use `categorySection()` for nested category systems.
274
-
275
- **Key characteristics:**
276
- - Hierarchical structure (configurable depth)
277
- - Parent-child relationships
278
- - Requires `headingField` and `title` object
279
- - Optional `depth` property (default: 1, no nesting)
280
- - Automatically adds `parent_id` and `level` fields when depth > 1
281
-
282
- **Example use cases:** Product categories, Content categories, Navigation menus
283
-
284
-
285
- ## Contributing
286
-
287
- Contributions are welcome! Please read our contributing guidelines and submit pull requests to the main repository.
288
-
289
- ## License
290
-
1
+ # nextjs-cms
2
+
3
+ A headless and comprehensive type-safe content management system built with Nextjs. This package provides all the core functionality for building dynamic CMS-powered websites with authentication, database integration, and extensible content sections.
4
+
5
+ ## Features
6
+
7
+ - **Type-Safe API**: Built with tRPC for end-to-end type safety
8
+ - **Authentication System**: JWT-based authentication with React hooks
9
+ - **Database Integration**: Drizzle ORM with MySQL support
10
+ - **Extensible Content Sections**: Modular section system with custom fields
11
+ - **File Management**: Built-in file upload and management capabilities
12
+ - **Internationalization**: Multi-language support with i18next
13
+ - **Validation**: Zod schema validation throughout
14
+ - **Testing**: Comprehensive unit and integration tests
15
+
16
+ ## Installation
17
+
18
+ Please install using the create-nextjs-cms package:
19
+
20
+ ```bash
21
+ npx create-nextjs-cms
22
+ # or
23
+ yarn create nextjs-cms
24
+ # or
25
+ pnpm create nextjs-cms
26
+ # or
27
+ bun create nextjs-cms
28
+ ```
29
+
30
+ ## Quick Start
31
+
32
+ ### 1. Configure Your CMS
33
+
34
+ Create a `cms.config.ts` file in your project root:
35
+
36
+ ```typescript
37
+ import { CMSConfig } from 'nextjs-cms/core/config'
38
+
39
+ export default {
40
+ ui: {
41
+ title: 'My CMS Site',
42
+ defaultTheme: 'dark',
43
+ logo: '/logo.svg'
44
+ },
45
+ sections: {
46
+ path: './sections',
47
+ strict: false,
48
+ category: { allowRecursiveDelete: false }
49
+ },
50
+ media: {
51
+ upload: {
52
+ path: './public/uploads',
53
+ preserveExtension: true
54
+ }
55
+ }
56
+ } satisfies CMSConfig
57
+ ```
58
+
59
+
60
+ ### 2. Create Content Sections
61
+
62
+ Create a section file in your sections folder. Sections are created using helper functions (`simpleSection`, `hasItemsSection`, or `categorySection`), and fields are created using field helper functions.
63
+
64
+ #### Simple Section Example
65
+
66
+ ```typescript
67
+ // sections/about.section.ts
68
+ import { richTextField } from 'nextjs-cms/core/fields'
69
+ import { simpleSection } from 'nextjs-cms/core/sections'
70
+
71
+ const about = richTextField({
72
+ name: 'about',
73
+ label: 'About',
74
+ required: true,
75
+ order: 1,
76
+ })
77
+
78
+ export default simpleSection({
79
+ name: 'about',
80
+ order: 1,
81
+ title: 'About Page',
82
+ db: {
83
+ table: 'about',
84
+ },
85
+ fields: [about],
86
+ })
87
+ ```
88
+
89
+ #### Has Items Section Example
90
+
91
+ ```typescript
92
+ // sections/blog.section.ts
93
+ import { textField, richTextField, dateField, photoField } from 'nextjs-cms/core/fields'
94
+ import { hasItemsSection } from 'nextjs-cms/core/sections'
95
+
96
+ const title = textField({
97
+ name: 'title',
98
+ label: 'Title',
99
+ required: true,
100
+ order: 1,
101
+ })
102
+
103
+ const content = richTextField({
104
+ name: 'content',
105
+ label: 'Content',
106
+ required: true,
107
+ order: 2,
108
+ })
109
+
110
+ const publishDate = dateField({
111
+ name: 'publish_date',
112
+ label: 'Publish Date',
113
+ required: false,
114
+ order: 3,
115
+ })
116
+
117
+ const coverPhoto = photoField({
118
+ name: 'coverphoto',
119
+ label: 'Cover Photo',
120
+ required: false,
121
+ order: 4,
122
+ })
123
+
124
+ export default hasItemsSection({
125
+ name: 'blog',
126
+ order: 1,
127
+ headingField: title,
128
+ title: {
129
+ section: 'Blog',
130
+ singular: 'Post',
131
+ plural: 'Posts',
132
+ },
133
+ db: {
134
+ table: 'blog',
135
+ },
136
+ fields: [title, content, publishDate, coverPhoto],
137
+ })
138
+ ```
139
+
140
+ #### Category Section Example
141
+
142
+ ```typescript
143
+ // sections/categories.section.ts
144
+ import { textField, photoField } from 'nextjs-cms/core/fields'
145
+ import { categorySection } from 'nextjs-cms/core/sections'
146
+
147
+ const title = textField({
148
+ name: 'title',
149
+ label: 'Title',
150
+ required: true,
151
+ order: 1,
152
+ })
153
+
154
+ const image = photoField({
155
+ name: 'image',
156
+ label: 'Image',
157
+ required: false,
158
+ order: 2,
159
+ })
160
+
161
+ export default categorySection({
162
+ name: 'categories',
163
+ order: 1,
164
+ headingField: title,
165
+ title: {
166
+ section: 'Categories',
167
+ singular: 'Category',
168
+ plural: 'Categories',
169
+ },
170
+ db: {
171
+ table: 'categories',
172
+ },
173
+ fields: [title, image],
174
+ depth: 2, // Allow nested categories
175
+ })
176
+ ```
177
+
178
+ ## API Reference
179
+
180
+ ### Core Modules
181
+
182
+ #### API (`nextjs-cms/api`)
183
+ - **appRouter**: Main tRPC router with all CMS endpoints
184
+ - **createCaller**: Server-side API caller factory
185
+ - **createTRPCContext**: Context factory for tRPC requests
186
+
187
+ #### Authentication (`nextjs-cms/auth`)
188
+ - **JWT Management**: Token creation, verification, and refresh
189
+ - **React Hooks**: `useAxiosPrivate`, `useRefreshToken`
190
+ - **Server Actions**: Authentication utilities for server components
191
+
192
+ #### Core (`nextjs-cms/core`)
193
+ - **Config**: CMS configuration management (`CMSConfig`)
194
+ - **Fields**: Content field helper functions (`textField`, `richTextField`, `dateField`, `photoField`, etc.)
195
+ - **Sections**: Section helper functions (`simpleSection`, `hasItemsSection`, `categorySection`)
196
+ - **Submit**: Form submission handlers (`SimpleSectionSubmit`)
197
+ - **Factories**: Section factory for loading sections (`SectionFactory`)
198
+
199
+ #### Database (`nextjs-cms/db`)
200
+ - **Client**: Database connection and query utilities
201
+ - **Schema**: Database schema definitions
202
+ - **Migrations**: Drizzle migration helpers
203
+
204
+ #### Validators (`nextjs-cms/validators`)
205
+ Zod validators for all field types:
206
+ - Text fields, numbers, dates
207
+ - File uploads (images, documents, videos)
208
+ - Rich text content
209
+ - Select fields and checkboxes
210
+
211
+ #### Translations (`nextjs-cms/translations`)
212
+ - Multi-language support
213
+ - Dictionary management
214
+ - i18next integration
215
+
216
+ ## Field Types
217
+
218
+ The CMS supports various field types out of the box. Each field is created using a helper function that accepts a configuration object:
219
+
220
+ - **Text**: `textField({ name, label, required, order, ... })` - Single-line text input
221
+ - **TextArea**: `textAreaField({ name, label, required, order, ... })` - Multi-line text input
222
+ - **RichText**: `richTextField({ name, label, required, order, ... })` - Rich text editor (TinyMCE)
223
+ - **Number**: `numberField({ name, label, required, order, ... })` - Numeric input
224
+ - **Date**: `dateField({ name, label, required, order, ... })` - Date picker
225
+ - **Select**: `selectField({ name, label, required, order, options, ... })` - Dropdown selection
226
+ - **SelectMultiple**: `selectMultipleField({ name, label, required, order, ... })` - Multi-select field
227
+ - **Checkbox**: `checkboxField({ name, label, required, order, ... })` - Boolean checkbox
228
+ - **Photo**: `photoField({ name, label, required, order, size, thumbnail, ... })` - Image upload
229
+ - **Video**: `videoField({ name, label, required, order, ... })` - Video file upload
230
+ - **Document**: `documentField({ name, label, required, order, type, ... })` - Document file upload
231
+ - **Color**: `colorField({ name, label, required, order, ... })` - Color picker
232
+ - **Map**: `mapField({ name, label, required, order, ... })` - Location/map field
233
+ - **Tags**: `tagsField({ name, label, required, order, ... })` - Tag input field
234
+ - **Password**: `passwordField({ name, label, required, order, ... })` - Password input
235
+ - **FieldGroup**: `fieldGroup({ title, order, fields })` - Group multiple fields together
236
+
237
+ ### Field Configuration
238
+
239
+ All fields require at minimum:
240
+ - `name`: string - Unique field identifier (used in database)
241
+ - `label`: string - Display label for the field
242
+ - `required`: boolean - Whether the field is required
243
+ - `order`: number - Display order of the field
244
+
245
+ Additional options vary by field type. See the API documentation for each field type for complete configuration options.
246
+
247
+ ## Section Types
248
+
249
+ ### Simple Section
250
+ Basic content sections with a single record. Use `simpleSection()` for pages like "About", "Contact", or "Settings" that have only one instance.
251
+
252
+ **Key characteristics:**
253
+ - Single record (always has ID = 1)
254
+ - No listing/browse page
255
+ - Direct edit page
256
+ - Requires `title` property
257
+
258
+ **Example use cases:** About page, Privacy Policy, Site Settings
259
+
260
+ ### Has Items Section
261
+ Sections that can contain multiple items. Use `hasItemsSection()` for collections like blog posts, products, or articles.
262
+
263
+ **Key characteristics:**
264
+ - Multiple records
265
+ - Browse/listing page with pagination
266
+ - Individual item pages
267
+ - Requires `headingField` and `title` object with `section`, `singular`, and `plural` properties
268
+ - Optional `coverPhotoField`, `search`, and `gallery` configuration
269
+
270
+ **Example use cases:** Blog posts, Products, News articles, Events
271
+
272
+ ### Category Section
273
+ Sections organized by categories with hierarchical structure. Use `categorySection()` for nested category systems.
274
+
275
+ **Key characteristics:**
276
+ - Hierarchical structure (configurable depth)
277
+ - Parent-child relationships
278
+ - Requires `headingField` and `title` object
279
+ - Optional `depth` property (default: 1, no nesting)
280
+ - Automatically adds `parent_id` and `level` fields when depth > 1
281
+
282
+ **Example use cases:** Product categories, Content categories, Navigation menus
283
+
284
+
285
+ ## Contributing
286
+
287
+ Contributions are welcome! Please read our contributing guidelines and submit pull requests to the main repository.
288
+
289
+ ## License
290
+
291
291
  MIT License - see LICENSE file for details.
@@ -140,16 +140,16 @@ export async function dbConfigSetup(options) {
140
140
  /**
141
141
  * Prepare new environment variables block
142
142
  */
143
- const newEnvBlock = `
144
-
145
- ####
146
- # generated by the init script
147
- ####
148
- DB_HOST=${dbHost}
149
- DB_PORT=${dbPort}
150
- DB_NAME=${dbName}
151
- DB_USER=${dbUser}
152
- DB_PASSWORD='${dbPassword}'
143
+ const newEnvBlock = `
144
+
145
+ ####
146
+ # generated by the init script
147
+ ####
148
+ DB_HOST=${dbHost}
149
+ DB_PORT=${dbPort}
150
+ DB_NAME=${dbName}
151
+ DB_USER=${dbUser}
152
+ DB_PASSWORD='${dbPassword}'
153
153
  `;
154
154
  /**
155
155
  * Append the new credentials to the .env file
@@ -1 +1 @@
1
- {"version":3,"file":"loader-with-jiti.d.ts","sourceRoot":"","sources":["../../../src/core/config/loader-with-jiti.ts"],"names":[],"mappings":"AAkDA,eAAO,MAAM,sBAAsB,cAAmC,CAAA;AAiHtE;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,OAAO,CA4BxD,CAAA"}
1
+ {"version":3,"file":"loader-with-jiti.d.ts","sourceRoot":"","sources":["../../../src/core/config/loader-with-jiti.ts"],"names":[],"mappings":"AAiDA,eAAO,MAAM,sBAAsB,cAAmC,CAAA;AAsHtE;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,OAAO,CA4BxD,CAAA"}