From 6f57d498a4639262084cacd00e7c0e48ce3563d6 Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Sat, 26 Oct 2024 16:53:08 +0300 Subject: [PATCH 1/3] build: drop prisma build --- .github/actions/vercel/action.yaml | 2 +- .github/workflows/migrate.yaml | 6 ------ apps/builder/package.json | 1 - package.json | 2 +- packages/prisma-client/migrations-cli/args.ts | 4 ++++ packages/prisma-client/migrations-cli/cli.ts | 4 +++- packages/prisma-client/package.json | 6 ------ pnpm-lock.yaml | 3 --- 8 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/actions/vercel/action.yaml b/.github/actions/vercel/action.yaml index 3a9cf705be45..1bf12577942a 100644 --- a/.github/actions/vercel/action.yaml +++ b/.github/actions/vercel/action.yaml @@ -61,7 +61,7 @@ runs: "framework": "remix", "devCommand": "pnpm dev", "installCommand": "pnpm install", - "buildCommand": "pnpm --filter=@webstudio-is/prisma-client build:prod && pnpm --filter=@webstudio-is/http-client build && pnpm --filter=@webstudio-is/builder build", + "buildCommand": "pnpm --filter=@webstudio-is/http-client build && pnpm --filter=@webstudio-is/builder build", "outputDirectory": null, "rootDirectory": "apps/builder", "directoryListing": false, diff --git a/.github/workflows/migrate.yaml b/.github/workflows/migrate.yaml index e87db669b661..cfe4e282f1cc 100644 --- a/.github/workflows/migrate.yaml +++ b/.github/workflows/migrate.yaml @@ -49,9 +49,6 @@ jobs: - name: pnpm instal run: pnpm install --ignore-scripts - - name: build prisma client - run: pnpm --filter '@webstudio-is/prisma-client...' run build - - name: execute migration run: pnpm --filter '@webstudio-is/prisma-client' run migrations migrate env: @@ -105,9 +102,6 @@ jobs: - name: pnpm instal run: pnpm install --ignore-scripts - - name: build prisma client - run: pnpm --filter '@webstudio-is/prisma-client...' run build - - name: get pending id: pending run: | diff --git a/apps/builder/package.json b/apps/builder/package.json index 2eb42e9cc4b1..414615dd96c4 100644 --- a/apps/builder/package.json +++ b/apps/builder/package.json @@ -134,7 +134,6 @@ "@types/react": "^18.2.70", "@types/react-dom": "^18.2.25", "@webstudio-is/jest-config": "workspace:*", - "@webstudio-is/prisma-client": "workspace:*", "@webstudio-is/tsconfig": "workspace:*", "html-tags": "^4.0.0", "react-router-dom": "^6.26.2", diff --git a/package.json b/package.json index 04433bc9f2de..cf334f23dd2a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "format": "prettier --write \"**/*.{ts,tsx,md}\"", "storybook:dev": "storybook dev -p 6006", "storybook:build": "storybook build", - "migrations": "cd apps/builder && pnpm migrations --dev", + "migrations": "pnpm --filter=./packages/prisma-client migrations --dev --cwd ../../apps/builder", "build-figma-tokens": "cd packages/design-system && pnpm build-figma-tokens", "prepare": "which git && git config core.hooksPath .git/hooks/ && simple-git-hooks || echo git not installed", "local:version-snapshot": "pnpm -r exec pnpm version prepatch --preid $(cat /dev/urandom | LC_ALL=C tr -dc 'a-z' | fold -w 8 | head -n 1)", diff --git a/packages/prisma-client/migrations-cli/args.ts b/packages/prisma-client/migrations-cli/args.ts index 3587f1ad225f..b44102a0870c 100644 --- a/packages/prisma-client/migrations-cli/args.ts +++ b/packages/prisma-client/migrations-cli/args.ts @@ -4,6 +4,10 @@ export const { values, positionals } = parseArgs({ args: process.argv.slice(2), allowPositionals: true, options: { + cwd: { + type: "string", + default: "./", + }, dev: { type: "boolean", }, diff --git a/packages/prisma-client/migrations-cli/cli.ts b/packages/prisma-client/migrations-cli/cli.ts index 2ef0cc52b193..a9644bfe532c 100755 --- a/packages/prisma-client/migrations-cli/cli.ts +++ b/packages/prisma-client/migrations-cli/cli.ts @@ -1,11 +1,13 @@ #!/usr/bin/env tsx -import { loadEnvFile } from "node:process"; +import { chdir, loadEnvFile } from "node:process"; import * as commands from "./commands"; import * as logger from "./logger"; import * as args from "./args"; import { UserError } from "./errors"; +chdir(args.values.cwd); + const USAGE = `Usage: migrations [--dev] Commands: diff --git a/packages/prisma-client/package.json b/packages/prisma-client/package.json index 1c37a671cb50..402cfa14ef28 100644 --- a/packages/prisma-client/package.json +++ b/packages/prisma-client/package.json @@ -8,13 +8,7 @@ "scripts": { "typecheck": "tsc", "dev": "pnpm build", - "build": "prisma format && pnpm generate && esbuild src/prisma.ts --outdir=lib --format=cjs && cp src/cjs/package.json lib && rm -rf lib/__generated__ && cp -r src/__generated__ lib/__generated__ && pnpm dts", "generate": "PRISMA_BINARY_TARGET=${PRISMA_BINARY_TARGET:-'[\"native\"]'} prisma generate", - "build:prod": "PRISMA_BINARY_TARGET='[\"rhel-openssl-3.0.x\"]' pnpm build", - "dts": "tsc --declarationDir lib", - "migrations": "./migrations-cli/cli.ts" - }, - "bin": { "migrations": "./migrations-cli/cli.ts" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fe87e225eb60..0536e81d2181 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -467,9 +467,6 @@ importers: '@webstudio-is/jest-config': specifier: workspace:* version: link:../../packages/jest-config - '@webstudio-is/prisma-client': - specifier: workspace:* - version: link:../../packages/prisma-client '@webstudio-is/tsconfig': specifier: workspace:* version: link:../../packages/tsconfig From 8349a7c606df76d97c4fcab05df696ba4564ec35 Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Sat, 26 Oct 2024 16:55:56 +0300 Subject: [PATCH 2/3] Remove typecheck and dev scripts --- packages/prisma-client/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/prisma-client/package.json b/packages/prisma-client/package.json index 402cfa14ef28..5d767456f4b3 100644 --- a/packages/prisma-client/package.json +++ b/packages/prisma-client/package.json @@ -6,8 +6,6 @@ "homepage": "https://webstudio.is", "type": "module", "scripts": { - "typecheck": "tsc", - "dev": "pnpm build", "generate": "PRISMA_BINARY_TARGET=${PRISMA_BINARY_TARGET:-'[\"native\"]'} prisma generate", "migrations": "./migrations-cli/cli.ts" }, From 75f92a62ada1e99614288779e902d27ec00ea01f Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Sat, 26 Oct 2024 17:03:23 +0300 Subject: [PATCH 3/3] Remove ci:migrate script --- apps/builder/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/builder/package.json b/apps/builder/package.json index 414615dd96c4..3dbec9532cd4 100644 --- a/apps/builder/package.json +++ b/apps/builder/package.json @@ -13,8 +13,7 @@ "dev": "remix vite:dev", "dev:auth": "DEBUG=OAuth2Strategy,ws:* remix vite:dev", "typecheck": "tsc --noEmit --emitDeclarationOnly false", - "test": "NODE_OPTIONS=--experimental-vm-modules jest", - "ci:migrate": "migrations migrate" + "test": "NODE_OPTIONS=--experimental-vm-modules jest" }, "dependencies": { "@atlaskit/pragmatic-drag-and-drop": "^1.3.1",