Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken ci #694

Merged
merged 7 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ coverage:
default:
informational: true
ignore:
- "**/*.tsx"
- "**/*.tsx"
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
uses: codecov/codecov-action@v4
with:
name: ${{ matrix.os }}
files: cov.lcov
files: cov.lcov
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
entrypoint: ./main.ts # 📝 Update the entrypoint if necessary
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: "3"

services:
web:
Expand All @@ -13,4 +13,4 @@ services:
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
- STRIPE_PREMIUM_PLAN_PRICE_ID=${STRIPE_PREMIUM_PLAN_PRICE_ID}
ports:
- "8000:8000"
- "8000:8000"
9 changes: 7 additions & 2 deletions e2e_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Deno.test("[e2e] GET /callback", async (test) => {
};
const stripeRespBody: Partial<Stripe.Response<Stripe.Customer>> = { id };
const fetchStub = stub(
window,
globalThis,
"fetch",
returnsNext([
Promise.resolve(Response.json(githubRespBody)),
Expand Down Expand Up @@ -187,7 +187,7 @@ Deno.test("[e2e] GET /callback", async (test) => {
};
const stripeRespBody: Partial<Stripe.Response<Stripe.Customer>> = { id };
const fetchStub = stub(
window,
globalThis,
"fetch",
returnsNext([
Promise.resolve(Response.json(githubRespBody)),
Expand Down Expand Up @@ -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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const stubbedError = stub(console, "error");
using stubbedError = stub(console, "error");

Removes the need for stubbedError.restore(); below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS doesn't like it
Screenshot 2024-10-31 at 20 01 45

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Ignore then :)


setupEnv(
{ "STRIPE_PREMIUM_PLAN_PRICE_ID": null },
);
Expand All @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion islands/ItemsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion islands/UsersTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/blog/routes/blog/[slug].tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 2 additions & 2 deletions plugins/error_handling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
2 changes: 1 addition & 1 deletion routes/api/stripe-webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
14 changes: 10 additions & 4 deletions static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,33 @@
@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 {
@apply flex justify-between p-4 gap-4;
}

.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 {
@apply text-gray-500 px-3 py-4 sm:py-2;
}

.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 {
Expand Down
3 changes: 3 additions & 0 deletions utils/db.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// Copyright 2023-2024 the Deno authors. All rights reserved. MIT license.

/// <reference lib="deno.unstable" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kt3k shouldn't "unstable": ["kv"] within deno.json fix this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weirdly it didn't. I see there is --unstable-kv option provided when running deno task test, but same problem. I think it could be some deno issue. I have been able to make it work only with the reference ... comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this seems like a runtime issue.


import { ulid } from "$std/ulid/mod.ts";

const DENO_KV_PATH_KEY = "DENO_KV_PATH";
Expand Down
4 changes: 2 additions & 2 deletions utils/github_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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))]),
);
Expand Down
Loading