typescript - 自行托管 Deno 库的正确方法是什么?

标签 typescript visual-studio-code deno

我已经设置了一个 apache2 服务器并将我的库定位在 http://example.com/lib/deno/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2b5f4e585f6b1a051b051b" rel="noreferrer noopener nofollow">[email protected]</a>/然后从 http://example.com/lib/deno/test/ 创建 301 重定向到前者。在 VS Code(使用 deno 插件)中,我注意到当我导入类似 https://deno.land/std/http/server.ts 的内容时我收到一条警告消息:

Implicitly using latest version (0.140.0) for https://deno.land/std/http/server.ts deno(deno-warn)

按照 URL 重定向到 https://deno.land/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ef9c9b8bafdec1dedbdfc1df" rel="noreferrer noopener nofollow">[email protected]</a>/http/server.ts

但是当我导入自己的 http://example.com/lib/deno/test/mod.ts 时我没有收到类似的消息。此警告是否以某种方式硬编码为仅适用于 deno.land,还是我没有正确托管内容?

最佳答案

Deno 提供 Language Server Protocol 的实现。要与模块发现、自动完成等方面的所有功能紧密集成,您将需要实现一个模块注册表,如下所述:

https://deno.land/[email protected]/language_server/imports

以下是所需的基础知识,但您需要了解 API 端点、架构等的详细信息才能成功实现。

Registry support for import completions

In order to support having a registry be discoverable by the Deno language server, the registry needs to provide a few things:

  • A schema definition file. This file needs to be located at /.well-known/deno-import-intellisense.json. This file provides the configuration needed to allow the Deno language server query the registry and construct import specifiers.

  • A series of API endpoints that provide the values to be provided to the user to complete an import specifier.

关于typescript - 自行托管 Deno 库的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72349400/

相关文章:

typescript - 如何在 ngbdatepicker 中更改 datepicker 日期格式,如 dd/mm/yyyy

angular - npm types 或 typings 或 @type 或什么?

javascript - 将 RxJS 与 filter(Boolean) 一起用于查询?

debugging - vscode调试器配置: cwd

javascript - 如何在生产中使用 deno

typescript - 如何使用 Deno (oak) 返回 html 或 json?

javascript - 如何将 JQuery 导入 Typescript 文件?

android - 未找到设备 Flutter VSCode 模拟器

visual-studio-code - VSC 连接到 SSL LocalHost 以进行角度调试

typescript - 如何退出 Deno? (process.exit 的模拟)