nextjs-cms 0.8.7 → 0.8.9
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/fields.js +4 -4
- package/dist/api/routers/navigation.d.ts +3 -3
- package/dist/cli/lib/db-config.js +10 -10
- package/dist/core/db/table-checker/MysqlTable.js +8 -8
- package/dist/core/factories/section-factory-with-esbuild.js +9 -9
- package/dist/core/factories/section-factory-with-jiti.js +9 -9
- package/dist/core/fields/select.d.ts +1 -1
- package/dist/core/sections/category.d.ts +4 -4
- package/dist/core/sections/category.d.ts.map +1 -1
- package/dist/core/sections/category.js +9 -8
- package/dist/core/sections/hasItems.d.ts +58 -58
- package/dist/core/sections/section.d.ts +3 -3
- package/dist/core/sections/simple.d.ts +4 -4
- package/dist/plugins/loader.d.ts +2 -1
- package/dist/plugins/loader.d.ts.map +1 -1
- package/dist/plugins/loader.js +1 -3
- package/dist/translations/client.d.ts +4 -4
- package/dist/translations/dictionaries/ar.d.ts +433 -0
- package/dist/translations/dictionaries/ar.d.ts.map +1 -0
- package/dist/translations/dictionaries/ar.js +444 -0
- package/dist/translations/dictionaries/en.d.ts +433 -0
- package/dist/translations/dictionaries/en.d.ts.map +1 -0
- package/dist/translations/dictionaries/en.js +444 -0
- package/dist/translations/server.d.ts +4 -4
- package/dist/validators/number.js +5 -5
- package/package.json +3 -3
|
@@ -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
|
|
@@ -22,10 +22,10 @@ export class MysqlTableChecker extends DbTableChecker {
|
|
|
22
22
|
return _tables;
|
|
23
23
|
}
|
|
24
24
|
static async getColumns(tableName) {
|
|
25
|
-
const statement = sql `
|
|
26
|
-
SELECT COLUMN_NAME
|
|
27
|
-
FROM information_schema.COLUMNS c
|
|
28
|
-
inner join information_schema.TABLES t ON t.TABLE_NAME = c.TABLE_NAME
|
|
25
|
+
const statement = sql `
|
|
26
|
+
SELECT COLUMN_NAME
|
|
27
|
+
FROM information_schema.COLUMNS c
|
|
28
|
+
inner join information_schema.TABLES t ON t.TABLE_NAME = c.TABLE_NAME
|
|
29
29
|
WHERE t.TABLE_NAME = ${tableName}`;
|
|
30
30
|
const _cols = [];
|
|
31
31
|
const _res = await db.execute(statement);
|
|
@@ -82,10 +82,10 @@ export class MysqlTableChecker extends DbTableChecker {
|
|
|
82
82
|
fullTextKeys.push({ name: key, columns: _fullTextKeyMap[key] });
|
|
83
83
|
}
|
|
84
84
|
// Foreign keys should be retrieved from information_schema
|
|
85
|
-
const [foreignKeys] = await db.execute(sql `
|
|
86
|
-
SELECT COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME
|
|
87
|
-
FROM information_schema.KEY_COLUMN_USAGE
|
|
88
|
-
WHERE TABLE_NAME = ${table} AND CONSTRAINT_NAME != 'PRIMARY' AND REFERENCED_TABLE_NAME IS NOT NULL;
|
|
85
|
+
const [foreignKeys] = await db.execute(sql `
|
|
86
|
+
SELECT COLUMN_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME
|
|
87
|
+
FROM information_schema.KEY_COLUMN_USAGE
|
|
88
|
+
WHERE TABLE_NAME = ${table} AND CONSTRAINT_NAME != 'PRIMARY' AND REFERENCED_TABLE_NAME IS NOT NULL;
|
|
89
89
|
`);
|
|
90
90
|
return { primaryKeys, uniqueKeys, indexKeys, foreignKeys, fullTextKeys };
|
|
91
91
|
}
|
|
@@ -436,15 +436,15 @@ export class SectionFactory {
|
|
|
436
436
|
importErr.message.includes('Cannot find module') &&
|
|
437
437
|
importErr.message.includes('.section')) {
|
|
438
438
|
this.sectionProcessingErrors[file] ??= [];
|
|
439
|
-
this.sectionProcessingErrors[file].push(`❌ Invalid section import detected.
|
|
440
|
-
|
|
441
|
-
Sections MUST use extensionless relative imports:
|
|
442
|
-
|
|
443
|
-
✅ import exampleSection from './example.section'
|
|
444
|
-
❌ import exampleSection from './example.section.ts'
|
|
445
|
-
❌ import exampleSection from './example.section.js'
|
|
446
|
-
|
|
447
|
-
This file is bundled with esbuild, so Node never resolves the import directly.
|
|
439
|
+
this.sectionProcessingErrors[file].push(`❌ Invalid section import detected.
|
|
440
|
+
|
|
441
|
+
Sections MUST use extensionless relative imports:
|
|
442
|
+
|
|
443
|
+
✅ import exampleSection from './example.section'
|
|
444
|
+
❌ import exampleSection from './example.section.ts'
|
|
445
|
+
❌ import exampleSection from './example.section.js'
|
|
446
|
+
|
|
447
|
+
This file is bundled with esbuild, so Node never resolves the import directly.
|
|
448
448
|
If you added an extension manually, remove it.`);
|
|
449
449
|
this.errorCount++;
|
|
450
450
|
continue;
|
|
@@ -392,15 +392,15 @@ export class SectionFactory {
|
|
|
392
392
|
importErr.message.includes('Cannot find module') &&
|
|
393
393
|
importErr.message.includes('.section')) {
|
|
394
394
|
this.sectionProcessingErrors[file] ??= [];
|
|
395
|
-
this.sectionProcessingErrors[file].push(`❌ Invalid section import detected.
|
|
396
|
-
|
|
397
|
-
Sections MUST use extensionless relative imports:
|
|
398
|
-
|
|
399
|
-
✅ import exampleSection from './example.section'
|
|
400
|
-
❌ import exampleSection from './example.section.ts'
|
|
401
|
-
❌ import exampleSection from './example.section.js'
|
|
402
|
-
|
|
403
|
-
This file is bundled with jiti, so Node never resolves the import directly.
|
|
395
|
+
this.sectionProcessingErrors[file].push(`❌ Invalid section import detected.
|
|
396
|
+
|
|
397
|
+
Sections MUST use extensionless relative imports:
|
|
398
|
+
|
|
399
|
+
✅ import exampleSection from './example.section'
|
|
400
|
+
❌ import exampleSection from './example.section.ts'
|
|
401
|
+
❌ import exampleSection from './example.section.js'
|
|
402
|
+
|
|
403
|
+
This file is bundled with jiti, so Node never resolves the import directly.
|
|
404
404
|
If you added an extension manually, remove it.`);
|
|
405
405
|
this.errorCount++;
|
|
406
406
|
continue;
|
|
@@ -346,8 +346,8 @@ declare const selectFieldConfigSchema: z.ZodIntersection<z.ZodUnion<readonly [z.
|
|
|
346
346
|
}, z.core.$strict>]>, z.ZodObject<{
|
|
347
347
|
type: z.ZodLiteral<"select">;
|
|
348
348
|
optionsType: z.ZodEnum<{
|
|
349
|
-
db: "db";
|
|
350
349
|
section: "section";
|
|
350
|
+
db: "db";
|
|
351
351
|
static: "static";
|
|
352
352
|
}>;
|
|
353
353
|
build: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodCustom<SelectField, SelectField>>;
|