From 32e230d2529e0f9d1e6c5915369f0f3efbe850c3 Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Wed, 26 Dec 2018 18:53:39 -0800 Subject: [PATCH] feat(@angular-devkit/architect): deprecate the current architect API This is done in short notice since it was always considered experimental. Most developers already know that the API is going to change. --- .../src/{architect.ts => architect-legacy.ts} | 59 ++++++++++++++++++- .../architect/src/architect_spec.ts | 2 +- .../angular_devkit/architect/src/index.ts | 6 +- 3 files changed, 61 insertions(+), 6 deletions(-) rename packages/angular_devkit/architect/src/{architect.ts => architect-legacy.ts} (95%) diff --git a/packages/angular_devkit/architect/src/architect.ts b/packages/angular_devkit/architect/src/architect-legacy.ts similarity index 95% rename from packages/angular_devkit/architect/src/architect.ts rename to packages/angular_devkit/architect/src/architect-legacy.ts index 2464f6551d94..eba23fa02ed6 100644 --- a/packages/angular_devkit/architect/src/architect.ts +++ b/packages/angular_devkit/architect/src/architect-legacy.ts @@ -24,18 +24,27 @@ import { resolve as nodeResolve } from '@angular-devkit/core/node'; import { Observable, forkJoin, of, throwError } from 'rxjs'; import { concatMap, map, tap } from 'rxjs/operators'; +/** + * @deprecated + */ export class ProjectNotFoundException extends BaseException { constructor(projectName: string) { super(`Project '${projectName}' could not be found in Workspace.`); } } +/** + * @deprecated + */ export class TargetNotFoundException extends BaseException { constructor(projectName: string, targetName: string) { super(`Target '${targetName}' could not be found in project '${projectName}'.`); } } +/** + * @deprecated + */ export class ConfigurationNotFoundException extends BaseException { constructor(projectName: string, configurationName: string) { super(`Configuration '${configurationName}' could not be found in project '${projectName}'.`); @@ -43,22 +52,34 @@ export class ConfigurationNotFoundException extends BaseException { } // TODO: break this exception apart into more granular ones. +/** + * @deprecated + */ export class BuilderCannotBeResolvedException extends BaseException { constructor(builder: string) { super(`Builder '${builder}' cannot be resolved.`); } } +/** + * @deprecated + */ export class ArchitectNotYetLoadedException extends BaseException { constructor() { super(`Architect needs to be loaded before Architect is used.`); } } +/** + * @deprecated + */ export class BuilderNotFoundException extends BaseException { constructor(builder: string) { super(`Builder ${builder} could not be found.`); } } +/** + * @deprecated + */ export interface BuilderContext { logger: logging.Logger; host: virtualFs.Host<{}>; @@ -70,37 +91,57 @@ export interface BuilderContext { // TODO: use Build Event Protocol // https://docs.bazel.build/versions/master/build-event-protocol.html // https://github.com/googleapis/googleapis/tree/master/google/devtools/build/v1 -// TODO: use unknown -// tslint:disable-next-line:no-any -export interface BuildEvent { +/** + * TODO: use unknown + * @deprecated + */ +export interface BuildEvent { // tslint:disable-line:no-any success: boolean; result?: BuildResultT; } +/** + * @deprecated + */ export interface Builder { run(builderConfig: BuilderConfiguration>): Observable; } +/** + * @deprecated + */ export interface BuilderPathsMap { builders: { [k: string]: BuilderPaths }; } +/** + * @deprecated + */ export interface BuilderPaths { class: Path; schema: Path; description: string; } +/** + * @deprecated + */ export interface BuilderDescription { name: string; schema: JsonObject; description: string; } +/** + * @deprecated + */ export interface BuilderConstructor { new(context: BuilderContext): Builder; } +/** + * @deprecated + */ export interface BuilderConfiguration { root: Path; sourceRoot?: Path; @@ -109,6 +150,9 @@ export interface BuilderConfiguration { options: OptionsT; } +/** + * @deprecated + */ export interface TargetSpecifier { project: string; target: string; @@ -116,6 +160,9 @@ export interface TargetSpecifier { overrides?: Partial; } +/** + * @deprecated + */ export interface TargetMap { [k: string]: Target; } @@ -123,12 +170,18 @@ export interface TargetMap { export declare type TargetOptions = T; export declare type TargetConfiguration = Partial; +/** + * @deprecated + */ export interface Target { builder: string; options: TargetOptions; configurations?: { [k: string]: TargetConfiguration }; } +/** + * @deprecated + */ export class Architect { private readonly _targetsSchemaPath = join(normalize(__dirname), 'targets-schema.json'); private readonly _buildersSchemaPath = join(normalize(__dirname), 'builders-schema.json'); diff --git a/packages/angular_devkit/architect/src/architect_spec.ts b/packages/angular_devkit/architect/src/architect_spec.ts index f75472f39e6f..54a36b148447 100644 --- a/packages/angular_devkit/architect/src/architect_spec.ts +++ b/packages/angular_devkit/architect/src/architect_spec.ts @@ -15,7 +15,7 @@ import { BuilderCannotBeResolvedException, ConfigurationNotFoundException, TargetNotFoundException, -} from './architect'; +} from './architect-legacy'; describe('Architect', () => { diff --git a/packages/angular_devkit/architect/src/index.ts b/packages/angular_devkit/architect/src/index.ts index c4635420df03..1041aa4e5be0 100644 --- a/packages/angular_devkit/architect/src/index.ts +++ b/packages/angular_devkit/architect/src/index.ts @@ -5,5 +5,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - -export * from './architect'; +/** + * @deprecated + */ +export * from './architect-legacy';