diff --git a/.github/codecov.yml b/.github/codecov.yml index cb06b78f0..6fe451a7f 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -8,4 +8,4 @@ coverage: default: informational: true ignore: - - "**/*.tsx" \ No newline at end of file + - "**/*.tsx" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index df4d15b35..d202a332d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,6 +1,5 @@ version: 2 updates: - - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af770d266..d7057919f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,4 +38,4 @@ jobs: uses: codecov/codecov-action@v4 with: name: ${{ matrix.os }} - files: cov.lcov \ No newline at end of file + files: cov.lcov diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dec0be6d3..fe36061d4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -31,4 +31,4 @@ jobs: uses: denoland/deployctl@v1 with: project: saaskit # 📝 Update the deploy project name if necessary - entrypoint: ./main.ts # 📝 Update the entrypoint if necessary \ No newline at end of file + entrypoint: ./main.ts # 📝 Update the entrypoint if necessary diff --git a/docker-compose.yml b/docker-compose.yml index e5748edf9..066e5451c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: "3" services: web: @@ -13,4 +13,4 @@ services: - STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET} - STRIPE_PREMIUM_PLAN_PRICE_ID=${STRIPE_PREMIUM_PLAN_PRICE_ID} ports: - - "8000:8000" \ No newline at end of file + - "8000:8000" diff --git a/e2e_test.ts b/e2e_test.ts index 7ac8022f0..445d69dc4 100644 --- a/e2e_test.ts +++ b/e2e_test.ts @@ -149,7 +149,7 @@ Deno.test("[e2e] GET /callback", async (test) => { }; const stripeRespBody: Partial> = { id }; const fetchStub = stub( - window, + globalThis, "fetch", returnsNext([ Promise.resolve(Response.json(githubRespBody)), @@ -187,7 +187,7 @@ Deno.test("[e2e] GET /callback", async (test) => { }; const stripeRespBody: Partial> = { id }; const fetchStub = stub( - window, + globalThis, "fetch", returnsNext([ Promise.resolve(Response.json(githubRespBody)), @@ -881,6 +881,9 @@ Deno.test("[e2e] GET /account/upgrade", async (test) => { await createUser(user); await test.step("serves internal server error response if the `STRIPE_PREMIUM_PLAN_PRICE_ID` environment variable is not set", async () => { + // Suppress the error message thrown by the handler + const stubbedError = stub(console, "error"); + setupEnv( { "STRIPE_PREMIUM_PLAN_PRICE_ID": null }, ); @@ -893,6 +896,8 @@ Deno.test("[e2e] GET /account/upgrade", async (test) => { assertEquals(resp.status, STATUS_CODE.InternalServerError); assertHtml(resp); + + stubbedError.restore(); }); await test.step("serves not found response if Stripe is disabled", async () => { diff --git a/islands/ItemsList.tsx b/islands/ItemsList.tsx index f5e3dbca8..dd26cf781 100644 --- a/islands/ItemsList.tsx +++ b/islands/ItemsList.tsx @@ -146,7 +146,7 @@ export default function ItemsList(props: ItemsListProps) { itemsSig.value = [...itemsSig.value, ...values]; cursorSig.value = cursor; } catch (error) { - console.error(error.message); + console.error((error as Error).message); } finally { isLoadingSig.value = false; } diff --git a/islands/UsersTable.tsx b/islands/UsersTable.tsx index 35aca107b..7587fed7b 100644 --- a/islands/UsersTable.tsx +++ b/islands/UsersTable.tsx @@ -58,7 +58,7 @@ export default function UsersTable(props: UsersTableProps) { usersSig.value = [...usersSig.value, ...values]; cursorSig.value = cursor; } catch (error) { - console.log(error.message); + console.log((error as Error).message); } finally { isLoadingSig.value = false; } diff --git a/plugins/blog/routes/blog/[slug].tsx b/plugins/blog/routes/blog/[slug].tsx index 55c01b9cf..5862eb475 100644 --- a/plugins/blog/routes/blog/[slug].tsx +++ b/plugins/blog/routes/blog/[slug].tsx @@ -1,6 +1,6 @@ // Copyright 2023-2024 the Deno authors. All rights reserved. MIT license. import { defineRoute } from "$fresh/server.ts"; -import { CSS, render } from "https://deno.land/x/gfm@0.2.5/mod.ts"; +import { CSS, render } from "jsr:@deno/gfm"; import { getPost } from "../../utils/posts.ts"; import Head from "@/components/Head.tsx"; import Share from "../../components/Share.tsx"; diff --git a/plugins/error_handling.ts b/plugins/error_handling.ts index 29e3cd36d..9a2b1524c 100644 --- a/plugins/error_handling.ts +++ b/plugins/error_handling.ts @@ -47,8 +47,8 @@ export default { try { return await ctx.next(); } catch (error) { - const status = toErrorStatus(error); - return new Response(error.message, { + const status = toErrorStatus(error as Error); + return new Response((error as Error).message, { statusText: STATUS_TEXT[status], status, }); diff --git a/routes/api/stripe-webhooks.ts b/routes/api/stripe-webhooks.ts index e599ae42a..d915bf70f 100644 --- a/routes/api/stripe-webhooks.ts +++ b/routes/api/stripe-webhooks.ts @@ -41,7 +41,7 @@ export const handler: Handlers = { cryptoProvider, ); } catch (error) { - throw new BadRequestError(error.message); + throw new BadRequestError((error as Error).message); } // @ts-ignore: Property 'customer' actually does exist on type 'Object' diff --git a/static/styles.css b/static/styles.css index 4704e327a..f3f5e13d3 100644 --- a/static/styles.css +++ b/static/styles.css @@ -2,11 +2,15 @@ @tailwind components; @tailwind utilities; .button-styles { - @apply px-4 py-2 bg-primary text-white rounded-lg border border-primary transition duration-100 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-transparent hover:text-primary; + @apply px-4 py-2 bg-primary text-white rounded-lg border border-primary + transition duration-100 disabled:opacity-50 disabled:cursor-not-allowed + hover:bg-transparent hover:text-primary; } .input-styles { - @apply px-4 py-2 bg-transparent rounded-lg outline-none border border-gray-300 hover:border-black transition duration-100 disabled:opacity-50 disabled:cursor-not-allowed hover:dark:border-white; + @apply px-4 py-2 bg-transparent rounded-lg outline-none border border-gray-300 + hover:border-black transition duration-100 disabled:opacity-50 + disabled:cursor-not-allowed hover:dark:border-white; } .site-bar-styles { @@ -14,7 +18,8 @@ } .nav-styles { - @apply flex flex-wrap justify-start gap-x-8 gap-y-4 items-center justify-between h-full; + @apply flex flex-wrap justify-start gap-x-8 gap-y-4 items-center + justify-between h-full; } .nav-item { @@ -22,7 +27,8 @@ } .link-styles { - @apply text-gray-500 transition duration-100 hover:text-black hover:dark:text-white; + @apply text-gray-500 transition duration-100 hover:text-black + hover:dark:text-white; } /* .active-link-styles { diff --git a/utils/db.ts b/utils/db.ts index 444d40c7e..4012be565 100644 --- a/utils/db.ts +++ b/utils/db.ts @@ -1,4 +1,7 @@ // Copyright 2023-2024 the Deno authors. All rights reserved. MIT license. + +/// + import { ulid } from "$std/ulid/mod.ts"; const DENO_KV_PATH_KEY = "DENO_KV_PATH"; diff --git a/utils/github_test.ts b/utils/github_test.ts index 07784cc93..5dcfe2bf4 100644 --- a/utils/github_test.ts +++ b/utils/github_test.ts @@ -10,7 +10,7 @@ Deno.test("[plugins] getGitHubUser()", async (test) => { await test.step("rejects on error message", async () => { const message = crypto.randomUUID(); const fetchStub = stub( - window, + globalThis, "fetch", returnsNext([ Promise.resolve( @@ -29,7 +29,7 @@ Deno.test("[plugins] getGitHubUser()", async (test) => { await test.step("resolves to a GitHub user object", async () => { const body = { login: crypto.randomUUID(), email: crypto.randomUUID() }; const fetchStub = stub( - window, + globalThis, "fetch", returnsNext([Promise.resolve(Response.json(body))]), );