diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..09cf720 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "denoland.vscode-deno" + ] +} diff --git a/ast/desugar.test.ts b/ast/desugar.test.ts index 5dfb6a1..2bd3a07 100644 --- a/ast/desugar.test.ts +++ b/ast/desugar.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "testing/asserts.ts"; +import { assertEquals } from "assert/mod.ts"; import { desugar } from "./desugar.ts"; import { Kind, PrimitiveType } from "./ast.ts"; diff --git a/ast/estimate_type.test.ts b/ast/estimate_type.test.ts index eddf952..c229a34 100644 --- a/ast/estimate_type.test.ts +++ b/ast/estimate_type.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "testing/asserts.ts"; +import { assertEquals } from "assert/mod.ts"; import type { Equal, Expect } from "@type-challenges/utils"; import { type EstimateType } from "./estimate_type.ts"; import { Kind } from "./ast.ts"; diff --git a/decorator/decorator.test.ts b/decorator/decorator.test.ts index 0b5bd91..b70ebf1 100644 --- a/decorator/decorator.test.ts +++ b/decorator/decorator.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "testing/asserts.ts"; +import { assertEquals } from "assert/mod.ts"; import { Decorator } from "./decorator.ts"; diff --git a/decorators.test.ts b/decorators.test.ts index ca864f2..295840f 100644 --- a/decorators.test.ts +++ b/decorators.test.ts @@ -1,4 +1,4 @@ -import { assertEquals, assertThrows } from "testing/asserts.ts"; +import { assertEquals, assertThrows } from "assert/mod.ts"; import { d } from "./decorators.ts"; import { decorate, union } from "./ast/utils.ts"; import { createSanitize } from "./validator/create_sanitize.ts"; diff --git a/deno.json b/deno.json index 860ca32..d3afae7 100644 --- a/deno.json +++ b/deno.json @@ -1,15 +1,15 @@ { "imports": { - "dnt/": "https://deno.land/x/dnt@0.33.0/", - "testing/": "https://deno.land/std@0.179.0/testing/", - "@type-challenges/utils": "https://esm.sh/@type-challenges/utils@0.1.1/index.d.ts" + "dnt/": "https://deno.land/x/dnt@0.40.0/", + "assert/": "https://deno.land/std@0.220.1/assert/", + "@type-challenges/utils": "npm:@type-challenges/utils@0.1.1/index.d.ts" }, "tasks": { "test": "deno task test:unit && deno task test:lint && deno task test:format && deno task test:types", "test:unit": "deno test -A --unstable", - "test:lint": "deno lint", - "test:format": "deno fmt --check", - "test:types": "find . -name '*.ts' | xargs deno check --unstable", + "test:lint": "deno lint --ignore=.npm", + "test:format": "deno fmt --check --ignore=.npm", + "test:types": "find . -name '*.ts' -not -path './.npm/*' | xargs deno check", "build:npm": "deno run -A scripts/build_npm.ts" } } diff --git a/scripts/build_npm.ts b/scripts/build_npm.ts index c28a335..a48ce38 100644 --- a/scripts/build_npm.ts +++ b/scripts/build_npm.ts @@ -1,8 +1,11 @@ import { build, emptyDir } from "dnt/mod.ts"; -const cmd = Deno.run({ cmd: ["git", "describe", "--tags"], stdout: "piped" }); -const version = new TextDecoder().decode(await cmd.output()).trim(); -cmd.close(); +const cmd = new Deno.Command(Deno.execPath(), { + args: ["git", "describe", "--tags"], + stdout: "piped", +}); +const { stdout } = await cmd.output(); +const version = new TextDecoder().decode(stdout).trim(); await emptyDir("./.npm"); @@ -14,7 +17,7 @@ await build({ }, test: false, compilerOptions: { - lib: ["es2021", "dom"], + lib: ["ES2021", "DOM"], }, package: { name: "safen", diff --git a/short.test.ts b/short.test.ts index cc8df8a..8aaee29 100644 --- a/short.test.ts +++ b/short.test.ts @@ -1,4 +1,4 @@ -import { assert, assertFalse } from "testing/asserts.ts"; +import { assert, assertFalse } from "assert/mod.ts"; import { v } from "./short.ts"; Deno.test("short, validation, decorate", () => { diff --git a/validator/create_sanitize.test.ts b/validator/create_sanitize.test.ts index f495983..3d50cc4 100644 --- a/validator/create_sanitize.test.ts +++ b/validator/create_sanitize.test.ts @@ -1,4 +1,4 @@ -import { assertEquals, assertThrows } from "testing/asserts.ts"; +import { assertEquals, assertThrows } from "assert/mod.ts"; import { between } from "../decorators/between.ts"; import { email } from "../decorators/email.ts"; import { ip } from "../decorators/ip.ts"; diff --git a/validator/create_validate.test.ts b/validator/create_validate.test.ts index 19cd54c..c378a0e 100644 --- a/validator/create_validate.test.ts +++ b/validator/create_validate.test.ts @@ -1,7 +1,7 @@ import { between } from "../decorators/between.ts"; import { email } from "../decorators/email.ts"; import { lengthBetween } from "../decorators/length_between.ts"; -import { assert, assertFalse } from "testing/asserts.ts"; +import { assert, assertFalse } from "assert/mod.ts"; import { any, array, decorate, optional, or, union } from "../ast/utils.ts"; import { emptyToNull } from "../decorators/empty_to_null.ts"; import { ip } from "../decorators/ip.ts";