@berenddeboer/nx-aws-cdk

中文文档
3.0.3发布于 2025/12/15MITTypeScriptCommonJS零依赖构建来源已验证近 30 天下载 9758

Nx self-inferring plugin for AWS CDK stacks

原始使用文档
文档目录8 节
  1. Table of Contents
  2. Install
  3. Usage
  4. Plugin
  5. Generating a CDK application
  6. Targets
  7. Contributing
  8. License

standard-readme compliant @berenddeboer/nx-aws-cdk Typescript LICENSE npm version Downloads


@berenddeboer/nx-aws-cdk

A self-inferring Nx plugin for developing aws-cdk applications.

Table of Contents

Install

npm
npm install --save-dev @berenddeboer/nx-aws-cdk
pnpm
pnpm i --save-dev @berenddeboer/nx-aws-cdk
yarn
yarn add --dev @berenddeboer/nx-aws-cdk
bun
bun add -D @berenddeboer/nx-aws-cdk

Usage

Plugin

This package uses inferred targets (tasks). Any project with a cdk.json in its root will create the appropriate cdk targets for that project.

You can configure the default target names in the plugin:

{
  "plugin": "@berenddeboer/nx-aws-cdk/plugin",
  "options": {
    "cdkTargetName": "cdk",
    "synthTargetName": "synth",
    "deployTargetName": "deploy",
    "diffTargetName": "diff",
    "rollbackTargetName": "rollback",
    "watchTargetName": "watch",
    "destroyTargetName": "destroy"
  }
},

Remove a target if you do not want it auto-generated.

There's no need to use the executor anymore, but you can still use it for non-inferred targets.

Use the cdk target to run any cdk command easily:

npx nx run my-stack:cdk diff ...

Generating a CDK application

To generate an AWS CDK v2 Application:

npx nx generate @berenddeboer/nx-aws-cdk:application --directory=stacks/cdk-app --name=cdk-app

Currently do not specify a unit test runner. This crashes nx for as yet unknown reasons.

You can customize it further by passing these options:

nx generate @berenddeboer/nx-aws-cdk:application [directory] [options,...]

Options:
    --directory                  The directory of the new                          [string]
                                 application.
    --name                       The name of the application.                      [string]
    --linter                     The tool to use for running   [string] [choices: "eslint",
                                 lint checks.                     "none"] [default: "none"]
    --setParserOptionsProject    Whether or not to configure                      [boolean]
                                 the ESLint
                                 `parserOptions.project`
                                 option. We do not do this by
                                 default for lint performance
                                 reasons.
    --tags                       Add tags to the project (used                     [string]
                                 for linting)
    --unitTestRunner             Test runner to use for unit     [string] [choices: "jest",
                                 tests.                         "vitest", "none"] [default:
                                                                                    "none"]
    --useProjectJson             Use a `project.json`                             [boolean]
                                 configuration file instead of
                                 inlining the Nx configuration
                                 in the `package.json` file.
    --skipFormat                 Skip formatting files.                           [boolean]
    --skipPackageJson            Do not add dependencies to                       [boolean]
                                 `package.json`.

Targets

Generated applications expose several functions to the CLI that allow users to deploy, destroy and so on.

nx deploy myApp
nx destroy myApp

We infer the most common cdk commands. Use the executor to have access to all CDK commands.

Contributing

See the contributing file!

PRs accepted.

If editing the README, please conform to the standard-readme specification.

License

This project is MIT licensed.

版本与发布记录

@berenddeboer/nx-aws-cdk 共发布 32 个版本,首次发布于 2023/05/12;过去 12 个月发布了 1 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.0.3latest2025/12/1510 个月前
3.0.22025/09/121.2 年前
3.0.12025/07/301.3 年前
3.0.02025/07/301.3 年前
3.0.0-alpha92025/05/091.5 年前
3.0.0-alpha82025/04/191.6 年前

关于 @berenddeboer/nx-aws-cdk 的常见问题

@berenddeboer/nx-aws-cdk 是什么?

Nx self-inferring plugin for AWS CDK stacks

如何安装 @berenddeboer/nx-aws-cdk?

在项目目录运行 npm install @berenddeboer/nx-aws-cdk,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@nx/devkit(^20.6.4 || ^21.0.0 || ^22.0.0)、@nx/eslint(^20.6.4 || ^21.0.0 || ^22.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@berenddeboer/nx-aws-cdk 支持 TypeScript 吗?

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

@berenddeboer/nx-aws-cdk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@berenddeboer/nx-aws-cdk 可以商用吗?

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

@berenddeboer/nx-aws-cdk 的下载量有多少?

根据 npm 官方下载统计,@berenddeboer/nx-aws-cdk 在 2026/10/08 – 2026/11/06 这 30 天内被下载 9,758 次,日均约 325 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@berenddeboer/nx-aws-cdk 还在维护吗?

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