From 20efa5b2b60887a7910ffb94b089bffe2875e18d Mon Sep 17 00:00:00 2001 From: AshGw Date: Fri, 17 Jan 2025 18:07:56 +0100 Subject: [PATCH 1/4] fix: remove `isBrowser` check error --- packages/env/index.ts | 5 +++-- packages/env/tsconfig.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/env/index.ts b/packages/env/index.ts index fdb4b588..868dcda4 100644 --- a/packages/env/index.ts +++ b/packages/env/index.ts @@ -5,6 +5,8 @@ import { createEnv } from "@ashgw/ts-env"; config({ path: require("path").resolve(__dirname, "../../.env") }); +const isBrowser = typeof window !== "undefined"; + export const env = createEnv({ vars: { NODE_ENV: z.enum(["production", "development", "preview"]), @@ -15,6 +17,5 @@ export const env = createEnv({ }, disablePrefix: ["NODE_ENV"], prefix: "NEXT_PUBLIC", - // @ts-expect-error skip in browser - skipValidation: typeof window === "undefined" ? false : true, + skipValidation: isBrowser, }); diff --git a/packages/env/tsconfig.json b/packages/env/tsconfig.json index 99fa424f..9a946ec1 100644 --- a/packages/env/tsconfig.json +++ b/packages/env/tsconfig.json @@ -1,5 +1,6 @@ { "extends": "@ashgw/tsconfig/base.json", "include": ["."], + "compilerOptions": { "lib": ["DOM", "ES2022"] }, "exclude": ["node_modules"] } From 47aa2f4b152c7a0d0ee5dd894aa40b14b52673ac Mon Sep 17 00:00:00 2001 From: AshGw Date: Fri, 17 Jan 2025 19:05:08 +0100 Subject: [PATCH 2/4] ci: fix CI name --- .github/workflows/label.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index b24c72a1..36fd2f3f 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -1,5 +1,6 @@ # this auto labels PRs based on the configuration file # have a look at ./github/labeler.yml` +name: CI on: - pull_request_target @@ -17,4 +18,4 @@ jobs: with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true - configuration-path: ./github/labeler.yml + configuration-path: ./github/labeler.yml` From a24d9fb94acd235b190aeb2ed8e173ab0948ad3c Mon Sep 17 00:00:00 2001 From: AshGw Date: Fri, 17 Jan 2025 19:07:19 +0100 Subject: [PATCH 3/4] fix: config path --- .github/workflows/label.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 36fd2f3f..158955e5 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -18,4 +18,4 @@ jobs: with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true - configuration-path: ./github/labeler.yml` + configuration-path: ../github/labeler.yml` From b7ec671962fc9ab8d0189c2e368efa8c4119560c Mon Sep 17 00:00:00 2001 From: AshGw Date: Fri, 17 Jan 2025 19:11:27 +0100 Subject: [PATCH 4/4] fix: remove path --- .github/workflows/label.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 158955e5..d9326dd4 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -18,4 +18,3 @@ jobs: with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true - configuration-path: ../github/labeler.yml`