JSR 协议
jsr:
协议从 JSR 注册表 获取包。
¥The jsr:
protocol fetches packages from the JSR registry.
请注意,由于 JSR 注册表负责将包从 TypeScript 编译为 JavaScript,因此它们有时会重新打包包。因此,Yarn 锁定文件包含完整的 tarball URL。
¥Note that because the JSR registry is responsible for compiling packages from TypeScript to JavaScript they sometimes re-pack packages. As a result, the Yarn lockfile contains the full tarball URLs.
引用 JSR 文档:
¥Quoting the JSR documentation:
即使版本本身没有更改,针对软件包特定版本发布的特定 tarball 也可能会随时间而变化。这是因为 JSR 注册表可能会为软件包版本重新生成与 npm 兼容的 tarball,以修复与 npm 的兼容性问题或改进生成的 tarball 中的转译输出。我们将其称为 tarball 的“修订版本”。tarball 的修订版不会在 npm 注册表端点中公布,但它包含在 tarball 本身的 URL 中,并包含在 tarball 中
package.json
文件的_jsr_revision
字段中。tarball 的修订版本不被视为软件包版本的一部分,并且不会影响 semver 解析。¥The specific tarballs advertised for a given version of a package may change over time, even if the version itself is not changed. This is because the JSR registry may re-generate npm compatible tarballs for a package version to fix compatibility issues with npm or improve the transpile output in the generated tarball. We refer to this as the “revision” of a tarball. The revision of a tarball is not advertised in the npm registry endpoint, but it is included in the URL of the tarball itself and is included in the
package.json
file in the tarball at the_jsr_revision
field. The revision of a tarball is not considered part of the package version, and does not affect semver resolution.但是,tarball URL 是不可变的。引用了特定 tarball URL 的工具始终能够下载该 tarball。生成 tarball 的新修订版本时,旧 tarball 不会被删除,并将继续在同一 URL 上可用。新的 tarball 将在包含新修订版的新 URL 上提供。
¥However, tarball URLs are immutable. Tools that have a reference to a specific tarball URL will always be able to download that exact tarball. When a new revision of a tarball is generated, the old tarball is not deleted and will continue to be available at the same URL. The new tarball will be available at a new URL that includes the new revision.
由于 tarball URL 包含在包管理器锁定文件中,因此运行
npm i
/yarn
/pnpm i
绝不会意外下载 tarball 的新版本。¥Because the tarball URL is included in package manager lock files, running
npm i
/yarn
/pnpm i
will never accidentally download a new revision of the tarball.