nextjs-cms-kit 0.5.8 → 0.5.10

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.
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'commander';
2
2
  // import { intro, outro } from '@clack/prompts'
3
- import { dbConfigSetup } from '../lib/db-config-setup';
3
+ import { dbConfigSetup } from '../lib/db-config-setup.js';
4
4
  import chalk from 'chalk';
5
5
  import { dbConnectionClose } from 'nextjs-cms/db/client';
6
6
  export const dbConfigCommand = new Command('db-config')
@@ -1,5 +1,5 @@
1
1
  import { Command } from 'commander';
2
- import { fixMasterAdmin } from '../lib/fix-master-admin';
2
+ import { fixMasterAdmin } from '../lib/fix-master-admin.js';
3
3
  import { dbConnectionClose } from 'nextjs-cms/db/client';
4
4
  import chalk from 'chalk';
5
5
  export const fixMasterAdminCommand = new Command('fix-master-admin')
@@ -1,5 +1,5 @@
1
1
  import { Command } from 'commander';
2
- import { setMasterAdmin } from '../lib/set-master-admin';
2
+ import { setMasterAdmin } from '../lib/set-master-admin.js';
3
3
  import { dbConnectionClose } from 'nextjs-cms/db/client';
4
4
  import chalk from 'chalk';
5
5
  export const setMasterAdminCommand = new Command('set-master-admin')
@@ -1,10 +1,10 @@
1
1
  import { Command } from 'commander';
2
2
  import { note, intro, outro, spinner } from '@clack/prompts';
3
3
  import { spawn } from 'child_process';
4
- import { setMasterAdmin } from '../lib/set-master-admin';
4
+ import { setMasterAdmin } from '../lib/set-master-admin.js';
5
5
  import { dbConnectionClose } from 'nextjs-cms/db/client';
6
6
  import chalk from 'chalk';
7
- import { dbConfigSetup } from '../lib/db-config-setup';
7
+ import { dbConfigSetup } from '../lib/db-config-setup.js';
8
8
  export const setupCommand = new Command('setup').description('Complete LZCMS setup').action(async () => {
9
9
  const s = spinner();
10
10
  console.log(chalk.hex('#E8DCFF').bold(setupCommand.parent?.name()));
@@ -25,7 +25,7 @@ export const setupCommand = new Command('setup').description('Complete LZCMS set
25
25
  note('Generating database schema...');
26
26
  // Use spawn to properly handle streams and prevent hanging
27
27
  await new Promise((resolve, reject) => {
28
- const child = spawn('pnpm', ['drizzle-kit', 'push --force', '--config=drizzle.config.ts'], {
28
+ const child = spawn('pnpm', ['drizzle-kit', 'push --force', '--config=drizzle.config.js'], {
29
29
  cwd: process.cwd(),
30
30
  env: { ...process.env },
31
31
  stdio: 'inherit', // Inherit stdio to prevent hanging and show output directly
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'commander';
2
- import { updateSections } from '../lib/update-sections';
3
- import { fixMasterAdminPrivileges } from '../lib/actions';
2
+ import { updateSections } from '../lib/update-sections.js';
3
+ import { fixMasterAdminPrivileges } from '../lib/actions.js';
4
4
  import chalk from 'chalk';
5
5
  import { dbConnectionClose } from 'nextjs-cms/db/client';
6
6
  export const updateSectionsCommand = new Command('update-sections')
package/dist/index.js CHANGED
@@ -3,11 +3,11 @@ import { Command } from 'commander';
3
3
  import chalk from 'chalk';
4
4
  // import { intro, outro } from '@clack/prompts'
5
5
  // Import command modules
6
- import { dbConfigCommand } from './commands/db-config';
7
- import { setupCommand } from './commands/setup';
8
- import { setMasterAdminCommand } from './commands/set-master-admin';
9
- import { fixMasterAdminCommand } from './commands/fix-master-admin';
10
- import { updateSectionsCommand } from './commands/update-sections';
6
+ import { dbConfigCommand } from './commands/db-config.js';
7
+ import { setupCommand } from './commands/setup.js';
8
+ import { setMasterAdminCommand } from './commands/set-master-admin.js';
9
+ import { fixMasterAdminCommand } from './commands/fix-master-admin.js';
10
+ import { updateSectionsCommand } from './commands/update-sections.js';
11
11
  const program = new Command();
12
12
  program
13
13
  .name('lzcms-kit')
@@ -3,7 +3,7 @@ import { intro, isCancel, outro, text, spinner, note } from '@clack/prompts';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
5
  import { cwd } from 'process';
6
- import { reloadAndUpdateEnvironmentVariables } from './reload-env';
6
+ import { reloadAndUpdateEnvironmentVariables } from './reload-env.js';
7
7
  /**
8
8
  * Removes specific environment variables from the .env file content
9
9
  * Removes both the generated comment block and the individual variable lines
@@ -1,5 +1,5 @@
1
1
  import { intro, outro } from '@clack/prompts';
2
- import { fixMasterAdminPrivileges } from './actions';
2
+ import { fixMasterAdminPrivileges } from './actions.js';
3
3
  export async function fixMasterAdmin() {
4
4
  intro(`Looking up sections...`);
5
5
  await fixMasterAdminPrivileges();
@@ -1,5 +1,5 @@
1
1
  import * as p from '@clack/prompts';
2
- import { fixMasterAdminPrivileges, getMasterAdmin, setMaterAdmin } from './actions';
2
+ import { fixMasterAdminPrivileges, getMasterAdmin, setMaterAdmin } from './actions.js';
3
3
  export async function setMasterAdmin() {
4
4
  p.intro(`Setting up master admin...`);
5
5
  /**
@@ -10,8 +10,8 @@ import { FileField } from 'nextjs-cms/core/fields';
10
10
  import chalk from 'chalk';
11
11
  import { intro, select, spinner, log } from '@clack/prompts';
12
12
  import { MysqlTableChecker } from 'nextjs-cms/core/db';
13
- import { generateDrizzleSchema } from './schema-generator';
14
- import { addTableKeys } from './add-table-keys';
13
+ import { generateDrizzleSchema } from './schema-generator.js';
14
+ import { addTableKeys } from './add-table-keys.js';
15
15
  function generateFieldSQL(input) {
16
16
  let fieldSQL = `\`${input.name}\` `;
17
17
  /**
@@ -503,7 +503,7 @@ const main = async (s) => {
503
503
  */
504
504
  console.log(chalk.white(`Removing existing schema file...`));
505
505
  s.start();
506
- const schemaFilePath = './dynamic-schemas/schema.ts';
506
+ const schemaFilePath = './dynamic-schemas/schema.js';
507
507
  try {
508
508
  if (fs.existsSync(schemaFilePath)) {
509
509
  fs.unlinkSync(schemaFilePath);
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "nextjs-cms-kit",
3
3
  "private": false,
4
- "version": "0.5.8",
5
- "type": "module",
4
+ "version": "0.5.10",
6
5
  "bin": {
7
6
  "nextjs-cms-kit": "./dist/index.js"
8
7
  },
@@ -28,18 +27,19 @@
28
27
  "glob": "^11.0.3",
29
28
  "mysql2": "^3.12.0",
30
29
  "zod": "4.1.12",
31
- "nextjs-cms": "0.5.8"
30
+ "nextjs-cms": "0.5.10"
32
31
  },
33
32
  "devDependencies": {
34
33
  "@types/bcrypt": "^6.0.0",
35
34
  "drizzle-kit": "^0.31.5",
36
35
  "eslint": "^9.12.0",
37
36
  "prettier": "^3.3.3",
37
+ "recast": "^0.23.11",
38
38
  "tsup": "^8.3.6",
39
39
  "tsx": "^4.20.6",
40
40
  "typescript": "^5.9.2",
41
- "@lzcms/prettier-config": "0.1.0",
42
41
  "@lzcms/eslint-config": "0.3.0",
42
+ "@lzcms/prettier-config": "0.1.0",
43
43
  "@lzcms/tsconfig": "0.1.0"
44
44
  },
45
45
  "prettier": "@lzcms/prettier-config",