nextjs-cms 0.5.66 → 0.5.67
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/db/config.d.ts.map +1 -1
- package/dist/db/config.js +22 -1
- package/package.json +3 -3
package/dist/db/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/db/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;IAClG,QAAQ,EAAE,MAAM,CAAA;CACnB;AAQD,wBAAgB,eAAe,CAAC,SAAS,GAAE,OAAO,CAAC,QAAQ,CAAM,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/db/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;IAClG,QAAQ,EAAE,MAAM,CAAA;CACnB;AAQD,wBAAgB,eAAe,CAAC,SAAS,GAAE,OAAO,CAAC,QAAQ,CAAM,GAAG,QAAQ,CA4D3E"}
|
package/dist/db/config.js
CHANGED
|
@@ -30,10 +30,31 @@ export function resolveDbConfig(overrides = {}) {
|
|
|
30
30
|
}
|
|
31
31
|
catch (error) {
|
|
32
32
|
const idDev = process.env.NODE_ENV === 'development';
|
|
33
|
+
let preferredPM = 'pnpm';
|
|
34
|
+
// This environment variable is set by npm and yarn but pnpm seems less consistent
|
|
35
|
+
const userAgent = process.env.npm_config_user_agent;
|
|
36
|
+
if (userAgent) {
|
|
37
|
+
if (userAgent.startsWith('yarn')) {
|
|
38
|
+
preferredPM = 'yarn';
|
|
39
|
+
}
|
|
40
|
+
else if (userAgent.startsWith('pnpm')) {
|
|
41
|
+
preferredPM = 'pnpm';
|
|
42
|
+
}
|
|
43
|
+
else if (userAgent.startsWith('bun')) {
|
|
44
|
+
preferredPM = 'bun';
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
preferredPM = 'npm';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// If no user agent is set, assume npm
|
|
52
|
+
preferredPM = 'npm';
|
|
53
|
+
}
|
|
33
54
|
console.log('');
|
|
34
55
|
console.error(chalk.redBright('Database name and user are required'));
|
|
35
56
|
console.log(chalk.gray(`Make sure to set the ${chalk.white.italic('DB_NAME')} and ${chalk.white.italic('DB_USER')} in your ${idDev ? 'development' : 'production'} environment variables.`));
|
|
36
|
-
console.log(chalk.gray(`Or, you can run ${chalk.greenBright.italic(
|
|
57
|
+
console.log(chalk.gray(`Or, you can run ${chalk.greenBright.italic(`${preferredPM} nextjs-cms-kit ${idDev ? '--dev' : ''} db-config`)} command at the root of your nextjs-cms project to set db config interactively.`));
|
|
37
58
|
process.exit(1);
|
|
38
59
|
}
|
|
39
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-cms",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.67",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -151,8 +151,8 @@
|
|
|
151
151
|
"tsx": "^4.20.6",
|
|
152
152
|
"typescript": "^5.9.2",
|
|
153
153
|
"@lzcms/eslint-config": "0.3.0",
|
|
154
|
-
"@lzcms/
|
|
155
|
-
"@lzcms/
|
|
154
|
+
"@lzcms/tsconfig": "0.1.0",
|
|
155
|
+
"@lzcms/prettier-config": "0.1.0"
|
|
156
156
|
},
|
|
157
157
|
"license": "MIT",
|
|
158
158
|
"keywords": [
|