Skip to content

Commit

Permalink
update projen to build CODE_REGISTRY.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizencc committed Feb 17, 2025
1 parent 01fa691 commit f5d64af
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,7 @@ toolkitLib.package.addField("exports", {
"./package.json": "./package.json"
});

toolkitLib.postCompileTask.prependExec('ts-node scripts/gen-code-registry.ts');
toolkitLib.postCompileTask.exec('node build-tools/bundle.mjs');
// Smoke test built JS files
toolkitLib.postCompileTask.exec("node ./lib/index.js >/dev/null 2>/dev/null </dev/null");
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/toolkit/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions packages/@aws-cdk/toolkit/CODE_REGISTRY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
| Code | Description | Level | Data Interface |
|------|-------------| ----- | -------------- |
| CDK_TOOLKIT_I1000 | Provides synthesis times. | info | undefined |
| CDK_TOOLKIT_I1901 | Provides stack data | result | undefined |
| CDK_TOOLKIT_I1902 | Successfully deployed stacks | result | undefined |
| CDK_TOOLKIT_I2901 | Provides details on the selected stacks and their dependencies | result | undefined |
| CDK_TOOLKIT_E3900 | Resource import failed | error | undefined |
| CDK_TOOLKIT_I5000 | Provides deployment times | info | undefined |
| CDK_TOOLKIT_I5001 | Provides total time in deploy action, including synth and rollback | info | undefined |
| CDK_TOOLKIT_I5002 | Provides time for resource migration | info | undefined |
| CDK_TOOLKIT_I5031 | Informs about any log groups that are traced as part of the deployment | info | undefined |
| CDK_TOOLKIT_I5050 | Confirm rollback during deployment | response | undefined |
| CDK_TOOLKIT_I5060 | Confirm deploy security sensitive changes | response | undefined |
| CDK_TOOLKIT_I5900 | Deployment results on success | result | undefined |
| CDK_TOOLKIT_E5001 | No stacks found | error | undefined |
| CDK_TOOLKIT_I6000 | Provides rollback times | info | undefined |
| CDK_TOOLKIT_E6001 | No stacks found | error | undefined |
| CDK_TOOLKIT_E6900 | Rollback failed | error | undefined |
| CDK_TOOLKIT_I7000 | Provides destroy times | info | undefined |
| CDK_TOOLKIT_I7010 | Confirm destroy stacks | response | undefined |
| CDK_TOOLKIT_E7010 | Action was aborted due to negative confirmation of request | error | undefined |
| CDK_TOOLKIT_E7900 | Stack deletion failed | error | undefined |
| CDK_ASSEMBLY_I0042 | Writing updated context | debug | undefined |
| CDK_ASSEMBLY_I0241 | Fetching missing context | debug | undefined |
| CDK_ASSEMBLY_I1000 | Cloud assembly output starts | debug | undefined |
| CDK_ASSEMBLY_I1001 | Output lines emitted by the cloud assembly to stdout | info | undefined |
| CDK_ASSEMBLY_E1002 | Output lines emitted by the cloud assembly to stderr | error | undefined |
| CDK_ASSEMBLY_I1003 | Cloud assembly output finished | info | undefined |
| CDK_ASSEMBLY_E1111 | Incompatible CDK CLI version. Upgrade needed. | error | undefined |
15 changes: 15 additions & 0 deletions packages/@aws-cdk/toolkit/scripts/gen-code-registry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as fs from 'fs';
import { CODES, CodeInfo } from '../lib/api/io/private/codes';

function objectToMarkdownTable(codes: Record<string, CodeInfo>) {
let table = '| Code | Description | Level | Data Interface |\n';
table += '|------|-------------| ----- | -------------- |\n';

Object.entries(codes).forEach(([id, code]) => {
table += `| ${id} | ${code.description} | ${code.level} | ${code.interface} |\n`;
});

return table;
}

fs.writeFileSync('CODE_REGISTRY.md', objectToMarkdownTable(CODES));

0 comments on commit f5d64af

Please sign in to comment.