@github/dependency-submission-toolkit

中文文档
3.0.0发布于 2026/11/05MITTypeScriptESM + CJS构建来源已验证近 30 天下载 2816

A TypeScript library for creating dependency snapshots.

原始使用文档

Dependency Submission Toolkit

@github/dependency-submission-toolkit is a TypeScript library for creating dependency snapshots and submitting them to the dependency submission API. Snapshots are a set of dependencies grouped by manifest with some related metadata. A manifest can be a physical file or a more abstract representation of a dependency grouping (such processing of program outputs). After submission to the API, the included dependencies appear in the repository's dependency graph.

Installation

Version 3 requires Node.js 24 or later. Both CommonJS (require) and ESM (import) are supported.

npm install @github/dependency-submission-toolkit

Writing Your Own Dependency Submission Action

You may use classes from @github/dependency-submission-toolkit to help in building your own GitHub Action for submitting dependencies to the Dependency Submission API. At a high level, the steps to use the classes are:

  1. Create a PackageCache of all of the packages that could be included in your manifest, as well define as the relationships between them.

  2. Using the packages defined in PackageCache, create a Manifest or a BuildTarget, which defines the dependencies of the build environment or specific build artifact.

  3. Create a Snapshot to include one or more Manifests or BuildTargets. The snapshot is the base container for submitting dependencies to the Dependency Submission API.

  4. Follow the instructions for Creating a JavaScript Action. These include:

    • Defining an action.yml action metadata file
    • Compiling the JavaScript into a single script using ncc
    • Testing your action in a workflow

A full example action using this library is included in the example/ directory. This example uses the output from the npm list to create an accurate and complete graph of the dependencies used in this library. This action is also included in a workflow in this repository and runs for each commit to the main branch.

版本与发布记录

@github/dependency-submission-toolkit 共发布 16 个版本,首次发布于 2022/06/29;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.0.0latest2026/11/0511 天前
2.0.7-oidc.1oidc-test2026/11/0411 天前
2.0.52025/03/221.7 年前
2.0.42024/02/192 年前
2.0.32024/01/222 年前
2.0.22024/01/182 年前

关于 @github/dependency-submission-toolkit 的常见问题

@github/dependency-submission-toolkit 是什么?

A TypeScript library for creating dependency snapshots.

如何安装 @github/dependency-submission-toolkit?

在项目目录运行 npm install @github/dependency-submission-toolkit,或使用 pnpm add / yarn add / bun add。

@github/dependency-submission-toolkit 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@github/dependency-submission-toolkit 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@github/dependency-submission-toolkit 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@github/dependency-submission-toolkit 可以商用吗?

@github/dependency-submission-toolkit 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@github/dependency-submission-toolkit 的下载量有多少?

根据 npm 官方下载统计,@github/dependency-submission-toolkit 在 2026/10/17 – 2026/11/15 这 30 天内被下载 2,816 次,日均约 94 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@github/dependency-submission-toolkit 还在维护吗?

最新版本 3.0.0 发布于 2026/11/05(11 天前);至今共发布 16 个版本,其中过去 12 个月发布了 2 个;首次发布于 2022/06/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。