Skip to content

Commit f5d64af

Browse files
committed
update projen to build CODE_REGISTRY.md
1 parent 01fa691 commit f5d64af

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

.projenrc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ toolkitLib.package.addField("exports", {
987987
"./package.json": "./package.json"
988988
});
989989

990+
toolkitLib.postCompileTask.prependExec('ts-node scripts/gen-code-registry.ts');
990991
toolkitLib.postCompileTask.exec('node build-tools/bundle.mjs');
991992
// Smoke test built JS files
992993
toolkitLib.postCompileTask.exec("node ./lib/index.js >/dev/null 2>/dev/null </dev/null");

packages/@aws-cdk/toolkit/.projen/tasks.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
| Code | Description | Level | Data Interface |
2+
|------|-------------| ----- | -------------- |
3+
| CDK_TOOLKIT_I1000 | Provides synthesis times. | info | undefined |
4+
| CDK_TOOLKIT_I1901 | Provides stack data | result | undefined |
5+
| CDK_TOOLKIT_I1902 | Successfully deployed stacks | result | undefined |
6+
| CDK_TOOLKIT_I2901 | Provides details on the selected stacks and their dependencies | result | undefined |
7+
| CDK_TOOLKIT_E3900 | Resource import failed | error | undefined |
8+
| CDK_TOOLKIT_I5000 | Provides deployment times | info | undefined |
9+
| CDK_TOOLKIT_I5001 | Provides total time in deploy action, including synth and rollback | info | undefined |
10+
| CDK_TOOLKIT_I5002 | Provides time for resource migration | info | undefined |
11+
| CDK_TOOLKIT_I5031 | Informs about any log groups that are traced as part of the deployment | info | undefined |
12+
| CDK_TOOLKIT_I5050 | Confirm rollback during deployment | response | undefined |
13+
| CDK_TOOLKIT_I5060 | Confirm deploy security sensitive changes | response | undefined |
14+
| CDK_TOOLKIT_I5900 | Deployment results on success | result | undefined |
15+
| CDK_TOOLKIT_E5001 | No stacks found | error | undefined |
16+
| CDK_TOOLKIT_I6000 | Provides rollback times | info | undefined |
17+
| CDK_TOOLKIT_E6001 | No stacks found | error | undefined |
18+
| CDK_TOOLKIT_E6900 | Rollback failed | error | undefined |
19+
| CDK_TOOLKIT_I7000 | Provides destroy times | info | undefined |
20+
| CDK_TOOLKIT_I7010 | Confirm destroy stacks | response | undefined |
21+
| CDK_TOOLKIT_E7010 | Action was aborted due to negative confirmation of request | error | undefined |
22+
| CDK_TOOLKIT_E7900 | Stack deletion failed | error | undefined |
23+
| CDK_ASSEMBLY_I0042 | Writing updated context | debug | undefined |
24+
| CDK_ASSEMBLY_I0241 | Fetching missing context | debug | undefined |
25+
| CDK_ASSEMBLY_I1000 | Cloud assembly output starts | debug | undefined |
26+
| CDK_ASSEMBLY_I1001 | Output lines emitted by the cloud assembly to stdout | info | undefined |
27+
| CDK_ASSEMBLY_E1002 | Output lines emitted by the cloud assembly to stderr | error | undefined |
28+
| CDK_ASSEMBLY_I1003 | Cloud assembly output finished | info | undefined |
29+
| CDK_ASSEMBLY_E1111 | Incompatible CDK CLI version. Upgrade needed. | error | undefined |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as fs from 'fs';
2+
import { CODES, CodeInfo } from '../lib/api/io/private/codes';
3+
4+
function objectToMarkdownTable(codes: Record<string, CodeInfo>) {
5+
let table = '| Code | Description | Level | Data Interface |\n';
6+
table += '|------|-------------| ----- | -------------- |\n';
7+
8+
Object.entries(codes).forEach(([id, code]) => {
9+
table += `| ${id} | ${code.description} | ${code.level} | ${code.interface} |\n`;
10+
});
11+
12+
return table;
13+
}
14+
15+
fs.writeFileSync('CODE_REGISTRY.md', objectToMarkdownTable(CODES));

0 commit comments

Comments
 (0)