Skip to content

Commit d84e2bc

Browse files
devversionamysorto
authored andcommitted
build: switch to API signature test tool from dev-infra
We recently introduced a new tool for testing the public API signature of entry-points. This tool is part of the shared dev-infra package and uses Microsoft's API extractor under the hood. This commit sets up the new tool and removes ts-api-guardian.
1 parent 672947e commit d84e2bc

File tree

125 files changed

+9703
-3598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+9703
-3598
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ jobs:
220220
- *slack_notify_on_failure
221221

222222
# --------------------------------------------------------------------------------------------
223-
# Job that runs ts-api-guardian against our API goldens in "tools/public_api_guard".
223+
# Job that runs API golden tests in "tools/public_api_guard".
224224
# This job fails whenever an API has been updated but not explicitly approved through goldens.
225225
# --------------------------------------------------------------------------------------------
226226
api_golden_checks:

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package(default_visibility = ["//visibility:public"])
88

99
exports_files([
1010
"LICENSE",
11+
"package.json",
1112
])
1213

1314
genrule(

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@
218218
"shelljs": "^0.8.3",
219219
"stylelint": "^13.8.0",
220220
"terser": "^4.8.0",
221-
"ts-api-guardian": "^0.6.0",
222221
"ts-node": "^9.1.1",
223222
"tsickle": "0.39.1",
224223
"tslint": "^6.1.3",

scripts/check-mdc-exports.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ function getMissingSymbols(name: string, skipped: string[], skippedPatterns: Reg
7575

7676
/**
7777
* Gets the name of the exported symbols from a particular package.
78-
* Based on https://github.com/angular/angular/blob/master/tools/ts-api-guardian/lib/serializer.ts
7978
*/
8079
function getExports(name: string): string[] {
8180
const entryPoint = join(__dirname, '../src', name, 'public-api.ts');

src/material/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
// primary entry-point which is empty as of version 9. All components should
1010
// be imported through their individual entry-points. This file is needed to
1111
// satisfy the "ng_package" bazel rule which also requires a primary entry-point.
12+
13+
// Workaround for: https://github.com/microsoft/rushstack/issues/2806.
14+
// This is a private export that can be removed at any time.
15+
export const ɵɵtsModuleIndicatorApiExtractorWorkaround = true;

tools/public_api_guard/BUILD.bazel

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ load(":generate-guard-tests.bzl", "generate_test_targets")
44

55
package(default_visibility = ["//visibility:public"])
66

7-
golden_files = ["cdk/%s.d.ts" % e for e in CDK_ENTRYPOINTS] + \
8-
["material/%s.d.ts" % e for e in MATERIAL_ENTRYPOINTS + MATERIAL_TESTING_ENTRYPOINTS] + [
9-
# Primary entry-points.
10-
"cdk/cdk.d.ts",
11-
"material/material.d.ts",
12-
"youtube-player/youtube-player.d.ts",
13-
"google-maps/google-maps.d.ts",
14-
]
7+
golden_files = [
8+
# Primary entry-points.
9+
"cdk/cdk.md",
10+
"material/material.md",
11+
"youtube-player/youtube-player.md",
12+
"google-maps/google-maps.md",
13+
] + ["cdk/%s.md" % e for e in CDK_ENTRYPOINTS] + \
14+
["material/%s.md" % e for e in MATERIAL_ENTRYPOINTS + MATERIAL_TESTING_ENTRYPOINTS]
1515

1616
# Generate the API guard test targets for each golden file in the current package.
17-
generate_test_targets(golden_files)
17+
generate_test_targets(targets = golden_files)

0 commit comments

Comments
 (0)