From 32640469b1bbb6489af4f920e83e57d4cad2deb9 Mon Sep 17 00:00:00 2001 From: fullykubed Date: Wed, 20 Mar 2024 11:46:24 -0400 Subject: [PATCH] fix: fixes linting breaking the dev site --- packages/nix/devenv/lint.sh | 8 ++++++++ packages/nix/devenv/precommit-website.sh | 1 + packages/website/.gitignore | 3 +++ packages/website/next.config.mjs | 3 ++- packages/website/tsconfig.json | 4 +++- 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/nix/devenv/lint.sh b/packages/nix/devenv/lint.sh index 8eea9b1e..2c7f59e6 100755 --- a/packages/nix/devenv/lint.sh +++ b/packages/nix/devenv/lint.sh @@ -7,6 +7,14 @@ set -eo pipefail # Needed to avoid running out of memory export NODE_OPTIONS="--max-old-space-size=8192" +####################################### +## Install node modules +####################################### +( + cd "$DEVENV_ROOT" + npm i +) + ####################################### ## Terraform ####################################### diff --git a/packages/nix/devenv/precommit-website.sh b/packages/nix/devenv/precommit-website.sh index 7f30f412..980ea02c 100644 --- a/packages/nix/devenv/precommit-website.sh +++ b/packages/nix/devenv/precommit-website.sh @@ -4,6 +4,7 @@ set -eo pipefail ( cd "$DEVENV_ROOT/packages/website" + export LINT=true npm i ./node_modules/.bin/next build ) diff --git a/packages/website/.gitignore b/packages/website/.gitignore index 4f360c89..00f59d94 100644 --- a/packages/website/.gitignore +++ b/packages/website/.gitignore @@ -36,3 +36,6 @@ yarn-error.log* next-env.d.ts .vscode + +.lint +build \ No newline at end of file diff --git a/packages/website/next.config.mjs b/packages/website/next.config.mjs index 89deab81..82cbaeff 100644 --- a/packages/website/next.config.mjs +++ b/packages/website/next.config.mjs @@ -18,7 +18,8 @@ const withMDX = createMDX({ /** @type {import('next').NextConfig} */ const nextConfig = { - pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'] + pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'], + distDir: process.env.LINT === "true" ? '.lint' : 'build' } export default withBundleAnalyzer(withMDX(nextConfig)) diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json index e4e85ce9..c6b89b94 100644 --- a/packages/website/tsconfig.json +++ b/packages/website/tsconfig.json @@ -45,7 +45,9 @@ "next-env.d.ts", "src/**/*.ts", "src/**/*.tsx", - ".next/types/**/*.ts" + ".next/types/**/*.ts", + "build/types/**/*.ts", + ".lint/types/**/*.ts" ], "exclude": [ "node_modules"