diff --git a/etc/api/angular_devkit/schematics/src/_golden-api.d.ts b/etc/api/angular_devkit/schematics/src/_golden-api.d.ts index 5fac0daf1a..5204afc755 100644 --- a/etc/api/angular_devkit/schematics/src/_golden-api.d.ts +++ b/etc/api/angular_devkit/schematics/src/_golden-api.d.ts @@ -176,7 +176,6 @@ export declare class DryRunSink extends HostSink { protected _fileDoesNotExistExceptionSet: Set; protected _subject: Subject; readonly reporter: Observable; - constructor(dir: string, force?: boolean); constructor(host: virtualFs.Host, force?: boolean); _done(): Observable; protected _fileAlreadyExistException(path: string): void; @@ -215,7 +214,6 @@ export interface EngineHost(schematic: SchematicDescription, collection: CollectionDescription): RuleFactory; hasTaskExecutor(name: string): boolean; listSchematicNames(collection: CollectionDescription): string[]; - listSchematics(collection: Collection): string[]; transformContext(context: TypedSchematicContext): TypedSchematicContext | void; transformOptions(schematic: SchematicDescription, options: OptionT, context?: TypedSchematicContext): Observable; } @@ -246,10 +244,6 @@ export interface FilePredicate { (path: Path, entry?: Readonly | null): T; } -export declare class FileSystemSink extends HostSink { - constructor(dir: string, force?: boolean); -} - export declare type FileVisitor = FilePredicate; export declare const FileVisitorCancelToken: symbol; diff --git a/etc/api/angular_devkit/schematics/tools/index.d.ts b/etc/api/angular_devkit/schematics/tools/index.d.ts index 98adfeac05..74574a2fe9 100644 --- a/etc/api/angular_devkit/schematics/tools/index.d.ts +++ b/etc/api/angular_devkit/schematics/tools/index.d.ts @@ -67,7 +67,6 @@ export declare abstract class FileSystemEngineHostBase implements FileSystemEngi getSchematicRuleFactory(schematic: FileSystemSchematicDesc, _collection: FileSystemCollectionDesc): RuleFactory; hasTaskExecutor(name: string): boolean; listSchematicNames(collection: FileSystemCollectionDesc): string[]; - listSchematics(collection: FileSystemCollection): string[]; registerContextTransform(t: ContextTransform): void; registerOptionsTransform(t: OptionTransform): void; registerTaskExecutor(factory: TaskExecutorFactory, options?: T): void; diff --git a/packages/angular_devkit/schematics/src/engine/interface.ts b/packages/angular_devkit/schematics/src/engine/interface.ts index 5664780e19..ac2d9d2409 100644 --- a/packages/angular_devkit/schematics/src/engine/interface.ts +++ b/packages/angular_devkit/schematics/src/engine/interface.ts @@ -77,10 +77,6 @@ export type SchematicDescription { createCollectionDescription(name: string): CollectionDescription; - /** - * @deprecated Use `listSchematicNames`. - */ - listSchematics(collection: Collection): string[]; listSchematicNames(collection: CollectionDescription): string[]; createSchematicDescription( diff --git a/packages/angular_devkit/schematics/src/index.ts b/packages/angular_devkit/schematics/src/index.ts index 68390c0f40..d0951eb363 100644 --- a/packages/angular_devkit/schematics/src/index.ts +++ b/packages/angular_devkit/schematics/src/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ import { FilePredicate, MergeStrategy, Tree as TreeInterface } from './tree/interface'; -import { branch, empty, merge, optimize, partition } from './tree/static'; +import { branch, empty, merge, partition } from './tree/static'; export { SchematicsException } from './exception/exception'; @@ -28,7 +28,6 @@ export * from './tree/host-tree'; export { UpdateRecorder } from './tree/interface'; export * from './engine/schematic'; export * from './sink/dryrun'; -export * from './sink/filesystem'; export * from './sink/host'; export * from './sink/sink'; @@ -58,5 +57,5 @@ export const Tree: TreeConstructor = { partition(tree: TreeInterface, predicate: FilePredicate) { return partition(tree, predicate); }, - optimize(tree: TreeInterface) { return optimize(tree); }, + optimize(tree: TreeInterface) { return tree; }, }; diff --git a/packages/angular_devkit/schematics/src/sink/dryrun.ts b/packages/angular_devkit/schematics/src/sink/dryrun.ts index 5d861e4f54..b17ddff12a 100644 --- a/packages/angular_devkit/schematics/src/sink/dryrun.ts +++ b/packages/angular_devkit/schematics/src/sink/dryrun.ts @@ -50,11 +50,6 @@ export class DryRunSink extends HostSink { readonly reporter: Observable = this._subject.asObservable(); - /** - * @deprecated Use the virtualFs.Host constructor instead. - */ - constructor(dir: string, force?: boolean); - /** * @param {host} dir The host to use to output. This should be scoped. * @param {boolean} force Whether to force overwriting files that already exist. diff --git a/packages/angular_devkit/schematics/src/sink/dryrun_spec.ts b/packages/angular_devkit/schematics/src/sink/dryrun_spec.ts index 9cc49ed55c..9f62413786 100644 --- a/packages/angular_devkit/schematics/src/sink/dryrun_spec.ts +++ b/packages/angular_devkit/schematics/src/sink/dryrun_spec.ts @@ -9,7 +9,6 @@ import { Path, normalize, virtualFs } from '@angular-devkit/core'; import { toArray } from 'rxjs/operators'; import { HostCreateTree, HostTree } from '../tree/host-tree'; -import { optimize } from '../tree/static'; import { DryRunSink } from './dryrun'; @@ -47,7 +46,7 @@ describe('DryRunSink', () => { }) .then(done, done.fail); - sink.commit(optimize(tree)) + sink.commit(tree) .toPromise().then(done, done.fail); }); @@ -78,7 +77,7 @@ describe('DryRunSink', () => { }) .then(done, done.fail); - sink.commit(optimize(tree)) + sink.commit(tree) .toPromise().then(done, done.fail); }); }); diff --git a/packages/angular_devkit/schematics/src/sink/filesystem.ts b/packages/angular_devkit/schematics/src/sink/filesystem.ts deleted file mode 100644 index 16e1d0275f..0000000000 --- a/packages/angular_devkit/schematics/src/sink/filesystem.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * 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 - */ -import { normalize, virtualFs } from '@angular-devkit/core'; -import { NodeJsSyncHost } from '@angular-devkit/core/node'; -import { HostSink } from './host'; - -/** - * @deprecated Use the new virtualFs.Host classes from @angular-devkit/core. - */ -export class FileSystemSink extends HostSink { - constructor(dir: string, force = false) { - super(new virtualFs.ScopedHost(new NodeJsSyncHost(), normalize(dir)), force); - } -} diff --git a/packages/angular_devkit/schematics/src/sink/host_spec.ts b/packages/angular_devkit/schematics/src/sink/host_spec.ts index be52dd4778..8ad2ef8c8c 100644 --- a/packages/angular_devkit/schematics/src/sink/host_spec.ts +++ b/packages/angular_devkit/schematics/src/sink/host_spec.ts @@ -9,7 +9,6 @@ import { normalize, virtualFs } from '@angular-devkit/core'; import { HostSink } from '@angular-devkit/schematics'; import { HostCreateTree, HostTree } from '../tree/host-tree'; -import { optimize } from '../tree/static'; describe('FileSystemSink', () => { @@ -34,7 +33,7 @@ describe('FileSystemSink', () => { const outputHost = new virtualFs.test.TestHost(); const sink = new HostSink(outputHost); - sink.commit(optimize(tree)) + sink.commit(tree) .toPromise() .then(() => { const tmpFiles = outputHost.files.sort(); @@ -57,7 +56,7 @@ describe('FileSystemSink', () => { const outputHost = new virtualFs.test.TestHost(); const sink = new HostSink(outputHost); - sink.commit(optimize(tree)) + sink.commit(tree) .toPromise() .then(done, done.fail); }); @@ -70,7 +69,7 @@ describe('FileSystemSink', () => { tree.rename('/file0', '/file1'); const sink = new HostSink(host); - sink.commit(optimize(tree)) + sink.commit(tree) .toPromise() .then(() => { expect(host.sync.exists(normalize('/file0'))).toBe(false); @@ -88,7 +87,7 @@ describe('FileSystemSink', () => { tree.rename('/sub/directory/file2', '/another-directory/file2'); const sink = new HostSink(host); - sink.commit(optimize(tree)) + sink.commit(tree) .toPromise() .then(() => { expect(host.sync.exists(normalize('/sub/directory/file2'))).toBe(false); @@ -106,7 +105,7 @@ describe('FileSystemSink', () => { tree.create('/file0', 'hello'); const sink = new HostSink(host); - sink.commit(optimize(tree)) + sink.commit(tree) .toPromise() .then(() => { expect(host.sync.read(normalize('/file0')).toString()).toBe('hello'); @@ -128,7 +127,7 @@ describe('FileSystemSink', () => { expect(tree.exists('/file0')).toBeTruthy(); const sink = new HostSink(host); - sink.commit(optimize(tree)) + sink.commit(tree) .toPromise() .then(() => { expect(host.sync.read(normalize('/file0')).toString()).toBe('hello'); diff --git a/packages/angular_devkit/schematics/src/tree/static.ts b/packages/angular_devkit/schematics/src/tree/static.ts index 02a45b61dd..516169abee 100644 --- a/packages/angular_devkit/schematics/src/tree/static.ts +++ b/packages/angular_devkit/schematics/src/tree/static.ts @@ -34,8 +34,3 @@ export function partition(tree: Tree, predicate: FilePredicate): [Tree, throw new SchematicsException('Tree type is not supported.'); } } - -/** @deprecated Tree's are automically optimized */ -export function optimize(tree: Tree) { - return tree; -} diff --git a/packages/angular_devkit/schematics/src/workflow/base.ts b/packages/angular_devkit/schematics/src/workflow/base.ts index 8e2e151986..14b9aee9dd 100644 --- a/packages/angular_devkit/schematics/src/workflow/base.ts +++ b/packages/angular_devkit/schematics/src/workflow/base.ts @@ -16,7 +16,6 @@ import { HostSink } from '../sink/host'; import { Sink } from '../sink/sink'; import { HostTree } from '../tree/host-tree'; import { Tree } from '../tree/interface'; -import { optimize } from '../tree/static'; import { LifeCycleEvent, RequiredWorkflowExecutionContext, @@ -165,7 +164,6 @@ export abstract class BaseWorkflow implements Workflow { of(new HostTree(this._host)), { logger: context.logger }, ).pipe( - map(tree => optimize(tree)), concatMap((tree: Tree) => { // Process all sinks. return concat( diff --git a/packages/angular_devkit/schematics/tools/fallback-engine-host.ts b/packages/angular_devkit/schematics/tools/fallback-engine-host.ts index c8e8d3a374..a0044090a8 100644 --- a/packages/angular_devkit/schematics/tools/fallback-engine-host.ts +++ b/packages/angular_devkit/schematics/tools/fallback-engine-host.ts @@ -109,15 +109,6 @@ export class FallbackEngineHost implements EngineHost<{}, {}> { return result; } - /** - * @deprecated Use `listSchematicNames`. - */ - listSchematics( - collection: Collection, - ): string[] { - return this.listSchematicNames(collection.description); - } - listSchematicNames(collection: CollectionDescription): string[] { const allNames = new Set(); this._hosts.forEach(host => { diff --git a/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts b/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts index 8c5e560fb6..915d36fbc4 100644 --- a/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts +++ b/packages/angular_devkit/schematics/tools/file-system-engine-host-base.ts @@ -124,12 +124,6 @@ export abstract class FileSystemEngineHostBase implements FileSystemEngineHost { private _contextTransforms: ContextTransform[] = []; private _taskFactories = new Map Observable>(); - /** - * @deprecated Use `listSchematicNames`. - */ - listSchematics(collection: FileSystemCollection): string[] { - return this.listSchematicNames(collection.description); - } listSchematicNames(collection: FileSystemCollectionDesc) { const schematics: string[] = []; for (const key of Object.keys(collection.schematics)) {