From f63752062a70f06e2f658bdc80d875caa1abb92e Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 10 Jan 2024 10:25:07 +0100 Subject: [PATCH] chore: change assert to with for import attributes (#2231) --- docs/toc.ts | 2 +- src/dev/update_check.ts | 2 +- tests/cli_update_check_test.ts | 2 +- www/main_test.ts | 2 +- www/routes/index.tsx | 4 ++-- www/routes/raw.ts | 2 +- www/routes/showcase.tsx | 2 +- www/routes/update.tsx | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/toc.ts b/docs/toc.ts index b143f012..a254c412 100644 --- a/docs/toc.ts +++ b/docs/toc.ts @@ -1,4 +1,4 @@ -import FRESH_VERSIONS from "../versions.json" assert { type: "json" }; +import FRESH_VERSIONS from "../versions.json" with { type: "json" }; type RawTableOfContents = Record< string, diff --git a/src/dev/update_check.ts b/src/dev/update_check.ts index d4f22890..b59c0b0f 100644 --- a/src/dev/update_check.ts +++ b/src/dev/update_check.ts @@ -48,7 +48,7 @@ async function fetchLatestVersion() { async function readCurrentVersion() { const versions = (await import("../../versions.json", { - "assert": { type: "json" }, + with: { type: "json" }, })).default as string[]; return versions[0]; } diff --git a/tests/cli_update_check_test.ts b/tests/cli_update_check_test.ts index b8bd5205..89771e56 100644 --- a/tests/cli_update_check_test.ts +++ b/tests/cli_update_check_test.ts @@ -6,7 +6,7 @@ import { assertNotEquals, assertNotMatch, } from "./deps.ts"; -import versions from "../versions.json" assert { type: "json" }; +import versions from "../versions.json" with { type: "json" }; import { CheckFile } from "../src/dev/update_check.ts"; import { WEEK } from "../src/dev/deps.ts"; import { getStdOutput } from "../tests/test_utils.ts"; diff --git a/www/main_test.ts b/www/main_test.ts index 3eae19e1..2ff04007 100644 --- a/www/main_test.ts +++ b/www/main_test.ts @@ -1,7 +1,7 @@ import { assertArrayIncludes, assertEquals } from "$std/assert/mod.ts"; import { withPageName } from "../tests/test_utils.ts"; import { dirname, join } from "$std/path/mod.ts"; -import VERSIONS from "../versions.json" assert { type: "json" }; +import VERSIONS from "../versions.json" with { type: "json" }; import { createHandler } from "../server.ts"; import manifest from "./fresh.gen.ts"; import config from "./fresh.config.ts"; diff --git a/www/routes/index.tsx b/www/routes/index.tsx index fb3b3c24..17fdeed2 100644 --- a/www/routes/index.tsx +++ b/www/routes/index.tsx @@ -3,12 +3,12 @@ import { Handlers, PageProps } from "$fresh/server.ts"; import Counter from "../islands/Counter.tsx"; import LemonDrop from "../islands/LemonDrop.tsx"; import Footer from "../components/Footer.tsx"; -import VERSIONS from "../../versions.json" assert { type: "json" }; +import VERSIONS from "../../versions.json" with { type: "json" }; import * as FeatureIcons from "../components/FeatureIcons.tsx"; import CopyArea from "../islands/CopyArea.tsx"; import * as Icons from "../components/Icons.tsx"; import Projects from "../components/Projects.tsx"; -import projects from "../data/showcase.json" assert { type: "json" }; +import projects from "../data/showcase.json" with { type: "json" }; import Header from "../components/Header.tsx"; function isOpenGraphUA(header: string | null): boolean { diff --git a/www/routes/raw.ts b/www/routes/raw.ts index 39af5455..7c752713 100644 --- a/www/routes/raw.ts +++ b/www/routes/raw.ts @@ -1,7 +1,7 @@ import { RouteConfig } from "$fresh/server.ts"; import { Handlers } from "$fresh/server.ts"; import { format, parse } from "$std/semver/mod.ts"; -import VERSIONS from "../../versions.json" assert { type: "json" }; +import VERSIONS from "../../versions.json" with { type: "json" }; import { extname } from "$std/path/mod.ts"; const BASE_URL = "https://raw.githubusercontent.com/denoland/fresh/"; diff --git a/www/routes/showcase.tsx b/www/routes/showcase.tsx index bae94980..3f5ee0ec 100644 --- a/www/routes/showcase.tsx +++ b/www/routes/showcase.tsx @@ -3,7 +3,7 @@ import { PageProps } from "$fresh/server.ts"; import Projects, { Project } from "../components/Projects.tsx"; import Header from "../components/Header.tsx"; import Footer from "../components/Footer.tsx"; -import projects from "../data/showcase.json" assert { type: "json" }; +import projects from "../data/showcase.json" with { type: "json" }; const TITLE = "Showcase | Fresh"; const DESCRIPTION = "Selection of projects that have been built with Fresh."; diff --git a/www/routes/update.tsx b/www/routes/update.tsx index 0a7c15e9..0672665d 100644 --- a/www/routes/update.tsx +++ b/www/routes/update.tsx @@ -1,5 +1,5 @@ import { Handlers, PageProps } from "$fresh/server.ts"; -import VERSIONS from "../../versions.json" assert { type: "json" }; +import VERSIONS from "../../versions.json" with { type: "json" }; export const handler: Handlers = { GET(req) {