mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor: remove all deep imports in language service
Removes all deep imports, which cause problems with vitest module resolution
This commit is contained in:
parent
c3d4be4a61
commit
1ca9d28ea5
38 changed files with 200 additions and 135 deletions
|
|
@ -82,14 +82,17 @@ ts_project(
|
|||
"//:node_modules/typescript",
|
||||
"//packages/compiler",
|
||||
"//packages/compiler-cli/private",
|
||||
"//packages/compiler-cli/src/ngtsc/annotations",
|
||||
"//packages/compiler-cli/src/ngtsc/core",
|
||||
"//packages/compiler-cli/src/ngtsc/core:api",
|
||||
"//packages/compiler-cli/src/ngtsc/diagnostics",
|
||||
"//packages/compiler-cli/src/ngtsc/docs",
|
||||
"//packages/compiler-cli/src/ngtsc/file_system",
|
||||
"//packages/compiler-cli/src/ngtsc/imports",
|
||||
"//packages/compiler-cli/src/ngtsc/incremental",
|
||||
"//packages/compiler-cli/src/ngtsc/indexer",
|
||||
"//packages/compiler-cli/src/ngtsc/logging",
|
||||
"//packages/compiler-cli/src/ngtsc/metadata",
|
||||
"//packages/compiler-cli/src/ngtsc/perf",
|
||||
"//packages/compiler-cli/src/ngtsc/program_driver",
|
||||
"//packages/compiler-cli/src/ngtsc/reflection",
|
||||
|
|
|
|||
|
|
@ -33,6 +33,40 @@ export {NgTscPlugin, PluginCompilerHost} from './src/ngtsc/tsc_plugin';
|
|||
export {NgtscProgram} from './src/ngtsc/program';
|
||||
export {OptimizeFor} from './src/ngtsc/typecheck/api';
|
||||
|
||||
// Explicit exports for language service
|
||||
export {getAngularDecorators} from './src/ngtsc/annotations';
|
||||
export {
|
||||
NgCompiler,
|
||||
type NgCompilerOptions,
|
||||
type CompilationTicket,
|
||||
freshCompilationTicket,
|
||||
incrementalFromCompilerTicket,
|
||||
resourceChangeTicket,
|
||||
} from './src/ngtsc/core';
|
||||
export {type NgCompilerAdapter} from './src/ngtsc/core/api';
|
||||
export {Reference} from './src/ngtsc/imports';
|
||||
export {
|
||||
type DirectiveMeta,
|
||||
type InputMapping,
|
||||
isExternalResource,
|
||||
MetaKind,
|
||||
type PipeMeta,
|
||||
type Resource,
|
||||
} from './src/ngtsc/metadata';
|
||||
export {
|
||||
type DeclarationNode,
|
||||
isNamedClassDeclaration,
|
||||
type ReflectionHost,
|
||||
type ClassDeclaration,
|
||||
} from './src/ngtsc/reflection';
|
||||
export {isFatalDiagnosticError} from './src/ngtsc/diagnostics';
|
||||
export {PerfPhase} from './src/ngtsc/perf';
|
||||
export {type FileUpdate, type ProgramDriver} from './src/ngtsc/program_driver';
|
||||
export {TrackedIncrementalBuildStrategy} from './src/ngtsc/incremental';
|
||||
export {isShim} from './src/ngtsc/shims';
|
||||
export {getRootDirs} from './src/ngtsc/util/src/typescript';
|
||||
export * from './src/ngtsc/typecheck/api';
|
||||
|
||||
// **Note**: Explicit named exports to make this file work with CJS/ESM interop without
|
||||
// needing to use a default import. NodeJS will expose named CJS exports as named ESM exports.
|
||||
// TODO(devversion): Remove these duplicate exports once devmode&prodmode is combined/ESM.
|
||||
|
|
@ -40,8 +74,14 @@ export {ConsoleLogger, Logger, LogLevel} from './src/ngtsc/logging';
|
|||
export {
|
||||
NodeJSFileSystem,
|
||||
absoluteFrom,
|
||||
FileSystem,
|
||||
AbsoluteFsPath,
|
||||
absoluteFromSourceFile,
|
||||
resolve,
|
||||
type FileStats,
|
||||
type PathSegment,
|
||||
type PathString,
|
||||
getSourceFileOrError,
|
||||
type FileSystem,
|
||||
type AbsoluteFsPath,
|
||||
NgtscCompilerHost,
|
||||
getFileSystem,
|
||||
setFileSystem,
|
||||
|
|
|
|||
|
|
@ -8,16 +8,17 @@
|
|||
|
||||
/** @fileoverview provides adapters for communicating with the ng compiler */
|
||||
|
||||
import {ConfigurationHost} from '@angular/compiler-cli';
|
||||
import {NgCompilerAdapter} from '@angular/compiler-cli/src/ngtsc/core/api';
|
||||
import {
|
||||
AbsoluteFsPath,
|
||||
ConfigurationHost,
|
||||
FileStats,
|
||||
NgCompilerAdapter,
|
||||
PathSegment,
|
||||
PathString,
|
||||
} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {isShim} from '@angular/compiler-cli/src/ngtsc/shims';
|
||||
import {getRootDirs} from '@angular/compiler-cli/src/ngtsc/util/src/typescript';
|
||||
getRootDirs,
|
||||
isShim,
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import * as p from 'path';
|
||||
import ts from 'typescript';
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import {
|
|||
TemplateSymbol,
|
||||
TemplateTypeChecker,
|
||||
TypeCheckableDirectiveMeta,
|
||||
} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
} from '@angular/compiler-cli';
|
||||
import ts from 'typescript';
|
||||
|
||||
import {DisplayInfoKind, unsafeCastDisplayInfoKindToScriptElementKind} from './utils/display_parts';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {NgCompiler} from '@angular/compiler-cli';
|
||||
import type ts from 'typescript';
|
||||
|
||||
import {TypeCheckInfo} from '../utils';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import {TmplAstBoundEvent} from '@angular/compiler';
|
||||
import {ErrorCode, ngErrorCode} from '@angular/compiler-cli/src/ngtsc/diagnostics';
|
||||
import {ErrorCode, ngErrorCode} from '@angular/compiler-cli';
|
||||
import type ts from 'typescript';
|
||||
|
||||
import {getTargetAtPosition, TargetNodeKind} from '../template_target';
|
||||
|
|
|
|||
|
|
@ -7,8 +7,13 @@
|
|||
*/
|
||||
|
||||
import {ASTWithName, TmplAstElement} from '@angular/compiler';
|
||||
import {ErrorCode as NgCompilerErrorCode, ngErrorCode} from '@angular/compiler-cli';
|
||||
import {PotentialDirective, PotentialPipe} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
import {
|
||||
ErrorCode as NgCompilerErrorCode,
|
||||
ngErrorCode,
|
||||
PotentialDirective,
|
||||
PotentialPipe,
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import type ts from 'typescript';
|
||||
|
||||
import {getTargetAtPosition, TargetNodeKind} from '../template_target';
|
||||
|
|
|
|||
|
|
@ -14,8 +14,13 @@ import {
|
|||
TmplAstTemplate,
|
||||
TmplAstTextAttribute,
|
||||
} from '@angular/compiler';
|
||||
import {ErrorCode, ngErrorCode} from '@angular/compiler-cli/src/ngtsc/diagnostics';
|
||||
import {TypeCheckableDirectiveMeta} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
import {
|
||||
ErrorCode,
|
||||
InputMapping,
|
||||
ngErrorCode,
|
||||
TypeCheckableDirectiveMeta,
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
|
||||
import {getTargetAtPosition, TargetNodeKind} from '../template_target';
|
||||
|
|
@ -168,7 +173,7 @@ function getBoundAttributes(
|
|||
if (inputs !== null) {
|
||||
boundInputs.push({
|
||||
attribute: attr,
|
||||
inputs: inputs.map((input) => ({
|
||||
inputs: inputs.map((input: InputMapping) => ({
|
||||
fieldName: input.classPropertyName,
|
||||
required: input.required,
|
||||
})),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {ErrorCode, ngErrorCode} from '@angular/compiler-cli/src/ngtsc/diagnostics';
|
||||
import {ErrorCode, ngErrorCode} from '@angular/compiler-cli';
|
||||
import tss from 'typescript';
|
||||
|
||||
import {CodeActionMeta, FixIdForCodeFixesAll} from './utils';
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {absoluteFrom} from '@angular/compiler-cli';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {NgCompiler, absoluteFrom} from '@angular/compiler-cli';
|
||||
|
||||
import type ts from 'typescript';
|
||||
|
||||
import {TypeCheckInfo} from '../utils';
|
||||
|
|
|
|||
|
|
@ -7,16 +7,17 @@
|
|||
*/
|
||||
|
||||
import {
|
||||
AbsoluteFsPath,
|
||||
CompilationTicket,
|
||||
NgCompiler,
|
||||
NgCompilerOptions,
|
||||
ProgramDriver,
|
||||
TrackedIncrementalBuildStrategy,
|
||||
freshCompilationTicket,
|
||||
incrementalFromCompilerTicket,
|
||||
NgCompiler,
|
||||
resolve,
|
||||
resourceChangeTicket,
|
||||
} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {NgCompilerOptions} from '@angular/compiler-cli/src/ngtsc/core/api';
|
||||
import {AbsoluteFsPath, resolve} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {TrackedIncrementalBuildStrategy} from '@angular/compiler-cli/src/ngtsc/incremental';
|
||||
import {ProgramDriver} from '@angular/compiler-cli/src/ngtsc/program_driver';
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import {LanguageServiceAdapter} from './adapters';
|
||||
|
||||
|
|
|
|||
|
|
@ -14,34 +14,36 @@ import {
|
|||
EmptyExpr,
|
||||
ImplicitReceiver,
|
||||
LiteralPrimitive,
|
||||
ParsedEventType,
|
||||
ParseSourceSpan,
|
||||
ParsedEventType,
|
||||
PropertyRead,
|
||||
SafePropertyRead,
|
||||
ThisReceiver,
|
||||
TmplAstBoundAttribute,
|
||||
TmplAstBoundEvent,
|
||||
TmplAstBoundEvent as BoundEvent,
|
||||
TmplAstElement,
|
||||
TmplAstLetDeclaration,
|
||||
TmplAstNode,
|
||||
TmplAstReference,
|
||||
TmplAstSwitchBlock,
|
||||
TmplAstSwitchBlock as SwitchBlock,
|
||||
TmplAstTemplate,
|
||||
TmplAstText,
|
||||
TmplAstTextAttribute,
|
||||
TmplAstTextAttribute as TextAttribute,
|
||||
TmplAstVariable,
|
||||
TmplAstLetDeclaration,
|
||||
TmplAstSwitchBlock,
|
||||
ThisReceiver,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {
|
||||
CompletionKind,
|
||||
NgCompiler,
|
||||
PotentialDirective,
|
||||
PotentialPipe,
|
||||
SymbolKind,
|
||||
TemplateDeclarationSymbol,
|
||||
TemplateTypeChecker,
|
||||
} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
|
||||
import {
|
||||
|
|
@ -1395,7 +1397,7 @@ export class CompletionBuilder<N extends TmplAstNode | AST> {
|
|||
): ts.WithMetadata<ts.CompletionInfo> | undefined {
|
||||
const pipes = this.templateTypeChecker
|
||||
.getPotentialPipes(this.component)
|
||||
.filter((p) => p.isInScope);
|
||||
.filter((p: PotentialPipe) => p.isInScope);
|
||||
if (pipes === null) {
|
||||
return undefined;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,14 @@ import {
|
|||
TmplAstTemplate,
|
||||
TmplAstTextAttribute,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {absoluteFrom} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {isExternalResource, Resource} from '@angular/compiler-cli/src/ngtsc/metadata';
|
||||
import {
|
||||
absoluteFrom,
|
||||
DirectiveSymbol,
|
||||
DomBindingSymbol,
|
||||
ElementSymbol,
|
||||
isExternalResource,
|
||||
NgCompiler,
|
||||
Resource,
|
||||
SelectorlessComponentSymbol,
|
||||
SelectorlessDirectiveSymbol,
|
||||
Symbol,
|
||||
|
|
@ -29,7 +30,8 @@ import {
|
|||
TcbLocation,
|
||||
TemplateSymbol,
|
||||
TemplateTypeChecker,
|
||||
} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
|
||||
import {convertToTemplateDocumentSpan} from './references_and_rename_utils';
|
||||
|
|
|
|||
|
|
@ -38,9 +38,8 @@ import {
|
|||
TmplAstViewportDeferredTrigger,
|
||||
tmplAstVisitAll,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {isExternalResource} from '@angular/compiler-cli/src/ngtsc/metadata';
|
||||
import {isNamedClassDeclaration} from '@angular/compiler-cli/src/ngtsc/reflection';
|
||||
import {isExternalResource, isNamedClassDeclaration, NgCompiler} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
|
||||
import {AngularSymbolKind, DocumentSymbolsOptions, TemplateDocumentSymbol} from '../api';
|
||||
|
|
|
|||
|
|
@ -17,9 +17,10 @@ import {
|
|||
LiteralArray,
|
||||
LiteralMap,
|
||||
LiteralPrimitive,
|
||||
SafeCall,
|
||||
ParsedEventType,
|
||||
PropertyRead,
|
||||
RecursiveAstVisitor,
|
||||
SafeCall,
|
||||
SpreadElement,
|
||||
TemplateLiteral,
|
||||
TmplAstBoundAttribute,
|
||||
|
|
@ -31,29 +32,29 @@ import {
|
|||
TmplAstIfBlockBranch,
|
||||
TmplAstLetDeclaration,
|
||||
TmplAstNode,
|
||||
TmplAstRecursiveVisitor,
|
||||
TmplAstReference,
|
||||
TmplAstSwitchBlock,
|
||||
TmplAstTextAttribute,
|
||||
TmplAstVariable,
|
||||
TmplAstReference,
|
||||
tmplAstVisitAll,
|
||||
RecursiveAstVisitor,
|
||||
TmplAstRecursiveVisitor,
|
||||
Unary,
|
||||
tmplAstVisitAll,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {
|
||||
SymbolKind,
|
||||
VariableSymbol,
|
||||
PipeSymbol,
|
||||
OutputBindingSymbol,
|
||||
InputBindingSymbol,
|
||||
LetDeclarationSymbol,
|
||||
ReferenceSymbol,
|
||||
DomBindingSymbol,
|
||||
ElementSymbol,
|
||||
ExpressionSymbol,
|
||||
} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
import {TemplateTypeChecker} from '@angular/compiler-cli/src/ngtsc/typecheck/api/checker';
|
||||
InputBindingSymbol,
|
||||
LetDeclarationSymbol,
|
||||
NgCompiler,
|
||||
OutputBindingSymbol,
|
||||
PipeSymbol,
|
||||
ReferenceSymbol,
|
||||
SymbolKind,
|
||||
TemplateTypeChecker,
|
||||
VariableSymbol,
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import {findFirstMatchingNode} from '@angular/compiler-cli/private/hybrid_analysis';
|
||||
import ts from 'typescript';
|
||||
|
||||
|
|
|
|||
|
|
@ -7,20 +7,23 @@
|
|||
*/
|
||||
|
||||
import {AST, TmplAstNode} from '@angular/compiler';
|
||||
import {CompilerOptions, ConfigurationHost, readConfiguration} from '@angular/compiler-cli';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {
|
||||
AbsoluteFsPath,
|
||||
absoluteFrom,
|
||||
CompilerOptions,
|
||||
ConfigurationHost,
|
||||
ErrorCode,
|
||||
FileUpdate,
|
||||
isExternalResource,
|
||||
isFatalDiagnosticError,
|
||||
isNamedClassDeclaration,
|
||||
ngErrorCode,
|
||||
} from '@angular/compiler-cli/src/ngtsc/diagnostics';
|
||||
import {absoluteFrom, AbsoluteFsPath} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {PerfPhase} from '@angular/compiler-cli/src/ngtsc/perf';
|
||||
import {FileUpdate, ProgramDriver} from '@angular/compiler-cli/src/ngtsc/program_driver';
|
||||
import {isNamedClassDeclaration} from '@angular/compiler-cli/src/ngtsc/reflection';
|
||||
import {OptimizeFor} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
import ts from 'typescript';
|
||||
|
||||
NgCompiler,
|
||||
OptimizeFor,
|
||||
PerfPhase,
|
||||
ProgramDriver,
|
||||
readConfiguration,
|
||||
} from '@angular/compiler-cli';
|
||||
import {
|
||||
AngularInlayHint,
|
||||
ApplyRefactoringProgressFn,
|
||||
|
|
@ -33,7 +36,8 @@ import {
|
|||
PluginConfig,
|
||||
} from '../api';
|
||||
|
||||
import {isExternalResource} from '@angular/compiler-cli/src/ngtsc/metadata';
|
||||
import ts from 'typescript';
|
||||
|
||||
import {LanguageServiceAdapter, LSParseConfigHost} from './adapters';
|
||||
import {ALL_CODE_FIXES_METAS, CodeFixes} from './codefixes';
|
||||
import {CompilerFactory} from './compiler_factory';
|
||||
|
|
@ -455,7 +459,7 @@ export class LanguageService {
|
|||
}
|
||||
|
||||
const classDeclarations: ts.ClassDeclaration[] = [];
|
||||
sf.forEachChild((node) => {
|
||||
sf.forEachChild((node: ts.Node) => {
|
||||
if (ts.isClassDeclaration(node)) {
|
||||
classDeclarations.push(node);
|
||||
}
|
||||
|
|
@ -691,7 +695,7 @@ export class LanguageService {
|
|||
(compiler) => {
|
||||
const components = compiler.getComponentsWithTemplateFile(fileName);
|
||||
const componentDeclarationLocations: ts.DocumentSpan[] = Array.from(
|
||||
components.values(),
|
||||
components.values() as IterableIterator<ts.ClassDeclaration>,
|
||||
).map((c) => {
|
||||
let contextSpan: ts.TextSpan | undefined = undefined;
|
||||
let textSpan: ts.TextSpan;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
import {TmplAstElement} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {NgCompiler} from '@angular/compiler-cli';
|
||||
import tss from 'typescript';
|
||||
|
||||
import {LinkedEditingRanges} from '../api';
|
||||
|
|
|
|||
|
|
@ -18,9 +18,8 @@ import {
|
|||
TmplAstSwitchBlockCase,
|
||||
tmplAstVisitAll,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {isExternalResource} from '@angular/compiler-cli/src/ngtsc/metadata';
|
||||
import {isNamedClassDeclaration} from '@angular/compiler-cli/src/ngtsc/reflection';
|
||||
import {isExternalResource, isNamedClassDeclaration, NgCompiler} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
|
||||
import {getFirstComponentForTemplateFile, isTypeScriptFile, toTextSpan} from './utils';
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ import {
|
|||
TmplAstNode,
|
||||
TmplAstTextAttribute,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {
|
||||
DirectiveSymbol,
|
||||
DomBindingSymbol,
|
||||
ElementSymbol,
|
||||
InputBindingSymbol,
|
||||
LetDeclarationSymbol,
|
||||
NgCompiler,
|
||||
OutputBindingSymbol,
|
||||
PipeSymbol,
|
||||
ReferenceSymbol,
|
||||
|
|
@ -29,7 +29,8 @@ import {
|
|||
SymbolKind,
|
||||
TcbLocation,
|
||||
VariableSymbol,
|
||||
} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
|
||||
import {DisplayInfoKind, SYMBOL_PUNC, SYMBOL_SPACE, SYMBOL_TEXT} from './utils/display_parts';
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {CompilerOptions} from '@angular/compiler-cli';
|
||||
import {getFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {CompilerOptions, NgCompiler, getFileSystem} from '@angular/compiler-cli';
|
||||
|
||||
import type ts from 'typescript';
|
||||
import {
|
||||
getMessageForClassIncompatibility,
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
import type ts from 'typescript';
|
||||
import {getAngularDecorators} from '@angular/compiler-cli/src/ngtsc/annotations';
|
||||
import {ReflectionHost} from '@angular/compiler-cli/src/ngtsc/reflection';
|
||||
import {ReflectionHost, getAngularDecorators} from '@angular/compiler-cli';
|
||||
|
||||
import {isDirectiveOrComponent} from '../../utils/decorators';
|
||||
|
||||
export function isDecoratorInputClassField(
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {CompilerOptions} from '@angular/compiler-cli';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {CompilerOptions, NgCompiler} from '@angular/compiler-cli';
|
||||
|
||||
import {MigrationConfig} from '@angular/core/schematics/migrations/signal-migration/src';
|
||||
import {ApplyRefactoringProgressFn, ApplyRefactoringResult} from '../../../api';
|
||||
import ts from 'typescript';
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {CompilerOptions} from '@angular/compiler-cli';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {CompilerOptions, NgCompiler} from '@angular/compiler-cli';
|
||||
|
||||
import {
|
||||
isInputContainerNode,
|
||||
MigrationConfig,
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {CompilerOptions} from '@angular/compiler-cli';
|
||||
import {getFileSystem} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {CompilerOptions, NgCompiler, getFileSystem} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
import {groupReplacementsByFile} from '@angular/core/schematics/utils/tsurge/helpers/group_replacements';
|
||||
import {ApplyRefactoringProgressFn, ApplyRefactoringResult} from '../../../api';
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
import type ts from 'typescript';
|
||||
import {getAngularDecorators} from '@angular/compiler-cli/src/ngtsc/annotations';
|
||||
import {ReflectionHost} from '@angular/compiler-cli/src/ngtsc/reflection';
|
||||
import {ReflectionHost, getAngularDecorators} from '@angular/compiler-cli';
|
||||
|
||||
import {isDirectiveOrComponent} from '../../utils/decorators';
|
||||
|
||||
export function isDecoratorQueryClassField(
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {CompilerOptions} from '@angular/compiler-cli';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {CompilerOptions, NgCompiler} from '@angular/compiler-cli';
|
||||
|
||||
import {MigrationConfig} from '@angular/core/schematics/migrations/signal-migration/src';
|
||||
import {ApplyRefactoringProgressFn, ApplyRefactoringResult} from '../../../api';
|
||||
import ts from 'typescript';
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {CompilerOptions} from '@angular/compiler-cli';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {CompilerOptions, NgCompiler} from '@angular/compiler-cli';
|
||||
|
||||
import {ApplyRefactoringProgressFn, ApplyRefactoringResult} from '../../../api';
|
||||
import ts from 'typescript';
|
||||
import {isTypeScriptFile} from '../../utils';
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import type ts from 'typescript';
|
||||
import {ApplyRefactoringProgressFn, ApplyRefactoringResult} from '../../api';
|
||||
import {CompilerOptions} from '@angular/compiler-cli';
|
||||
import {CompilerOptions, NgCompiler} from '@angular/compiler-cli';
|
||||
import type ts from 'typescript';
|
||||
|
||||
import {
|
||||
ConvertFieldToSignalInputBestEffortRefactoring,
|
||||
ConvertFieldToSignalInputRefactoring,
|
||||
|
|
|
|||
|
|
@ -6,11 +6,17 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
import {AST, TmplAstComponent, TmplAstNode} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {absoluteFrom} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {MetaKind, PipeMeta, DirectiveMeta} from '@angular/compiler-cli/src/ngtsc/metadata';
|
||||
import {PerfPhase} from '@angular/compiler-cli/src/ngtsc/perf';
|
||||
import {SymbolKind, TemplateTypeChecker} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
import {
|
||||
absoluteFrom,
|
||||
DirectiveMeta,
|
||||
MetaKind,
|
||||
NgCompiler,
|
||||
PerfPhase,
|
||||
PipeMeta,
|
||||
SymbolKind,
|
||||
TemplateTypeChecker,
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -14,29 +14,31 @@ import {
|
|||
SafePropertyRead,
|
||||
TmplAstBoundAttribute,
|
||||
TmplAstBoundEvent,
|
||||
TmplAstComponent,
|
||||
TmplAstDirective,
|
||||
TmplAstElement,
|
||||
TmplAstLetDeclaration,
|
||||
TmplAstNode,
|
||||
TmplAstElement,
|
||||
TmplAstRecursiveVisitor,
|
||||
TmplAstReference,
|
||||
TmplAstTextAttribute,
|
||||
TmplAstVariable,
|
||||
TmplAstComponent,
|
||||
TmplAstDirective,
|
||||
TmplAstRecursiveVisitor,
|
||||
tmplAstVisitAll,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {absoluteFrom} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {DirectiveMeta, PipeMeta} from '@angular/compiler-cli/src/ngtsc/metadata';
|
||||
import {
|
||||
absoluteFrom,
|
||||
DirectiveMeta,
|
||||
DirectiveSymbol,
|
||||
NgCompiler,
|
||||
PipeMeta,
|
||||
SelectorlessComponentSymbol,
|
||||
SelectorlessDirectiveSymbol,
|
||||
Symbol,
|
||||
SymbolKind,
|
||||
TcbLocation,
|
||||
TemplateTypeChecker,
|
||||
} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import {
|
||||
ExpressionIdentifier,
|
||||
hasExpressionIdentifier,
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ import {
|
|||
TmplAstVariable,
|
||||
TmplAstVisitor,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {PotentialDirective} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
import {NgCompiler, PotentialDirective} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
import {TypeCheckInfo} from './utils';
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@
|
|||
*/
|
||||
|
||||
import {Call, SafeCall} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {getSourceFileOrError} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {SymbolKind} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
import {NgCompiler, SymbolKind, getSourceFileOrError} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
|
||||
import {getTargetAtPosition, TargetNodeKind} from './template_target';
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ import {
|
|||
tmplAstVisitAll,
|
||||
TmplAstVisitor,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {NgCompiler} from '@angular/compiler-cli';
|
||||
import {findFirstMatchingNode} from '@angular/compiler-cli/private/hybrid_analysis';
|
||||
import tss from 'typescript';
|
||||
|
||||
|
|
|
|||
|
|
@ -8,11 +8,6 @@ ts_project(
|
|||
deps = [
|
||||
"//:node_modules/typescript",
|
||||
"//packages/compiler",
|
||||
"//packages/compiler-cli/src/ngtsc/annotations",
|
||||
"//packages/compiler-cli/src/ngtsc/core",
|
||||
"//packages/compiler-cli/src/ngtsc/file_system",
|
||||
"//packages/compiler-cli/src/ngtsc/metadata",
|
||||
"//packages/compiler-cli/src/ngtsc/reflection",
|
||||
"//packages/compiler-cli/src/ngtsc/typecheck/api",
|
||||
"//packages/compiler-cli",
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@
|
|||
*/
|
||||
|
||||
import type ts from 'typescript';
|
||||
import {ReflectionHost} from '@angular/compiler-cli/src/ngtsc/reflection';
|
||||
import {getAngularDecorators} from '@angular/compiler-cli/src/ngtsc/annotations';
|
||||
import {ReflectionHost, getAngularDecorators} from '@angular/compiler-cli';
|
||||
|
||||
export function isDirectiveOrComponent(
|
||||
node: ts.ClassDeclaration,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {isNamedClassDeclaration} from '@angular/compiler-cli/src/ngtsc/reflection';
|
||||
import {
|
||||
LetDeclarationSymbol,
|
||||
PotentialDirective,
|
||||
|
|
@ -16,7 +15,9 @@ import {
|
|||
TcbLocation,
|
||||
TemplateTypeChecker,
|
||||
VariableSymbol,
|
||||
} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
isNamedClassDeclaration,
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
|
||||
// Reverse mappings of enum would generate strings
|
||||
|
|
|
|||
|
|
@ -24,15 +24,16 @@ import {
|
|||
TmplAstTemplate,
|
||||
TmplAstTextAttribute,
|
||||
} from '@angular/compiler';
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {
|
||||
AbsoluteFsPath,
|
||||
DeclarationNode,
|
||||
DirectiveSymbol,
|
||||
isExternalResource,
|
||||
NgCompiler,
|
||||
TemplateTypeChecker,
|
||||
absoluteFrom,
|
||||
absoluteFromSourceFile,
|
||||
AbsoluteFsPath,
|
||||
} from '@angular/compiler-cli/src/ngtsc/file_system';
|
||||
import {isExternalResource} from '@angular/compiler-cli/src/ngtsc/metadata';
|
||||
import {DeclarationNode} from '@angular/compiler-cli/src/ngtsc/reflection';
|
||||
import {DirectiveSymbol, TemplateTypeChecker} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
} from '@angular/compiler-cli';
|
||||
import ts from 'typescript';
|
||||
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -5,22 +5,23 @@
|
|||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
import {NgCompiler} from '@angular/compiler-cli/src/ngtsc/core';
|
||||
import {guessIndentationInSingleLine} from './format';
|
||||
import * as path from 'path';
|
||||
import {
|
||||
ClassDeclaration,
|
||||
DirectiveModuleExportDetails,
|
||||
NgCompiler,
|
||||
PotentialDirective,
|
||||
PotentialDirectiveModuleSpecifierResolver,
|
||||
PotentialImportMode,
|
||||
PotentialPipe,
|
||||
Reference,
|
||||
SymbolReference,
|
||||
TemplateTypeChecker,
|
||||
TsCompletionEntryInfo,
|
||||
SymbolReference,
|
||||
} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
} from '@angular/compiler-cli';
|
||||
|
||||
import ts from 'typescript';
|
||||
import {guessIndentationInSingleLine} from './format';
|
||||
import * as path from 'path';
|
||||
import {ClassDeclaration} from '@angular/compiler-cli/src/ngtsc/reflection';
|
||||
import {Reference} from '@angular/compiler-cli/src/ngtsc/imports';
|
||||
|
||||
/**
|
||||
* Return the node that most tightly encompasses the specified `position`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue