nextjs-cms-kit 0.5.30 → 0.5.31

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/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- declare const program: Command;
4
- export default program;
2
+ export {};
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,QAAA,MAAM,OAAO,SAAgB,CAAA;AAmE7B,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -1,62 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import chalk from 'chalk';
4
- const program = new Command();
5
- program
6
- .name('nextjs-cms-kit')
7
- .description(chalk.green('nextjs-cms CLI toolkit for managing your nextjs-cms application'))
8
- .version('0.4.0')
9
- .option('-d, --dev', 'Use development environment file')
10
- .action(() => {
11
- console.log(chalk.hex('#E8DCFF').bold(program.name()));
12
- console.log(program.version());
13
- console.log(program.description());
14
- console.log(chalk.gray('--------------------------'));
15
- console.log(chalk.yellow(`Running in ${process.env.NODE_ENV} mode`));
16
- console.log(chalk.gray('--------------------------'));
17
- });
18
- // Lazy-load commands to avoid eager database connection initialization
19
- // This significantly improves CLI startup time by deferring heavy imports
20
- // until the specific command is actually invoked
21
- program
22
- .command('setup')
23
- .description('Complete nextjs-cms setup')
24
- .action(async () => {
25
- const { runSetup } = await import('./commands/setup.js');
26
- await runSetup(program.opts().dev ?? false);
27
- });
28
- program
29
- .command('db-config')
30
- .description('Initialize nextjs-cms database configuration')
31
- .action(async () => {
32
- const { runDbConfig } = await import('./commands/db-config.js');
33
- await runDbConfig(program.opts().dev ?? false);
34
- });
35
- program
36
- .command('set-master-admin')
37
- .description('Set or update master admin password')
38
- .action(async () => {
39
- const { runSetMasterAdmin } = await import('./commands/set-master-admin.js');
40
- await runSetMasterAdmin(program.opts().dev ?? false);
41
- });
42
- program
43
- .command('fix-master-admin')
44
- .description('Fix master admin privileges for all sections')
45
- .action(async () => {
46
- const { runFixMasterAdmin } = await import('./commands/fix-master-admin.js');
47
- await runFixMasterAdmin();
48
- });
49
- program
50
- .command('update-sections')
51
- .description('Update database tables based on current sections and update master admin privileges')
52
- .action(async () => {
53
- const { runUpdateSections } = await import('./commands/update-sections.js');
54
- await runUpdateSections(program.opts().dev ?? false);
55
- });
56
- // Handle unknown commands
57
- program.on('command:*', (operands) => {
58
- console.error(chalk.red(`Unknown command: ${operands[0]}`));
59
- console.log(chalk.gray('Run nextjs-cms-kit --help to see available commands'));
60
- process.exit(1);
61
- });
62
- export default program;
2
+ import program from './lib/program.js';
3
+ program.parse(process.argv);
@@ -0,0 +1,4 @@
1
+ import { Command } from 'commander';
2
+ declare const program: Command;
3
+ export default program;
4
+ //# sourceMappingURL=program.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/lib/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,QAAA,MAAM,OAAO,SAAgB,CAAA;AAmE7B,eAAe,OAAO,CAAA"}
@@ -0,0 +1,61 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ const program = new Command();
4
+ program
5
+ .name('nextjs-cms-kit')
6
+ .description(chalk.green('nextjs-cms CLI toolkit for managing your nextjs-cms application'))
7
+ .version('0.4.0')
8
+ .option('-d, --dev', 'Use development environment file')
9
+ .action(() => {
10
+ console.log(chalk.hex('#E8DCFF').bold(program.name()));
11
+ console.log(program.version());
12
+ console.log(program.description());
13
+ console.log(chalk.gray('--------------------------'));
14
+ console.log(chalk.yellow(`Running in ${process.env.NODE_ENV} mode`));
15
+ console.log(chalk.gray('--------------------------'));
16
+ });
17
+ // Lazy-load commands to avoid eager database connection initialization
18
+ // This significantly improves CLI startup time by deferring heavy imports
19
+ // until the specific command is actually invoked
20
+ program
21
+ .command('setup')
22
+ .description('Complete nextjs-cms setup')
23
+ .action(async () => {
24
+ const { runSetup } = await import('../commands/setup.js');
25
+ await runSetup(Boolean(program.opts().dev));
26
+ });
27
+ program
28
+ .command('db-config')
29
+ .description('Initialize nextjs-cms database configuration')
30
+ .action(async () => {
31
+ const { runDbConfig } = await import('../commands/db-config.js');
32
+ await runDbConfig(Boolean(program.opts().dev));
33
+ });
34
+ program
35
+ .command('set-master-admin')
36
+ .description('Set or update master admin password')
37
+ .action(async () => {
38
+ const { runSetMasterAdmin } = await import('../commands/set-master-admin.js');
39
+ await runSetMasterAdmin(Boolean(program.opts().dev));
40
+ });
41
+ program
42
+ .command('fix-master-admin')
43
+ .description('Fix master admin privileges for all sections')
44
+ .action(async () => {
45
+ const { runFixMasterAdmin } = await import('../commands/fix-master-admin.js');
46
+ await runFixMasterAdmin();
47
+ });
48
+ program
49
+ .command('update-sections')
50
+ .description('Update database tables based on current sections and update master admin privileges')
51
+ .action(async () => {
52
+ const { runUpdateSections } = await import('../commands/update-sections.js');
53
+ await runUpdateSections(Boolean(program.opts().dev));
54
+ });
55
+ // Handle unknown commands
56
+ program.on('command:*', (operands) => {
57
+ console.error(chalk.red(`Unknown command: ${operands[0]}`));
58
+ console.log(chalk.gray('Run nextjs-cms-kit --help to see available commands'));
59
+ process.exit(1);
60
+ });
61
+ export default program;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nextjs-cms-kit",
3
3
  "private": false,
4
- "version": "0.5.30",
4
+ "version": "0.5.31",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "nextjs-cms-kit": "./dist/index.js"
@@ -11,6 +11,10 @@
11
11
  ".": {
12
12
  "types": "./dist/index.d.ts",
13
13
  "default": "./dist/index.js"
14
+ },
15
+ "./cli": {
16
+ "types": "./dist/lib/program.d.ts",
17
+ "default": "./dist/lib/program.js"
14
18
  }
15
19
  },
16
20
  "files": [
@@ -28,7 +32,7 @@
28
32
  "mysql2": "^3.12.0"
29
33
  },
30
34
  "peerDependencies": {
31
- "nextjs-cms": "0.5.30"
35
+ "nextjs-cms": "0.5.31"
32
36
  },
33
37
  "devDependencies": {
34
38
  "@types/bcrypt": "^6.0.0",
@@ -37,8 +41,8 @@
37
41
  "prettier": "^3.3.3",
38
42
  "tsx": "^4.20.6",
39
43
  "typescript": "^5.9.2",
40
- "@lzcms/prettier-config": "0.1.0",
41
44
  "@lzcms/eslint-config": "0.3.0",
45
+ "@lzcms/prettier-config": "0.1.0",
42
46
  "@lzcms/tsconfig": "0.1.0"
43
47
  },
44
48
  "prettier": "@lzcms/prettier-config",