Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular-devkit/schematics): fix issues in google #11857

Merged
merged 1 commit into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/angular/cli/models/schematic-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export abstract class SchematicCommand extends Command {
private _originalOptions: Option[];
private _engineHost: FileSystemEngineHostBase;
private _engine: Engine<FileSystemCollectionDesc, FileSystemSchematicDesc>;
private _workFlow: workflow.BaseWorkflow;
private _workflow: workflow.BaseWorkflow;
argStrategy = ArgumentStrategy.Nothing;

constructor(
Expand Down Expand Up @@ -166,7 +166,7 @@ export abstract class SchematicCommand extends Command {
/*
* Runtime hook to allow specifying customized workflow
*/
protected getWorkFlow(options: RunSchematicOptions): workflow.BaseWorkflow {
protected getWorkflow(options: RunSchematicOptions): workflow.BaseWorkflow {
const {force, dryRun} = options;
const fsHost = new virtualFs.ScopedHost(
new NodeJsSyncHost(), normalize(this.project.root));
Expand All @@ -182,12 +182,12 @@ export abstract class SchematicCommand extends Command {
);
}

private _getWorkFlow(options: RunSchematicOptions): workflow.BaseWorkflow {
if (!this._workFlow) {
this._workFlow = this.getWorkFlow(options);
private _getWorkflow(options: RunSchematicOptions): workflow.BaseWorkflow {
if (!this._workflow) {
this._workflow = this.getWorkflow(options);
}

return this._workFlow;
return this._workflow;
}

protected runSchematic(options: RunSchematicOptions) {
Expand All @@ -196,7 +196,7 @@ export abstract class SchematicCommand extends Command {
let nothingDone = true;
let loggingQueue: string[] = [];
let error = false;
const workflow = this._getWorkFlow(options);
const workflow = this._getWorkflow(options);

const workingDir = process.cwd().replace(this.project.root, '').replace(/\\/g, '/');
const pathOptions = this.setPathOptions(schematicOptions, workingDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
import { deepCopy, schema } from '@angular-devkit/core';
import { Observable, of as observableOf } from 'rxjs';
import { first, map, mergeMap } from 'rxjs/operators';
import { SchematicDescription } from '../src';
import { FileSystemCollectionDescription, FileSystemSchematicDescription } from './description';

export type SchematicDesc =
SchematicDescription<FileSystemCollectionDescription, FileSystemSchematicDescription>;

import { FileSystemSchematicDescription } from './description';

export class InvalidInputOptions<T = {}> extends schema.SchemaValidationException {
constructor(options: T, errors: schema.SchemaValidatorError[]) {
Expand All @@ -26,7 +21,7 @@ export class InvalidInputOptions<T = {}> extends schema.SchemaValidationExceptio

// This can only be used in NodeJS.
export function validateOptionsWithSchema(registry: schema.SchemaRegistry) {
return <T extends {}>(schematic: SchematicDesc, options: T): Observable<T> => {
return <T extends {}>(schematic: FileSystemSchematicDescription, options: T): Observable<T> => {
// Prevent a schematic from changing the options object by making a copy of it.
options = deepCopy(options);

Expand Down