refactor(core): move schematic typescript logic to utility package (#29608)

PR Close #29608
This commit is contained in:
Paul Gschwendtner 2019-03-28 11:24:02 +01:00 committed by Jason Aden
parent 5a724b34bd
commit 780081def0
15 changed files with 10 additions and 20 deletions

View File

@ -7,13 +7,11 @@
*/ */
import * as ts from 'typescript'; import * as ts from 'typescript';
import {hasPropertyNameText} from '../../../utils/typescript/property_name';
import {hasPropertyNameText} from '../typescript/property_name';
import {DeclarationUsageVisitor} from './declaration_usage_visitor'; import {DeclarationUsageVisitor} from './declaration_usage_visitor';
import {ClassMetadataMap} from './ng_query_visitor'; import {ClassMetadataMap} from './ng_query_visitor';
import {NgQueryDefinition, QueryTiming, QueryType} from './query-definition'; import {NgQueryDefinition, QueryTiming, QueryType} from './query-definition';
/** /**
* Object that maps a given type of query to a list of lifecycle hooks that * Object that maps a given type of query to a list of lifecycle hooks that
* could be used to access such a query statically. * could be used to access such a query statically.

View File

@ -7,7 +7,7 @@
*/ */
import * as ts from 'typescript'; import * as ts from 'typescript';
import {isFunctionLikeDeclaration, unwrapExpression} from '../typescript/functions'; import {isFunctionLikeDeclaration, unwrapExpression} from '../../../utils/typescript/functions';
/** /**
* Class that can be used to determine if a given TypeScript node is used within * Class that can be used to determine if a given TypeScript node is used within

View File

@ -7,9 +7,8 @@
*/ */
import * as ts from 'typescript'; import * as ts from 'typescript';
import {getAngularDecorators} from '../../../utils/ng_decorators';
import {getPropertyNameText, hasPropertyNameText} from '../typescript/property_name'; import {getPropertyNameText, hasPropertyNameText} from '../../../utils/typescript/property_name';
import {getAngularDecorators} from './decorators';
/** Analyzes the given class and resolves the name of all inputs which are declared. */ /** Analyzes the given class and resolves the name of all inputs which are declared. */
export function getInputNamesOfClass( export function getInputNamesOfClass(

View File

@ -7,10 +7,8 @@
*/ */
import * as ts from 'typescript'; import * as ts from 'typescript';
import {getAngularDecorators} from '../../../utils/ng_decorators';
import {findParentClassDeclaration, getBaseTypeIdentifiers} from '../typescript/class_declaration'; import {findParentClassDeclaration, getBaseTypeIdentifiers} from '../../../utils/typescript/class_declaration';
import {getAngularDecorators} from './decorators';
import {getInputNamesOfClass} from './directive_inputs'; import {getInputNamesOfClass} from './directive_inputs';
import {NgQueryDefinition, QueryType} from './query-definition'; import {NgQueryDefinition, QueryType} from './query-definition';

View File

@ -7,8 +7,7 @@
*/ */
import * as ts from 'typescript'; import * as ts from 'typescript';
import {NgDecorator} from './decorators'; import {NgDecorator} from '../../../utils/ng_decorators';
/** Timing of a given query. Either static or dynamic. */ /** Timing of a given query. Either static or dynamic. */
export enum QueryTiming { export enum QueryTiming {

View File

@ -8,7 +8,6 @@
import {Replacement, RuleFailure, Rules} from 'tslint'; import {Replacement, RuleFailure, Rules} from 'tslint';
import * as ts from 'typescript'; import * as ts from 'typescript';
import {analyzeNgQueryUsage} from '../angular/analyze_query_usage'; import {analyzeNgQueryUsage} from '../angular/analyze_query_usage';
import {NgQueryResolveVisitor} from '../angular/ng_query_visitor'; import {NgQueryResolveVisitor} from '../angular/ng_query_visitor';
import {QueryTiming} from '../angular/query-definition'; import {QueryTiming} from '../angular/query-definition';

View File

@ -11,11 +11,11 @@ import {dirname, relative} from 'path';
import * as ts from 'typescript'; import * as ts from 'typescript';
import {getProjectTsConfigPaths} from '../../utils/project_tsconfig_paths'; import {getProjectTsConfigPaths} from '../../utils/project_tsconfig_paths';
import {parseTsconfigFile} from '../../utils/typescript/parse_tsconfig';
import {analyzeNgQueryUsage} from './angular/analyze_query_usage'; import {analyzeNgQueryUsage} from './angular/analyze_query_usage';
import {NgQueryResolveVisitor} from './angular/ng_query_visitor'; import {NgQueryResolveVisitor} from './angular/ng_query_visitor';
import {getTransformedQueryCallExpr} from './transform'; import {getTransformedQueryCallExpr} from './transform';
import {parseTsconfigFile} from './typescript/tsconfig';
/** Entry point for the V8 static-query migration. */ /** Entry point for the V8 static-query migration. */

View File

@ -7,10 +7,8 @@
*/ */
import * as ts from 'typescript'; import * as ts from 'typescript';
import {getPropertyNameText} from '../../utils/typescript/property_name';
import {NgQueryDefinition, QueryTiming} from './angular/query-definition'; import {NgQueryDefinition, QueryTiming} from './angular/query-definition';
import {getPropertyNameText} from './typescript/property_name';
/** /**
* Transforms the given query decorator by explicitly specifying the timing based on the * Transforms the given query decorator by explicitly specifying the timing based on the

View File

@ -7,7 +7,7 @@
*/ */
import * as ts from 'typescript'; import * as ts from 'typescript';
import {getCallDecoratorImport} from '../typescript/decorators'; import {getCallDecoratorImport} from './typescript/decorators';
export interface NgDecorator { export interface NgDecorator {
name: string; name: string;

View File

@ -7,7 +7,6 @@
*/ */
import * as ts from 'typescript'; import * as ts from 'typescript';
import {Import, getImportOfIdentifier} from './imports'; import {Import, getImportOfIdentifier} from './imports';
export function getCallDecoratorImport( export function getCallDecoratorImport(