cdk-cost-analyzer 0.1.1

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 (228) hide show
  1. package/.cdk-cost-analyzer-cache/metadata.json +12 -0
  2. package/.gitlab-ci.yml +214 -0
  3. package/.husky/pre-commit +12 -0
  4. package/.kiro/hooks/accessibility-audit.kiro.hook +18 -0
  5. package/.kiro/hooks/api-schema-validation.kiro.hook +21 -0
  6. package/.kiro/hooks/auto-test-on-save.kiro.hook +19 -0
  7. package/.kiro/hooks/cdk-synth-on-change.kiro.hook +20 -0
  8. package/.kiro/hooks/code-coverage-check.kiro.hook +14 -0
  9. package/.kiro/hooks/commit-message-helper.kiro.hook +14 -0
  10. package/.kiro/hooks/dependency-update-check.kiro.hook +14 -0
  11. package/.kiro/hooks/env-file-validation.kiro.hook +18 -0
  12. package/.kiro/hooks/lint-and-format-on-save.kiro.hook +21 -0
  13. package/.kiro/hooks/mcp-config-validation.kiro.hook +17 -0
  14. package/.kiro/hooks/mcp-server-test.kiro.hook +14 -0
  15. package/.kiro/hooks/performance-analysis.kiro.hook +14 -0
  16. package/.kiro/hooks/readme-spell-check.kiro.hook +14 -0
  17. package/.kiro/hooks/security-scan-on-dependency-change.kiro.hook +21 -0
  18. package/.kiro/hooks/translation-update.kiro.hook +18 -0
  19. package/.kiro/hooks/update-documentation.kiro.hook +18 -0
  20. package/.kiro/settings/mcp.json +20 -0
  21. package/.kiro/specs/cdk-cost-analyzer/design.md +620 -0
  22. package/.kiro/specs/cdk-cost-analyzer/requirements.md +183 -0
  23. package/.kiro/specs/cdk-cost-analyzer/tasks.md +357 -0
  24. package/.kiro/specs/github-actions-ci/design.md +281 -0
  25. package/.kiro/specs/github-actions-ci/requirements.md +86 -0
  26. package/.kiro/specs/github-actions-ci/tasks.md +115 -0
  27. package/.kiro/specs/nlb-calculator-test-coverage/design.md +190 -0
  28. package/.kiro/specs/nlb-calculator-test-coverage/requirements.md +84 -0
  29. package/.kiro/specs/nlb-calculator-test-coverage/tasks.md +150 -0
  30. package/.kiro/specs/production-readiness/design.md +1213 -0
  31. package/.kiro/specs/production-readiness/requirements.md +312 -0
  32. package/.kiro/specs/production-readiness/tasks.md +269 -0
  33. package/.kiro/specs/repository-cleanup/design.md +283 -0
  34. package/.kiro/specs/repository-cleanup/requirements.md +74 -0
  35. package/.kiro/specs/repository-cleanup/tasks.md +64 -0
  36. package/.kiro/steering/aws-cli-best-practices.md +41 -0
  37. package/.kiro/steering/cdk-best-practices.md +49 -0
  38. package/.kiro/steering/development-standards.md +54 -0
  39. package/.kiro/steering/docker-best-practices.md +34 -0
  40. package/.kiro/steering/documentation-style.md +151 -0
  41. package/.kiro/steering/git-best-practices.md +37 -0
  42. package/.kiro/steering/mcp-best-practices.md +95 -0
  43. package/.kiro/steering/python-best-practices.md +48 -0
  44. package/.kiro/steering/react-best-practices.md +44 -0
  45. package/.kiro/steering/security-best-practices.md +41 -0
  46. package/.kiro/steering/testing-best-practices.md +59 -0
  47. package/.kiro/steering/typescript-best-practices.md +40 -0
  48. package/CHANGELOG.md +49 -0
  49. package/CONTRIBUTING.md +258 -0
  50. package/LICENSE +19 -0
  51. package/README.md +480 -0
  52. package/SECURITY.md +117 -0
  53. package/dist/api/index.d.ts +11 -0
  54. package/dist/api/index.js +65 -0
  55. package/dist/api/types.d.ts +15 -0
  56. package/dist/api/types.js +3 -0
  57. package/dist/cli/index.d.ts +2 -0
  58. package/dist/cli/index.js +262 -0
  59. package/dist/config/ConfigManager.d.ts +40 -0
  60. package/dist/config/ConfigManager.js +238 -0
  61. package/dist/config/index.d.ts +2 -0
  62. package/dist/config/index.js +19 -0
  63. package/dist/config/types.d.ts +72 -0
  64. package/dist/config/types.js +15 -0
  65. package/dist/diff/DiffEngine.d.ts +7 -0
  66. package/dist/diff/DiffEngine.js +73 -0
  67. package/dist/diff/index.d.ts +2 -0
  68. package/dist/diff/index.js +21 -0
  69. package/dist/diff/types.d.ts +20 -0
  70. package/dist/diff/types.js +3 -0
  71. package/dist/integrations/GitLabIntegration.d.ts +7 -0
  72. package/dist/integrations/GitLabIntegration.js +45 -0
  73. package/dist/integrations/index.d.ts +2 -0
  74. package/dist/integrations/index.js +21 -0
  75. package/dist/integrations/types.d.ts +11 -0
  76. package/dist/integrations/types.js +13 -0
  77. package/dist/parser/TemplateParser.d.ts +8 -0
  78. package/dist/parser/TemplateParser.js +75 -0
  79. package/dist/parser/index.d.ts +2 -0
  80. package/dist/parser/index.js +22 -0
  81. package/dist/parser/types.d.ts +30 -0
  82. package/dist/parser/types.js +3 -0
  83. package/dist/pipeline/PipelineOrchestrator.d.ts +23 -0
  84. package/dist/pipeline/PipelineOrchestrator.js +191 -0
  85. package/dist/pipeline/index.d.ts +2 -0
  86. package/dist/pipeline/index.js +19 -0
  87. package/dist/pipeline/types.d.ts +41 -0
  88. package/dist/pipeline/types.js +13 -0
  89. package/dist/pricing/CacheManager.d.ts +75 -0
  90. package/dist/pricing/CacheManager.js +195 -0
  91. package/dist/pricing/PricingClient.d.ts +17 -0
  92. package/dist/pricing/PricingClient.js +122 -0
  93. package/dist/pricing/PricingService.d.ts +16 -0
  94. package/dist/pricing/PricingService.js +149 -0
  95. package/dist/pricing/calculators/ALBCalculator.d.ts +16 -0
  96. package/dist/pricing/calculators/ALBCalculator.js +163 -0
  97. package/dist/pricing/calculators/APIGatewayCalculator.d.ts +10 -0
  98. package/dist/pricing/calculators/APIGatewayCalculator.js +177 -0
  99. package/dist/pricing/calculators/CloudFrontCalculator.d.ts +59 -0
  100. package/dist/pricing/calculators/CloudFrontCalculator.js +151 -0
  101. package/dist/pricing/calculators/DynamoDBCalculator.d.ts +9 -0
  102. package/dist/pricing/calculators/DynamoDBCalculator.js +146 -0
  103. package/dist/pricing/calculators/EC2Calculator.d.ts +7 -0
  104. package/dist/pricing/calculators/EC2Calculator.js +80 -0
  105. package/dist/pricing/calculators/ECSCalculator.d.ts +9 -0
  106. package/dist/pricing/calculators/ECSCalculator.js +116 -0
  107. package/dist/pricing/calculators/ElastiCacheCalculator.d.ts +8 -0
  108. package/dist/pricing/calculators/ElastiCacheCalculator.js +106 -0
  109. package/dist/pricing/calculators/LambdaCalculator.d.ts +13 -0
  110. package/dist/pricing/calculators/LambdaCalculator.js +111 -0
  111. package/dist/pricing/calculators/NLBCalculator.d.ts +16 -0
  112. package/dist/pricing/calculators/NLBCalculator.js +138 -0
  113. package/dist/pricing/calculators/NatGatewayCalculator.d.ts +12 -0
  114. package/dist/pricing/calculators/NatGatewayCalculator.js +116 -0
  115. package/dist/pricing/calculators/RDSCalculator.d.ts +9 -0
  116. package/dist/pricing/calculators/RDSCalculator.js +103 -0
  117. package/dist/pricing/calculators/S3Calculator.d.ts +8 -0
  118. package/dist/pricing/calculators/S3Calculator.js +68 -0
  119. package/dist/pricing/calculators/VPCEndpointCalculator.d.ts +12 -0
  120. package/dist/pricing/calculators/VPCEndpointCalculator.js +129 -0
  121. package/dist/pricing/index.d.ts +10 -0
  122. package/dist/pricing/index.js +37 -0
  123. package/dist/pricing/types.d.ts +53 -0
  124. package/dist/pricing/types.js +22 -0
  125. package/dist/releasetag.txt +1 -0
  126. package/dist/reporter/Reporter.d.ts +18 -0
  127. package/dist/reporter/Reporter.js +412 -0
  128. package/dist/reporter/index.d.ts +2 -0
  129. package/dist/reporter/index.js +21 -0
  130. package/dist/reporter/types.d.ts +72 -0
  131. package/dist/reporter/types.js +3 -0
  132. package/dist/synthesis/SynthesisOrchestrator.d.ts +26 -0
  133. package/dist/synthesis/SynthesisOrchestrator.js +243 -0
  134. package/dist/synthesis/index.d.ts +2 -0
  135. package/dist/synthesis/index.js +19 -0
  136. package/dist/synthesis/types.d.ts +17 -0
  137. package/dist/synthesis/types.js +13 -0
  138. package/dist/threshold/ThresholdEnforcer.d.ts +29 -0
  139. package/dist/threshold/ThresholdEnforcer.js +143 -0
  140. package/dist/threshold/index.d.ts +2 -0
  141. package/dist/threshold/index.js +19 -0
  142. package/dist/threshold/types.d.ts +15 -0
  143. package/dist/threshold/types.js +17 -0
  144. package/docs/CALCULATORS.md +820 -0
  145. package/docs/CI_CD.md +608 -0
  146. package/docs/CONFIGURATION.md +407 -0
  147. package/docs/DEVELOPMENT.md +387 -0
  148. package/docs/RELEASE.md +223 -0
  149. package/docs/TROUBLESHOOTING.md +847 -0
  150. package/examples/.cdk-cost-analyzer.yml +85 -0
  151. package/examples/.gitlab-ci.yml +125 -0
  152. package/examples/api-usage.js +26 -0
  153. package/examples/complex/base.json +16 -0
  154. package/examples/complex/target.json +29 -0
  155. package/examples/monorepo/.gitlab-ci.yml +251 -0
  156. package/examples/monorepo/README.md +341 -0
  157. package/examples/monorepo/package.json +27 -0
  158. package/examples/monorepo/packages/backend-infra/.cdk-cost-analyzer.yml +34 -0
  159. package/examples/monorepo/packages/backend-infra/bin/app.ts +16 -0
  160. package/examples/monorepo/packages/backend-infra/cdk.json +7 -0
  161. package/examples/monorepo/packages/backend-infra/lib/backend-stack.ts +128 -0
  162. package/examples/monorepo/packages/backend-infra/package.json +30 -0
  163. package/examples/monorepo/packages/backend-infra/tsconfig.json +11 -0
  164. package/examples/monorepo/packages/data-infra/.cdk-cost-analyzer.yml +38 -0
  165. package/examples/monorepo/packages/data-infra/bin/app.ts +16 -0
  166. package/examples/monorepo/packages/data-infra/cdk.json +7 -0
  167. package/examples/monorepo/packages/data-infra/lib/data-stack.ts +121 -0
  168. package/examples/monorepo/packages/data-infra/package.json +30 -0
  169. package/examples/monorepo/packages/data-infra/tsconfig.json +11 -0
  170. package/examples/monorepo/packages/frontend-infra/.cdk-cost-analyzer.yml +31 -0
  171. package/examples/monorepo/packages/frontend-infra/bin/app.ts +16 -0
  172. package/examples/monorepo/packages/frontend-infra/cdk.json +7 -0
  173. package/examples/monorepo/packages/frontend-infra/lib/frontend-stack.ts +60 -0
  174. package/examples/monorepo/packages/frontend-infra/package.json +30 -0
  175. package/examples/monorepo/packages/frontend-infra/tsconfig.json +11 -0
  176. package/examples/monorepo/tsconfig.json +35 -0
  177. package/examples/multi-stack/.cdk-cost-analyzer.yml +72 -0
  178. package/examples/multi-stack/.gitlab-ci.yml +184 -0
  179. package/examples/multi-stack/README.md +279 -0
  180. package/examples/multi-stack/bin/app.ts +36 -0
  181. package/examples/multi-stack/cdk.json +72 -0
  182. package/examples/multi-stack/lib/compute-stack.ts +128 -0
  183. package/examples/multi-stack/lib/networking-stack.ts +69 -0
  184. package/examples/multi-stack/lib/storage-stack.ts +141 -0
  185. package/examples/multi-stack/package-lock.json +4437 -0
  186. package/examples/multi-stack/package.json +42 -0
  187. package/examples/multi-stack/tsconfig.json +34 -0
  188. package/examples/simple/base.json +8 -0
  189. package/examples/simple/target.json +14 -0
  190. package/examples/single-stack/.NVP +0 -0
  191. package/examples/single-stack/.cdk-cost-analyzer.yml +52 -0
  192. package/examples/single-stack/.gitlab-ci.yml +126 -0
  193. package/examples/single-stack/README.md +184 -0
  194. package/examples/single-stack/UeK +0 -0
  195. package/examples/single-stack/bin/app.ts +16 -0
  196. package/examples/single-stack/cdk.json +72 -0
  197. package/examples/single-stack/lib/infrastructure-stack.ts +119 -0
  198. package/examples/single-stack/package-lock.json +4443 -0
  199. package/examples/single-stack/package.json +38 -0
  200. package/examples/single-stack/tsconfig.json +34 -0
  201. package/package.json +139 -0
  202. package/test-cdk-project/README-COMPUTE.md +141 -0
  203. package/test-cdk-project/README.md +95 -0
  204. package/test-cdk-project/app-with-compute.js +102 -0
  205. package/test-cdk-project/app.js +81 -0
  206. package/test-cdk-project/cdk-compute.json +3 -0
  207. package/test-cdk-project/cdk.context.json +7 -0
  208. package/test-cdk-project/cdk.json +3 -0
  209. package/test-cdk-project/cdk.out/TestStack.assets.json +21 -0
  210. package/test-cdk-project/cdk.out/TestStack.template.json +115 -0
  211. package/test-cdk-project/cdk.out/cdk.out +1 -0
  212. package/test-cdk-project/cdk.out/manifest.json +503 -0
  213. package/test-cdk-project/cdk.out/tree.json +1 -0
  214. package/test-cdk-project/cdk.out.base/TestStack.assets.json +21 -0
  215. package/test-cdk-project/cdk.out.base/TestStack.template.json +115 -0
  216. package/test-cdk-project/cdk.out.base/cdk.out +1 -0
  217. package/test-cdk-project/cdk.out.base/manifest.json +503 -0
  218. package/test-cdk-project/cdk.out.base/tree.json +1 -0
  219. package/test-cdk-project/cdk.out.target/TestStack.assets.json +21 -0
  220. package/test-cdk-project/cdk.out.target/TestStack.template.json +183 -0
  221. package/test-cdk-project/cdk.out.target/cdk.out +1 -0
  222. package/test-cdk-project/cdk.out.target/manifest.json +521 -0
  223. package/test-cdk-project/cdk.out.target/tree.json +1 -0
  224. package/test-cdk-project/package-lock.json +422 -0
  225. package/test-cdk-project/package.json +17 -0
  226. package/tools/workflows/README.md +102 -0
  227. package/tools/workflows/validate-workflows.js +109 -0
  228. package/tools/workflows/workflow-utils.ts +181 -0
@@ -0,0 +1,422 @@
1
+ {
2
+ "name": "test-cdk-project",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "test-cdk-project",
9
+ "version": "1.0.0",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "aws-cdk-lib": "^2.231.0",
13
+ "constructs": "^10.4.3"
14
+ }
15
+ },
16
+ "node_modules/@aws-cdk/asset-awscli-v1": {
17
+ "version": "2.2.242",
18
+ "resolved": "https://registry.npmjs.org/@aws-cdk/asset-awscli-v1/-/asset-awscli-v1-2.2.242.tgz",
19
+ "integrity": "sha512-4c1bAy2ISzcdKXYS1k4HYZsNrgiwbiDzj36ybwFVxEWZXVAP0dimQTCaB9fxu7sWzEjw3d+eaw6Fon+QTfTIpQ==",
20
+ "license": "Apache-2.0"
21
+ },
22
+ "node_modules/@aws-cdk/asset-node-proxy-agent-v6": {
23
+ "version": "2.1.0",
24
+ "resolved": "https://registry.npmjs.org/@aws-cdk/asset-node-proxy-agent-v6/-/asset-node-proxy-agent-v6-2.1.0.tgz",
25
+ "integrity": "sha512-7bY3J8GCVxLupn/kNmpPc5VJz8grx+4RKfnnJiO1LG+uxkZfANZG3RMHhE+qQxxwkyQ9/MfPtTpf748UhR425A==",
26
+ "license": "Apache-2.0"
27
+ },
28
+ "node_modules/@aws-cdk/cloud-assembly-schema": {
29
+ "version": "48.20.0",
30
+ "resolved": "https://registry.npmjs.org/@aws-cdk/cloud-assembly-schema/-/cloud-assembly-schema-48.20.0.tgz",
31
+ "integrity": "sha512-+eeiav9LY4wbF/EFuCt/vfvi/Zoxo8bf94PW5clbMraChEliq83w4TbRVy0jB9jE0v1ooFTtIjSQkowSPkfISg==",
32
+ "bundleDependencies": [
33
+ "jsonschema",
34
+ "semver"
35
+ ],
36
+ "license": "Apache-2.0",
37
+ "dependencies": {
38
+ "jsonschema": "~1.4.1",
39
+ "semver": "^7.7.2"
40
+ },
41
+ "engines": {
42
+ "node": ">= 18.0.0"
43
+ }
44
+ },
45
+ "node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema": {
46
+ "version": "1.4.1",
47
+ "inBundle": true,
48
+ "license": "MIT",
49
+ "engines": {
50
+ "node": "*"
51
+ }
52
+ },
53
+ "node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver": {
54
+ "version": "7.7.2",
55
+ "inBundle": true,
56
+ "license": "ISC",
57
+ "bin": {
58
+ "semver": "bin/semver.js"
59
+ },
60
+ "engines": {
61
+ "node": ">=10"
62
+ }
63
+ },
64
+ "node_modules/aws-cdk-lib": {
65
+ "version": "2.231.0",
66
+ "resolved": "https://registry.npmjs.org/aws-cdk-lib/-/aws-cdk-lib-2.231.0.tgz",
67
+ "integrity": "sha512-RMt88F1vhsM28j81EjvIXRoPeYQdtk72EGh9xAP6LjuyF8df1hDBIy5cawUvagdp5eCBPVHrPJ2U0eaUUKtjFg==",
68
+ "bundleDependencies": [
69
+ "@balena/dockerignore",
70
+ "case",
71
+ "fs-extra",
72
+ "ignore",
73
+ "jsonschema",
74
+ "minimatch",
75
+ "punycode",
76
+ "semver",
77
+ "table",
78
+ "yaml",
79
+ "mime-types"
80
+ ],
81
+ "license": "Apache-2.0",
82
+ "dependencies": {
83
+ "@aws-cdk/asset-awscli-v1": "2.2.242",
84
+ "@aws-cdk/asset-node-proxy-agent-v6": "^2.1.0",
85
+ "@aws-cdk/cloud-assembly-schema": "^48.6.0",
86
+ "@balena/dockerignore": "^1.0.2",
87
+ "case": "1.6.3",
88
+ "fs-extra": "^11.3.1",
89
+ "ignore": "^5.3.2",
90
+ "jsonschema": "^1.5.0",
91
+ "mime-types": "^2.1.35",
92
+ "minimatch": "^3.1.2",
93
+ "punycode": "^2.3.1",
94
+ "semver": "^7.7.2",
95
+ "table": "^6.9.0",
96
+ "yaml": "1.10.2"
97
+ },
98
+ "engines": {
99
+ "node": ">= 18.0.0"
100
+ },
101
+ "peerDependencies": {
102
+ "constructs": "^10.0.0"
103
+ }
104
+ },
105
+ "node_modules/aws-cdk-lib/node_modules/@balena/dockerignore": {
106
+ "version": "1.0.2",
107
+ "inBundle": true,
108
+ "license": "Apache-2.0"
109
+ },
110
+ "node_modules/aws-cdk-lib/node_modules/ajv": {
111
+ "version": "8.17.1",
112
+ "inBundle": true,
113
+ "license": "MIT",
114
+ "dependencies": {
115
+ "fast-deep-equal": "^3.1.3",
116
+ "fast-uri": "^3.0.1",
117
+ "json-schema-traverse": "^1.0.0",
118
+ "require-from-string": "^2.0.2"
119
+ },
120
+ "funding": {
121
+ "type": "github",
122
+ "url": "https://github.com/sponsors/epoberezkin"
123
+ }
124
+ },
125
+ "node_modules/aws-cdk-lib/node_modules/ansi-regex": {
126
+ "version": "5.0.1",
127
+ "inBundle": true,
128
+ "license": "MIT",
129
+ "engines": {
130
+ "node": ">=8"
131
+ }
132
+ },
133
+ "node_modules/aws-cdk-lib/node_modules/ansi-styles": {
134
+ "version": "4.3.0",
135
+ "inBundle": true,
136
+ "license": "MIT",
137
+ "dependencies": {
138
+ "color-convert": "^2.0.1"
139
+ },
140
+ "engines": {
141
+ "node": ">=8"
142
+ },
143
+ "funding": {
144
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
145
+ }
146
+ },
147
+ "node_modules/aws-cdk-lib/node_modules/astral-regex": {
148
+ "version": "2.0.0",
149
+ "inBundle": true,
150
+ "license": "MIT",
151
+ "engines": {
152
+ "node": ">=8"
153
+ }
154
+ },
155
+ "node_modules/aws-cdk-lib/node_modules/balanced-match": {
156
+ "version": "1.0.2",
157
+ "inBundle": true,
158
+ "license": "MIT"
159
+ },
160
+ "node_modules/aws-cdk-lib/node_modules/brace-expansion": {
161
+ "version": "1.1.12",
162
+ "inBundle": true,
163
+ "license": "MIT",
164
+ "dependencies": {
165
+ "balanced-match": "^1.0.0",
166
+ "concat-map": "0.0.1"
167
+ }
168
+ },
169
+ "node_modules/aws-cdk-lib/node_modules/case": {
170
+ "version": "1.6.3",
171
+ "inBundle": true,
172
+ "license": "(MIT OR GPL-3.0-or-later)",
173
+ "engines": {
174
+ "node": ">= 0.8.0"
175
+ }
176
+ },
177
+ "node_modules/aws-cdk-lib/node_modules/color-convert": {
178
+ "version": "2.0.1",
179
+ "inBundle": true,
180
+ "license": "MIT",
181
+ "dependencies": {
182
+ "color-name": "~1.1.4"
183
+ },
184
+ "engines": {
185
+ "node": ">=7.0.0"
186
+ }
187
+ },
188
+ "node_modules/aws-cdk-lib/node_modules/color-name": {
189
+ "version": "1.1.4",
190
+ "inBundle": true,
191
+ "license": "MIT"
192
+ },
193
+ "node_modules/aws-cdk-lib/node_modules/concat-map": {
194
+ "version": "0.0.1",
195
+ "inBundle": true,
196
+ "license": "MIT"
197
+ },
198
+ "node_modules/aws-cdk-lib/node_modules/emoji-regex": {
199
+ "version": "8.0.0",
200
+ "inBundle": true,
201
+ "license": "MIT"
202
+ },
203
+ "node_modules/aws-cdk-lib/node_modules/fast-deep-equal": {
204
+ "version": "3.1.3",
205
+ "inBundle": true,
206
+ "license": "MIT"
207
+ },
208
+ "node_modules/aws-cdk-lib/node_modules/fast-uri": {
209
+ "version": "3.1.0",
210
+ "funding": [
211
+ {
212
+ "type": "github",
213
+ "url": "https://github.com/sponsors/fastify"
214
+ },
215
+ {
216
+ "type": "opencollective",
217
+ "url": "https://opencollective.com/fastify"
218
+ }
219
+ ],
220
+ "inBundle": true,
221
+ "license": "BSD-3-Clause"
222
+ },
223
+ "node_modules/aws-cdk-lib/node_modules/fs-extra": {
224
+ "version": "11.3.1",
225
+ "inBundle": true,
226
+ "license": "MIT",
227
+ "dependencies": {
228
+ "graceful-fs": "^4.2.0",
229
+ "jsonfile": "^6.0.1",
230
+ "universalify": "^2.0.0"
231
+ },
232
+ "engines": {
233
+ "node": ">=14.14"
234
+ }
235
+ },
236
+ "node_modules/aws-cdk-lib/node_modules/graceful-fs": {
237
+ "version": "4.2.11",
238
+ "inBundle": true,
239
+ "license": "ISC"
240
+ },
241
+ "node_modules/aws-cdk-lib/node_modules/ignore": {
242
+ "version": "5.3.2",
243
+ "inBundle": true,
244
+ "license": "MIT",
245
+ "engines": {
246
+ "node": ">= 4"
247
+ }
248
+ },
249
+ "node_modules/aws-cdk-lib/node_modules/is-fullwidth-code-point": {
250
+ "version": "3.0.0",
251
+ "inBundle": true,
252
+ "license": "MIT",
253
+ "engines": {
254
+ "node": ">=8"
255
+ }
256
+ },
257
+ "node_modules/aws-cdk-lib/node_modules/json-schema-traverse": {
258
+ "version": "1.0.0",
259
+ "inBundle": true,
260
+ "license": "MIT"
261
+ },
262
+ "node_modules/aws-cdk-lib/node_modules/jsonfile": {
263
+ "version": "6.2.0",
264
+ "inBundle": true,
265
+ "license": "MIT",
266
+ "dependencies": {
267
+ "universalify": "^2.0.0"
268
+ },
269
+ "optionalDependencies": {
270
+ "graceful-fs": "^4.1.6"
271
+ }
272
+ },
273
+ "node_modules/aws-cdk-lib/node_modules/jsonschema": {
274
+ "version": "1.5.0",
275
+ "inBundle": true,
276
+ "license": "MIT",
277
+ "engines": {
278
+ "node": "*"
279
+ }
280
+ },
281
+ "node_modules/aws-cdk-lib/node_modules/lodash.truncate": {
282
+ "version": "4.4.2",
283
+ "inBundle": true,
284
+ "license": "MIT"
285
+ },
286
+ "node_modules/aws-cdk-lib/node_modules/mime-db": {
287
+ "version": "1.52.0",
288
+ "inBundle": true,
289
+ "license": "MIT",
290
+ "engines": {
291
+ "node": ">= 0.6"
292
+ }
293
+ },
294
+ "node_modules/aws-cdk-lib/node_modules/mime-types": {
295
+ "version": "2.1.35",
296
+ "inBundle": true,
297
+ "license": "MIT",
298
+ "dependencies": {
299
+ "mime-db": "1.52.0"
300
+ },
301
+ "engines": {
302
+ "node": ">= 0.6"
303
+ }
304
+ },
305
+ "node_modules/aws-cdk-lib/node_modules/minimatch": {
306
+ "version": "3.1.2",
307
+ "inBundle": true,
308
+ "license": "ISC",
309
+ "dependencies": {
310
+ "brace-expansion": "^1.1.7"
311
+ },
312
+ "engines": {
313
+ "node": "*"
314
+ }
315
+ },
316
+ "node_modules/aws-cdk-lib/node_modules/punycode": {
317
+ "version": "2.3.1",
318
+ "inBundle": true,
319
+ "license": "MIT",
320
+ "engines": {
321
+ "node": ">=6"
322
+ }
323
+ },
324
+ "node_modules/aws-cdk-lib/node_modules/require-from-string": {
325
+ "version": "2.0.2",
326
+ "inBundle": true,
327
+ "license": "MIT",
328
+ "engines": {
329
+ "node": ">=0.10.0"
330
+ }
331
+ },
332
+ "node_modules/aws-cdk-lib/node_modules/semver": {
333
+ "version": "7.7.2",
334
+ "inBundle": true,
335
+ "license": "ISC",
336
+ "bin": {
337
+ "semver": "bin/semver.js"
338
+ },
339
+ "engines": {
340
+ "node": ">=10"
341
+ }
342
+ },
343
+ "node_modules/aws-cdk-lib/node_modules/slice-ansi": {
344
+ "version": "4.0.0",
345
+ "inBundle": true,
346
+ "license": "MIT",
347
+ "dependencies": {
348
+ "ansi-styles": "^4.0.0",
349
+ "astral-regex": "^2.0.0",
350
+ "is-fullwidth-code-point": "^3.0.0"
351
+ },
352
+ "engines": {
353
+ "node": ">=10"
354
+ },
355
+ "funding": {
356
+ "url": "https://github.com/chalk/slice-ansi?sponsor=1"
357
+ }
358
+ },
359
+ "node_modules/aws-cdk-lib/node_modules/string-width": {
360
+ "version": "4.2.3",
361
+ "inBundle": true,
362
+ "license": "MIT",
363
+ "dependencies": {
364
+ "emoji-regex": "^8.0.0",
365
+ "is-fullwidth-code-point": "^3.0.0",
366
+ "strip-ansi": "^6.0.1"
367
+ },
368
+ "engines": {
369
+ "node": ">=8"
370
+ }
371
+ },
372
+ "node_modules/aws-cdk-lib/node_modules/strip-ansi": {
373
+ "version": "6.0.1",
374
+ "inBundle": true,
375
+ "license": "MIT",
376
+ "dependencies": {
377
+ "ansi-regex": "^5.0.1"
378
+ },
379
+ "engines": {
380
+ "node": ">=8"
381
+ }
382
+ },
383
+ "node_modules/aws-cdk-lib/node_modules/table": {
384
+ "version": "6.9.0",
385
+ "inBundle": true,
386
+ "license": "BSD-3-Clause",
387
+ "dependencies": {
388
+ "ajv": "^8.0.1",
389
+ "lodash.truncate": "^4.4.2",
390
+ "slice-ansi": "^4.0.0",
391
+ "string-width": "^4.2.3",
392
+ "strip-ansi": "^6.0.1"
393
+ },
394
+ "engines": {
395
+ "node": ">=10.0.0"
396
+ }
397
+ },
398
+ "node_modules/aws-cdk-lib/node_modules/universalify": {
399
+ "version": "2.0.1",
400
+ "inBundle": true,
401
+ "license": "MIT",
402
+ "engines": {
403
+ "node": ">= 10.0.0"
404
+ }
405
+ },
406
+ "node_modules/aws-cdk-lib/node_modules/yaml": {
407
+ "version": "1.10.2",
408
+ "inBundle": true,
409
+ "license": "ISC",
410
+ "engines": {
411
+ "node": ">= 6"
412
+ }
413
+ },
414
+ "node_modules/constructs": {
415
+ "version": "10.4.3",
416
+ "resolved": "https://registry.npmjs.org/constructs/-/constructs-10.4.3.tgz",
417
+ "integrity": "sha512-3+ZB67qWGM1vEstNpj6pGaLNN1qz4gxC1CBhEUhZDZk0PqzQWY65IzC1Doq17MGPa9xa2wJ1G/DJ3swU8kWAHQ==",
418
+ "license": "Apache-2.0",
419
+ "peer": true
420
+ }
421
+ }
422
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "test-cdk-project",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "type": "commonjs",
13
+ "dependencies": {
14
+ "aws-cdk-lib": "^2.231.0",
15
+ "constructs": "^10.4.3"
16
+ }
17
+ }
@@ -0,0 +1,102 @@
1
+ # GitHub Actions Workflow Validation
2
+
3
+ This directory contains tools for validating GitHub Actions workflows locally using `act`.
4
+
5
+ ## Pre-commit Integration
6
+
7
+ Workflow validation is automatically run as part of the pre-commit hook. When you commit changes, the system will:
8
+
9
+ 1. Run linting and tests
10
+ 2. Validate GitHub Actions workflows (if `act` is available)
11
+
12
+ ## Prerequisites
13
+
14
+ Install `act` for local GitHub Actions testing:
15
+
16
+ ```bash
17
+ # macOS
18
+ brew install act
19
+
20
+ # Or use the project task
21
+ npm run install:act
22
+ ```
23
+
24
+ ## Manual Validation
25
+
26
+ You can manually validate workflows at any time:
27
+
28
+ ```bash
29
+ # Validate all workflows
30
+ npm run validate:workflows
31
+
32
+ # Or run the validator directly
33
+ node tools/workflows/validate-workflows.js
34
+ ```
35
+
36
+ ## What Gets Validated
37
+
38
+ ### 1. YAML Syntax
39
+ - Checks that all `.yml` and `.yaml` files in `.github/workflows/` are valid YAML
40
+ - Reports syntax errors with line numbers
41
+
42
+ ### 2. Workflow Structure (with act)
43
+ - Validates that workflows can be parsed by `act`
44
+ - Checks that expected jobs are present
45
+ - Verifies workflow execution feasibility
46
+
47
+ ## Manual Testing with act
48
+
49
+ You can also test workflows manually:
50
+
51
+ ```bash
52
+ # List all workflows and jobs
53
+ act --list
54
+
55
+ # Validate specific workflow (dry run)
56
+ act -j test --dryrun
57
+ act -j upgrade --dryrun
58
+
59
+ # Actually run workflow (use with caution)
60
+ act -j test
61
+
62
+ # Run with specific environment
63
+ act -j test --env CI=true
64
+ ```
65
+
66
+ ## Pre-commit Hook Details
67
+
68
+ The pre-commit hook (`.husky/pre-commit`) runs:
69
+
70
+ 1. `npm run lint` - TypeScript linting
71
+ 2. `npm run test:silent` - Full test suite
72
+ 3. `npm run validate:workflows` - Workflow validation (if act available)
73
+
74
+ If `act` is not installed, workflow validation is skipped with a warning, but the commit proceeds.
75
+
76
+ ## Troubleshooting
77
+
78
+ ### act not found
79
+ ```bash
80
+ brew install act
81
+ ```
82
+
83
+ ### Workflow validation fails
84
+ - Check YAML syntax in workflow files
85
+ - Ensure workflow structure follows GitHub Actions format
86
+ - Test manually with `act --list` to see detailed errors
87
+
88
+ ### Pre-commit hook issues
89
+ ```bash
90
+ # Reinstall hooks
91
+ npx husky install
92
+
93
+ # Test hook manually
94
+ .husky/pre-commit
95
+ ```
96
+
97
+ ## Benefits
98
+
99
+ - **Early Detection**: Catch workflow issues before pushing to GitHub
100
+ - **Local Testing**: Test workflows without triggering GitHub Actions
101
+ - **Graceful Degradation**: Works with or without `act` installed
102
+ - **Developer Friendly**: Clear error messages and installation instructions
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const yaml = require('js-yaml');
7
+
8
+ class WorkflowValidator {
9
+ constructor() {
10
+ this.workspaceRoot = path.resolve(__dirname, '../..');
11
+ }
12
+
13
+ isActAvailable() {
14
+ try {
15
+ execSync('which act', { stdio: 'pipe' });
16
+ return true;
17
+ } catch {
18
+ return false;
19
+ }
20
+ }
21
+
22
+ validateWorkflowFiles() {
23
+ const workflowDir = path.join(this.workspaceRoot, '.github/workflows');
24
+
25
+ if (!fs.existsSync(workflowDir)) {
26
+ console.log('āŒ No .github/workflows directory found');
27
+ return false;
28
+ }
29
+
30
+ const workflowFiles = fs.readdirSync(workflowDir)
31
+ .filter(file => file.endsWith('.yml') || file.endsWith('.yaml'));
32
+
33
+ if (workflowFiles.length === 0) {
34
+ console.log('āŒ No workflow files found');
35
+ return false;
36
+ }
37
+
38
+ console.log(`šŸ“‹ Found ${workflowFiles.length} workflow file(s): ${workflowFiles.join(', ')}`);
39
+
40
+ // Validate YAML syntax
41
+ for (const file of workflowFiles) {
42
+ try {
43
+ const content = fs.readFileSync(path.join(workflowDir, file), 'utf8');
44
+ yaml.load(content);
45
+ console.log(`āœ… ${file}: Valid YAML syntax`);
46
+ } catch (error) {
47
+ console.log(`āŒ ${file}: Invalid YAML syntax - ${error.message}`);
48
+ return false;
49
+ }
50
+ }
51
+
52
+ return true;
53
+ }
54
+
55
+ validateWithAct() {
56
+ if (!this.isActAvailable()) {
57
+ console.log('āš ļø act not available - skipping workflow execution validation');
58
+ console.log(' Install with: brew install act');
59
+ return true; // Don't fail if act is not available
60
+ }
61
+
62
+ try {
63
+ console.log('šŸ” Validating workflows with act...');
64
+
65
+ // List workflows to validate they can be parsed
66
+ const result = execSync('act --list', {
67
+ cwd: this.workspaceRoot,
68
+ stdio: 'pipe',
69
+ encoding: 'utf8',
70
+ timeout: 10000,
71
+ });
72
+
73
+ if (result.includes('test') || result.includes('upgrade')) {
74
+ console.log('āœ… Workflows can be parsed by act');
75
+ return true;
76
+ } else {
77
+ console.log('āŒ No expected workflows found by act');
78
+ return false;
79
+ }
80
+ } catch (error) {
81
+ console.log(`āŒ act validation failed: ${error.message}`);
82
+ return false;
83
+ }
84
+ }
85
+
86
+ validate() {
87
+ console.log('šŸš€ Validating GitHub Actions workflows...\n');
88
+
89
+ const yamlValid = this.validateWorkflowFiles();
90
+ if (!yamlValid) {
91
+ process.exit(1);
92
+ }
93
+
94
+ const actValid = this.validateWithAct();
95
+ if (!actValid) {
96
+ process.exit(1);
97
+ }
98
+
99
+ console.log('\nāœ… All workflow validations passed!');
100
+ }
101
+ }
102
+
103
+ // Run validation if called directly
104
+ if (require.main === module) {
105
+ const validator = new WorkflowValidator();
106
+ validator.validate();
107
+ }
108
+
109
+ module.exports = WorkflowValidator;