Skip to content

Commit

Permalink
fix: specify x|std (#23)
Browse files Browse the repository at this point in the history
* fix: specify x|std

fix #22

* test: fix test

If include "v", it must be captured too.
Because it cause failed to update.
  • Loading branch information
Omochice authored Nov 13, 2023
1 parent 496f355 commit f34c242
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions deno/deno-land.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"customType": "regex",
"fileMatch": ["^import_map.json$", "^deno.jsonc?$"],
"matchStrings": [
"['\"].+?['\"]\\s*:\\s*['\"](?<depName>https://deno.land/.+?)@v?(?<currentValue>(?:0|[1-9]\\d*)(?:\\.(?:0|[1-9]\\d*)(?:\\.(?:0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)?)?)[/'\"]"
"['\"].+?['\"]\\s*:\\s*['\"](?<depName>https://deno.land/(?:x/.+?|std))@(?<currentValue>v?(?:0|[1-9]\\d*)(?:\\.(?:0|[1-9]\\d*)(?:\\.(?:0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)?)?)[/'\"]"
],
"datasourceTemplate": "deno"
},
{
"customType": "regex",
"fileMatch": ["\\.[jt]sx?$"],
"matchStrings": [
"(?:im|ex)port(?:.|\\s)+?from\\s*['\"](?<depName>https://deno.land/.+?)@v?(?<currentValue>(?:0|[1-9]\\d*)(?:\\.(?:0|[1-9]\\d*)(?:\\.(?:0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)?)?)[/'\"]"
"(?:im|ex)port(?:.|\\s)+?from\\s*['\"](?<depName>https://deno.land/(?:x?.+?|std))@(?<currentValue>v?(?:0|[1-9]\\d*)(?:\\.(?:0|[1-9]\\d*)(?:\\.(?:0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)?)?)[/'\"]"
],
"datasourceTemplate": "deno"
}
Expand Down
6 changes: 3 additions & 3 deletions test/deno/deno-land.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("deno.land for import map", () => {
"path": "https://deno.land/std@v0.204.0/path/mod.ts",
}
}`,
currentValue: "0.204.0",
currentValue: "v0.204.0",
depName: "https://deno.land/std",
},
{
Expand All @@ -53,7 +53,7 @@ describe("deno.land for import map", () => {
"some": "https://deno.land/x/some_module@v0.1.0",
}
}`,
currentValue: "0.1.0",
currentValue: "v0.1.0",
depName: "https://deno.land/x/some_module",
},
] as const;
Expand Down Expand Up @@ -89,7 +89,7 @@ describe("deno.land for import map", () => {
{
title: "should accept if 'v' in version",
input: `import { someFuncion } from "https://deno.land/std@v1.0.0/some/mod.ts";`,
currentValue: "1.0.0",
currentValue: "v1.0.0",
depName: "https://deno.land/std",
},
{
Expand Down

0 comments on commit f34c242

Please sign in to comment.