Skip to content

Commit

Permalink
ci: add golden files for runtime error codes (#44677)
Browse files Browse the repository at this point in the history
Runtime error codes in the Core, Common and Forms packages were not included into the `public-api` group reviews. This commit creates the necessary golden files to keep track of further changes in the runtime codes.

This is a followup from #44398 (comment).

PR Close #44677
  • Loading branch information
AndrewKushnir authored and atscott committed Jan 12, 2022
1 parent 07d97af commit 74037f1
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 2 deletions.
15 changes: 15 additions & 0 deletions goldens/public-api/common/errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## API Report File for "angular-srcs"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts

// @public
export const enum RuntimeErrorCode {
// (undocumented)
PARENT_NG_SWITCH_NOT_FOUND = 2000
}

// (No @packageDocumentation comment for this package)

```
55 changes: 55 additions & 0 deletions goldens/public-api/core/errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## API Report File for "angular-srcs"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts

// @public
export function formatRuntimeError<T = RuntimeErrorCode>(code: T, message: string): string;

// @public (undocumented)
export class RuntimeError<T = RuntimeErrorCode> extends Error {
constructor(code: T, message: string);
// (undocumented)
code: T;
}

// @public
export const enum RuntimeErrorCode {
// (undocumented)
ALREADY_DESTROYED_PLATFORM = 404,
// (undocumented)
ASYNC_INITIALIZERS_STILL_RUNNING = 405,
// (undocumented)
BOOTSTRAP_COMPONENTS_NOT_FOUND = 403,
// (undocumented)
CYCLIC_DI_DEPENDENCY = -200,
// (undocumented)
ERROR_HANDLER_NOT_FOUND = 402,
// (undocumented)
EXPORT_NOT_FOUND = -301,
// (undocumented)
EXPRESSION_CHANGED_AFTER_CHECKED = -100,
// (undocumented)
MULTIPLE_COMPONENTS_MATCH = -300,
// (undocumented)
MULTIPLE_PLATFORMS = 400,
// (undocumented)
PIPE_NOT_FOUND = -302,
// (undocumented)
PLATFORM_NOT_FOUND = 401,
// (undocumented)
PROVIDER_NOT_FOUND = -201,
// (undocumented)
RECURSIVE_APPLICATION_REF_TICK = 101,
// (undocumented)
TEMPLATE_STRUCTURE_ERROR = 305,
// (undocumented)
UNKNOWN_BINDING = 303,
// (undocumented)
UNKNOWN_ELEMENT = 304
}

// (No @packageDocumentation comment for this package)

```
19 changes: 19 additions & 0 deletions goldens/public-api/forms/errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## API Report File for "angular-srcs"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts

// @public
export const enum RuntimeErrorCode {
// (undocumented)
MISSING_CONTROL = 1001,
// (undocumented)
MISSING_CONTROL_VALUE = 1002,
// (undocumented)
NO_CONTROLS = 1000
}

// (No @packageDocumentation comment for this package)

```
12 changes: 11 additions & 1 deletion packages/common/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test")
load("//packages/common/locales:index.bzl", "generate_base_currencies_file")
load("//tools:defaults.bzl", "api_golden_test_npm_package", "ng_module", "ng_package")
load("//tools:defaults.bzl", "api_golden_test", "api_golden_test_npm_package", "ng_module", "ng_package")

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

Expand Down Expand Up @@ -77,3 +77,13 @@ api_golden_test_npm_package(
golden_dir = "angular/goldens/public-api/common",
npm_package = "angular/packages/common/npm_package",
)

api_golden_test(
name = "common_errors",
data = [
"//goldens:public-api",
"//packages/common",
],
entry_point = "angular/packages/common/src/errors.d.ts",
golden = "angular/goldens/public-api/common/errors.md",
)
10 changes: 10 additions & 0 deletions packages/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,13 @@ api_golden_test(
entry_point = "angular/packages/core/src/render3/global_utils_api.d.ts",
golden = "angular/goldens/public-api/core/global_utils.md",
)

api_golden_test(
name = "core_errors",
data = [
"//goldens:public-api",
"//packages/core",
],
entry_point = "angular/packages/core/src/errors.d.ts",
golden = "angular/goldens/public-api/core/errors.md",
)
12 changes: 11 additions & 1 deletion packages/forms/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "api_golden_test_npm_package", "ng_module", "ng_package")
load("//tools:defaults.bzl", "api_golden_test", "api_golden_test_npm_package", "ng_module", "ng_package")

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

Expand Down Expand Up @@ -46,3 +46,13 @@ api_golden_test_npm_package(
golden_dir = "angular/goldens/public-api/forms",
npm_package = "angular/packages/forms/npm_package",
)

api_golden_test(
name = "forms_errors",
data = [
"//goldens:public-api",
"//packages/forms",
],
entry_point = "angular/packages/forms/src/errors.d.ts",
golden = "angular/goldens/public-api/forms/errors.md",
)

0 comments on commit 74037f1

Please sign in to comment.