refactor(core): move schematic typescript logic to utility package (#29608)
PR Close #29608
This commit is contained in:
parent
5a724b34bd
commit
780081def0
|
@ -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.
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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';
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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';
|
||||||
|
|
|
@ -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. */
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
|
@ -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(
|
Loading…
Reference in New Issue