Skip to content

Commit

Permalink
ci: move public-api goldens to goldens directory (angular#35768)
Browse files Browse the repository at this point in the history
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 angular#35768
  • Loading branch information
josephperrott authored and matsko committed Mar 11, 2020
1 parent 19cfaf7 commit 15f8afa
Show file tree
Hide file tree
Showing 62 changed files with 483 additions and 348 deletions.
5 changes: 2 additions & 3 deletions .pullapprove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,7 @@ groups:
'docs/SAVED_REPLIES.md',
'docs/TOOLS.md',
'docs/TRIAGE_AND_LABELS.md',
'goldens/*',
'modules/e2e_util/e2e_util.ts',
'modules/e2e_util/perf_util.ts',
'modules/*',
Expand All @@ -958,8 +959,6 @@ groups:
'tools/ngcontainer/**',
'tools/npm/**',
'tools/npm_integration_test/**',
'tools/public_api_guard/BUILD.bazel',
'tools/public_api_guard/public_api_guard.bzl',
'tools/pullapprove/**',
'tools/rxjs/**',
'tools/saucelabs/**',
Expand Down Expand Up @@ -994,7 +993,7 @@ groups:
conditions:
- >
contains_any_globs(files, [
'tools/public_api_guard/**',
'goldens/public-api/**',
'docs/NAMING.md',
'aio/content/guide/glossary.md',
'aio/content/guide/styleguide.md',
Expand Down
8 changes: 8 additions & 0 deletions goldens/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package(default_visibility = ["//visibility:public"])

filegroup(
name = "public-api",
srcs = glob([
"public-api/**/*.d.ts",
]),
)
11 changes: 11 additions & 0 deletions goldens/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### *`public-api/`*

This directory contains all of the public api goldens for our npm packages we publish
to NPM. These are tested on all PRs and commits as part of the our bazel tests.

To check or update the public api goldens, run one of the following commands:

```bash
yarn public-api:check
yarn public-api:update
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ export declare type AnimateTimings = {

export declare function animation(steps: AnimationMetadata | AnimationMetadata[], options?: AnimationOptions | null): AnimationReferenceMetadata;

export interface AnimationAnimateChildMetadata extends AnimationMetadata {
export declare interface AnimationAnimateChildMetadata extends AnimationMetadata {
options: AnimationOptions | null;
}

export interface AnimationAnimateMetadata extends AnimationMetadata {
export declare interface AnimationAnimateMetadata extends AnimationMetadata {
styles: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata | null;
timings: string | number | AnimateTimings;
}

export interface AnimationAnimateRefMetadata extends AnimationMetadata {
export declare interface AnimationAnimateRefMetadata extends AnimationMetadata {
animation: AnimationReferenceMetadata;
options: AnimationOptions | null;
}
Expand All @@ -32,7 +32,7 @@ export declare abstract class AnimationBuilder {
abstract build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory;
}

export interface AnimationEvent {
export declare interface AnimationEvent {
disabled: boolean;
element: any;
fromState: string;
Expand All @@ -46,16 +46,16 @@ export declare abstract class AnimationFactory {
abstract create(element: any, options?: AnimationOptions): AnimationPlayer;
}

export interface AnimationGroupMetadata extends AnimationMetadata {
export declare interface AnimationGroupMetadata extends AnimationMetadata {
options: AnimationOptions | null;
steps: AnimationMetadata[];
}

export interface AnimationKeyframesSequenceMetadata extends AnimationMetadata {
export declare interface AnimationKeyframesSequenceMetadata extends AnimationMetadata {
steps: AnimationStyleMetadata[];
}

export interface AnimationMetadata {
export declare interface AnimationMetadata {
type: AnimationMetadataType;
}

Expand All @@ -82,7 +82,7 @@ export declare interface AnimationOptions {
};
}

export interface AnimationPlayer {
export declare interface AnimationPlayer {
beforeDestroy?: () => any;
parentPlayer: AnimationPlayer | null;
readonly totalTime: number;
Expand All @@ -101,7 +101,7 @@ export interface AnimationPlayer {
setPosition(position: any /** TODO #9100 */): void;
}

export interface AnimationQueryMetadata extends AnimationMetadata {
export declare interface AnimationQueryMetadata extends AnimationMetadata {
animation: AnimationMetadata | AnimationMetadata[];
options: AnimationQueryOptions | null;
selector: string;
Expand All @@ -112,22 +112,22 @@ export declare interface AnimationQueryOptions extends AnimationOptions {
optional?: boolean;
}

export interface AnimationReferenceMetadata extends AnimationMetadata {
export declare interface AnimationReferenceMetadata extends AnimationMetadata {
animation: AnimationMetadata | AnimationMetadata[];
options: AnimationOptions | null;
}

export interface AnimationSequenceMetadata extends AnimationMetadata {
export declare interface AnimationSequenceMetadata extends AnimationMetadata {
options: AnimationOptions | null;
steps: AnimationMetadata[];
}

export interface AnimationStaggerMetadata extends AnimationMetadata {
export declare interface AnimationStaggerMetadata extends AnimationMetadata {
animation: AnimationMetadata | AnimationMetadata[];
timings: string | number;
}

export interface AnimationStateMetadata extends AnimationMetadata {
export declare interface AnimationStateMetadata extends AnimationMetadata {
name: string;
options?: {
params: {
Expand All @@ -137,7 +137,7 @@ export interface AnimationStateMetadata extends AnimationMetadata {
styles: AnimationStyleMetadata;
}

export interface AnimationStyleMetadata extends AnimationMetadata {
export declare interface AnimationStyleMetadata extends AnimationMetadata {
offset: number | null;
styles: '*' | {
[key: string]: string | number;
Expand All @@ -146,15 +146,15 @@ export interface AnimationStyleMetadata extends AnimationMetadata {
} | '*'>;
}

export interface AnimationTransitionMetadata extends AnimationMetadata {
export declare interface AnimationTransitionMetadata extends AnimationMetadata {
animation: AnimationMetadata | AnimationMetadata[];
expr: string | ((fromState: string, toState: string, element?: any, params?: {
[key: string]: any;
}) => boolean);
options: AnimationOptions | null;
}

export interface AnimationTriggerMetadata extends AnimationMetadata {
export declare interface AnimationTriggerMetadata extends AnimationMetadata {
definitions: AnimationMetadata[];
name: string;
options: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export declare class JsonPipe implements PipeTransform {
transform(value: any): string;
}

export interface KeyValue<K, V> {
export declare interface KeyValue<K, V> {
key: K;
value: V;
}
Expand Down Expand Up @@ -165,12 +165,12 @@ export declare class Location {

export declare const LOCATION_INITIALIZED: InjectionToken<Promise<any>>;

export interface LocationChangeEvent {
export declare interface LocationChangeEvent {
state: any;
type: string;
}

export interface LocationChangeListener {
export declare interface LocationChangeListener {
(event: LocationChangeEvent): any;
}

Expand Down Expand Up @@ -362,7 +362,7 @@ export declare enum Plural {
Other = 5
}

export interface PopStateEvent {
export declare interface PopStateEvent {
pop?: boolean;
state?: any;
type?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ export declare class HttpClientXsrfModule {
}): ModuleWithProviders<HttpClientXsrfModule>;
}

export interface HttpDownloadProgressEvent extends HttpProgressEvent {
export declare interface HttpDownloadProgressEvent extends HttpProgressEvent {
partialText?: string;
type: HttpEventType.DownloadProgress;
}
Expand Down Expand Up @@ -1552,11 +1552,11 @@ export declare class HttpHeaders {
set(name: string, value: string | string[]): HttpHeaders;
}

export interface HttpInterceptor {
export declare interface HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
}

export interface HttpParameterCodec {
export declare interface HttpParameterCodec {
decodeKey(key: string): string;
decodeValue(value: string): string;
encodeKey(key: string): string;
Expand All @@ -1575,7 +1575,7 @@ export declare class HttpParams {
toString(): string;
}

export interface HttpProgressEvent {
export declare interface HttpProgressEvent {
loaded: number;
total?: number;
type: HttpEventType.DownloadProgress | HttpEventType.UploadProgress;
Expand Down Expand Up @@ -1690,11 +1690,11 @@ export declare abstract class HttpResponseBase {
}, defaultStatus?: number, defaultStatusText?: string);
}

export interface HttpSentEvent {
export declare interface HttpSentEvent {
type: HttpEventType.Sent;
}

export interface HttpUploadProgressEvent extends HttpProgressEvent {
export declare interface HttpUploadProgressEvent extends HttpProgressEvent {
type: HttpEventType.UploadProgress;
}

Expand All @@ -1705,7 +1705,7 @@ export declare class HttpUrlEncodingCodec implements HttpParameterCodec {
encodeValue(value: string): string;
}

export interface HttpUserEvent<T> {
export declare interface HttpUserEvent<T> {
type: HttpEventType.User;
}

Expand All @@ -1719,7 +1719,7 @@ export declare abstract class HttpXsrfTokenExtractor {
}

export declare class JsonpClientBackend implements HttpBackend {
constructor(callbackMap: JsonpCallbackContext, document: any);
constructor(callbackMap: ɵangular_packages_common_http_http_b, document: any);
handle(req: HttpRequest<never>): Observable<HttpEvent<any>>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export declare abstract class HttpTestingController {
}): void;
}

export interface RequestMatch {
export declare interface RequestMatch {
method?: string;
url?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export declare class MockPlatformLocation implements PlatformLocation {
replaceState(state: any, title: string, newUrl: string): void;
}

export interface MockPlatformLocationConfig {
export declare interface MockPlatformLocationConfig {
appBaseHref?: string;
startUrl?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export declare class AngularJSUrlCodec implements UrlCodec {

export declare const LOCATION_UPGRADE_CONFIGURATION: InjectionToken<LocationUpgradeConfig>;

export interface LocationUpgradeConfig {
export declare interface LocationUpgradeConfig {
appBaseHref?: string;
hashPrefix?: string;
serverBaseHref?: string;
Expand Down
File renamed without changes.
Loading

0 comments on commit 15f8afa

Please sign in to comment.