瀏覽代碼

Merge pull request #2070 from cprussin/fix-xc-admin-frontend-build

Fix xc-admin-frontend build
Connor Prussin 1 年之前
父節點
當前提交
ba27ebfa1f

+ 2 - 1
Dockerfile.node

@@ -16,7 +16,8 @@ USER pyth
 
 FROM builder-base AS builder
 ARG package
-RUN CI=true pnpm turbo build --filter $package
+ENV CI true
+RUN pnpm turbo build --filter $package
 RUN pnpm deploy --filter $package --prod /srv/$package
 
 

+ 1 - 10
apps/api-reference/eslint.config.js

@@ -6,13 +6,4 @@ const tailwindConfig = fileURLToPath(
   import.meta.resolve(`./tailwind.config.ts`),
 );
 
-export default [
-  ...nextjs,
-  ...tailwind(tailwindConfig),
-  ...storybook,
-  {
-    rules: {
-      "turbo/no-undeclared-env-vars": "off",
-    },
-  },
-];
+export default [...nextjs, ...tailwind(tailwindConfig), ...storybook];

+ 5 - 0
apps/api-reference/src/server-config.ts

@@ -2,6 +2,11 @@
 // and load all env variables.
 /* eslint-disable n/no-process-env */
 
+// Disable the following rule because variables in this file are only loaded at
+// runtime and do not influence the build outputs, thus they need not be
+// declared to turbo for it to be able to cache build outputs correctly.
+/* eslint-disable turbo/no-undeclared-env-vars */
+
 import "server-only";
 
 /**

+ 1 - 10
apps/staking/eslint.config.js

@@ -6,13 +6,4 @@ const tailwindConfig = fileURLToPath(
   import.meta.resolve(`./tailwind.config.ts`),
 );
 
-export default [
-  ...nextjs,
-  ...tailwind(tailwindConfig),
-  ...storybook,
-  {
-    rules: {
-      "turbo/no-undeclared-env-vars": "off",
-    },
-  },
-];
+export default [...nextjs, ...tailwind(tailwindConfig), ...storybook];

+ 5 - 0
apps/staking/src/config/server.ts

@@ -2,6 +2,11 @@
 // and load all env variables.
 /* eslint-disable n/no-process-env */
 
+// Disable the following rule because variables in this file are only loaded at
+// runtime and do not influence the build outputs, thus they need not be
+// declared to turbo for it to be able to cache build outputs correctly.
+/* eslint-disable turbo/no-undeclared-env-vars */
+
 import "server-only";
 
 /**

+ 2 - 1
governance/xc_admin/packages/xc_admin_frontend/Dockerfile

@@ -4,7 +4,8 @@ ARG NEXT_PUBLIC_RPC_POOL_TOKEN
 ENV NEXT_TELEMETRY_DISABLED 1
 ENV BUILD_STANDALONE true
 ENV NEXT_PUBLIC_RPC_POOL_TOKEN $NEXT_PUBLIC_RPC_POOL_TOKEN
-RUN CI=true pnpm turbo build --filter @pythnetwork/xc-admin-frontend
+ENV CI true
+RUN pnpm turbo build --filter @pythnetwork/xc-admin-frontend
 
 
 # See https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile

+ 2 - 1
governance/xc_admin/packages/xc_admin_frontend/turbo.json

@@ -4,7 +4,8 @@
   "tasks": {
     "build": {
       "dependsOn": ["pull:env", "^build"],
-      "outputs": [".next/**", "!.next/cache/**"]
+      "outputs": [".next/**", "!.next/cache/**"],
+      "env": ["BUILD_STANDALONE"]
     },
     "pull:env": {
       "outputs": [".env.local"],

+ 1 - 0
turbo.json

@@ -25,6 +25,7 @@
       "cache": false
     },
     "fix:lint": {
+      "dependsOn": ["^build"],
       "cache": false
     },
     "test": {