@cdktn/cli-core 0.25.0-pre.9 → 0.26.0-pre.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.
Files changed (82) hide show
  1. package/README.md +12 -0
  2. package/build/lib/cdktf-config.d.ts.map +1 -1
  3. package/build/lib/cdktf-config.js +18 -8
  4. package/build/lib/cdktf-project.d.ts +4 -1
  5. package/build/lib/cdktf-project.d.ts.map +1 -1
  6. package/build/lib/cdktf-project.js +47 -57
  7. package/build/lib/cdktf-stack.d.ts.map +1 -1
  8. package/build/lib/cdktf-stack.js +6 -39
  9. package/build/lib/convert.js +19 -10
  10. package/build/lib/dependencies/cdktf-config-manager.d.ts +2 -0
  11. package/build/lib/dependencies/cdktf-config-manager.d.ts.map +1 -1
  12. package/build/lib/dependencies/cdktf-config-manager.js +26 -6
  13. package/build/lib/dependencies/dependency-manager.d.ts +16 -5
  14. package/build/lib/dependencies/dependency-manager.d.ts.map +1 -1
  15. package/build/lib/dependencies/dependency-manager.js +53 -26
  16. package/build/lib/dependencies/package-manager.d.ts.map +1 -1
  17. package/build/lib/dependencies/package-manager.js +109 -22
  18. package/build/lib/dependencies/prebuilt-providers.d.ts.map +1 -1
  19. package/build/lib/dependencies/prebuilt-providers.js +38 -18
  20. package/build/lib/dependencies/registry-api.d.ts +10 -0
  21. package/build/lib/dependencies/registry-api.d.ts.map +1 -1
  22. package/build/lib/dependencies/registry-api.js +35 -13
  23. package/build/lib/dependencies/version-constraints.js +20 -11
  24. package/build/lib/error-reporting.d.ts +1 -1
  25. package/build/lib/error-reporting.d.ts.map +1 -1
  26. package/build/lib/error-reporting.js +111 -41
  27. package/build/lib/errors.d.ts.map +1 -1
  28. package/build/lib/execution-logs.js +2 -3
  29. package/build/lib/get.js +21 -11
  30. package/build/lib/helpers/stack-helpers.js +8 -9
  31. package/build/lib/init.d.ts +3 -2
  32. package/build/lib/init.d.ts.map +1 -1
  33. package/build/lib/init.js +78 -21
  34. package/build/lib/installed-binary-check.js +19 -10
  35. package/build/lib/local-provider-constraints.js +18 -8
  36. package/build/lib/local-provider-versions.d.ts.map +1 -1
  37. package/build/lib/local-provider-versions.js +8 -5
  38. package/build/lib/models/deploy-machine.d.ts +3 -3
  39. package/build/lib/models/deploy-machine.d.ts.map +1 -1
  40. package/build/lib/models/deploy-machine.js +10 -10
  41. package/build/lib/models/interactive-process.js +2 -3
  42. package/build/lib/models/schema.js +18 -8
  43. package/build/lib/models/terraform-cli.d.ts.map +1 -1
  44. package/build/lib/models/terraform-cli.js +26 -13
  45. package/build/lib/models/terraform.d.ts.map +1 -1
  46. package/build/lib/models/terraform.js +4 -3
  47. package/build/lib/output.d.ts +1 -1
  48. package/build/lib/output.d.ts.map +1 -1
  49. package/build/lib/output.js +40 -16
  50. package/build/lib/provider-add.d.ts.map +1 -1
  51. package/build/lib/provider-add.js +41 -4
  52. package/build/lib/server/terraform-logs.js +2 -3
  53. package/build/lib/synth-stack.d.ts +6 -2
  54. package/build/lib/synth-stack.d.ts.map +1 -1
  55. package/build/lib/synth-stack.js +40 -13
  56. package/build/lib/synth.js +19 -10
  57. package/build/lib/terraform-json.js +18 -8
  58. package/build/lib/terraform-provider-lock.d.ts +8 -0
  59. package/build/lib/terraform-provider-lock.d.ts.map +1 -1
  60. package/build/lib/terraform-provider-lock.js +47 -1
  61. package/build/lib/watch.d.ts.map +1 -1
  62. package/build/lib/watch.js +73 -33
  63. package/package.json +11 -12
  64. package/templates/csharp/AGENTS.md +33 -0
  65. package/templates/csharp/cdktf.json +1 -0
  66. package/templates/go/AGENTS.md +33 -0
  67. package/templates/go/cdktf.json +1 -0
  68. package/templates/java/AGENTS.md +33 -0
  69. package/templates/java/cdktf.json +1 -0
  70. package/templates/python/AGENTS.md +33 -0
  71. package/templates/python/Pipfile +1 -1
  72. package/templates/python/cdktf.json +1 -0
  73. package/templates/python-pip/AGENTS.md +33 -0
  74. package/templates/python-pip/cdktf.json +1 -0
  75. package/templates/typescript/.hooks.sscaff.js +98 -7
  76. package/templates/typescript/AGENTS.md +33 -0
  77. package/templates/typescript/cdktf.json +2 -1
  78. package/templates/typescript/help +16 -16
  79. package/templates/typescript/jest.config.js +1 -1
  80. package/templates/typescript/package.json +2 -2
  81. package/templates/typescript/tsconfig.json +7 -0
  82. package/templates/typescript-pnpm/pnpm-workspace.yaml +4 -0
@@ -0,0 +1,33 @@
1
+ # AGENTS.md
2
+
3
+ This is a [CDK Terrain](https://cdktn.io) (CDKTN) project written in TypeScript. CDKTN is the
4
+ community-maintained successor to CDK for Terraform (CDKTF): the library and CLI are both named `cdktn`.
5
+ Packages, imports and some behavior differ from CDKTF, so check the CDKTN docs instead of relying on
6
+ prior CDKTF knowledge.
7
+
8
+ ## Docs
9
+
10
+ - Docs MCP server: https://cdktn.io/docs/mcp (streamable HTTP, no auth). `.mcp.json` registers it for
11
+ Claude Code; for other clients add it as a remote MCP server, or run
12
+ `claude mcp add --transport http cdktn https://cdktn.io/docs/mcp`
13
+ - Agent skill: https://cdktn.io/docs/skill.md
14
+ - LLM index: https://cdktn.io/llms.txt
15
+ - Migrating from CDKTF: https://cdktn.io/docs/release/upgrade-guide-v0-22
16
+
17
+ ## Layout
18
+
19
+ - `main.ts`: the app; define stacks and resources here
20
+ - `cdktf.json`: project config (language, app command, providers, modules)
21
+ - `.gen/`: provider and module bindings generated by `cdktn get`; do not edit by hand
22
+ - `cdktf.out/`: Terraform JSON written by `cdktn synth`; do not edit
23
+
24
+ ## Commands
25
+
26
+ - `cdktn provider add <provider>`: add a provider (uses a prebuilt package when one exists)
27
+ - `cdktn get`: generate bindings for the providers and modules in `cdktf.json`
28
+ - `cdktn synth`: synthesize Terraform JSON into `cdktf.out/`
29
+ - `cdktn diff [stack]`: plan changes for a stack
30
+ - `cdktn deploy [stack]` / `cdktn destroy [stack]`: change real infrastructure; ask before running
31
+ - `{{ pmRun }} test` (tests live in `__tests__/`): run unit tests
32
+
33
+ The `help` file lists every command for this project.
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "language": "typescript",
3
- "app": "npx ts-node main.ts",
3
+ "app": "{{ pmExec }} tsx main.ts",
4
4
  "projectId": "{{projectId}}",
5
5
  "sendCrashReports": "{{sendCrashReports}}",
6
6
  "targetVersions": {
7
7
  "terraform": ">=1.5.7",
8
8
  "opentofu": ">=1.6.0"
9
9
  },
10
+ "sendUsageTelemetry": "{{sendUsageTelemetry}}",
10
11
  "terraformProviders": [],
11
12
  "terraformModules": [],
12
13
  "context": {
@@ -5,10 +5,10 @@
5
5
  cat help Print this message
6
6
 
7
7
  Compile:
8
- npm run get Import/update Terraform providers and modules (you should check-in this directory)
9
- npm run compile Compile typescript code to javascript (or "npm run watch")
10
- npm run watch Watch for changes and compile typescript in the background
11
- npm run build Compile typescript
8
+ {{ pmRun }} get Import/update Terraform providers and modules (you should check-in this directory)
9
+ {{ pmRun }} compile Compile typescript code to javascript (or "{{ pmRun }} watch")
10
+ {{ pmRun }} watch Watch for changes and compile typescript in the background
11
+ {{ pmRun }} build Compile typescript
12
12
 
13
13
  Synthesize:
14
14
  cdktn synth [stack] Synthesize Terraform resources from stacks to cdktf.out/ (ready for 'terraform apply')
@@ -23,12 +23,12 @@
23
23
  cdktn destroy [stack] Destroy the stack
24
24
 
25
25
  Test:
26
- npm run test Runs unit tests (edit __tests__/main-test.ts to add your own tests)
27
- npm run test:watch Watches the tests and reruns them on change
26
+ {{ pmRun }} test Runs unit tests (edit __tests__/main-test.ts to add your own tests)
27
+ {{ pmRun }} test:watch Watches the tests and reruns them on change
28
28
 
29
29
  Upgrades:
30
- npm run upgrade Upgrade cdktn modules to latest version
31
- npm run upgrade:next Upgrade cdktn modules to latest "@next" version (last commit)
30
+ {{ pmRun }} upgrade Upgrade cdktn modules to latest version
31
+ {{ pmRun }} upgrade:next Upgrade cdktn modules to latest "@next" version (last commit)
32
32
 
33
33
  Use Providers:
34
34
 
@@ -37,14 +37,14 @@
37
37
  cdktn provider add "aws@~>3.0" null kreuzwerker/docker
38
38
 
39
39
  You can find all prebuilt providers on npm: https://www.npmjs.com/search?q=keywords:cdktn
40
- You can also install these providers directly through npm:
41
-
42
- npm install @cdktn/provider-aws
43
- npm install @cdktn/provider-google
44
- npm install @cdktn/provider-azurerm
45
- npm install @cdktn/provider-docker
46
- npm install @cdktn/provider-github
47
- npm install @cdktn/provider-null
40
+ You can also install these providers directly through {{ packageManager }}:
41
+
42
+ {{ pmAdd }} @cdktn/provider-aws
43
+ {{ pmAdd }} @cdktn/provider-google
44
+ {{ pmAdd }} @cdktn/provider-azurerm
45
+ {{ pmAdd }} @cdktn/provider-docker
46
+ {{ pmAdd }} @cdktn/provider-github
47
+ {{ pmAdd }} @cdktn/provider-null
48
48
 
49
49
  You can also build any module or provider locally. Learn more https://cdktn.io/docs/concepts/providers
50
50
 
@@ -1,4 +1,4 @@
1
- /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
1
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
2
2
  /*
3
3
  * For a detailed explanation regarding each configuration property, visit:
4
4
  * https://jestjs.io/docs/configuration
@@ -13,8 +13,8 @@
13
13
  "watch": "tsc -w",
14
14
  "test": "jest",
15
15
  "test:watch": "jest --watch",
16
- "upgrade": "npm i cdktn@latest cdktn-cli@latest",
17
- "upgrade:next": "npm i cdktn@next cdktn-cli@next"
16
+ "upgrade": "{{ pmAdd }} cdktn@latest cdktn-cli@latest",
17
+ "upgrade:next": "{{ pmAdd }} cdktn@next cdktn-cli@next"
18
18
  },
19
19
  "engines": {
20
20
  "node": ">=22.0"
@@ -5,6 +5,8 @@
5
5
  "experimentalDecorators": true,
6
6
  "inlineSourceMap": true,
7
7
  "inlineSources": true,
8
+ // Required for ts-jest on TypeScript 6; `npm run build` still type-checks.
9
+ "isolatedModules": true,
8
10
  "lib": [
9
11
  "es2018"
10
12
  ],
@@ -22,6 +24,11 @@
22
24
  "strictPropertyInitialization": true,
23
25
  "stripInternal": true,
24
26
  "target": "ES2018",
27
+ // TypeScript 6 no longer picks up ambient @types automatically.
28
+ "types": [
29
+ "node",
30
+ "jest"
31
+ ],
25
32
  "incremental": true,
26
33
  "skipLibCheck": true
27
34
  },
@@ -0,0 +1,4 @@
1
+ allowBuilds:
2
+ esbuild: true
3
+ unrs-resolver: true
4
+ "@parcel/watcher": false