@angular/core 18.1.0-next.1 → 18.1.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/core.mjs +1 -1
- package/esm2022/src/event_emitter.mjs +20 -11
- package/esm2022/src/pending_tasks.mjs +15 -20
- package/esm2022/src/render3/after_render_hooks.mjs +67 -132
- package/esm2022/src/render3/component_ref.mjs +1 -1
- package/esm2022/src/render3/instructions/change_detection.mjs +27 -24
- package/esm2022/src/render3/reactive_lview_consumer.mjs +56 -3
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +344 -349
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/index.d.ts +212 -28
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/after-render-phase/bundle.js +602 -0
- package/schematics/migrations/after-render-phase/bundle.js.map +7 -0
- package/schematics/migrations/http-providers/bundle.js +15 -15
- package/schematics/migrations/invalid-two-way-bindings/bundle.js +158 -158
- package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +1 -1
- package/schematics/migrations.json +5 -0
- package/schematics/ng-generate/control-flow-migration/bundle.js +166 -166
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +1 -1
- package/schematics/ng-generate/standalone-migration/bundle.js +483 -1096
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../packages/core/schematics/migrations/after-render-phase/index.ts", "../../../../../../../../packages/core/schematics/utils/project_tsconfig_paths.ts", "../../../../../../../../packages/core/schematics/utils/typescript/compiler_host.ts", "../../../../../../../../packages/core/schematics/utils/typescript/parse_tsconfig.ts", "../../../../../../../../packages/core/schematics/migrations/after-render-phase/migration.ts", "../../../../../../../../packages/core/schematics/utils/change_tracker.ts", "../../../../../../../../packages/core/schematics/utils/import_manager.ts", "../../../../../../../../packages/core/schematics/utils/typescript/imports.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Rule, SchematicsException, Tree, UpdateRecorder} from '@angular-devkit/schematics';\nimport {relative} from 'path';\nimport {getProjectTsConfigPaths} from '../../utils/project_tsconfig_paths';\nimport {canMigrateFile, createMigrationProgram} from '../../utils/typescript/compiler_host';\nimport {migrateFile} from './migration';\n\nexport default function (): Rule {\n return async (tree: Tree) => {\n const {buildPaths, testPaths} = await getProjectTsConfigPaths(tree);\n const basePath = process.cwd();\n const allPaths = [...buildPaths, ...testPaths];\n\n if (!allPaths.length) {\n throw new SchematicsException(\n 'Could not find any tsconfig file. Cannot run the afterRender phase migration.',\n );\n }\n\n for (const tsconfigPath of allPaths) {\n runMigration(tree, tsconfigPath, basePath);\n }\n };\n}\n\nfunction runMigration(tree: Tree, tsconfigPath: string, basePath: string) {\n const program = createMigrationProgram(tree, tsconfigPath, basePath);\n const sourceFiles = program\n .getSourceFiles()\n .filter((sourceFile) => canMigrateFile(basePath, sourceFile, program));\n\n for (const sourceFile of sourceFiles) {\n let update: UpdateRecorder | null = null;\n\n const rewriter = (startPos: number, width: number, text: string | null) => {\n if (update === null) {\n // Lazily initialize update, because most files will not require migration.\n update = tree.beginUpdate(relative(basePath, sourceFile.fileName));\n }\n update.remove(startPos, width);\n if (text !== null) {\n update.insertLeft(startPos, text);\n }\n };\n migrateFile(sourceFile, program.getTypeChecker(), rewriter);\n\n if (update !== null) {\n tree.commitUpdate(update);\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {json, normalize, virtualFs, workspaces} from '@angular-devkit/core';\nimport {Tree} from '@angular-devkit/schematics';\n\n/**\n * Gets all tsconfig paths from a CLI project by reading the workspace configuration\n * and looking for common tsconfig locations.\n */\nexport async function getProjectTsConfigPaths(\n tree: Tree,\n): Promise<{buildPaths: string[]; testPaths: string[]}> {\n // Start with some tsconfig paths that are generally used within CLI projects. Note\n // that we are not interested in IDE-specific tsconfig files (e.g. /tsconfig.json)\n const buildPaths = new Set<string>();\n const testPaths = new Set<string>();\n\n const workspace = await getWorkspace(tree);\n for (const [, project] of workspace.projects) {\n for (const [name, target] of project.targets) {\n if (name !== 'build' && name !== 'test') {\n continue;\n }\n\n for (const [, options] of allTargetOptions(target)) {\n const tsConfig = options['tsConfig'];\n // Filter out tsconfig files that don't exist in the CLI project.\n if (typeof tsConfig !== 'string' || !tree.exists(tsConfig)) {\n continue;\n }\n\n if (name === 'build') {\n buildPaths.add(normalize(tsConfig));\n } else {\n testPaths.add(normalize(tsConfig));\n }\n }\n }\n }\n\n return {\n buildPaths: [...buildPaths],\n testPaths: [...testPaths],\n };\n}\n\n/** Get options for all configurations for the passed builder target. */\nfunction* allTargetOptions(\n target: workspaces.TargetDefinition,\n): Iterable<[string | undefined, Record<string, json.JsonValue | undefined>]> {\n if (target.options) {\n yield [undefined, target.options];\n }\n\n if (!target.configurations) {\n return;\n }\n\n for (const [name, options] of Object.entries(target.configurations)) {\n if (options) {\n yield [name, options];\n }\n }\n}\n\nfunction createHost(tree: Tree): workspaces.WorkspaceHost {\n return {\n async readFile(path: string): Promise<string> {\n const data = tree.read(path);\n if (!data) {\n throw new Error('File not found.');\n }\n\n return virtualFs.fileBufferToString(data);\n },\n async writeFile(path: string, data: string): Promise<void> {\n return tree.overwrite(path, data);\n },\n async isDirectory(path: string): Promise<boolean> {\n // Approximate a directory check.\n // We don't need to consider empty directories and hence this is a good enough approach.\n // This is also per documentation, see:\n // https://angular.dev/tools/cli/schematics-for-libraries#get-the-project-configuration\n return !tree.exists(path) && tree.getDir(path).subfiles.length > 0;\n },\n async isFile(path: string): Promise<boolean> {\n return tree.exists(path);\n },\n };\n}\n\nasync function getWorkspace(tree: Tree): Promise<workspaces.WorkspaceDefinition> {\n const host = createHost(tree);\n const {workspace} = await workspaces.readWorkspace('/', host);\n\n return workspace;\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Tree} from '@angular-devkit/schematics';\nimport {dirname, relative, resolve} from 'path';\nimport ts from 'typescript';\n\nimport {parseTsconfigFile} from './parse_tsconfig';\n\ntype FakeReadFileFn = (fileName: string) => string | undefined;\n\n/**\n * Creates a TypeScript program instance for a TypeScript project within\n * the virtual file system tree.\n * @param tree Virtual file system tree that contains the source files.\n * @param tsconfigPath Virtual file system path that resolves to the TypeScript project.\n * @param basePath Base path for the virtual file system tree.\n * @param fakeFileRead Optional file reader function. Can be used to overwrite files in\n * the TypeScript program, or to add in-memory files (e.g. to add global types).\n * @param additionalFiles Additional file paths that should be added to the program.\n */\nexport function createMigrationProgram(\n tree: Tree,\n tsconfigPath: string,\n basePath: string,\n fakeFileRead?: FakeReadFileFn,\n additionalFiles?: string[],\n) {\n const {rootNames, options, host} = createProgramOptions(\n tree,\n tsconfigPath,\n basePath,\n fakeFileRead,\n additionalFiles,\n );\n return ts.createProgram(rootNames, options, host);\n}\n\n/**\n * Creates the options necessary to instantiate a TypeScript program.\n * @param tree Virtual file system tree that contains the source files.\n * @param tsconfigPath Virtual file system path that resolves to the TypeScript project.\n * @param basePath Base path for the virtual file system tree.\n * @param fakeFileRead Optional file reader function. Can be used to overwrite files in\n * the TypeScript program, or to add in-memory files (e.g. to add global types).\n * @param additionalFiles Additional file paths that should be added to the program.\n * @param optionOverrides Overrides of the parsed compiler options.\n */\nexport function createProgramOptions(\n tree: Tree,\n tsconfigPath: string,\n basePath: string,\n fakeFileRead?: FakeReadFileFn,\n additionalFiles?: string[],\n optionOverrides?: ts.CompilerOptions,\n) {\n // Resolve the tsconfig path to an absolute path. This is needed as TypeScript otherwise\n // is not able to resolve root directories in the given tsconfig. More details can be found\n // in the following issue: https://github.com/microsoft/TypeScript/issues/37731.\n tsconfigPath = resolve(basePath, tsconfigPath);\n const parsed = parseTsconfigFile(tsconfigPath, dirname(tsconfigPath));\n const options = optionOverrides ? {...parsed.options, ...optionOverrides} : parsed.options;\n const host = createMigrationCompilerHost(tree, options, basePath, fakeFileRead);\n return {rootNames: parsed.fileNames.concat(additionalFiles || []), options, host};\n}\n\nfunction createMigrationCompilerHost(\n tree: Tree,\n options: ts.CompilerOptions,\n basePath: string,\n fakeRead?: FakeReadFileFn,\n): ts.CompilerHost {\n const host = ts.createCompilerHost(options, true);\n const defaultReadFile = host.readFile;\n\n // We need to overwrite the host \"readFile\" method, as we want the TypeScript\n // program to be based on the file contents in the virtual file tree. Otherwise\n // if we run multiple migrations we might have intersecting changes and\n // source files.\n host.readFile = (fileName) => {\n const treeRelativePath = relative(basePath, fileName);\n let result: string | undefined = fakeRead?.(treeRelativePath);\n\n if (typeof result !== 'string') {\n // If the relative path resolved to somewhere outside of the tree, fall back to\n // TypeScript's default file reading function since the `tree` will throw an error.\n result = treeRelativePath.startsWith('..')\n ? defaultReadFile.call(host, fileName)\n : tree.read(treeRelativePath)?.toString();\n }\n\n // Strip BOM as otherwise TSC methods (Ex: getWidth) will return an offset,\n // which breaks the CLI UpdateRecorder.\n // See: https://github.com/angular/angular/pull/30719\n return typeof result === 'string' ? result.replace(/^\\uFEFF/, '') : undefined;\n };\n\n return host;\n}\n\n/**\n * Checks whether a file can be migrate by our automated migrations.\n * @param basePath Absolute path to the project.\n * @param sourceFile File being checked.\n * @param program Program that includes the source file.\n */\nexport function canMigrateFile(\n basePath: string,\n sourceFile: ts.SourceFile,\n program: ts.Program,\n): boolean {\n // We shouldn't migrate .d.ts files, files from an external library or type checking files.\n if (\n sourceFile.fileName.endsWith('.ngtypecheck.ts') ||\n sourceFile.isDeclarationFile ||\n program.isSourceFileFromExternalLibrary(sourceFile)\n ) {\n return false;\n }\n\n // Our migrations are set up to create a `Program` from the project's tsconfig and to migrate all\n // the files within the program. This can include files that are outside of the Angular CLI\n // project. We can't migrate files outside of the project, because our file system interactions\n // go through the CLI's `Tree` which assumes that all files are within the project. See:\n // https://github.com/angular/angular-cli/blob/0b0961c9c233a825b6e4bb59ab7f0790f9b14676/packages/angular_devkit/schematics/src/tree/host-tree.ts#L131\n return !relative(basePath, sourceFile.fileName).startsWith('..');\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport * as path from 'path';\nimport ts from 'typescript';\n\nexport function parseTsconfigFile(tsconfigPath: string, basePath: string): ts.ParsedCommandLine {\n const {config} = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n const parseConfigHost = {\n useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,\n fileExists: ts.sys.fileExists,\n readDirectory: ts.sys.readDirectory,\n readFile: ts.sys.readFile,\n };\n\n // Throw if incorrect arguments are passed to this function. Passing relative base paths\n // results in root directories not being resolved and in later type checking runtime errors.\n // More details can be found here: https://github.com/microsoft/TypeScript/issues/37731.\n if (!path.isAbsolute(basePath)) {\n throw Error('Unexpected relative base path has been specified.');\n }\n\n return ts.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport ts from 'typescript';\nimport {ChangeTracker} from '../../utils/change_tracker';\nimport {getImportOfIdentifier, getImportSpecifier} from '../../utils/typescript/imports';\n\nconst CORE = '@angular/core';\nconst AFTER_RENDER_PHASE_ENUM = 'AfterRenderPhase';\nconst AFTER_RENDER_FNS = new Set(['afterRender', 'afterNextRender']);\n\ntype RewriteFn = (startPos: number, width: number, text: string) => void;\n\nexport function migrateFile(\n sourceFile: ts.SourceFile,\n typeChecker: ts.TypeChecker,\n rewriteFn: RewriteFn,\n) {\n const changeTracker = new ChangeTracker(ts.createPrinter());\n const phaseEnum = getImportSpecifier(sourceFile, CORE, AFTER_RENDER_PHASE_ENUM);\n\n // Check if there are any imports of the `AfterRenderPhase` enum.\n if (phaseEnum) {\n // Remove the `AfterRenderPhase` enum import.\n changeTracker.removeNode(phaseEnum);\n ts.forEachChild(sourceFile, function visit(node: ts.Node) {\n ts.forEachChild(node, visit);\n\n // Check if this is a function call of `afterRender` or `afterNextRender`.\n if (\n ts.isCallExpression(node) &&\n ts.isIdentifier(node.expression) &&\n AFTER_RENDER_FNS.has(getImportOfIdentifier(typeChecker, node.expression)?.name || '')\n ) {\n let phase: string | undefined;\n const [callback, options] = node.arguments;\n // Check if any `AfterRenderOptions` options were specified.\n if (ts.isObjectLiteralExpression(options)) {\n const phaseProp = options.properties.find((p) => p.name?.getText() === 'phase');\n // Check if the `phase` options is set.\n if (\n phaseProp &&\n ts.isPropertyAssignment(phaseProp) &&\n ts.isPropertyAccessExpression(phaseProp.initializer) &&\n phaseProp.initializer.expression.getText() === AFTER_RENDER_PHASE_ENUM\n ) {\n phaseProp.initializer.expression;\n phase = phaseProp.initializer.name.getText();\n // Remove the `phase` option.\n if (options.properties.length === 1) {\n changeTracker.removeNode(options);\n } else {\n const newOptions = ts.factory.createObjectLiteralExpression(\n options.properties.filter((p) => p !== phaseProp),\n );\n changeTracker.replaceNode(options, newOptions);\n }\n }\n }\n // If we found a phase, update the callback.\n if (phase) {\n phase = phase.substring(0, 1).toLocaleLowerCase() + phase.substring(1);\n const spec = ts.factory.createObjectLiteralExpression([\n ts.factory.createPropertyAssignment(ts.factory.createIdentifier(phase), callback),\n ]);\n changeTracker.replaceNode(callback, spec);\n }\n }\n });\n }\n\n // Write the changes.\n for (const changesInFile of changeTracker.recordChanges().values()) {\n for (const change of changesInFile) {\n rewriteFn(change.start, change.removeLength ?? 0, change.text);\n }\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport ts from 'typescript';\n\nimport {ImportManager} from './import_manager';\n\n/** Function that can be used to remap a generated import. */\nexport type ImportRemapper = (moduleName: string, inFile: string) => string;\n\n/** Mapping between a source file and the changes that have to be applied to it. */\nexport type ChangesByFile = ReadonlyMap<ts.SourceFile, PendingChange[]>;\n\n/** Change that needs to be applied to a file. */\nexport interface PendingChange {\n /** Index at which to start changing the file. */\n start: number;\n /**\n * Amount of text that should be removed after the `start`.\n * No text will be removed if omitted.\n */\n removeLength?: number;\n /** New text that should be inserted. */\n text: string;\n}\n\n/** Tracks changes that have to be made for specific files. */\nexport class ChangeTracker {\n private readonly _changes = new Map<ts.SourceFile, PendingChange[]>();\n private readonly _importManager: ImportManager;\n\n constructor(\n private _printer: ts.Printer,\n private _importRemapper?: ImportRemapper,\n ) {\n this._importManager = new ImportManager(\n (currentFile) => ({\n addNewImport: (start, text) => this.insertText(currentFile, start, text),\n updateExistingImport: (namedBindings, text) =>\n this.replaceText(currentFile, namedBindings.getStart(), namedBindings.getWidth(), text),\n }),\n this._printer,\n );\n }\n\n /**\n * Tracks the insertion of some text.\n * @param sourceFile File in which the text is being inserted.\n * @param start Index at which the text is insert.\n * @param text Text to be inserted.\n */\n insertText(sourceFile: ts.SourceFile, index: number, text: string): void {\n this._trackChange(sourceFile, {start: index, text});\n }\n\n /**\n * Replaces text within a file.\n * @param sourceFile File in which to replace the text.\n * @param start Index from which to replace the text.\n * @param removeLength Length of the text being replaced.\n * @param text Text to be inserted instead of the old one.\n */\n replaceText(sourceFile: ts.SourceFile, start: number, removeLength: number, text: string): void {\n this._trackChange(sourceFile, {start, removeLength, text});\n }\n\n /**\n * Replaces the text of an AST node with a new one.\n * @param oldNode Node to be replaced.\n * @param newNode New node to be inserted.\n * @param emitHint Hint when formatting the text of the new node.\n * @param sourceFileWhenPrinting File to use when printing out the new node. This is important\n * when copying nodes from one file to another, because TypeScript might not output literal nodes\n * without it.\n */\n replaceNode(\n oldNode: ts.Node,\n newNode: ts.Node,\n emitHint = ts.EmitHint.Unspecified,\n sourceFileWhenPrinting?: ts.SourceFile,\n ): void {\n const sourceFile = oldNode.getSourceFile();\n this.replaceText(\n sourceFile,\n oldNode.getStart(),\n oldNode.getWidth(),\n this._printer.printNode(emitHint, newNode, sourceFileWhenPrinting || sourceFile),\n );\n }\n\n /**\n * Removes the text of an AST node from a file.\n * @param node Node whose text should be removed.\n */\n removeNode(node: ts.Node): void {\n this._trackChange(node.getSourceFile(), {\n start: node.getStart(),\n removeLength: node.getWidth(),\n text: '',\n });\n }\n\n /**\n * Adds an import to a file.\n * @param sourceFile File to which to add the import.\n * @param symbolName Symbol being imported.\n * @param moduleName Module from which the symbol is imported.\n * @param alias Alias to use for the import.\n * @param keepSymbolName Whether to keep the symbol name in the import.\n */\n addImport(\n sourceFile: ts.SourceFile,\n symbolName: string,\n moduleName: string,\n alias: string | null = null,\n keepSymbolName = false,\n ): ts.Expression {\n if (this._importRemapper) {\n moduleName = this._importRemapper(moduleName, sourceFile.fileName);\n }\n\n // It's common for paths to be manipulated with Node's `path` utilties which\n // can yield a path with back slashes. Normalize them since outputting such\n // paths will also cause TS to escape the forward slashes.\n moduleName = normalizePath(moduleName);\n\n return this._importManager.addImportToSourceFile(\n sourceFile,\n symbolName,\n moduleName,\n alias,\n false,\n keepSymbolName,\n );\n }\n\n /**\n * Gets the changes that should be applied to all the files in the migration.\n * The changes are sorted in the order in which they should be applied.\n */\n recordChanges(): ChangesByFile {\n this._importManager.recordChanges();\n return this._changes;\n }\n\n /**\n * Clear the tracked changes\n */\n clearChanges(): void {\n this._changes.clear();\n }\n\n /**\n * Adds a change to a `ChangesByFile` map.\n * @param file File that the change is associated with.\n * @param change Change to be added.\n */\n private _trackChange(file: ts.SourceFile, change: PendingChange): void {\n const changes = this._changes.get(file);\n\n if (changes) {\n // Insert the changes in reverse so that they're applied in reverse order.\n // This ensures that the offsets of subsequent changes aren't affected by\n // previous changes changing the file's text.\n const insertIndex = changes.findIndex((current) => current.start <= change.start);\n\n if (insertIndex === -1) {\n changes.push(change);\n } else {\n changes.splice(insertIndex, 0, change);\n }\n } else {\n this._changes.set(file, [change]);\n }\n }\n}\n\n/** Normalizes a path to use posix separators. */\nexport function normalizePath(path: string): string {\n return path.replace(/\\\\/g, '/');\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {dirname, resolve} from 'path';\nimport ts from 'typescript';\n\n/** Update recorder for managing imports. */\nexport interface ImportManagerUpdateRecorder {\n addNewImport(start: number, importText: string): void;\n updateExistingImport(namedBindings: ts.NamedImports, newNamedBindings: string): void;\n}\n\n/** Possible types of quotes for imports. */\nconst enum QuoteStyle {\n Single,\n Double,\n}\n\n/**\n * Import manager that can be used to add TypeScript imports to given source\n * files. The manager ensures that multiple transformations are applied properly\n * without shifted offsets and that similar existing import declarations are re-used.\n */\nexport class ImportManager {\n /** Map of import declarations that need to be updated to include the given symbols. */\n private updatedImports = new Map<\n ts.ImportDeclaration,\n {propertyName?: ts.Identifier; importName: ts.Identifier}[]\n >();\n /** Map of source-files and their previously used identifier names. */\n private usedIdentifierNames = new Map<ts.SourceFile, string[]>();\n /** Map of source files and the new imports that have to be added to them. */\n private newImports: Map<\n ts.SourceFile,\n {\n importStartIndex: number;\n defaultImports: Map<string, ts.Identifier>;\n namedImports: Map<string, ts.ImportSpecifier[]>;\n }\n > = new Map();\n /** Map between a file and the implied quote style for imports. */\n private quoteStyles: Record<string, QuoteStyle> = {};\n\n /**\n * Array of previously resolved symbol imports. Cache can be re-used to return\n * the same identifier without checking the source-file again.\n */\n private importCache: {\n sourceFile: ts.SourceFile;\n symbolName: string | null;\n alias: string | null;\n moduleName: string;\n identifier: ts.Identifier;\n }[] = [];\n\n constructor(\n private getUpdateRecorder: (sf: ts.SourceFile) => ImportManagerUpdateRecorder,\n private printer: ts.Printer,\n ) {}\n\n /**\n * Adds an import to the given source-file and returns the TypeScript\n * identifier that can be used to access the newly imported symbol.\n */\n addImportToSourceFile(\n sourceFile: ts.SourceFile,\n symbolName: string | null,\n moduleName: string,\n alias: string | null = null,\n typeImport = false,\n keepSymbolName = false,\n ): ts.Expression {\n const sourceDir = dirname(sourceFile.fileName);\n let importStartIndex = 0;\n let existingImport: ts.ImportDeclaration | null = null;\n\n // In case the given import has been already generated previously, we just return\n // the previous generated identifier in order to avoid duplicate generated imports.\n const cachedImport = this.importCache.find(\n (c) =>\n c.sourceFile === sourceFile &&\n c.symbolName === symbolName &&\n c.moduleName === moduleName &&\n c.alias === alias,\n );\n if (cachedImport) {\n return cachedImport.identifier;\n }\n\n // Walk through all source-file top-level statements and search for import declarations\n // that already match the specified \"moduleName\" and can be updated to import the\n // given symbol. If no matching import can be found, the last import in the source-file\n // will be used as starting point for a new import that will be generated.\n for (let i = sourceFile.statements.length - 1; i >= 0; i--) {\n const statement = sourceFile.statements[i];\n\n if (\n !ts.isImportDeclaration(statement) ||\n !ts.isStringLiteral(statement.moduleSpecifier) ||\n !statement.importClause\n ) {\n continue;\n }\n\n if (importStartIndex === 0) {\n importStartIndex = this._getEndPositionOfNode(statement);\n }\n\n const moduleSpecifier = statement.moduleSpecifier.text;\n\n if (\n (moduleSpecifier.startsWith('.') &&\n resolve(sourceDir, moduleSpecifier) !== resolve(sourceDir, moduleName)) ||\n moduleSpecifier !== moduleName\n ) {\n continue;\n }\n\n if (statement.importClause.namedBindings) {\n const namedBindings = statement.importClause.namedBindings;\n\n // In case a \"Type\" symbol is imported, we can't use namespace imports\n // because these only export symbols available at runtime (no types)\n if (ts.isNamespaceImport(namedBindings) && !typeImport) {\n return ts.factory.createPropertyAccessExpression(\n ts.factory.createIdentifier(namedBindings.name.text),\n ts.factory.createIdentifier(alias || symbolName || 'default'),\n );\n } else if (ts.isNamedImports(namedBindings) && symbolName) {\n const existingElement = namedBindings.elements.find((e) => {\n // TODO(crisbeto): if an alias conflicts with an existing import, it may cause invalid\n // code to be generated. This is unlikely, but we may want to revisit it in the future.\n if (alias) {\n return e.propertyName && e.name.text === alias && e.propertyName.text === symbolName;\n }\n return e.propertyName ? e.propertyName.text === symbolName : e.name.text === symbolName;\n });\n\n if (existingElement) {\n return ts.factory.createIdentifier(existingElement.name.text);\n }\n\n // In case the symbol could not be found in an existing import, we\n // keep track of the import declaration as it can be updated to include\n // the specified symbol name without having to create a new import.\n existingImport = statement;\n }\n } else if (statement.importClause.name && !symbolName) {\n return ts.factory.createIdentifier(statement.importClause.name.text);\n }\n }\n\n if (existingImport) {\n const {propertyName, name} = this._getImportParts(\n sourceFile,\n symbolName!,\n alias,\n keepSymbolName,\n );\n\n // Since it can happen that multiple classes need to be imported within the\n // specified source file and we want to add the identifiers to the existing\n // import declaration, we need to keep track of the updated import declarations.\n // We can't directly update the import declaration for each identifier as this\n // would throw off the recorder offsets. We need to keep track of the new identifiers\n // for the import and perform the import transformation as batches per source-file.\n this.updatedImports.set(\n existingImport,\n (this.updatedImports.get(existingImport) || []).concat({propertyName, importName: name}),\n );\n\n // Keep track of all updated imports so that we don't generate duplicate\n // similar imports as these can't be statically analyzed in the source-file yet.\n this.importCache.push({sourceFile, moduleName, symbolName, alias, identifier: name});\n\n return name;\n }\n\n let identifier: ts.Identifier | null = null;\n\n if (!this.newImports.has(sourceFile)) {\n this.newImports.set(sourceFile, {\n importStartIndex,\n defaultImports: new Map(),\n namedImports: new Map(),\n });\n }\n\n if (symbolName) {\n const {propertyName, name} = this._getImportParts(\n sourceFile,\n symbolName,\n alias,\n keepSymbolName,\n );\n const importMap = this.newImports.get(sourceFile)!.namedImports;\n identifier = name;\n\n if (!importMap.has(moduleName)) {\n importMap.set(moduleName, []);\n }\n\n importMap.get(moduleName)!.push(ts.factory.createImportSpecifier(false, propertyName, name));\n } else {\n const importMap = this.newImports.get(sourceFile)!.defaultImports;\n identifier = this._getUniqueIdentifier(sourceFile, 'defaultExport');\n importMap.set(moduleName, identifier);\n }\n\n // Keep track of all generated imports so that we don't generate duplicate\n // similar imports as these can't be statically analyzed in the source-file yet.\n this.importCache.push({sourceFile, symbolName, moduleName, alias, identifier});\n\n return identifier;\n }\n\n /**\n * Stores the collected import changes within the appropriate update recorders. The\n * updated imports can only be updated *once* per source-file because previous updates\n * could otherwise shift the source-file offsets.\n */\n recordChanges() {\n this.updatedImports.forEach((expressions, importDecl) => {\n const sourceFile = importDecl.getSourceFile();\n const recorder = this.getUpdateRecorder(sourceFile);\n const namedBindings = importDecl.importClause!.namedBindings as ts.NamedImports;\n const newNamedBindings = ts.factory.updateNamedImports(\n namedBindings,\n namedBindings.elements.concat(\n expressions.map(({propertyName, importName}) =>\n ts.factory.createImportSpecifier(false, propertyName, importName),\n ),\n ),\n );\n\n const newNamedBindingsText = this.printer.printNode(\n ts.EmitHint.Unspecified,\n newNamedBindings,\n sourceFile,\n );\n recorder.updateExistingImport(namedBindings, newNamedBindingsText);\n });\n\n this.newImports.forEach(({importStartIndex, defaultImports, namedImports}, sourceFile) => {\n const recorder = this.getUpdateRecorder(sourceFile);\n const useSingleQuotes = this._getQuoteStyle(sourceFile) === QuoteStyle.Single;\n\n defaultImports.forEach((identifier, moduleName) => {\n const newImport = ts.factory.createImportDeclaration(\n undefined,\n ts.factory.createImportClause(false, identifier, undefined),\n ts.factory.createStringLiteral(moduleName, useSingleQuotes),\n );\n\n recorder.addNewImport(\n importStartIndex,\n this._getNewImportText(importStartIndex, newImport, sourceFile),\n );\n });\n\n namedImports.forEach((specifiers, moduleName) => {\n const newImport = ts.factory.createImportDeclaration(\n undefined,\n ts.factory.createImportClause(\n false,\n undefined,\n ts.factory.createNamedImports(specifiers),\n ),\n ts.factory.createStringLiteral(moduleName, useSingleQuotes),\n );\n\n recorder.addNewImport(\n importStartIndex,\n this._getNewImportText(importStartIndex, newImport, sourceFile),\n );\n });\n });\n }\n\n /** Gets an unique identifier with a base name for the given source file. */\n private _getUniqueIdentifier(sourceFile: ts.SourceFile, baseName: string): ts.Identifier {\n if (this.isUniqueIdentifierName(sourceFile, baseName)) {\n this._recordUsedIdentifier(sourceFile, baseName);\n return ts.factory.createIdentifier(baseName);\n }\n\n let name = null;\n let counter = 1;\n do {\n name = `${baseName}_${counter++}`;\n } while (!this.isUniqueIdentifierName(sourceFile, name));\n\n this._recordUsedIdentifier(sourceFile, name!);\n return ts.factory.createIdentifier(name!);\n }\n\n /**\n * Checks whether the specified identifier name is used within the given\n * source file.\n */\n private isUniqueIdentifierName(sourceFile: ts.SourceFile, name: string) {\n if (\n this.usedIdentifierNames.has(sourceFile) &&\n this.usedIdentifierNames.get(sourceFile)!.indexOf(name) !== -1\n ) {\n return false;\n }\n\n // Walk through the source file and search for an identifier matching\n // the given name. In that case, it's not guaranteed that this name\n // is unique in the given declaration scope and we just return false.\n const nodeQueue: ts.Node[] = [sourceFile];\n while (nodeQueue.length) {\n const node = nodeQueue.shift()!;\n if (\n ts.isIdentifier(node) &&\n node.text === name &&\n // Identifiers that are aliased in an import aren't\n // problematic since they're used under a different name.\n (!ts.isImportSpecifier(node.parent) || node.parent.propertyName !== node)\n ) {\n return false;\n }\n nodeQueue.push(...node.getChildren());\n }\n return true;\n }\n\n private _recordUsedIdentifier(sourceFile: ts.SourceFile, identifierName: string) {\n this.usedIdentifierNames.set(\n sourceFile,\n (this.usedIdentifierNames.get(sourceFile) || []).concat(identifierName),\n );\n }\n\n /**\n * Determines the full end of a given node. By default the end position of a node is\n * before all trailing comments. This could mean that generated imports shift comments.\n */\n private _getEndPositionOfNode(node: ts.Node) {\n const nodeEndPos = node.getEnd();\n const commentRanges = ts.getTrailingCommentRanges(node.getSourceFile().text, nodeEndPos);\n if (!commentRanges || !commentRanges.length) {\n return nodeEndPos;\n }\n return commentRanges[commentRanges.length - 1]!.end;\n }\n\n /** Gets the text that should be added to the file for a newly-created import declaration. */\n private _getNewImportText(\n importStartIndex: number,\n newImport: ts.ImportDeclaration,\n sourceFile: ts.SourceFile,\n ): string {\n const text = this.printer.printNode(ts.EmitHint.Unspecified, newImport, sourceFile);\n\n // If the import is generated at the start of the source file, we want to add\n // a new-line after the import. Otherwise if the import is generated after an\n // existing import, we need to prepend a new-line so that the import is not on\n // the same line as the existing import anchor\n return importStartIndex === 0 ? `${text}\\n` : `\\n${text}`;\n }\n\n /**\n * Gets the different parts necessary to construct an import specifier.\n * @param sourceFile File in which the import is being inserted.\n * @param symbolName Name of the symbol.\n * @param alias Alias that the symbol may be available under.\n * @returns Object containing the different parts. E.g. `{name: 'alias', propertyName: 'name'}`\n * would correspond to `import {name as alias}` while `{name: 'name', propertyName: undefined}`\n * corresponds to `import {name}`.\n */\n private _getImportParts(\n sourceFile: ts.SourceFile,\n symbolName: string,\n alias: string | null,\n keepSymbolName: boolean,\n ) {\n const symbolIdentifier = ts.factory.createIdentifier(symbolName);\n const aliasIdentifier = alias ? ts.factory.createIdentifier(alias) : null;\n const generatedUniqueIdentifier = this._getUniqueIdentifier(sourceFile, alias || symbolName);\n const needsGeneratedUniqueName = generatedUniqueIdentifier.text !== (alias || symbolName);\n let propertyName: ts.Identifier | undefined;\n let name: ts.Identifier;\n\n if (needsGeneratedUniqueName && !keepSymbolName) {\n propertyName = symbolIdentifier;\n name = generatedUniqueIdentifier;\n } else if (aliasIdentifier) {\n propertyName = symbolIdentifier;\n name = aliasIdentifier;\n } else {\n name = symbolIdentifier;\n }\n\n return {propertyName, name};\n }\n\n /** Gets the quote style that is used for a file's imports. */\n private _getQuoteStyle(sourceFile: ts.SourceFile): QuoteStyle {\n if (!this.quoteStyles.hasOwnProperty(sourceFile.fileName)) {\n let quoteStyle: QuoteStyle | undefined;\n\n // Walk through the top-level imports and try to infer the quotes.\n for (const statement of sourceFile.statements) {\n if (\n ts.isImportDeclaration(statement) &&\n ts.isStringLiteralLike(statement.moduleSpecifier)\n ) {\n // Use `getText` instead of the actual text since it includes the quotes.\n quoteStyle = statement.moduleSpecifier.getText().trim().startsWith('\"')\n ? QuoteStyle.Double\n : QuoteStyle.Single;\n break;\n }\n }\n\n // Otherwise fall back to single quotes.\n this.quoteStyles[sourceFile.fileName] = quoteStyle ?? QuoteStyle.Single;\n }\n\n return this.quoteStyles[sourceFile.fileName];\n }\n}\n", "/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport ts from 'typescript';\n\nexport type Import = {\n name: string;\n importModule: string;\n node: ts.ImportDeclaration;\n};\n\n/** Gets import information about the specified identifier by using the Type checker. */\nexport function getImportOfIdentifier(\n typeChecker: ts.TypeChecker,\n node: ts.Identifier,\n): Import | null {\n const symbol = typeChecker.getSymbolAtLocation(node);\n\n if (!symbol || symbol.declarations === undefined || !symbol.declarations.length) {\n return null;\n }\n\n const decl = symbol.declarations[0];\n\n if (!ts.isImportSpecifier(decl)) {\n return null;\n }\n\n const importDecl = decl.parent.parent.parent;\n\n if (!ts.isImportDeclaration(importDecl) || !ts.isStringLiteral(importDecl.moduleSpecifier)) {\n return null;\n }\n\n return {\n // Handles aliased imports: e.g. \"import {Component as myComp} from ...\";\n name: decl.propertyName ? decl.propertyName.text : decl.name.text,\n importModule: importDecl.moduleSpecifier.text,\n node: importDecl,\n };\n}\n\n/**\n * Gets a top-level import specifier with a specific name that is imported from a particular module.\n * E.g. given a file that looks like:\n *\n * ```\n * import { Component, Directive } from '@angular/core';\n * import { Foo } from './foo';\n * ```\n *\n * Calling `getImportSpecifier(sourceFile, '@angular/core', 'Directive')` will yield the node\n * referring to `Directive` in the top import.\n *\n * @param sourceFile File in which to look for imports.\n * @param moduleName Name of the import's module.\n * @param specifierName Original name of the specifier to look for. Aliases will be resolved to\n * their original name.\n */\nexport function getImportSpecifier(\n sourceFile: ts.SourceFile,\n moduleName: string | RegExp,\n specifierName: string,\n): ts.ImportSpecifier | null {\n return getImportSpecifiers(sourceFile, moduleName, [specifierName])[0] ?? null;\n}\n\nexport function getImportSpecifiers(\n sourceFile: ts.SourceFile,\n moduleName: string | RegExp,\n specifierNames: string[],\n): ts.ImportSpecifier[] {\n const matches: ts.ImportSpecifier[] = [];\n for (const node of sourceFile.statements) {\n if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {\n const isMatch =\n typeof moduleName === 'string'\n ? node.moduleSpecifier.text === moduleName\n : moduleName.test(node.moduleSpecifier.text);\n const namedBindings = node.importClause?.namedBindings;\n if (isMatch && namedBindings && ts.isNamedImports(namedBindings)) {\n for (const specifierName of specifierNames) {\n const match = findImportSpecifier(namedBindings.elements, specifierName);\n if (match) {\n matches.push(match);\n }\n }\n }\n }\n }\n return matches;\n}\n\nexport function getNamedImports(\n sourceFile: ts.SourceFile,\n moduleName: string | RegExp,\n): ts.NamedImports | null {\n for (const node of sourceFile.statements) {\n if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {\n const isMatch =\n typeof moduleName === 'string'\n ? node.moduleSpecifier.text === moduleName\n : moduleName.test(node.moduleSpecifier.text);\n const namedBindings = node.importClause?.namedBindings;\n if (isMatch && namedBindings && ts.isNamedImports(namedBindings)) {\n return namedBindings;\n }\n }\n }\n return null;\n}\n\n/**\n * Replaces an import inside a named imports node with a different one.\n *\n * @param node Node that contains the imports.\n * @param existingImport Import that should be replaced.\n * @param newImportName Import that should be inserted.\n */\nexport function replaceImport(\n node: ts.NamedImports,\n existingImport: string,\n newImportName: string,\n) {\n const isAlreadyImported = findImportSpecifier(node.elements, newImportName);\n if (isAlreadyImported) {\n return node;\n }\n\n const existingImportNode = findImportSpecifier(node.elements, existingImport);\n if (!existingImportNode) {\n return node;\n }\n\n const importPropertyName = existingImportNode.propertyName\n ? ts.factory.createIdentifier(newImportName)\n : undefined;\n const importName = existingImportNode.propertyName\n ? existingImportNode.name\n : ts.factory.createIdentifier(newImportName);\n\n return ts.factory.updateNamedImports(node, [\n ...node.elements.filter((current) => current !== existingImportNode),\n // Create a new import while trying to preserve the alias of the old one.\n ts.factory.createImportSpecifier(false, importPropertyName, importName),\n ]);\n}\n\n/**\n * Removes a symbol from the named imports and updates a node\n * that represents a given named imports.\n *\n * @param node Node that contains the imports.\n * @param symbol Symbol that should be removed.\n * @returns An updated node (ts.NamedImports).\n */\nexport function removeSymbolFromNamedImports(node: ts.NamedImports, symbol: ts.ImportSpecifier) {\n return ts.factory.updateNamedImports(node, [\n ...node.elements.filter((current) => current !== symbol),\n ]);\n}\n\n/** Finds an import specifier with a particular name. */\nexport function findImportSpecifier(\n nodes: ts.NodeArray<ts.ImportSpecifier>,\n specifierName: string,\n): ts.ImportSpecifier | undefined {\n return nodes.find((element) => {\n const {name, propertyName} = element;\n return propertyName ? propertyName.text === specifierName : name.text === specifierName;\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAQA,wBAA8D;AAC9D,IAAAA,eAAuB;;;ACDvB,kBAAqD;AAOrD,SAAsB,wBACpB,MAAU;;AAIV,UAAM,aAAa,oBAAI,IAAG;AAC1B,UAAM,YAAY,oBAAI,IAAG;AAEzB,UAAM,YAAY,MAAM,aAAa,IAAI;AACzC,eAAW,CAAC,EAAE,OAAO,KAAK,UAAU,UAAU;AAC5C,iBAAW,CAAC,MAAM,MAAM,KAAK,QAAQ,SAAS;AAC5C,YAAI,SAAS,WAAW,SAAS,QAAQ;AACvC;QACF;AAEA,mBAAW,CAAC,EAAE,OAAO,KAAK,iBAAiB,MAAM,GAAG;AAClD,gBAAM,WAAW,QAAQ;AAEzB,cAAI,OAAO,aAAa,YAAY,CAAC,KAAK,OAAO,QAAQ,GAAG;AAC1D;UACF;AAEA,cAAI,SAAS,SAAS;AACpB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,OAAM,GAAI;AAClE,eAAW,UAAU,eAAe;AAClC,gBAAU,OAAO,QAAO,YAAO,iBAAP,YAAuB,GAAG,OAAO,IAAI;IAC/D;EACF;AACF;;;AJpEc,SAAP,6BAAO;AACZ,SAAO,CAAO,SAAc;AAC1B,UAAM,EAAC,YAAY,UAAS,IAAI,MAAM,wBAAwB,IAAI;AAClE,UAAM,WAAW,QAAQ,IAAG;AAC5B,UAAM,WAAW,CAAC,GAAG,YAAY,GAAG,SAAS;AAE7C,QAAI,CAAC,SAAS,QAAQ;AACpB,YAAM,IAAI,sCACR,+EAA+E;IAEnF;AAEA,eAAW,gBAAgB,UAAU;AACnC,mBAAa,MAAM,cAAc,QAAQ;IAC3C;EACF;AACF;AAEA,SAAS,aAAa,MAAY,cAAsB,UAAgB;AACtE,QAAM,UAAU,uBAAuB,MAAM,cAAc,QAAQ;AACnE,QAAM,cAAc,QACjB,eAAc,EACd,OAAO,CAAC,eAAe,eAAe,UAAU,YAAY,OAAO,CAAC;AAEvE,aAAW,cAAc,aAAa;AACpC,QAAI,SAAgC;AAEpC,UAAM,WAAW,CAAC,UAAkB,OAAe,SAAuB;AACxE,UAAI,WAAW,MAAM;AAEnB,iBAAS,KAAK,gBAAY,uBAAS,UAAU,WAAW,QAAQ,CAAC;MACnE;AACA,aAAO,OAAO,UAAU,KAAK;AAC7B,UAAI,SAAS,MAAM;AACjB,eAAO,WAAW,UAAU,IAAI;MAClC;IACF;AACA,gBAAY,YAAY,QAAQ,eAAc,GAAI,QAAQ;AAE1D,QAAI,WAAW,MAAM;AACnB,WAAK,aAAa,MAAM;IAC1B;EACF;AACF;",
|
|
6
|
+
"names": ["import_path", "path", "import_typescript", "ts", "ts", "import_typescript", "import_typescript", "import_path", "import_typescript", "ts", "ts", "path", "import_typescript", "ts", "ts", "_a"]
|
|
7
|
+
}
|
|
@@ -60,7 +60,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
// bazel-out/
|
|
63
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/http-providers/index.mjs
|
|
64
64
|
var http_providers_exports = {};
|
|
65
65
|
__export(http_providers_exports, {
|
|
66
66
|
default: () => http_providers_default
|
|
@@ -69,7 +69,7 @@ module.exports = __toCommonJS(http_providers_exports);
|
|
|
69
69
|
var import_schematics = require("@angular-devkit/schematics");
|
|
70
70
|
var import_path3 = require("path");
|
|
71
71
|
|
|
72
|
-
// bazel-out/
|
|
72
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
|
|
73
73
|
var import_core = require("@angular-devkit/core");
|
|
74
74
|
function getProjectTsConfigPaths(tree) {
|
|
75
75
|
return __async(this, null, function* () {
|
|
@@ -149,11 +149,11 @@ function getWorkspace(tree) {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
// bazel-out/
|
|
152
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
153
153
|
var import_path = require("path");
|
|
154
154
|
var import_typescript2 = __toESM(require("typescript"), 1);
|
|
155
155
|
|
|
156
|
-
// bazel-out/
|
|
156
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
|
|
157
157
|
var path = __toESM(require("path"), 1);
|
|
158
158
|
var import_typescript = __toESM(require("typescript"), 1);
|
|
159
159
|
function parseTsconfigFile(tsconfigPath, basePath) {
|
|
@@ -170,7 +170,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
|
|
|
170
170
|
return import_typescript.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
// bazel-out/
|
|
173
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
174
174
|
function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
|
|
175
175
|
const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
|
|
176
176
|
return import_typescript2.default.createProgram(rootNames, options, host);
|
|
@@ -203,13 +203,13 @@ function canMigrateFile(basePath, sourceFile, program) {
|
|
|
203
203
|
return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
// bazel-out/
|
|
206
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/http-providers/utils.mjs
|
|
207
207
|
var import_typescript7 = __toESM(require("typescript"), 1);
|
|
208
208
|
|
|
209
|
-
// bazel-out/
|
|
209
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
|
|
210
210
|
var import_typescript4 = __toESM(require("typescript"), 1);
|
|
211
211
|
|
|
212
|
-
// bazel-out/
|
|
212
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
|
|
213
213
|
var import_path2 = require("path");
|
|
214
214
|
var import_typescript3 = __toESM(require("typescript"), 1);
|
|
215
215
|
var ImportManager = class {
|
|
@@ -393,7 +393,7 @@ ${text}`;
|
|
|
393
393
|
}
|
|
394
394
|
};
|
|
395
395
|
|
|
396
|
-
// bazel-out/
|
|
396
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
|
|
397
397
|
var ChangeTracker = class {
|
|
398
398
|
constructor(_printer, _importRemapper) {
|
|
399
399
|
__publicField(this, "_printer");
|
|
@@ -456,10 +456,10 @@ function normalizePath(path2) {
|
|
|
456
456
|
return path2.replace(/\\/g, "/");
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
-
// bazel-out/
|
|
459
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
|
|
460
460
|
var import_typescript6 = __toESM(require("typescript"), 1);
|
|
461
461
|
|
|
462
|
-
// bazel-out/
|
|
462
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
|
|
463
463
|
var import_typescript5 = __toESM(require("typescript"), 1);
|
|
464
464
|
function getImportOfIdentifier(typeChecker, node) {
|
|
465
465
|
const symbol = typeChecker.getSymbolAtLocation(node);
|
|
@@ -519,7 +519,7 @@ function findImportSpecifier(nodes, specifierName) {
|
|
|
519
519
|
});
|
|
520
520
|
}
|
|
521
521
|
|
|
522
|
-
// bazel-out/
|
|
522
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
|
|
523
523
|
function getCallDecoratorImport(typeChecker, decorator) {
|
|
524
524
|
if (!import_typescript6.default.isCallExpression(decorator.expression) || !import_typescript6.default.isIdentifier(decorator.expression.expression)) {
|
|
525
525
|
return null;
|
|
@@ -528,7 +528,7 @@ function getCallDecoratorImport(typeChecker, decorator) {
|
|
|
528
528
|
return getImportOfIdentifier(typeChecker, identifier);
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
// bazel-out/
|
|
531
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/ng_decorators.mjs
|
|
532
532
|
function getAngularDecorators(typeChecker, decorators) {
|
|
533
533
|
return decorators.map((node) => ({ node, importData: getCallDecoratorImport(typeChecker, node) })).filter(({ importData }) => importData && importData.importModule.startsWith("@angular/")).map(({ node, importData }) => ({
|
|
534
534
|
node,
|
|
@@ -538,7 +538,7 @@ function getAngularDecorators(typeChecker, decorators) {
|
|
|
538
538
|
}));
|
|
539
539
|
}
|
|
540
540
|
|
|
541
|
-
// bazel-out/
|
|
541
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/http-providers/utils.mjs
|
|
542
542
|
var HTTP_CLIENT_MODULE = "HttpClientModule";
|
|
543
543
|
var HTTP_CLIENT_XSRF_MODULE = "HttpClientXsrfModule";
|
|
544
544
|
var HTTP_CLIENT_JSONP_MODULE = "HttpClientJsonpModule";
|
|
@@ -826,7 +826,7 @@ function updateTestBedConfiguration(configureTestingModuleArgs, newImports, newP
|
|
|
826
826
|
]);
|
|
827
827
|
}
|
|
828
828
|
|
|
829
|
-
// bazel-out/
|
|
829
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/http-providers/index.mjs
|
|
830
830
|
function http_providers_default() {
|
|
831
831
|
return (tree) => __async(this, null, function* () {
|
|
832
832
|
const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);
|