From db96a836cf9bd3b88f24aa9d646fc2f531ce1f93 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Mon, 6 Oct 2025 15:11:00 +0100 Subject: [PATCH 1/3] Run lint in CI and fix issues with vscode extension eslint was erroring when run via the vscode extension, but not via the CLI. Didn't look too deeply into it the root cause suggests it's an issue with eslint and pnpm. I've added the suggested incantation to publicHoistPattern and it seems to work now, so I'm not asking anymore questions... --- .github/workflows/test.yml | 32 ++++++++++++++++++++++++++++++++ pnpm-workspace.yaml | 4 ++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c31239b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: Test + +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v3 + with: + version: 9 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + registry-url: "https://registry.npmjs.org" + + - run: pnpm install --frozen-lockfile + + - name: Run Lint + run: pnpm lint + + - name: Build packages + run: pnpm build + + - name: Run tests + run: pnpm test diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index d7e0935..852dcc8 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -8,3 +8,7 @@ onlyBuiltDependencies: - sharp - unrs-resolver - utf-8-validate +publicHoistPattern: + # https://github.com/pnpm/pnpm/issues/8878#issuecomment-2546442011 + - "@next/eslint-plugin-next" + - "eslint-plugin-react-hooks" From 488bcc99ef4b68b2785b601b72a2d8b7c746b93d Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Tue, 7 Oct 2025 09:17:03 +0100 Subject: [PATCH 2/3] Ensure that the `window.location` is only run on the client It was previously failing to build in CI because the initial render happens on the server, where `window` is not defiend. --- src/app/oauth/callback/page.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/oauth/callback/page.tsx b/src/app/oauth/callback/page.tsx index b41a407..b4d5be4 100644 --- a/src/app/oauth/callback/page.tsx +++ b/src/app/oauth/callback/page.tsx @@ -9,13 +9,13 @@ export default function OAuthCallback() { const [oauthError, setOAuthError] = useState(null); const [timedOut, setTimedOut] = useState(false); - const params = new URLSearchParams(window.location.search); - const code = params.get("code"); - const state = params.get("state"); - // complete the oauth flow and exchange the code for an access token useEffect(() => { const processOAuthCallback = async () => { + const params = new URLSearchParams(window.location.search); + const code = params.get("code"); + const state = params.get("state"); + // the user is already authenticated, nothing to do if (!ready || authenticated || !code || !state) { return; @@ -35,7 +35,7 @@ export default function OAuthCallback() { }; processOAuthCallback(); - }, [authenticated, completeOAuth, code, ready, state]); + }, [authenticated, completeOAuth, ready]); // fetch the user's available entities after they've been authenticated useEffect(() => { From 7b69fc49cea019769acf7125e162d8442ea74109 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Tue, 7 Oct 2025 09:19:55 +0100 Subject: [PATCH 3/3] Don't run tests because there aren't any --- .github/workflows/{test.yml => lint.yml} | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) rename .github/workflows/{test.yml => lint.yml} (89%) diff --git a/.github/workflows/test.yml b/.github/workflows/lint.yml similarity index 89% rename from .github/workflows/test.yml rename to .github/workflows/lint.yml index c31239b..26d108e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Test +name: Lint on: pull_request: @@ -27,6 +27,3 @@ jobs: - name: Build packages run: pnpm build - - - name: Run tests - run: pnpm test