diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 0dfa926..8596811 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -13,5 +13,5 @@ jobs: id-token: write steps: - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 - run: deno publish diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 14b4ae3..39d1a89 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,5 +17,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 - run: deno task check diff --git a/deno.lock b/deno.lock index 6cd4367..ebd493d 100644 --- a/deno.lock +++ b/deno.lock @@ -1,308 +1,288 @@ { - "version": "3", - "packages": { - "specifiers": { - "jsr:@cliffy/ansi@1.0.0-rc.5": "jsr:@cliffy/ansi@1.0.0-rc.5", - "jsr:@cliffy/internal@1.0.0-rc.5": "jsr:@cliffy/internal@1.0.0-rc.5", - "jsr:@cliffy/keycode@1.0.0-rc.5": "jsr:@cliffy/keycode@1.0.0-rc.5", - "jsr:@cliffy/prompt@^1.0.0-rc.5": "jsr:@cliffy/prompt@1.0.0-rc.5", - "jsr:@core/unknownutil@^4.3.0": "jsr:@core/unknownutil@4.3.0", - "jsr:@david/dax@^0.42.0": "jsr:@david/dax@0.42.0", - "jsr:@david/path@0.2": "jsr:@david/path@0.2.0", - "jsr:@david/which@~0.4.1": "jsr:@david/which@0.4.1", - "jsr:@deno/graph@^0.82.1": "jsr:@deno/graph@0.82.1", - "jsr:@std/assert@1.0.0-rc.2": "jsr:@std/assert@1.0.0-rc.2", - "jsr:@std/assert@^0.221.0": "jsr:@std/assert@0.221.0", - "jsr:@std/assert@^1.0.5": "jsr:@std/assert@1.0.5", - "jsr:@std/async@^1.0.5": "jsr:@std/async@1.0.5", - "jsr:@std/bytes@^0.221.0": "jsr:@std/bytes@0.221.0", - "jsr:@std/cli@^1.0.6": "jsr:@std/cli@1.0.6", - "jsr:@std/collections@^1.0.6": "jsr:@std/collections@1.0.6", - "jsr:@std/encoding@1.0.0-rc.2": "jsr:@std/encoding@1.0.0-rc.2", - "jsr:@std/encoding@^1.0.5": "jsr:@std/encoding@1.0.5", - "jsr:@std/fmt@1": "jsr:@std/fmt@1.0.2", - "jsr:@std/fmt@^1.0.2": "jsr:@std/fmt@1.0.2", - "jsr:@std/fmt@~0.225.4": "jsr:@std/fmt@0.225.6", - "jsr:@std/fs@1": "jsr:@std/fs@1.0.3", - "jsr:@std/fs@^1": "jsr:@std/fs@1.0.3", - "jsr:@std/fs@^1.0.3": "jsr:@std/fs@1.0.3", - "jsr:@std/http@^1.0.6": "jsr:@std/http@1.0.6", - "jsr:@std/internal@^1.0.3": "jsr:@std/internal@1.0.3", - "jsr:@std/io@0.221": "jsr:@std/io@0.221.0", - "jsr:@std/io@^0.221.0": "jsr:@std/io@0.221.0", - "jsr:@std/io@~0.224.2": "jsr:@std/io@0.224.8", - "jsr:@std/media-types@^1.0.3": "jsr:@std/media-types@1.0.3", - "jsr:@std/net@^1.0.3": "jsr:@std/net@1.0.4", - "jsr:@std/net@^1.0.4": "jsr:@std/net@1.0.4", - "jsr:@std/path@1": "jsr:@std/path@1.0.6", - "jsr:@std/path@1.0.0-rc.2": "jsr:@std/path@1.0.0-rc.2", - "jsr:@std/path@^1": "jsr:@std/path@1.0.6", - "jsr:@std/path@^1.0.4": "jsr:@std/path@1.0.6", - "jsr:@std/path@^1.0.5": "jsr:@std/path@1.0.6", - "jsr:@std/path@^1.0.6": "jsr:@std/path@1.0.6", - "jsr:@std/regexp@^1.0.0": "jsr:@std/regexp@1.0.0", - "jsr:@std/semver@^1.0.3": "jsr:@std/semver@1.0.3", - "jsr:@std/streams@0.221": "jsr:@std/streams@0.221.0", - "jsr:@std/streams@^1.0.5": "jsr:@std/streams@1.0.5", - "jsr:@std/text@1.0.0-rc.1": "jsr:@std/text@1.0.0-rc.1", - "npm:@types/node": "npm:@types/node@18.16.19", - "npm:chokidar@^3.6.0": "npm:chokidar@3.6.0", - "npm:zod@^3.23.8": "npm:zod@3.23.8" - }, - "jsr": { - "@cliffy/ansi@1.0.0-rc.5": { - "integrity": "85a4dba4da5d8278dcdfeea98672cd15706c244833f82edc60c61f410d9fc1a9", - "dependencies": [ - "jsr:@std/encoding@1.0.0-rc.2" - ] - }, - "@cliffy/internal@1.0.0-rc.5": { - "integrity": "1e8dca4fcfba1815bf1a899bb880e09f8b45284c352465ef8fb015887c1fc126" - }, - "@cliffy/keycode@1.0.0-rc.5": { - "integrity": "2bcb3cb13873f0b758664394e003fc0cfa751af37a076ca9ec6e574df77aa3a8" - }, - "@cliffy/prompt@1.0.0-rc.5": { - "integrity": "3573a4c5c460fc84dcc554e548acfc2616157b60a61a9781833967c5a76da9f0", - "dependencies": [ - "jsr:@cliffy/ansi@1.0.0-rc.5", - "jsr:@cliffy/internal@1.0.0-rc.5", - "jsr:@cliffy/keycode@1.0.0-rc.5", - "jsr:@std/assert@1.0.0-rc.2", - "jsr:@std/fmt@~0.225.4", - "jsr:@std/io@~0.224.2", - "jsr:@std/path@1.0.0-rc.2", - "jsr:@std/text@1.0.0-rc.1" - ] - }, - "@core/unknownutil@4.3.0": { - "integrity": "538a3687ffa81028e91d148818047df219663d0da671d906cecd165581ae55cc" - }, - "@david/dax@0.42.0": { - "integrity": "0c547c9a20577a6072b90def194c159c9ddab82280285ebfd8268a4ebefbd80b", - "dependencies": [ - "jsr:@david/path@0.2", - "jsr:@david/which@~0.4.1", - "jsr:@std/fmt@1", - "jsr:@std/fs@1", - "jsr:@std/io@0.221", - "jsr:@std/path@1", - "jsr:@std/streams@0.221" - ] - }, - "@david/path@0.2.0": { - "integrity": "f2d7aa7f02ce5a55e27c09f9f1381794acb09d328f8d3c8a2e3ab3ffc294dccd", - "dependencies": [ - "jsr:@std/fs@^1", - "jsr:@std/path@^1" - ] - }, - "@david/which@0.4.1": { - "integrity": "896a682b111f92ab866cc70c5b4afab2f5899d2f9bde31ed00203b9c250f225e" - }, - "@deno/graph@0.82.1": { - "integrity": "ce5ccb325b1c84f65000eddb6d1922cfb43545beabd4f395648ad541c1cd987c" - }, - "@std/assert@0.221.0": { - "integrity": "a5f1aa6e7909dbea271754fd4ab3f4e687aeff4873b4cef9a320af813adb489a" - }, - "@std/assert@1.0.0-rc.2": { - "integrity": "0484eab1d76b55fca1c3beaff485a274e67dd3b9f065edcbe70030dfc0b964d3" - }, - "@std/assert@1.0.5": { - "integrity": "e37da8e4033490ce613eec4ac1d78dba1faf5b02a3f6c573a28f15365b9b440f", - "dependencies": [ - "jsr:@std/internal@^1.0.3" - ] - }, - "@std/async@1.0.5": { - "integrity": "31d68214bfbb31bd4c6022401d484e3964147c76c9220098baa703a39b6c2da6" - }, - "@std/bytes@0.221.0": { - "integrity": "64a047011cf833890a4a2ab7293ac55a1b4f5a050624ebc6a0159c357de91966" - }, - "@std/cli@1.0.6": { - "integrity": "d22d8b38c66c666d7ad1f2a66c5b122da1704f985d3c47f01129f05abb6c5d3d" - }, - "@std/collections@1.0.6": { - "integrity": "60ad252af7df0594e6455f697920a37cd523ad66469fefcc9735e362826ac01d" - }, - "@std/encoding@1.0.0-rc.2": { - "integrity": "160d7674a20ebfbccdf610b3801fee91cf6e42d1c106dd46bbaf46e395cd35ef" - }, - "@std/encoding@1.0.5": { - "integrity": "ecf363d4fc25bd85bd915ff6733a7e79b67e0e7806334af15f4645c569fefc04" - }, - "@std/fmt@0.225.6": { - "integrity": "aba6aea27f66813cecfd9484e074a9e9845782ab0685c030e453a8a70b37afc8" - }, - "@std/fmt@1.0.2": { - "integrity": "87e9dfcdd3ca7c066e0c3c657c1f987c82888eb8103a3a3baa62684ffeb0f7a7" - }, - "@std/fs@1.0.3": { - "integrity": "3cb839b1360b0a42d8b367c3093bfe4071798e6694fa44cf1963e04a8edba4fe", - "dependencies": [ - "jsr:@std/path@^1.0.4" - ] - }, - "@std/http@1.0.6": { - "integrity": "20a6f3fa4a914fbb19ea96572f2519b656232597092581ed706cd865d842d0d0", - "dependencies": [ - "jsr:@std/cli@^1.0.6", - "jsr:@std/encoding@^1.0.5", - "jsr:@std/fmt@^1.0.2", - "jsr:@std/media-types@^1.0.3", - "jsr:@std/net@^1.0.3", - "jsr:@std/path@^1.0.5", - "jsr:@std/streams@^1.0.5" - ] - }, - "@std/internal@1.0.3": { - "integrity": "208e9b94a3d5649bd880e9ca38b885ab7651ab5b5303a56ed25de4755fb7b11e" - }, - "@std/io@0.221.0": { - "integrity": "faf7f8700d46ab527fa05cc6167f4b97701a06c413024431c6b4d207caa010da", - "dependencies": [ - "jsr:@std/assert@^0.221.0", - "jsr:@std/bytes@^0.221.0" - ] - }, - "@std/io@0.224.8": { - "integrity": "f525d05d51fd873de6352b9afcf35cab9ab5dc448bf3c20e0c8b521ded9be392" - }, - "@std/media-types@1.0.3": { - "integrity": "b12d30a7852f7578f4d210622df713bbfd1cbdd9b4ec2eaf5c1845ab70bab159" - }, - "@std/net@1.0.4": { - "integrity": "2f403b455ebbccf83d8a027d29c5a9e3a2452fea39bb2da7f2c04af09c8bc852" - }, - "@std/path@1.0.0-rc.2": { - "integrity": "39f20d37a44d1867abac8d91c169359ea6e942237a45a99ee1e091b32b921c7d" - }, - "@std/path@1.0.6": { - "integrity": "ab2c55f902b380cf28e0eec501b4906e4c1960d13f00e11cfbcd21de15f18fed" - }, - "@std/regexp@1.0.0": { - "integrity": "158628d134c49a0858afe05017c4666f5f73d3a56602c346549ca42f3fab244a" - }, - "@std/semver@1.0.3": { - "integrity": "7c139c6076a080eeaa4252c78b95ca5302818d7eafab0470d34cafd9930c13c8" - }, - "@std/streams@0.221.0": { - "integrity": "47f2f74634b47449277c0ee79fe878da4424b66bd8975c032e3afdca88986e61", - "dependencies": [ - "jsr:@std/io@^0.221.0" - ] - }, - "@std/streams@1.0.5": { - "integrity": "74e5c73d7d68eeab0d7fba3b05cbee3ba4ac5ae37c5f4e675f67e62f8f53edc4" - }, - "@std/text@1.0.0-rc.1": { - "integrity": "34c722203e87ee12792c8d4a0cd2ee0e001341cbce75b860fc21be19d62232b0" - } - }, - "npm": { - "@types/node@18.16.19": { - "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==", - "dependencies": {} - }, - "anymatch@3.1.3": { - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dependencies": { - "normalize-path": "normalize-path@3.0.0", - "picomatch": "picomatch@2.3.1" - } - }, - "binary-extensions@2.3.0": { - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dependencies": {} - }, - "braces@3.0.3": { - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dependencies": { - "fill-range": "fill-range@7.1.1" - } - }, - "chokidar@3.6.0": { - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dependencies": { - "anymatch": "anymatch@3.1.3", - "braces": "braces@3.0.3", - "fsevents": "fsevents@2.3.3", - "glob-parent": "glob-parent@5.1.2", - "is-binary-path": "is-binary-path@2.1.0", - "is-glob": "is-glob@4.0.3", - "normalize-path": "normalize-path@3.0.0", - "readdirp": "readdirp@3.6.0" - } - }, - "fill-range@7.1.1": { - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dependencies": { - "to-regex-range": "to-regex-range@5.0.1" - } - }, - "fsevents@2.3.3": { - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dependencies": {} - }, - "glob-parent@5.1.2": { - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "is-glob@4.0.3" - } - }, - "is-binary-path@2.1.0": { - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dependencies": { - "binary-extensions": "binary-extensions@2.3.0" - } - }, - "is-extglob@2.1.1": { - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dependencies": {} - }, - "is-glob@4.0.3": { - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "is-extglob@2.1.1" - } - }, - "is-number@7.0.0": { - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dependencies": {} - }, - "normalize-path@3.0.0": { - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dependencies": {} - }, - "picomatch@2.3.1": { - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dependencies": {} - }, - "readdirp@3.6.0": { - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dependencies": { - "picomatch": "picomatch@2.3.1" - } - }, - "to-regex-range@5.0.1": { - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "is-number@7.0.0" - } - }, - "zod@3.23.8": { - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", - "dependencies": {} - } + "version": "4", + "specifiers": { + "jsr:@cliffy/ansi@1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@cliffy/internal@1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@cliffy/keycode@1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@cliffy/prompt@^1.0.0-rc.7": "1.0.0-rc.7", + "jsr:@core/unknownutil@^4.3.0": "4.3.0", + "jsr:@david/dax@0.42": "0.42.0", + "jsr:@david/path@0.2": "0.2.0", + "jsr:@david/which@~0.4.1": "0.4.1", + "jsr:@deno/graph@~0.83.4": "0.83.4", + "jsr:@std/assert@0.221": "0.221.0", + "jsr:@std/assert@^1.0.6": "1.0.6", + "jsr:@std/assert@~1.0.6": "1.0.6", + "jsr:@std/async@^1.0.7": "1.0.7", + "jsr:@std/bytes@0.221": "0.221.0", + "jsr:@std/cli@^1.0.6": "1.0.6", + "jsr:@std/collections@^1.0.9": "1.0.9", + "jsr:@std/encoding@^1.0.5": "1.0.5", + "jsr:@std/encoding@~1.0.5": "1.0.5", + "jsr:@std/fmt@1": "1.0.3", + "jsr:@std/fmt@^1.0.3": "1.0.3", + "jsr:@std/fmt@~1.0.2": "1.0.3", + "jsr:@std/fs@1": "1.0.5", + "jsr:@std/fs@^1.0.5": "1.0.5", + "jsr:@std/http@^1.0.9": "1.0.9", + "jsr:@std/internal@^1.0.4": "1.0.4", + "jsr:@std/io@0.221": "0.221.0", + "jsr:@std/io@~0.224.9": "0.224.9", + "jsr:@std/media-types@^1.0.3": "1.0.3", + "jsr:@std/net@^1.0.4": "1.0.4", + "jsr:@std/path@1": "1.0.7", + "jsr:@std/path@^1.0.7": "1.0.7", + "jsr:@std/path@~1.0.6": "1.0.7", + "jsr:@std/regexp@1": "1.0.0", + "jsr:@std/semver@^1.0.3": "1.0.3", + "jsr:@std/streams@0.221": "0.221.0", + "jsr:@std/streams@^1.0.7": "1.0.7", + "jsr:@std/text@~1.0.7": "1.0.8", + "npm:@types/node@*": "22.5.4", + "npm:chokidar@^3.6.0": "3.6.0", + "npm:zod@^3.23.8": "3.23.8" + }, + "jsr": { + "@cliffy/ansi@1.0.0-rc.7": { + "integrity": "f71c921cce224c13d322e5cedba4f38e8f7354c7d855c9cb22729362a53f25aa", + "dependencies": [ + "jsr:@cliffy/internal", + "jsr:@std/encoding@~1.0.5", + "jsr:@std/io@~0.224.9" + ] + }, + "@cliffy/internal@1.0.0-rc.7": { + "integrity": "10412636ab3e67517d448be9eaab1b70c88eba9be22617b5d146257a11cc9b17" + }, + "@cliffy/keycode@1.0.0-rc.7": { + "integrity": "5b3f6c33994e81a76b79f108b1989642ac22705840da33781f7972d7dff05503" + }, + "@cliffy/prompt@1.0.0-rc.7": { + "integrity": "a9cbd13acd8073558447cae8ca4cf593c09d23bcbe429cc63346920c21187b83", + "dependencies": [ + "jsr:@cliffy/ansi", + "jsr:@cliffy/internal", + "jsr:@cliffy/keycode", + "jsr:@std/assert@~1.0.6", + "jsr:@std/fmt@~1.0.2", + "jsr:@std/io@~0.224.9", + "jsr:@std/path@~1.0.6", + "jsr:@std/text" + ] + }, + "@core/unknownutil@4.3.0": { + "integrity": "538a3687ffa81028e91d148818047df219663d0da671d906cecd165581ae55cc" + }, + "@david/dax@0.42.0": { + "integrity": "0c547c9a20577a6072b90def194c159c9ddab82280285ebfd8268a4ebefbd80b", + "dependencies": [ + "jsr:@david/path", + "jsr:@david/which", + "jsr:@std/fmt@1", + "jsr:@std/fs@1", + "jsr:@std/io@0.221", + "jsr:@std/path@1", + "jsr:@std/streams@0.221" + ] + }, + "@david/path@0.2.0": { + "integrity": "f2d7aa7f02ce5a55e27c09f9f1381794acb09d328f8d3c8a2e3ab3ffc294dccd", + "dependencies": [ + "jsr:@std/fs@1", + "jsr:@std/path@1" + ] + }, + "@david/which@0.4.1": { + "integrity": "896a682b111f92ab866cc70c5b4afab2f5899d2f9bde31ed00203b9c250f225e" + }, + "@deno/graph@0.83.4": { + "integrity": "9e9ffb19652e49f452bb7b539c6c699baf14ce5df4bd96603f81d062cf15c3a2" + }, + "@std/assert@0.221.0": { + "integrity": "a5f1aa6e7909dbea271754fd4ab3f4e687aeff4873b4cef9a320af813adb489a" + }, + "@std/assert@1.0.6": { + "integrity": "1904c05806a25d94fe791d6d883b685c9e2dcd60e4f9fc30f4fc5cf010c72207", + "dependencies": [ + "jsr:@std/internal" + ] + }, + "@std/async@1.0.7": { + "integrity": "f4fadc0124432e37cba11e8b3880164661a664de00a65118d976848f32f96290" + }, + "@std/bytes@0.221.0": { + "integrity": "64a047011cf833890a4a2ab7293ac55a1b4f5a050624ebc6a0159c357de91966" + }, + "@std/cli@1.0.6": { + "integrity": "d22d8b38c66c666d7ad1f2a66c5b122da1704f985d3c47f01129f05abb6c5d3d" + }, + "@std/collections@1.0.9": { + "integrity": "4f58104ead08a04a2199374247f07befe50ba01d9cca8cbb23ab9a0419921e71" + }, + "@std/encoding@1.0.5": { + "integrity": "ecf363d4fc25bd85bd915ff6733a7e79b67e0e7806334af15f4645c569fefc04" + }, + "@std/fmt@1.0.3": { + "integrity": "97765c16aa32245ff4e2204ecf7d8562496a3cb8592340a80e7e554e0bb9149f" + }, + "@std/fs@1.0.5": { + "integrity": "41806ad6823d0b5f275f9849a2640d87e4ef67c51ee1b8fb02426f55e02fd44e", + "dependencies": [ + "jsr:@std/path@^1.0.7" + ] + }, + "@std/http@1.0.9": { + "integrity": "d409fc319a5e8d4a154e576c758752e9700282d74f31357a12fec6420f9ecb6c", + "dependencies": [ + "jsr:@std/cli", + "jsr:@std/encoding@^1.0.5", + "jsr:@std/fmt@^1.0.3", + "jsr:@std/media-types", + "jsr:@std/net", + "jsr:@std/path@^1.0.7", + "jsr:@std/streams@^1.0.7" + ] + }, + "@std/internal@1.0.4": { + "integrity": "62e8e4911527e5e4f307741a795c0b0a9e6958d0b3790716ae71ce085f755422" + }, + "@std/io@0.221.0": { + "integrity": "faf7f8700d46ab527fa05cc6167f4b97701a06c413024431c6b4d207caa010da", + "dependencies": [ + "jsr:@std/assert@0.221", + "jsr:@std/bytes" + ] + }, + "@std/io@0.224.9": { + "integrity": "4414664b6926f665102e73c969cfda06d2c4c59bd5d0c603fd4f1b1c840d6ee3" + }, + "@std/media-types@1.0.3": { + "integrity": "b12d30a7852f7578f4d210622df713bbfd1cbdd9b4ec2eaf5c1845ab70bab159" + }, + "@std/net@1.0.4": { + "integrity": "2f403b455ebbccf83d8a027d29c5a9e3a2452fea39bb2da7f2c04af09c8bc852" + }, + "@std/path@1.0.7": { + "integrity": "76a689e07f0e15dcc6002ec39d0866797e7156629212b28f27179b8a5c3b33a1" + }, + "@std/regexp@1.0.0": { + "integrity": "158628d134c49a0858afe05017c4666f5f73d3a56602c346549ca42f3fab244a" + }, + "@std/semver@1.0.3": { + "integrity": "7c139c6076a080eeaa4252c78b95ca5302818d7eafab0470d34cafd9930c13c8" + }, + "@std/streams@0.221.0": { + "integrity": "47f2f74634b47449277c0ee79fe878da4424b66bd8975c032e3afdca88986e61", + "dependencies": [ + "jsr:@std/io@0.221" + ] + }, + "@std/streams@1.0.7": { + "integrity": "1a93917ca0c58c01b2bfb93647189229b1702677f169b6fb61ad6241cd2e499b" + }, + "@std/text@1.0.8": { + "integrity": "40ba34caa095f393e78796e5eda37b8b4e2cc6cfd6f51f34658ad7487b1451e4" + } + }, + "npm": { + "@types/node@22.5.4": { + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "dependencies": [ + "undici-types" + ] + }, + "anymatch@3.1.3": { + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": [ + "normalize-path", + "picomatch" + ] + }, + "binary-extensions@2.3.0": { + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==" + }, + "braces@3.0.3": { + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": [ + "fill-range" + ] + }, + "chokidar@3.6.0": { + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": [ + "anymatch", + "braces", + "fsevents", + "glob-parent", + "is-binary-path", + "is-glob", + "normalize-path", + "readdirp" + ] + }, + "fill-range@7.1.1": { + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": [ + "to-regex-range" + ] + }, + "fsevents@2.3.3": { + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==" + }, + "glob-parent@5.1.2": { + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": [ + "is-glob" + ] + }, + "is-binary-path@2.1.0": { + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": [ + "binary-extensions" + ] + }, + "is-extglob@2.1.1": { + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-glob@4.0.3": { + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": [ + "is-extglob" + ] + }, + "is-number@7.0.0": { + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "normalize-path@3.0.0": { + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "picomatch@2.3.1": { + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "readdirp@3.6.0": { + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": [ + "picomatch" + ] + }, + "to-regex-range@5.0.1": { + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": [ + "is-number" + ] + }, + "undici-types@6.19.8": { + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + }, + "zod@3.23.8": { + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==" } }, "redirects": { - "https://esm.sh/@sentry/core@^8.30.0": "https://esm.sh/@sentry/core@8.30.0", - "https://esm.sh/@sentry/deno@^8.30.0": "https://esm.sh/@sentry/deno@8.30.0", - "https://esm.sh/@sentry/types@^8.30.0": "https://esm.sh/@sentry/types@8.30.0", - "https://esm.sh/@sentry/utils@^8.30.0": "https://esm.sh/@sentry/utils@8.30.0" + "https://esm.sh/@sentry/core@^8.35.0": "https://esm.sh/@sentry/core@8.35.0", + "https://esm.sh/@sentry/deno@^8.35.0": "https://esm.sh/@sentry/deno@8.35.0", + "https://esm.sh/@sentry/types@^8.35.0": "https://esm.sh/@sentry/types@8.35.0", + "https://esm.sh/@sentry/utils@^8.35.0": "https://esm.sh/@sentry/utils@8.35.0" }, "remote": { "https://deno.land/x/dir@1.5.1/data_local_dir/mod.ts": "91eb1c4bfadfbeda30171007bac6d85aadacd43224a5ed721bbe56bc64e9eb66", @@ -310,13 +290,13 @@ "https://deno.land/x/import_map@v0.20.1/mod.ts": "b074650942b9cca0bd1a5a2c354338f844f93b0ae01de10a14718415d7f370f7", "https://deno.land/x/wasmbuild@0.15.1/cache.ts": "9d01b5cb24e7f2a942bbd8d14b093751fa690a6cde8e21709ddc97667e6669ed", "https://deno.land/x/wasmbuild@0.15.1/loader.ts": "8c2fc10e21678e42f84c5135d8ab6ab7dc92424c3f05d2354896a29ccfd02a63", - "https://esm.sh/@sentry/core@8.30.0": "6ea55a08796e81d63a2712b3a2aa6c8bfb4b09895ec0ffc841aabf2d735674e0", - "https://esm.sh/@sentry/deno@8.30.0": "8211df7ac85c4c201b2cc3d9005956cb09b4092dbbcdf55633358b32c199f90b", - "https://esm.sh/@sentry/types@8.30.0": "1a977873c9ec8828a6a05d8522b1a2948c2e5b2e56a1c560e97d95855bfd4e1d", - "https://esm.sh/@sentry/utils@8.30.0": "c3f82aab0e54f9a8c232b94333f9c4b18aba3872a1030966e335509da8ec73f3", - "https://esm.sh/v135/@sentry/core@8.30.0/denonext/core.mjs": "fe720089eba91db490e5e6ef582f74c6ee8a0ecf0c3e2cd7f0a3a88495f22637", - "https://esm.sh/v135/@sentry/deno@8.30.0/denonext/deno.mjs": "47f650ca113fe5a5a66f4b1bab06a6b26d02dd7d2aa1cfaf0692400392f8d765", - "https://esm.sh/v135/@sentry/types@8.30.0/denonext/types.mjs": "9bb79f6617026595d0b266202991c0f3ec4586fb86a1b99f6a40ebbcb23a2f23", - "https://esm.sh/v135/@sentry/utils@8.30.0/denonext/utils.mjs": "154ec2ea8ddcc76dafab610498b023ee4cbb4b46435be86e7b229d539038c9c4" + "https://esm.sh/@sentry/core@8.35.0": "9537cc379ccaee2289e712ab45f2410cae3c2ccc6854d2807381e0458686b32c", + "https://esm.sh/@sentry/deno@8.35.0": "225dfe720f8a9a6b22853b5a28e3fb08325be3421724619a3d37af2dffb19040", + "https://esm.sh/@sentry/types@8.35.0": "2f03d25e475286730118111043c883eb28acb3c00d60d3620174d522c4088886", + "https://esm.sh/@sentry/utils@8.35.0": "386befdd27386780063b247cbee68a6e522478012eaa7e7c4c07e89359ad9f38", + "https://esm.sh/v135/@sentry/core@8.35.0/denonext/core.mjs": "05fe5d4ca570a8c0888a4c7cc4c15bdebe641039107d7bfcc2688fe3a69c4b26", + "https://esm.sh/v135/@sentry/deno@8.35.0/denonext/deno.mjs": "1611a46ecc33003b63a9e1135ad7733bb3a746c630efab2c6b051d9da366c2e8", + "https://esm.sh/v135/@sentry/types@8.35.0/denonext/types.mjs": "bc6d9580f74910ff279a968d64603ea23c9da8753096139874f6a6ab58735d9a", + "https://esm.sh/v135/@sentry/utils@8.35.0/denonext/utils.mjs": "7657f46e9e796dd9f581c0f6dc1550e15d37df009d91d0aa36a210a1bdf14766" } } diff --git a/deps.ts b/deps.ts index b205d7f..7bc70ff 100644 --- a/deps.ts +++ b/deps.ts @@ -1,8 +1,8 @@ -export { abortable, deadline, debounce, delay, retry } from 'jsr:@std/async@^1.0.5' -export { walk } from 'jsr:@std/fs@^1.0.3' -export { serveDir, type ServeDirOptions, STATUS_CODE, STATUS_TEXT, type StatusCode } from 'jsr:@std/http@^1.0.6' -export { joinGlobs, toFileUrl } from 'jsr:@std/path@^1.0.6' -export { normalize as posixNormalize } from 'jsr:@std/path@^1.0.6/posix/normalize' +export { abortable, deadline, debounce, delay, retry } from 'jsr:@std/async@^1.0.7' +export { walk } from 'jsr:@std/fs@^1.0.5' +export { serveDir, type ServeDirOptions, STATUS_CODE, STATUS_TEXT, type StatusCode } from 'jsr:@std/http@^1.0.9' +export { joinGlobs, toFileUrl } from 'jsr:@std/path@^1.0.7' +export { normalize as posixNormalize } from 'jsr:@std/path@^1.0.7/posix/normalize' export { escape } from 'jsr:@std/regexp@^1.0.0' export { watch } from 'npm:chokidar@^3.6.0' export type { ZodType } from 'npm:zod@^3.23.8' diff --git a/dev_deps.ts b/dev_deps.ts index 9ec091e..7e22e42 100644 --- a/dev_deps.ts +++ b/dev_deps.ts @@ -8,18 +8,18 @@ export { type InputOptions, Select, type SelectOptions, -} from 'jsr:@cliffy/prompt@^1.0.0-rc.5' +} from 'jsr:@cliffy/prompt@^1.0.0-rc.7' export { as, ensure, is } from 'jsr:@core/unknownutil@^4.3.0' -export { createGraph, load as loadGraph } from 'jsr:@deno/graph@^0.82.1' -export type { DependencyJson, ResolvedDependency } from 'jsr:@deno/graph@^0.82.1/types' -export { assertEquals, assertExists } from 'jsr:@std/assert@^1.0.5' +export { createGraph, load as loadGraph } from 'jsr:@deno/graph@^0.83.4' +export type { DependencyJson, ResolvedDependency } from 'jsr:@deno/graph@^0.83.4/types' +export { assertEquals, assertExists } from 'jsr:@std/assert@^1.0.6' export { parseArgs } from 'jsr:@std/cli@^1.0.6' export { Spinner } from 'jsr:@std/cli@^1.0.6/unstable-spinner' -export { filterEntries } from 'jsr:@std/collections@^1.0.6' -export { bold, cyan, dim, green, magenta } from 'jsr:@std/fmt@^1.0.2/colors' -export { expandGlob } from 'jsr:@std/fs@^1.0.3' +export { filterEntries } from 'jsr:@std/collections@^1.0.9' +export { bold, cyan, dim, green, magenta } from 'jsr:@std/fmt@^1.0.3/colors' +export { expandGlob } from 'jsr:@std/fs@^1.0.5' export { getAvailablePort } from 'jsr:@std/net@^1.0.4/get-available-port' -export { dirname, fromFileUrl, relative, resolve, toFileUrl } from 'jsr:@std/path@^1.0.6' +export { dirname, fromFileUrl, relative, resolve, toFileUrl } from 'jsr:@std/path@^1.0.7' export { escape } from 'jsr:@std/regexp@^1.0.0' export * as SemVer from 'jsr:@std/semver@^1.0.3' diff --git a/src/router.ts b/src/router.ts index f1787ae..b2ab923 100644 --- a/src/router.ts +++ b/src/router.ts @@ -88,6 +88,9 @@ class LRUCache { class UrlNode { readonly children: Map = new Map() + static #cwd = Deno.cwd() + static #sep = Deno.build.os === 'windows' ? '\\' : '/' + placeholder: boolean = true slugName: string | null = null restSlugName: string | null = null @@ -97,11 +100,20 @@ class UrlNode { // #region Insert insert(urlPath: string, data: string): void { - this.#insert(urlPath.split('/').filter(Boolean), 0, [], false, data) + const segments = urlPath.split('/').filter((segment) => + segment && !(segment.startsWith('(') && segment.endsWith(')')) + ) + this.#insert(segments, 0, [], false, data) } #insert(urlPaths: string[], index: number, slugNames: string[], isCatchAll: boolean, data: string): void { if (index === urlPaths.length) { + if (this.data !== null) { + throw new Error( + `You cannot have two parallel pages that resolve to the same path. Please check ` + + `${UrlNode.#userFriendlyPath(this.data)} and ${UrlNode.#userFriendlyPath(data)}.`, + ) + } this.placeholder = false this.data = data return @@ -254,6 +266,10 @@ class UrlNode { } // #endregion + + static #userFriendlyPath(fileUrl: string) { + return fileUrl.slice(8 + UrlNode.#cwd.length).replace(/\//g, UrlNode.#sep) + } } /** diff --git a/src/sentry.ts b/src/sentry.ts index 023f9ee..e2e8f2b 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -24,10 +24,10 @@ import { setHttpStatus, startSpan, withIsolationScope, -} from 'https://esm.sh/@sentry/core@^8.30.0' -import * as Sentry from 'https://esm.sh/@sentry/deno@^8.30.0' -import type { Client, IntegrationFn, SpanAttributes } from 'https://esm.sh/@sentry/types@^8.30.0' -import { getSanitizedUrlString, parseUrl } from 'https://esm.sh/@sentry/utils@^8.30.0' +} from 'https://esm.sh/@sentry/core@^8.35.0' +import * as Sentry from 'https://esm.sh/@sentry/deno@^8.35.0' +import type { Client, IntegrationFn, SpanAttributes } from 'https://esm.sh/@sentry/types@^8.35.0' +import { getSanitizedUrlString, parseUrl } from 'https://esm.sh/@sentry/utils@^8.35.0' type RawHandler = (request: Request, info: Deno.ServeHandlerInfo) => Response | Promise diff --git a/tests/router.test.ts b/tests/router.test.ts index ee2a0ad..1d5f27f 100644 --- a/tests/router.test.ts +++ b/tests/router.test.ts @@ -46,11 +46,11 @@ Deno.test('router', async (t) => { '/[root-slug].ts', '/index.ts', '/posts/[id].ts', - '/blog/[id]/comments/[cid].ts', - '/blog/abc/[id].ts', + '/(blog)/blog/[id]/comments/[cid].ts', + '/(blog)/blog/abc/[id].ts', '/[...rest].ts', - '/blog/abc/post.ts', - '/blog/abc/index.ts', + '/(blog)/blog/abc/post.ts', + '/(blog)/blog/abc/index.ts', '/p1/[[...incl]].ts', '/p/[...rest].ts', '/p2/[...rest].ts', @@ -59,7 +59,7 @@ Deno.test('router', async (t) => { '/p3/[[...rest]].ts', '/p3/[id].ts', '/p3/[id]/abc.ts', - '/blog/[id].ts', + '/(blog)/blog/[id].ts', '/foo/[d]/bar/baz/[f].ts', '/apples/[ab]/[cd]/ef.ts', '/foo bar.ts', @@ -82,11 +82,11 @@ Deno.test('router', async (t) => { const tests: Record }> = { '/api/': { file: '/index.ts', params: {} }, '/api/apples/1/2/ef': { file: '/apples/[ab]/[cd]/ef.ts', params: { ab: '1', cd: '2' } }, - '/api/blog/abc': { file: '/blog/abc/index.ts', params: {} }, - '/api/blog/abc/post': { file: '/blog/abc/post.ts', params: {} }, - '/api/blog/abc/1': { file: '/blog/abc/[id].ts', params: { id: '1' } }, - '/api/blog/1': { file: '/blog/[id].ts', params: { id: '1' } }, - '/api/blog/1/comments/2': { file: '/blog/[id]/comments/[cid].ts', params: { id: '1', cid: '2' } }, + '/api/blog/abc': { file: '/(blog)/blog/abc/index.ts', params: {} }, + '/api/blog/abc/post': { file: '/(blog)/blog/abc/post.ts', params: {} }, + '/api/blog/abc/1': { file: '/(blog)/blog/abc/[id].ts', params: { id: '1' } }, + '/api/blog/1': { file: '/(blog)/blog/[id].ts', params: { id: '1' } }, + '/api/blog/1/comments/2': { file: '/(blog)/blog/[id]/comments/[cid].ts', params: { id: '1', cid: '2' } }, '/api/foo/1/bar/baz/2': { file: '/foo/[d]/bar/baz/[f].ts', params: { d: '1', f: '2' } }, '/api/p/1/2/3': { file: '/p/[...rest].ts', params: { rest: ['1', '2', '3'] } }, '/api/p1': { file: '/p1/[[...incl]].ts', params: { incl: [] } },