nextjs-cms 0.7.1 → 0.7.3
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 -21
- package/README.md +290 -290
- package/dist/api/index.d.ts +3 -3
- package/dist/api/lib/serverActions.d.ts +3 -3
- package/dist/api/root.d.ts +6 -6
- package/dist/api/routers/hasItemsSection.d.ts +2 -2
- package/dist/api/routers/simpleSection.d.ts +1 -1
- package/dist/cli/lib/db-config.js +10 -10
- package/dist/core/config/config-loader.d.ts +23 -3
- package/dist/core/config/config-loader.d.ts.map +1 -1
- package/dist/core/config/config-loader.js +32 -6
- package/dist/core/config/loader-with-jiti.d.ts.map +1 -1
- package/dist/core/config/loader-with-jiti.js +19 -15
- package/dist/core/db/table-checker/MysqlTable.js +8 -8
- package/dist/core/factories/section-factory-with-esbuild.d.ts.map +1 -1
- package/dist/core/factories/section-factory-with-esbuild.js +23 -9
- package/dist/core/factories/section-factory-with-jiti.d.ts.map +1 -1
- package/dist/core/factories/section-factory-with-jiti.js +51 -33
- package/dist/core/factories/section-name-validation.d.ts +10 -0
- package/dist/core/factories/section-name-validation.d.ts.map +1 -0
- package/dist/core/factories/section-name-validation.js +31 -0
- package/dist/core/fields/photo.d.ts +127 -85
- package/dist/core/fields/photo.d.ts.map +1 -1
- package/dist/core/fields/photo.js +83 -72
- package/dist/core/fields/richText.d.ts +9 -9
- package/dist/core/fields/select.d.ts +1 -1
- package/dist/core/sections/category.d.ts +42 -36
- package/dist/core/sections/category.d.ts.map +1 -1
- package/dist/core/sections/category.js +6 -1
- package/dist/core/sections/hasItems.d.ts +156 -54
- package/dist/core/sections/hasItems.d.ts.map +1 -1
- package/dist/core/sections/hasItems.js +6 -11
- package/dist/core/sections/section.d.ts +33 -20
- package/dist/core/sections/section.d.ts.map +1 -1
- package/dist/core/sections/section.js +37 -3
- package/dist/core/sections/simple.d.ts +14 -8
- package/dist/core/sections/simple.d.ts.map +1 -1
- package/dist/core/sections/simple.js +6 -1
- package/dist/core/submit/submit.js +1 -1
- package/dist/translations/client.d.ts.map +1 -1
- package/dist/translations/server.d.ts.map +1 -1
- package/dist/validators/photo.js +1 -1
- package/package.json +2 -1
- package/dist/translations/dictionaries/ar.d.ts +0 -433
- package/dist/translations/dictionaries/ar.d.ts.map +0 -1
- package/dist/translations/dictionaries/ar.js +0 -444
- package/dist/translations/dictionaries/en.d.ts +0 -433
- package/dist/translations/dictionaries/en.d.ts.map +0 -1
- package/dist/translations/dictionaries/en.js +0 -444
|
@@ -25,7 +25,7 @@ export const baseSectionOptionsSchema = z.strictObject({
|
|
|
25
25
|
.strictObject({
|
|
26
26
|
width: z.number(),
|
|
27
27
|
height: z.number(),
|
|
28
|
-
|
|
28
|
+
fit: z.enum(['cover', 'contain']),
|
|
29
29
|
quality: z.number(),
|
|
30
30
|
})
|
|
31
31
|
.optional(),
|
|
@@ -90,6 +90,35 @@ export function validateSectionConfig(config) {
|
|
|
90
90
|
throw new Error(result.error.message);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
const normalizeFieldName = (name) => name.trim().toLowerCase();
|
|
94
|
+
export function getDuplicateFieldNames(fields) {
|
|
95
|
+
const firstByName = new Map();
|
|
96
|
+
const duplicates = new Set();
|
|
97
|
+
for (const field of fields) {
|
|
98
|
+
const normalizedName = normalizeFieldName(field.name);
|
|
99
|
+
const existingFieldName = firstByName.get(normalizedName);
|
|
100
|
+
if (existingFieldName) {
|
|
101
|
+
duplicates.add(existingFieldName);
|
|
102
|
+
duplicates.add(field.name);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
firstByName.set(normalizedName, field.name);
|
|
106
|
+
}
|
|
107
|
+
return [...duplicates];
|
|
108
|
+
}
|
|
109
|
+
export function validateUniqueFieldNames(sectionName, fields) {
|
|
110
|
+
const duplicates = getDuplicateFieldNames(fields);
|
|
111
|
+
if (duplicates.length === 0)
|
|
112
|
+
return;
|
|
113
|
+
const message = `${chalk.red.bold(` - ${chalk.underline(`[Section: ${sectionName}]:`)} Duplicate field names detected: ${duplicates.join(', ')}.`)}\n${chalk.yellow(' Field names must be unique. Please make sure every field name is unique in each section.')}`;
|
|
114
|
+
throw new Error(message);
|
|
115
|
+
}
|
|
116
|
+
export function validateFieldNamesForSection({ sectionName, fields, identifierField, }) {
|
|
117
|
+
if (!identifierField && fields.some((field) => normalizeFieldName(field.name) === 'id')) {
|
|
118
|
+
throw new Error(`[Section: ${sectionName}]: Field name "id" is reserved when db.identifier is not provided. Set db.identifier to this field or rename the field.`);
|
|
119
|
+
}
|
|
120
|
+
validateUniqueFieldNames(sectionName, fields);
|
|
121
|
+
}
|
|
93
122
|
export class Section {
|
|
94
123
|
static [entityKind] = 'Section';
|
|
95
124
|
name;
|
|
@@ -186,6 +215,11 @@ export class Section {
|
|
|
186
215
|
throw new Error(message);
|
|
187
216
|
}
|
|
188
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Field names must be unique to avoid invalid DB schemas.
|
|
220
|
+
* This is a guardrail for direct Section instantiation paths.
|
|
221
|
+
*/
|
|
222
|
+
validateUniqueFieldNames(this.name, config.fields);
|
|
189
223
|
/**
|
|
190
224
|
* Resolve db configuration fields
|
|
191
225
|
* If user doesn't specify primaryKey, default to identifier field
|
|
@@ -238,8 +272,8 @@ export class Section {
|
|
|
238
272
|
thumbnail: {
|
|
239
273
|
width: this._galleryConfig.thumbnail?.width ?? cmsConfig.media.images.thumbnail.width,
|
|
240
274
|
height: this._galleryConfig.thumbnail?.height ?? cmsConfig.media.images.thumbnail.height,
|
|
241
|
-
|
|
242
|
-
quality: this._galleryConfig.thumbnail?.quality ?? cmsConfig.media.images.thumbnail.quality,
|
|
275
|
+
fit: this._galleryConfig.thumbnail?.fit ?? cmsConfig.media.images.thumbnail.fit ?? 'contain',
|
|
276
|
+
quality: this._galleryConfig.thumbnail?.quality ?? cmsConfig.media.images.thumbnail.quality ?? 80,
|
|
243
277
|
},
|
|
244
278
|
};
|
|
245
279
|
}
|
|
@@ -23,7 +23,10 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
23
23
|
table: z.ZodString;
|
|
24
24
|
}, z.core.$strict>;
|
|
25
25
|
fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
|
|
26
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
26
27
|
name: z.ZodString;
|
|
28
|
+
order: z.ZodNumber;
|
|
29
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
27
30
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
28
31
|
db: z.ZodObject<{
|
|
29
32
|
tableName: z.ZodString;
|
|
@@ -35,14 +38,14 @@ declare const optionsSchema: z.ZodObject<{
|
|
|
35
38
|
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
36
39
|
width: z.ZodNumber;
|
|
37
40
|
height: z.ZodNumber;
|
|
38
|
-
|
|
41
|
+
fit: z.ZodEnum<{
|
|
42
|
+
cover: "cover";
|
|
43
|
+
contain: "contain";
|
|
44
|
+
}>;
|
|
39
45
|
quality: z.ZodNumber;
|
|
40
46
|
}, z.core.$strict>>;
|
|
41
47
|
}, z.core.$strict>>;
|
|
42
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
43
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
44
48
|
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
45
|
-
order: z.ZodNumber;
|
|
46
49
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
47
50
|
}, z.core.$strict>;
|
|
48
51
|
declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
@@ -54,7 +57,10 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
|
54
57
|
db: z.ZodObject<{
|
|
55
58
|
table: z.ZodString;
|
|
56
59
|
}, z.core.$strict>;
|
|
60
|
+
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
57
61
|
name: z.ZodString;
|
|
62
|
+
order: z.ZodNumber;
|
|
63
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
58
64
|
gallery: z.ZodOptional<z.ZodObject<{
|
|
59
65
|
db: z.ZodObject<{
|
|
60
66
|
tableName: z.ZodString;
|
|
@@ -66,14 +72,14 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
|
|
|
66
72
|
thumbnail: z.ZodOptional<z.ZodObject<{
|
|
67
73
|
width: z.ZodNumber;
|
|
68
74
|
height: z.ZodNumber;
|
|
69
|
-
|
|
75
|
+
fit: z.ZodEnum<{
|
|
76
|
+
cover: "cover";
|
|
77
|
+
contain: "contain";
|
|
78
|
+
}>;
|
|
70
79
|
quality: z.ZodNumber;
|
|
71
80
|
}, z.core.$strict>>;
|
|
72
81
|
}, z.core.$strict>>;
|
|
73
|
-
readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
74
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
75
82
|
variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
|
|
76
|
-
order: z.ZodNumber;
|
|
77
83
|
hooks: z.ZodOptional<z.ZodCustom<import("./section.js").Hooks, import("./section.js").Hooks>>;
|
|
78
84
|
}, z.core.$strict>;
|
|
79
85
|
export type SimpleSectionOptions = z.infer<typeof optionsSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../src/core/sections/simple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../src/core/sections/simple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,OAAO,EAAiE,MAAM,cAAc,CAAA;AACrG,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,QAAA,MAAM,YAAY;;;;;kBAqBhB,CAAA;AAEF,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1C,qBAAa,aAAc,SAAQ,OAAO,CAAC,MAAM,CAAC;IAC9C,gBAAyB,CAAC,UAAU,CAAC,mBAAkB;IACvD,SAAkB,IAAI,YAAW;IACxB,KAAK,EAAE,eAAe,CAAA;gBAEnB,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC;CAKjD;AAED,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAGjB,CAAA;AAOF,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAK7B,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEhE;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CAmDhF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { entityKind } from '../helpers/index.js';
|
|
2
|
-
import { Section, baseHelperFunctionOptionsSchema } from './section.js';
|
|
2
|
+
import { Section, baseHelperFunctionOptionsSchema, validateFieldNamesForSection } from './section.js';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
import { FieldGroupConfigSchema, fieldConfigSchema } from './section.js';
|
|
5
5
|
const configSchema = z.strictObject({
|
|
@@ -81,6 +81,11 @@ export function simpleSection(section) {
|
|
|
81
81
|
fields = section.fields;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
validateFieldNamesForSection({
|
|
85
|
+
sectionName: section.name,
|
|
86
|
+
fields,
|
|
87
|
+
identifierField: undefined,
|
|
88
|
+
});
|
|
84
89
|
const config = {
|
|
85
90
|
...section,
|
|
86
91
|
fields,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/translations/client.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/translations/client.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AA0BvD,QAAA,MACI,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,EAC/B,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,QAAQ,GACX,EAAE,uBAAuB,qBAWzB;AAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/translations/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/translations/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AA2BvD,eAAO,MAAQ,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAE,eAAe;;GAAqD,CAAA;AAE3G,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAMvG"}
|
package/dist/validators/photo.js
CHANGED
|
@@ -76,7 +76,7 @@ export const photoFieldSchema = (field, locale = 'en') => {
|
|
|
76
76
|
/**
|
|
77
77
|
* Image dimensions
|
|
78
78
|
*/
|
|
79
|
-
if (field.size &&
|
|
79
|
+
if (field.size && 'strict' in field.size) {
|
|
80
80
|
try {
|
|
81
81
|
const { width, height } = await getImageDimensions(file, locale);
|
|
82
82
|
const { width: requiredW, height: requiredH } = field.size;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-cms",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -170,6 +170,7 @@
|
|
|
170
170
|
"execa": "9.6.1",
|
|
171
171
|
"glob": "^10.4.5",
|
|
172
172
|
"gradient-string": "^3.0.0",
|
|
173
|
+
"international-types": "^0.8.1",
|
|
173
174
|
"isomorphic-dompurify": "^2.21.0",
|
|
174
175
|
"jiti": "^2.6.1",
|
|
175
176
|
"jose": "^6.0.11",
|