From 41608c4c34e801a0d7895cd69b58c0009147b127 Mon Sep 17 00:00:00 2001 From: Aleksandra Date: Mon, 8 Aug 2022 17:57:39 +0200 Subject: [PATCH] Run codegen tasks after installing dependecies in the new command (#3692) --- .changeset/rotten-rocks-remember.md | 5 +++++ packages/blitz/src/cli/commands/new.ts | 5 +++++ pnpm-lock.yaml | 4 ++++ 3 files changed, 14 insertions(+) create mode 100644 .changeset/rotten-rocks-remember.md diff --git a/.changeset/rotten-rocks-remember.md b/.changeset/rotten-rocks-remember.md new file mode 100644 index 0000000000..960d86d400 --- /dev/null +++ b/.changeset/rotten-rocks-remember.md @@ -0,0 +1,5 @@ +--- +"blitz": patch +--- + +Run codegen tasks after creating a new app if user chose yarn as a package manager diff --git a/packages/blitz/src/cli/commands/new.ts b/packages/blitz/src/cli/commands/new.ts index 847a2bddac..c8abe41440 100644 --- a/packages/blitz/src/cli/commands/new.ts +++ b/packages/blitz/src/cli/commands/new.ts @@ -8,6 +8,7 @@ import {AppGenerator, AppGeneratorOptions, getLatestVersion} from "@blitzjs/gene import {loadEnvConfig} from "../../utils/env" import {runPrisma} from "../../utils/run-prisma" import {checkLatestVersion} from "../utils/check-latest-version" +import {codegenTasks} from "../utils/codegen-tasks" const forms: Record = { finalform: "React Final Form (recommended)", @@ -269,6 +270,10 @@ const newApp: CliCommand = async (argv) => { ) const result = await runPrisma(["migrate", "dev", "--name", "Initial migration"], true) if (!result.success) throw new Error() + + if (projectPkgManger === "yarn") { + await codegenTasks() + } } catch (error) { postInstallSteps.push( "blitz prisma migrate dev (when asked, you can name the migration anything)", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 96d15f5a67..914ac3f3b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3060,6 +3060,7 @@ packages: semver: 5.7.1 transitivePeerDependencies: - supports-color + dev: false /@babel/preset-flow/7.17.12_@babel+core@7.18.2: resolution: @@ -5490,6 +5491,7 @@ packages: typescript: 4.6.3 transitivePeerDependencies: - supports-color + dev: false /@typescript-eslint/experimental-utils/5.28.0_hrkuebk64jiu2ut2d2sm4oylnu: resolution: @@ -9313,6 +9315,7 @@ packages: transitivePeerDependencies: - eslint-import-resolver-webpack - supports-color + dev: false /eslint-config-next/12.2.4_hrkuebk64jiu2ut2d2sm4oylnu: resolution: @@ -9350,6 +9353,7 @@ packages: hasBin: true peerDependencies: eslint: ">=7.0.0" + dev: false /eslint-config-prettier/8.5.0_eslint@7.32.0: resolution: