diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8de3032..03dd79a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# Contributing
-PR's are are welcome and encouraged in this repository. Read this document to see how to contribute.
+PR's are welcome and encouraged in this repository. Read this document to see how to contribute.
## Table of Contents
@@ -76,13 +76,13 @@ npm link
Finally, in the project that you want to test, run:
```
-yarn link @codebrew/{plugin}
+yarn link @efacity/{plugin}
```
Or:
```
-npm link @codebrew/{plugin}
+npm link @efacity/{plugin}
```
# Pull Requests
diff --git a/README.md b/README.md
index 5e3e11f..98dac58 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,16 @@
-
+
[](https://github.com/RichardLitt/standard-readme)
-# Codebrew Nx Plugins
+# Efacity Nx Plugins
-A collection of third-party Nx plugins.
+A collection of third-party Nx plugins based on Codebrew (https://github.com/codebrewlab/nx-plugins)
+Codebrew no longer maintained the plugin and accepts pull requests to continue the development.
## Table of Contents
-- [Codebrew Nx Plugins](#codebrew-nx-plugins)
+- [AWS CDK Nx Plugins](#aws-cdk-nx-plugins)
- [Table of Contents](#table-of-contents)
- [Plugins](#plugins)
- [Maintainers](#maintainers)
@@ -18,13 +19,13 @@ A collection of third-party Nx plugins.
## Plugins
-| Plugin | Description |
-| --------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
-| [`@codebrew/nx-aws-cdk`](./packages/nx-aws-cdk/README.md) | An Nx plugin for developing [aws-cdk](https://docs.aws.amazon.com/cdk/latest/guide/home.html) |
+| Plugin | Description |
+| -------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
+| [`@efacity/nx-aws-cdk`](./packages/nx-aws-cdk/README.md) | An Nx plugin for developing [aws-cdk](https://docs.aws.amazon.com/cdk/latest/guide/home.html) |
## Maintainers
-[@tienne](https://github.com/tienne)
+[@efacity](https://github.com/efacity)
## Contributing
@@ -36,4 +37,4 @@ If editing the README, please conform to the [standard-readme](https://github.co
## License
-This project is MIT licensed 2021 David Kwon.
+This project is MIT licensed.
diff --git a/e2e/nx-aws-cdk-e2e/tests/aws-cdk.spec.ts b/e2e/nx-aws-cdk-e2e/tests/aws-cdk.spec.ts
index 3b12387..abbe116 100644
--- a/e2e/nx-aws-cdk-e2e/tests/aws-cdk.spec.ts
+++ b/e2e/nx-aws-cdk-e2e/tests/aws-cdk.spec.ts
@@ -2,20 +2,20 @@ import { checkFilesExist, ensureNxProject, readJson, runNxCommandAsync, uniq } f
describe('nx-aws-cdk e2e', () => {
beforeAll(() => {
- ensureNxProject('@codebrew/nx-aws-cdk', 'dist/packages/nx-aws-cdk');
+ ensureNxProject('@efacity/nx-aws-cdk', 'dist/packages/nx-aws-cdk');
});
it('should create aws-cdk', async () => {
const plugin = uniq('nx-aws-cdk');
- await runNxCommandAsync(`generate @codebrew/nx-aws-cdk:application ${plugin}`);
+ await runNxCommandAsync(`generate @efacity/nx-aws-cdk:application ${plugin}`);
}, 120000);
describe('--directory', () => {
it('should create src in the specified directory', async () => {
const plugin = uniq('nx-aws-cdk');
- await runNxCommandAsync(`generate @codebrew/nx-aws-cdk:application ${plugin} --directory subdir`);
+ await runNxCommandAsync(`generate @efacity/nx-aws-cdk:application ${plugin} --directory subdir`);
expect(() => checkFilesExist(`apps/subdir/${plugin}/src/main.ts`)).not.toThrow();
}, 120000);
});
@@ -24,7 +24,7 @@ describe('nx-aws-cdk e2e', () => {
it('should add tags to nx.json', async () => {
const plugin = uniq('nx-aws-cdk');
- await runNxCommandAsync(`generate @codebrew/nx-aws-cdk:application ${plugin} --tags e2etag,e2ePackage`);
+ await runNxCommandAsync(`generate @efacity/nx-aws-cdk:application ${plugin} --tags e2etag,e2ePackage`);
const nxJson = readJson('nx.json');
expect(nxJson.projects[plugin].tags).toEqual(['e2etag', 'e2ePackage']);
}, 120000);
diff --git a/package-lock.json b/package-lock.json
index ef3abec..1c5d398 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4,29 +4,41 @@
"lockfileVersion": 1,
"dependencies": {
"@angular-devkit/architect": {
- "version": "0.1200.5",
- "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1200.5.tgz",
- "integrity": "sha512-222VZ4OeaDK3vON8V5m+w15SRWfUs5uOb4H9ij/H9/6tyHD83uWfCDoOGg+ax4wJVdWEFJIS+Vn4ijGcZCq9WQ==",
+ "version": "0.1302.4",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1302.4.tgz",
+ "integrity": "sha512-9dS0Gvs4ER1DPSnKorJ4uk27A/rWwyvNy5CheOZu4ZTUnggGA7SFtMG7CKPD11Ae01lIMfxKfDqJYE8j2VpQaw==",
"dev": true,
"requires": {
- "@angular-devkit/core": "12.0.5",
+ "@angular-devkit/core": "13.2.4",
"rxjs": "6.6.7"
},
"dependencies": {
"@angular-devkit/core": {
- "version": "12.0.5",
- "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-12.0.5.tgz",
- "integrity": "sha512-zVSQV+8/vjUjsUKGlj8Kf5LioA6AXJTGI0yhHW9q1dFX4dPpbW63k0R1UoIB2wJ0F/AbYVgpnPGPe9BBm2fvZA==",
+ "version": "13.2.4",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-13.2.4.tgz",
+ "integrity": "sha512-hSw1JWA/6dDAF/xleQRXGtzHphfU49TMUhvAoAmsmmz3NAn03xLy1dtqdIXIf+TkFXVvZDaAB2mW8KfRV67GFg==",
"dev": true,
"requires": {
- "ajv": "8.2.0",
- "ajv-formats": "2.0.2",
+ "ajv": "8.9.0",
+ "ajv-formats": "2.1.1",
"fast-json-stable-stringify": "2.1.0",
"magic-string": "0.25.7",
"rxjs": "6.6.7",
"source-map": "0.7.3"
}
},
+ "ajv": {
+ "version": "8.9.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz",
+ "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==",
+ "dev": true,
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2",
+ "uri-js": "^4.2.2"
+ }
+ },
"source-map": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
@@ -79,14 +91,50 @@
}
},
"@angular-devkit/schematics": {
- "version": "12.1.2",
- "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-12.1.2.tgz",
- "integrity": "sha512-/UGcAJChq+g7wf46Exr5iIyuVw3j4TxTIntTpuKg/z/xf9Y+8mzJAZgGittu/yFcHAJ9aYcOHctffrfEdV7QSA==",
+ "version": "13.2.4",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-13.2.4.tgz",
+ "integrity": "sha512-VMhYa4cDu5yE31OvHncAd15Rmlchih/Sr6sxFsIwkg4xzRNIIZCtwqxVXgf0TiTN9zrvlvzK7nhPqTGNqqYb2A==",
"dev": true,
"requires": {
- "@angular-devkit/core": "12.1.2",
+ "@angular-devkit/core": "13.2.4",
+ "jsonc-parser": "3.0.0",
+ "magic-string": "0.25.7",
"ora": "5.4.1",
"rxjs": "6.6.7"
+ },
+ "dependencies": {
+ "@angular-devkit/core": {
+ "version": "13.2.4",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-13.2.4.tgz",
+ "integrity": "sha512-hSw1JWA/6dDAF/xleQRXGtzHphfU49TMUhvAoAmsmmz3NAn03xLy1dtqdIXIf+TkFXVvZDaAB2mW8KfRV67GFg==",
+ "dev": true,
+ "requires": {
+ "ajv": "8.9.0",
+ "ajv-formats": "2.1.1",
+ "fast-json-stable-stringify": "2.1.0",
+ "magic-string": "0.25.7",
+ "rxjs": "6.6.7",
+ "source-map": "0.7.3"
+ }
+ },
+ "ajv": {
+ "version": "8.9.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz",
+ "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==",
+ "dev": true,
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "source-map": {
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
+ "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
+ "dev": true
+ }
}
},
"@babel/code-frame": {
@@ -1815,6 +1863,97 @@
"rxjs": "^6.5.4",
"tslib": "^2.0.0",
"yargs": "15.4.1"
+ },
+ "dependencies": {
+ "@angular-devkit/architect": {
+ "version": "0.1200.5",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1200.5.tgz",
+ "integrity": "sha512-222VZ4OeaDK3vON8V5m+w15SRWfUs5uOb4H9ij/H9/6tyHD83uWfCDoOGg+ax4wJVdWEFJIS+Vn4ijGcZCq9WQ==",
+ "dev": true,
+ "requires": {
+ "@angular-devkit/core": "12.0.5",
+ "rxjs": "6.6.7"
+ },
+ "dependencies": {
+ "@angular-devkit/core": {
+ "version": "12.0.5",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-12.0.5.tgz",
+ "integrity": "sha512-zVSQV+8/vjUjsUKGlj8Kf5LioA6AXJTGI0yhHW9q1dFX4dPpbW63k0R1UoIB2wJ0F/AbYVgpnPGPe9BBm2fvZA==",
+ "dev": true,
+ "requires": {
+ "ajv": "8.2.0",
+ "ajv-formats": "2.0.2",
+ "fast-json-stable-stringify": "2.1.0",
+ "magic-string": "0.25.7",
+ "rxjs": "6.6.7",
+ "source-map": "0.7.3"
+ }
+ }
+ }
+ },
+ "@angular-devkit/schematics": {
+ "version": "12.2.16",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-12.2.16.tgz",
+ "integrity": "sha512-ToyZBCGilSeeLmhAxmeJ0PykmbKLoME+uK78gC64xJtNu9e3oVnmog8b8g9Ay9hTwZJ96HvNa16po11Gfbbn6A==",
+ "dev": true,
+ "requires": {
+ "@angular-devkit/core": "12.2.16",
+ "ora": "5.4.1",
+ "rxjs": "6.6.7"
+ },
+ "dependencies": {
+ "@angular-devkit/core": {
+ "version": "12.2.16",
+ "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-12.2.16.tgz",
+ "integrity": "sha512-cnVtUYSET27B5mRIBp38mpKIX0iHv/hWKiPo74WCGrNwTgwmMHngjgQ4ySn/w1W4s8LL6TDW55ZkRdwyk8TVMQ==",
+ "dev": true,
+ "requires": {
+ "ajv": "8.6.2",
+ "ajv-formats": "2.1.0",
+ "fast-json-stable-stringify": "2.1.0",
+ "magic-string": "0.25.7",
+ "rxjs": "6.6.7",
+ "source-map": "0.7.3"
+ }
+ },
+ "ajv": {
+ "version": "8.6.2",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz",
+ "integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==",
+ "dev": true,
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "ajv-formats": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.0.tgz",
+ "integrity": "sha512-USH2jBb+C/hIpwD2iRjp0pe0k+MvzG0mlSn/FIdCgQhUb9ALPRjt2KIQdfZDS9r0ZIeUAg7gOu9KL0PFqGqr5Q==",
+ "dev": true,
+ "requires": {
+ "ajv": "^8.0.0"
+ }
+ }
+ }
+ },
+ "ajv-formats": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.0.2.tgz",
+ "integrity": "sha512-Brah4Uo5/U8v76c6euTwtjVFFaVishwnJrQBYpev1JRh4vjA1F4HY3UzQez41YUCszUCXKagG8v6eVRBHV1gkw==",
+ "dev": true,
+ "requires": {
+ "ajv": "^8.0.0"
+ }
+ },
+ "source-map": {
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
+ "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
+ "dev": true
+ }
}
},
"@nrwl/tao": {
@@ -2135,9 +2274,9 @@
}
},
"debug": {
- "version": "4.3.2",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
- "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
+ "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"dev": true,
"requires": {
"ms": "2.1.2"
@@ -2642,9 +2781,9 @@
"dev": true
},
"ajv-formats": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.0.2.tgz",
- "integrity": "sha512-Brah4Uo5/U8v76c6euTwtjVFFaVishwnJrQBYpev1JRh4vjA1F4HY3UzQez41YUCszUCXKagG8v6eVRBHV1gkw==",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz",
+ "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==",
"dev": true,
"requires": {
"ajv": "^8.0.0"
@@ -9899,6 +10038,51 @@
"integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==",
"dev": true
},
+ "nx": {
+ "version": "13.8.2",
+ "resolved": "https://registry.npmjs.org/nx/-/nx-13.8.2.tgz",
+ "integrity": "sha512-raCluwNq9lK1sb71omgWfgXiQS8r+mnmXraL4p4aI7P07hEer2Oo8QI9ec4KbVc04HKkLOMkzg6YkZ94Glkc/g==",
+ "dev": true,
+ "requires": {
+ "@nrwl/cli": "13.8.2"
+ },
+ "dependencies": {
+ "@nrwl/cli": {
+ "version": "13.8.2",
+ "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-13.8.2.tgz",
+ "integrity": "sha512-wpSKo/78y1oNeBhwHIRYaqDddNhzdOmTOkYNf+J6wuaeaEMlnrJFgDrTyy14ysgPFiW0vzb5AdrDb6W2tGigYQ==",
+ "dev": true,
+ "requires": {
+ "@nrwl/tao": "13.8.2",
+ "chalk": "4.1.0",
+ "enquirer": "~2.3.6",
+ "v8-compile-cache": "2.3.0",
+ "yargs-parser": "20.0.0"
+ }
+ },
+ "@nrwl/tao": {
+ "version": "13.8.2",
+ "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-13.8.2.tgz",
+ "integrity": "sha512-68GsErwpOQDZPunJrpXDpauQo40dP66dO7uHQUu1Jf+css0uu1dfXtIR4CrAikvLJ57fZZw09l1xFrI9+OfXjA==",
+ "dev": true,
+ "requires": {
+ "chalk": "4.1.0",
+ "enquirer": "~2.3.6",
+ "fast-glob": "3.2.7",
+ "fs-extra": "^9.1.0",
+ "ignore": "^5.0.4",
+ "jsonc-parser": "3.0.0",
+ "nx": "13.8.2",
+ "rxjs": "^6.5.4",
+ "rxjs-for-await": "0.0.2",
+ "semver": "7.3.4",
+ "tmp": "~0.2.1",
+ "tslib": "^2.3.0",
+ "yargs-parser": "20.0.0"
+ }
+ }
+ }
+ },
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
diff --git a/package.json b/package.json
index c6dc4cf..be5c9cd 100644
--- a/package.json
+++ b/package.json
@@ -1,23 +1,22 @@
{
- "name": "@codebrew/nx-plugins",
- "description": "A collection of third-party Nx plugins",
+ "name": "@efacity/nx-plugins",
+ "description": "A collection of third-party Nx plugins based on https://github.com/codebrewlab/nx-plugins by Devin Kwon",
"author": {
- "name": "Devin Kwon",
- "email": "tienne89@gmail.com"
+ "name": "Ruslan Kharitonov"
},
"license": "MIT",
- "homepage": "https://github.com/codebrewlab/nx-plugins",
+ "homepage": "https://github.com/therk/nx-plugins",
"repository": {
"type": "git",
- "url": "git+https://github.com/codebrewlab/nx-plugins.git"
+ "url": "git+https://github.com/therk/nx-plugins.git"
},
"scripts": {
"nx": "nx",
"lint-stage": "lint-staged",
"commitlint": "commitlint",
"is-ci": "is-ci",
- "test": "nx test",
- "lint": "nx workspace-lint && nx lint",
+ "test": "nx test nx-aws-cdk",
+ "lint": "nx lint nx-aws-cdk",
"e2e": "nx e2e",
"format": "nx format:write",
"build:aws-cdk": "nx build nx-aws-cdk",
@@ -29,6 +28,8 @@
"tslib": "^2.0.0"
},
"devDependencies": {
+ "@angular-devkit/architect": "^0.1302.4",
+ "@angular-devkit/schematics": "^13.2.4",
"@commitlint/cli": "^13.2.1",
"@commitlint/config-conventional": "^13.2.0",
"@jscutlery/semver": "^2.10.0",
@@ -43,7 +44,7 @@
"@nrwl/workspace": "12.5.8",
"@types/jest": "26.0.8",
"@types/node": "14.14.33",
- "@typescript-eslint/eslint-plugin": "4.19.0",
+ "@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "4.19.0",
"dotenv": "8.2.0",
"eslint": "7.22.0",
@@ -52,6 +53,7 @@
"is-ci": "^3.0.0",
"jest": "27.0.3",
"lint-staged": "^11.2.3",
+ "nx": "^13.8.2",
"prettier": "^2.3.1",
"ts-jest": "27.0.3",
"ts-node": "~9.1.1",
diff --git a/packages/nx-aws-cdk/README.md b/packages/nx-aws-cdk/README.md
index 8f3990b..e1b68c1 100644
--- a/packages/nx-aws-cdk/README.md
+++ b/packages/nx-aws-cdk/README.md
@@ -1,15 +1,16 @@
[](https://github.com/RichardLitt/standard-readme)
-[](https://github.com/codebrewlab/nx-plugins/tree/master/packages/nx-aws-cdk)
+[](https://github.com/therk/nx-plugins/tree/master/packages/nx-aws-cdk)
[](https://www.typescriptlang.org/)
-[](https://www.npmjs.com/package/@codebrew/nx-aws-cdk)
-[](https://www.npmjs.com/package/@codebrew/nx-aws-cdk)
-[](https://www.npmjs.com/package/@codebrew/nx-aws-cdk)
+[](https://www.npmjs.com/package/@efacity/nx-aws-cdk)
+[](https://www.npmjs.com/package/@efacity/nx-aws-cdk)
+[](https://www.npmjs.com/package/@efacity/nx-aws-cdk)
-# @codebrew/nx-aws-cdk
+# @efacity/nx-aws-cdk
An Nx plugin for developing [aws-cdk](https://docs.aws.amazon.com/cdk/latest/guide/home.html)
+Based on !codebrew/nx-aws-cdk
## Table of Contents
@@ -25,29 +26,30 @@ An Nx plugin for developing [aws-cdk](https://docs.aws.amazon.com/cdk/latest/gui
```shell
# npm
-npm install --save-dev @codebrew/nx-aws-cdk
+npm install --save-dev @efacity/nx-aws-cdk
# yarn
-yarn add --dev @codebrew/nx-aws-cdk
+yarn add --dev @efacity/nx-aws-cdk
```
## Usage
### Generate Application
-Create Aws Cdk Application
+Create AWS CDK v2 Application
+
+More details on AWS CDK v2 can be found on https://docs.aws.amazon.com/cdk/v2/guide/home.html
```shell
-nx generate @codebrew/nx-aws-cdk:application myApp
+nx generate @efacity/nx-aws-cdk:application myApp
```
you can customize it further by passing these options:
```
-nx generate @codebrew/nx-aws-cdk:application [name] [options,...]
+nx generate @efacity/nx-aws-cdk:application [name] [options,...]
Options:
- --name
--tags Add tags to the project (used for linting)
--directory A directory where the project is placed
--skipFormat Skip formatting files
@@ -64,17 +66,17 @@ Options:
Generated applications expose several functions to the CLI that allow users to deploy, destroy and so on.
```shell
-nx deploy {Project Name}
-nx destroy {Project Name}
+nx deploy myApp
+nx destroy myApp
```
## Maintainers
-[@tienne](https://github.com/tienne)
+[@efacity](https://github.com/therk)
## Contributing
-See [the contributing file](../../contributing.md)!
+See [the contributing file](../../CONTRIBUTING.md)!
PRs accepted.
@@ -82,4 +84,4 @@ If editing the README, please conform to the [standard-readme](https://github.co
## License
-This project is MIT licensed 2021 David Kwon.
+This project is MIT licensed.
diff --git a/packages/nx-aws-cdk/migrations.json b/packages/nx-aws-cdk/migrations.json
new file mode 100644
index 0000000..ce17c60
--- /dev/null
+++ b/packages/nx-aws-cdk/migrations.json
@@ -0,0 +1,25 @@
+{
+ "schematics": {
+ "update-2.0.0": {
+ "version": "2.0.0",
+ "description": "Update libraries",
+ "factory": "./src/migrations/update-2-0-0/update-2-0-0"
+ },
+ "migrate-to-cdk-2": {
+ "version": "2.0.0",
+ "description": "Update AWS CDK to v2: rename '@aws-cdk/core' to 'aws-cdk-lib' and '@aws-cdk/assert' to 'aws-cdk'",
+ "factory": "./src/migrations/update-2-0-0/migrate-to-cdk-2"
+ }
+ },
+ "packageJsonUpdates": {
+ "2.0.0": {
+ "version": "2.0.0",
+ "packages": {
+ "eslint-plugin-cdk": {
+ "version": "^1.7.0",
+ "alwaysAddToPackageJson": false
+ }
+ }
+ }
+ }
+}
diff --git a/packages/nx-aws-cdk/package.json b/packages/nx-aws-cdk/package.json
index 22465aa..f11e95e 100644
--- a/packages/nx-aws-cdk/package.json
+++ b/packages/nx-aws-cdk/package.json
@@ -1,6 +1,6 @@
{
- "name": "@codebrew/nx-aws-cdk",
- "version": "1.0.3",
+ "name": "@efacity/nx-aws-cdk",
+ "version": "2.0.0",
"main": "src/index.js",
"generators": "./generators.json",
"executors": "./executors.json",
diff --git a/packages/nx-aws-cdk/src/generators/application/application.ts b/packages/nx-aws-cdk/src/generators/application/application.ts
index 4e8776a..9fdc9e1 100644
--- a/packages/nx-aws-cdk/src/generators/application/application.ts
+++ b/packages/nx-aws-cdk/src/generators/application/application.ts
@@ -108,11 +108,11 @@ export async function applicationGenerator(host: Tree, options: ApplicationSchem
sourceRoot: `${normalizedOptions.projectRoot}/src`,
targets: {
deploy: {
- executor: '@codebrew/nx-aws-cdk:deploy',
+ executor: '@efacity/nx-aws-cdk:deploy',
options: {},
},
destroy: {
- executor: '@codebrew/nx-aws-cdk:destroy',
+ executor: '@efacity/nx-aws-cdk:destroy',
options: {},
},
},
diff --git a/packages/nx-aws-cdk/src/generators/application/files/src/main.ts__template__ b/packages/nx-aws-cdk/src/generators/application/files/src/main.ts__template__
index 0854972..c9a1a68 100644
--- a/packages/nx-aws-cdk/src/generators/application/files/src/main.ts__template__
+++ b/packages/nx-aws-cdk/src/generators/application/files/src/main.ts__template__
@@ -1,5 +1,5 @@
-import * as cdk from '@aws-cdk/core';
+import { App } from 'aws-cdk-lib';
import { AppStack } from './stacks/app-stack';
-const app = new cdk.App();
+const app = new App();
new AppStack(app, '<%= projectName %>');
\ No newline at end of file
diff --git a/packages/nx-aws-cdk/src/generators/application/files/src/stacks/app-stack.ts__template__ b/packages/nx-aws-cdk/src/generators/application/files/src/stacks/app-stack.ts__template__
index 86c6509..2f8a983 100644
--- a/packages/nx-aws-cdk/src/generators/application/files/src/stacks/app-stack.ts__template__
+++ b/packages/nx-aws-cdk/src/generators/application/files/src/stacks/app-stack.ts__template__
@@ -1,8 +1,8 @@
-import * as cdk from '@aws-cdk/core';
+import { Stack, App, StackProps } from 'aws-cdk-lib';
-export class AppStack extends cdk.Stack {
- constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
- super(scope, id, props);
+export class AppStack extends Stack {
+ constructor(scope: App, id: string, props?: StackProps) {
+ super(scope, id, props);
// defines your stack here
}
diff --git a/packages/nx-aws-cdk/src/generators/application/jest-files/src/main.test.ts__template__ b/packages/nx-aws-cdk/src/generators/application/jest-files/src/main.test.ts__template__
index 5224eee..9e0cb53 100644
--- a/packages/nx-aws-cdk/src/generators/application/jest-files/src/main.test.ts__template__
+++ b/packages/nx-aws-cdk/src/generators/application/jest-files/src/main.test.ts__template__
@@ -1,13 +1,13 @@
-import { expect as expectCDK, matchTemplate, MatchStyle } from '@aws-cdk/assert';
-import * as cdk from '@aws-cdk/core';
+import { Stack, App } from 'aws-cdk-lib';
+import { Template } from 'aws-cdk-lib/assertions';
import { AppStack } from './stacks/app-stack';
test('Empty Stack', () => {
- const app = new cdk.App();
+ const app = new App();
// WHEN
const stack = new AppStack(app, '<%= projectName %>TestStack');
// THEN
- expectCDK(stack).to(matchTemplate({
- "Resources": {}
- }, MatchStyle.EXACT))
+ Template.fromStack(stack as Stack).templateMatches({
+ Resources: {}
+ });
});
diff --git a/packages/nx-aws-cdk/src/generators/init/init.spec.ts b/packages/nx-aws-cdk/src/generators/init/init.spec.ts
index f38f07c..41e9aea 100644
--- a/packages/nx-aws-cdk/src/generators/init/init.spec.ts
+++ b/packages/nx-aws-cdk/src/generators/init/init.spec.ts
@@ -16,7 +16,7 @@ describe('init', () => {
await initGenerator(tree, options);
const packageJson = readJson(tree, 'package.json');
- expect(packageJson.dependencies['@aws-cdk/core']).toBeDefined();
- expect(packageJson.dependencies['@aws-cdk/assert']).toBeDefined();
+ expect(packageJson.dependencies['aws-cdk-lib']).toBeDefined();
+ expect(packageJson.dependencies['aws-cdk']).toBeDefined();
});
});
diff --git a/packages/nx-aws-cdk/src/generators/init/init.ts b/packages/nx-aws-cdk/src/generators/init/init.ts
index 01a86c0..fb189d3 100644
--- a/packages/nx-aws-cdk/src/generators/init/init.ts
+++ b/packages/nx-aws-cdk/src/generators/init/init.ts
@@ -22,8 +22,8 @@ export async function initGenerator(host: Tree, options: InitGeneratorSchema) {
const installTask = addDependenciesToPackageJson(
host,
{
- '@aws-cdk/core': CDK_VERSION,
- '@aws-cdk/assert': CDK_VERSION,
+ 'aws-cdk': CDK_VERSION,
+ 'aws-cdk-lib': CDK_VERSION,
},
{
'eslint-plugin-cdk': CDK_ESLINT_VERSION,
diff --git a/packages/nx-aws-cdk/src/migrations/update-2-0-0/migrate-to-cdk-2.spec.ts b/packages/nx-aws-cdk/src/migrations/update-2-0-0/migrate-to-cdk-2.spec.ts
new file mode 100644
index 0000000..d2e04cf
--- /dev/null
+++ b/packages/nx-aws-cdk/src/migrations/update-2-0-0/migrate-to-cdk-2.spec.ts
@@ -0,0 +1,67 @@
+import { Tree } from '@angular-devkit/schematics';
+import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
+import { readJsonInTree } from '@nrwl/workspace';
+import * as path from 'path';
+import { createEmptyWorkspace, runSchematic } from '@nrwl/workspace/testing';
+import { CDK_VERSION } from '../../utils/cdk-shared';
+
+describe('Update AWS CDK dependencies to v2', () => {
+ let tree: Tree;
+ let schematicRunner: SchematicTestRunner;
+
+ beforeEach(async () => {
+ tree = Tree.empty();
+ tree = createEmptyWorkspace(tree);
+ schematicRunner = new SchematicTestRunner('@nrwl/next', path.join(__dirname, '../../../migrations.json'));
+ tree.overwrite(
+ 'package.json',
+ JSON.stringify({
+ devDependencies: {
+ '@aws-cdk/core': '^1.127.0',
+ },
+ })
+ );
+ });
+
+ it(`should update '@aws-cdk/core', if used, to the new package names`, async () => {
+ tree = await schematicRunner.runSchematicAsync('migrate-to-cdk-2', {}, tree).toPromise();
+
+ const packageJson = readJsonInTree(tree, '/package.json');
+ expect(packageJson).toMatchObject({
+ devDependencies: {
+ 'aws-cdk-lib': CDK_VERSION,
+ },
+ });
+ });
+
+ it(`should update '@aws-cdk/core' to the 'aws-sdk-lib' where imported`, async () => {
+ tree = await runSchematic('lib', { name: 'library-1' }, tree);
+
+ const moduleThatImports = 'libs/library-1/src/importer.ts';
+ tree.create(
+ moduleThatImports,
+ `import * as cdk from '@aws-cdk/core';
+ const app = new cdk.App();
+ `
+ );
+
+ tree = await schematicRunner.runSchematicAsync('migrate-to-cdk-2', {}, tree).toPromise();
+
+ expect(tree.read(moduleThatImports).toString()).toContain(`import * as cdk from 'aws-cdk-lib';`);
+ });
+ it(`should update '@aws-cdk/assert', if used, to 'aws-cdk-lib/assertions' where imported`, async () => {
+ tree = await runSchematic('lib', { name: 'library-1' }, tree);
+
+ const moduleThatImports = 'libs/library-1/src/importer.ts';
+ tree.create(
+ moduleThatImports,
+ `import * as cdk from '@aws-cdk/core';
+ const app = new cdk.App();
+ `
+ );
+
+ tree = await schematicRunner.runSchematicAsync('migrate-to-cdk-2', {}, tree).toPromise();
+
+ expect(tree.read(moduleThatImports).toString()).toContain(`import * as cdk from 'aws-cdk-lib';`);
+ });
+});
diff --git a/packages/nx-aws-cdk/src/migrations/update-2-0-0/migrate-to-cdk-2.ts b/packages/nx-aws-cdk/src/migrations/update-2-0-0/migrate-to-cdk-2.ts
new file mode 100644
index 0000000..06d6db1
--- /dev/null
+++ b/packages/nx-aws-cdk/src/migrations/update-2-0-0/migrate-to-cdk-2.ts
@@ -0,0 +1,16 @@
+import { chain } from '@angular-devkit/schematics';
+import { formatFiles, renameNpmPackages } from '@nrwl/workspace';
+import { CDK_VERSION } from '../../utils/cdk-shared';
+import { renamePackageImports } from '@nrwl/workspace/src/utils/rules/rename-package-imports';
+
+export default function update() {
+ return chain([
+ renameNpmPackages({
+ '@aws-cdk/core': ['aws-cdk-lib', CDK_VERSION],
+ }),
+ renamePackageImports({
+ '@aws-cdk/assert': 'aws-cdk-lib/assertions',
+ }),
+ formatFiles(),
+ ]);
+}
diff --git a/packages/nx-aws-cdk/src/migrations/update-2-0-0/update-2-0-0.spec.ts b/packages/nx-aws-cdk/src/migrations/update-2-0-0/update-2-0-0.spec.ts
new file mode 100644
index 0000000..0d2e635
--- /dev/null
+++ b/packages/nx-aws-cdk/src/migrations/update-2-0-0/update-2-0-0.spec.ts
@@ -0,0 +1,38 @@
+import { Tree } from '@angular-devkit/schematics';
+import { SchematicTestRunner } from '@angular-devkit/schematics/testing';
+import { readJsonInTree } from '@nrwl/workspace';
+import * as path from 'path';
+import { createEmptyWorkspace } from '@nrwl/workspace/testing';
+
+describe('Update 2.0.0', () => {
+ let tree: Tree;
+ let schematicRunner: SchematicTestRunner;
+
+ beforeEach(async () => {
+ tree = Tree.empty();
+ tree = createEmptyWorkspace(tree);
+ schematicRunner = new SchematicTestRunner('@nrwl/react', path.join(__dirname, '../../../migrations.json'));
+ });
+
+ it(`should update libs`, async () => {
+ tree.overwrite(
+ 'package.json',
+ JSON.stringify({
+ dependencies: {},
+ devDependencies: {
+ 'eslint-plugin-cdk': '^1.3.0',
+ },
+ })
+ );
+
+ tree = await schematicRunner.runSchematicAsync('update-2.0.0', {}, tree).toPromise();
+
+ const packageJson = readJsonInTree(tree, '/package.json');
+ expect(packageJson).toMatchObject({
+ dependencies: {},
+ devDependencies: {
+ 'eslint-plugin-cdk': '^1.7.0',
+ },
+ });
+ });
+});
diff --git a/packages/nx-aws-cdk/src/migrations/update-2-0-0/update-2-0-0.ts b/packages/nx-aws-cdk/src/migrations/update-2-0-0/update-2-0-0.ts
new file mode 100644
index 0000000..ed0c172
--- /dev/null
+++ b/packages/nx-aws-cdk/src/migrations/update-2-0-0/update-2-0-0.ts
@@ -0,0 +1,10 @@
+import { chain, Rule } from '@angular-devkit/schematics';
+import { formatFiles, updatePackagesInPackageJson } from '@nrwl/workspace';
+import * as path from 'path';
+
+export default function update(): Rule {
+ return chain([
+ updatePackagesInPackageJson(path.join(__dirname, '../../../', 'migrations.json'), '2.0.0'),
+ formatFiles(),
+ ]);
+}
diff --git a/packages/nx-aws-cdk/src/utils/cdk-shared.ts b/packages/nx-aws-cdk/src/utils/cdk-shared.ts
index 12efff8..424a76b 100644
--- a/packages/nx-aws-cdk/src/utils/cdk-shared.ts
+++ b/packages/nx-aws-cdk/src/utils/cdk-shared.ts
@@ -1,2 +1,2 @@
-export const CDK_VERSION = '^1.127.0';
-export const CDK_ESLINT_VERSION = '^1.3.0';
+export const CDK_VERSION = '^2.12.0';
+export const CDK_ESLINT_VERSION = '^1.7.0';
diff --git a/packages/nx-aws-cdk/src/utils/testing.ts b/packages/nx-aws-cdk/src/utils/testing.ts
index a35b636..c78c365 100644
--- a/packages/nx-aws-cdk/src/utils/testing.ts
+++ b/packages/nx-aws-cdk/src/utils/testing.ts
@@ -12,14 +12,14 @@ export function mockExecutorContext(executorName: string, workspaceVersion = 2):
root: 'apps/proj',
targets: {
test: {
- executor: `@codebrew/nx-aws-cdk:${executorName}`,
+ executor: `@efacity/nx-aws-cdk:${executorName}`,
},
},
},
},
},
target: {
- executor: `@codebrew/nx-aws-cdk:${executorName}`,
+ executor: `@efacity/nx-aws-cdk:${executorName}`,
},
isVerbose: true,
};
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 795db44..83ea2cb 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -15,7 +15,7 @@
"skipDefaultLibCheck": true,
"baseUrl": ".",
"paths": {
- "@codebrew/nx-aws-cdk": ["packages/nx-aws-cdk/src/index.ts"]
+ "@efacity/nx-aws-cdk": ["packages/nx-aws-cdk/src/index.ts"]
}
},
"exclude": ["node_modules", "tmp"]
diff --git a/workspace.json b/workspace.json
index de627d8..0ff0571 100644
--- a/workspace.json
+++ b/workspace.json
@@ -78,7 +78,7 @@
"executor": "@nrwl/nx-plugin:e2e",
"options": {
"target": "nx-aws-cdk:build",
- "npmPackageName": "@codebrew/nx-aws-cdk",
+ "npmPackageName": "@efacity/nx-aws-cdk",
"pluginOutputPath": "dist/packages/nx-aws-cdk",
"jestConfig": "e2e/nx-aws-cdk-e2e/jest.config.js"
}