nextjs-cms-kit 0.5.56 → 0.5.57

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.
@@ -17,7 +17,7 @@ export async function generateDrizzleSchema(table) {
17
17
  const { getCMSConfig } = await import('nextjs-cms/core/config');
18
18
  let tableCaseStyleFn;
19
19
  let columnCaseStyleFn;
20
- const lzConfig = getCMSConfig();
20
+ const lzConfig = await getCMSConfig();
21
21
  switch (lzConfig.schemaGeneration.drizzle.naming.tables) {
22
22
  case 'snakeCase':
23
23
  tableCaseStyleFn = toSnakeCase;
@@ -1 +1 @@
1
- {"version":3,"file":"update-sections.d.ts","sourceRoot":"","sources":["../../src/lib/update-sections.ts"],"names":[],"mappings":"AA+iCA,wBAAsB,cAAc,CAAC,SAAS,UAAQ,iBAmBrD"}
1
+ {"version":3,"file":"update-sections.d.ts","sourceRoot":"","sources":["../../src/lib/update-sections.ts"],"names":[],"mappings":"AAgjCA,wBAAsB,cAAc,CAAC,SAAS,UAAQ,iBAmBrD"}
@@ -499,7 +499,7 @@ async function updateTable(table, s) {
499
499
  s.stop(chalk.italic.hex(`${sqlErrors > 0 ? `#FFA500` : `#fafafa`}`)(`- Table \`${table.name}\` modified successfully ${sqlErrors > 0 ? `with ${sqlErrors} error(s).` : ''}`));
500
500
  }
501
501
  const main = async (s) => {
502
- const cmsConfig = getCMSConfig();
502
+ const cmsConfig = await getCMSConfig();
503
503
  const schemaGenerationEnabled = cmsConfig.schemaGeneration.drizzle.enabled;
504
504
  const schemaOutDir = cmsConfig.schemaGeneration.drizzle.outDir;
505
505
  const schemaFileName = cmsConfig.schemaGeneration.drizzle.fileName;
@@ -619,26 +619,27 @@ const main = async (s) => {
619
619
  /**
620
620
  * Check for gallery
621
621
  */
622
- if (s.gallery?.db.tableName) {
623
- console.log('Gallery found for section:', s.name, 'with table:', s.gallery.db.tableName);
622
+ const gallery = await s.getGallery();
623
+ if (gallery?.db.tableName) {
624
+ console.log('Gallery found for section:', s.name, 'with table:', gallery.db.tableName);
624
625
  const photoField = textField({
625
- name: s.gallery.db.photoNameField || 'photo',
626
+ name: gallery.db.photoNameField || 'photo',
626
627
  label: 'Photo Name',
627
628
  required: true,
628
629
  order: 0,
629
630
  });
630
631
  desiredTables.push({
631
- name: s.gallery.db.tableName,
632
+ name: gallery.db.tableName,
632
633
  fields: [
633
634
  textField({
634
- name: s.gallery.db.referenceIdentifierField || 'reference_id',
635
+ name: gallery.db.referenceIdentifierField || 'reference_id',
635
636
  label: 'Reference Id',
636
637
  required: true,
637
638
  order: 0,
638
639
  }).build(),
639
640
  photoField.build(),
640
641
  textAreaField({
641
- name: s.gallery.db.metaField || 'meta',
642
+ name: gallery.db.metaField || 'meta',
642
643
  label: 'Photo Information',
643
644
  required: false,
644
645
  order: 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nextjs-cms-kit",
3
3
  "private": false,
4
- "version": "0.5.56",
4
+ "version": "0.5.57",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "nextjs-cms-kit": "./dist/index.js"
@@ -28,20 +28,20 @@
28
28
  "chalk": "^5.4.1",
29
29
  "commander": "^14.0.2",
30
30
  "dotenv": "^17.2.3",
31
- "drizzle-zod": "^0.7.0",
31
+ "drizzle-zod": "^0.8.3",
32
32
  "mysql2": "^3.12.0",
33
- "nextjs-cms": "0.5.56"
33
+ "nextjs-cms": "0.5.57"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/bcrypt": "^6.0.0",
37
- "drizzle-kit": "^0.31.5",
37
+ "drizzle-kit": "^0.31.8",
38
38
  "eslint": "^9.12.0",
39
39
  "prettier": "^3.3.3",
40
40
  "tsx": "^4.20.6",
41
41
  "typescript": "^5.9.2",
42
- "@lzcms/eslint-config": "0.3.0",
43
42
  "@lzcms/prettier-config": "0.1.0",
44
- "@lzcms/tsconfig": "0.1.0"
43
+ "@lzcms/tsconfig": "0.1.0",
44
+ "@lzcms/eslint-config": "0.3.0"
45
45
  },
46
46
  "prettier": "@lzcms/prettier-config",
47
47
  "scripts": {
@@ -50,7 +50,7 @@
50
50
  "dev": "tsc --watch",
51
51
  "format": "prettier --check . --ignore-path ../../.gitignore",
52
52
  "lint": "eslint",
53
- "typecheck": "tsc --noEmit --emitDeclarationOnly false",
53
+ "typecheck": "tsc --noEmit",
54
54
  "run": "tsx src/index.ts"
55
55
  }
56
56
  }