Skip to content

Commit 2169017

Browse files
committed
Merge branch 'main' of github.com:muneebhashone/typescript-backend-toolkit
2 parents 55af8da + fd538e7 commit 2169017

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

packages/create-tbk-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-tbk-app",
3-
"version": "0.3.14",
3+
"version": "0.3.15",
44
"description": "CLI tool to scaffold TypeScript Backend Toolkit projects",
55
"type": "module",
66
"bin": {

packages/create-tbk-app/src/generators/config.generator.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ export async function generateReadme(
270270
context: TemplateContext,
271271
): Promise<void> {
272272
const lines: string[] = [];
273+
const installCommand =
274+
config.packageManager === 'pnpm'
275+
? `${config.packageManager} install`
276+
: `${config.packageManager} install --force`;
273277

274278
lines.push(`# ${config.projectName}`);
275279
lines.push('');
@@ -356,7 +360,7 @@ export async function generateReadme(
356360
lines.push('1. Install dependencies:');
357361
lines.push('');
358362
lines.push('```bash');
359-
lines.push(`${config.packageManager} install`);
363+
lines.push(installCommand);
360364
lines.push('```');
361365
lines.push('');
362366
lines.push('2. Copy environment variables:');
@@ -488,15 +492,15 @@ export async function generateReadme(
488492
lines.push('');
489493
lines.push('```');
490494
lines.push('src/');
491-
lines.push('├── app/ # Application setup');
492-
lines.push('├── config/ # Configuration');
493-
lines.push('├── lib/ # Core libraries');
494-
lines.push('├── middlewares/ # Express middlewares');
495-
lines.push('├── modules/ # Feature modules');
496-
lines.push('├── plugins/ # Plugin system');
497-
lines.push('├── routes/ # Route registration');
498-
lines.push('├── utils/ # Utilities');
499-
lines.push('└── main.ts # Entry point');
495+
lines.push('??? app/ # Application setup');
496+
lines.push('??? config/ # Configuration');
497+
lines.push('??? lib/ # Core libraries');
498+
lines.push('??? middlewares/ # Express middlewares');
499+
lines.push('??? modules/ # Feature modules');
500+
lines.push('??? plugins/ # Plugin system');
501+
lines.push('??? routes/ # Route registration');
502+
lines.push('??? utils/ # Utilities');
503+
lines.push('??? main.ts # Entry point');
500504
lines.push('```');
501505
lines.push('');
502506

packages/create-tbk-app/src/generators/project.generator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ export async function generateProject(
7171
console.log(` cd ${config.projectName}`);
7272

7373
if (config.skipInstall) {
74-
console.log(` ${config.packageManager} install`);
74+
const installCommand =
75+
config.packageManager === 'pnpm'
76+
? `${config.packageManager} install`
77+
: `${config.packageManager} install --force`;
78+
console.log(` ${installCommand}`);
7579
}
7680

7781
console.log(' cp .env.example .env.development');

packages/create-tbk-app/src/utils/package-manager.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export async function installDependencies(
99
const command = packageManager;
1010
const args = ['install'];
1111

12+
if (packageManager === 'npm' || packageManager === 'yarn') {
13+
args.push('--force');
14+
}
15+
1216
const child = spawn(command, args, {
1317
cwd: targetDir,
1418
stdio: 'inherit',

0 commit comments

Comments
 (0)