Skip to content

Commit ba68c58

Browse files
authored
Revert "refactor: use jsr modules where possible and upgrade fresh version (#684)" (#703)
This reverts commit e62793c.
1 parent e62793c commit ba68c58

27 files changed

+71
-81
lines changed

components/Footer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2023-2025 the Deno authors. All rights reserved. MIT license.
22
import { SITE_NAME } from "@/utils/constants.ts";
3-
import IconBrandDiscord from "@preact-icons/tb/TbBrandDiscord";
4-
import IconBrandGithub from "@preact-icons/tb/TbBrandGithub";
5-
import IconRss from "@preact-icons/tb/TbRss";
3+
import IconBrandDiscord from "tabler_icons_tsx/brand-discord.tsx";
4+
import IconBrandGithub from "tabler_icons_tsx/brand-github.tsx";
5+
import IconRss from "tabler_icons_tsx/rss.tsx";
66

77
function MadeWithFreshBadge() {
88
return (

components/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2023-2025 the Deno authors. All rights reserved. MIT license.
22
import { SITE_NAME } from "@/utils/constants.ts";
33
import { isStripeEnabled } from "@/utils/stripe.ts";
4-
import IconX from "@preact-icons/tb/TbX";
5-
import IconMenu from "@preact-icons/tb/TbMenu2";
4+
import IconX from "tabler_icons_tsx/x.tsx";
5+
import IconMenu from "tabler_icons_tsx/menu-2.tsx";
66
import { User } from "@/utils/db.ts";
77

88
export interface HeaderProps {

deno.json

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,21 @@
1919
},
2020
"compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" },
2121
"imports": {
22-
"$fresh/": "https://raw.githubusercontent.com/denoland/fresh/60220dd33b5b0f6b5c72927c933dbc32a3c4734e/",
2322
"@/": "./",
24-
"@deno/gfm": "jsr:@deno/gfm@^0.10.0",
25-
"@preact-icons/tb": "jsr:@preact-icons/tb@^1.0.13",
26-
"@preact/signals": "npm:@preact/signals@1.2.1",
27-
"@preact/signals-core": "npm:@preact/signals-core@1.5.0",
28-
"@std/assert": "jsr:@std/assert@^1.0",
29-
"@std/datetime": "jsr:@std/datetime@^0.225",
30-
"@std/front-matter": "jsr:@std/front-matter@^1.0",
31-
"@std/fs": "jsr:@std/fs@^1.0",
32-
"@std/http": "jsr:@std/http@^1.0",
33-
"@std/path": "jsr:@std/path@^1.0",
34-
"@std/testing": "jsr:@std/testing@^1.0",
35-
"@std/ulid": "jsr:@std/ulid@^1.0",
36-
"fresh_charts/": "https://deno.land/x/fresh_charts@0.3.1/",
37-
"kv_oauth/": "https://deno.land/x/deno_kv_oauth@v0.9.1/",
38-
"preact": "npm:preact@10.22.1",
39-
"preact/hooks": "npm:preact@10.22.1/hooks",
40-
"preact/jsx-runtime": "npm:preact@10.22.1/jsx-runtime",
41-
"stripe": "npm:/stripe@13.5.0",
23+
"$fresh/": "https://raw.githubusercontent.com/denoland/fresh/60220dd33b5b0f6b5c72927c933dbc32a3c4734e/",
24+
"preact": "https://esm.sh/preact@10.19.2",
25+
"preact/": "https://esm.sh/preact@10.19.2/",
26+
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.2",
27+
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.1",
28+
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.0",
4229
"tailwindcss": "npm:tailwindcss@3.4.1",
4330
"tailwindcss/": "npm:/tailwindcss@3.4.1/",
44-
"tailwindcss/plugin": "npm:/tailwindcss@3.4.1/plugin.js"
31+
"tailwindcss/plugin": "npm:/tailwindcss@3.4.1/plugin.js",
32+
"$std/": "https://deno.land/std@0.208.0/",
33+
"stripe": "npm:/stripe@13.5.0",
34+
"kv_oauth/": "https://deno.land/x/deno_kv_oauth@v0.9.1/",
35+
"tabler_icons_tsx/": "https://deno.land/x/tabler_icons_tsx@0.0.4/tsx/",
36+
"fresh_charts/": "https://deno.land/x/fresh_charts@0.3.1/"
4537
},
4638
"exclude": ["coverage/", "_fresh/", "**/_fresh/*"],
4739
"lint": { "rules": { "tags": ["fresh", "recommended"] } }

e2e_test.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ import {
1515
User,
1616
} from "@/utils/db.ts";
1717
import { stripe } from "@/utils/stripe.ts";
18-
import { assert } from "@std/assert/assert";
19-
import { assertArrayIncludes } from "@std/assert/array-includes";
20-
import { assertEquals } from "@std/assert/equals";
21-
import { assertInstanceOf } from "@std/assert/instance-of";
22-
import { assertNotEquals } from "@std/assert/not-equals";
23-
import { assertObjectMatch } from "@std/assert/object-match";
24-
import { assertStringIncludes } from "@std/assert/string-includes";
25-
import { isRedirectStatus, STATUS_CODE } from "@std/http/status";
26-
import { resolvesNext, returnsNext, stub } from "@std/testing/mock";
18+
import {
19+
assert,
20+
assertArrayIncludes,
21+
assertEquals,
22+
assertInstanceOf,
23+
assertNotEquals,
24+
assertObjectMatch,
25+
assertStringIncludes,
26+
} from "$std/assert/mod.ts";
27+
import { isRedirectStatus, STATUS_CODE } from "$std/http/status.ts";
28+
import { resolvesNext, returnsNext, stub } from "$std/testing/mock.ts";
2729
import Stripe from "stripe";
2830
import options from "./fresh.config.ts";
2931
import { _internals } from "./plugins/kv_oauth.ts";

islands/ItemsList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import { Signal, useComputed, useSignal } from "@preact/signals";
33
import { useEffect } from "preact/hooks";
44
import { type Item } from "@/utils/db.ts";
5-
import IconInfo from "@preact-icons/tb/TbInfoCircle";
5+
import IconInfo from "tabler_icons_tsx/info-circle.tsx";
66
import { fetchValues } from "@/utils/http.ts";
7-
import { decodeTime } from "@std/ulid/decode-time";
7+
import { decodeTime } from "$std/ulid/mod.ts";
88
import { timeAgo } from "@/utils/display.ts";
99
import GitHubAvatarImg from "@/components/GitHubAvatarImg.tsx";
1010

plugins/blog/components/Share.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright 2023-2025 the Deno authors. All rights reserved. MIT license.
2-
import IconBrandFacebook from "@preact-icons/tb/TbBrandFacebook";
3-
import IconBrandLinkedin from "@preact-icons/tb/TbBrandLinkedin";
4-
import IconBrandReddit from "@preact-icons/tb/TbBrandReddit";
5-
import IconBrandTwitter from "@preact-icons/tb/TbBrandTwitter";
2+
import IconBrandFacebook from "tabler_icons_tsx/brand-facebook.tsx";
3+
import IconBrandLinkedin from "tabler_icons_tsx/brand-linkedin.tsx";
4+
import IconBrandReddit from "tabler_icons_tsx/brand-reddit.tsx";
5+
import IconBrandTwitter from "tabler_icons_tsx/brand-twitter.tsx";
66

77
interface ShareProps {
88
url: URL;

plugins/blog/mod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Plugin } from "$fresh/server.ts";
33
import BlogIndex from "./routes/blog/index.tsx";
44
import BlogSlug from "./routes/blog/[slug].tsx";
55
import Feed from "./routes/feed.ts";
6-
import { normalize } from "@std/path/normalize";
6+
import { normalize } from "$std/url/normalize.ts";
77

88
export function blog(): Plugin {
99
return {
@@ -19,6 +19,6 @@ export function blog(): Plugin {
1919
component: Feed,
2020
}],
2121
location: import.meta.url,
22-
projectLocation: normalize(import.meta.url + "../../../"),
22+
projectLocation: normalize(import.meta.url + "../../../").href,
2323
};
2424
}

plugins/blog/routes/blog/[slug].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2023-2025 the Deno authors. All rights reserved. MIT license.
22
import { defineRoute } from "$fresh/server.ts";
3-
import { CSS, render } from "@deno/gfm";
3+
import { CSS, render } from "jsr:@deno/gfm";
44
import { getPost } from "../../utils/posts.ts";
55
import Head from "@/components/Head.tsx";
66
import Share from "../../components/Share.tsx";

plugins/blog/utils/posts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2023-2025 the Deno authors. All rights reserved. MIT license.
2-
import { extract as extractYaml } from "@std/front-matter/yaml";
3-
import { join } from "@std/path/join";
2+
import { extract } from "$std/front_matter/yaml.ts";
3+
import { join } from "$std/path/join.ts";
44

55
/**
66
* This code is based on the
@@ -38,7 +38,7 @@ export interface Post {
3838
export async function getPost(slug: string): Promise<Post | null> {
3939
try {
4040
const text = await Deno.readTextFile(join("./posts", `${slug}.md`));
41-
const { attrs, body } = extractYaml<Post>(text);
41+
const { attrs, body } = extract<Post>(text);
4242
return {
4343
...attrs,
4444
slug,

plugins/blog/utils/posts_test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// Copyright 2023-2025 the Deno authors. All rights reserved. MIT license.
22
import { getPost, getPosts } from "./posts.ts";
33

4-
import { assert } from "@std/assert/assert";
5-
import { assertEquals } from "@std/assert/equals";
4+
import { assert, assertEquals } from "$std/assert/mod.ts";
65

76
Deno.test("[blog] getPost()", async () => {
87
const post = await getPost("first-post");

0 commit comments

Comments
 (0)