create-express-kickstart 1.2.2 → 1.2.3

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/README.md CHANGED
@@ -14,14 +14,16 @@ You do not need to clone this repository, install dependencies manually, or writ
14
14
 
15
15
  ### 1. Initialize a New Project
16
16
 
17
+ We highly recommend using the `@latest` tag to ensure you are always downloading the most recent version of our CLI tool dynamically, bypassing any local caching issues!
18
+
17
19
  Run the following command anywhere in your terminal:
18
20
  ```bash
19
- npx create-express-kickstart <your-project-name>
21
+ npx create-express-kickstart@latest <your-project-name>
20
22
  ```
21
23
 
22
24
  **Example:**
23
25
  ```bash
24
- npx create-express-kickstart my-awesome-api
26
+ npx create-express-kickstart@latest my-awesome-api
25
27
  ```
26
28
 
27
29
  ### 2. What happens under the hood?
package/bin/cli.js CHANGED
@@ -266,7 +266,6 @@ async function init() {
266
266
  if (initAuth) {
267
267
  dependenciesToInstall.push('jsonwebtoken', 'bcryptjs'); // Add bcryptjs too since it's standard with JWT
268
268
  }
269
- const depString = dependenciesToInstall.join(' ');
270
269
 
271
270
  const devDependenciesToInstall = ['nodemon'];
272
271
  if (deps.prettier) devDependenciesToInstall.push('prettier');
@@ -274,32 +273,30 @@ async function init() {
274
273
  if (initTests) {
275
274
  devDependenciesToInstall.push('jest', 'supertest');
276
275
  }
277
- const devDepString = devDependenciesToInstall.join(' ');
278
276
 
279
- console.log(`\n⏳ Installing selected core dependencies (${dependenciesToInstall.join(', ')}). This might take a minute...`);
280
277
  try {
281
- let installCmd = packageManager === 'yarn' ? 'yarn add'
282
- : packageManager === 'pnpm' ? 'pnpm add'
283
- : packageManager === 'bun' ? 'bun add'
284
- : 'npm install';
285
-
286
- let installDevCmd = packageManager === 'yarn' ? 'yarn add -D'
287
- : packageManager === 'pnpm' ? 'pnpm add -D'
288
- : packageManager === 'bun' ? 'bun add -d'
289
- : 'npm install --save-dev';
290
-
291
- if (depString) {
292
- execSync(`${installCmd} ${depString}`, {
293
- cwd: projectPath,
294
- stdio: 'inherit'
295
- });
296
- }
278
+ const execConfig = { cwd: projectPath, stdio: 'inherit' };
297
279
 
298
- console.log(`\n⏳ Installing latest dev dependencies (${devDepString})...`);
299
- execSync(`${installDevCmd} ${devDepString}`, {
300
- cwd: projectPath,
301
- stdio: 'inherit'
302
- });
280
+ // Inject dependencies directly into package.json instead of doing them via raw arguments.
281
+ // This perfectly bypasses PNPM / YARN / BUN specific registry caching bugs when downloading deeply nested trees.
282
+ console.log(`\n⏳ Configuring ${packageManager} and resolving dependency trees...`);
283
+ const finalPackageJsonPath = path.join(projectPath, 'package.json');
284
+ const finalPackageJsonCode = JSON.parse(fs.readFileSync(finalPackageJsonPath, 'utf8'));
285
+
286
+ // We add them dynamically so package managers can evaluate them holistically at once
287
+ const latestDeps = {};
288
+ dependenciesToInstall.forEach(d => latestDeps[d] = 'latest');
289
+ finalPackageJsonCode.dependencies = latestDeps;
290
+
291
+ const latestDevDeps = {};
292
+ devDependenciesToInstall.forEach(d => latestDevDeps[d] = 'latest');
293
+ finalPackageJsonCode.devDependencies = latestDevDeps;
294
+
295
+ fs.writeFileSync(finalPackageJsonPath, JSON.stringify(finalPackageJsonCode, null, 2));
296
+
297
+ console.log(`\n⏳ Running final installation via ${packageManager} (This might take a minute)...`);
298
+ const installTriggerCmd = packageManager === 'npm' ? 'npm install' : `${packageManager} install`;
299
+ execSync(installTriggerCmd, execConfig);
303
300
 
304
301
  if (initGit) {
305
302
  console.log(`\n🌱 Initializing Git repository...`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-express-kickstart",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Production-ready CLI starter for Express APIs",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
@@ -1,10 +0,0 @@
1
- PORT=8000
2
- MONGODB_URI=mongodb://localhost:27017/
3
- CORS_ORIGIN=*
4
- NODE_ENV=development
5
-
6
- # Rate Limiting
7
- RATE_LIMIT_WINDOW_MS=900000 # 15 minutes in milliseconds
8
- RATE_LIMIT_MAX=100 # Maximum requests per windowMs
9
-
10
- JWT_SECRET=supersecretjwtkey123