Skip to content

Commit b029622

Browse files
mrgraingithub-actions
andauthored
chore(toolkit-lib): reduce api-extractor noise (#468)
Significantly removes the noise api-extractor prints to logs, so they are actually usable again. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license --------- Signed-off-by: github-actions <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent 3c10a42 commit b029622

File tree

9 files changed

+55
-7
lines changed

9 files changed

+55
-7
lines changed

.projenrc.ts

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ const ADDITIONAL_CLI_IGNORE_PATTERNS = [
9191
'index_bg.wasm',
9292
'build-info.json',
9393
'.recommended-feature-flags.json',
94+
'synth.lock',
9495
];
9596

9697
const CLI_SDK_V3_RANGE = '^3';
@@ -864,9 +865,12 @@ new pj.JsonFile(toolkitLib, 'api-extractor.json', {
864865
},
865866
},
866867
extractorMessageReporting: {
867-
default: {
868+
'default': {
868869
logLevel: 'warning',
869870
},
871+
'ae-missing-release-tag': {
872+
logLevel: 'none',
873+
},
870874
},
871875
tsdocMessageReporting: {
872876
default: {
@@ -878,6 +882,26 @@ new pj.JsonFile(toolkitLib, 'api-extractor.json', {
878882
committed: true,
879883
});
880884

885+
// TsDoc config (required by API Extractor)
886+
new pj.JsonFile(toolkitLib, 'tsdoc.json', {
887+
marker: false,
888+
obj: {
889+
$schema: 'https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json',
890+
// Inherit the TSDoc configuration for API Extractor
891+
extends: ['@microsoft/api-extractor/extends/tsdoc-base.json'],
892+
// custom config
893+
tagDefinitions: [
894+
{
895+
tagName: '@default',
896+
syntaxKind: 'block',
897+
},
898+
],
899+
supportForTags: {
900+
'@default': true,
901+
},
902+
},
903+
});
904+
881905
// Eslint rules
882906
toolkitLib.eslint?.addRules({
883907
'@cdklabs/no-throw-default-error': 'error',
@@ -948,7 +972,7 @@ const toolkitLibDocs = toolkitLib.addTask('docs', {
948972
const apiExtractorDocsTask = toolkitLib.addTask('api-extractor-docs', {
949973
exec: [
950974
// Run api-extractor to generate the API model
951-
'api-extractor run --diagnostics || true',
975+
'api-extractor run || true',
952976
// Create a directory for the API model
953977
'mkdir -p dist/api-extractor-docs/cdk/api/toolkit-lib',
954978
// Copy the API model to the directory (with error handling)
@@ -960,7 +984,7 @@ const apiExtractorDocsTask = toolkitLib.addTask('api-extractor-docs', {
960984
// Copy all files from docs directory if it exists
961985
'if [ -d docs ]; then mkdir -p dist/api-extractor-docs/cdk/api/toolkit-lib/docs && cp -r docs/* dist/api-extractor-docs/cdk/api/toolkit-lib/docs/; fi',
962986
// Zip the API model and docs files
963-
'cd dist/api-extractor-docs && zip -r ../api-extractor-docs.zip cdk',
987+
'cd dist/api-extractor-docs && zip -r -q ../api-extractor-docs.zip cdk',
964988
].join(' && '),
965989
});
966990

@@ -973,7 +997,7 @@ toolkitLib.packageTask.spawn(toolkitLibDocs, { args: ['--out dist/docs/cdk/api/t
973997
// The docs build needs the version in a specific file at the nested root
974998
toolkitLib.packageTask.exec('(cat dist/version.txt || echo "latest") > dist/docs/cdk/api/toolkit-lib/VERSION');
975999
// Zip the whole thing up, again paths are important here to get the desired folder structure
976-
toolkitLib.packageTask.exec('zip -r ../docs.zip cdk', { cwd: 'dist/docs' });
1000+
toolkitLib.packageTask.exec('zip -r -q ../docs.zip cdk', { cwd: 'dist/docs' });
9771001

9781002
toolkitLib.addTask('publish-local', {
9791003
exec: './build-tools/package.sh',

packages/@aws-cdk/cli-lib-alpha/.gitignore

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/toolkit-lib/.gitattributes

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/toolkit-lib/.gitignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/toolkit-lib/.projen/files.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/toolkit-lib/api-extractor.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.

packages/@aws-cdk/toolkit-lib/tsdoc.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/aws-cdk/.gitignore

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)