Skip to content

Commit 0cee947

Browse files
committed
fix: make create-app work with pnpm
1 parent d7b497b commit 0cee947

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

adminforth/commands/createApp/templates/package.json.hbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"license": "ISC",
99
"description": "",
1010
"scripts": {
11-
"dev": "pnpm _env:dev -- tsx watch index.ts",
12-
"prod": "pnpm _env:prod -- tsx index.ts",
11+
"dev": "pnpm _env:dev tsx watch index.ts",
12+
"prod": "pnpm _env:prod tsx index.ts",
1313
"start": "pnpm dev",
14-
"makemigration": "pnpm _env:dev -- npx --yes prisma migrate dev --create-only",
15-
"migrate:local": "pnpm _env:dev -- npx --yes prisma migrate deploy",
16-
"migrate:prod": "pnpm _env:prod -- npx --yes prisma migrate deploy",
14+
"makemigration": "pnpm _env:dev npx --yes prisma migrate dev --create-only",
15+
"migrate:local": "pnpm _env:dev npx --yes prisma migrate deploy",
16+
"migrate:prod": "pnpm _env:prod npx --yes prisma migrate deploy",
1717
"_env:dev": "dotenvx run -f .env -f .env.local --",
1818
"_env:prod": "dotenvx run -f .env.prod --"
1919
},
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
onlyBuiltDependencies:
2+
- better-sqlite3

adminforth/commands/createApp/utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,11 @@ async function writeTemplateFiles(dirname, cwd, options) {
338338
data: {
339339
sqliteFile,
340340
},
341+
},
342+
{
343+
src: 'pnpm-workspace.yaml.hbs',
344+
dest: 'pnpm-workspace.yaml',
345+
data: {},
341346
}
342347
];
343348

@@ -387,7 +392,7 @@ function generateFinalInstructions(skipPrismaSetup, options) {
387392

388393
instruction += `
389394
${chalk.dim('// Generate and apply initial migration')}
390-
${chalk.dim('$')}${chalk.cyan(' pnpm makemigration -- --name init && pnpm migrate:local')}\n`;
395+
${chalk.dim('$')}${chalk.cyan(' pnpm makemigration --name init && pnpm migrate:local')}\n`;
391396

392397
instruction += `
393398
${chalk.dim('// Start dev server with tsx watch for hot-reloading')}

adminforth/documentation/docs/tutorial/001-gettingStarted.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ myadmin/
8181
CLI will suggest you a command to initialize the database with Prisma:
8282

8383
```bash
84-
pnpm makemigration -- --name init
84+
pnpm makemigration --name init
8585
```
8686

8787
This will create a migration file in `migrations` and apply it to the database.
8888

8989
In future, when you need to add new resources, you need to modify `schema.prisma` (add models, change fields, etc.). After doing any modification you need to create a new migration using next command:
9090

9191
```bash
92-
pnpm makemigration -- --name init ; pnpm migrate:local
92+
pnpm makemigration --name init ; pnpm migrate:local
9393
```
9494

9595
Other developers need to pull migration and run `pnpm migrate:local` to apply any unapplied migrations.

0 commit comments

Comments
 (0)