Skip to content

Commit 6885074

Browse files
committed
build: update public API golden infra and move to goldens/
* Moves the public API goldens to `goldens/` * Switches us to the `npm_package` variant of the golden testing rule. This variant is more future proof and will work well with the `rules_js` migration (as it takes arbitrary Bazel tree artifacts)
1 parent 8c35b62 commit 6885074

File tree

122 files changed

+372
-488
lines changed

Some content is hidden

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

122 files changed

+372
-488
lines changed

.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=-2023857461
5-
package.json=-1367474012
6-
pnpm-lock.yaml=-811131462
5+
package.json=1204886269
6+
pnpm-lock.yaml=1975546108
77
pnpm-workspace.yaml=1711114604
8-
yarn.lock=-1654078010
8+
yarn.lock=824621907

.bazelrc

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ build:remote --google_default_credentials=true
9191

9292
# Setup the toolchain and platform for the remote build execution. The platform
9393
# is provided by the shared dev-infra package and targets k8 remote containers.
94-
build:remote --extra_execution_platforms=@npm//@angular/build-tooling/bazel/remote-execution:platform_with_network
95-
build:remote --host_platform=@npm//@angular/build-tooling/bazel/remote-execution:platform_with_network
96-
build:remote --platforms=@npm//@angular/build-tooling/bazel/remote-execution:platform_with_network
94+
build:remote --extra_execution_platforms=@devinfra//bazel/remote-execution:platform_with_network
95+
build:remote --host_platform=@devinfra//bazel/remote-execution:platform_with_network
96+
build:remote --platforms=@devinfra//bazel/remote-execution:platform_with_network
9797

9898
################################
9999
# Sandbox settings #

.github/CODEOWNERS

-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@
1313
/.github/ISSUE_TEMPLATE/** @angular/components-googlers
1414

1515
/tools/ @angular/dev-infra-components
16-
/tools/public_api_guard/**/*.md @angular/components-googlers

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- name: Install node modules
6565
run: yarn install --frozen-lockfile
6666
- name: Check API Goldens
67-
run: yarn bazel test tools/public_api_guard/...
67+
run: yarn bazel test goldens/...
6868
- uses: ./.github/actions/slack
6969
if: failure()
7070
with:

.github/workflows/pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Install node modules
6666
run: yarn install --frozen-lockfile
6767
- name: Check API Goldens
68-
run: yarn bazel test tools/public_api_guard/...
68+
run: yarn bazel test goldens/...
6969

7070
e2e:
7171
runs-on: ubuntu-latest

DEV_ENVIRONMENT.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ packages locally and test them by either of the following ways:
6666
### Approving public API changes
6767
If you're making changes to a public API, they need to be propagated to our public API golden files.
6868
To save the changes you can run `yarn approve-api <target>` and to review the changes, you can look
69-
at the file under `tools/public_api_guard/<target>.d.ts`.
69+
at the file under `goldens/<package>/<entry-point>.api.md`.
7070

7171

7272
### Disabling Git hooks
@@ -86,7 +86,7 @@ export HUSKY=0
8686

8787
A set of environment variables is made available within the dev-app. Such variables
8888
will be injected into the dev-app, so that e.g. API keys can be used for development
89-
without requiring secrets to be committed.
89+
without requiring secrets to be committed.
9090

9191
The following variables are currently used in the dev-app:
9292

WORKSPACE

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
204204

205205
git_repository(
206206
name = "devinfra",
207-
commit = "47572aba6019f368057c00966ac7ce354b1d65bc",
207+
commit = "cc73dde52b557f831cc3b6e48daf8c3b542a33df",
208208
remote = "https://github.com/angular/dev-infra.git",
209209
)
210210

@@ -218,7 +218,7 @@ setup_dependencies_2()
218218

219219
git_repository(
220220
name = "rules_angular",
221-
commit = "b1e419e5f6b5e897c07260780cfef2b0aac128fb",
221+
commit = "e10bf488aca18c159399f4c1163324a40f45a5dc",
222222
remote = "https://github.com/devversion/rules_angular.git",
223223
)
224224

goldens/BUILD.bazel

+34
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,38 @@
1+
load("@devinfra//bazel/api-golden:index.bzl", "api_golden_test_npm_package")
2+
13
exports_files([
24
"size-test.yaml",
35
"tsec-exemption.json",
46
])
7+
8+
api_golden_test_npm_package(
9+
name = "cdk_api",
10+
data = glob(["cdk/**"]) + [
11+
"//src/cdk:npm_package",
12+
],
13+
golden_dir = "angular_material/goldens/cdk",
14+
npm_package = "angular_material/src/cdk/npm_package",
15+
)
16+
17+
api_golden_test_npm_package(
18+
name = "material_api",
19+
data = glob(["material/**"]) + ["//src/material:npm_package"],
20+
golden_dir = "angular_material/goldens/material",
21+
npm_package = "angular_material/src/material/npm_package",
22+
)
23+
24+
api_golden_test_npm_package(
25+
name = "google_maps_api",
26+
data = glob(["google-maps/**"]) + ["//src/google-maps:npm_package"],
27+
golden_dir = "angular_material/goldens/google-maps",
28+
npm_package = "angular_material/src/google-maps/npm_package",
29+
types = ["@npm//@types/google.maps"],
30+
)
31+
32+
api_golden_test_npm_package(
33+
name = "youtube_player_api",
34+
data = glob(["youtube-player/**"]) + ["//src/youtube-player:npm_package"],
35+
golden_dir = "angular_material/goldens/youtube-player",
36+
npm_package = "angular_material/src/youtube-player/npm_package",
37+
types = ["@npm//@types/youtube"],
38+
)

tools/public_api_guard/cdk/a11y.md renamed to goldens/cdk/a11y/index.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_a11y"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
@@ -30,7 +30,7 @@ export class A11yModule {
3030
// (undocumented)
3131
static ɵinj: i0.ɵɵInjectorDeclaration<A11yModule>;
3232
// (undocumented)
33-
static ɵmod: i0.ɵɵNgModuleDeclaration<A11yModule, never, [typeof i1.ObserversModule, typeof i2.CdkAriaLive, typeof i3.CdkTrapFocus, typeof i4.CdkMonitorFocus], [typeof i2.CdkAriaLive, typeof i3.CdkTrapFocus, typeof i4.CdkMonitorFocus]>;
33+
static ɵmod: i0.ɵɵNgModuleDeclaration<A11yModule, never, [typeof ObserversModule, typeof CdkAriaLive, typeof CdkTrapFocus, typeof CdkMonitorFocus], [typeof CdkAriaLive, typeof CdkTrapFocus, typeof CdkMonitorFocus]>;
3434
}
3535

3636
// @public (undocumented)

tools/public_api_guard/cdk/accordion.md renamed to goldens/cdk/accordion/index.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_accordion"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
@@ -74,7 +74,7 @@ export class CdkAccordionModule {
7474
// (undocumented)
7575
static ɵinj: i0.ɵɵInjectorDeclaration<CdkAccordionModule>;
7676
// (undocumented)
77-
static ɵmod: i0.ɵɵNgModuleDeclaration<CdkAccordionModule, never, [typeof i1.CdkAccordion, typeof i2.CdkAccordionItem], [typeof i1.CdkAccordion, typeof i2.CdkAccordionItem]>;
77+
static ɵmod: i0.ɵɵNgModuleDeclaration<CdkAccordionModule, never, [typeof CdkAccordion, typeof CdkAccordionItem], [typeof CdkAccordion, typeof CdkAccordionItem]>;
7878
}
7979

8080
// (No @packageDocumentation comment for this package)

tools/public_api_guard/cdk/bidi.md renamed to goldens/cdk/bidi/index.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_bidi"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
@@ -17,7 +17,7 @@ export class BidiModule {
1717
// (undocumented)
1818
static ɵinj: i0.ɵɵInjectorDeclaration<BidiModule>;
1919
// (undocumented)
20-
static ɵmod: i0.ɵɵNgModuleDeclaration<BidiModule, never, [typeof i1.Dir], [typeof i1.Dir]>;
20+
static ɵmod: i0.ɵɵNgModuleDeclaration<BidiModule, never, [typeof Dir], [typeof Dir]>;
2121
}
2222

2323
// @public

tools/public_api_guard/cdk/clipboard.md renamed to goldens/cdk/clipboard/index.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_clipboard"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
@@ -51,7 +51,7 @@ export class ClipboardModule {
5151
// (undocumented)
5252
static ɵinj: i0.ɵɵInjectorDeclaration<ClipboardModule>;
5353
// (undocumented)
54-
static ɵmod: i0.ɵɵNgModuleDeclaration<ClipboardModule, never, [typeof i1.CdkCopyToClipboard], [typeof i1.CdkCopyToClipboard]>;
54+
static ɵmod: i0.ɵɵNgModuleDeclaration<ClipboardModule, never, [typeof CdkCopyToClipboard], [typeof CdkCopyToClipboard]>;
5555
}
5656

5757
// @public

tools/public_api_guard/cdk/coercion.md renamed to goldens/cdk/coercion/index.api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_coercion"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## API Report File for "@angular/cdk_coercion_private"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
import { Observable } from 'rxjs';
8+
9+
// @public
10+
export function coerceObservable<T>(data: T | Observable<T>): Observable<T>;
11+
12+
// (No @packageDocumentation comment for this package)
13+
14+
```

tools/public_api_guard/cdk/collections.md renamed to goldens/cdk/collections/index.api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_collections"
22

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

tools/public_api_guard/cdk/dialog.md renamed to goldens/cdk/dialog/index.api.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_dialog"
22

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

77
import { AfterContentInit } from '@angular/core';
88
import { AfterViewInit } from '@angular/core';
9-
import { BasePortalOutlet as BasePortalOutlet_2 } from '@angular/cdk/portal';
9+
import * as _angular_cdk_portal from '@angular/cdk/portal';
1010
import { ChangeDetectorRef } from '@angular/core';
1111
import { ComponentRef } from '@angular/core';
1212
import { DoCheck } from '@angular/core';
@@ -77,7 +77,7 @@ export class CdkDialogContainer<C extends DialogConfig = DialogConfig> extends B
7777
}
7878

7979
// @public
80-
export const DEFAULT_DIALOG_CONFIG: InjectionToken<DialogConfig<unknown, unknown, BasePortalOutlet_2>>;
80+
export const DEFAULT_DIALOG_CONFIG: InjectionToken<DialogConfig<unknown, unknown, _angular_cdk_portal.BasePortalOutlet>>;
8181

8282
// @public (undocumented)
8383
export class Dialog implements OnDestroy {
@@ -154,7 +154,7 @@ export class DialogModule {
154154
// (undocumented)
155155
static ɵinj: i0.ɵɵInjectorDeclaration<DialogModule>;
156156
// (undocumented)
157-
static ɵmod: i0.ɵɵNgModuleDeclaration<DialogModule, never, [typeof i1.OverlayModule, typeof i2.PortalModule, typeof i3_3.A11yModule, typeof i4_4.CdkDialogContainer], [typeof i2.PortalModule, typeof i4_4.CdkDialogContainer]>;
157+
static ɵmod: i0.ɵɵNgModuleDeclaration<DialogModule, never, [typeof OverlayModule, typeof PortalModule, typeof A11yModule, typeof CdkDialogContainer], [typeof PortalModule, typeof CdkDialogContainer]>;
158158
}
159159

160160
// @public

tools/public_api_guard/cdk/drag-drop.md renamed to goldens/cdk/drag-drop/index.api.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_drag-drop"
22

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

7-
import { AfterContentInit } from '@angular/core';
87
import { AfterViewInit } from '@angular/core';
9-
import { DoCheck } from '@angular/core';
108
import { ElementRef } from '@angular/core';
119
import { EventEmitter } from '@angular/core';
1210
import * as i0 from '@angular/core';
1311
import { InjectionToken } from '@angular/core';
14-
import { NgIterable } from '@angular/core';
1512
import { NgZone } from '@angular/core';
1613
import { Observable } from 'rxjs';
1714
import { OnChanges } from '@angular/core';
@@ -22,7 +19,6 @@ import { SimpleChanges } from '@angular/core';
2219
import { Subject } from 'rxjs';
2320
import { Subscription } from 'rxjs';
2421
import { TemplateRef } from '@angular/core';
25-
import { TrackByFunction } from '@angular/core';
2622
import { ViewContainerRef } from '@angular/core';
2723

2824
// @public
@@ -350,7 +346,7 @@ export class DragDropModule {
350346
// (undocumented)
351347
static ɵinj: i0.ɵɵInjectorDeclaration<DragDropModule>;
352348
// (undocumented)
353-
static ɵmod: i0.ɵɵNgModuleDeclaration<DragDropModule, never, [typeof i1.CdkDropList, typeof i2.CdkDropListGroup, typeof i3.CdkDrag, typeof i4.CdkDragHandle, typeof i5.CdkDragPreview, typeof i6.CdkDragPlaceholder], [typeof i7.CdkScrollableModule, typeof i1.CdkDropList, typeof i2.CdkDropListGroup, typeof i3.CdkDrag, typeof i4.CdkDragHandle, typeof i5.CdkDragPreview, typeof i6.CdkDragPlaceholder]>;
349+
static ɵmod: i0.ɵɵNgModuleDeclaration<DragDropModule, never, [typeof CdkDropList, typeof CdkDropListGroup, typeof CdkDrag, typeof CdkDragHandle, typeof CdkDragPreview, typeof CdkDragPlaceholder], [typeof CdkScrollableModule, typeof CdkDropList, typeof CdkDropListGroup, typeof CdkDrag, typeof CdkDragHandle, typeof CdkDragPreview, typeof CdkDragPlaceholder]>;
354350
}
355351

356352
// @public

tools/public_api_guard/cdk/cdk.md renamed to goldens/cdk/index.api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk"
22

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

tools/public_api_guard/cdk/keycodes.md renamed to goldens/cdk/keycodes/index.api.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_keycodes"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
@@ -175,7 +175,7 @@ export const LEFT_ARROW = 37;
175175
// @public (undocumented)
176176
export const M = 77;
177177

178-
// @public
178+
// @public (undocumented)
179179
export const MAC_ENTER = 3;
180180

181181
// @public (undocumented)
@@ -190,7 +190,7 @@ export const MAC_WK_CMD_RIGHT = 93;
190190
// @public (undocumented)
191191
export const META = 91;
192192

193-
// @public
193+
// @public (undocumented)
194194
export type ModifierKey = 'altKey' | 'shiftKey' | 'ctrlKey' | 'metaKey';
195195

196196
// @public (undocumented)

tools/public_api_guard/cdk/layout.md renamed to goldens/cdk/layout/index.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_layout"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
@@ -20,7 +20,7 @@ export class BreakpointObserver implements OnDestroy {
2020
static ɵprov: i0.ɵɵInjectableDeclaration<BreakpointObserver>;
2121
}
2222

23-
// @public
23+
// @public (undocumented)
2424
export const Breakpoints: {
2525
XSmall: string;
2626
Small: string;

tools/public_api_guard/cdk/listbox.md renamed to goldens/cdk/listbox/index.api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_listbox"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
@@ -97,7 +97,7 @@ export class CdkListboxModule {
9797
// (undocumented)
9898
static ɵinj: i0.ɵɵInjectorDeclaration<CdkListboxModule>;
9999
// (undocumented)
100-
static ɵmod: i0.ɵɵNgModuleDeclaration<CdkListboxModule, never, [typeof i1.CdkListbox, typeof i1.CdkOption], [typeof i1.CdkListbox, typeof i1.CdkOption]>;
100+
static ɵmod: i0.ɵɵNgModuleDeclaration<CdkListboxModule, never, [typeof CdkListbox, typeof CdkOption], [typeof CdkListbox, typeof CdkOption]>;
101101
}
102102

103103
// @public

tools/public_api_guard/cdk/menu.md renamed to goldens/cdk/menu/index.api.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_menu"
22

33
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
44
@@ -24,6 +24,7 @@ import { OnInit } from '@angular/core';
2424
import { Optional } from '@angular/core';
2525
import { QueryList } from '@angular/core';
2626
import { Renderer2 } from '@angular/core';
27+
import * as rxjs from 'rxjs';
2728
import { Signal } from '@angular/core';
2829
import { SimpleChanges } from '@angular/core';
2930
import { Subject } from 'rxjs';
@@ -202,7 +203,7 @@ export class CdkMenuModule {
202203
// (undocumented)
203204
static ɵinj: i0.ɵɵInjectorDeclaration<CdkMenuModule>;
204205
// (undocumented)
205-
static ɵmod: i0.ɵɵNgModuleDeclaration<CdkMenuModule, never, [typeof i1.OverlayModule, typeof i2_2.CdkMenuBar, typeof i3_3.CdkMenu, typeof i4_3.CdkMenuItem, typeof i5_2.CdkMenuItemRadio, typeof i6_2.CdkMenuItemCheckbox, typeof i7_2.CdkMenuTrigger, typeof i8.CdkMenuGroup, typeof i9.CdkContextMenuTrigger, typeof i10.CdkTargetMenuAim], [typeof i2_2.CdkMenuBar, typeof i3_3.CdkMenu, typeof i4_3.CdkMenuItem, typeof i5_2.CdkMenuItemRadio, typeof i6_2.CdkMenuItemCheckbox, typeof i7_2.CdkMenuTrigger, typeof i8.CdkMenuGroup, typeof i9.CdkContextMenuTrigger, typeof i10.CdkTargetMenuAim]>;
206+
static ɵmod: i0.ɵɵNgModuleDeclaration<CdkMenuModule, never, [typeof OverlayModule, typeof CdkMenuBar, typeof CdkMenu, typeof CdkMenuItem, typeof CdkMenuItemRadio, typeof CdkMenuItemCheckbox, typeof CdkMenuTrigger, typeof CdkMenuGroup, typeof CdkContextMenuTrigger, typeof CdkTargetMenuAim], [typeof CdkMenuBar, typeof CdkMenu, typeof CdkMenuItem, typeof CdkMenuItemRadio, typeof CdkMenuItemCheckbox, typeof CdkMenuTrigger, typeof CdkMenuGroup, typeof CdkContextMenuTrigger, typeof CdkTargetMenuAim]>;
206207
}
207208

208209
// @public
@@ -244,7 +245,7 @@ export abstract class CdkMenuTriggerBase implements OnDestroy {
244245
readonly opened: EventEmitter<void>;
245246
protected overlayRef: OverlayRef | null;
246247
registerChildMenu(child: Menu): void;
247-
protected readonly stopOutsideClicksListener: Observable<void>;
248+
protected readonly stopOutsideClicksListener: rxjs.Observable<void>;
248249
protected readonly viewContainerRef: ViewContainerRef;
249250
// (undocumented)
250251
static ɵdir: i0.ɵɵDirectiveDeclaration<CdkMenuTriggerBase, never, never, {}, {}, never, never, true, never>;

tools/public_api_guard/cdk/observers.md renamed to goldens/cdk/observers/index.api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## API Report File for "components-srcs"
1+
## API Report File for "@angular/cdk_observers"
22

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

0 commit comments

Comments
 (0)