diff --git a/.github/deno-to-node.ts b/.github/deno-to-node.ts index 7e62ff1..008b348 100755 --- a/.github/deno-to-node.ts +++ b/.github/deno-to-node.ts @@ -1,6 +1,6 @@ #!/usr/bin/env -S pkgx +npm deno run --allow-env --allow-read --allow-write --allow-net --allow-run -import { build, emptyDir } from "https://deno.land/x/dnt@0.38.1/mod.ts"; +import { build, emptyDir } from "https://deno.land/x/dnt@0.39.0/mod.ts"; import SemVer from "../src/utils/semver.ts"; await emptyDir("./dist"); diff --git a/deno.json b/deno.json index 0d75dbe..e693bdc 100644 --- a/deno.json +++ b/deno.json @@ -26,7 +26,7 @@ }, "imports": { "is-what": "https://deno.land/x/is_what@v4.1.15/src/index.ts", - "deno/": "https://deno.land/std@0.204.0/", + "deno/": "https://deno.land/std@0.196.0/", "outdent": "https://deno.land/x/outdent@v0.8.0/mod.ts" } } diff --git a/src/deps.ts b/src/deps.ts index 08c54fa..7ec2015 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -8,13 +8,13 @@ import * as outdent from "https://deno.land/x/outdent@v0.8.0/mod.ts" export { outdent } // importing super specifically to reduce final npm bundle size -import * as crypto from "https://deno.land/std@0.204.0/crypto/mod.ts" -import { moveSync } from "https://deno.land/std@0.204.0/fs/move.ts" -import { readLines } from "https://deno.land/std@0.204.0/io/read_lines.ts" -import { writeAll } from "https://deno.land/std@0.204.0/streams/write_all.ts" -import { parse as parseYaml } from "https://deno.land/std@0.204.0/yaml/parse.ts" -import { SEP } from "https://deno.land/std@0.204.0/path/mod.ts" -import { fromFileUrl } from "https://deno.land/std@0.204.0/path/from_file_url.ts" +import * as crypto from "https://deno.land/std@0.196.0/crypto/mod.ts" +import { moveSync } from "https://deno.land/std@0.196.0/fs/move.ts" +import { readLines } from "https://deno.land/std@0.196.0/io/read_lines.ts" +import { writeAll } from "https://deno.land/std@0.196.0/streams/write_all.ts" +import { parse as parseYaml } from "https://deno.land/std@0.196.0/yaml/parse.ts" +import { SEP } from "https://deno.land/std@0.196.0/path/mod.ts" +import { fromFileUrl } from "https://deno.land/std@0.196.0/path/mod.ts" const streams = { writeAll } const io = { readLines } diff --git a/src/hooks/useInventory.ts b/src/hooks/useInventory.ts index bc7e692..b5554c3 100644 --- a/src/hooks/useInventory.ts +++ b/src/hooks/useInventory.ts @@ -33,7 +33,7 @@ const get = async (rq: PackageRequirement | Package) => { } const releases = await rsp.text() - let versions = releases ? releases.split("\n").compact(x => new SemVer(x)) : [] + let versions = releases.trim().split("\n").map(x => new SemVer(x)) if (versions.length < 1) throw new Error(`No versions for ${rq.project}`) diff --git a/src/hooks/useTestConfig.ts b/src/hooks/useTestConfig.ts index 87baa8e..b1bd41c 100644 --- a/src/hooks/useTestConfig.ts +++ b/src/hooks/useTestConfig.ts @@ -1,5 +1,5 @@ import useConfig, { ConfigDefault } from "./useConfig.ts" -import { fromFileUrl } from "deno/path/from_file_url.ts" +import { fromFileUrl } from "deno/path/mod.ts" import Path from "../utils/Path.ts" export function useBaseTestConfig(env?: Record) { diff --git a/src/utils/pkg.ts b/src/utils/pkg.ts index 3a488c5..9118d31 100644 --- a/src/utils/pkg.ts +++ b/src/utils/pkg.ts @@ -3,6 +3,8 @@ import * as semver from "./semver.ts" /// allows inputs `nodejs.org@16` when `semver.parse` would reject export function parse(input: string): PackageRequirement { + input = input.trim() + const match = input.match(/^(.+?)([\^=~<>@].+)?$/) if (!match) throw new Error(`invalid pkgspec: ${input}`) if (!match[2]) match[2] = "*"