deno publish
命令行用法
o publish [OPTIONS]
将当前工作目录的包或工作区发布到 JSR
不稳定选项 Jump to heading
--unstable
Jump to heading
--unstable
标志已被弃用。请使用细粒度的 --unstable-*
标志.
--unstable-bare-node-builtins
Jump to heading
启用不稳定的裸节点内置功能.
--unstable-detect-cjs
Jump to heading
在更多情况下将模棱两可的 .js、.jsx、.ts、.tsx 文件视为 CommonJS 模块.
--unstable-sloppy-imports
Jump to heading
启用通过扩展探测、.js 到 .ts 以及目录探测来解析模块标识符的不稳定功能.
发布选项 Jump to heading
--allow-dirty
Jump to heading
如果仓库有未提交的更改,允许发布.
--allow-slow-types
Jump to heading
允许发布包含慢速类型的包.
--dry-run
Jump to heading
准备发布包,执行所有检查和验证,但不进行上传.
--no-provenance
Jump to heading
禁用来源证明。 默认在 Github actions 中启用,公开链接包到其构建和发布的位置。.
--set-version
Jump to heading
设置要发布的包的版本。 此标志可以在发布单个包时使用,不能在工作区中使用。.
--token
Jump to heading
发布时使用的 API 令牌。如果未设置,将使用交互式身份验证.
Options Jump to heading
--config
Jump to heading
Short flag: -c
配置 deno 的不同方面,包括 TypeScript、代码检查和代码格式化
通常配置文件将被称为 deno.json
或 deno.jsonc
并自动检测;在这种情况下,此标志不是必需的。
文档:https://docs.deno.com/go/config.
--no-config
Jump to heading
禁用自动加载配置文件.
类型检查选项 Jump to heading
--check
Jump to heading
设置类型检查行为。此子命令默认会检查本地模块,因此添加 --check
是多余的
如果提供了 "all" 值,远程模块也将被包含。
或者,可以使用 'deno check' 子命令.
--no-check
Jump to heading
跳过类型检查。如果提供了 "remote" 值,远程模块的诊断错误将被忽略.
包要求 Jump to heading
你的包必须在 deno.json
或 jsr.json
文件中包含 name
、version
和 exports
字段。
name
字段必须唯一,并遵循@<scope_name>/<package_name>
的命名规范。version
字段必须是一个有效的 semver 版本。exports
字段必须指向包的主入口点。
示例:
{
"name": "@scope_name/package_name",
"version": "1.0.0",
"exports": "./main.ts"
}
在发布你的包之前,你必须通过访问 JSR - 发布一个包 在注册表中创建它。
示例 Jump to heading
发布当前工作区
deno publish
使用特定令牌发布当前工作区,绕过交互式身份验证
deno publish --token c00921b1-0d4f-4d18-b8c8-ac98227f9275
发布并检查远程模块中的错误
deno publish --check=all
执行试运行以模拟发布
deno publish --dry-run
使用特定配置文件中的设置进行发布
deno publish --config custom-config.json