@wolsok/nx-aws-cdk-v2 3.0.8 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +1 -1
- package/src/executors/bootstrap/bootstrap.js +1 -3
- package/src/executors/bootstrap/bootstrap.js.map +1 -1
- package/src/executors/deploy/deploy.d.ts +1 -1
- package/src/executors/deploy/deploy.js +1 -1
- package/src/executors/deploy/deploy.js.map +1 -1
- package/src/executors/destroy/destroy.d.ts +1 -1
- package/src/executors/destroy/destroy.js +1 -3
- package/src/executors/destroy/destroy.js.map +1 -1
- package/src/executors/synth/synth.d.ts +1 -1
- package/src/executors/synth/synth.js +1 -1
- package/src/executors/synth/synth.js.map +1 -1
- package/src/generators/application/files/cdk.json__template__ +1 -1
- package/src/generators/init/init.js +1 -3
- package/src/generators/init/init.js.map +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -3
- package/src/index.js.map +1 -1
- package/src/interfaces/parsed-executor.interface.d.ts +1 -1
- package/src/utils/cdk-shared.d.ts +3 -5
- package/src/utils/cdk-shared.js +4 -6
- package/src/utils/cdk-shared.js.map +1 -1
- package/src/utils/executor.util.d.ts +10 -0
- package/src/utils/executor.util.js +29 -28
- package/src/utils/executor.util.js.map +1 -1
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ otherwise the workspace root. The Nx project name is the path below `<appsDir>`
|
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
The generator also adds `aws-cdk-lib` and `constructs` to `dependencies`, and the `aws-cdk` CLI plus
|
|
115
|
-
the TypeScript
|
|
115
|
+
the TypeScript loader `tsx` to `devDependencies` of your workspace.
|
|
116
116
|
|
|
117
117
|
> The CDK Toolkit CLI (`aws-cdk`) and the construct library (`aws-cdk-lib`) are released on separate
|
|
118
118
|
> version lines — `2.1xxx.x` for the CLI, `2.x` for the library. They are pinned independently.
|
|
@@ -215,10 +215,10 @@ All four executors build the same shape of command and run it **from the workspa
|
|
|
215
215
|
<pm-exec> cdk -a "<pm-exec> <loader> <workspace-root>/<project-root>/src/main.ts" <command> [stacks] [--flags]
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
-
- `<pm-exec>` is `
|
|
219
|
-
|
|
220
|
-
- `<loader>` is `tsx
|
|
221
|
-
|
|
218
|
+
- `<pm-exec>` is the `exec` form Nx reports for your package manager: `npx` for npm, `pnpm exec`
|
|
219
|
+
for pnpm (`pnpx` on older versions), `yarn` for yarn, `bun` for bun.
|
|
220
|
+
- `<loader>` is always `tsx --tsconfig <project-root>/tsconfig.app.json`. It handles CommonJS and ESM
|
|
221
|
+
alike and resolves the project's tsconfig `paths` itself.
|
|
222
222
|
- Because `cdk` runs with the workspace root as its working directory, `cdk.out` is written to the
|
|
223
223
|
**workspace root**, and the generated `cdk.json` is _not_ read. That file exists for the times you
|
|
224
224
|
invoke `cdk` yourself from the project directory.
|
package/package.json
CHANGED
|
@@ -19,9 +19,7 @@ function normalizeOptions(options, context) {
|
|
|
19
19
|
if (Object.prototype.hasOwnProperty.call(options, 'profile')) {
|
|
20
20
|
profile = `--profile ${options.profile}`;
|
|
21
21
|
}
|
|
22
|
-
const { sourceRoot, root } =
|
|
23
|
-
// eslint-disable-next-line no-unsafe-optional-chaining
|
|
24
|
-
context?.projectsConfigurations?.projects[context.projectName];
|
|
22
|
+
const { sourceRoot, root } = (0, executor_util_1.resolveProjectPaths)(context);
|
|
25
23
|
return {
|
|
26
24
|
...options,
|
|
27
25
|
parseArgs: parsedArgs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/executors/bootstrap/bootstrap.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/executors/bootstrap/bootstrap.ts"],"names":[],"mappings":";;AAiBA,8BAUC;AA1BD,6DAKmC;AAWpB,KAAK,UAAU,WAAW,CACvC,OAAgC,EAChC,OAAwB;IAExB,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAE9D,OAAO;QACL,OAAO,EAAE,MAAM;KAChB,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CACnB,OAAsC,EACtC,OAAwB;IAExB,MAAM,OAAO,GAAG,IAAA,6BAAa,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACpD,OAAO,IAAA,iCAAiB,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,gBAAgB,CACvB,OAAgC,EAChC,OAAwB;IAExB,MAAM,UAAU,GAAG,IAAA,yBAAS,EAAC,OAAO,CAAC,CAAC;IACtC,IAAI,OAAO,CAAC;IAEZ,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;QAC7D,OAAO,GAAG,aAAa,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3C,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAA,mCAAmB,EAAC,OAAO,CAAC,CAAC;IAE1D,OAAO;QACL,GAAG,OAAO;QACV,SAAS,EAAE,UAAU;QACrB,OAAO;QACP,UAAU;QACV,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { DeployExecutorSchema } from './schema';
|
|
|
2
2
|
import { ParsedExecutorInterface } from '../../interfaces/parsed-executor.interface';
|
|
3
3
|
import { ExecutorContext } from '@nx/devkit';
|
|
4
4
|
export interface ParsedDeployExecutorOption extends ParsedExecutorInterface {
|
|
5
|
-
stacks?: string
|
|
5
|
+
stacks?: string;
|
|
6
6
|
sourceRoot: string;
|
|
7
7
|
root: string;
|
|
8
8
|
}
|
|
@@ -19,7 +19,7 @@ function normalizeOptions(options, context) {
|
|
|
19
19
|
if (Object.prototype.hasOwnProperty.call(options, 'stacks')) {
|
|
20
20
|
stacks = options.stacks;
|
|
21
21
|
}
|
|
22
|
-
const { sourceRoot, root } = context
|
|
22
|
+
const { sourceRoot, root } = (0, executor_util_1.resolveProjectPaths)(context);
|
|
23
23
|
return {
|
|
24
24
|
...options,
|
|
25
25
|
parseArgs: parsedArgs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/executors/deploy/deploy.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/executors/deploy/deploy.ts"],"names":[],"mappings":";;AAgBA,8BAUC;AAzBD,6DAKmC;AAUpB,KAAK,UAAU,WAAW,CACvC,OAA6B,EAC7B,OAAwB;IAExB,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAE3D,OAAO;QACL,OAAO,EAAE,MAAM;KAChB,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,SAAS,CACtB,OAAmC,EACnC,OAAwB;IAExB,MAAM,OAAO,GAAG,IAAA,6BAAa,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACjD,OAAO,IAAA,iCAAiB,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,gBAAgB,CACvB,OAA6B,EAC7B,OAAwB;IAExB,MAAM,UAAU,GAAG,IAAA,yBAAS,EAAC,OAAO,CAAC,CAAC;IACtC,IAAI,MAAM,CAAC;IAEX,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC5D,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAA,mCAAmB,EAAC,OAAO,CAAC,CAAC;IAE1D,OAAO;QACL,GAAG,OAAO;QACV,SAAS,EAAE,UAAU;QACrB,MAAM;QACN,UAAU;QACV,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { DestroyExecutorSchema } from './schema';
|
|
|
2
2
|
import { ParsedExecutorInterface } from '../../interfaces/parsed-executor.interface';
|
|
3
3
|
import { ExecutorContext } from '@nx/devkit';
|
|
4
4
|
export interface ParsedDestroyExecutorOption extends ParsedExecutorInterface {
|
|
5
|
-
stacks?: string
|
|
5
|
+
stacks?: string;
|
|
6
6
|
app?: string;
|
|
7
7
|
sourceRoot: string;
|
|
8
8
|
root: string;
|
|
@@ -19,9 +19,7 @@ function normalizeOptions(options, context) {
|
|
|
19
19
|
if (Object.prototype.hasOwnProperty.call(options, 'stacks')) {
|
|
20
20
|
stacks = options.stacks;
|
|
21
21
|
}
|
|
22
|
-
const { sourceRoot, root } =
|
|
23
|
-
// eslint-disable-next-line no-unsafe-optional-chaining
|
|
24
|
-
context?.projectsConfigurations?.projects[context.projectName];
|
|
22
|
+
const { sourceRoot, root } = (0, executor_util_1.resolveProjectPaths)(context);
|
|
25
23
|
return {
|
|
26
24
|
...options,
|
|
27
25
|
parseArgs: parsedArgs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destroy.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/executors/destroy/destroy.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"destroy.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/executors/destroy/destroy.ts"],"names":[],"mappings":";;AAiBA,8BAUC;AA1BD,6DAKmC;AAWpB,KAAK,UAAU,WAAW,CACvC,OAA8B,EAC9B,OAAwB;IAExB,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAE5D,OAAO;QACL,OAAO,EAAE,MAAM;KAChB,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CACjB,OAAoC,EACpC,OAAwB;IAExB,MAAM,OAAO,GAAG,IAAA,6BAAa,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClD,OAAO,IAAA,iCAAiB,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,gBAAgB,CACvB,OAA8B,EAC9B,OAAwB;IAExB,MAAM,UAAU,GAAG,IAAA,yBAAS,EAAC,OAAO,CAAC,CAAC;IACtC,IAAI,MAAM,CAAC;IAEX,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC5D,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAA,mCAAmB,EAAC,OAAO,CAAC,CAAC;IAE1D,OAAO;QACL,GAAG,OAAO;QACV,SAAS,EAAE,UAAU;QACrB,MAAM;QACN,UAAU;QACV,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { ExecutorContext } from '@nx/devkit';
|
|
|
2
2
|
import { ParsedExecutorInterface } from '../../interfaces/parsed-executor.interface';
|
|
3
3
|
import { SynthExecutorSchema } from './schema';
|
|
4
4
|
export interface ParsedSynthExecutorOption extends ParsedExecutorInterface {
|
|
5
|
-
stacks?: string
|
|
5
|
+
stacks?: string;
|
|
6
6
|
sourceRoot: string;
|
|
7
7
|
root: string;
|
|
8
8
|
}
|
|
@@ -19,7 +19,7 @@ function normalizeOptions(options, context) {
|
|
|
19
19
|
if (Object.prototype.hasOwnProperty.call(options, 'stacks')) {
|
|
20
20
|
stacks = options.stacks;
|
|
21
21
|
}
|
|
22
|
-
const { sourceRoot, root } = context
|
|
22
|
+
const { sourceRoot, root } = (0, executor_util_1.resolveProjectPaths)(context);
|
|
23
23
|
return {
|
|
24
24
|
...options,
|
|
25
25
|
parseArgs: parsedArgs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synth.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/executors/synth/synth.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"synth.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/executors/synth/synth.ts"],"names":[],"mappings":";;AAiBA,8BAUC;AAxBD,6DAKmC;AASpB,KAAK,UAAU,WAAW,CACvC,OAA4B,EAC5B,OAAwB;IAExB,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAE1D,OAAO;QACL,OAAO,EAAE,MAAM;KAChB,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CACf,OAAkC,EAClC,OAAwB;IAExB,MAAM,OAAO,GAAG,IAAA,6BAAa,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,OAAO,IAAA,iCAAiB,EAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,gBAAgB,CACvB,OAA4B,EAC5B,OAAwB;IAExB,MAAM,UAAU,GAAG,IAAA,yBAAS,EAAC,OAAO,CAAC,CAAC;IACtC,IAAI,MAAM,CAAC;IAEX,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC5D,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,IAAA,mCAAmB,EAAC,OAAO,CAAC,CAAC;IAE1D,OAAO;QACL,GAAG,OAAO;QACV,SAAS,EAAE,UAAU;QACrB,MAAM;QACN,UAAU;QACV,IAAI;KACL,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"app": "npx
|
|
2
|
+
"app": "npx tsx --tsconfig tsconfig.app.json src/main.ts",
|
|
3
3
|
"output": "<%= offsetFromRoot %>dist/cdk.out/<%= projectName %>",
|
|
4
4
|
"requireApproval": "never",
|
|
5
5
|
"watch": {
|
|
@@ -21,12 +21,10 @@ async function initGenerator(host, options) {
|
|
|
21
21
|
'aws-cdk-lib': cdk_shared_1.CDK_LIB_VERSION,
|
|
22
22
|
constructs: cdk_shared_1.CDK_CONSTRUCTS_VERSION,
|
|
23
23
|
}, {
|
|
24
|
-
// The CDK Toolkit and the TypeScript
|
|
24
|
+
// The CDK Toolkit and the TypeScript loader are only ever invoked by the
|
|
25
25
|
// executors, so they belong in devDependencies rather than shipping with
|
|
26
26
|
// whatever the workspace publishes.
|
|
27
27
|
'aws-cdk': cdk_shared_1.CDK_CLI_VERSION,
|
|
28
|
-
'ts-node': cdk_shared_1.TS_NODE_VERSION,
|
|
29
|
-
'tsconfig-paths': cdk_shared_1.TSCONFIG_PATHS_VERSION,
|
|
30
28
|
tsx: cdk_shared_1.TSX_VERSION,
|
|
31
29
|
});
|
|
32
30
|
if (!schema.skipFormat) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/generators/init/init.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../../libs/public/nx-aws-cdk-v2/src/generators/init/init.ts"],"names":[],"mappings":";;;AAwBA,sCAiCC;AAzDD,uCAMoB;AACpB,mCAA6C;AAG7C,uDAKgC;AAEhC,SAAS,gBAAgB,CAAC,MAA2B;IACnD,OAAO;QACL,GAAG,MAAM;QACT,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,MAAM;KAChD,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,aAAa,CAAC,IAAU,EAAE,OAA4B;IAC1E,IAAI,WAA8B,CAAC;IACnC,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEzC,IAAI,MAAM,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;QACrC,WAAW,GAAG,MAAM,IAAA,wBAAiB,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,qCAA4B,EAC9C,IAAI,EACJ;QACE,aAAa,EAAE,4BAAe;QAC9B,UAAU,EAAE,mCAAsB;KACnC,EACD;QACE,yEAAyE;QACzE,yEAAyE;QACzE,oCAAoC;QACpC,SAAS,EAAE,4BAAe;QAC1B,GAAG,EAAE,wBAAW;KACjB,CACF,CAAC;IAEF,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,KAAK,IAAI,EAAE;QAChB,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,WAAW,EAAE,CAAC;QACtB,CAAC;QACD,MAAM,WAAW,EAAE,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AAED,kBAAe,aAAa,CAAC;AAChB,QAAA,aAAa,GAAG,IAAA,2BAAkB,EAAC,aAAa,CAAC,CAAC"}
|
package/src/index.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export type { BootstrapExecutorSchema } from './executors/bootstrap/schema';
|
|
|
17
17
|
export type { DeployExecutorSchema } from './executors/deploy/schema';
|
|
18
18
|
export type { DestroyExecutorSchema } from './executors/destroy/schema';
|
|
19
19
|
export type { SynthExecutorSchema } from './executors/synth/schema';
|
|
20
|
-
export { CDK_CLI_VERSION, CDK_CONSTRUCTS_VERSION, CDK_LIB_VERSION,
|
|
20
|
+
export { CDK_CLI_VERSION, CDK_CONSTRUCTS_VERSION, CDK_LIB_VERSION, TSX_VERSION, } from './utils/cdk-shared';
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TSX_VERSION = exports.
|
|
3
|
+
exports.TSX_VERSION = exports.CDK_LIB_VERSION = exports.CDK_CONSTRUCTS_VERSION = exports.CDK_CLI_VERSION = exports.synthExecutor = exports.destroyExecutor = exports.deployExecutor = exports.bootstrapExecutor = exports.initSchematic = exports.initGenerator = exports.applicationSchematic = exports.applicationGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
/**
|
|
6
6
|
* Public entry point of `@wolsok/nx-aws-cdk-v2`.
|
|
@@ -27,7 +27,5 @@ var cdk_shared_1 = require("./utils/cdk-shared");
|
|
|
27
27
|
Object.defineProperty(exports, "CDK_CLI_VERSION", { enumerable: true, get: function () { return cdk_shared_1.CDK_CLI_VERSION; } });
|
|
28
28
|
Object.defineProperty(exports, "CDK_CONSTRUCTS_VERSION", { enumerable: true, get: function () { return cdk_shared_1.CDK_CONSTRUCTS_VERSION; } });
|
|
29
29
|
Object.defineProperty(exports, "CDK_LIB_VERSION", { enumerable: true, get: function () { return cdk_shared_1.CDK_LIB_VERSION; } });
|
|
30
|
-
Object.defineProperty(exports, "TS_NODE_VERSION", { enumerable: true, get: function () { return cdk_shared_1.TS_NODE_VERSION; } });
|
|
31
|
-
Object.defineProperty(exports, "TSCONFIG_PATHS_VERSION", { enumerable: true, get: function () { return cdk_shared_1.TSCONFIG_PATHS_VERSION; } });
|
|
32
30
|
Object.defineProperty(exports, "TSX_VERSION", { enumerable: true, get: function () { return cdk_shared_1.TSX_VERSION; } });
|
|
33
31
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/public/nx-aws-cdk-v2/src/index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AACH,oEAG8C;AAF5C,mHAAA,oBAAoB,OAAA;AACpB,mHAAA,oBAAoB,OAAA;AAEtB,+CAAsE;AAA7D,qGAAA,aAAa,OAAA;AAAE,qGAAA,aAAa,OAAA;AAKrC,6DAA+E;AAAtE,uIAAA,OAAO,OAAqB;AACrC,oDAAsE;AAA7D,iIAAA,OAAO,OAAkB;AAClC,uDAAyE;AAAhE,mIAAA,OAAO,OAAmB;AACnC,iDAAmE;AAA1D,+HAAA,OAAO,OAAiB;AAOjC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/public/nx-aws-cdk-v2/src/index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AACH,oEAG8C;AAF5C,mHAAA,oBAAoB,OAAA;AACpB,mHAAA,oBAAoB,OAAA;AAEtB,+CAAsE;AAA7D,qGAAA,aAAa,OAAA;AAAE,qGAAA,aAAa,OAAA;AAKrC,6DAA+E;AAAtE,uIAAA,OAAO,OAAqB;AACrC,oDAAsE;AAA7D,iIAAA,OAAO,OAAkB;AAClC,uDAAyE;AAAhE,mIAAA,OAAO,OAAmB;AACnC,iDAAmE;AAA1D,+HAAA,OAAO,OAAiB;AAOjC,iDAK4B;AAJ1B,6GAAA,eAAe,OAAA;AACf,oHAAA,sBAAsB,OAAA;AACtB,6GAAA,eAAe,OAAA;AACf,yGAAA,WAAW,OAAA"}
|
|
@@ -11,13 +11,11 @@ export declare const CDK_CLI_VERSION = "^2.1137.0";
|
|
|
11
11
|
export declare const CDK_LIB_VERSION = "^2.265.0";
|
|
12
12
|
export declare const CDK_CONSTRUCTS_VERSION = "^10.8.1";
|
|
13
13
|
/**
|
|
14
|
-
* TypeScript
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
14
|
+
* TypeScript loader used to run a CDK app's `main.ts` without a build step —
|
|
15
|
+
* see `generateCommandString`. It handles both CommonJS and ESM workspaces and
|
|
16
|
+
* resolves the app's tsconfig `paths` itself.
|
|
17
17
|
*/
|
|
18
18
|
export declare const TSX_VERSION = "^4.20.0";
|
|
19
|
-
export declare const TS_NODE_VERSION = "^10.9.2";
|
|
20
|
-
export declare const TSCONFIG_PATHS_VERSION = "^4.2.0";
|
|
21
19
|
/**
|
|
22
20
|
* @deprecated Use {@link CDK_LIB_VERSION} for `aws-cdk-lib` and
|
|
23
21
|
* {@link CDK_CLI_VERSION} for the `aws-cdk` CLI instead.
|
package/src/utils/cdk-shared.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CDK_VERSION = exports.
|
|
3
|
+
exports.CDK_VERSION = exports.TSX_VERSION = exports.CDK_CONSTRUCTS_VERSION = exports.CDK_LIB_VERSION = exports.CDK_CLI_VERSION = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Dependency versions the `init` generator adds to a consumer workspace.
|
|
6
6
|
*
|
|
@@ -14,13 +14,11 @@ exports.CDK_CLI_VERSION = '^2.1137.0';
|
|
|
14
14
|
exports.CDK_LIB_VERSION = '^2.265.0';
|
|
15
15
|
exports.CDK_CONSTRUCTS_VERSION = '^10.8.1';
|
|
16
16
|
/**
|
|
17
|
-
* TypeScript
|
|
18
|
-
* `
|
|
19
|
-
*
|
|
17
|
+
* TypeScript loader used to run a CDK app's `main.ts` without a build step —
|
|
18
|
+
* see `generateCommandString`. It handles both CommonJS and ESM workspaces and
|
|
19
|
+
* resolves the app's tsconfig `paths` itself.
|
|
20
20
|
*/
|
|
21
21
|
exports.TSX_VERSION = '^4.20.0';
|
|
22
|
-
exports.TS_NODE_VERSION = '^10.9.2';
|
|
23
|
-
exports.TSCONFIG_PATHS_VERSION = '^4.2.0';
|
|
24
22
|
/**
|
|
25
23
|
* @deprecated Use {@link CDK_LIB_VERSION} for `aws-cdk-lib` and
|
|
26
24
|
* {@link CDK_CLI_VERSION} for the `aws-cdk` CLI instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-shared.js","sourceRoot":"","sources":["../../../../../../libs/public/nx-aws-cdk-v2/src/utils/cdk-shared.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACU,QAAA,eAAe,GAAG,WAAW,CAAC;AAC9B,QAAA,eAAe,GAAG,UAAU,CAAC;AAC7B,QAAA,sBAAsB,GAAG,SAAS,CAAC;AAEhD;;;;GAIG;AACU,QAAA,WAAW,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cdk-shared.js","sourceRoot":"","sources":["../../../../../../libs/public/nx-aws-cdk-v2/src/utils/cdk-shared.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACU,QAAA,eAAe,GAAG,WAAW,CAAC;AAC9B,QAAA,eAAe,GAAG,UAAU,CAAC;AAC7B,QAAA,sBAAsB,GAAG,SAAS,CAAC;AAEhD;;;;GAIG;AACU,QAAA,WAAW,GAAG,SAAS,CAAC;AAErC;;;GAGG;AACU,QAAA,WAAW,GAAG,uBAAe,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { DeployExecutorSchema } from '../executors/deploy/schema';
|
|
2
2
|
import { ParsedExecutorInterface } from '../interfaces/parsed-executor.interface';
|
|
3
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
3
4
|
import { BootstrapExecutorSchema } from '../executors/bootstrap/schema';
|
|
4
5
|
import { SynthExecutorSchema } from '../executors/synth/schema';
|
|
6
|
+
/**
|
|
7
|
+
* Project paths the CDK command is built from. Every executor needs both, so a
|
|
8
|
+
* context without a resolvable project configuration is a hard error rather
|
|
9
|
+
* than an `undefined` that only surfaces later in a malformed command.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveProjectPaths(context: ExecutorContext): {
|
|
12
|
+
sourceRoot: string;
|
|
13
|
+
root: string;
|
|
14
|
+
};
|
|
5
15
|
export declare const executorPropKeys: string[];
|
|
6
16
|
export declare const LARGE_BUFFER: number;
|
|
7
17
|
export declare function generateCommandString(command: string, appPath: string): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LARGE_BUFFER = exports.executorPropKeys = void 0;
|
|
4
|
+
exports.resolveProjectPaths = resolveProjectPaths;
|
|
4
5
|
exports.generateCommandString = generateCommandString;
|
|
5
6
|
exports.parseArgs = parseArgs;
|
|
6
7
|
exports.createCommand = createCommand;
|
|
@@ -8,10 +9,20 @@ exports.runCommandProcess = runCommandProcess;
|
|
|
8
9
|
const tslib_1 = require("tslib");
|
|
9
10
|
const child_process_1 = require("child_process");
|
|
10
11
|
const devkit_1 = require("@nx/devkit");
|
|
11
|
-
const node_fs_1 = require("node:fs");
|
|
12
12
|
const path = tslib_1.__importStar(require("node:path"));
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Project paths the CDK command is built from. Every executor needs both, so a
|
|
15
|
+
* context without a resolvable project configuration is a hard error rather
|
|
16
|
+
* than an `undefined` that only surfaces later in a malformed command.
|
|
17
|
+
*/
|
|
18
|
+
function resolveProjectPaths(context) {
|
|
19
|
+
const project = context.projectName
|
|
20
|
+
? context.projectsConfigurations?.projects[context.projectName]
|
|
21
|
+
: undefined;
|
|
22
|
+
if (!project) {
|
|
23
|
+
throw new Error(`Cannot resolve the project configuration for "${context.projectName ?? '<unknown project>'}".`);
|
|
24
|
+
}
|
|
25
|
+
return { sourceRoot: project.sourceRoot ?? project.root, root: project.root };
|
|
15
26
|
}
|
|
16
27
|
exports.executorPropKeys = ['stacks'];
|
|
17
28
|
exports.LARGE_BUFFER = 1024 * 1000000;
|
|
@@ -25,16 +36,19 @@ function getWorkspaceRoot() {
|
|
|
25
36
|
return process.env.NX_WORKSPACE_ROOT || devkit_1.workspaceRoot;
|
|
26
37
|
}
|
|
27
38
|
function generateCommandString(command, appPath) {
|
|
28
|
-
|
|
29
|
-
|
|
39
|
+
// `exec` is the package manager's "run a binary from node_modules" form:
|
|
40
|
+
// npx, `pnpm exec` (or pnpx on older pnpm), yarn, bun. Deriving it by hand
|
|
41
|
+
// produced `pnpm tsx`, which pnpm reads as a script name, not a binary.
|
|
42
|
+
const { exec: packageManagerExecutor } = (0, devkit_1.getPackageManagerCommand)();
|
|
30
43
|
const projectPath = path.join(getWorkspaceRoot(), appPath);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
//
|
|
44
|
+
// tsx resolves the tsconfig `paths` of the app on its own, so the CDK entry
|
|
45
|
+
// can import workspace aliases. ts-node needed tsconfig-paths for that, and
|
|
46
|
+
// tsconfig-paths silently resolves nothing once `baseUrl` is gone — which
|
|
47
|
+
// TypeScript 6 deprecates. `--tsconfig` is required: without it tsx reads
|
|
48
|
+
// whatever tsconfig sits next to the current working directory.
|
|
49
|
+
const tsConfigPath = path.join(projectPath, 'tsconfig.app.json');
|
|
36
50
|
const mainTsPath = path.join(projectPath, 'src', 'main.ts');
|
|
37
|
-
const generatePath = `${packageManagerExecutor} ${
|
|
51
|
+
const generatePath = `${packageManagerExecutor} tsx --tsconfig ${tsConfigPath} ${mainTsPath}`;
|
|
38
52
|
return `${packageManagerExecutor} cdk -a "${generatePath}" ${command}`;
|
|
39
53
|
}
|
|
40
54
|
function parseArgs(options) {
|
|
@@ -82,13 +96,13 @@ function runCommandProcess(command, cwd) {
|
|
|
82
96
|
process.on('exit', processExitListener);
|
|
83
97
|
process.on('SIGTERM', processExitListener);
|
|
84
98
|
process.stdin.on('data', (data) => {
|
|
85
|
-
childProcess.stdin
|
|
86
|
-
childProcess.stdin
|
|
99
|
+
childProcess.stdin?.write(data);
|
|
100
|
+
childProcess.stdin?.end();
|
|
87
101
|
});
|
|
88
|
-
childProcess.stdout
|
|
102
|
+
childProcess.stdout?.on('data', (data) => {
|
|
89
103
|
process.stdout.write(data);
|
|
90
104
|
});
|
|
91
|
-
childProcess.stderr
|
|
105
|
+
childProcess.stderr?.on('data', (err) => {
|
|
92
106
|
process.stderr.write(err);
|
|
93
107
|
});
|
|
94
108
|
childProcess.on('close', (code) => {
|
|
@@ -106,17 +120,4 @@ function runCommandProcess(command, cwd) {
|
|
|
106
120
|
});
|
|
107
121
|
});
|
|
108
122
|
}
|
|
109
|
-
function getModuleType(projectPath) {
|
|
110
|
-
// `projectPath` is already absolute; joining it onto the workspace root again
|
|
111
|
-
// produced a path that never existed, so an app-level `"type"` was ignored.
|
|
112
|
-
const packageJsonPath = path.join(projectPath, 'package.json');
|
|
113
|
-
const appPackageJson = getPackageJson(packageJsonPath);
|
|
114
|
-
if (appPackageJson?.type) {
|
|
115
|
-
devkit_1.logger.debug(`Module type from ${packageJsonPath}: ${appPackageJson.type}`);
|
|
116
|
-
return appPackageJson.type;
|
|
117
|
-
}
|
|
118
|
-
const globalPackageJson = getPackageJson(path.join(getWorkspaceRoot(), 'package.json'));
|
|
119
|
-
devkit_1.logger.debug(`Module type from workspace package.json: ${globalPackageJson.type ?? 'commonjs'}`);
|
|
120
|
-
return globalPackageJson.type;
|
|
121
|
-
}
|
|
122
123
|
//# sourceMappingURL=executor.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.util.js","sourceRoot":"","sources":["../../../../../../libs/public/nx-aws-cdk-v2/src/utils/executor.util.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"executor.util.js","sourceRoot":"","sources":["../../../../../../libs/public/nx-aws-cdk-v2/src/utils/executor.util.ts"],"names":[],"mappings":";;;AAmBA,kDAiBC;AAeD,sDAgBC;AAED,8BAaC;AAED,sCA+BC;AAED,8CA8CC;;A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