nextjs-cms-kit 0.5.31 → 0.5.32

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 +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"}
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/lib/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAqDnC,QAAA,MAAM,OAAO,SAAgB,CAAA;AAmE7B,eAAe,OAAO,CAAA"}
@@ -1,5 +1,45 @@
1
1
  import { Command } from 'commander';
2
2
  import chalk from 'chalk';
3
+ import { existsSync, readFileSync } from 'fs';
4
+ import { join } from 'path';
5
+ function isNextjsCmsApp() {
6
+ const cwd = process.cwd();
7
+ // Check for lz.config.ts file
8
+ const configFile = join(cwd, 'lz.config.ts');
9
+ if (!existsSync(configFile)) {
10
+ return false;
11
+ }
12
+ // Check for nextjs-cms dependency in package.json
13
+ try {
14
+ const packageJsonPath = join(cwd, 'package.json');
15
+ if (!existsSync(packageJsonPath)) {
16
+ return false;
17
+ }
18
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
19
+ const allDeps = {
20
+ ...(packageJson.dependencies ?? {}),
21
+ ...(packageJson.devDependencies ?? {}),
22
+ ...(packageJson.peerDependencies ?? {}),
23
+ };
24
+ return 'nextjs-cms' in allDeps;
25
+ }
26
+ catch {
27
+ return false;
28
+ }
29
+ }
30
+ function validateNextjsCmsApp() {
31
+ if (!isNextjsCmsApp()) {
32
+ console.error(chalk.red('❌ Error: This command must be run in a nextjs-cms application directory.'));
33
+ console.error(chalk.gray('Make sure you have:'));
34
+ console.error(chalk.gray(' - lz.config.ts file'));
35
+ console.error(chalk.gray(' - nextjs-cms as a dependency in package.json'));
36
+ console.error(chalk.gray('To create a new nextjs-cms application, run:'));
37
+ console.error(chalk.gray(' - pnpm create nextjs-cms@latest'));
38
+ process.exit(1);
39
+ }
40
+ }
41
+ // Validate that we're in a nextjs-cms app before proceeding
42
+ validateNextjsCmsApp();
3
43
  const program = new Command();
4
44
  program
5
45
  .name('nextjs-cms-kit')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nextjs-cms-kit",
3
3
  "private": false,
4
- "version": "0.5.31",
4
+ "version": "0.5.32",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "nextjs-cms-kit": "./dist/index.js"
@@ -32,7 +32,7 @@
32
32
  "mysql2": "^3.12.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "nextjs-cms": "0.5.31"
35
+ "nextjs-cms": "0.5.32"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/bcrypt": "^6.0.0",
@@ -42,8 +42,8 @@
42
42
  "tsx": "^4.20.6",
43
43
  "typescript": "^5.9.2",
44
44
  "@lzcms/eslint-config": "0.3.0",
45
- "@lzcms/prettier-config": "0.1.0",
46
- "@lzcms/tsconfig": "0.1.0"
45
+ "@lzcms/tsconfig": "0.1.0",
46
+ "@lzcms/prettier-config": "0.1.0"
47
47
  },
48
48
  "prettier": "@lzcms/prettier-config",
49
49
  "scripts": {