deno-udd
DenoのURL importのversionをあげてくれるtool
/icons/github.iconhayd/deno-udd
contribution memo
テストコマンド
$ deno test --allow-write=/tmp --allow-read=/tmp
新しいdomainを追加したいといきは、registry.tsとregistry_test.tsを編集する
バグ
https://github.com/hayd/deno-udd/issues/58
まじか
どうしようかな。今そっちやる余裕無いぞ
2022-02-17 22:53:04 さすがになんとかしたい
✅CIを導入する (scrapbox-katex-previewer)#620cadaf1280f00000960191で本格的に困り始めてきた
URL Pattern APIとか使えないだろうか
少なくともregistory.ts周りの設計を一からやり直す必要がありそう
https://:domain/@:scope/:packagenameに対応していない
このせいでscrapbox-parserのversionを正しく認識できていなかった
https://gyazo.com/3b95980bf0a7c232d25b57c3bec53e87
cf. https://github.com/hayd/deno-udd/issues/6
あとでパッチ投げる
実装
https://:domain/@:scope/:packagename@:versionとhttps://:domain/:packagename@:versionの2つに対応できればいい
以下のmethodsをカスタマイズする
name()
(@:scope/)?:packagenameを返す
at(version)
指定されたversionにしたURLを返す
version()
:versionを返す
defaultではdefaultName(), defaultAt(), defaultVersion()が使用されているが、それだと対応できないので独自の処理に置き換える
別のRegistoryとして実装するのもありか?
13:12:25 これで実装してみた
保存用branch
https://github.com/hayd/deno-udd/pull/52 がmergeされたらPRする
parts()はgetInfo()として全てのregistryで共通化させてもいいかもしれない
13:29:02 PR出していいかコメントで聞いたhttps://github.com/hayd/deno-udd/issues/6
codeに自信がない……
https://cdn.jsdelivr.net/npm に対応していない
https://cdn.jsdelivr.net/gh には対応している
esm.sh対応
PRだした
13:18:03 mergeされんの早っ!
https://github.com/hayd/deno-udd/pull/52#event-5899838066
Deno(Nodeでも)で外部モジュールのクラスやSymbolを使用するときは少し慎重になる必要があると同じ現象が起きている
具体的には、https://deno.land/std@0.105.0/http/server.ts#= をimportすると内部でhttps://deno.land/std@0.105.0/http/server.ts がimportされる
これらは別々のmoduleとして認識されてしまい、classが違うとエラーが出てしまう
code:log
error: TS2322 ERROR: Type 'import("https://deno.land/std@0.105.0/http/server.ts").ServerRequest | null' is not assignable to type 'import("https://deno.land/std@0.105.0/http/server.ts#=").ServerRequest | null'.
Type 'import("https://deno.land/std@0.105.0/http/server.ts").ServerRequest' is not assignable to type 'import("https://deno.land/std@0.105.0/http/server.ts#=").ServerRequest'.
Property '#done' in type 'ServerRequest' refers to a different member that cannot be accessed from within type 'ServerRequest'.
request = await readRequest(conn, reader);
~~~~~~~
at https://deno.land/std@0.105.0/http/server.ts#=:149:9
これはさすがにissueにすべきだろ
#2022-03-13 13:31:37
#2022-03-11 17:00:19
#2022-02-17 22:54:49
#2022-01-24 05:38:11
#2022-01-16 11:11:28