From 6f8c69524e51dfe8b55194fdd8d72094342471c1 Mon Sep 17 00:00:00 2001 From: Foster Hangdaan Date: Fri, 8 Nov 2024 17:55:50 -0500 Subject: [PATCH] refactor: Move Valibot to `deps.ts` --- deno.json | 1 - deno.lock | Bin 31979 -> 31942 bytes deps.ts | 17 +++++++++++++++++ mod.ts | 2 +- tests/mod.test.ts | 8 ++++---- 5 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 deps.ts diff --git a/deno.json b/deno.json index 9aa47df..6d7e24c 100644 --- a/deno.json +++ b/deno.json @@ -9,7 +9,6 @@ "@std/assert": "jsr:@std/assert@1.0.7", "@std/path": "jsr:@std/path@1.0.8", "@std/testing": "jsr:@std/testing@1.0.4", - "@valibot/valibot": "jsr:@valibot/valibot@0.42.1", "lume/": "https://deno.land/x/lume@v2.4.1/" } } diff --git a/deno.lock b/deno.lock index a6aa433813c6fa18b00d830043facefbef9e2093..d45b9b2df6b1eebba7ade657eb09e090e7839cab 100644 GIT binary patch delta 23 ccmaF;lkwP3#tl1bc)1jSAQnj0a@BGH0C`jg*8l(j delta 31 kcmX^1lkxRW#tl1bChuY6n>>eIoR>=h2x5U`EmtiU0NF?ihX4Qo diff --git a/deps.ts b/deps.ts new file mode 100644 index 0000000..7c7640f --- /dev/null +++ b/deps.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 Foster Hangdaan + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * as valibot from "jsr:@valibot/valibot@0.42.1"; diff --git a/mod.ts b/mod.ts index 4a2c83c..a20f574 100644 --- a/mod.ts +++ b/mod.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import * as v from "@valibot/valibot"; +import { valibot as v } from "./deps.ts"; import Site from "lume/core/site.ts"; import diagrams from "./resources/diagrams.json" with { type: "json" }; import { deflateSync } from "node:zlib"; diff --git a/tests/mod.test.ts b/tests/mod.test.ts index cb44f94..a637d03 100644 --- a/tests/mod.test.ts +++ b/tests/mod.test.ts @@ -15,7 +15,7 @@ */ import mod from "../mod.ts"; -import { ValiError } from "@valibot/valibot"; +import { valibot as v } from "../deps.ts"; import { assertExists, assertInstanceOf } from "@std/assert"; import { assertSnapshot } from "@std/testing/snapshot"; import { getSite } from "./utils.ts"; @@ -29,7 +29,7 @@ Deno.test("Error thrown on invalid options", async (t) => { error = err; } assertExists(error); - assertInstanceOf(error, ValiError); + assertInstanceOf(error, v.ValiError); }); await t.step("Invalid enabledDiagrams", () => { @@ -40,7 +40,7 @@ Deno.test("Error thrown on invalid options", async (t) => { error = err; } assertExists(error); - assertInstanceOf(error, ValiError); + assertInstanceOf(error, v.ValiError); }); await t.step("Invalid format", () => { @@ -52,7 +52,7 @@ Deno.test("Error thrown on invalid options", async (t) => { error = err; } assertExists(error); - assertInstanceOf(error, ValiError); + assertInstanceOf(error, v.ValiError); }); });