Skip to content

Commit fd01443

Browse files
committed
Use deno^2 (#79)
1 parent 5ae6c80 commit fd01443

36 files changed

+140
-121
lines changed

deno.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,9 @@
33
"allowJs": false,
44
"strict": true
55
},
6-
"fmt": {
7-
"files": {
8-
"exclude": [
9-
"./"
10-
]
11-
}
12-
},
13-
"pkgx": "deno^1.40",
6+
"pkgx": "deno^2.0",
147
"tasks": {
15-
"test": "deno test --parallel --unstable-fs --unstable-ffi --allow-env --allow-read --allow-ffi --allow-net=dist.pkgx.dev,github.com,codeload.github.com --allow-write --allow-run=tar,uname,/bin/sh,foo,'C:\\Windows\\system32\\cmd.exe'",
8+
"test": "deno test --parallel --unstable-fs --unstable-ffi --allow-all",
169
"typecheck": "deno check ./mod.ts"
1710
},
1811
"lint": {
@@ -24,8 +17,9 @@
2417
"exclude": ["dist/"]
2518
},
2619
"imports": {
20+
"@std/assert": "jsr:@std/assert@^1.0.6",
21+
"@std/testing": "jsr:@std/testing@^1.0.3",
2722
"is-what": "https://deno.land/x/is_what@v4.1.15/src/index.ts",
28-
"deno/": "https://deno.land/std@0.224.0/",
2923
"outdent": "https://deno.land/x/outdent@v0.8.0/mod.ts"
3024
}
3125
}

src/deps.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ import * as outdent from "outdent"
88
export { outdent }
99

1010
// importing super specifically to reduce final npm bundle size
11-
import * as crypto from "deno/crypto/mod.ts"
12-
import { moveSync } from "deno/fs/move.ts"
13-
import { readLines } from "deno/io/read_lines.ts"
14-
import { writeAll } from "deno/io/write_all.ts"
15-
import { parse as parseYaml } from "deno/yaml/parse.ts"
16-
import { SEPARATOR as SEP } from "deno/path/mod.ts"
17-
import { fromFileUrl } from "deno/path/mod.ts"
11+
import * as crypto from "jsr:@std/crypto@1"
12+
import { moveSync } from "jsr:@std/fs@1"
13+
import { writeAll } from "jsr:@std/io@^0.225.0"
14+
import { parse as parseYaml } from "jsr:@std/yaml@1"
15+
import { SEPARATOR as SEP, fromFileUrl } from "jsr:@std/path@1"
1816

1917
const streams = { writeAll }
20-
const io = { readLines }
2118
const fs = { moveSync }
22-
const deno = { readLines, crypto, fs, io, streams, parseYaml, SEP, fromFileUrl }
19+
const deno = { crypto, fs, streams, parseYaml, SEP, fromFileUrl }
2320

2421
export { deno }

src/hooks/useCache.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Stowage, StowageNativeBottle } from "../types.ts"
22
import { useTestConfig } from "./useTestConfig.ts"
3-
import { assertEquals } from "deno/assert/mod.ts"
3+
import { assertEquals } from "@std/assert"
44
import SemVer from "../utils/semver.ts"
55
import useCache from "./useCache.ts"
66
import host from "../utils/host.ts"

src/hooks/useCellar.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals, assertRejects } from "deno/assert/mod.ts"
1+
import { assertEquals, assertRejects } from "@std/assert"
22
import SemVer, * as semver from "../utils/semver.ts"
33
import { useTestConfig } from "./useTestConfig.ts"
44
import useCellar from "./useCellar.ts"

src/hooks/useConfig.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assert, assertEquals, assertFalse, assertThrows, assertMatch } from "deno/assert/mod.ts"
1+
import { assert, assertEquals, assertFalse, assertThrows, assertMatch } from "@std/assert"
22
import { _internals, ConfigDefault } from "./useConfig.ts"
33
import { useTestConfig } from "./useTestConfig.ts"
44
import Path from "../utils/Path.ts"

src/hooks/useDownload.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useTestConfig } from "./useTestConfig.ts"
2-
import { assert } from "deno/assert/mod.ts"
2+
import { assert } from "@std/assert"
33
import useDownload from "./useDownload.ts"
44

55
//TODO don’t actually do http obv.

src/hooks/useDownload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { deno } from "../deps.ts"
22
const { crypto: crypto_, streams: { writeAll } } = deno
33
const { crypto } = crypto_
4-
import { encodeHex } from "deno/encoding/hex.ts"
4+
import { encodeHex } from "jsr:@std/encoding@1"
55
import { PkgxError, panic } from "../utils/error.ts"
66
import useConfig from "./useConfig.ts"
77
import useFetch from "./useFetch.ts"

src/hooks/useFetch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { stub, assertSpyCallArgs } from "deno/testing/mock.ts"
1+
import { stub, assertSpyCallArgs } from "@std/testing/mock"
22
import { useTestConfig } from "./useTestConfig.ts";
33
import useFetch, { _internals } from "./useFetch.ts"
44

src/hooks/useInventory.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// deno-lint-ignore-file require-await no-explicit-any
2-
import { assertEquals } from "deno/assert/assert_equals.ts"
2+
import { assertEquals, assertRejects } from "@std/assert"
33
import SemVer, * as semver from "../utils/semver.ts"
4-
import { assertRejects } from "deno/assert/mod.ts"
5-
import * as mock from "deno/testing/mock.ts"
4+
import * as mock from "@std/testing/mock"
65
import { _internals } from "./useFetch.ts"
76
import specimen from "./useInventory.ts"
87

src/hooks/useMoustaches.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "deno/assert/mod.ts"
1+
import { assertEquals } from "@std/assert"
22
import { useTestConfig } from "./useTestConfig.ts"
33
import useMoustaches from "./useMoustaches.ts"
44
import { Package } from "../types.ts"

0 commit comments

Comments
 (0)