nextjs-cms-kit 0.5.35 → 0.5.36

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,EAAU,MAAM,WAAW,CAAA;AAsE3C,QAAA,MAAM,OAAO,SAAgB,CAAA;AA4E7B,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/lib/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAA;AAqE3C,QAAA,MAAM,OAAO,SAAgB,CAAA;AAoE7B,eAAe,OAAO,CAAA"}
@@ -2,7 +2,6 @@ import { Command, Option } from 'commander';
2
2
  import chalk from 'chalk';
3
3
  import { existsSync, readFileSync } from 'fs';
4
4
  import { join } from 'path';
5
- import { config } from 'dotenv';
6
5
  function isNextjsCmsApp() {
7
6
  const cwd = process.cwd();
8
7
  // Check for lz.config.ts file
@@ -54,14 +53,6 @@ function validateNextjsCmsApp() {
54
53
  // Validate that we're in a nextjs-cms app before proceeding
55
54
  validateNextjsCmsApp();
56
55
  const program = new Command();
57
- // Load environment file based on dev flag
58
- const isDev = process.argv.includes('-d') || process.argv.includes('--dev');
59
- if (isDev) {
60
- config({ path: '.env.development' });
61
- }
62
- else {
63
- config();
64
- }
65
56
  program
66
57
  .name('nextjs-cms-kit')
67
58
  .option('-d, --dev', 'use development environment file, use -d/--dev before any command to use the development environment file (e.g. nextjs-cms-kit -d setup)', false)
@@ -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,iBAwBrD"}
@@ -13,6 +13,7 @@ import { intro, select, spinner, log } from '@clack/prompts';
13
13
  import { MysqlTableChecker } from 'nextjs-cms/core/db';
14
14
  import { generateDrizzleSchema } from './schema-generator.js';
15
15
  import { addTableKeys } from './add-table-keys.js';
16
+ import { config } from 'dotenv';
16
17
  function generateFieldSQL(input) {
17
18
  let fieldSQL = `\`${input.name}\` `;
18
19
  /**
@@ -896,9 +897,15 @@ export async function updateSections(useDevEnv = false) {
896
897
  try {
897
898
  // s.start()
898
899
  // Set environment file if dev mode
900
+ // Load environment file based on dev flag
899
901
  if (useDevEnv) {
902
+ config({ path: '.env.development' });
900
903
  process.env.NODE_ENV = 'development';
901
904
  }
905
+ else {
906
+ config();
907
+ process.env.NODE_ENV = 'production';
908
+ }
902
909
  // Run the main update logic
903
910
  await main(s);
904
911
  s.stop('Sections updated successfully');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nextjs-cms-kit",
3
3
  "private": false,
4
- "version": "0.5.35",
4
+ "version": "0.5.36",
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.35"
35
+ "nextjs-cms": "0.5.36"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/bcrypt": "^6.0.0",
@@ -41,9 +41,9 @@
41
41
  "prettier": "^3.3.3",
42
42
  "tsx": "^4.20.6",
43
43
  "typescript": "^5.9.2",
44
- "@lzcms/prettier-config": "0.1.0",
44
+ "@lzcms/eslint-config": "0.3.0",
45
45
  "@lzcms/tsconfig": "0.1.0",
46
- "@lzcms/eslint-config": "0.3.0"
46
+ "@lzcms/prettier-config": "0.1.0"
47
47
  },
48
48
  "prettier": "@lzcms/prettier-config",
49
49
  "scripts": {