Bläddra i källkod

Merge pull request #2497 from pyth-network/cprussin/fix-vercel-corepack

fix: fix vercel's use of corepack during the ignoreCommand
Connor Prussin 8 månader sedan
förälder
incheckning
3bc88d782c

+ 1 - 0
.gitignore

@@ -24,3 +24,4 @@ __pycache__
 .next
 .turbo/
 .cursorrules
+.corepack

+ 1 - 4
apps/api-reference/vercel.json

@@ -1,7 +1,4 @@
 {
   "$schema": "https://openapi.vercel.sh/vercel.json",
-  "ignoreCommand": "pnpm dlx turbo-ignore --fallback=HEAD^",
-  "env": {
-    "ENABLE_EXPERIMENTAL_COREPACK": "1"
-  }
+  "ignoreCommand": "../../vercel-ignore.sh"
 }

+ 1 - 4
apps/entropy-debugger/vercel.json

@@ -1,7 +1,4 @@
 {
   "$schema": "https://openapi.vercel.sh/vercel.json",
-  "ignoreCommand": "pnpm dlx turbo-ignore --fallback=HEAD^",
-  "env": {
-    "ENABLE_EXPERIMENTAL_COREPACK": "1"
-  }
+  "ignoreCommand": "../../vercel-ignore.sh"
 }

+ 1 - 4
apps/insights/vercel.json

@@ -1,7 +1,4 @@
 {
   "$schema": "https://openapi.vercel.sh/vercel.json",
-  "ignoreCommand": "pnpm dlx turbo-ignore --fallback=HEAD^",
-  "env": {
-    "ENABLE_EXPERIMENTAL_COREPACK": "1"
-  }
+  "ignoreCommand": "../../vercel-ignore.sh"
 }

+ 1 - 4
apps/staking/vercel.json

@@ -1,7 +1,4 @@
 {
   "$schema": "https://openapi.vercel.sh/vercel.json",
-  "ignoreCommand": "pnpm dlx turbo-ignore --fallback=HEAD^",
-  "env": {
-    "ENABLE_EXPERIMENTAL_COREPACK": "1"
-  }
+  "ignoreCommand": "../../vercel-ignore.sh"
 }

+ 1 - 4
governance/xc_admin/packages/xc_admin_frontend/vercel.json

@@ -1,7 +1,4 @@
 {
   "$schema": "https://openapi.vercel.sh/vercel.json",
-  "ignoreCommand": "pnpm dlx turbo-ignore --fallback=HEAD^",
-  "env": {
-    "ENABLE_EXPERIMENTAL_COREPACK": "1"
-  }
+  "ignoreCommand": "../../../../vercel-ignore.sh"
 }

+ 2 - 5
packages/component-library/vercel.json

@@ -1,10 +1,7 @@
 {
   "$schema": "https://openapi.vercel.sh/vercel.json",
   "buildCommand": "turbo --filter @pythnetwork/component-library build:storybook",
-  "ignoreCommand": "pnpm dlx turbo-ignore --fallback=HEAD^",
+  "ignoreCommand": "../../vercel-ignore.sh",
   "framework": null,
-  "outputDirectory": "storybook-static",
-  "env": {
-    "ENABLE_EXPERIMENTAL_COREPACK": "1"
-  }
+  "outputDirectory": "storybook-static"
 }

+ 14 - 0
vercel-ignore.sh

@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Vercel currently does not properly enable corepack when running the
+# ignoreCommand.  This was recommended as a stopgap by Vercel support until they
+# fix that issue.
+COREPACK_ROOT="$PWD/.corepack"
+COREPACK_SHIM="$COREPACK_ROOT/shim"
+export COREPACK_HOME="$COREPACK_ROOT/home"
+export PATH="$COREPACK_SHIM:$PATH"
+mkdir -p "$COREPACK_HOME"
+mkdir -p "$COREPACK_SHIM"
+corepack enable --install-directory "$COREPACK_SHIM"
+
+exec pnpm dlx turbo-ignore --fallback=HEAD^