Skip to content

Commit

Permalink
Update deno stdlib in hopes of fixing parse err
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Sep 5, 2024
1 parent 0c0f3ce commit d6438e6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 25 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ jobs:
with:
parallel-finished: true

verify-usage-as-deno-lib:
# we’re checking no import-map type imports snuck in
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: src
- uses: denoland/setup-deno@v1
- run: deno run --no-config --unstable --allow-all src/mod.ts

lint:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"imports": {
"is-what": "https://deno.land/x/[email protected]/src/index.ts",
"deno/": "https://deno.land/std@0.196.0/",
"deno/": "https://deno.land/std@0.224.0/",
"outdent": "https://deno.land/x/[email protected]/mod.ts"
}
}
20 changes: 10 additions & 10 deletions src/deps.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import * as is_what from "https://deno.land/x/[email protected]/src/index.ts"
import * as is_what from "is-what"
export { is_what }

import { type PlainObject } from "https://deno.land/x/[email protected]/src/index.ts"
import { type PlainObject } from "is-what"
export type { PlainObject }

import * as outdent from "https://deno.land/x/outdent@v0.8.0/mod.ts"
import * as outdent from "outdent"
export { outdent }

// importing super specifically to reduce final npm bundle size
import * as crypto from "https://deno.land/[email protected]/crypto/mod.ts"
import { moveSync } from "https://deno.land/[email protected]/fs/move.ts"
import { readLines } from "https://deno.land/[email protected]/io/read_lines.ts"
import { writeAll } from "https://deno.land/[email protected]/streams/write_all.ts"
import { parse as parseYaml } from "https://deno.land/[email protected]/yaml/parse.ts"
import { SEP } from "https://deno.land/[email protected]/path/mod.ts"
import { fromFileUrl } from "https://deno.land/[email protected]/path/mod.ts"
import * as crypto from "deno/crypto/mod.ts"
import { moveSync } from "deno/fs/move.ts"
import { readLines } from "deno/io/read_lines.ts"
const writeAll = Deno.writeAll
import { parse as parseYaml } from "deno/yaml/parse.ts"
import { SEPARATOR as SEP } from "deno/path/mod.ts"
import { fromFileUrl } from "deno/path/mod.ts"

const streams = { writeAll }
const io = { readLines }
Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useDownload.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { deno } from "../deps.ts"
const { crypto: crypto_, streams: { writeAll } } = deno
const { toHashString, crypto } = crypto_
const { crypto } = crypto_
import { encodeHex } from "deno/encoding/hex.ts"
import { PkgxError, panic } from "../utils/error.ts"
import useConfig from "./useConfig.ts"
import useFetch from "./useFetch.ts"
Expand Down Expand Up @@ -75,7 +76,7 @@ function cache({ for: url }: {for: URL}): Path {
if (url.search) key += `?${url.search}`
const blob = new TextEncoder().encode(key)
const hash = crypto.subtle.digestSync("SHA-256", blob)
return toHashString(hash)
return encodeHex(hash)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/Path.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, assertEquals, assertFalse, assertThrows } from "deno/assert/mod.ts"
import { SEP } from "deno/path/mod.ts"
import { SEPARATOR as SEP } from "deno/path/mod.ts"
import Path from "./Path.ts"

Deno.test("test Path", async test => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/semver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HEY YOU! DO NOT CHANGE THIS TO USE deps.ts since it breaks pkgx/gui
import { isArray, isString } from "https://deno.land/x/[email protected]/src/index.ts"
import { isArray, isString } from "is-what"

/**
* we have our own implementation because open source is full of weird
Expand Down

0 comments on commit d6438e6

Please sign in to comment.