ci: move public-api goldens to goldens directory (#35768)

Moves the public api .d.ts files from tools/public_api_guard to
goldens/public-api.

Additionally, provides a README in the goldens directory and a script
assist in testing the current state of the repo against the goldens as
well as a command for accepting all changes to the goldens in a single
command.

PR Close #35768
This commit is contained in:
Joey Perrott
2020-02-26 09:09:35 -08:00
committed by Matias Niemelä
parent 19cfaf7f4c
commit 15f8afa4bf
62 changed files with 483 additions and 348 deletions

View File

@ -62,6 +62,7 @@ def ts_api_guardian_test(
name = name,
data = data,
entry_point = "@angular//tools/ts-api-guardian:bin/ts-api-guardian",
tags = kwargs.pop("tags", []) + ["api_guard"],
templated_args = args + ["--verify", golden, actual],
**kwargs
)
@ -71,6 +72,7 @@ def ts_api_guardian_test(
testonly = True,
data = data,
entry_point = "@angular//tools/ts-api-guardian:bin/ts-api-guardian",
tags = kwargs.pop("tags", []) + ["api_guard"],
templated_args = args + ["--out", golden, actual],
**kwargs
)
@ -120,8 +122,8 @@ def ts_api_guardian_test_npm_package(
name = name,
data = data,
entry_point = "@angular//tools/ts-api-guardian:bin/ts-api-guardian",
templated_args = args + ["--verifyDir", goldenDir, "--rootDir", actualDir],
tags = ["api_guard"],
tags = kwargs.pop("tags", []) + ["api_guard"],
templated_args = args + ["--autoDiscoverEntrypoints", "--verifyDir", goldenDir, "--rootDir", actualDir],
**kwargs
)
@ -130,7 +132,7 @@ def ts_api_guardian_test_npm_package(
testonly = True,
data = data,
entry_point = "@angular//tools/ts-api-guardian:bin/ts-api-guardian",
templated_args = args + ["--outDir", goldenDir, "--rootDir", actualDir],
tags = ["api_guard"],
tags = kwargs.pop("tags", []) + ["api_guard"],
templated_args = args + ["--autoDiscoverEntrypoints", "--outDir", goldenDir, "--rootDir", actualDir],
**kwargs
)

View File

@ -57,7 +57,7 @@ function ensureDirectory(dir: string) {
*/
function isDirectory(dirPath: string) {
try {
fs.lstatSync(dirPath).isDirectory();
return fs.lstatSync(dirPath).isDirectory();
} catch {
return false;
}