简中文档
On this page

deno publish

Command line usage

deno publish [OPTIONS]

Publish the current working directory's package or workspace to JSR


Publishing options Jump to heading

--allow-dirty Jump to heading

Allow publishing if the repository has uncommitted changed.

--allow-slow-types Jump to heading

Allow publishing with slow types.

--dry-run Jump to heading

Prepare the package for publishing performing all checks and validations without uploading.

--no-provenance Jump to heading

Disable provenance attestation. Enabled by default on Github actions, publicly links the package to where it was built and published from.

--set-version Jump to heading

Set version for a package to be published. This flag can be used while publishing individual packages and cannot be used in a workspace.

--token Jump to heading

The API token to use when publishing. If unset, interactive authentication is be used.

Options Jump to heading

--config Jump to heading

Short flag: -c

Configure different aspects of deno including TypeScript, linting, and code formatting Typically the configuration file will be called deno.json or deno.jsonc and automatically detected; in that case this flag is not necessary.

--no-config Jump to heading

Disable automatic loading of the configuration file.

Type checking options Jump to heading

--check Jump to heading

Set type-checking behavior. This subcommand type-checks local modules by default, so adding --check is redundant If the value of "all" is supplied, remote modules will be included. Alternatively, the 'deno check' subcommand can be used.

--no-check Jump to heading

Skip type-checking. If the value of "remote" is supplied, diagnostic errors from remote modules will be ignored.

包要求 Jump to heading

您的包必须在其 deno.jsonjsr.json 文件中具有 nameversionexports 字段。

  • name 字段必须是唯一的,并遵循 @<scope_name>/<package_name> 约定。
  • version 字段必须是有效的 semver 版本。
  • exports 字段必须指向包的主要入口点。

示例:

deno.json
{
  "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

你找到了你需要的东西吗?

编辑此页面
隐私政策