@eui/core 23.0.0-alpha.8 → 23.0.0-alpha.9
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/CHANGELOG.md +9 -0
- package/docs/changelog.html +10 -0
- package/docs/interfaces/Schema-1.html +1 -13
- package/docs/interfaces/Schema-10.html +1 -1
- package/docs/interfaces/Schema-11.html +1 -1
- package/docs/interfaces/Schema-12.html +1 -1
- package/docs/interfaces/Schema-13.html +1 -1
- package/docs/interfaces/Schema-14.html +1 -1
- package/docs/interfaces/Schema-15.html +1 -1
- package/docs/interfaces/Schema-16.html +1 -1
- package/docs/interfaces/Schema-17.html +1 -1
- package/docs/interfaces/Schema-18.html +1 -1
- package/docs/interfaces/Schema-19.html +1 -1
- package/docs/interfaces/Schema-2.html +33 -15
- package/docs/interfaces/Schema-20.html +1 -1
- package/docs/interfaces/Schema-21.html +13 -1
- package/docs/interfaces/Schema-3.html +1 -64
- package/docs/interfaces/Schema-4.html +1 -1
- package/docs/interfaces/Schema-5.html +1 -1
- package/docs/interfaces/Schema-6.html +1 -1
- package/docs/interfaces/Schema-7.html +1 -1
- package/docs/interfaces/Schema-8.html +1 -1
- package/docs/interfaces/Schema-9.html +1 -1
- package/docs/interfaces/Schema.html +46 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/documentation.json +794 -794
- package/docs/llms.txt +14 -14
- package/docs/miscellaneous/functions.html +2 -2
- package/docs/properties.html +1 -1
- package/package.json +2 -2
|
@@ -2036,12 +2036,12 @@
|
|
|
2036
2036
|
},
|
|
2037
2037
|
{
|
|
2038
2038
|
"name": "Schema",
|
|
2039
|
-
"id": "interface-Schema-
|
|
2040
|
-
"file": "packages/core/schematics/
|
|
2039
|
+
"id": "interface-Schema-5cd6db1920bd5b70a44c0b8a7f7e30f600bfd16a9950f218e6d451a1755ced95b462ef9a62ee87e39bcb8c392981b8d2597895bf0a272fd8aea71f03429ed976",
|
|
2040
|
+
"file": "packages/core/schematics/icon-migrate/schema.ts",
|
|
2041
2041
|
"deprecated": false,
|
|
2042
2042
|
"deprecationMessage": "",
|
|
2043
2043
|
"type": "interface",
|
|
2044
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode, TmplAstTemplate } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\nimport { SELECTOR_MAP, SelectorEntry, getClassNamesForArray } from './selector-map';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n useClassArray?: boolean;\n}\n\ninterface ImportToAdd {\n /** The symbol to add to imports array (class name or array name for spread) */\n symbol: string;\n /** Whether this should be spread (...EUI_BUTTON) */\n isSpread: boolean;\n /** ES import path */\n importPath: string;\n}\n\nexport function addEuiImports(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n const useClassArray = options.useClassArray ?? false;\n let filesUpdated = 0;\n\n // Index NgModules for standalone:false support\n const ngModuleIndex = buildNgModuleIndex(tree, tree.getDir(scanPath || '/'));\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts') || path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n const source = buffer.toString('utf-8');\n\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true);\n const components = findComponentDecorators(sourceFile);\n if (components.length === 0) return;\n\n let modified = false;\n\n for (const { decorator, className: componentClassName, isNonStandalone } of components) {\n const templateHtml = getTemplateContent(tree, path, decorator, source);\n if (!templateHtml) continue;\n\n const matched = matchSelectorsInTemplate(templateHtml);\n if (matched.length === 0) continue;\n\n const importsToAdd = resolveImports(matched, useClassArray);\n if (importsToAdd.length === 0) continue;\n\n if (isNonStandalone) {\n // Find the NgModule that declares this component and add imports there\n const moduleInfo = findDeclaringModule(ngModuleIndex, componentClassName);\n if (!moduleInfo) {\n context.logger.warn(`⚠ Could not find declaring NgModule for ${componentClassName} in ${path}`);\n continue;\n }\n const moduleBuffer = tree.read(moduleInfo.path);\n if (!moduleBuffer) continue;\n const moduleSource = moduleBuffer.toString('utf-8');\n const result = addImportsToFile(moduleSource, moduleInfo.path, moduleInfo.decoratorPos, importsToAdd, useClassArray);\n if (result !== moduleSource) {\n if (options.dryRun) {\n logDryRun(context, `Would add EUI imports to NgModule in ${moduleInfo.path} for component ${componentClassName}`);\n } else {\n tree.overwrite(moduleInfo.path, result);\n }\n modified = true;\n }\n } else {\n // Standalone component — add imports directly\n const currentSource = tree.read(path)!.toString('utf-8');\n const result = addImportsToFile(currentSource, path, decorator.getStart(), importsToAdd, useClassArray);\n if (result !== currentSource) {\n if (options.dryRun) {\n logDryRun(context, `Would add EUI imports to ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n modified = true;\n }\n }\n }\n\n if (modified) filesUpdated++;\n });\n\n context.logger.info(`add-eui-imports: ${filesUpdated} file(s) updated.`);\n if (options.dryRun) logDryRunNote(context);\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\n// --- Selector Matching ---\n\nfunction matchSelectorsInTemplate(html: string): SelectorEntry[] {\n const parsed = parseTemplate(html, '', { preserveWhitespaces: true });\n if (parsed.errors?.length) return [];\n\n const matched: SelectorEntry[] = [];\n visitTemplateNodes(parsed.nodes, matched);\n return matched;\n}\n\nfunction visitTemplateNodes(nodes: TmplAstNode[], matched: SelectorEntry[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n matchElement(node, matched);\n visitTemplateNodes(node.children, matched);\n } else if (node instanceof TmplAstTemplate) {\n visitTemplateNodes(node.children, matched);\n }\n }\n}\n\nfunction matchElement(element: TmplAstElement, matched: SelectorEntry[]): void {\n const tagName = element.name;\n const attrNames = new Set([\n ...element.attributes.map(a => a.name),\n ...element.inputs.map(i => i.name),\n ]);\n\n for (const entry of SELECTOR_MAP) {\n if (entry.element && entry.element !== tagName) continue;\n if (!entry.element && entry.attributes.length === 0) continue;\n if (!entry.attributes.every(attr => attrNames.has(attr))) continue;\n // If no element specified, at least one attribute must match on this element\n if (!entry.element && entry.attributes.length > 0 && !entry.attributes.some(attr => attrNames.has(attr))) continue;\n matched.push(entry);\n }\n}\n\n// --- Import Resolution ---\n\nfunction resolveImports(matched: SelectorEntry[], useClassArray: boolean): ImportToAdd[] {\n const seen = new Set<string>();\n const result: ImportToAdd[] = [];\n\n for (const entry of matched) {\n if (useClassArray && entry.classArray) {\n if (seen.has(entry.classArray)) continue;\n seen.add(entry.classArray);\n result.push({ symbol: entry.classArray, isSpread: true, importPath: entry.importPath });\n } else {\n if (seen.has(entry.className)) continue;\n seen.add(entry.className);\n result.push({ symbol: entry.className, isSpread: false, importPath: entry.importPath });\n }\n }\n\n return result;\n}\n\n// --- Template Extraction ---\n\nfunction getTemplateContent(tree: Tree, tsPath: string, decorator: ts.Decorator, source: string): string | null {\n const call = decorator.expression as ts.CallExpression;\n if (!call.arguments[0] || !ts.isObjectLiteralExpression(call.arguments[0])) return null;\n const metadata = call.arguments[0];\n\n for (const prop of metadata.properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) continue;\n if (prop.name.text === 'template') {\n const init = prop.initializer;\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n return init.text;\n }\n }\n if (prop.name.text === 'templateUrl') {\n if (ts.isStringLiteral(prop.initializer)) {\n const dir = tsPath.substring(0, tsPath.lastIndexOf('/'));\n const templateBuffer = tree.read(`${dir}/${prop.initializer.text}`);\n if (templateBuffer) return templateBuffer.toString('utf-8');\n }\n }\n }\n return null;\n}\n\n// --- Component Decorator Detection ---\n\ninterface ComponentInfo {\n decorator: ts.Decorator;\n className: string;\n isNonStandalone: boolean;\n}\n\nfunction findComponentDecorators(sourceFile: ts.SourceFile): ComponentInfo[] {\n const results: ComponentInfo[] = [];\n const visit = (node: ts.Node): void => {\n if (ts.isClassDeclaration(node) && node.name) {\n const decs = ts.getDecorators(node);\n if (decs) {\n for (const dec of decs) {\n if (ts.isCallExpression(dec.expression) && ts.isIdentifier(dec.expression.expression) && dec.expression.expression.text === 'Component') {\n const isNonStandalone = hasStandaloneFalse(dec);\n results.push({ decorator: dec, className: node.name.text, isNonStandalone });\n }\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(sourceFile);\n return results;\n}\n\nfunction hasStandaloneFalse(decorator: ts.Decorator): boolean {\n const call = decorator.expression as ts.CallExpression;\n if (!call.arguments[0] || !ts.isObjectLiteralExpression(call.arguments[0])) return false;\n for (const prop of call.arguments[0].properties) {\n if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name) && prop.name.text === 'standalone') {\n return prop.initializer.kind === ts.SyntaxKind.FalseKeyword;\n }\n }\n return false;\n}\n\n// --- NgModule Index ---\n\ninterface NgModuleInfo {\n path: string;\n declarations: string[];\n decoratorPos: number;\n}\n\nfunction buildNgModuleIndex(tree: Tree, dir: DirEntry): NgModuleInfo[] {\n const modules: NgModuleInfo[] = [];\n\n visitDir(dir, (path) => {\n if (!path.endsWith('.ts') || path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n const source = buffer.toString('utf-8');\n if (!source.includes('NgModule')) return;\n\n const sf = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true);\n const visit = (node: ts.Node): void => {\n if (ts.isClassDeclaration(node)) {\n const decs = ts.getDecorators(node);\n if (decs) {\n for (const dec of decs) {\n if (ts.isCallExpression(dec.expression) && ts.isIdentifier(dec.expression.expression) && dec.expression.expression.text === 'NgModule') {\n const declarations = extractArrayProperty(dec, 'declarations', source);\n modules.push({ path, declarations, decoratorPos: dec.getStart() });\n }\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(sf);\n });\n\n return modules;\n}\n\nfunction extractArrayProperty(decorator: ts.Decorator, propName: string, source: string): string[] {\n const call = decorator.expression as ts.CallExpression;\n if (!call.arguments[0] || !ts.isObjectLiteralExpression(call.arguments[0])) return [];\n for (const prop of call.arguments[0].properties) {\n if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name) && prop.name.text === propName) {\n if (ts.isArrayLiteralExpression(prop.initializer)) {\n return prop.initializer.elements\n .filter(ts.isIdentifier)\n .map(id => id.text);\n }\n }\n }\n return [];\n}\n\nfunction findDeclaringModule(modules: NgModuleInfo[], componentClassName: string): NgModuleInfo | undefined {\n return modules.find(m => m.declarations.includes(componentClassName));\n}\n\n// --- Import Addition ---\n\nfunction addImportsToFile(source: string, filePath: string, decoratorStartHint: number, imports: ImportToAdd[], useClassArray: boolean): string {\n const sf = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n\n // Find the imports array in the decorator closest to decoratorStartHint\n const importsArrayInfo = findDecoratorImportsArray(sf, source, decoratorStartHint);\n if (!importsArrayInfo) return source;\n\n const { arrayNode, decoratorType } = importsArrayInfo;\n\n // Determine what's already in the imports array\n const existingSymbols = new Set<string>();\n const existingSpreads = new Set<string>();\n for (const el of arrayNode.elements) {\n if (ts.isSpreadElement(el) && ts.isIdentifier(el.expression)) {\n existingSpreads.add(el.expression.text);\n } else if (ts.isIdentifier(el)) {\n existingSymbols.add(el.text);\n }\n }\n\n // Filter out already-present imports and compute what to add/remove\n const toAdd: ImportToAdd[] = [];\n const toRemoveFromArray: string[] = []; // individual class names to consolidate\n\n for (const imp of imports) {\n if (imp.isSpread) {\n if (existingSpreads.has(imp.symbol)) continue; // Already has ...EUI_X\n toAdd.push(imp);\n // Consolidate: remove individual class names covered by this array\n if (useClassArray) {\n const coveredClasses = getClassNamesForArray(imp.symbol);\n for (const cls of coveredClasses) {\n if (existingSymbols.has(cls)) toRemoveFromArray.push(cls);\n }\n }\n } else {\n if (existingSymbols.has(imp.symbol)) continue;\n // Also skip if a spread already covers this class\n const coveringArray = imports.find(i => i.isSpread && getClassNamesForArray(i.symbol).includes(imp.symbol));\n if (coveringArray && (existingSpreads.has(coveringArray.symbol) || toAdd.some(a => a.symbol === coveringArray.symbol))) continue;\n toAdd.push(imp);\n }\n }\n\n if (toAdd.length === 0 && toRemoveFromArray.length === 0) return source;\n\n // Build new array content\n let result = source;\n result = updateDecoratorImportsArray(result, filePath, arrayNode, toAdd, toRemoveFromArray);\n\n // Add ES imports\n result = addEsImports(result, filePath, toAdd);\n\n // Remove consolidated class names from ES imports\n if (toRemoveFromArray.length > 0) {\n result = removeFromEsImports(result, filePath, toRemoveFromArray);\n }\n\n return result;\n}\n\ninterface ImportsArrayInfo {\n arrayNode: ts.ArrayLiteralExpression;\n decoratorType: 'Component' | 'NgModule';\n}\n\nfunction findDecoratorImportsArray(sf: ts.SourceFile, source: string, decoratorStartHint: number): ImportsArrayInfo | null {\n let found: ImportsArrayInfo | null = null;\n\n const visit = (node: ts.Node): void => {\n if (found) return;\n if (ts.isClassDeclaration(node)) {\n const decs = ts.getDecorators(node);\n if (!decs) return;\n for (const dec of decs) {\n if (!ts.isCallExpression(dec.expression)) continue;\n if (!ts.isIdentifier(dec.expression.expression)) continue;\n const decName = dec.expression.expression.text;\n if (decName !== 'Component' && decName !== 'NgModule') continue;\n if (Math.abs(dec.getStart() - decoratorStartHint) > 5) continue; // Match by position\n\n const metadata = dec.expression.arguments[0];\n if (!ts.isObjectLiteralExpression(metadata)) continue;\n\n for (const prop of metadata.properties) {\n if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name) && prop.name.text === 'imports') {\n if (ts.isArrayLiteralExpression(prop.initializer)) {\n found = { arrayNode: prop.initializer, decoratorType: decName as 'Component' | 'NgModule' };\n return;\n }\n }\n }\n\n // No imports array found — create one\n if (!found && decName === 'Component') {\n // We need to add `imports: []` to the decorator\n // Insert after the last property\n const lastProp = metadata.properties[metadata.properties.length - 1];\n if (lastProp) {\n const insertPos = lastProp.getEnd();\n const indent = detectIndent(source, metadata.getStart());\n const insertion = `,\\n${indent} imports: []`;\n const newSource = source.slice(0, insertPos) + insertion + source.slice(insertPos);\n // Re-parse to get the array node\n const newSf = ts.createSourceFile('', newSource, ts.ScriptTarget.Latest, true);\n const newArray = findImportsArrayInSource(newSf);\n if (newArray) {\n // We can't return a node from a different source file in the general case.\n // Instead, we'll handle the \"no imports array\" case by adding it inline.\n found = null; // Will be handled separately\n }\n }\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(sf);\n return found;\n}\n\nfunction findImportsArrayInSource(sf: ts.SourceFile): ts.ArrayLiteralExpression | null {\n let found: ts.ArrayLiteralExpression | null = null;\n const visit = (node: ts.Node): void => {\n if (found) return;\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && node.name.text === 'imports' && ts.isArrayLiteralExpression(node.initializer)) {\n found = node.initializer;\n }\n ts.forEachChild(node, visit);\n };\n visit(sf);\n return found;\n}\n\nfunction updateDecoratorImportsArray(source: string, filePath: string, arrayNode: ts.ArrayLiteralExpression, toAdd: ImportToAdd[], toRemove: string[]): string {\n const sf = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n\n // Rebuild the array content\n const existingElements: string[] = [];\n for (const el of arrayNode.elements) {\n const text = source.slice(el.getStart(sf), el.getEnd()).trim();\n // Check if this element should be removed (consolidation)\n if (ts.isIdentifier(el) && toRemove.includes(el.text)) continue;\n existingElements.push(text);\n }\n\n // Add new entries\n for (const imp of toAdd) {\n const entry = imp.isSpread ? `...${imp.symbol}` : imp.symbol;\n if (!existingElements.includes(entry)) {\n existingElements.push(entry);\n }\n }\n\n // Determine formatting\n const arrayStart = arrayNode.getStart(sf);\n const arrayEnd = arrayNode.getEnd();\n const originalText = source.slice(arrayStart, arrayEnd);\n const isMultiline = originalText.includes('\\n');\n\n let newArrayText: string;\n if (isMultiline || existingElements.length > 3) {\n const indent = detectIndent(source, arrayStart);\n const itemIndent = indent + ' ';\n newArrayText = `[\\n${existingElements.map(e => `${itemIndent}${e},`).join('\\n')}\\n${indent}]`;\n } else {\n newArrayText = `[${existingElements.join(', ')}]`;\n }\n\n return source.slice(0, arrayStart) + newArrayText + source.slice(arrayEnd);\n}\n\nfunction addEsImports(source: string, filePath: string, imports: ImportToAdd[]): string {\n let result = source;\n\n // Group by import path\n const byPath = new Map<string, string[]>();\n for (const imp of imports) {\n const existing = byPath.get(imp.importPath) || [];\n existing.push(imp.symbol);\n byPath.set(imp.importPath, existing);\n }\n\n for (const [importPath, symbols] of byPath) {\n const sf = ts.createSourceFile(filePath, result, ts.ScriptTarget.Latest, true);\n\n // Check if there's already an import from this path\n const existingImport = sf.statements.find(\n (s): s is ts.ImportDeclaration =>\n ts.isImportDeclaration(s) && ts.isStringLiteral(s.moduleSpecifier) && s.moduleSpecifier.text === importPath,\n );\n\n if (existingImport?.importClause?.namedBindings && ts.isNamedImports(existingImport.importClause.namedBindings)) {\n // Extend existing import\n const namedBindings = existingImport.importClause.namedBindings;\n const existingNames = namedBindings.elements.map(el => el.name.text);\n const newNames = symbols.filter(s => !existingNames.includes(s));\n if (newNames.length === 0) continue;\n\n const allNames = [...existingNames, ...newNames].sort();\n const newClause = `{ ${allNames.join(', ')} }`;\n result = result.slice(0, namedBindings.getStart(sf)) + newClause + result.slice(namedBindings.getEnd());\n } else {\n // Add new import statement\n const sortedSymbols = [...symbols].sort();\n const newImport = `import { ${sortedSymbols.join(', ')} } from '${importPath}';\\n`;\n\n // Insert after the last existing import\n const lastImport = [...sf.statements].reverse().find(ts.isImportDeclaration);\n if (lastImport) {\n const pos = lastImport.getEnd();\n result = result.slice(0, pos) + '\\n' + newImport.trimEnd() + result.slice(pos);\n } else {\n result = newImport + result;\n }\n }\n }\n\n return result;\n}\n\nfunction detectIndent(source: string, pos: number): string {\n const lineStart = source.lastIndexOf('\\n', pos - 1) + 1;\n const match = source.slice(lineStart, pos).match(/^(\\s*)/);\n return match ? match[1] : '';\n}\n\nfunction removeFromEsImports(source: string, filePath: string, symbolsToRemove: string[]): string {\n let result = source;\n const sf = ts.createSourceFile(filePath, result, ts.ScriptTarget.Latest, true);\n\n for (const stmt of sf.statements) {\n if (!ts.isImportDeclaration(stmt) || !stmt.importClause?.namedBindings || !ts.isNamedImports(stmt.importClause.namedBindings)) continue;\n const namedBindings = stmt.importClause.namedBindings;\n const existingNames = namedBindings.elements.map(el => el.name.text);\n const remaining = existingNames.filter(n => !symbolsToRemove.includes(n));\n\n if (remaining.length === existingNames.length) continue; // Nothing to remove from this import\n\n if (remaining.length === 0) {\n // Remove the entire import statement\n result = result.slice(0, stmt.getStart(sf)) + result.slice(stmt.getEnd()).replace(/^\\r?\\n/, '');\n } else {\n const newClause = `{ ${remaining.join(', ')} }`;\n result = result.slice(0, namedBindings.getStart(sf)) + newClause + result.slice(namedBindings.getEnd());\n }\n break; // Only process the first matching import for the consolidated symbols\n }\n\n return result;\n}\n",
|
|
2044
|
+
"sourceCode": "export interface Schema {\n /** The path to scan for files to migrate */\n path?: string;\n /** Whether to perform a dry run without making changes */\n dryRun?: boolean;\n}\n",
|
|
2045
2045
|
"displayName": "Schema",
|
|
2046
2046
|
"properties": [
|
|
2047
2047
|
{
|
|
@@ -2052,9 +2052,9 @@
|
|
|
2052
2052
|
"type": "boolean",
|
|
2053
2053
|
"indexKey": "",
|
|
2054
2054
|
"optional": true,
|
|
2055
|
-
"description": "",
|
|
2056
|
-
"line":
|
|
2057
|
-
"rawdescription": "\
|
|
2055
|
+
"description": "<p>Whether to perform a dry run without making changes</p>\n",
|
|
2056
|
+
"line": 5,
|
|
2057
|
+
"rawdescription": "\nWhether to perform a dry run without making changes"
|
|
2058
2058
|
},
|
|
2059
2059
|
{
|
|
2060
2060
|
"name": "path",
|
|
@@ -2064,21 +2064,9 @@
|
|
|
2064
2064
|
"type": "string",
|
|
2065
2065
|
"indexKey": "",
|
|
2066
2066
|
"optional": true,
|
|
2067
|
-
"description": "",
|
|
2068
|
-
"line":
|
|
2069
|
-
"rawdescription": "\
|
|
2070
|
-
},
|
|
2071
|
-
{
|
|
2072
|
-
"name": "useClassArray",
|
|
2073
|
-
"coverageIgnore": false,
|
|
2074
|
-
"deprecated": false,
|
|
2075
|
-
"deprecationMessage": "",
|
|
2076
|
-
"type": "boolean",
|
|
2077
|
-
"indexKey": "",
|
|
2078
|
-
"optional": true,
|
|
2079
|
-
"description": "",
|
|
2080
|
-
"line": 10,
|
|
2081
|
-
"rawdescription": "\n"
|
|
2067
|
+
"description": "<p>The path to scan for files to migrate</p>\n",
|
|
2068
|
+
"line": 3,
|
|
2069
|
+
"rawdescription": "\nThe path to scan for files to migrate"
|
|
2082
2070
|
}
|
|
2083
2071
|
],
|
|
2084
2072
|
"indexSignatures": [],
|
|
@@ -2092,12 +2080,12 @@
|
|
|
2092
2080
|
},
|
|
2093
2081
|
{
|
|
2094
2082
|
"name": "Schema",
|
|
2095
|
-
"id": "interface-Schema-
|
|
2096
|
-
"file": "packages/core/schematics/
|
|
2083
|
+
"id": "interface-Schema-9c5e016857e1416ac7bbb881973e644c0f578a53bd432bb951c1676ac3f2a6631bfe3344860346a081b841217278723e0bb0bf2fa35fb869de67cb0cc8d99849-1",
|
|
2084
|
+
"file": "packages/core/schematics/add-eui-imports/index.ts",
|
|
2097
2085
|
"deprecated": false,
|
|
2098
2086
|
"deprecationMessage": "",
|
|
2099
2087
|
"type": "interface",
|
|
2100
|
-
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst MULTIPLE_EMPTY_LINES = /\\n{3,}/g;\n\nexport function fixNoMultipleEmptyLines(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (filePath) => {\n const buffer = tree.read(filePath);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n const result = original.replace(MULTIPLE_EMPTY_LINES, '\\n\\n');\n\n if (result !== original) {\n if (filePath.endsWith('.ts')) {\n const sourceFile = ts.createSourceFile(filePath, result, ts.ScriptTarget.Latest, true);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((sourceFile as any).parseDiagnostics?.length) {\n context.logger.warn(`Skipping ${filePath}: file would not parse after transformation.`);\n return;\n }\n }\n if (options.dryRun) {\n logDryRun(context, `Would collapse multiple empty lines in ${filePath}`);\n } else {\n tree.overwrite(filePath, result);\n }\n count++;\n }\n });\n\n context.logger.info(`Fixed multiple empty lines in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.ts') && !file.endsWith('.html') && !file.endsWith('.scss') && !file.endsWith('.css')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2088
|
+
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode, TmplAstTemplate } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\nimport { SELECTOR_MAP, SelectorEntry, getClassNamesForArray } from './selector-map';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n useClassArray?: boolean;\n}\n\ninterface ImportToAdd {\n /** The symbol to add to imports array (class name or array name for spread) */\n symbol: string;\n /** Whether this should be spread (...EUI_BUTTON) */\n isSpread: boolean;\n /** ES import path */\n importPath: string;\n}\n\nexport function addEuiImports(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n const useClassArray = options.useClassArray ?? false;\n let filesUpdated = 0;\n\n // Index NgModules for standalone:false support\n const ngModuleIndex = buildNgModuleIndex(tree, tree.getDir(scanPath || '/'));\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts') || path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n const source = buffer.toString('utf-8');\n\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true);\n const components = findComponentDecorators(sourceFile);\n if (components.length === 0) return;\n\n let modified = false;\n\n for (const { decorator, className: componentClassName, isNonStandalone } of components) {\n const templateHtml = getTemplateContent(tree, path, decorator, source);\n if (!templateHtml) continue;\n\n const matched = matchSelectorsInTemplate(templateHtml);\n if (matched.length === 0) continue;\n\n const importsToAdd = resolveImports(matched, useClassArray);\n if (importsToAdd.length === 0) continue;\n\n if (isNonStandalone) {\n // Find the NgModule that declares this component and add imports there\n const moduleInfo = findDeclaringModule(ngModuleIndex, componentClassName);\n if (!moduleInfo) {\n context.logger.warn(`⚠ Could not find declaring NgModule for ${componentClassName} in ${path}`);\n continue;\n }\n const moduleBuffer = tree.read(moduleInfo.path);\n if (!moduleBuffer) continue;\n const moduleSource = moduleBuffer.toString('utf-8');\n const result = addImportsToFile(moduleSource, moduleInfo.path, moduleInfo.decoratorPos, importsToAdd, useClassArray);\n if (result !== moduleSource) {\n if (options.dryRun) {\n logDryRun(context, `Would add EUI imports to NgModule in ${moduleInfo.path} for component ${componentClassName}`);\n } else {\n tree.overwrite(moduleInfo.path, result);\n }\n modified = true;\n }\n } else {\n // Standalone component — add imports directly\n const currentSource = tree.read(path)!.toString('utf-8');\n const result = addImportsToFile(currentSource, path, decorator.getStart(), importsToAdd, useClassArray);\n if (result !== currentSource) {\n if (options.dryRun) {\n logDryRun(context, `Would add EUI imports to ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n modified = true;\n }\n }\n }\n\n if (modified) filesUpdated++;\n });\n\n context.logger.info(`add-eui-imports: ${filesUpdated} file(s) updated.`);\n if (options.dryRun) logDryRunNote(context);\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\n// --- Selector Matching ---\n\nfunction matchSelectorsInTemplate(html: string): SelectorEntry[] {\n const parsed = parseTemplate(html, '', { preserveWhitespaces: true });\n if (parsed.errors?.length) return [];\n\n const matched: SelectorEntry[] = [];\n visitTemplateNodes(parsed.nodes, matched);\n return matched;\n}\n\nfunction visitTemplateNodes(nodes: TmplAstNode[], matched: SelectorEntry[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n matchElement(node, matched);\n visitTemplateNodes(node.children, matched);\n } else if (node instanceof TmplAstTemplate) {\n visitTemplateNodes(node.children, matched);\n }\n }\n}\n\nfunction matchElement(element: TmplAstElement, matched: SelectorEntry[]): void {\n const tagName = element.name;\n const attrNames = new Set([\n ...element.attributes.map(a => a.name),\n ...element.inputs.map(i => i.name),\n ]);\n\n for (const entry of SELECTOR_MAP) {\n if (entry.element && entry.element !== tagName) continue;\n if (!entry.element && entry.attributes.length === 0) continue;\n if (!entry.attributes.every(attr => attrNames.has(attr))) continue;\n // If no element specified, at least one attribute must match on this element\n if (!entry.element && entry.attributes.length > 0 && !entry.attributes.some(attr => attrNames.has(attr))) continue;\n matched.push(entry);\n }\n}\n\n// --- Import Resolution ---\n\nfunction resolveImports(matched: SelectorEntry[], useClassArray: boolean): ImportToAdd[] {\n const seen = new Set<string>();\n const result: ImportToAdd[] = [];\n\n for (const entry of matched) {\n if (useClassArray && entry.classArray) {\n if (seen.has(entry.classArray)) continue;\n seen.add(entry.classArray);\n result.push({ symbol: entry.classArray, isSpread: true, importPath: entry.importPath });\n } else {\n if (seen.has(entry.className)) continue;\n seen.add(entry.className);\n result.push({ symbol: entry.className, isSpread: false, importPath: entry.importPath });\n }\n }\n\n return result;\n}\n\n// --- Template Extraction ---\n\nfunction getTemplateContent(tree: Tree, tsPath: string, decorator: ts.Decorator, source: string): string | null {\n const call = decorator.expression as ts.CallExpression;\n if (!call.arguments[0] || !ts.isObjectLiteralExpression(call.arguments[0])) return null;\n const metadata = call.arguments[0];\n\n for (const prop of metadata.properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) continue;\n if (prop.name.text === 'template') {\n const init = prop.initializer;\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n return init.text;\n }\n }\n if (prop.name.text === 'templateUrl') {\n if (ts.isStringLiteral(prop.initializer)) {\n const dir = tsPath.substring(0, tsPath.lastIndexOf('/'));\n const templateBuffer = tree.read(`${dir}/${prop.initializer.text}`);\n if (templateBuffer) return templateBuffer.toString('utf-8');\n }\n }\n }\n return null;\n}\n\n// --- Component Decorator Detection ---\n\ninterface ComponentInfo {\n decorator: ts.Decorator;\n className: string;\n isNonStandalone: boolean;\n}\n\nfunction findComponentDecorators(sourceFile: ts.SourceFile): ComponentInfo[] {\n const results: ComponentInfo[] = [];\n const visit = (node: ts.Node): void => {\n if (ts.isClassDeclaration(node) && node.name) {\n const decs = ts.getDecorators(node);\n if (decs) {\n for (const dec of decs) {\n if (ts.isCallExpression(dec.expression) && ts.isIdentifier(dec.expression.expression) && dec.expression.expression.text === 'Component') {\n const isNonStandalone = hasStandaloneFalse(dec);\n results.push({ decorator: dec, className: node.name.text, isNonStandalone });\n }\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(sourceFile);\n return results;\n}\n\nfunction hasStandaloneFalse(decorator: ts.Decorator): boolean {\n const call = decorator.expression as ts.CallExpression;\n if (!call.arguments[0] || !ts.isObjectLiteralExpression(call.arguments[0])) return false;\n for (const prop of call.arguments[0].properties) {\n if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name) && prop.name.text === 'standalone') {\n return prop.initializer.kind === ts.SyntaxKind.FalseKeyword;\n }\n }\n return false;\n}\n\n// --- NgModule Index ---\n\ninterface NgModuleInfo {\n path: string;\n declarations: string[];\n decoratorPos: number;\n}\n\nfunction buildNgModuleIndex(tree: Tree, dir: DirEntry): NgModuleInfo[] {\n const modules: NgModuleInfo[] = [];\n\n visitDir(dir, (path) => {\n if (!path.endsWith('.ts') || path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n const source = buffer.toString('utf-8');\n if (!source.includes('NgModule')) return;\n\n const sf = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true);\n const visit = (node: ts.Node): void => {\n if (ts.isClassDeclaration(node)) {\n const decs = ts.getDecorators(node);\n if (decs) {\n for (const dec of decs) {\n if (ts.isCallExpression(dec.expression) && ts.isIdentifier(dec.expression.expression) && dec.expression.expression.text === 'NgModule') {\n const declarations = extractArrayProperty(dec, 'declarations', source);\n modules.push({ path, declarations, decoratorPos: dec.getStart() });\n }\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(sf);\n });\n\n return modules;\n}\n\nfunction extractArrayProperty(decorator: ts.Decorator, propName: string, source: string): string[] {\n const call = decorator.expression as ts.CallExpression;\n if (!call.arguments[0] || !ts.isObjectLiteralExpression(call.arguments[0])) return [];\n for (const prop of call.arguments[0].properties) {\n if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name) && prop.name.text === propName) {\n if (ts.isArrayLiteralExpression(prop.initializer)) {\n return prop.initializer.elements\n .filter(ts.isIdentifier)\n .map(id => id.text);\n }\n }\n }\n return [];\n}\n\nfunction findDeclaringModule(modules: NgModuleInfo[], componentClassName: string): NgModuleInfo | undefined {\n return modules.find(m => m.declarations.includes(componentClassName));\n}\n\n// --- Import Addition ---\n\nfunction addImportsToFile(source: string, filePath: string, decoratorStartHint: number, imports: ImportToAdd[], useClassArray: boolean): string {\n const sf = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n\n // Find the imports array in the decorator closest to decoratorStartHint\n const importsArrayInfo = findDecoratorImportsArray(sf, source, decoratorStartHint);\n if (!importsArrayInfo) return source;\n\n const { arrayNode, decoratorType } = importsArrayInfo;\n\n // Determine what's already in the imports array\n const existingSymbols = new Set<string>();\n const existingSpreads = new Set<string>();\n for (const el of arrayNode.elements) {\n if (ts.isSpreadElement(el) && ts.isIdentifier(el.expression)) {\n existingSpreads.add(el.expression.text);\n } else if (ts.isIdentifier(el)) {\n existingSymbols.add(el.text);\n }\n }\n\n // Filter out already-present imports and compute what to add/remove\n const toAdd: ImportToAdd[] = [];\n const toRemoveFromArray: string[] = []; // individual class names to consolidate\n\n for (const imp of imports) {\n if (imp.isSpread) {\n if (existingSpreads.has(imp.symbol)) continue; // Already has ...EUI_X\n toAdd.push(imp);\n // Consolidate: remove individual class names covered by this array\n if (useClassArray) {\n const coveredClasses = getClassNamesForArray(imp.symbol);\n for (const cls of coveredClasses) {\n if (existingSymbols.has(cls)) toRemoveFromArray.push(cls);\n }\n }\n } else {\n if (existingSymbols.has(imp.symbol)) continue;\n // Also skip if a spread already covers this class\n const coveringArray = imports.find(i => i.isSpread && getClassNamesForArray(i.symbol).includes(imp.symbol));\n if (coveringArray && (existingSpreads.has(coveringArray.symbol) || toAdd.some(a => a.symbol === coveringArray.symbol))) continue;\n toAdd.push(imp);\n }\n }\n\n if (toAdd.length === 0 && toRemoveFromArray.length === 0) return source;\n\n // Build new array content\n let result = source;\n result = updateDecoratorImportsArray(result, filePath, arrayNode, toAdd, toRemoveFromArray);\n\n // Add ES imports\n result = addEsImports(result, filePath, toAdd);\n\n // Remove consolidated class names from ES imports\n if (toRemoveFromArray.length > 0) {\n result = removeFromEsImports(result, filePath, toRemoveFromArray);\n }\n\n return result;\n}\n\ninterface ImportsArrayInfo {\n arrayNode: ts.ArrayLiteralExpression;\n decoratorType: 'Component' | 'NgModule';\n}\n\nfunction findDecoratorImportsArray(sf: ts.SourceFile, source: string, decoratorStartHint: number): ImportsArrayInfo | null {\n let found: ImportsArrayInfo | null = null;\n\n const visit = (node: ts.Node): void => {\n if (found) return;\n if (ts.isClassDeclaration(node)) {\n const decs = ts.getDecorators(node);\n if (!decs) return;\n for (const dec of decs) {\n if (!ts.isCallExpression(dec.expression)) continue;\n if (!ts.isIdentifier(dec.expression.expression)) continue;\n const decName = dec.expression.expression.text;\n if (decName !== 'Component' && decName !== 'NgModule') continue;\n if (Math.abs(dec.getStart() - decoratorStartHint) > 5) continue; // Match by position\n\n const metadata = dec.expression.arguments[0];\n if (!ts.isObjectLiteralExpression(metadata)) continue;\n\n for (const prop of metadata.properties) {\n if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name) && prop.name.text === 'imports') {\n if (ts.isArrayLiteralExpression(prop.initializer)) {\n found = { arrayNode: prop.initializer, decoratorType: decName as 'Component' | 'NgModule' };\n return;\n }\n }\n }\n\n // No imports array found — create one\n if (!found && decName === 'Component') {\n // We need to add `imports: []` to the decorator\n // Insert after the last property\n const lastProp = metadata.properties[metadata.properties.length - 1];\n if (lastProp) {\n const insertPos = lastProp.getEnd();\n const indent = detectIndent(source, metadata.getStart());\n const insertion = `,\\n${indent} imports: []`;\n const newSource = source.slice(0, insertPos) + insertion + source.slice(insertPos);\n // Re-parse to get the array node\n const newSf = ts.createSourceFile('', newSource, ts.ScriptTarget.Latest, true);\n const newArray = findImportsArrayInSource(newSf);\n if (newArray) {\n // We can't return a node from a different source file in the general case.\n // Instead, we'll handle the \"no imports array\" case by adding it inline.\n found = null; // Will be handled separately\n }\n }\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n visit(sf);\n return found;\n}\n\nfunction findImportsArrayInSource(sf: ts.SourceFile): ts.ArrayLiteralExpression | null {\n let found: ts.ArrayLiteralExpression | null = null;\n const visit = (node: ts.Node): void => {\n if (found) return;\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && node.name.text === 'imports' && ts.isArrayLiteralExpression(node.initializer)) {\n found = node.initializer;\n }\n ts.forEachChild(node, visit);\n };\n visit(sf);\n return found;\n}\n\nfunction updateDecoratorImportsArray(source: string, filePath: string, arrayNode: ts.ArrayLiteralExpression, toAdd: ImportToAdd[], toRemove: string[]): string {\n const sf = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n\n // Rebuild the array content\n const existingElements: string[] = [];\n for (const el of arrayNode.elements) {\n const text = source.slice(el.getStart(sf), el.getEnd()).trim();\n // Check if this element should be removed (consolidation)\n if (ts.isIdentifier(el) && toRemove.includes(el.text)) continue;\n existingElements.push(text);\n }\n\n // Add new entries\n for (const imp of toAdd) {\n const entry = imp.isSpread ? `...${imp.symbol}` : imp.symbol;\n if (!existingElements.includes(entry)) {\n existingElements.push(entry);\n }\n }\n\n // Determine formatting\n const arrayStart = arrayNode.getStart(sf);\n const arrayEnd = arrayNode.getEnd();\n const originalText = source.slice(arrayStart, arrayEnd);\n const isMultiline = originalText.includes('\\n');\n\n let newArrayText: string;\n if (isMultiline || existingElements.length > 3) {\n const indent = detectIndent(source, arrayStart);\n const itemIndent = indent + ' ';\n newArrayText = `[\\n${existingElements.map(e => `${itemIndent}${e},`).join('\\n')}\\n${indent}]`;\n } else {\n newArrayText = `[${existingElements.join(', ')}]`;\n }\n\n return source.slice(0, arrayStart) + newArrayText + source.slice(arrayEnd);\n}\n\nfunction addEsImports(source: string, filePath: string, imports: ImportToAdd[]): string {\n let result = source;\n\n // Group by import path\n const byPath = new Map<string, string[]>();\n for (const imp of imports) {\n const existing = byPath.get(imp.importPath) || [];\n existing.push(imp.symbol);\n byPath.set(imp.importPath, existing);\n }\n\n for (const [importPath, symbols] of byPath) {\n const sf = ts.createSourceFile(filePath, result, ts.ScriptTarget.Latest, true);\n\n // Check if there's already an import from this path\n const existingImport = sf.statements.find(\n (s): s is ts.ImportDeclaration =>\n ts.isImportDeclaration(s) && ts.isStringLiteral(s.moduleSpecifier) && s.moduleSpecifier.text === importPath,\n );\n\n if (existingImport?.importClause?.namedBindings && ts.isNamedImports(existingImport.importClause.namedBindings)) {\n // Extend existing import\n const namedBindings = existingImport.importClause.namedBindings;\n const existingNames = namedBindings.elements.map(el => el.name.text);\n const newNames = symbols.filter(s => !existingNames.includes(s));\n if (newNames.length === 0) continue;\n\n const allNames = [...existingNames, ...newNames].sort();\n const newClause = `{ ${allNames.join(', ')} }`;\n result = result.slice(0, namedBindings.getStart(sf)) + newClause + result.slice(namedBindings.getEnd());\n } else {\n // Add new import statement\n const sortedSymbols = [...symbols].sort();\n const newImport = `import { ${sortedSymbols.join(', ')} } from '${importPath}';\\n`;\n\n // Insert after the last existing import\n const lastImport = [...sf.statements].reverse().find(ts.isImportDeclaration);\n if (lastImport) {\n const pos = lastImport.getEnd();\n result = result.slice(0, pos) + '\\n' + newImport.trimEnd() + result.slice(pos);\n } else {\n result = newImport + result;\n }\n }\n }\n\n return result;\n}\n\nfunction detectIndent(source: string, pos: number): string {\n const lineStart = source.lastIndexOf('\\n', pos - 1) + 1;\n const match = source.slice(lineStart, pos).match(/^(\\s*)/);\n return match ? match[1] : '';\n}\n\nfunction removeFromEsImports(source: string, filePath: string, symbolsToRemove: string[]): string {\n let result = source;\n const sf = ts.createSourceFile(filePath, result, ts.ScriptTarget.Latest, true);\n\n for (const stmt of sf.statements) {\n if (!ts.isImportDeclaration(stmt) || !stmt.importClause?.namedBindings || !ts.isNamedImports(stmt.importClause.namedBindings)) continue;\n const namedBindings = stmt.importClause.namedBindings;\n const existingNames = namedBindings.elements.map(el => el.name.text);\n const remaining = existingNames.filter(n => !symbolsToRemove.includes(n));\n\n if (remaining.length === existingNames.length) continue; // Nothing to remove from this import\n\n if (remaining.length === 0) {\n // Remove the entire import statement\n result = result.slice(0, stmt.getStart(sf)) + result.slice(stmt.getEnd()).replace(/^\\r?\\n/, '');\n } else {\n const newClause = `{ ${remaining.join(', ')} }`;\n result = result.slice(0, namedBindings.getStart(sf)) + newClause + result.slice(namedBindings.getEnd());\n }\n break; // Only process the first matching import for the consolidated symbols\n }\n\n return result;\n}\n",
|
|
2101
2089
|
"displayName": "Schema",
|
|
2102
2090
|
"properties": [
|
|
2103
2091
|
{
|
|
@@ -2109,7 +2097,7 @@
|
|
|
2109
2097
|
"indexKey": "",
|
|
2110
2098
|
"optional": true,
|
|
2111
2099
|
"description": "",
|
|
2112
|
-
"line":
|
|
2100
|
+
"line": 9,
|
|
2113
2101
|
"rawdescription": "\n"
|
|
2114
2102
|
},
|
|
2115
2103
|
{
|
|
@@ -2121,7 +2109,19 @@
|
|
|
2121
2109
|
"indexKey": "",
|
|
2122
2110
|
"optional": true,
|
|
2123
2111
|
"description": "",
|
|
2124
|
-
"line":
|
|
2112
|
+
"line": 8,
|
|
2113
|
+
"rawdescription": "\n"
|
|
2114
|
+
},
|
|
2115
|
+
{
|
|
2116
|
+
"name": "useClassArray",
|
|
2117
|
+
"coverageIgnore": false,
|
|
2118
|
+
"deprecated": false,
|
|
2119
|
+
"deprecationMessage": "",
|
|
2120
|
+
"type": "boolean",
|
|
2121
|
+
"indexKey": "",
|
|
2122
|
+
"optional": true,
|
|
2123
|
+
"description": "",
|
|
2124
|
+
"line": 10,
|
|
2125
2125
|
"rawdescription": "\n"
|
|
2126
2126
|
}
|
|
2127
2127
|
],
|
|
@@ -2139,12 +2139,12 @@
|
|
|
2139
2139
|
},
|
|
2140
2140
|
{
|
|
2141
2141
|
"name": "Schema",
|
|
2142
|
-
"id": "interface-Schema-
|
|
2143
|
-
"file": "packages/core/schematics/
|
|
2142
|
+
"id": "interface-Schema-4fe31ff3e9f1d34845a6b865d605e215f33552094b88c3d0eab0b180187fe64ce4d68d687516cb3d62c57d2678a103969b2dacbb18a49b26060f78096678fcce-2",
|
|
2143
|
+
"file": "packages/core/schematics/fix-no-multiple-empty-lines/index.ts",
|
|
2144
2144
|
"deprecated": false,
|
|
2145
2145
|
"deprecationMessage": "",
|
|
2146
2146
|
"type": "interface",
|
|
2147
|
-
"sourceCode": "
|
|
2147
|
+
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst MULTIPLE_EMPTY_LINES = /\\n{3,}/g;\n\nexport function fixNoMultipleEmptyLines(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (filePath) => {\n const buffer = tree.read(filePath);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n const result = original.replace(MULTIPLE_EMPTY_LINES, '\\n\\n');\n\n if (result !== original) {\n if (filePath.endsWith('.ts')) {\n const sourceFile = ts.createSourceFile(filePath, result, ts.ScriptTarget.Latest, true);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((sourceFile as any).parseDiagnostics?.length) {\n context.logger.warn(`Skipping ${filePath}: file would not parse after transformation.`);\n return;\n }\n }\n if (options.dryRun) {\n logDryRun(context, `Would collapse multiple empty lines in ${filePath}`);\n } else {\n tree.overwrite(filePath, result);\n }\n count++;\n }\n });\n\n context.logger.info(`Fixed multiple empty lines in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.ts') && !file.endsWith('.html') && !file.endsWith('.scss') && !file.endsWith('.css')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2148
2148
|
"displayName": "Schema",
|
|
2149
2149
|
"properties": [
|
|
2150
2150
|
{
|
|
@@ -2155,9 +2155,9 @@
|
|
|
2155
2155
|
"type": "boolean",
|
|
2156
2156
|
"indexKey": "",
|
|
2157
2157
|
"optional": true,
|
|
2158
|
-
"description": "
|
|
2159
|
-
"line":
|
|
2160
|
-
"rawdescription": "\
|
|
2158
|
+
"description": "",
|
|
2159
|
+
"line": 7,
|
|
2160
|
+
"rawdescription": "\n"
|
|
2161
2161
|
},
|
|
2162
2162
|
{
|
|
2163
2163
|
"name": "path",
|
|
@@ -2167,9 +2167,9 @@
|
|
|
2167
2167
|
"type": "string",
|
|
2168
2168
|
"indexKey": "",
|
|
2169
2169
|
"optional": true,
|
|
2170
|
-
"description": "
|
|
2171
|
-
"line":
|
|
2172
|
-
"rawdescription": "\
|
|
2170
|
+
"description": "",
|
|
2171
|
+
"line": 6,
|
|
2172
|
+
"rawdescription": "\n"
|
|
2173
2173
|
}
|
|
2174
2174
|
],
|
|
2175
2175
|
"indexSignatures": [],
|
|
@@ -2715,12 +2715,12 @@
|
|
|
2715
2715
|
},
|
|
2716
2716
|
{
|
|
2717
2717
|
"name": "Schema",
|
|
2718
|
-
"id": "interface-Schema-
|
|
2719
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2718
|
+
"id": "interface-Schema-a806c1769fb526271565003a6a3ef9ab4c67e421d93ee0cb54e1f6de223807afc1f16ad294656ef614a77a91a38cc914ce41ac97ed3a8a4195a1e74a729c0c08-14",
|
|
2719
|
+
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
2720
2720
|
"deprecated": false,
|
|
2721
2721
|
"deprecationMessage": "",
|
|
2722
2722
|
"type": "interface",
|
|
2723
|
-
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst
|
|
2723
|
+
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst REMOVED_INPUTS = new Set(['type']);\n\nexport function migrateEuiPopover(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes('eui-popover')) return;\n\n const result = path.endsWith('.html')\n ? migrateTemplate(original)\n : migrateInlineTemplates(original);\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would remove 'type' input in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n\n // Warn about TS usages inline\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts') && (original.includes('eui-popover') || original.includes('euiPopover') || original.includes('EuiPopover'))) {\n if (original.includes('type')) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && node.name.text === 'type') {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${path}:${line + 1} - Manual action needed: \"type\" is no longer a valid input on eui-popover. Remove this assignment.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n }\n });\n\n context.logger.info(`Removed deprecated eui-popover 'type' input from ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const removals: { start: number; end: number }[] = [];\n\n visitNodes(parsed.nodes, removals);\n\n let result = source;\n for (const { start, end } of removals.sort((a, b) => b.start - a.start)) {\n // Extend start backwards to consume leading whitespace\n let adjustedStart = start;\n while (adjustedStart > 0 && (result[adjustedStart - 1] === ' ' || result[adjustedStart - 1] === '\\t')) {\n adjustedStart--;\n }\n result = result.slice(0, adjustedStart) + result.slice(end);\n }\n\n return result;\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const templateRegex = /template\\s*:\\s*`([^`]*)`/gs;\n return source.replace(templateRegex, (match, templateContent: string) => {\n if (!templateContent.includes('eui-popover')) return match;\n const migrated = migrateTemplate(templateContent);\n if (migrated === templateContent) return match;\n return match.replace(templateContent, migrated);\n });\n}\n\nfunction visitNodes(nodes: TmplAstNode[], removals: { start: number; end: number }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === 'eui-popover') {\n collectRemovals(node, removals);\n }\n visitNodes(node.children, removals);\n }\n }\n}\n\nfunction collectRemovals(element: TmplAstElement, removals: { start: number; end: number }[]): void {\n for (const attr of element.attributes) {\n if (REMOVED_INPUTS.has(attr.name)) {\n removals.push(getAttributeSpan(attr));\n }\n }\n for (const input of element.inputs) {\n if (REMOVED_INPUTS.has(input.name)) {\n removals.push(getAttributeSpan(input));\n }\n }\n}\n\nfunction getAttributeSpan(attr: TmplAstTextAttribute | TmplAstBoundAttribute): { start: number; end: number } {\n return { start: attr.sourceSpan.start.offset, end: attr.sourceSpan.end.offset };\n}\n",
|
|
2724
2724
|
"displayName": "Schema",
|
|
2725
2725
|
"properties": [
|
|
2726
2726
|
{
|
|
@@ -2762,12 +2762,12 @@
|
|
|
2762
2762
|
},
|
|
2763
2763
|
{
|
|
2764
2764
|
"name": "Schema",
|
|
2765
|
-
"id": "interface-Schema-
|
|
2766
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2765
|
+
"id": "interface-Schema-90e62c16ce9ada881e8d434336bb633dae9745236106ddf60964afbd11de6aa579255a13d6036b384281860eb6ed2ee329194b519c51fdaf20f79bc511d0f64f-15",
|
|
2766
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
2767
2767
|
"deprecated": false,
|
|
2768
2768
|
"deprecationMessage": "",
|
|
2769
2769
|
"type": "interface",
|
|
2770
|
-
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst
|
|
2770
|
+
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst INPUT_RENAMES = new Map([\n ['iconLabelClass', 'icon'],\n ['iconLabelStyleClass', 'fillColor'],\n]);\n\nexport function migrateEuiProgressCircle(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const oldNames = [...INPUT_RENAMES.keys()];\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n if (original.includes('eui-progress-circle')) {\n const result = path.endsWith('.html')\n ? migrateTemplate(original)\n : migrateInlineTemplates(original);\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename deprecated inputs in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n }\n\n // Warn about TS property access usages (merged from warnTsUsages)\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts')) {\n if (oldNames.some((name) => original.includes(name))) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && INPUT_RENAMES.has(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const newName = INPUT_RENAMES.get(node.name.text);\n context.logger.warn(\n `${path}:${line + 1} - \"${node.name.text}\" has been renamed to \"${newName}\" on eui-progress-circle. Update this reference manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n }\n });\n\n context.logger.info(`Renamed deprecated eui-progress-circle inputs in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n visitNodes(parsed.nodes, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: { start: number; end: number; text: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes('eui-progress-circle')) {\n ts.forEachChild(node, visit);\n return;\n }\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) {\n changes.push({ start, end, text: migrated });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n let result = source;\n for (const change of changes.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n return result;\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n}\n\nfunction visitNodes(nodes: TmplAstNode[], edits: { start: number; end: number; replacement: string }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === 'eui-progress-circle') {\n collectRenames(node, edits);\n }\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const attr of element.attributes) {\n const newName = INPUT_RENAMES.get(attr.name);\n if (newName) {\n edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n }\n for (const input of element.inputs) {\n const newName = INPUT_RENAMES.get(input.name);\n if (newName) {\n edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n }\n}\n\nfunction applyEdits(source: string, edits: { start: number; end: number; replacement: string }[]): string {\n let result = source;\n for (const edit of edits.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n",
|
|
2771
2771
|
"displayName": "Schema",
|
|
2772
2772
|
"properties": [
|
|
2773
2773
|
{
|
|
@@ -2809,12 +2809,12 @@
|
|
|
2809
2809
|
},
|
|
2810
2810
|
{
|
|
2811
2811
|
"name": "Schema",
|
|
2812
|
-
"id": "interface-Schema-
|
|
2813
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2812
|
+
"id": "interface-Schema-91c9f900bf3ebb82488fb65644938ef486ceaa447cff8bfd9d710df9595d82acb267b26f3c252173bc684353f362473120226426ed7ee5d98b33e30011dd9383-16",
|
|
2813
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
2814
2814
|
"deprecated": false,
|
|
2815
2815
|
"deprecationMessage": "",
|
|
2816
2816
|
"type": "interface",
|
|
2817
|
-
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst INPUT_RENAMES = new Map([\n ['iconLabelClass', 'icon'],\n ['iconLabelStyleClass', 'fillColor'],\n]);\n\nexport function migrateEuiProgressCircle(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const oldNames = [...INPUT_RENAMES.keys()];\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n if (original.includes('eui-progress-circle')) {\n const result = path.endsWith('.html')\n ? migrateTemplate(original)\n : migrateInlineTemplates(original);\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename deprecated inputs in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n }\n\n // Warn about TS property access usages (merged from warnTsUsages)\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts')) {\n if (oldNames.some((name) => original.includes(name))) {\n const sourceFile = ts.createSourceFile(path, original, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && INPUT_RENAMES.has(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n const newName = INPUT_RENAMES.get(node.name.text);\n context.logger.warn(\n `${path}:${line + 1} - \"${node.name.text}\" has been renamed to \"${newName}\" on eui-progress-circle. Update this reference manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n }\n });\n\n context.logger.info(`Renamed deprecated eui-progress-circle inputs in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n visitNodes(parsed.nodes, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: { start: number; end: number; text: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes('eui-progress-circle')) {\n ts.forEachChild(node, visit);\n return;\n }\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) {\n changes.push({ start, end, text: migrated });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n let result = source;\n for (const change of changes.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n return result;\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n}\n\nfunction visitNodes(nodes: TmplAstNode[], edits: { start: number; end: number; replacement: string }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === 'eui-progress-circle') {\n collectRenames(node, edits);\n }\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const attr of element.attributes) {\n const newName = INPUT_RENAMES.get(attr.name);\n if (newName) {\n edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n }\n for (const input of element.inputs) {\n const newName = INPUT_RENAMES.get(input.name);\n if (newName) {\n edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n }\n}\n\nfunction applyEdits(source: string, edits: { start: number; end: number; replacement: string }[]): string {\n let result = source;\n for (const edit of edits.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n",
|
|
2817
|
+
"sourceCode": "import { BindingPipe, parseTemplate, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstBoundText, TmplAstElement, TmplAstNode, TmplAstTemplate, TmplAstTextAttribute, AST, ASTWithSource, Interpolation } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Edit { start: number; end: number; replacement: string; }\n\n// --- Table-level input renames (on elements with euiTable attribute) ---\nconst TABLE_INPUT_RENAMES = new Map([\n ['rows', 'data'],\n ['loading', 'isLoading'],\n ['asyncTable', 'isAsync'],\n ['euiTableResponsive', 'isTableResponsive'],\n ['euiTableFixedLayout', 'isTableFixedLayout'],\n ['euiTableCompact', 'isTableCompact'],\n ['hasStickyColumns', 'hasStickyCols'],\n]);\n\n// --- Child element input renames (scoped to euiTable context) ---\nconst TH_TD_INPUT_RENAMES = new Map([\n ['isStickyColumn', 'isStickyCol'],\n ['sortable', 'isSortable'],\n]);\n\nconst TR_INPUT_RENAMES = new Map([\n ['isSelectableHeader', 'isHeaderSelectable'],\n ['isSelectable', 'isDataSelectable'],\n]);\n\n// --- Removed inputs ---\nconst REMOVED_INPUTS = new Set(['euiTableBordered', 'isHoverable', 'defaultMultiOrder', 'paginable']);\n\n// --- Output renames/removals ---\nconst OUTPUT_RENAMES = new Map([['selectedRows', 'rowsSelect']]);\nconst REMOVED_OUTPUTS = new Set(['multiSortChange']);\n\n// --- Pipe rename ---\nconst OLD_PIPE = 'euiTableHighlightFilter';\nconst NEW_PIPE = 'euiTableHighlight';\n\n// --- TS property renames ---\nconst TS_PROPERTY_RENAMES = new Map([['filteredRows', 'getFilteredData']]);\n\nconst PAGINATOR_IMPORT_PATH = '@eui/components/eui-paginator';\nconst PAGINATOR_COMPONENT = 'EuiPaginatorComponent';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nexport function migrateEuiTable(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const paginatorHtmlFiles = new Set<string>();\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes('euiTable') && !original.includes(OLD_PIPE) && !original.includes('filteredRows') && !original.includes('setSort')) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n const { output, hasPaginator } = migrateTemplateWithPaginator(original, path, context);\n result = output;\n if (hasPaginator) paginatorHtmlFiles.add(path);\n } else {\n const { output, hasPaginator } = migrateTypeScript(original, path, context);\n result = output;\n if (hasPaginator) {\n result = addPaginatorImport(result, path);\n }\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate eui-table breaking changes in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n });\n\n // Handle paginator imports for external templates\n if (paginatorHtmlFiles.size > 0) {\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!source.includes('templateUrl')) return;\n\n for (const htmlFile of paginatorHtmlFiles) {\n const htmlFileName = htmlFile.split('/').pop()!;\n if (source.includes(htmlFileName)) {\n const updated = addPaginatorImport(source, path);\n if (updated !== source) {\n if (options.dryRun) {\n logDryRun(context, `Would add paginator import in ${path}`);\n } else {\n tree.overwrite(path, updated);\n }\n count++;\n }\n break;\n }\n }\n });\n }\n\n context.logger.info(`Migrated eui-table in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction migrateTemplateWithPaginator(source: string, filePath: string, context: SchematicContext): { output: string; hasPaginator: boolean } {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n let hasPaginator = false;\n\n const paginatorResult = visitNodesForTable(parsed.nodes, source, edits, false, filePath, context);\n if (paginatorResult) hasPaginator = true;\n\n collectPipeRenames(parsed.nodes, source, edits);\n\n return { output: applyEdits(source, edits), hasPaginator };\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): string {\n return migrateTemplateWithPaginator(source, filePath, context).output;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, context: SchematicContext): { output: string; hasPaginator: boolean } {\n let result = source;\n let hasPaginator = false;\n\n // Migrate inline templates\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = result.slice(start, end);\n if (!rawTemplate.includes('euiTable') && !rawTemplate.includes(OLD_PIPE)) {\n ts.forEachChild(node, visit); return;\n}\n const { output: migrated, hasPaginator: pag } = migrateTemplateWithPaginator(rawTemplate, filePath, context);\n if (pag) hasPaginator = true;\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n result = applyEdits(result, changes);\n\n // Rename TS property accesses\n result = renameTsProperties(result);\n\n // Warn about setSort\n warnSetSort(result, filePath, context);\n\n return { output: result, hasPaginator };\n}\n\nfunction renameTsProperties(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && TS_PROPERTY_RENAMES.has(node.name.text)) {\n edits.push({ start: node.name.getStart(sourceFile), end: node.name.getEnd(), replacement: TS_PROPERTY_RENAMES.get(node.name.text)! });\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return applyEdits(source, edits);\n}\n\nfunction warnSetSort(source: string, filePath: string, context: SchematicContext): void {\n if (!source.includes('setSort')) return;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) &&\n ts.isIdentifier(node.expression.name) && node.expression.name.text === 'setSort') {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"setSort\" signature changed from setSort(sort: string, order: \"asc\" | \"desc\") to setSort(Sort[]). Update manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n}\n\n// --- Template AST visitors ---\n\nfunction visitNodesForTable(\n nodes: TmplAstNode[], source: string, edits: Edit[], insideEuiTable: boolean, filePath: string, context: SchematicContext,\n): boolean {\n let hasPaginator = false;\n\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n const isEuiTable = hasEuiTableAttribute(node);\n\n if (isEuiTable) {\n collectTableInputRenames(node, edits);\n collectInputRemovals(node, source, edits, filePath, context);\n collectOutputChanges(node, source, edits, filePath, context);\n if (collectPaginatorMigration(node, source, edits)) hasPaginator = true;\n }\n\n if (isEuiTable || insideEuiTable) {\n collectChildElementRenames(node, edits);\n collectChildInputRemovals(node, source, edits, filePath, context);\n collectEmptyMessageRename(node, edits);\n }\n\n const childResult = visitNodesForTable(node.children, source, edits, isEuiTable || insideEuiTable, filePath, context);\n if (childResult) hasPaginator = true;\n }\n\n if (node instanceof TmplAstTemplate) {\n if (insideEuiTable) {\n collectTemplateEmptyMessageRename(node, edits);\n }\n const childResult = visitNodesForTable(node.children, source, edits, insideEuiTable, filePath, context);\n if (childResult) hasPaginator = true;\n }\n }\n\n return hasPaginator;\n}\n\nfunction hasEuiTableAttribute(element: TmplAstElement): boolean {\n return element.attributes.some((a) => a.name === 'euiTable') ||\n element.inputs.some((i) => i.name === 'euiTable');\n}\n\nfunction collectTableInputRenames(element: TmplAstElement, edits: Edit[]): void {\n for (const attr of element.attributes) {\n const newName = TABLE_INPUT_RENAMES.get(attr.name);\n if (newName) edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n for (const input of element.inputs) {\n const newName = TABLE_INPUT_RENAMES.get(input.name);\n if (newName) edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n}\n\nfunction collectChildElementRenames(element: TmplAstElement, edits: Edit[]): void {\n const renames = (element.name === 'th' || element.name === 'td') ? TH_TD_INPUT_RENAMES\n : element.name === 'tr' ? TR_INPUT_RENAMES : null;\n if (!renames) return;\n\n for (const attr of element.attributes) {\n const newName = renames.get(attr.name);\n if (newName) edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n for (const input of element.inputs) {\n const newName = renames.get(input.name);\n if (newName) edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n}\n\nfunction collectChildInputRemovals(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n const childRemovedInputs = new Set(['defaultMultiOrder']);\n\n for (const attr of element.attributes) {\n if (childRemovedInputs.has(attr.name)) {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n logRemovalWarning(attr.name, filePath, element, context);\n }\n }\n for (const input of element.inputs) {\n if (childRemovedInputs.has(input.name)) {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n logRemovalWarning(input.name, filePath, element, context);\n }\n }\n}\n\nfunction collectInputRemovals(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const attr of element.attributes) {\n if (REMOVED_INPUTS.has(attr.name) && attr.name !== 'paginable') {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n logRemovalWarning(attr.name, filePath, element, context);\n }\n }\n for (const input of element.inputs) {\n if (REMOVED_INPUTS.has(input.name) && input.name !== 'paginable') {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n logRemovalWarning(input.name, filePath, element, context);\n }\n }\n}\n\nfunction collectOutputChanges(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const output of element.outputs) {\n const newName = OUTPUT_RENAMES.get(output.name);\n if (newName) {\n edits.push({ start: output.keySpan!.start.offset, end: output.keySpan!.end.offset, replacement: newName });\n }\n if (REMOVED_OUTPUTS.has(output.name)) {\n removeAttribute(output.sourceSpan.start.offset, output.sourceSpan.end.offset, source, edits);\n const { line } = element.startSourceSpan.start;\n context.logger.warn(\n `${filePath}:${line + 1} - \"(${output.name})\" removed. Multi-sort is now supported by (sortChange) output.`,\n );\n }\n }\n}\n\nfunction collectPaginatorMigration(element: TmplAstElement, source: string, edits: Edit[]): boolean {\n let found = false;\n\n for (const attr of element.attributes) {\n if (attr.name === 'paginable') {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n found = true;\n }\n }\n for (const input of element.inputs) {\n if (input.name === 'paginable') {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n found = true;\n }\n }\n\n if (found) {\n // Add [paginator]=\"paginator\" before closing > of opening tag\n const insertPos = element.startSourceSpan.end.offset - 1;\n edits.push({ start: insertPos, end: insertPos, replacement: ' [paginator]=\"paginator\"' });\n\n // Add eui-paginator after </table>\n if (element.endSourceSpan) {\n const afterTable = element.endSourceSpan.end.offset;\n edits.push({\n start: afterTable,\n end: afterTable,\n replacement: '\\n<!-- TODO: Configure paginator and implement onPageChange handler -->\\n<eui-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\" />',\n });\n }\n }\n\n return found;\n}\n\nfunction collectEmptyMessageRename(element: TmplAstElement, edits: Edit[]): void {\n // Handle direct attribute on elements (unlikely but handle)\n for (const attr of element.attributes) {\n if (attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n}\n\nfunction collectTemplateEmptyMessageRename(template: TmplAstTemplate, edits: Edit[]): void {\n for (const attr of template.templateAttrs) {\n if (attr instanceof TmplAstTextAttribute && attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n for (const attr of template.attributes) {\n if (attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n}\n\n// --- Pipe rename via AST ---\n\nfunction collectPipeRenames(nodes: TmplAstNode[], source: string, edits: Edit[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n for (const input of node.inputs) {\n visitExpressionForPipes(input.value, edits);\n }\n for (const output of node.outputs) {\n if (output.handler) visitExpressionForPipes(output.handler, edits);\n }\n collectPipeRenames(node.children, source, edits);\n }\n if (node instanceof TmplAstTemplate) {\n for (const input of node.inputs) {\n visitExpressionForPipes(input.value, edits);\n }\n collectPipeRenames(node.children, source, edits);\n }\n if (node instanceof TmplAstBoundText) {\n visitExpressionForPipes(node.value, edits);\n }\n }\n}\n\nfunction visitExpressionForPipes(expr: AST, edits: Edit[]): void {\n if (expr instanceof ASTWithSource && expr.ast) {\n visitAstForPipes(expr.ast, edits);\n } else {\n visitAstForPipes(expr, edits);\n }\n}\n\nfunction visitAstForPipes(ast: AST, edits: Edit[]): void {\n if (ast instanceof BindingPipe) {\n if (ast.name === OLD_PIPE && ast.nameSpan) {\n edits.push({ start: ast.nameSpan.start, end: ast.nameSpan.end, replacement: NEW_PIPE });\n }\n visitAstForPipes(ast.exp, edits);\n for (const arg of ast.args) {\n visitAstForPipes(arg, edits);\n }\n return;\n }\n\n if (ast instanceof Interpolation) {\n for (const expr of ast.expressions) {\n visitAstForPipes(expr, edits);\n }\n return;\n }\n\n // Recursively visit all properties that could contain AST nodes\n for (const key of Object.keys(ast)) {\n // eslint-disable-next-line\n const val = (ast as any)[key];\n if (val instanceof AST) {\n visitAstForPipes(val, edits);\n } else if (Array.isArray(val)) {\n for (const item of val) {\n if (item instanceof AST) visitAstForPipes(item, edits);\n }\n }\n }\n}\n\n// --- Import handling for paginator ---\n\nfunction addPaginatorImport(source: string, filePath: string): string {\n if (source.includes(PAGINATOR_COMPONENT)) return source;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Add import statement after last import\n let lastImportEnd = 0;\n for (const stmt of sourceFile.statements) {\n if (ts.isImportDeclaration(stmt)) {\n lastImportEnd = stmt.getEnd();\n }\n }\n\n if (lastImportEnd > 0) {\n edits.push({\n start: lastImportEnd,\n end: lastImportEnd,\n replacement: `\\nimport { ${PAGINATOR_COMPONENT} } from '${PAGINATOR_IMPORT_PATH}';`,\n });\n }\n\n // Add to component imports array\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && node.name.text === 'imports' && isComponentMetadataProperty(node)) {\n if (ts.isArrayLiteralExpression(node.initializer)) {\n const arr = node.initializer;\n const elements = arr.elements;\n if (elements.length > 0) {\n const lastElement = elements[elements.length - 1];\n edits.push({\n start: lastElement.getEnd(),\n end: lastElement.getEnd(),\n replacement: `, ${PAGINATOR_COMPONENT}`,\n });\n } else {\n const insertPos = arr.getStart(sourceFile) + 1;\n edits.push({ start: insertPos, end: insertPos, replacement: PAGINATOR_COMPONENT });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return applyEdits(source, edits);\n}\n\n// --- Helpers ---\n\nfunction removeAttribute(start: number, end: number, source: string, edits: Edit[]): void {\n let adjustedStart = start;\n while (adjustedStart > 0 && (source[adjustedStart - 1] === ' ' || source[adjustedStart - 1] === '\\t')) {\n adjustedStart--;\n }\n edits.push({ start: adjustedStart, end, replacement: '' });\n}\n\nfunction logRemovalWarning(name: string, filePath: string, element: TmplAstElement, context: SchematicContext): void {\n const { line } = element.startSourceSpan.start;\n if (name === 'defaultMultiOrder') {\n context.logger.warn(`${filePath}:${line + 1} - \"[${name}]\" removed. Use setSort(Sort[]) to initialize sorting.`);\n } else {\n context.logger.warn(`${filePath}:${line + 1} - \"[${name}]\" removed to align to Design System.`);\n }\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n const unique = new Map<string, Edit>();\n for (const edit of edits) {\n const key = `${edit.start}:${edit.end}`;\n unique.set(key, edit);\n }\n let result = source;\n for (const edit of [...unique.values()].sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2818
2818
|
"displayName": "Schema",
|
|
2819
2819
|
"properties": [
|
|
2820
2820
|
{
|
|
@@ -2826,7 +2826,7 @@
|
|
|
2826
2826
|
"indexKey": "",
|
|
2827
2827
|
"optional": true,
|
|
2828
2828
|
"description": "",
|
|
2829
|
-
"line":
|
|
2829
|
+
"line": 49,
|
|
2830
2830
|
"rawdescription": "\n"
|
|
2831
2831
|
},
|
|
2832
2832
|
{
|
|
@@ -2838,7 +2838,7 @@
|
|
|
2838
2838
|
"indexKey": "",
|
|
2839
2839
|
"optional": true,
|
|
2840
2840
|
"description": "",
|
|
2841
|
-
"line":
|
|
2841
|
+
"line": 48,
|
|
2842
2842
|
"rawdescription": "\n"
|
|
2843
2843
|
}
|
|
2844
2844
|
],
|
|
@@ -2856,12 +2856,12 @@
|
|
|
2856
2856
|
},
|
|
2857
2857
|
{
|
|
2858
2858
|
"name": "Schema",
|
|
2859
|
-
"id": "interface-Schema-
|
|
2860
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2859
|
+
"id": "interface-Schema-760dec88d3f709d5b38226e55f7cbfb1e5fabcea6c004fd46e611be1dd563b8b247e9e6c77667e5582fe7b443374ba2c4facd2b2db2985edb46c9a4a37a8a876-17",
|
|
2860
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
2861
2861
|
"deprecated": false,
|
|
2862
2862
|
"deprecationMessage": "",
|
|
2863
2863
|
"type": "interface",
|
|
2864
|
-
"sourceCode": "import { BindingPipe, parseTemplate, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstBoundText, TmplAstElement, TmplAstNode, TmplAstTemplate, TmplAstTextAttribute, AST, ASTWithSource, Interpolation } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Edit { start: number; end: number; replacement: string; }\n\n// --- Table-level input renames (on elements with euiTable attribute) ---\nconst TABLE_INPUT_RENAMES = new Map([\n ['rows', 'data'],\n ['loading', 'isLoading'],\n ['asyncTable', 'isAsync'],\n ['euiTableResponsive', 'isTableResponsive'],\n ['euiTableFixedLayout', 'isTableFixedLayout'],\n ['euiTableCompact', 'isTableCompact'],\n ['hasStickyColumns', 'hasStickyCols'],\n]);\n\n// --- Child element input renames (scoped to euiTable context) ---\nconst TH_TD_INPUT_RENAMES = new Map([\n ['isStickyColumn', 'isStickyCol'],\n ['sortable', 'isSortable'],\n]);\n\nconst TR_INPUT_RENAMES = new Map([\n ['isSelectableHeader', 'isHeaderSelectable'],\n ['isSelectable', 'isDataSelectable'],\n]);\n\n// --- Removed inputs ---\nconst REMOVED_INPUTS = new Set(['euiTableBordered', 'isHoverable', 'defaultMultiOrder', 'paginable']);\n\n// --- Output renames/removals ---\nconst OUTPUT_RENAMES = new Map([['selectedRows', 'rowsSelect']]);\nconst REMOVED_OUTPUTS = new Set(['multiSortChange']);\n\n// --- Pipe rename ---\nconst OLD_PIPE = 'euiTableHighlightFilter';\nconst NEW_PIPE = 'euiTableHighlight';\n\n// --- TS property renames ---\nconst TS_PROPERTY_RENAMES = new Map([['filteredRows', 'getFilteredData']]);\n\nconst PAGINATOR_IMPORT_PATH = '@eui/components/eui-paginator';\nconst PAGINATOR_COMPONENT = 'EuiPaginatorComponent';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nexport function migrateEuiTable(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let count = 0;\n const paginatorHtmlFiles = new Set<string>();\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes('euiTable') && !original.includes(OLD_PIPE) && !original.includes('filteredRows') && !original.includes('setSort')) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n const { output, hasPaginator } = migrateTemplateWithPaginator(original, path, context);\n result = output;\n if (hasPaginator) paginatorHtmlFiles.add(path);\n } else {\n const { output, hasPaginator } = migrateTypeScript(original, path, context);\n result = output;\n if (hasPaginator) {\n result = addPaginatorImport(result, path);\n }\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate eui-table breaking changes in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n });\n\n // Handle paginator imports for external templates\n if (paginatorHtmlFiles.size > 0) {\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!source.includes('templateUrl')) return;\n\n for (const htmlFile of paginatorHtmlFiles) {\n const htmlFileName = htmlFile.split('/').pop()!;\n if (source.includes(htmlFileName)) {\n const updated = addPaginatorImport(source, path);\n if (updated !== source) {\n if (options.dryRun) {\n logDryRun(context, `Would add paginator import in ${path}`);\n } else {\n tree.overwrite(path, updated);\n }\n count++;\n }\n break;\n }\n }\n });\n }\n\n context.logger.info(`Migrated eui-table in ${count} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction migrateTemplateWithPaginator(source: string, filePath: string, context: SchematicContext): { output: string; hasPaginator: boolean } {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n let hasPaginator = false;\n\n const paginatorResult = visitNodesForTable(parsed.nodes, source, edits, false, filePath, context);\n if (paginatorResult) hasPaginator = true;\n\n collectPipeRenames(parsed.nodes, source, edits);\n\n return { output: applyEdits(source, edits), hasPaginator };\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): string {\n return migrateTemplateWithPaginator(source, filePath, context).output;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, context: SchematicContext): { output: string; hasPaginator: boolean } {\n let result = source;\n let hasPaginator = false;\n\n // Migrate inline templates\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = result.slice(start, end);\n if (!rawTemplate.includes('euiTable') && !rawTemplate.includes(OLD_PIPE)) {\n ts.forEachChild(node, visit); return;\n}\n const { output: migrated, hasPaginator: pag } = migrateTemplateWithPaginator(rawTemplate, filePath, context);\n if (pag) hasPaginator = true;\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n result = applyEdits(result, changes);\n\n // Rename TS property accesses\n result = renameTsProperties(result);\n\n // Warn about setSort\n warnSetSort(result, filePath, context);\n\n return { output: result, hasPaginator };\n}\n\nfunction renameTsProperties(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && TS_PROPERTY_RENAMES.has(node.name.text)) {\n edits.push({ start: node.name.getStart(sourceFile), end: node.name.getEnd(), replacement: TS_PROPERTY_RENAMES.get(node.name.text)! });\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return applyEdits(source, edits);\n}\n\nfunction warnSetSort(source: string, filePath: string, context: SchematicContext): void {\n if (!source.includes('setSort')) return;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) &&\n ts.isIdentifier(node.expression.name) && node.expression.name.text === 'setSort') {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"setSort\" signature changed from setSort(sort: string, order: \"asc\" | \"desc\") to setSort(Sort[]). Update manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n}\n\n// --- Template AST visitors ---\n\nfunction visitNodesForTable(\n nodes: TmplAstNode[], source: string, edits: Edit[], insideEuiTable: boolean, filePath: string, context: SchematicContext,\n): boolean {\n let hasPaginator = false;\n\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n const isEuiTable = hasEuiTableAttribute(node);\n\n if (isEuiTable) {\n collectTableInputRenames(node, edits);\n collectInputRemovals(node, source, edits, filePath, context);\n collectOutputChanges(node, source, edits, filePath, context);\n if (collectPaginatorMigration(node, source, edits)) hasPaginator = true;\n }\n\n if (isEuiTable || insideEuiTable) {\n collectChildElementRenames(node, edits);\n collectChildInputRemovals(node, source, edits, filePath, context);\n collectEmptyMessageRename(node, edits);\n }\n\n const childResult = visitNodesForTable(node.children, source, edits, isEuiTable || insideEuiTable, filePath, context);\n if (childResult) hasPaginator = true;\n }\n\n if (node instanceof TmplAstTemplate) {\n if (insideEuiTable) {\n collectTemplateEmptyMessageRename(node, edits);\n }\n const childResult = visitNodesForTable(node.children, source, edits, insideEuiTable, filePath, context);\n if (childResult) hasPaginator = true;\n }\n }\n\n return hasPaginator;\n}\n\nfunction hasEuiTableAttribute(element: TmplAstElement): boolean {\n return element.attributes.some((a) => a.name === 'euiTable') ||\n element.inputs.some((i) => i.name === 'euiTable');\n}\n\nfunction collectTableInputRenames(element: TmplAstElement, edits: Edit[]): void {\n for (const attr of element.attributes) {\n const newName = TABLE_INPUT_RENAMES.get(attr.name);\n if (newName) edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n for (const input of element.inputs) {\n const newName = TABLE_INPUT_RENAMES.get(input.name);\n if (newName) edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n}\n\nfunction collectChildElementRenames(element: TmplAstElement, edits: Edit[]): void {\n const renames = (element.name === 'th' || element.name === 'td') ? TH_TD_INPUT_RENAMES\n : element.name === 'tr' ? TR_INPUT_RENAMES : null;\n if (!renames) return;\n\n for (const attr of element.attributes) {\n const newName = renames.get(attr.name);\n if (newName) edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: newName });\n }\n for (const input of element.inputs) {\n const newName = renames.get(input.name);\n if (newName) edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: newName });\n }\n}\n\nfunction collectChildInputRemovals(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n const childRemovedInputs = new Set(['defaultMultiOrder']);\n\n for (const attr of element.attributes) {\n if (childRemovedInputs.has(attr.name)) {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n logRemovalWarning(attr.name, filePath, element, context);\n }\n }\n for (const input of element.inputs) {\n if (childRemovedInputs.has(input.name)) {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n logRemovalWarning(input.name, filePath, element, context);\n }\n }\n}\n\nfunction collectInputRemovals(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const attr of element.attributes) {\n if (REMOVED_INPUTS.has(attr.name) && attr.name !== 'paginable') {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n logRemovalWarning(attr.name, filePath, element, context);\n }\n }\n for (const input of element.inputs) {\n if (REMOVED_INPUTS.has(input.name) && input.name !== 'paginable') {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n logRemovalWarning(input.name, filePath, element, context);\n }\n }\n}\n\nfunction collectOutputChanges(element: TmplAstElement, source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const output of element.outputs) {\n const newName = OUTPUT_RENAMES.get(output.name);\n if (newName) {\n edits.push({ start: output.keySpan!.start.offset, end: output.keySpan!.end.offset, replacement: newName });\n }\n if (REMOVED_OUTPUTS.has(output.name)) {\n removeAttribute(output.sourceSpan.start.offset, output.sourceSpan.end.offset, source, edits);\n const { line } = element.startSourceSpan.start;\n context.logger.warn(\n `${filePath}:${line + 1} - \"(${output.name})\" removed. Multi-sort is now supported by (sortChange) output.`,\n );\n }\n }\n}\n\nfunction collectPaginatorMigration(element: TmplAstElement, source: string, edits: Edit[]): boolean {\n let found = false;\n\n for (const attr of element.attributes) {\n if (attr.name === 'paginable') {\n removeAttribute(attr.sourceSpan.start.offset, attr.sourceSpan.end.offset, source, edits);\n found = true;\n }\n }\n for (const input of element.inputs) {\n if (input.name === 'paginable') {\n removeAttribute(input.sourceSpan.start.offset, input.sourceSpan.end.offset, source, edits);\n found = true;\n }\n }\n\n if (found) {\n // Add [paginator]=\"paginator\" before closing > of opening tag\n const insertPos = element.startSourceSpan.end.offset - 1;\n edits.push({ start: insertPos, end: insertPos, replacement: ' [paginator]=\"paginator\"' });\n\n // Add eui-paginator after </table>\n if (element.endSourceSpan) {\n const afterTable = element.endSourceSpan.end.offset;\n edits.push({\n start: afterTable,\n end: afterTable,\n replacement: '\\n<!-- TODO: Configure paginator and implement onPageChange handler -->\\n<eui-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\" />',\n });\n }\n }\n\n return found;\n}\n\nfunction collectEmptyMessageRename(element: TmplAstElement, edits: Edit[]): void {\n // Handle direct attribute on elements (unlikely but handle)\n for (const attr of element.attributes) {\n if (attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n}\n\nfunction collectTemplateEmptyMessageRename(template: TmplAstTemplate, edits: Edit[]): void {\n for (const attr of template.templateAttrs) {\n if (attr instanceof TmplAstTextAttribute && attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n for (const attr of template.attributes) {\n if (attr.name === 'euiTemplate' && attr.value === 'emptyMessage' && attr.valueSpan) {\n edits.push({ start: attr.valueSpan.start.offset, end: attr.valueSpan.end.offset, replacement: 'footer' });\n }\n }\n}\n\n// --- Pipe rename via AST ---\n\nfunction collectPipeRenames(nodes: TmplAstNode[], source: string, edits: Edit[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n for (const input of node.inputs) {\n visitExpressionForPipes(input.value, edits);\n }\n for (const output of node.outputs) {\n if (output.handler) visitExpressionForPipes(output.handler, edits);\n }\n collectPipeRenames(node.children, source, edits);\n }\n if (node instanceof TmplAstTemplate) {\n for (const input of node.inputs) {\n visitExpressionForPipes(input.value, edits);\n }\n collectPipeRenames(node.children, source, edits);\n }\n if (node instanceof TmplAstBoundText) {\n visitExpressionForPipes(node.value, edits);\n }\n }\n}\n\nfunction visitExpressionForPipes(expr: AST, edits: Edit[]): void {\n if (expr instanceof ASTWithSource && expr.ast) {\n visitAstForPipes(expr.ast, edits);\n } else {\n visitAstForPipes(expr, edits);\n }\n}\n\nfunction visitAstForPipes(ast: AST, edits: Edit[]): void {\n if (ast instanceof BindingPipe) {\n if (ast.name === OLD_PIPE && ast.nameSpan) {\n edits.push({ start: ast.nameSpan.start, end: ast.nameSpan.end, replacement: NEW_PIPE });\n }\n visitAstForPipes(ast.exp, edits);\n for (const arg of ast.args) {\n visitAstForPipes(arg, edits);\n }\n return;\n }\n\n if (ast instanceof Interpolation) {\n for (const expr of ast.expressions) {\n visitAstForPipes(expr, edits);\n }\n return;\n }\n\n // Recursively visit all properties that could contain AST nodes\n for (const key of Object.keys(ast)) {\n // eslint-disable-next-line\n const val = (ast as any)[key];\n if (val instanceof AST) {\n visitAstForPipes(val, edits);\n } else if (Array.isArray(val)) {\n for (const item of val) {\n if (item instanceof AST) visitAstForPipes(item, edits);\n }\n }\n }\n}\n\n// --- Import handling for paginator ---\n\nfunction addPaginatorImport(source: string, filePath: string): string {\n if (source.includes(PAGINATOR_COMPONENT)) return source;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Add import statement after last import\n let lastImportEnd = 0;\n for (const stmt of sourceFile.statements) {\n if (ts.isImportDeclaration(stmt)) {\n lastImportEnd = stmt.getEnd();\n }\n }\n\n if (lastImportEnd > 0) {\n edits.push({\n start: lastImportEnd,\n end: lastImportEnd,\n replacement: `\\nimport { ${PAGINATOR_COMPONENT} } from '${PAGINATOR_IMPORT_PATH}';`,\n });\n }\n\n // Add to component imports array\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && node.name.text === 'imports' && isComponentMetadataProperty(node)) {\n if (ts.isArrayLiteralExpression(node.initializer)) {\n const arr = node.initializer;\n const elements = arr.elements;\n if (elements.length > 0) {\n const lastElement = elements[elements.length - 1];\n edits.push({\n start: lastElement.getEnd(),\n end: lastElement.getEnd(),\n replacement: `, ${PAGINATOR_COMPONENT}`,\n });\n } else {\n const insertPos = arr.getStart(sourceFile) + 1;\n edits.push({ start: insertPos, end: insertPos, replacement: PAGINATOR_COMPONENT });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return applyEdits(source, edits);\n}\n\n// --- Helpers ---\n\nfunction removeAttribute(start: number, end: number, source: string, edits: Edit[]): void {\n let adjustedStart = start;\n while (adjustedStart > 0 && (source[adjustedStart - 1] === ' ' || source[adjustedStart - 1] === '\\t')) {\n adjustedStart--;\n }\n edits.push({ start: adjustedStart, end, replacement: '' });\n}\n\nfunction logRemovalWarning(name: string, filePath: string, element: TmplAstElement, context: SchematicContext): void {\n const { line } = element.startSourceSpan.start;\n if (name === 'defaultMultiOrder') {\n context.logger.warn(`${filePath}:${line + 1} - \"[${name}]\" removed. Use setSort(Sort[]) to initialize sorting.`);\n } else {\n context.logger.warn(`${filePath}:${line + 1} - \"[${name}]\" removed to align to Design System.`);\n }\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n const unique = new Map<string, Edit>();\n for (const edit of edits) {\n const key = `${edit.start}:${edit.end}`;\n unique.set(key, edit);\n }\n let result = source;\n for (const edit of [...unique.values()].sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2864
|
+
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface TextChange {\n start: number;\n end: number;\n text: string;\n}\n\ninterface MigrationResult {\n content: string;\n migrated: number;\n skipped: number;\n}\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst OLD_LABEL = 'eui-tab-label';\nconst OLD_SUB_LABEL = 'euiTabSubLabel';\nconst OLD_CONTENT = 'eui-tab-content';\nconst NEW_HEADER = 'eui-tab-header';\nconst NEW_HEADER_LABEL = 'eui-tab-header-label';\nconst NEW_HEADER_SUB_LABEL = 'eui-tab-header-sub-label';\nconst NEW_BODY = 'eui-tab-body';\n\nexport function migrateEuiTabs(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let migrated = 0;\n let skipped = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) {\n return;\n }\n\n const original = buffer.toString('utf-8');\n const result = path.endsWith('.html')\n ? migrateTemplate(original, path, context)\n : migrateInlineTemplates(original, path, context);\n\n migrated += result.migrated;\n skipped += result.skipped;\n\n if (result.content !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate ${result.migrated} tab block(s) in ${path}`);\n } else {\n tree.overwrite(path, result.content);\n }\n }\n });\n\n context.logger.info(`Migrated ${migrated} EUI tab template block(s).`);\n if (skipped > 0) {\n context.logger.warn(`Skipped ${skipped} malformed EUI tab template block(s).`);\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n\n return tree;\n };\n}\n\nfunction migrateInlineTemplates(source: string, filePath: string, context: SchematicContext): MigrationResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: TextChange[] = [];\n let migrated = 0;\n let skipped = 0;\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const initializer = unwrapExpression(node.initializer);\n\n if (ts.isStringLiteral(initializer) || ts.isNoSubstitutionTemplateLiteral(initializer)) {\n const start = initializer.getStart(sourceFile) + 1;\n const end = initializer.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n const result = migrateTemplate(rawTemplate, `${filePath}@inline-template`, context);\n\n migrated += result.migrated;\n skipped += result.skipped;\n\n if (result.content !== rawTemplate) {\n changes.push({ start, end, text: result.content });\n }\n } else if (ts.isTemplateExpression(initializer)) {\n context.logger.warn(`Skipping interpolated inline template in ${filePath}.`);\n skipped++;\n }\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return {\n content: applyChanges(source, changes),\n migrated,\n skipped,\n };\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (\n (ts.isIdentifier(name) && name.text === 'template') ||\n (ts.isStringLiteral(name) && name.text === 'template')\n );\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n\n return current;\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) {\n return false;\n }\n\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) {\n return false;\n }\n\n return (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): MigrationResult {\n const parsed = parseTemplate(source, filePath, { preserveWhitespaces: true });\n const changes: TextChange[] = [];\n let migrated = 0;\n let skipped = 0;\n\n for (const error of parsed.errors ?? []) {\n context.logger.warn(`Template parse warning in ${filePath}: ${error.msg}`);\n }\n\n for (const tab of findElements(parsed.nodes, 'eui-tab')) {\n const label = findDirectChild(tab, OLD_LABEL);\n const content = findDirectChild(tab, OLD_CONTENT);\n const hasOldMarkup = Boolean(label || content);\n const hasNewMarkup = Boolean(findDirectChild(tab, NEW_HEADER) || findDirectChild(tab, NEW_BODY));\n\n if (!hasOldMarkup || hasNewMarkup) {\n continue;\n }\n\n if (!label || !content) {\n context.logger.warn(`Skipping malformed <eui-tab> in ${filePath}.`);\n skipped++;\n continue;\n }\n\n changes.push({\n start: label.sourceSpan.start.offset,\n end: label.sourceSpan.end.offset,\n text: buildHeaderReplacement(source, label),\n });\n changes.push({\n start: content.sourceSpan.start.offset,\n end: content.sourceSpan.end.offset,\n text: buildBodyReplacement(source, content),\n });\n migrated++;\n }\n\n return {\n content: applyChanges(source, withoutOverlaps(changes)),\n migrated,\n skipped,\n };\n}\n\nfunction findElements(nodes: readonly TmplAstNode[], name: string): TmplAstElement[] {\n const matches: TmplAstElement[] = [];\n\n for (const node of nodes) {\n if (isElement(node)) {\n if (node.name === name) {\n matches.push(node);\n }\n matches.push(...findElements(node.children, name));\n }\n }\n\n return matches;\n}\n\nfunction findDirectChild(element: TmplAstElement, name: string): TmplAstElement | undefined {\n return element.children.find((child): child is TmplAstElement => isElement(child) && child.name === name);\n}\n\nfunction isElement(node: TmplAstNode): node is TmplAstElement {\n return node instanceof TmplAstElement;\n}\n\nfunction buildHeaderReplacement(source: string, label: TmplAstElement): string {\n const indent = getIndent(source, label.sourceSpan.start.offset);\n const labelAttributes = getAttributeText(source, label, OLD_LABEL);\n const subLabels = findElements(label.children, OLD_SUB_LABEL);\n const mainLabelContent = removeElementRanges(getInnerText(source, label), label, subLabels);\n const lines = [\n `<${NEW_HEADER}>`,\n `${indent} <${NEW_HEADER_LABEL}${labelAttributes}>`,\n ...formatInnerLines(mainLabelContent, `${indent} `),\n `${indent} </${NEW_HEADER_LABEL}>`,\n ];\n\n for (const subLabel of subLabels) {\n const subLabelAttributes = getAttributeText(source, subLabel, OLD_SUB_LABEL);\n lines.push(\n `${indent} <${NEW_HEADER_SUB_LABEL}${subLabelAttributes}>`,\n ...formatInnerLines(getInnerText(source, subLabel), `${indent} `),\n `${indent} </${NEW_HEADER_SUB_LABEL}>`,\n );\n }\n\n lines.push(`${indent}</${NEW_HEADER}>`);\n\n return lines.join('\\n');\n}\n\nfunction buildBodyReplacement(source: string, content: TmplAstElement): string {\n const indent = getIndent(source, content.sourceSpan.start.offset);\n const attributes = getAttributeText(source, content, OLD_CONTENT);\n const innerText = getInnerText(source, content);\n const trimmed = innerText.trim();\n\n if (trimmed && !trimmed.includes('\\n')) {\n return `<${NEW_BODY}${attributes}>${trimmed}</${NEW_BODY}>`;\n }\n\n return [\n `<${NEW_BODY}${attributes}>`,\n ...formatInnerLines(innerText, `${indent} `),\n `${indent}</${NEW_BODY}>`,\n ].join('\\n');\n}\n\nfunction getInnerText(source: string, element: TmplAstElement): string {\n if (!element.endSourceSpan) {\n return '';\n }\n\n return source.slice(element.startSourceSpan.end.offset, element.endSourceSpan.start.offset);\n}\n\nfunction removeElementRanges(source: string, parent: TmplAstElement, elements: readonly TmplAstElement[]): string {\n const parentContentStart = parent.startSourceSpan.end.offset;\n let result = source;\n\n for (const element of [...elements].sort((a, b) => b.sourceSpan.start.offset - a.sourceSpan.start.offset)) {\n const start = element.sourceSpan.start.offset - parentContentStart;\n const end = element.sourceSpan.end.offset - parentContentStart;\n result = result.slice(0, start) + result.slice(end);\n }\n\n return result;\n}\n\nfunction getAttributeText(source: string, element: TmplAstElement, tagName: string): string {\n const startTag = source.slice(element.startSourceSpan.start.offset, element.startSourceSpan.end.offset);\n const tagStart = startTag.indexOf(tagName);\n\n if (tagStart === -1) {\n return '';\n }\n\n const contentEnd = startTag.endsWith('/>') ? startTag.length - 2 : startTag.length - 1;\n return startTag.slice(tagStart + tagName.length, contentEnd).trimEnd();\n}\n\nfunction getIndent(source: string, offset: number): string {\n const lineStart = source.lastIndexOf('\\n', offset - 1) + 1;\n const prefix = source.slice(lineStart, offset);\n return prefix.match(/^\\s*/)?.[0] ?? '';\n}\n\nfunction formatInnerLines(source: string, indent: string): string[] {\n const trimmed = source.trim();\n\n if (!trimmed) {\n return [];\n }\n\n return trimmed.split(/\\r?\\n/).map((line) => `${indent}${line.trim()}`);\n}\n\nfunction withoutOverlaps(changes: TextChange[]): TextChange[] {\n const accepted: TextChange[] = [];\n\n for (const change of [...changes].sort((a, b) => a.start - b.start || b.end - a.end)) {\n if (!accepted.some((current) => change.start < current.end && current.start < change.end)) {\n accepted.push(change);\n }\n }\n\n return accepted;\n}\n\nfunction applyChanges(source: string, changes: readonly TextChange[]): string {\n let result = source;\n\n for (const change of [...changes].sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n\n return result;\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2865
2865
|
"displayName": "Schema",
|
|
2866
2866
|
"properties": [
|
|
2867
2867
|
{
|
|
@@ -2873,7 +2873,7 @@
|
|
|
2873
2873
|
"indexKey": "",
|
|
2874
2874
|
"optional": true,
|
|
2875
2875
|
"description": "",
|
|
2876
|
-
"line":
|
|
2876
|
+
"line": 20,
|
|
2877
2877
|
"rawdescription": "\n"
|
|
2878
2878
|
},
|
|
2879
2879
|
{
|
|
@@ -2885,7 +2885,7 @@
|
|
|
2885
2885
|
"indexKey": "",
|
|
2886
2886
|
"optional": true,
|
|
2887
2887
|
"description": "",
|
|
2888
|
-
"line":
|
|
2888
|
+
"line": 19,
|
|
2889
2889
|
"rawdescription": "\n"
|
|
2890
2890
|
}
|
|
2891
2891
|
],
|
|
@@ -2903,12 +2903,12 @@
|
|
|
2903
2903
|
},
|
|
2904
2904
|
{
|
|
2905
2905
|
"name": "Schema",
|
|
2906
|
-
"id": "interface-Schema-
|
|
2907
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2906
|
+
"id": "interface-Schema-e1cd02924eb82a618c71a0b26c081bdd020519d2699aa0e2dc98640c4e0f347c3649b967c5fc87543e41bbbfabd1304835850ccc38f40684d6521c242b2030ed-18",
|
|
2907
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
2908
2908
|
"deprecated": false,
|
|
2909
2909
|
"deprecationMessage": "",
|
|
2910
2910
|
"type": "interface",
|
|
2911
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface TextChange {\n start: number;\n end: number;\n text: string;\n}\n\ninterface MigrationResult {\n content: string;\n migrated: number;\n skipped: number;\n}\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst OLD_LABEL = 'eui-tab-label';\nconst OLD_SUB_LABEL = 'euiTabSubLabel';\nconst OLD_CONTENT = 'eui-tab-content';\nconst NEW_HEADER = 'eui-tab-header';\nconst NEW_HEADER_LABEL = 'eui-tab-header-label';\nconst NEW_HEADER_SUB_LABEL = 'eui-tab-header-sub-label';\nconst NEW_BODY = 'eui-tab-body';\n\nexport function migrateEuiTabs(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let migrated = 0;\n let skipped = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) {\n return;\n }\n\n const original = buffer.toString('utf-8');\n const result = path.endsWith('.html')\n ? migrateTemplate(original, path, context)\n : migrateInlineTemplates(original, path, context);\n\n migrated += result.migrated;\n skipped += result.skipped;\n\n if (result.content !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate ${result.migrated} tab block(s) in ${path}`);\n } else {\n tree.overwrite(path, result.content);\n }\n }\n });\n\n context.logger.info(`Migrated ${migrated} EUI tab template block(s).`);\n if (skipped > 0) {\n context.logger.warn(`Skipped ${skipped} malformed EUI tab template block(s).`);\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n\n return tree;\n };\n}\n\nfunction migrateInlineTemplates(source: string, filePath: string, context: SchematicContext): MigrationResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: TextChange[] = [];\n let migrated = 0;\n let skipped = 0;\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const initializer = unwrapExpression(node.initializer);\n\n if (ts.isStringLiteral(initializer) || ts.isNoSubstitutionTemplateLiteral(initializer)) {\n const start = initializer.getStart(sourceFile) + 1;\n const end = initializer.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n const result = migrateTemplate(rawTemplate, `${filePath}@inline-template`, context);\n\n migrated += result.migrated;\n skipped += result.skipped;\n\n if (result.content !== rawTemplate) {\n changes.push({ start, end, text: result.content });\n }\n } else if (ts.isTemplateExpression(initializer)) {\n context.logger.warn(`Skipping interpolated inline template in ${filePath}.`);\n skipped++;\n }\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return {\n content: applyChanges(source, changes),\n migrated,\n skipped,\n };\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (\n (ts.isIdentifier(name) && name.text === 'template') ||\n (ts.isStringLiteral(name) && name.text === 'template')\n );\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n\n return current;\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) {\n return false;\n }\n\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) {\n return false;\n }\n\n return (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): MigrationResult {\n const parsed = parseTemplate(source, filePath, { preserveWhitespaces: true });\n const changes: TextChange[] = [];\n let migrated = 0;\n let skipped = 0;\n\n for (const error of parsed.errors ?? []) {\n context.logger.warn(`Template parse warning in ${filePath}: ${error.msg}`);\n }\n\n for (const tab of findElements(parsed.nodes, 'eui-tab')) {\n const label = findDirectChild(tab, OLD_LABEL);\n const content = findDirectChild(tab, OLD_CONTENT);\n const hasOldMarkup = Boolean(label || content);\n const hasNewMarkup = Boolean(findDirectChild(tab, NEW_HEADER) || findDirectChild(tab, NEW_BODY));\n\n if (!hasOldMarkup || hasNewMarkup) {\n continue;\n }\n\n if (!label || !content) {\n context.logger.warn(`Skipping malformed <eui-tab> in ${filePath}.`);\n skipped++;\n continue;\n }\n\n changes.push({\n start: label.sourceSpan.start.offset,\n end: label.sourceSpan.end.offset,\n text: buildHeaderReplacement(source, label),\n });\n changes.push({\n start: content.sourceSpan.start.offset,\n end: content.sourceSpan.end.offset,\n text: buildBodyReplacement(source, content),\n });\n migrated++;\n }\n\n return {\n content: applyChanges(source, withoutOverlaps(changes)),\n migrated,\n skipped,\n };\n}\n\nfunction findElements(nodes: readonly TmplAstNode[], name: string): TmplAstElement[] {\n const matches: TmplAstElement[] = [];\n\n for (const node of nodes) {\n if (isElement(node)) {\n if (node.name === name) {\n matches.push(node);\n }\n matches.push(...findElements(node.children, name));\n }\n }\n\n return matches;\n}\n\nfunction findDirectChild(element: TmplAstElement, name: string): TmplAstElement | undefined {\n return element.children.find((child): child is TmplAstElement => isElement(child) && child.name === name);\n}\n\nfunction isElement(node: TmplAstNode): node is TmplAstElement {\n return node instanceof TmplAstElement;\n}\n\nfunction buildHeaderReplacement(source: string, label: TmplAstElement): string {\n const indent = getIndent(source, label.sourceSpan.start.offset);\n const labelAttributes = getAttributeText(source, label, OLD_LABEL);\n const subLabels = findElements(label.children, OLD_SUB_LABEL);\n const mainLabelContent = removeElementRanges(getInnerText(source, label), label, subLabels);\n const lines = [\n `<${NEW_HEADER}>`,\n `${indent} <${NEW_HEADER_LABEL}${labelAttributes}>`,\n ...formatInnerLines(mainLabelContent, `${indent} `),\n `${indent} </${NEW_HEADER_LABEL}>`,\n ];\n\n for (const subLabel of subLabels) {\n const subLabelAttributes = getAttributeText(source, subLabel, OLD_SUB_LABEL);\n lines.push(\n `${indent} <${NEW_HEADER_SUB_LABEL}${subLabelAttributes}>`,\n ...formatInnerLines(getInnerText(source, subLabel), `${indent} `),\n `${indent} </${NEW_HEADER_SUB_LABEL}>`,\n );\n }\n\n lines.push(`${indent}</${NEW_HEADER}>`);\n\n return lines.join('\\n');\n}\n\nfunction buildBodyReplacement(source: string, content: TmplAstElement): string {\n const indent = getIndent(source, content.sourceSpan.start.offset);\n const attributes = getAttributeText(source, content, OLD_CONTENT);\n const innerText = getInnerText(source, content);\n const trimmed = innerText.trim();\n\n if (trimmed && !trimmed.includes('\\n')) {\n return `<${NEW_BODY}${attributes}>${trimmed}</${NEW_BODY}>`;\n }\n\n return [\n `<${NEW_BODY}${attributes}>`,\n ...formatInnerLines(innerText, `${indent} `),\n `${indent}</${NEW_BODY}>`,\n ].join('\\n');\n}\n\nfunction getInnerText(source: string, element: TmplAstElement): string {\n if (!element.endSourceSpan) {\n return '';\n }\n\n return source.slice(element.startSourceSpan.end.offset, element.endSourceSpan.start.offset);\n}\n\nfunction removeElementRanges(source: string, parent: TmplAstElement, elements: readonly TmplAstElement[]): string {\n const parentContentStart = parent.startSourceSpan.end.offset;\n let result = source;\n\n for (const element of [...elements].sort((a, b) => b.sourceSpan.start.offset - a.sourceSpan.start.offset)) {\n const start = element.sourceSpan.start.offset - parentContentStart;\n const end = element.sourceSpan.end.offset - parentContentStart;\n result = result.slice(0, start) + result.slice(end);\n }\n\n return result;\n}\n\nfunction getAttributeText(source: string, element: TmplAstElement, tagName: string): string {\n const startTag = source.slice(element.startSourceSpan.start.offset, element.startSourceSpan.end.offset);\n const tagStart = startTag.indexOf(tagName);\n\n if (tagStart === -1) {\n return '';\n }\n\n const contentEnd = startTag.endsWith('/>') ? startTag.length - 2 : startTag.length - 1;\n return startTag.slice(tagStart + tagName.length, contentEnd).trimEnd();\n}\n\nfunction getIndent(source: string, offset: number): string {\n const lineStart = source.lastIndexOf('\\n', offset - 1) + 1;\n const prefix = source.slice(lineStart, offset);\n return prefix.match(/^\\s*/)?.[0] ?? '';\n}\n\nfunction formatInnerLines(source: string, indent: string): string[] {\n const trimmed = source.trim();\n\n if (!trimmed) {\n return [];\n }\n\n return trimmed.split(/\\r?\\n/).map((line) => `${indent}${line.trim()}`);\n}\n\nfunction withoutOverlaps(changes: TextChange[]): TextChange[] {\n const accepted: TextChange[] = [];\n\n for (const change of [...changes].sort((a, b) => a.start - b.start || b.end - a.end)) {\n if (!accepted.some((current) => change.start < current.end && current.start < change.end)) {\n accepted.push(change);\n }\n }\n\n return accepted;\n}\n\nfunction applyChanges(source: string, changes: readonly TextChange[]): string {\n let result = source;\n\n for (const change of [...changes].sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n\n return result;\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2911
|
+
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\nconst OLD_TAG = 'eui-toolbar-menu';\nconst NEW_TAG = 'eui-toolbar-mega-menu';\nconst OLD_COMPONENT = 'EuiToolbarMenuComponent';\nconst NEW_COMPONENT = 'EuiToolbarMegaMenuComponent';\nconst OLD_INTERFACE = 'ToolbarItem';\nconst NEW_INTERFACE = 'EuiMenuItem';\nconst NEW_COMPONENT_PATH = '@eui/components/layout';\nconst NEW_INTERFACE_PATH = '@eui/core';\nconst REMOVED_OUTPUT = 'menuItemClick';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\nexport function migrateEuiToolbarMenu(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(OLD_TAG) && !original.includes(OLD_COMPONENT) && !original.includes(OLD_INTERFACE)) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original, path, context);\n } else {\n result = migrateTypeScript(original, path, context);\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate eui-toolbar-menu → eui-toolbar-mega-menu in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n context.logger.info(`Migrated eui-toolbar-menu → eui-toolbar-mega-menu in ${fileCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n\n visitNodes(parsed.nodes, source, edits, filePath, context);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateTypeScript(source: string, filePath: string, context: SchematicContext): string {\n let result = migrateInlineTemplates(source, filePath, context);\n result = migrateImportsAndTypes(result, filePath, context);\n return result;\n}\n\nfunction migrateInlineTemplates(source: string, filePath: string, context: SchematicContext): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(OLD_TAG)) {\n ts.forEachChild(node, visit); return; \n}\n const migrated = migrateTemplate(rawTemplate, filePath, context);\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return applyEdits(source, changes);\n}\n\nfunction migrateImportsAndTypes(source: string, filePath: string, context: SchematicContext): string {\n if (!source.includes(OLD_COMPONENT) && !source.includes(OLD_INTERFACE)) return source;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Track if EuiMenuItem is already imported from @eui/core\n let hasEuiMenuItemImport = false;\n\n // First pass: analyze imports\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const moduleSpec = (stmt.moduleSpecifier as ts.StringLiteral).text;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n for (const specifier of namedBindings.elements) {\n if (specifier.name.text === NEW_INTERFACE && moduleSpec === NEW_INTERFACE_PATH) {\n hasEuiMenuItemImport = true;\n }\n }\n }\n\n // Second pass: collect edits for import declarations\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n const moduleSpec = stmt.moduleSpecifier as ts.StringLiteral;\n const specifiers = namedBindings.elements;\n const hasComponent = specifiers.some((s) => s.name.text === OLD_COMPONENT);\n const hasInterface = specifiers.some((s) => s.name.text === OLD_INTERFACE);\n\n if (hasComponent && hasInterface) {\n // Both are in the same import → must split into two different paths\n const others = specifiers.filter((s) => s.name.text !== OLD_COMPONENT && s.name.text !== OLD_INTERFACE);\n const lines: string[] = [];\n lines.push(`import { ${NEW_COMPONENT} } from '${NEW_COMPONENT_PATH}';`);\n if (!hasEuiMenuItemImport) {\n lines.push(`import { ${NEW_INTERFACE} } from '${NEW_INTERFACE_PATH}';`);\n }\n if (others.length > 0) {\n const otherNames = others.map((s) => s.name.text).join(', ');\n lines.push(`import { ${otherNames} } from '${moduleSpec.text}';`);\n }\n edits.push({\n start: stmt.getStart(sourceFile),\n end: stmt.getEnd(),\n replacement: lines.join('\\n'),\n });\n } else if (hasComponent) {\n edits.push({\n start: moduleSpec.getStart(sourceFile) + 1,\n end: moduleSpec.getEnd() - 1,\n replacement: NEW_COMPONENT_PATH,\n });\n for (const specifier of specifiers) {\n if (specifier.name.text === OLD_COMPONENT) {\n edits.push({\n start: specifier.name.getStart(sourceFile),\n end: specifier.name.getEnd(),\n replacement: NEW_COMPONENT,\n });\n }\n }\n } else if (hasInterface) {\n if (hasEuiMenuItemImport) {\n removeImportSpecifier(namedBindings, specifiers.find((s) => s.name.text === OLD_INTERFACE)!, sourceFile, edits);\n } else {\n edits.push({\n start: moduleSpec.getStart(sourceFile) + 1,\n end: moduleSpec.getEnd() - 1,\n replacement: NEW_INTERFACE_PATH,\n });\n for (const specifier of specifiers) {\n if (specifier.name.text === OLD_INTERFACE) {\n edits.push({\n start: specifier.name.getStart(sourceFile),\n end: specifier.name.getEnd(),\n replacement: NEW_INTERFACE,\n });\n }\n }\n }\n }\n }\n\n // Third pass: rename identifier references in non-import positions\n const visitRefs = (node: ts.Node): void => {\n if (ts.isImportDeclaration(node)) return; // skip imports (already handled)\n if (ts.isIdentifier(node)) {\n if (node.text === OLD_COMPONENT) {\n edits.push({ start: node.getStart(sourceFile), end: node.getEnd(), replacement: NEW_COMPONENT });\n }\n if (node.text === OLD_INTERFACE) {\n edits.push({ start: node.getStart(sourceFile), end: node.getEnd(), replacement: NEW_INTERFACE });\n }\n }\n ts.forEachChild(node, visitRefs);\n };\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) {\n visitRefs(stmt);\n }\n }\n\n // Warn about ToolbarItem-specific properties\n warnRemovedProperties(sourceFile, filePath, context);\n\n return applyEdits(source, edits);\n}\n\nfunction removeImportSpecifier(\n namedImports: ts.NamedImports,\n specifier: ts.ImportSpecifier,\n sourceFile: ts.SourceFile,\n edits: Edit[],\n): void {\n const elements = namedImports.elements;\n if (elements.length === 1) {\n // Remove the entire import declaration\n const importDecl = namedImports.parent.parent;\n edits.push({\n start: importDecl.getStart(sourceFile),\n end: importDecl.getEnd(),\n replacement: '',\n });\n } else {\n // Remove just this specifier with surrounding comma/whitespace\n const idx = elements.indexOf(specifier);\n let start: number;\n let end: number;\n if (idx < elements.length - 1) {\n start = specifier.getStart(sourceFile);\n end = elements[idx + 1].getStart(sourceFile);\n } else {\n start = elements[idx - 1].getEnd();\n end = specifier.getEnd();\n }\n edits.push({ start, end, replacement: '' });\n }\n}\n\nfunction warnRemovedProperties(sourceFile: ts.SourceFile, filePath: string, context: SchematicContext): void {\n const deprecated = ['isHome', 'isSeparator'];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && deprecated.includes(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"${node.name.text}\" was part of ToolbarItem but does not exist on EuiMenuItem. Review manually.`,\n );\n }\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && deprecated.includes(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"${node.name.text}\" was part of ToolbarItem but does not exist on EuiMenuItem. Review manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n}\n\nfunction visitNodes(nodes: TmplAstNode[], source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === OLD_TAG) {\n collectTagRenames(node, source, edits);\n collectOutputRemovals(node, source, edits, filePath, context);\n }\n visitNodes(node.children, source, edits, filePath, context);\n }\n }\n}\n\nfunction collectTagRenames(element: TmplAstElement, source: string, edits: Edit[]): void {\n // Rename opening tag\n const openStart = element.startSourceSpan.start.offset + 1; // skip '<'\n edits.push({ start: openStart, end: openStart + OLD_TAG.length, replacement: NEW_TAG });\n\n // Rename closing tag\n if (element.endSourceSpan) {\n const closeStart = element.endSourceSpan.start.offset + 2; // skip '</'\n edits.push({ start: closeStart, end: closeStart + OLD_TAG.length, replacement: NEW_TAG });\n }\n}\n\nfunction collectOutputRemovals(\n element: TmplAstElement,\n source: string,\n edits: Edit[],\n filePath: string,\n context: SchematicContext,\n): void {\n for (const output of element.outputs) {\n if (output.name === REMOVED_OUTPUT) {\n let start = output.sourceSpan.start.offset;\n // Remove leading whitespace\n while (start > 0 && (source[start - 1] === ' ' || source[start - 1] === '\\t')) {\n start--;\n }\n edits.push({ start, end: output.sourceSpan.end.offset, replacement: '' });\n\n const { line } = element.startSourceSpan.start;\n context.logger.warn(\n `${filePath}:${line + 1} - \"(menuItemClick)\" has been removed. There is no equivalent on eui-toolbar-mega-menu.`,\n );\n }\n }\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n // Deduplicate edits at same position (e.g. module path edits when both Component and ToolbarItem are from same source)\n const unique = deduplicateEdits(edits);\n let result = source;\n for (const edit of unique.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction deduplicateEdits(edits: Edit[]): Edit[] {\n const seen = new Map<string, Edit>();\n for (const edit of edits) {\n const key = `${edit.start}:${edit.end}`;\n // Last wins for same range\n seen.set(key, edit);\n }\n return Array.from(seen.values());\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2912
2912
|
"displayName": "Schema",
|
|
2913
2913
|
"properties": [
|
|
2914
2914
|
{
|
|
@@ -2920,7 +2920,7 @@
|
|
|
2920
2920
|
"indexKey": "",
|
|
2921
2921
|
"optional": true,
|
|
2922
2922
|
"description": "",
|
|
2923
|
-
"line":
|
|
2923
|
+
"line": 18,
|
|
2924
2924
|
"rawdescription": "\n"
|
|
2925
2925
|
},
|
|
2926
2926
|
{
|
|
@@ -2932,7 +2932,7 @@
|
|
|
2932
2932
|
"indexKey": "",
|
|
2933
2933
|
"optional": true,
|
|
2934
2934
|
"description": "",
|
|
2935
|
-
"line":
|
|
2935
|
+
"line": 17,
|
|
2936
2936
|
"rawdescription": "\n"
|
|
2937
2937
|
}
|
|
2938
2938
|
],
|
|
@@ -2950,12 +2950,12 @@
|
|
|
2950
2950
|
},
|
|
2951
2951
|
{
|
|
2952
2952
|
"name": "Schema",
|
|
2953
|
-
"id": "interface-Schema-
|
|
2954
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2953
|
+
"id": "interface-Schema-d36032102ed30a7ada1e3d36bb9ca41b7234b855760cac9783a25818f7ffe2097e1ebd8e808b574ddec0760f827272f6cd561f45f3eb1578f87f39ee2633730a-19",
|
|
2954
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
2955
2955
|
"deprecated": false,
|
|
2956
2956
|
"deprecationMessage": "",
|
|
2957
2957
|
"type": "interface",
|
|
2958
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\nconst OLD_TAG = 'eui-toolbar-menu';\nconst NEW_TAG = 'eui-toolbar-mega-menu';\nconst OLD_COMPONENT = 'EuiToolbarMenuComponent';\nconst NEW_COMPONENT = 'EuiToolbarMegaMenuComponent';\nconst OLD_INTERFACE = 'ToolbarItem';\nconst NEW_INTERFACE = 'EuiMenuItem';\nconst NEW_COMPONENT_PATH = '@eui/components/layout';\nconst NEW_INTERFACE_PATH = '@eui/core';\nconst REMOVED_OUTPUT = 'menuItemClick';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\nexport function migrateEuiToolbarMenu(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(OLD_TAG) && !original.includes(OLD_COMPONENT) && !original.includes(OLD_INTERFACE)) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original, path, context);\n } else {\n result = migrateTypeScript(original, path, context);\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate eui-toolbar-menu → eui-toolbar-mega-menu in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n context.logger.info(`Migrated eui-toolbar-menu → eui-toolbar-mega-menu in ${fileCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction migrateTemplate(source: string, filePath: string, context: SchematicContext): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: Edit[] = [];\n\n visitNodes(parsed.nodes, source, edits, filePath, context);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateTypeScript(source: string, filePath: string, context: SchematicContext): string {\n let result = migrateInlineTemplates(source, filePath, context);\n result = migrateImportsAndTypes(result, filePath, context);\n return result;\n}\n\nfunction migrateInlineTemplates(source: string, filePath: string, context: SchematicContext): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: Edit[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(OLD_TAG)) {\n ts.forEachChild(node, visit); return; \n}\n const migrated = migrateTemplate(rawTemplate, filePath, context);\n if (migrated !== rawTemplate) changes.push({ start, end, replacement: migrated });\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return applyEdits(source, changes);\n}\n\nfunction migrateImportsAndTypes(source: string, filePath: string, context: SchematicContext): string {\n if (!source.includes(OLD_COMPONENT) && !source.includes(OLD_INTERFACE)) return source;\n\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Track if EuiMenuItem is already imported from @eui/core\n let hasEuiMenuItemImport = false;\n\n // First pass: analyze imports\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const moduleSpec = (stmt.moduleSpecifier as ts.StringLiteral).text;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n for (const specifier of namedBindings.elements) {\n if (specifier.name.text === NEW_INTERFACE && moduleSpec === NEW_INTERFACE_PATH) {\n hasEuiMenuItemImport = true;\n }\n }\n }\n\n // Second pass: collect edits for import declarations\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n const moduleSpec = stmt.moduleSpecifier as ts.StringLiteral;\n const specifiers = namedBindings.elements;\n const hasComponent = specifiers.some((s) => s.name.text === OLD_COMPONENT);\n const hasInterface = specifiers.some((s) => s.name.text === OLD_INTERFACE);\n\n if (hasComponent && hasInterface) {\n // Both are in the same import → must split into two different paths\n const others = specifiers.filter((s) => s.name.text !== OLD_COMPONENT && s.name.text !== OLD_INTERFACE);\n const lines: string[] = [];\n lines.push(`import { ${NEW_COMPONENT} } from '${NEW_COMPONENT_PATH}';`);\n if (!hasEuiMenuItemImport) {\n lines.push(`import { ${NEW_INTERFACE} } from '${NEW_INTERFACE_PATH}';`);\n }\n if (others.length > 0) {\n const otherNames = others.map((s) => s.name.text).join(', ');\n lines.push(`import { ${otherNames} } from '${moduleSpec.text}';`);\n }\n edits.push({\n start: stmt.getStart(sourceFile),\n end: stmt.getEnd(),\n replacement: lines.join('\\n'),\n });\n } else if (hasComponent) {\n edits.push({\n start: moduleSpec.getStart(sourceFile) + 1,\n end: moduleSpec.getEnd() - 1,\n replacement: NEW_COMPONENT_PATH,\n });\n for (const specifier of specifiers) {\n if (specifier.name.text === OLD_COMPONENT) {\n edits.push({\n start: specifier.name.getStart(sourceFile),\n end: specifier.name.getEnd(),\n replacement: NEW_COMPONENT,\n });\n }\n }\n } else if (hasInterface) {\n if (hasEuiMenuItemImport) {\n removeImportSpecifier(namedBindings, specifiers.find((s) => s.name.text === OLD_INTERFACE)!, sourceFile, edits);\n } else {\n edits.push({\n start: moduleSpec.getStart(sourceFile) + 1,\n end: moduleSpec.getEnd() - 1,\n replacement: NEW_INTERFACE_PATH,\n });\n for (const specifier of specifiers) {\n if (specifier.name.text === OLD_INTERFACE) {\n edits.push({\n start: specifier.name.getStart(sourceFile),\n end: specifier.name.getEnd(),\n replacement: NEW_INTERFACE,\n });\n }\n }\n }\n }\n }\n\n // Third pass: rename identifier references in non-import positions\n const visitRefs = (node: ts.Node): void => {\n if (ts.isImportDeclaration(node)) return; // skip imports (already handled)\n if (ts.isIdentifier(node)) {\n if (node.text === OLD_COMPONENT) {\n edits.push({ start: node.getStart(sourceFile), end: node.getEnd(), replacement: NEW_COMPONENT });\n }\n if (node.text === OLD_INTERFACE) {\n edits.push({ start: node.getStart(sourceFile), end: node.getEnd(), replacement: NEW_INTERFACE });\n }\n }\n ts.forEachChild(node, visitRefs);\n };\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) {\n visitRefs(stmt);\n }\n }\n\n // Warn about ToolbarItem-specific properties\n warnRemovedProperties(sourceFile, filePath, context);\n\n return applyEdits(source, edits);\n}\n\nfunction removeImportSpecifier(\n namedImports: ts.NamedImports,\n specifier: ts.ImportSpecifier,\n sourceFile: ts.SourceFile,\n edits: Edit[],\n): void {\n const elements = namedImports.elements;\n if (elements.length === 1) {\n // Remove the entire import declaration\n const importDecl = namedImports.parent.parent;\n edits.push({\n start: importDecl.getStart(sourceFile),\n end: importDecl.getEnd(),\n replacement: '',\n });\n } else {\n // Remove just this specifier with surrounding comma/whitespace\n const idx = elements.indexOf(specifier);\n let start: number;\n let end: number;\n if (idx < elements.length - 1) {\n start = specifier.getStart(sourceFile);\n end = elements[idx + 1].getStart(sourceFile);\n } else {\n start = elements[idx - 1].getEnd();\n end = specifier.getEnd();\n }\n edits.push({ start, end, replacement: '' });\n }\n}\n\nfunction warnRemovedProperties(sourceFile: ts.SourceFile, filePath: string, context: SchematicContext): void {\n const deprecated = ['isHome', 'isSeparator'];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && deprecated.includes(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"${node.name.text}\" was part of ToolbarItem but does not exist on EuiMenuItem. Review manually.`,\n );\n }\n if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name) && deprecated.includes(node.name.text)) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(\n `${filePath}:${line + 1} - \"${node.name.text}\" was part of ToolbarItem but does not exist on EuiMenuItem. Review manually.`,\n );\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n}\n\nfunction visitNodes(nodes: TmplAstNode[], source: string, edits: Edit[], filePath: string, context: SchematicContext): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === OLD_TAG) {\n collectTagRenames(node, source, edits);\n collectOutputRemovals(node, source, edits, filePath, context);\n }\n visitNodes(node.children, source, edits, filePath, context);\n }\n }\n}\n\nfunction collectTagRenames(element: TmplAstElement, source: string, edits: Edit[]): void {\n // Rename opening tag\n const openStart = element.startSourceSpan.start.offset + 1; // skip '<'\n edits.push({ start: openStart, end: openStart + OLD_TAG.length, replacement: NEW_TAG });\n\n // Rename closing tag\n if (element.endSourceSpan) {\n const closeStart = element.endSourceSpan.start.offset + 2; // skip '</'\n edits.push({ start: closeStart, end: closeStart + OLD_TAG.length, replacement: NEW_TAG });\n }\n}\n\nfunction collectOutputRemovals(\n element: TmplAstElement,\n source: string,\n edits: Edit[],\n filePath: string,\n context: SchematicContext,\n): void {\n for (const output of element.outputs) {\n if (output.name === REMOVED_OUTPUT) {\n let start = output.sourceSpan.start.offset;\n // Remove leading whitespace\n while (start > 0 && (source[start - 1] === ' ' || source[start - 1] === '\\t')) {\n start--;\n }\n edits.push({ start, end: output.sourceSpan.end.offset, replacement: '' });\n\n const { line } = element.startSourceSpan.start;\n context.logger.warn(\n `${filePath}:${line + 1} - \"(menuItemClick)\" has been removed. There is no equivalent on eui-toolbar-mega-menu.`,\n );\n }\n }\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) current = current.expression;\n return current;\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n // Deduplicate edits at same position (e.g. module path edits when both Component and ToolbarItem are from same source)\n const unique = deduplicateEdits(edits);\n let result = source;\n for (const edit of unique.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction deduplicateEdits(edits: Edit[]): Edit[] {\n const seen = new Map<string, Edit>();\n for (const edit of edits) {\n const key = `${edit.start}:${edit.end}`;\n // Last wins for same range\n seen.set(key, edit);\n }\n return Array.from(seen.values());\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2958
|
+
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\nconst OLD_CLASS = 'EuiTooltipConfig';\nconst NEW_INTERFACE = 'EuiTooltipInterface';\n\nexport function migrateEuiTooltip(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(OLD_CLASS)) return;\n\n const result = migrateTypeScript(original, path, context);\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate EuiTooltipConfig → EuiTooltipInterface in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n context.logger.info(`Migrated EuiTooltipConfig → EuiTooltipInterface in ${fileCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction migrateTypeScript(source: string, filePath: string, context: SchematicContext): string {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Track if EuiTooltipInterface is already imported\n let hasInterfaceImport = false;\n let classImportDecl: ts.ImportDeclaration | null = null;\n let classImportModuleSpecifier: string | null = null;\n\n // First pass: analyze imports\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n for (const specifier of namedBindings.elements) {\n if (specifier.name.text === NEW_INTERFACE) {\n hasInterfaceImport = true;\n }\n if (specifier.name.text === OLD_CLASS) {\n classImportDecl = stmt;\n classImportModuleSpecifier = (stmt.moduleSpecifier as ts.StringLiteral).text;\n }\n }\n }\n\n // Second pass: handle import declarations\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) continue;\n const namedBindings = stmt.importClause?.namedBindings;\n if (!namedBindings || !ts.isNamedImports(namedBindings)) continue;\n\n const specifiers = namedBindings.elements;\n const classSpecifier = specifiers.find((s) => s.name.text === OLD_CLASS);\n if (!classSpecifier) continue;\n\n if (hasInterfaceImport) {\n // EuiTooltipInterface is already imported elsewhere → remove EuiTooltipConfig from this import\n removeImportSpecifier(namedBindings, classSpecifier, sourceFile, edits);\n } else {\n // Rename EuiTooltipConfig → EuiTooltipInterface in the import\n edits.push({\n start: classSpecifier.name.getStart(sourceFile),\n end: classSpecifier.name.getEnd(),\n replacement: NEW_INTERFACE,\n });\n hasInterfaceImport = true;\n }\n }\n\n // Third pass: replace `new EuiTooltipConfig(...)` → spread/cast to interface\n const visitNewExpressions = (node: ts.Node): void => {\n if (ts.isNewExpression(node) && ts.isIdentifier(node.expression) && node.expression.text === OLD_CLASS) {\n const args = node.arguments;\n if (args && args.length === 1) {\n const arg = args[0];\n // `new EuiTooltipConfig({ ... })` → `{ ... } as EuiTooltipInterface`\n // But if the argument is just a variable, we keep it: `varName as EuiTooltipInterface`\n const argText = source.slice(arg.getStart(sourceFile), arg.getEnd());\n\n if (ts.isObjectLiteralExpression(arg)) {\n // Inline object: `new EuiTooltipConfig({ x: 1 })` → `{ x: 1 }`\n edits.push({\n start: node.getStart(sourceFile),\n end: node.getEnd(),\n replacement: argText,\n });\n } else {\n // Variable or expression: `new EuiTooltipConfig(opts)` → `opts`\n edits.push({\n start: node.getStart(sourceFile),\n end: node.getEnd(),\n replacement: argText,\n });\n }\n } else if (!args || args.length === 0) {\n // `new EuiTooltipConfig()` → `{} as EuiTooltipInterface`\n edits.push({\n start: node.getStart(sourceFile),\n end: node.getEnd(),\n replacement: `{} as ${NEW_INTERFACE}`,\n });\n }\n return; // don't recurse into children we've already replaced\n }\n ts.forEachChild(node, visitNewExpressions);\n };\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) {\n visitNewExpressions(stmt);\n }\n }\n\n // Fourth pass: rename all remaining identifier references (type annotations, etc.)\n const visitRefs = (node: ts.Node): void => {\n if (ts.isImportDeclaration(node)) return;\n // Skip nodes we already covered in new expressions\n if (ts.isNewExpression(node) && ts.isIdentifier(node.expression) && node.expression.text === OLD_CLASS) return;\n\n if (ts.isIdentifier(node) && node.text === OLD_CLASS) {\n // Ensure this is not part of an import declaration\n if (!isPartOfImport(node)) {\n edits.push({\n start: node.getStart(sourceFile),\n end: node.getEnd(),\n replacement: NEW_INTERFACE,\n });\n }\n }\n ts.forEachChild(node, visitRefs);\n };\n\n for (const stmt of sourceFile.statements) {\n if (!ts.isImportDeclaration(stmt)) {\n visitRefs(stmt);\n }\n }\n\n return applyEdits(source, edits);\n}\n\nfunction isPartOfImport(node: ts.Node): boolean {\n let current: ts.Node | undefined = node.parent;\n while (current) {\n if (ts.isImportDeclaration(current)) return true;\n current = current.parent;\n }\n return false;\n}\n\nfunction removeImportSpecifier(\n namedImports: ts.NamedImports,\n specifier: ts.ImportSpecifier,\n sourceFile: ts.SourceFile,\n edits: Edit[],\n): void {\n const elements = namedImports.elements;\n if (elements.length === 1) {\n // Remove the entire import declaration\n const importDecl = namedImports.parent.parent;\n let end = importDecl.getEnd();\n // Also remove trailing newline if present\n const fullText = sourceFile.getFullText();\n if (fullText[end] === '\\n') end++;\n edits.push({\n start: importDecl.getStart(sourceFile),\n end,\n replacement: '',\n });\n } else {\n // Remove just this specifier with surrounding comma/whitespace\n const idx = elements.indexOf(specifier);\n let start: number;\n let end: number;\n if (idx < elements.length - 1) {\n // Not the last → remove from this specifier start to next specifier start\n start = specifier.getStart(sourceFile);\n end = elements[idx + 1].getStart(sourceFile);\n } else {\n // Last element → remove from previous element end to this end\n start = elements[idx - 1].getEnd();\n end = specifier.getEnd();\n }\n edits.push({ start, end, replacement: '' });\n }\n}\n\nfunction applyEdits(source: string, edits: Edit[]): string {\n const unique = deduplicateEdits(edits);\n let result = source;\n for (const edit of unique.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n\nfunction deduplicateEdits(edits: Edit[]): Edit[] {\n const seen = new Map<string, Edit>();\n for (const edit of edits) {\n const key = `${edit.start}:${edit.end}`;\n seen.set(key, edit);\n }\n return Array.from(seen.values());\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n",
|
|
2959
2959
|
"displayName": "Schema",
|
|
2960
2960
|
"properties": [
|
|
2961
2961
|
{
|
|
@@ -2967,7 +2967,7 @@
|
|
|
2967
2967
|
"indexKey": "",
|
|
2968
2968
|
"optional": true,
|
|
2969
2969
|
"description": "",
|
|
2970
|
-
"line":
|
|
2970
|
+
"line": 7,
|
|
2971
2971
|
"rawdescription": "\n"
|
|
2972
2972
|
},
|
|
2973
2973
|
{
|
|
@@ -2979,7 +2979,7 @@
|
|
|
2979
2979
|
"indexKey": "",
|
|
2980
2980
|
"optional": true,
|
|
2981
2981
|
"description": "",
|
|
2982
|
-
"line":
|
|
2982
|
+
"line": 6,
|
|
2983
2983
|
"rawdescription": "\n"
|
|
2984
2984
|
}
|
|
2985
2985
|
],
|
|
@@ -2997,12 +2997,12 @@
|
|
|
2997
2997
|
},
|
|
2998
2998
|
{
|
|
2999
2999
|
"name": "Schema",
|
|
3000
|
-
"id": "interface-Schema-
|
|
3001
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
3000
|
+
"id": "interface-Schema-21147930d3fbc38fbb3052a2ed9e7aa2b7505e6ed8c88c28796ce7101bd2ad914726eb230dda5826647036190edec6dae7e7e1d172387cd3803aa00bcdf790be-20",
|
|
3001
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
3002
3002
|
"deprecated": false,
|
|
3003
3003
|
"deprecationMessage": "",
|
|
3004
3004
|
"type": "interface",
|
|
3005
|
-
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\
|
|
3005
|
+
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, TmplAstElement, TmplAstNode, TmplAstTextAttribute } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst OLD_NAME = 'iconSet';\nconst NEW_NAME = 'iconSvgName';\nconst COMPONENT_TAG = 'eui-icon-toggle';\n\nexport function migrateEuiIconToggle(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let templateCount = 0;\n let tsCount = 0;\n\n const dir = tree.getDir(scanPath || '/');\n visitDir(dir, (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n if (!original.includes(COMPONENT_TAG)) return;\n\n let result: string;\n\n if (path.endsWith('.html')) {\n result = migrateTemplate(original);\n } else {\n result = migrateInlineTemplates(original);\n result = renameTsPropertyAccesses(result);\n }\n\n if (result !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would rename '${OLD_NAME}' → '${NEW_NAME}' in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n if (path.endsWith('.html')) templateCount++;\n else tsCount++;\n }\n });\n\n context.logger.info(`Renamed '${OLD_NAME}' → '${NEW_NAME}' on ${COMPONENT_TAG} in ${templateCount + tsCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\nfunction visitDir(dir: DirEntry, callback: (path: string) => void): void {\n for (const file of dir.subfiles) {\n if (file.endsWith('.d.ts')) continue;\n if (!file.endsWith('.html') && !file.endsWith('.ts')) continue;\n callback(`${dir.path}/${file}`);\n }\n for (const sub of dir.subdirs) {\n if (sub === 'node_modules' || sub === 'dist') continue;\n visitDir(dir.dir(sub), callback);\n }\n}\n\nfunction migrateTemplate(source: string): string {\n const parsed = parseTemplate(source, '', { preserveWhitespaces: true });\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n visitNodes(parsed.nodes, edits);\n\n return applyEdits(source, edits);\n}\n\nfunction migrateInlineTemplates(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const changes: { start: number; end: number; text: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAssignment(node) && isTemplateProperty(node) && isComponentMetadataProperty(node)) {\n const init = unwrapExpression(node.initializer);\n if (ts.isStringLiteral(init) || ts.isNoSubstitutionTemplateLiteral(init)) {\n const start = init.getStart(sourceFile) + 1;\n const end = init.getEnd() - 1;\n const rawTemplate = source.slice(start, end);\n if (!rawTemplate.includes(COMPONENT_TAG)) {\n ts.forEachChild(node, visit);\n return;\n }\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) {\n changes.push({ start, end, text: migrated });\n }\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n let result = source;\n for (const change of changes.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, change.start) + change.text + result.slice(change.end);\n }\n return result;\n}\n\nfunction renameTsPropertyAccesses(source: string): string {\n const sourceFile = ts.createSourceFile('', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: { start: number; end: number; replacement: string }[] = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && node.name.text === OLD_NAME) {\n edits.push({ start: node.name.getStart(sourceFile), end: node.name.getEnd(), replacement: NEW_NAME });\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return applyEdits(source, edits);\n}\n\nfunction isTemplateProperty(node: ts.PropertyAssignment): boolean {\n const name = node.name;\n return (ts.isIdentifier(name) && name.text === 'template') || (ts.isStringLiteral(name) && name.text === 'template');\n}\n\nfunction isComponentMetadataProperty(node: ts.PropertyAssignment): boolean {\n const objectLiteral = node.parent;\n if (!ts.isObjectLiteralExpression(objectLiteral)) return false;\n const callExpression = objectLiteral.parent;\n if (!ts.isCallExpression(callExpression) || callExpression.arguments[0] !== objectLiteral) return false;\n return ts.isDecorator(callExpression.parent) && ts.isIdentifier(callExpression.expression) && callExpression.expression.text === 'Component';\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let current = expression;\n while (ts.isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n}\n\nfunction visitNodes(nodes: TmplAstNode[], edits: { start: number; end: number; replacement: string }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === COMPONENT_TAG) {\n collectRenames(node, edits);\n }\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const attr of element.attributes) {\n if (attr.name === OLD_NAME) {\n edits.push({ start: attr.keySpan!.start.offset, end: attr.keySpan!.end.offset, replacement: NEW_NAME });\n }\n }\n for (const input of element.inputs) {\n if (input.name === OLD_NAME) {\n edits.push({ start: input.keySpan!.start.offset, end: input.keySpan!.end.offset, replacement: NEW_NAME });\n }\n }\n}\n\nfunction applyEdits(source: string, edits: { start: number; end: number; replacement: string }[]): string {\n let result = source;\n for (const edit of edits.sort((a, b) => b.start - a.start)) {\n result = result.slice(0, edit.start) + edit.replacement + result.slice(edit.end);\n }\n return result;\n}\n",
|
|
3006
3006
|
"displayName": "Schema",
|
|
3007
3007
|
"properties": [
|
|
3008
3008
|
{
|
|
@@ -3014,7 +3014,7 @@
|
|
|
3014
3014
|
"indexKey": "",
|
|
3015
3015
|
"optional": true,
|
|
3016
3016
|
"description": "",
|
|
3017
|
-
"line":
|
|
3017
|
+
"line": 8,
|
|
3018
3018
|
"rawdescription": "\n"
|
|
3019
3019
|
},
|
|
3020
3020
|
{
|
|
@@ -3026,7 +3026,7 @@
|
|
|
3026
3026
|
"indexKey": "",
|
|
3027
3027
|
"optional": true,
|
|
3028
3028
|
"description": "",
|
|
3029
|
-
"line":
|
|
3029
|
+
"line": 7,
|
|
3030
3030
|
"rawdescription": "\n"
|
|
3031
3031
|
}
|
|
3032
3032
|
],
|
|
@@ -24416,7 +24416,7 @@
|
|
|
24416
24416
|
},
|
|
24417
24417
|
{
|
|
24418
24418
|
"name": "applyEdits",
|
|
24419
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
24419
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
24420
24420
|
"ctype": "miscellaneous",
|
|
24421
24421
|
"subtype": "function",
|
|
24422
24422
|
"coverageIgnore": false,
|
|
@@ -24461,7 +24461,7 @@
|
|
|
24461
24461
|
},
|
|
24462
24462
|
{
|
|
24463
24463
|
"name": "applyEdits",
|
|
24464
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
24464
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
24465
24465
|
"ctype": "miscellaneous",
|
|
24466
24466
|
"subtype": "function",
|
|
24467
24467
|
"coverageIgnore": false,
|
|
@@ -24506,7 +24506,7 @@
|
|
|
24506
24506
|
},
|
|
24507
24507
|
{
|
|
24508
24508
|
"name": "applyEdits",
|
|
24509
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
24509
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
24510
24510
|
"ctype": "miscellaneous",
|
|
24511
24511
|
"subtype": "function",
|
|
24512
24512
|
"coverageIgnore": false,
|
|
@@ -24551,7 +24551,7 @@
|
|
|
24551
24551
|
},
|
|
24552
24552
|
{
|
|
24553
24553
|
"name": "applyEdits",
|
|
24554
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
24554
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
24555
24555
|
"ctype": "miscellaneous",
|
|
24556
24556
|
"subtype": "function",
|
|
24557
24557
|
"coverageIgnore": false,
|
|
@@ -24596,7 +24596,7 @@
|
|
|
24596
24596
|
},
|
|
24597
24597
|
{
|
|
24598
24598
|
"name": "applyEdits",
|
|
24599
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
24599
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
24600
24600
|
"ctype": "miscellaneous",
|
|
24601
24601
|
"subtype": "function",
|
|
24602
24602
|
"coverageIgnore": false,
|
|
@@ -25998,7 +25998,7 @@
|
|
|
25998
25998
|
},
|
|
25999
25999
|
{
|
|
26000
26000
|
"name": "collectRenames",
|
|
26001
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
26001
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
26002
26002
|
"ctype": "miscellaneous",
|
|
26003
26003
|
"subtype": "function",
|
|
26004
26004
|
"coverageIgnore": false,
|
|
@@ -26043,7 +26043,7 @@
|
|
|
26043
26043
|
},
|
|
26044
26044
|
{
|
|
26045
26045
|
"name": "collectRenames",
|
|
26046
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
26046
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
26047
26047
|
"ctype": "miscellaneous",
|
|
26048
26048
|
"subtype": "function",
|
|
26049
26049
|
"coverageIgnore": false,
|
|
@@ -29339,7 +29339,7 @@
|
|
|
29339
29339
|
},
|
|
29340
29340
|
{
|
|
29341
29341
|
"name": "isComponentMetadataProperty",
|
|
29342
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29342
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
29343
29343
|
"ctype": "miscellaneous",
|
|
29344
29344
|
"subtype": "function",
|
|
29345
29345
|
"coverageIgnore": false,
|
|
@@ -29369,7 +29369,7 @@
|
|
|
29369
29369
|
},
|
|
29370
29370
|
{
|
|
29371
29371
|
"name": "isComponentMetadataProperty",
|
|
29372
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29372
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
29373
29373
|
"ctype": "miscellaneous",
|
|
29374
29374
|
"subtype": "function",
|
|
29375
29375
|
"coverageIgnore": false,
|
|
@@ -29399,7 +29399,7 @@
|
|
|
29399
29399
|
},
|
|
29400
29400
|
{
|
|
29401
29401
|
"name": "isComponentMetadataProperty",
|
|
29402
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29402
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
29403
29403
|
"ctype": "miscellaneous",
|
|
29404
29404
|
"subtype": "function",
|
|
29405
29405
|
"coverageIgnore": false,
|
|
@@ -29429,7 +29429,7 @@
|
|
|
29429
29429
|
},
|
|
29430
29430
|
{
|
|
29431
29431
|
"name": "isComponentMetadataProperty",
|
|
29432
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29432
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
29433
29433
|
"ctype": "miscellaneous",
|
|
29434
29434
|
"subtype": "function",
|
|
29435
29435
|
"coverageIgnore": false,
|
|
@@ -29459,7 +29459,7 @@
|
|
|
29459
29459
|
},
|
|
29460
29460
|
{
|
|
29461
29461
|
"name": "isComponentMetadataProperty",
|
|
29462
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29462
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
29463
29463
|
"ctype": "miscellaneous",
|
|
29464
29464
|
"subtype": "function",
|
|
29465
29465
|
"coverageIgnore": false,
|
|
@@ -29884,7 +29884,7 @@
|
|
|
29884
29884
|
},
|
|
29885
29885
|
{
|
|
29886
29886
|
"name": "isTemplateProperty",
|
|
29887
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29887
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
29888
29888
|
"ctype": "miscellaneous",
|
|
29889
29889
|
"subtype": "function",
|
|
29890
29890
|
"coverageIgnore": false,
|
|
@@ -29914,7 +29914,7 @@
|
|
|
29914
29914
|
},
|
|
29915
29915
|
{
|
|
29916
29916
|
"name": "isTemplateProperty",
|
|
29917
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29917
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
29918
29918
|
"ctype": "miscellaneous",
|
|
29919
29919
|
"subtype": "function",
|
|
29920
29920
|
"coverageIgnore": false,
|
|
@@ -29944,7 +29944,7 @@
|
|
|
29944
29944
|
},
|
|
29945
29945
|
{
|
|
29946
29946
|
"name": "isTemplateProperty",
|
|
29947
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29947
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
29948
29948
|
"ctype": "miscellaneous",
|
|
29949
29949
|
"subtype": "function",
|
|
29950
29950
|
"coverageIgnore": false,
|
|
@@ -29974,7 +29974,7 @@
|
|
|
29974
29974
|
},
|
|
29975
29975
|
{
|
|
29976
29976
|
"name": "isTemplateProperty",
|
|
29977
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
29977
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
29978
29978
|
"ctype": "miscellaneous",
|
|
29979
29979
|
"subtype": "function",
|
|
29980
29980
|
"coverageIgnore": false,
|
|
@@ -30004,7 +30004,7 @@
|
|
|
30004
30004
|
},
|
|
30005
30005
|
{
|
|
30006
30006
|
"name": "isTemplateProperty",
|
|
30007
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
30007
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
30008
30008
|
"ctype": "miscellaneous",
|
|
30009
30009
|
"subtype": "function",
|
|
30010
30010
|
"coverageIgnore": false,
|
|
@@ -31854,38 +31854,6 @@
|
|
|
31854
31854
|
}
|
|
31855
31855
|
]
|
|
31856
31856
|
},
|
|
31857
|
-
{
|
|
31858
|
-
"name": "migrateInlineTemplates",
|
|
31859
|
-
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
31860
|
-
"ctype": "miscellaneous",
|
|
31861
|
-
"subtype": "function",
|
|
31862
|
-
"coverageIgnore": false,
|
|
31863
|
-
"deprecated": false,
|
|
31864
|
-
"deprecationMessage": "",
|
|
31865
|
-
"rawdescription": "",
|
|
31866
|
-
"description": "",
|
|
31867
|
-
"displayName": "migrateInlineTemplates",
|
|
31868
|
-
"args": [
|
|
31869
|
-
{
|
|
31870
|
-
"name": "source",
|
|
31871
|
-
"type": "string",
|
|
31872
|
-
"deprecated": false,
|
|
31873
|
-
"deprecationMessage": ""
|
|
31874
|
-
}
|
|
31875
|
-
],
|
|
31876
|
-
"returnType": "string",
|
|
31877
|
-
"jsdoctags": [
|
|
31878
|
-
{
|
|
31879
|
-
"name": "source",
|
|
31880
|
-
"type": "string",
|
|
31881
|
-
"deprecated": false,
|
|
31882
|
-
"deprecationMessage": "",
|
|
31883
|
-
"tagName": {
|
|
31884
|
-
"text": "param"
|
|
31885
|
-
}
|
|
31886
|
-
}
|
|
31887
|
-
]
|
|
31888
|
-
},
|
|
31889
31857
|
{
|
|
31890
31858
|
"name": "migrateInlineTemplates",
|
|
31891
31859
|
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
@@ -32075,8 +32043,8 @@
|
|
|
32075
32043
|
]
|
|
32076
32044
|
},
|
|
32077
32045
|
{
|
|
32078
|
-
"name": "
|
|
32079
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32046
|
+
"name": "migrateInlineTemplates",
|
|
32047
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
32080
32048
|
"ctype": "miscellaneous",
|
|
32081
32049
|
"subtype": "function",
|
|
32082
32050
|
"coverageIgnore": false,
|
|
@@ -32084,7 +32052,7 @@
|
|
|
32084
32052
|
"deprecationMessage": "",
|
|
32085
32053
|
"rawdescription": "",
|
|
32086
32054
|
"description": "",
|
|
32087
|
-
"displayName": "
|
|
32055
|
+
"displayName": "migrateInlineTemplates",
|
|
32088
32056
|
"args": [
|
|
32089
32057
|
{
|
|
32090
32058
|
"name": "source",
|
|
@@ -32108,7 +32076,7 @@
|
|
|
32108
32076
|
},
|
|
32109
32077
|
{
|
|
32110
32078
|
"name": "migrateTemplate",
|
|
32111
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32079
|
+
"file": "packages/core/schematics/migrate-eui-accent/index.ts",
|
|
32112
32080
|
"ctype": "miscellaneous",
|
|
32113
32081
|
"subtype": "function",
|
|
32114
32082
|
"coverageIgnore": false,
|
|
@@ -32140,7 +32108,7 @@
|
|
|
32140
32108
|
},
|
|
32141
32109
|
{
|
|
32142
32110
|
"name": "migrateTemplate",
|
|
32143
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32111
|
+
"file": "packages/core/schematics/migrate-eui-alert/index.ts",
|
|
32144
32112
|
"ctype": "miscellaneous",
|
|
32145
32113
|
"subtype": "function",
|
|
32146
32114
|
"coverageIgnore": false,
|
|
@@ -32172,7 +32140,7 @@
|
|
|
32172
32140
|
},
|
|
32173
32141
|
{
|
|
32174
32142
|
"name": "migrateTemplate",
|
|
32175
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32143
|
+
"file": "packages/core/schematics/migrate-eui-avatar/index.ts",
|
|
32176
32144
|
"ctype": "miscellaneous",
|
|
32177
32145
|
"subtype": "function",
|
|
32178
32146
|
"coverageIgnore": false,
|
|
@@ -32204,7 +32172,7 @@
|
|
|
32204
32172
|
},
|
|
32205
32173
|
{
|
|
32206
32174
|
"name": "migrateTemplate",
|
|
32207
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32175
|
+
"file": "packages/core/schematics/migrate-eui-button/index.ts",
|
|
32208
32176
|
"ctype": "miscellaneous",
|
|
32209
32177
|
"subtype": "function",
|
|
32210
32178
|
"coverageIgnore": false,
|
|
@@ -32236,7 +32204,7 @@
|
|
|
32236
32204
|
},
|
|
32237
32205
|
{
|
|
32238
32206
|
"name": "migrateTemplate",
|
|
32239
|
-
"file": "packages/core/schematics/migrate-eui-chip
|
|
32207
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
32240
32208
|
"ctype": "miscellaneous",
|
|
32241
32209
|
"subtype": "function",
|
|
32242
32210
|
"coverageIgnore": false,
|
|
@@ -32268,7 +32236,7 @@
|
|
|
32268
32236
|
},
|
|
32269
32237
|
{
|
|
32270
32238
|
"name": "migrateTemplate",
|
|
32271
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32239
|
+
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
32272
32240
|
"ctype": "miscellaneous",
|
|
32273
32241
|
"subtype": "function",
|
|
32274
32242
|
"coverageIgnore": false,
|
|
@@ -32300,7 +32268,7 @@
|
|
|
32300
32268
|
},
|
|
32301
32269
|
{
|
|
32302
32270
|
"name": "migrateTemplate",
|
|
32303
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32271
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
32304
32272
|
"ctype": "miscellaneous",
|
|
32305
32273
|
"subtype": "function",
|
|
32306
32274
|
"coverageIgnore": false,
|
|
@@ -32332,7 +32300,7 @@
|
|
|
32332
32300
|
},
|
|
32333
32301
|
{
|
|
32334
32302
|
"name": "migrateTemplate",
|
|
32335
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32303
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
32336
32304
|
"ctype": "miscellaneous",
|
|
32337
32305
|
"subtype": "function",
|
|
32338
32306
|
"coverageIgnore": false,
|
|
@@ -32364,7 +32332,7 @@
|
|
|
32364
32332
|
},
|
|
32365
32333
|
{
|
|
32366
32334
|
"name": "migrateTemplate",
|
|
32367
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32335
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
32368
32336
|
"ctype": "miscellaneous",
|
|
32369
32337
|
"subtype": "function",
|
|
32370
32338
|
"coverageIgnore": false,
|
|
@@ -32396,7 +32364,7 @@
|
|
|
32396
32364
|
},
|
|
32397
32365
|
{
|
|
32398
32366
|
"name": "migrateTemplate",
|
|
32399
|
-
"file": "packages/core/schematics/migrate-eui-icon-
|
|
32367
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
32400
32368
|
"ctype": "miscellaneous",
|
|
32401
32369
|
"subtype": "function",
|
|
32402
32370
|
"coverageIgnore": false,
|
|
@@ -32676,6 +32644,38 @@
|
|
|
32676
32644
|
}
|
|
32677
32645
|
]
|
|
32678
32646
|
},
|
|
32647
|
+
{
|
|
32648
|
+
"name": "migrateTemplate",
|
|
32649
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
32650
|
+
"ctype": "miscellaneous",
|
|
32651
|
+
"subtype": "function",
|
|
32652
|
+
"coverageIgnore": false,
|
|
32653
|
+
"deprecated": false,
|
|
32654
|
+
"deprecationMessage": "",
|
|
32655
|
+
"rawdescription": "",
|
|
32656
|
+
"description": "",
|
|
32657
|
+
"displayName": "migrateTemplate",
|
|
32658
|
+
"args": [
|
|
32659
|
+
{
|
|
32660
|
+
"name": "source",
|
|
32661
|
+
"type": "string",
|
|
32662
|
+
"deprecated": false,
|
|
32663
|
+
"deprecationMessage": ""
|
|
32664
|
+
}
|
|
32665
|
+
],
|
|
32666
|
+
"returnType": "string",
|
|
32667
|
+
"jsdoctags": [
|
|
32668
|
+
{
|
|
32669
|
+
"name": "source",
|
|
32670
|
+
"type": "string",
|
|
32671
|
+
"deprecated": false,
|
|
32672
|
+
"deprecationMessage": "",
|
|
32673
|
+
"tagName": {
|
|
32674
|
+
"text": "param"
|
|
32675
|
+
}
|
|
32676
|
+
}
|
|
32677
|
+
]
|
|
32678
|
+
},
|
|
32679
32679
|
{
|
|
32680
32680
|
"name": "migrateTemplateWithPaginator",
|
|
32681
32681
|
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
@@ -34486,7 +34486,7 @@
|
|
|
34486
34486
|
},
|
|
34487
34487
|
{
|
|
34488
34488
|
"name": "unwrapExpression",
|
|
34489
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
34489
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
34490
34490
|
"ctype": "miscellaneous",
|
|
34491
34491
|
"subtype": "function",
|
|
34492
34492
|
"coverageIgnore": false,
|
|
@@ -34516,7 +34516,7 @@
|
|
|
34516
34516
|
},
|
|
34517
34517
|
{
|
|
34518
34518
|
"name": "unwrapExpression",
|
|
34519
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
34519
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
34520
34520
|
"ctype": "miscellaneous",
|
|
34521
34521
|
"subtype": "function",
|
|
34522
34522
|
"coverageIgnore": false,
|
|
@@ -34546,7 +34546,7 @@
|
|
|
34546
34546
|
},
|
|
34547
34547
|
{
|
|
34548
34548
|
"name": "unwrapExpression",
|
|
34549
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
34549
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
34550
34550
|
"ctype": "miscellaneous",
|
|
34551
34551
|
"subtype": "function",
|
|
34552
34552
|
"coverageIgnore": false,
|
|
@@ -34576,7 +34576,7 @@
|
|
|
34576
34576
|
},
|
|
34577
34577
|
{
|
|
34578
34578
|
"name": "unwrapExpression",
|
|
34579
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
34579
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
34580
34580
|
"ctype": "miscellaneous",
|
|
34581
34581
|
"subtype": "function",
|
|
34582
34582
|
"coverageIgnore": false,
|
|
@@ -34606,7 +34606,7 @@
|
|
|
34606
34606
|
},
|
|
34607
34607
|
{
|
|
34608
34608
|
"name": "unwrapExpression",
|
|
34609
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
34609
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
34610
34610
|
"ctype": "miscellaneous",
|
|
34611
34611
|
"subtype": "function",
|
|
34612
34612
|
"coverageIgnore": false,
|
|
@@ -35369,7 +35369,7 @@
|
|
|
35369
35369
|
},
|
|
35370
35370
|
{
|
|
35371
35371
|
"name": "visitDir",
|
|
35372
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35372
|
+
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
35373
35373
|
"ctype": "miscellaneous",
|
|
35374
35374
|
"subtype": "function",
|
|
35375
35375
|
"coverageIgnore": false,
|
|
@@ -35414,7 +35414,7 @@
|
|
|
35414
35414
|
},
|
|
35415
35415
|
{
|
|
35416
35416
|
"name": "visitDir",
|
|
35417
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35417
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
35418
35418
|
"ctype": "miscellaneous",
|
|
35419
35419
|
"subtype": "function",
|
|
35420
35420
|
"coverageIgnore": false,
|
|
@@ -35459,7 +35459,7 @@
|
|
|
35459
35459
|
},
|
|
35460
35460
|
{
|
|
35461
35461
|
"name": "visitDir",
|
|
35462
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35462
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
35463
35463
|
"ctype": "miscellaneous",
|
|
35464
35464
|
"subtype": "function",
|
|
35465
35465
|
"coverageIgnore": false,
|
|
@@ -35504,7 +35504,7 @@
|
|
|
35504
35504
|
},
|
|
35505
35505
|
{
|
|
35506
35506
|
"name": "visitDir",
|
|
35507
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35507
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
35508
35508
|
"ctype": "miscellaneous",
|
|
35509
35509
|
"subtype": "function",
|
|
35510
35510
|
"coverageIgnore": false,
|
|
@@ -35549,7 +35549,7 @@
|
|
|
35549
35549
|
},
|
|
35550
35550
|
{
|
|
35551
35551
|
"name": "visitDir",
|
|
35552
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35552
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
35553
35553
|
"ctype": "miscellaneous",
|
|
35554
35554
|
"subtype": "function",
|
|
35555
35555
|
"coverageIgnore": false,
|
|
@@ -35594,7 +35594,7 @@
|
|
|
35594
35594
|
},
|
|
35595
35595
|
{
|
|
35596
35596
|
"name": "visitDir",
|
|
35597
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35597
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
35598
35598
|
"ctype": "miscellaneous",
|
|
35599
35599
|
"subtype": "function",
|
|
35600
35600
|
"coverageIgnore": false,
|
|
@@ -35639,7 +35639,7 @@
|
|
|
35639
35639
|
},
|
|
35640
35640
|
{
|
|
35641
35641
|
"name": "visitDir",
|
|
35642
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35642
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
35643
35643
|
"ctype": "miscellaneous",
|
|
35644
35644
|
"subtype": "function",
|
|
35645
35645
|
"coverageIgnore": false,
|
|
@@ -36232,49 +36232,6 @@
|
|
|
36232
36232
|
}
|
|
36233
36233
|
]
|
|
36234
36234
|
},
|
|
36235
|
-
{
|
|
36236
|
-
"name": "visitNodes",
|
|
36237
|
-
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
36238
|
-
"ctype": "miscellaneous",
|
|
36239
|
-
"subtype": "function",
|
|
36240
|
-
"coverageIgnore": false,
|
|
36241
|
-
"deprecated": false,
|
|
36242
|
-
"deprecationMessage": "",
|
|
36243
|
-
"rawdescription": "",
|
|
36244
|
-
"description": "",
|
|
36245
|
-
"displayName": "visitNodes",
|
|
36246
|
-
"args": [
|
|
36247
|
-
{
|
|
36248
|
-
"name": "nodes",
|
|
36249
|
-
"deprecated": false,
|
|
36250
|
-
"deprecationMessage": ""
|
|
36251
|
-
},
|
|
36252
|
-
{
|
|
36253
|
-
"name": "edits",
|
|
36254
|
-
"deprecated": false,
|
|
36255
|
-
"deprecationMessage": ""
|
|
36256
|
-
}
|
|
36257
|
-
],
|
|
36258
|
-
"returnType": "void",
|
|
36259
|
-
"jsdoctags": [
|
|
36260
|
-
{
|
|
36261
|
-
"name": "nodes",
|
|
36262
|
-
"deprecated": false,
|
|
36263
|
-
"deprecationMessage": "",
|
|
36264
|
-
"tagName": {
|
|
36265
|
-
"text": "param"
|
|
36266
|
-
}
|
|
36267
|
-
},
|
|
36268
|
-
{
|
|
36269
|
-
"name": "edits",
|
|
36270
|
-
"deprecated": false,
|
|
36271
|
-
"deprecationMessage": "",
|
|
36272
|
-
"tagName": {
|
|
36273
|
-
"text": "param"
|
|
36274
|
-
}
|
|
36275
|
-
}
|
|
36276
|
-
]
|
|
36277
|
-
},
|
|
36278
36235
|
{
|
|
36279
36236
|
"name": "visitNodes",
|
|
36280
36237
|
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
@@ -36450,8 +36407,8 @@
|
|
|
36450
36407
|
]
|
|
36451
36408
|
},
|
|
36452
36409
|
{
|
|
36453
|
-
"name": "
|
|
36454
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36410
|
+
"name": "visitNodes",
|
|
36411
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
36455
36412
|
"ctype": "miscellaneous",
|
|
36456
36413
|
"subtype": "function",
|
|
36457
36414
|
"coverageIgnore": false,
|
|
@@ -36459,44 +36416,20 @@
|
|
|
36459
36416
|
"deprecationMessage": "",
|
|
36460
36417
|
"rawdescription": "",
|
|
36461
36418
|
"description": "",
|
|
36462
|
-
"displayName": "
|
|
36419
|
+
"displayName": "visitNodes",
|
|
36463
36420
|
"args": [
|
|
36464
36421
|
{
|
|
36465
36422
|
"name": "nodes",
|
|
36466
36423
|
"deprecated": false,
|
|
36467
36424
|
"deprecationMessage": ""
|
|
36468
36425
|
},
|
|
36469
|
-
{
|
|
36470
|
-
"name": "source",
|
|
36471
|
-
"type": "string",
|
|
36472
|
-
"deprecated": false,
|
|
36473
|
-
"deprecationMessage": ""
|
|
36474
|
-
},
|
|
36475
36426
|
{
|
|
36476
36427
|
"name": "edits",
|
|
36477
36428
|
"deprecated": false,
|
|
36478
36429
|
"deprecationMessage": ""
|
|
36479
|
-
},
|
|
36480
|
-
{
|
|
36481
|
-
"name": "insideEuiTable",
|
|
36482
|
-
"type": "boolean",
|
|
36483
|
-
"deprecated": false,
|
|
36484
|
-
"deprecationMessage": ""
|
|
36485
|
-
},
|
|
36486
|
-
{
|
|
36487
|
-
"name": "filePath",
|
|
36488
|
-
"type": "string",
|
|
36489
|
-
"deprecated": false,
|
|
36490
|
-
"deprecationMessage": ""
|
|
36491
|
-
},
|
|
36492
|
-
{
|
|
36493
|
-
"name": "context",
|
|
36494
|
-
"type": "SchematicContext",
|
|
36495
|
-
"deprecated": false,
|
|
36496
|
-
"deprecationMessage": ""
|
|
36497
36430
|
}
|
|
36498
36431
|
],
|
|
36499
|
-
"returnType": "
|
|
36432
|
+
"returnType": "void",
|
|
36500
36433
|
"jsdoctags": [
|
|
36501
36434
|
{
|
|
36502
36435
|
"name": "nodes",
|
|
@@ -36506,15 +36439,6 @@
|
|
|
36506
36439
|
"text": "param"
|
|
36507
36440
|
}
|
|
36508
36441
|
},
|
|
36509
|
-
{
|
|
36510
|
-
"name": "source",
|
|
36511
|
-
"type": "string",
|
|
36512
|
-
"deprecated": false,
|
|
36513
|
-
"deprecationMessage": "",
|
|
36514
|
-
"tagName": {
|
|
36515
|
-
"text": "param"
|
|
36516
|
-
}
|
|
36517
|
-
},
|
|
36518
36442
|
{
|
|
36519
36443
|
"name": "edits",
|
|
36520
36444
|
"deprecated": false,
|
|
@@ -36522,39 +36446,12 @@
|
|
|
36522
36446
|
"tagName": {
|
|
36523
36447
|
"text": "param"
|
|
36524
36448
|
}
|
|
36525
|
-
},
|
|
36526
|
-
{
|
|
36527
|
-
"name": "insideEuiTable",
|
|
36528
|
-
"type": "boolean",
|
|
36529
|
-
"deprecated": false,
|
|
36530
|
-
"deprecationMessage": "",
|
|
36531
|
-
"tagName": {
|
|
36532
|
-
"text": "param"
|
|
36533
|
-
}
|
|
36534
|
-
},
|
|
36535
|
-
{
|
|
36536
|
-
"name": "filePath",
|
|
36537
|
-
"type": "string",
|
|
36538
|
-
"deprecated": false,
|
|
36539
|
-
"deprecationMessage": "",
|
|
36540
|
-
"tagName": {
|
|
36541
|
-
"text": "param"
|
|
36542
|
-
}
|
|
36543
|
-
},
|
|
36544
|
-
{
|
|
36545
|
-
"name": "context",
|
|
36546
|
-
"type": "SchematicContext",
|
|
36547
|
-
"deprecated": false,
|
|
36548
|
-
"deprecationMessage": "",
|
|
36549
|
-
"tagName": {
|
|
36550
|
-
"text": "param"
|
|
36551
|
-
}
|
|
36552
36449
|
}
|
|
36553
36450
|
]
|
|
36554
36451
|
},
|
|
36555
36452
|
{
|
|
36556
|
-
"name": "
|
|
36557
|
-
"file": "packages/core/schematics/
|
|
36453
|
+
"name": "visitNodesForTable",
|
|
36454
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
36558
36455
|
"ctype": "miscellaneous",
|
|
36559
36456
|
"subtype": "function",
|
|
36560
36457
|
"coverageIgnore": false,
|
|
@@ -36562,57 +36459,13 @@
|
|
|
36562
36459
|
"deprecationMessage": "",
|
|
36563
36460
|
"rawdescription": "",
|
|
36564
36461
|
"description": "",
|
|
36565
|
-
"displayName": "
|
|
36462
|
+
"displayName": "visitNodesForTable",
|
|
36566
36463
|
"args": [
|
|
36567
36464
|
{
|
|
36568
36465
|
"name": "nodes",
|
|
36569
36466
|
"deprecated": false,
|
|
36570
36467
|
"deprecationMessage": ""
|
|
36571
36468
|
},
|
|
36572
|
-
{
|
|
36573
|
-
"name": "matched",
|
|
36574
|
-
"deprecated": false,
|
|
36575
|
-
"deprecationMessage": ""
|
|
36576
|
-
}
|
|
36577
|
-
],
|
|
36578
|
-
"returnType": "void",
|
|
36579
|
-
"jsdoctags": [
|
|
36580
|
-
{
|
|
36581
|
-
"name": "nodes",
|
|
36582
|
-
"deprecated": false,
|
|
36583
|
-
"deprecationMessage": "",
|
|
36584
|
-
"tagName": {
|
|
36585
|
-
"text": "param"
|
|
36586
|
-
}
|
|
36587
|
-
},
|
|
36588
|
-
{
|
|
36589
|
-
"name": "matched",
|
|
36590
|
-
"deprecated": false,
|
|
36591
|
-
"deprecationMessage": "",
|
|
36592
|
-
"tagName": {
|
|
36593
|
-
"text": "param"
|
|
36594
|
-
}
|
|
36595
|
-
}
|
|
36596
|
-
]
|
|
36597
|
-
},
|
|
36598
|
-
{
|
|
36599
|
-
"name": "warnPropertyAccesses",
|
|
36600
|
-
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
36601
|
-
"ctype": "miscellaneous",
|
|
36602
|
-
"subtype": "function",
|
|
36603
|
-
"coverageIgnore": false,
|
|
36604
|
-
"deprecated": false,
|
|
36605
|
-
"deprecationMessage": "",
|
|
36606
|
-
"rawdescription": "",
|
|
36607
|
-
"description": "",
|
|
36608
|
-
"displayName": "warnPropertyAccesses",
|
|
36609
|
-
"args": [
|
|
36610
|
-
{
|
|
36611
|
-
"name": "path",
|
|
36612
|
-
"type": "string",
|
|
36613
|
-
"deprecated": false,
|
|
36614
|
-
"deprecationMessage": ""
|
|
36615
|
-
},
|
|
36616
36469
|
{
|
|
36617
36470
|
"name": "source",
|
|
36618
36471
|
"type": "string",
|
|
@@ -36620,57 +36473,13 @@
|
|
|
36620
36473
|
"deprecationMessage": ""
|
|
36621
36474
|
},
|
|
36622
36475
|
{
|
|
36623
|
-
"name": "
|
|
36624
|
-
"type": "SchematicContext",
|
|
36476
|
+
"name": "edits",
|
|
36625
36477
|
"deprecated": false,
|
|
36626
36478
|
"deprecationMessage": ""
|
|
36627
|
-
}
|
|
36628
|
-
],
|
|
36629
|
-
"returnType": "void",
|
|
36630
|
-
"jsdoctags": [
|
|
36631
|
-
{
|
|
36632
|
-
"name": "path",
|
|
36633
|
-
"type": "string",
|
|
36634
|
-
"deprecated": false,
|
|
36635
|
-
"deprecationMessage": "",
|
|
36636
|
-
"tagName": {
|
|
36637
|
-
"text": "param"
|
|
36638
|
-
}
|
|
36639
|
-
},
|
|
36640
|
-
{
|
|
36641
|
-
"name": "source",
|
|
36642
|
-
"type": "string",
|
|
36643
|
-
"deprecated": false,
|
|
36644
|
-
"deprecationMessage": "",
|
|
36645
|
-
"tagName": {
|
|
36646
|
-
"text": "param"
|
|
36647
|
-
}
|
|
36648
36479
|
},
|
|
36649
36480
|
{
|
|
36650
|
-
"name": "
|
|
36651
|
-
"type": "
|
|
36652
|
-
"deprecated": false,
|
|
36653
|
-
"deprecationMessage": "",
|
|
36654
|
-
"tagName": {
|
|
36655
|
-
"text": "param"
|
|
36656
|
-
}
|
|
36657
|
-
}
|
|
36658
|
-
]
|
|
36659
|
-
},
|
|
36660
|
-
{
|
|
36661
|
-
"name": "warnRemovedProperties",
|
|
36662
|
-
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
36663
|
-
"ctype": "miscellaneous",
|
|
36664
|
-
"subtype": "function",
|
|
36665
|
-
"coverageIgnore": false,
|
|
36666
|
-
"deprecated": false,
|
|
36667
|
-
"deprecationMessage": "",
|
|
36668
|
-
"rawdescription": "",
|
|
36669
|
-
"description": "",
|
|
36670
|
-
"displayName": "warnRemovedProperties",
|
|
36671
|
-
"args": [
|
|
36672
|
-
{
|
|
36673
|
-
"name": "sourceFile",
|
|
36481
|
+
"name": "insideEuiTable",
|
|
36482
|
+
"type": "boolean",
|
|
36674
36483
|
"deprecated": false,
|
|
36675
36484
|
"deprecationMessage": ""
|
|
36676
36485
|
},
|
|
@@ -36687,10 +36496,10 @@
|
|
|
36687
36496
|
"deprecationMessage": ""
|
|
36688
36497
|
}
|
|
36689
36498
|
],
|
|
36690
|
-
"returnType": "
|
|
36499
|
+
"returnType": "boolean",
|
|
36691
36500
|
"jsdoctags": [
|
|
36692
36501
|
{
|
|
36693
|
-
"name": "
|
|
36502
|
+
"name": "nodes",
|
|
36694
36503
|
"deprecated": false,
|
|
36695
36504
|
"deprecationMessage": "",
|
|
36696
36505
|
"tagName": {
|
|
@@ -36698,7 +36507,7 @@
|
|
|
36698
36507
|
}
|
|
36699
36508
|
},
|
|
36700
36509
|
{
|
|
36701
|
-
"name": "
|
|
36510
|
+
"name": "source",
|
|
36702
36511
|
"type": "string",
|
|
36703
36512
|
"deprecated": false,
|
|
36704
36513
|
"deprecationMessage": "",
|
|
@@ -36707,52 +36516,243 @@
|
|
|
36707
36516
|
}
|
|
36708
36517
|
},
|
|
36709
36518
|
{
|
|
36710
|
-
"name": "
|
|
36711
|
-
"type": "SchematicContext",
|
|
36519
|
+
"name": "edits",
|
|
36712
36520
|
"deprecated": false,
|
|
36713
36521
|
"deprecationMessage": "",
|
|
36714
36522
|
"tagName": {
|
|
36715
36523
|
"text": "param"
|
|
36716
36524
|
}
|
|
36717
|
-
}
|
|
36718
|
-
]
|
|
36719
|
-
},
|
|
36720
|
-
{
|
|
36721
|
-
"name": "warnSetSort",
|
|
36722
|
-
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
36723
|
-
"ctype": "miscellaneous",
|
|
36724
|
-
"subtype": "function",
|
|
36725
|
-
"coverageIgnore": false,
|
|
36726
|
-
"deprecated": false,
|
|
36727
|
-
"deprecationMessage": "",
|
|
36728
|
-
"rawdescription": "",
|
|
36729
|
-
"description": "",
|
|
36730
|
-
"displayName": "warnSetSort",
|
|
36731
|
-
"args": [
|
|
36732
|
-
{
|
|
36733
|
-
"name": "source",
|
|
36734
|
-
"type": "string",
|
|
36735
|
-
"deprecated": false,
|
|
36736
|
-
"deprecationMessage": ""
|
|
36737
|
-
},
|
|
36738
|
-
{
|
|
36739
|
-
"name": "filePath",
|
|
36740
|
-
"type": "string",
|
|
36741
|
-
"deprecated": false,
|
|
36742
|
-
"deprecationMessage": ""
|
|
36743
36525
|
},
|
|
36744
36526
|
{
|
|
36745
|
-
"name": "
|
|
36746
|
-
"type": "
|
|
36747
|
-
"deprecated": false,
|
|
36748
|
-
"deprecationMessage": ""
|
|
36749
|
-
|
|
36750
|
-
|
|
36751
|
-
|
|
36752
|
-
|
|
36753
|
-
{
|
|
36754
|
-
"name": "
|
|
36755
|
-
"type": "string",
|
|
36527
|
+
"name": "insideEuiTable",
|
|
36528
|
+
"type": "boolean",
|
|
36529
|
+
"deprecated": false,
|
|
36530
|
+
"deprecationMessage": "",
|
|
36531
|
+
"tagName": {
|
|
36532
|
+
"text": "param"
|
|
36533
|
+
}
|
|
36534
|
+
},
|
|
36535
|
+
{
|
|
36536
|
+
"name": "filePath",
|
|
36537
|
+
"type": "string",
|
|
36538
|
+
"deprecated": false,
|
|
36539
|
+
"deprecationMessage": "",
|
|
36540
|
+
"tagName": {
|
|
36541
|
+
"text": "param"
|
|
36542
|
+
}
|
|
36543
|
+
},
|
|
36544
|
+
{
|
|
36545
|
+
"name": "context",
|
|
36546
|
+
"type": "SchematicContext",
|
|
36547
|
+
"deprecated": false,
|
|
36548
|
+
"deprecationMessage": "",
|
|
36549
|
+
"tagName": {
|
|
36550
|
+
"text": "param"
|
|
36551
|
+
}
|
|
36552
|
+
}
|
|
36553
|
+
]
|
|
36554
|
+
},
|
|
36555
|
+
{
|
|
36556
|
+
"name": "visitTemplateNodes",
|
|
36557
|
+
"file": "packages/core/schematics/add-eui-imports/index.ts",
|
|
36558
|
+
"ctype": "miscellaneous",
|
|
36559
|
+
"subtype": "function",
|
|
36560
|
+
"coverageIgnore": false,
|
|
36561
|
+
"deprecated": false,
|
|
36562
|
+
"deprecationMessage": "",
|
|
36563
|
+
"rawdescription": "",
|
|
36564
|
+
"description": "",
|
|
36565
|
+
"displayName": "visitTemplateNodes",
|
|
36566
|
+
"args": [
|
|
36567
|
+
{
|
|
36568
|
+
"name": "nodes",
|
|
36569
|
+
"deprecated": false,
|
|
36570
|
+
"deprecationMessage": ""
|
|
36571
|
+
},
|
|
36572
|
+
{
|
|
36573
|
+
"name": "matched",
|
|
36574
|
+
"deprecated": false,
|
|
36575
|
+
"deprecationMessage": ""
|
|
36576
|
+
}
|
|
36577
|
+
],
|
|
36578
|
+
"returnType": "void",
|
|
36579
|
+
"jsdoctags": [
|
|
36580
|
+
{
|
|
36581
|
+
"name": "nodes",
|
|
36582
|
+
"deprecated": false,
|
|
36583
|
+
"deprecationMessage": "",
|
|
36584
|
+
"tagName": {
|
|
36585
|
+
"text": "param"
|
|
36586
|
+
}
|
|
36587
|
+
},
|
|
36588
|
+
{
|
|
36589
|
+
"name": "matched",
|
|
36590
|
+
"deprecated": false,
|
|
36591
|
+
"deprecationMessage": "",
|
|
36592
|
+
"tagName": {
|
|
36593
|
+
"text": "param"
|
|
36594
|
+
}
|
|
36595
|
+
}
|
|
36596
|
+
]
|
|
36597
|
+
},
|
|
36598
|
+
{
|
|
36599
|
+
"name": "warnPropertyAccesses",
|
|
36600
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
36601
|
+
"ctype": "miscellaneous",
|
|
36602
|
+
"subtype": "function",
|
|
36603
|
+
"coverageIgnore": false,
|
|
36604
|
+
"deprecated": false,
|
|
36605
|
+
"deprecationMessage": "",
|
|
36606
|
+
"rawdescription": "",
|
|
36607
|
+
"description": "",
|
|
36608
|
+
"displayName": "warnPropertyAccesses",
|
|
36609
|
+
"args": [
|
|
36610
|
+
{
|
|
36611
|
+
"name": "path",
|
|
36612
|
+
"type": "string",
|
|
36613
|
+
"deprecated": false,
|
|
36614
|
+
"deprecationMessage": ""
|
|
36615
|
+
},
|
|
36616
|
+
{
|
|
36617
|
+
"name": "source",
|
|
36618
|
+
"type": "string",
|
|
36619
|
+
"deprecated": false,
|
|
36620
|
+
"deprecationMessage": ""
|
|
36621
|
+
},
|
|
36622
|
+
{
|
|
36623
|
+
"name": "context",
|
|
36624
|
+
"type": "SchematicContext",
|
|
36625
|
+
"deprecated": false,
|
|
36626
|
+
"deprecationMessage": ""
|
|
36627
|
+
}
|
|
36628
|
+
],
|
|
36629
|
+
"returnType": "void",
|
|
36630
|
+
"jsdoctags": [
|
|
36631
|
+
{
|
|
36632
|
+
"name": "path",
|
|
36633
|
+
"type": "string",
|
|
36634
|
+
"deprecated": false,
|
|
36635
|
+
"deprecationMessage": "",
|
|
36636
|
+
"tagName": {
|
|
36637
|
+
"text": "param"
|
|
36638
|
+
}
|
|
36639
|
+
},
|
|
36640
|
+
{
|
|
36641
|
+
"name": "source",
|
|
36642
|
+
"type": "string",
|
|
36643
|
+
"deprecated": false,
|
|
36644
|
+
"deprecationMessage": "",
|
|
36645
|
+
"tagName": {
|
|
36646
|
+
"text": "param"
|
|
36647
|
+
}
|
|
36648
|
+
},
|
|
36649
|
+
{
|
|
36650
|
+
"name": "context",
|
|
36651
|
+
"type": "SchematicContext",
|
|
36652
|
+
"deprecated": false,
|
|
36653
|
+
"deprecationMessage": "",
|
|
36654
|
+
"tagName": {
|
|
36655
|
+
"text": "param"
|
|
36656
|
+
}
|
|
36657
|
+
}
|
|
36658
|
+
]
|
|
36659
|
+
},
|
|
36660
|
+
{
|
|
36661
|
+
"name": "warnRemovedProperties",
|
|
36662
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
36663
|
+
"ctype": "miscellaneous",
|
|
36664
|
+
"subtype": "function",
|
|
36665
|
+
"coverageIgnore": false,
|
|
36666
|
+
"deprecated": false,
|
|
36667
|
+
"deprecationMessage": "",
|
|
36668
|
+
"rawdescription": "",
|
|
36669
|
+
"description": "",
|
|
36670
|
+
"displayName": "warnRemovedProperties",
|
|
36671
|
+
"args": [
|
|
36672
|
+
{
|
|
36673
|
+
"name": "sourceFile",
|
|
36674
|
+
"deprecated": false,
|
|
36675
|
+
"deprecationMessage": ""
|
|
36676
|
+
},
|
|
36677
|
+
{
|
|
36678
|
+
"name": "filePath",
|
|
36679
|
+
"type": "string",
|
|
36680
|
+
"deprecated": false,
|
|
36681
|
+
"deprecationMessage": ""
|
|
36682
|
+
},
|
|
36683
|
+
{
|
|
36684
|
+
"name": "context",
|
|
36685
|
+
"type": "SchematicContext",
|
|
36686
|
+
"deprecated": false,
|
|
36687
|
+
"deprecationMessage": ""
|
|
36688
|
+
}
|
|
36689
|
+
],
|
|
36690
|
+
"returnType": "void",
|
|
36691
|
+
"jsdoctags": [
|
|
36692
|
+
{
|
|
36693
|
+
"name": "sourceFile",
|
|
36694
|
+
"deprecated": false,
|
|
36695
|
+
"deprecationMessage": "",
|
|
36696
|
+
"tagName": {
|
|
36697
|
+
"text": "param"
|
|
36698
|
+
}
|
|
36699
|
+
},
|
|
36700
|
+
{
|
|
36701
|
+
"name": "filePath",
|
|
36702
|
+
"type": "string",
|
|
36703
|
+
"deprecated": false,
|
|
36704
|
+
"deprecationMessage": "",
|
|
36705
|
+
"tagName": {
|
|
36706
|
+
"text": "param"
|
|
36707
|
+
}
|
|
36708
|
+
},
|
|
36709
|
+
{
|
|
36710
|
+
"name": "context",
|
|
36711
|
+
"type": "SchematicContext",
|
|
36712
|
+
"deprecated": false,
|
|
36713
|
+
"deprecationMessage": "",
|
|
36714
|
+
"tagName": {
|
|
36715
|
+
"text": "param"
|
|
36716
|
+
}
|
|
36717
|
+
}
|
|
36718
|
+
]
|
|
36719
|
+
},
|
|
36720
|
+
{
|
|
36721
|
+
"name": "warnSetSort",
|
|
36722
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
36723
|
+
"ctype": "miscellaneous",
|
|
36724
|
+
"subtype": "function",
|
|
36725
|
+
"coverageIgnore": false,
|
|
36726
|
+
"deprecated": false,
|
|
36727
|
+
"deprecationMessage": "",
|
|
36728
|
+
"rawdescription": "",
|
|
36729
|
+
"description": "",
|
|
36730
|
+
"displayName": "warnSetSort",
|
|
36731
|
+
"args": [
|
|
36732
|
+
{
|
|
36733
|
+
"name": "source",
|
|
36734
|
+
"type": "string",
|
|
36735
|
+
"deprecated": false,
|
|
36736
|
+
"deprecationMessage": ""
|
|
36737
|
+
},
|
|
36738
|
+
{
|
|
36739
|
+
"name": "filePath",
|
|
36740
|
+
"type": "string",
|
|
36741
|
+
"deprecated": false,
|
|
36742
|
+
"deprecationMessage": ""
|
|
36743
|
+
},
|
|
36744
|
+
{
|
|
36745
|
+
"name": "context",
|
|
36746
|
+
"type": "SchematicContext",
|
|
36747
|
+
"deprecated": false,
|
|
36748
|
+
"deprecationMessage": ""
|
|
36749
|
+
}
|
|
36750
|
+
],
|
|
36751
|
+
"returnType": "void",
|
|
36752
|
+
"jsdoctags": [
|
|
36753
|
+
{
|
|
36754
|
+
"name": "source",
|
|
36755
|
+
"type": "string",
|
|
36756
36756
|
"deprecated": false,
|
|
36757
36757
|
"deprecationMessage": "",
|
|
36758
36758
|
"tagName": {
|
|
@@ -45663,10 +45663,10 @@
|
|
|
45663
45663
|
]
|
|
45664
45664
|
}
|
|
45665
45665
|
],
|
|
45666
|
-
"packages/core/schematics/migrate-eui-
|
|
45666
|
+
"packages/core/schematics/migrate-eui-progress-circle/index.ts": [
|
|
45667
45667
|
{
|
|
45668
45668
|
"name": "applyEdits",
|
|
45669
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
45669
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
45670
45670
|
"ctype": "miscellaneous",
|
|
45671
45671
|
"subtype": "function",
|
|
45672
45672
|
"coverageIgnore": false,
|
|
@@ -45711,7 +45711,7 @@
|
|
|
45711
45711
|
},
|
|
45712
45712
|
{
|
|
45713
45713
|
"name": "collectRenames",
|
|
45714
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
45714
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
45715
45715
|
"ctype": "miscellaneous",
|
|
45716
45716
|
"subtype": "function",
|
|
45717
45717
|
"coverageIgnore": false,
|
|
@@ -45756,7 +45756,7 @@
|
|
|
45756
45756
|
},
|
|
45757
45757
|
{
|
|
45758
45758
|
"name": "isComponentMetadataProperty",
|
|
45759
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
45759
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
45760
45760
|
"ctype": "miscellaneous",
|
|
45761
45761
|
"subtype": "function",
|
|
45762
45762
|
"coverageIgnore": false,
|
|
@@ -45786,7 +45786,7 @@
|
|
|
45786
45786
|
},
|
|
45787
45787
|
{
|
|
45788
45788
|
"name": "isTemplateProperty",
|
|
45789
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
45789
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
45790
45790
|
"ctype": "miscellaneous",
|
|
45791
45791
|
"subtype": "function",
|
|
45792
45792
|
"coverageIgnore": false,
|
|
@@ -45815,8 +45815,8 @@
|
|
|
45815
45815
|
]
|
|
45816
45816
|
},
|
|
45817
45817
|
{
|
|
45818
|
-
"name": "
|
|
45819
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
45818
|
+
"name": "migrateEuiProgressCircle",
|
|
45819
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
45820
45820
|
"ctype": "miscellaneous",
|
|
45821
45821
|
"subtype": "function",
|
|
45822
45822
|
"coverageIgnore": false,
|
|
@@ -45824,7 +45824,7 @@
|
|
|
45824
45824
|
"deprecationMessage": "",
|
|
45825
45825
|
"rawdescription": "",
|
|
45826
45826
|
"description": "",
|
|
45827
|
-
"displayName": "
|
|
45827
|
+
"displayName": "migrateEuiProgressCircle",
|
|
45828
45828
|
"args": [
|
|
45829
45829
|
{
|
|
45830
45830
|
"name": "options",
|
|
@@ -45850,7 +45850,7 @@
|
|
|
45850
45850
|
},
|
|
45851
45851
|
{
|
|
45852
45852
|
"name": "migrateInlineTemplates",
|
|
45853
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
45853
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
45854
45854
|
"ctype": "miscellaneous",
|
|
45855
45855
|
"subtype": "function",
|
|
45856
45856
|
"coverageIgnore": false,
|
|
@@ -45882,7 +45882,7 @@
|
|
|
45882
45882
|
},
|
|
45883
45883
|
{
|
|
45884
45884
|
"name": "migrateTemplate",
|
|
45885
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
45885
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
45886
45886
|
"ctype": "miscellaneous",
|
|
45887
45887
|
"subtype": "function",
|
|
45888
45888
|
"coverageIgnore": false,
|
|
@@ -45912,409 +45912,9 @@
|
|
|
45912
45912
|
}
|
|
45913
45913
|
]
|
|
45914
45914
|
},
|
|
45915
|
-
{
|
|
45916
|
-
"name": "renameTsPropertyAccesses",
|
|
45917
|
-
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
45918
|
-
"ctype": "miscellaneous",
|
|
45919
|
-
"subtype": "function",
|
|
45920
|
-
"coverageIgnore": false,
|
|
45921
|
-
"deprecated": false,
|
|
45922
|
-
"deprecationMessage": "",
|
|
45923
|
-
"rawdescription": "",
|
|
45924
|
-
"description": "",
|
|
45925
|
-
"displayName": "renameTsPropertyAccesses",
|
|
45926
|
-
"args": [
|
|
45927
|
-
{
|
|
45928
|
-
"name": "source",
|
|
45929
|
-
"type": "string",
|
|
45930
|
-
"deprecated": false,
|
|
45931
|
-
"deprecationMessage": ""
|
|
45932
|
-
}
|
|
45933
|
-
],
|
|
45934
|
-
"returnType": "string",
|
|
45935
|
-
"jsdoctags": [
|
|
45936
|
-
{
|
|
45937
|
-
"name": "source",
|
|
45938
|
-
"type": "string",
|
|
45939
|
-
"deprecated": false,
|
|
45940
|
-
"deprecationMessage": "",
|
|
45941
|
-
"tagName": {
|
|
45942
|
-
"text": "param"
|
|
45943
|
-
}
|
|
45944
|
-
}
|
|
45945
|
-
]
|
|
45946
|
-
},
|
|
45947
45915
|
{
|
|
45948
45916
|
"name": "unwrapExpression",
|
|
45949
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
45950
|
-
"ctype": "miscellaneous",
|
|
45951
|
-
"subtype": "function",
|
|
45952
|
-
"coverageIgnore": false,
|
|
45953
|
-
"deprecated": false,
|
|
45954
|
-
"deprecationMessage": "",
|
|
45955
|
-
"rawdescription": "",
|
|
45956
|
-
"description": "",
|
|
45957
|
-
"displayName": "unwrapExpression",
|
|
45958
|
-
"args": [
|
|
45959
|
-
{
|
|
45960
|
-
"name": "expression",
|
|
45961
|
-
"deprecated": false,
|
|
45962
|
-
"deprecationMessage": ""
|
|
45963
|
-
}
|
|
45964
|
-
],
|
|
45965
|
-
"returnType": "ts.Expression",
|
|
45966
|
-
"jsdoctags": [
|
|
45967
|
-
{
|
|
45968
|
-
"name": "expression",
|
|
45969
|
-
"deprecated": false,
|
|
45970
|
-
"deprecationMessage": "",
|
|
45971
|
-
"tagName": {
|
|
45972
|
-
"text": "param"
|
|
45973
|
-
}
|
|
45974
|
-
}
|
|
45975
|
-
]
|
|
45976
|
-
},
|
|
45977
|
-
{
|
|
45978
|
-
"name": "visitDir",
|
|
45979
|
-
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
45980
|
-
"ctype": "miscellaneous",
|
|
45981
|
-
"subtype": "function",
|
|
45982
|
-
"coverageIgnore": false,
|
|
45983
|
-
"deprecated": false,
|
|
45984
|
-
"deprecationMessage": "",
|
|
45985
|
-
"rawdescription": "",
|
|
45986
|
-
"description": "",
|
|
45987
|
-
"displayName": "visitDir",
|
|
45988
|
-
"args": [
|
|
45989
|
-
{
|
|
45990
|
-
"name": "dir",
|
|
45991
|
-
"type": "DirEntry",
|
|
45992
|
-
"deprecated": false,
|
|
45993
|
-
"deprecationMessage": ""
|
|
45994
|
-
},
|
|
45995
|
-
{
|
|
45996
|
-
"name": "callback",
|
|
45997
|
-
"deprecated": false,
|
|
45998
|
-
"deprecationMessage": ""
|
|
45999
|
-
}
|
|
46000
|
-
],
|
|
46001
|
-
"returnType": "void",
|
|
46002
|
-
"jsdoctags": [
|
|
46003
|
-
{
|
|
46004
|
-
"name": "dir",
|
|
46005
|
-
"type": "DirEntry",
|
|
46006
|
-
"deprecated": false,
|
|
46007
|
-
"deprecationMessage": "",
|
|
46008
|
-
"tagName": {
|
|
46009
|
-
"text": "param"
|
|
46010
|
-
}
|
|
46011
|
-
},
|
|
46012
|
-
{
|
|
46013
|
-
"name": "callback",
|
|
46014
|
-
"deprecated": false,
|
|
46015
|
-
"deprecationMessage": "",
|
|
46016
|
-
"tagName": {
|
|
46017
|
-
"text": "param"
|
|
46018
|
-
}
|
|
46019
|
-
}
|
|
46020
|
-
]
|
|
46021
|
-
},
|
|
46022
|
-
{
|
|
46023
|
-
"name": "visitNodes",
|
|
46024
|
-
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
46025
|
-
"ctype": "miscellaneous",
|
|
46026
|
-
"subtype": "function",
|
|
46027
|
-
"coverageIgnore": false,
|
|
46028
|
-
"deprecated": false,
|
|
46029
|
-
"deprecationMessage": "",
|
|
46030
|
-
"rawdescription": "",
|
|
46031
|
-
"description": "",
|
|
46032
|
-
"displayName": "visitNodes",
|
|
46033
|
-
"args": [
|
|
46034
|
-
{
|
|
46035
|
-
"name": "nodes",
|
|
46036
|
-
"deprecated": false,
|
|
46037
|
-
"deprecationMessage": ""
|
|
46038
|
-
},
|
|
46039
|
-
{
|
|
46040
|
-
"name": "edits",
|
|
46041
|
-
"deprecated": false,
|
|
46042
|
-
"deprecationMessage": ""
|
|
46043
|
-
}
|
|
46044
|
-
],
|
|
46045
|
-
"returnType": "void",
|
|
46046
|
-
"jsdoctags": [
|
|
46047
|
-
{
|
|
46048
|
-
"name": "nodes",
|
|
46049
|
-
"deprecated": false,
|
|
46050
|
-
"deprecationMessage": "",
|
|
46051
|
-
"tagName": {
|
|
46052
|
-
"text": "param"
|
|
46053
|
-
}
|
|
46054
|
-
},
|
|
46055
|
-
{
|
|
46056
|
-
"name": "edits",
|
|
46057
|
-
"deprecated": false,
|
|
46058
|
-
"deprecationMessage": "",
|
|
46059
|
-
"tagName": {
|
|
46060
|
-
"text": "param"
|
|
46061
|
-
}
|
|
46062
|
-
}
|
|
46063
|
-
]
|
|
46064
|
-
}
|
|
46065
|
-
],
|
|
46066
|
-
"packages/core/schematics/migrate-eui-progress-circle/index.ts": [
|
|
46067
|
-
{
|
|
46068
|
-
"name": "applyEdits",
|
|
46069
|
-
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
46070
|
-
"ctype": "miscellaneous",
|
|
46071
|
-
"subtype": "function",
|
|
46072
|
-
"coverageIgnore": false,
|
|
46073
|
-
"deprecated": false,
|
|
46074
|
-
"deprecationMessage": "",
|
|
46075
|
-
"rawdescription": "",
|
|
46076
|
-
"description": "",
|
|
46077
|
-
"displayName": "applyEdits",
|
|
46078
|
-
"args": [
|
|
46079
|
-
{
|
|
46080
|
-
"name": "source",
|
|
46081
|
-
"type": "string",
|
|
46082
|
-
"deprecated": false,
|
|
46083
|
-
"deprecationMessage": ""
|
|
46084
|
-
},
|
|
46085
|
-
{
|
|
46086
|
-
"name": "edits",
|
|
46087
|
-
"deprecated": false,
|
|
46088
|
-
"deprecationMessage": ""
|
|
46089
|
-
}
|
|
46090
|
-
],
|
|
46091
|
-
"returnType": "string",
|
|
46092
|
-
"jsdoctags": [
|
|
46093
|
-
{
|
|
46094
|
-
"name": "source",
|
|
46095
|
-
"type": "string",
|
|
46096
|
-
"deprecated": false,
|
|
46097
|
-
"deprecationMessage": "",
|
|
46098
|
-
"tagName": {
|
|
46099
|
-
"text": "param"
|
|
46100
|
-
}
|
|
46101
|
-
},
|
|
46102
|
-
{
|
|
46103
|
-
"name": "edits",
|
|
46104
|
-
"deprecated": false,
|
|
46105
|
-
"deprecationMessage": "",
|
|
46106
|
-
"tagName": {
|
|
46107
|
-
"text": "param"
|
|
46108
|
-
}
|
|
46109
|
-
}
|
|
46110
|
-
]
|
|
46111
|
-
},
|
|
46112
|
-
{
|
|
46113
|
-
"name": "collectRenames",
|
|
46114
|
-
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
46115
|
-
"ctype": "miscellaneous",
|
|
46116
|
-
"subtype": "function",
|
|
46117
|
-
"coverageIgnore": false,
|
|
46118
|
-
"deprecated": false,
|
|
46119
|
-
"deprecationMessage": "",
|
|
46120
|
-
"rawdescription": "",
|
|
46121
|
-
"description": "",
|
|
46122
|
-
"displayName": "collectRenames",
|
|
46123
|
-
"args": [
|
|
46124
|
-
{
|
|
46125
|
-
"name": "element",
|
|
46126
|
-
"type": "TmplAstElement",
|
|
46127
|
-
"deprecated": false,
|
|
46128
|
-
"deprecationMessage": ""
|
|
46129
|
-
},
|
|
46130
|
-
{
|
|
46131
|
-
"name": "edits",
|
|
46132
|
-
"deprecated": false,
|
|
46133
|
-
"deprecationMessage": ""
|
|
46134
|
-
}
|
|
46135
|
-
],
|
|
46136
|
-
"returnType": "void",
|
|
46137
|
-
"jsdoctags": [
|
|
46138
|
-
{
|
|
46139
|
-
"name": "element",
|
|
46140
|
-
"type": "TmplAstElement",
|
|
46141
|
-
"deprecated": false,
|
|
46142
|
-
"deprecationMessage": "",
|
|
46143
|
-
"tagName": {
|
|
46144
|
-
"text": "param"
|
|
46145
|
-
}
|
|
46146
|
-
},
|
|
46147
|
-
{
|
|
46148
|
-
"name": "edits",
|
|
46149
|
-
"deprecated": false,
|
|
46150
|
-
"deprecationMessage": "",
|
|
46151
|
-
"tagName": {
|
|
46152
|
-
"text": "param"
|
|
46153
|
-
}
|
|
46154
|
-
}
|
|
46155
|
-
]
|
|
46156
|
-
},
|
|
46157
|
-
{
|
|
46158
|
-
"name": "isComponentMetadataProperty",
|
|
46159
|
-
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
46160
|
-
"ctype": "miscellaneous",
|
|
46161
|
-
"subtype": "function",
|
|
46162
|
-
"coverageIgnore": false,
|
|
46163
|
-
"deprecated": false,
|
|
46164
|
-
"deprecationMessage": "",
|
|
46165
|
-
"rawdescription": "",
|
|
46166
|
-
"description": "",
|
|
46167
|
-
"displayName": "isComponentMetadataProperty",
|
|
46168
|
-
"args": [
|
|
46169
|
-
{
|
|
46170
|
-
"name": "node",
|
|
46171
|
-
"deprecated": false,
|
|
46172
|
-
"deprecationMessage": ""
|
|
46173
|
-
}
|
|
46174
|
-
],
|
|
46175
|
-
"returnType": "boolean",
|
|
46176
|
-
"jsdoctags": [
|
|
46177
|
-
{
|
|
46178
|
-
"name": "node",
|
|
46179
|
-
"deprecated": false,
|
|
46180
|
-
"deprecationMessage": "",
|
|
46181
|
-
"tagName": {
|
|
46182
|
-
"text": "param"
|
|
46183
|
-
}
|
|
46184
|
-
}
|
|
46185
|
-
]
|
|
46186
|
-
},
|
|
46187
|
-
{
|
|
46188
|
-
"name": "isTemplateProperty",
|
|
46189
|
-
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
46190
|
-
"ctype": "miscellaneous",
|
|
46191
|
-
"subtype": "function",
|
|
46192
|
-
"coverageIgnore": false,
|
|
46193
|
-
"deprecated": false,
|
|
46194
|
-
"deprecationMessage": "",
|
|
46195
|
-
"rawdescription": "",
|
|
46196
|
-
"description": "",
|
|
46197
|
-
"displayName": "isTemplateProperty",
|
|
46198
|
-
"args": [
|
|
46199
|
-
{
|
|
46200
|
-
"name": "node",
|
|
46201
|
-
"deprecated": false,
|
|
46202
|
-
"deprecationMessage": ""
|
|
46203
|
-
}
|
|
46204
|
-
],
|
|
46205
|
-
"returnType": "boolean",
|
|
46206
|
-
"jsdoctags": [
|
|
46207
|
-
{
|
|
46208
|
-
"name": "node",
|
|
46209
|
-
"deprecated": false,
|
|
46210
|
-
"deprecationMessage": "",
|
|
46211
|
-
"tagName": {
|
|
46212
|
-
"text": "param"
|
|
46213
|
-
}
|
|
46214
|
-
}
|
|
46215
|
-
]
|
|
46216
|
-
},
|
|
46217
|
-
{
|
|
46218
|
-
"name": "migrateEuiProgressCircle",
|
|
46219
|
-
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
46220
|
-
"ctype": "miscellaneous",
|
|
46221
|
-
"subtype": "function",
|
|
46222
|
-
"coverageIgnore": false,
|
|
46223
|
-
"deprecated": false,
|
|
46224
|
-
"deprecationMessage": "",
|
|
46225
|
-
"rawdescription": "",
|
|
46226
|
-
"description": "",
|
|
46227
|
-
"displayName": "migrateEuiProgressCircle",
|
|
46228
|
-
"args": [
|
|
46229
|
-
{
|
|
46230
|
-
"name": "options",
|
|
46231
|
-
"type": "Schema",
|
|
46232
|
-
"deprecated": false,
|
|
46233
|
-
"deprecationMessage": "",
|
|
46234
|
-
"defaultValue": "{}"
|
|
46235
|
-
}
|
|
46236
|
-
],
|
|
46237
|
-
"returnType": "Rule",
|
|
46238
|
-
"jsdoctags": [
|
|
46239
|
-
{
|
|
46240
|
-
"name": "options",
|
|
46241
|
-
"type": "Schema",
|
|
46242
|
-
"deprecated": false,
|
|
46243
|
-
"deprecationMessage": "",
|
|
46244
|
-
"defaultValue": "{}",
|
|
46245
|
-
"tagName": {
|
|
46246
|
-
"text": "param"
|
|
46247
|
-
}
|
|
46248
|
-
}
|
|
46249
|
-
]
|
|
46250
|
-
},
|
|
46251
|
-
{
|
|
46252
|
-
"name": "migrateInlineTemplates",
|
|
46253
|
-
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
46254
|
-
"ctype": "miscellaneous",
|
|
46255
|
-
"subtype": "function",
|
|
46256
|
-
"coverageIgnore": false,
|
|
46257
|
-
"deprecated": false,
|
|
46258
|
-
"deprecationMessage": "",
|
|
46259
|
-
"rawdescription": "",
|
|
46260
|
-
"description": "",
|
|
46261
|
-
"displayName": "migrateInlineTemplates",
|
|
46262
|
-
"args": [
|
|
46263
|
-
{
|
|
46264
|
-
"name": "source",
|
|
46265
|
-
"type": "string",
|
|
46266
|
-
"deprecated": false,
|
|
46267
|
-
"deprecationMessage": ""
|
|
46268
|
-
}
|
|
46269
|
-
],
|
|
46270
|
-
"returnType": "string",
|
|
46271
|
-
"jsdoctags": [
|
|
46272
|
-
{
|
|
46273
|
-
"name": "source",
|
|
46274
|
-
"type": "string",
|
|
46275
|
-
"deprecated": false,
|
|
46276
|
-
"deprecationMessage": "",
|
|
46277
|
-
"tagName": {
|
|
46278
|
-
"text": "param"
|
|
46279
|
-
}
|
|
46280
|
-
}
|
|
46281
|
-
]
|
|
46282
|
-
},
|
|
46283
|
-
{
|
|
46284
|
-
"name": "migrateTemplate",
|
|
46285
|
-
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
46286
|
-
"ctype": "miscellaneous",
|
|
46287
|
-
"subtype": "function",
|
|
46288
|
-
"coverageIgnore": false,
|
|
46289
|
-
"deprecated": false,
|
|
46290
|
-
"deprecationMessage": "",
|
|
46291
|
-
"rawdescription": "",
|
|
46292
|
-
"description": "",
|
|
46293
|
-
"displayName": "migrateTemplate",
|
|
46294
|
-
"args": [
|
|
46295
|
-
{
|
|
46296
|
-
"name": "source",
|
|
46297
|
-
"type": "string",
|
|
46298
|
-
"deprecated": false,
|
|
46299
|
-
"deprecationMessage": ""
|
|
46300
|
-
}
|
|
46301
|
-
],
|
|
46302
|
-
"returnType": "string",
|
|
46303
|
-
"jsdoctags": [
|
|
46304
|
-
{
|
|
46305
|
-
"name": "source",
|
|
46306
|
-
"type": "string",
|
|
46307
|
-
"deprecated": false,
|
|
46308
|
-
"deprecationMessage": "",
|
|
46309
|
-
"tagName": {
|
|
46310
|
-
"text": "param"
|
|
46311
|
-
}
|
|
46312
|
-
}
|
|
46313
|
-
]
|
|
46314
|
-
},
|
|
46315
|
-
{
|
|
46316
|
-
"name": "unwrapExpression",
|
|
46317
|
-
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
45917
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
46318
45918
|
"ctype": "miscellaneous",
|
|
46319
45919
|
"subtype": "function",
|
|
46320
45920
|
"coverageIgnore": false,
|
|
@@ -47609,6 +47209,406 @@
|
|
|
47609
47209
|
]
|
|
47610
47210
|
}
|
|
47611
47211
|
],
|
|
47212
|
+
"packages/core/schematics/migrate-eui-icon-toggle/index.ts": [
|
|
47213
|
+
{
|
|
47214
|
+
"name": "applyEdits",
|
|
47215
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47216
|
+
"ctype": "miscellaneous",
|
|
47217
|
+
"subtype": "function",
|
|
47218
|
+
"coverageIgnore": false,
|
|
47219
|
+
"deprecated": false,
|
|
47220
|
+
"deprecationMessage": "",
|
|
47221
|
+
"rawdescription": "",
|
|
47222
|
+
"description": "",
|
|
47223
|
+
"displayName": "applyEdits",
|
|
47224
|
+
"args": [
|
|
47225
|
+
{
|
|
47226
|
+
"name": "source",
|
|
47227
|
+
"type": "string",
|
|
47228
|
+
"deprecated": false,
|
|
47229
|
+
"deprecationMessage": ""
|
|
47230
|
+
},
|
|
47231
|
+
{
|
|
47232
|
+
"name": "edits",
|
|
47233
|
+
"deprecated": false,
|
|
47234
|
+
"deprecationMessage": ""
|
|
47235
|
+
}
|
|
47236
|
+
],
|
|
47237
|
+
"returnType": "string",
|
|
47238
|
+
"jsdoctags": [
|
|
47239
|
+
{
|
|
47240
|
+
"name": "source",
|
|
47241
|
+
"type": "string",
|
|
47242
|
+
"deprecated": false,
|
|
47243
|
+
"deprecationMessage": "",
|
|
47244
|
+
"tagName": {
|
|
47245
|
+
"text": "param"
|
|
47246
|
+
}
|
|
47247
|
+
},
|
|
47248
|
+
{
|
|
47249
|
+
"name": "edits",
|
|
47250
|
+
"deprecated": false,
|
|
47251
|
+
"deprecationMessage": "",
|
|
47252
|
+
"tagName": {
|
|
47253
|
+
"text": "param"
|
|
47254
|
+
}
|
|
47255
|
+
}
|
|
47256
|
+
]
|
|
47257
|
+
},
|
|
47258
|
+
{
|
|
47259
|
+
"name": "collectRenames",
|
|
47260
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47261
|
+
"ctype": "miscellaneous",
|
|
47262
|
+
"subtype": "function",
|
|
47263
|
+
"coverageIgnore": false,
|
|
47264
|
+
"deprecated": false,
|
|
47265
|
+
"deprecationMessage": "",
|
|
47266
|
+
"rawdescription": "",
|
|
47267
|
+
"description": "",
|
|
47268
|
+
"displayName": "collectRenames",
|
|
47269
|
+
"args": [
|
|
47270
|
+
{
|
|
47271
|
+
"name": "element",
|
|
47272
|
+
"type": "TmplAstElement",
|
|
47273
|
+
"deprecated": false,
|
|
47274
|
+
"deprecationMessage": ""
|
|
47275
|
+
},
|
|
47276
|
+
{
|
|
47277
|
+
"name": "edits",
|
|
47278
|
+
"deprecated": false,
|
|
47279
|
+
"deprecationMessage": ""
|
|
47280
|
+
}
|
|
47281
|
+
],
|
|
47282
|
+
"returnType": "void",
|
|
47283
|
+
"jsdoctags": [
|
|
47284
|
+
{
|
|
47285
|
+
"name": "element",
|
|
47286
|
+
"type": "TmplAstElement",
|
|
47287
|
+
"deprecated": false,
|
|
47288
|
+
"deprecationMessage": "",
|
|
47289
|
+
"tagName": {
|
|
47290
|
+
"text": "param"
|
|
47291
|
+
}
|
|
47292
|
+
},
|
|
47293
|
+
{
|
|
47294
|
+
"name": "edits",
|
|
47295
|
+
"deprecated": false,
|
|
47296
|
+
"deprecationMessage": "",
|
|
47297
|
+
"tagName": {
|
|
47298
|
+
"text": "param"
|
|
47299
|
+
}
|
|
47300
|
+
}
|
|
47301
|
+
]
|
|
47302
|
+
},
|
|
47303
|
+
{
|
|
47304
|
+
"name": "isComponentMetadataProperty",
|
|
47305
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47306
|
+
"ctype": "miscellaneous",
|
|
47307
|
+
"subtype": "function",
|
|
47308
|
+
"coverageIgnore": false,
|
|
47309
|
+
"deprecated": false,
|
|
47310
|
+
"deprecationMessage": "",
|
|
47311
|
+
"rawdescription": "",
|
|
47312
|
+
"description": "",
|
|
47313
|
+
"displayName": "isComponentMetadataProperty",
|
|
47314
|
+
"args": [
|
|
47315
|
+
{
|
|
47316
|
+
"name": "node",
|
|
47317
|
+
"deprecated": false,
|
|
47318
|
+
"deprecationMessage": ""
|
|
47319
|
+
}
|
|
47320
|
+
],
|
|
47321
|
+
"returnType": "boolean",
|
|
47322
|
+
"jsdoctags": [
|
|
47323
|
+
{
|
|
47324
|
+
"name": "node",
|
|
47325
|
+
"deprecated": false,
|
|
47326
|
+
"deprecationMessage": "",
|
|
47327
|
+
"tagName": {
|
|
47328
|
+
"text": "param"
|
|
47329
|
+
}
|
|
47330
|
+
}
|
|
47331
|
+
]
|
|
47332
|
+
},
|
|
47333
|
+
{
|
|
47334
|
+
"name": "isTemplateProperty",
|
|
47335
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47336
|
+
"ctype": "miscellaneous",
|
|
47337
|
+
"subtype": "function",
|
|
47338
|
+
"coverageIgnore": false,
|
|
47339
|
+
"deprecated": false,
|
|
47340
|
+
"deprecationMessage": "",
|
|
47341
|
+
"rawdescription": "",
|
|
47342
|
+
"description": "",
|
|
47343
|
+
"displayName": "isTemplateProperty",
|
|
47344
|
+
"args": [
|
|
47345
|
+
{
|
|
47346
|
+
"name": "node",
|
|
47347
|
+
"deprecated": false,
|
|
47348
|
+
"deprecationMessage": ""
|
|
47349
|
+
}
|
|
47350
|
+
],
|
|
47351
|
+
"returnType": "boolean",
|
|
47352
|
+
"jsdoctags": [
|
|
47353
|
+
{
|
|
47354
|
+
"name": "node",
|
|
47355
|
+
"deprecated": false,
|
|
47356
|
+
"deprecationMessage": "",
|
|
47357
|
+
"tagName": {
|
|
47358
|
+
"text": "param"
|
|
47359
|
+
}
|
|
47360
|
+
}
|
|
47361
|
+
]
|
|
47362
|
+
},
|
|
47363
|
+
{
|
|
47364
|
+
"name": "migrateEuiIconToggle",
|
|
47365
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47366
|
+
"ctype": "miscellaneous",
|
|
47367
|
+
"subtype": "function",
|
|
47368
|
+
"coverageIgnore": false,
|
|
47369
|
+
"deprecated": false,
|
|
47370
|
+
"deprecationMessage": "",
|
|
47371
|
+
"rawdescription": "",
|
|
47372
|
+
"description": "",
|
|
47373
|
+
"displayName": "migrateEuiIconToggle",
|
|
47374
|
+
"args": [
|
|
47375
|
+
{
|
|
47376
|
+
"name": "options",
|
|
47377
|
+
"type": "Schema",
|
|
47378
|
+
"deprecated": false,
|
|
47379
|
+
"deprecationMessage": "",
|
|
47380
|
+
"defaultValue": "{}"
|
|
47381
|
+
}
|
|
47382
|
+
],
|
|
47383
|
+
"returnType": "Rule",
|
|
47384
|
+
"jsdoctags": [
|
|
47385
|
+
{
|
|
47386
|
+
"name": "options",
|
|
47387
|
+
"type": "Schema",
|
|
47388
|
+
"deprecated": false,
|
|
47389
|
+
"deprecationMessage": "",
|
|
47390
|
+
"defaultValue": "{}",
|
|
47391
|
+
"tagName": {
|
|
47392
|
+
"text": "param"
|
|
47393
|
+
}
|
|
47394
|
+
}
|
|
47395
|
+
]
|
|
47396
|
+
},
|
|
47397
|
+
{
|
|
47398
|
+
"name": "migrateInlineTemplates",
|
|
47399
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47400
|
+
"ctype": "miscellaneous",
|
|
47401
|
+
"subtype": "function",
|
|
47402
|
+
"coverageIgnore": false,
|
|
47403
|
+
"deprecated": false,
|
|
47404
|
+
"deprecationMessage": "",
|
|
47405
|
+
"rawdescription": "",
|
|
47406
|
+
"description": "",
|
|
47407
|
+
"displayName": "migrateInlineTemplates",
|
|
47408
|
+
"args": [
|
|
47409
|
+
{
|
|
47410
|
+
"name": "source",
|
|
47411
|
+
"type": "string",
|
|
47412
|
+
"deprecated": false,
|
|
47413
|
+
"deprecationMessage": ""
|
|
47414
|
+
}
|
|
47415
|
+
],
|
|
47416
|
+
"returnType": "string",
|
|
47417
|
+
"jsdoctags": [
|
|
47418
|
+
{
|
|
47419
|
+
"name": "source",
|
|
47420
|
+
"type": "string",
|
|
47421
|
+
"deprecated": false,
|
|
47422
|
+
"deprecationMessage": "",
|
|
47423
|
+
"tagName": {
|
|
47424
|
+
"text": "param"
|
|
47425
|
+
}
|
|
47426
|
+
}
|
|
47427
|
+
]
|
|
47428
|
+
},
|
|
47429
|
+
{
|
|
47430
|
+
"name": "migrateTemplate",
|
|
47431
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47432
|
+
"ctype": "miscellaneous",
|
|
47433
|
+
"subtype": "function",
|
|
47434
|
+
"coverageIgnore": false,
|
|
47435
|
+
"deprecated": false,
|
|
47436
|
+
"deprecationMessage": "",
|
|
47437
|
+
"rawdescription": "",
|
|
47438
|
+
"description": "",
|
|
47439
|
+
"displayName": "migrateTemplate",
|
|
47440
|
+
"args": [
|
|
47441
|
+
{
|
|
47442
|
+
"name": "source",
|
|
47443
|
+
"type": "string",
|
|
47444
|
+
"deprecated": false,
|
|
47445
|
+
"deprecationMessage": ""
|
|
47446
|
+
}
|
|
47447
|
+
],
|
|
47448
|
+
"returnType": "string",
|
|
47449
|
+
"jsdoctags": [
|
|
47450
|
+
{
|
|
47451
|
+
"name": "source",
|
|
47452
|
+
"type": "string",
|
|
47453
|
+
"deprecated": false,
|
|
47454
|
+
"deprecationMessage": "",
|
|
47455
|
+
"tagName": {
|
|
47456
|
+
"text": "param"
|
|
47457
|
+
}
|
|
47458
|
+
}
|
|
47459
|
+
]
|
|
47460
|
+
},
|
|
47461
|
+
{
|
|
47462
|
+
"name": "renameTsPropertyAccesses",
|
|
47463
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47464
|
+
"ctype": "miscellaneous",
|
|
47465
|
+
"subtype": "function",
|
|
47466
|
+
"coverageIgnore": false,
|
|
47467
|
+
"deprecated": false,
|
|
47468
|
+
"deprecationMessage": "",
|
|
47469
|
+
"rawdescription": "",
|
|
47470
|
+
"description": "",
|
|
47471
|
+
"displayName": "renameTsPropertyAccesses",
|
|
47472
|
+
"args": [
|
|
47473
|
+
{
|
|
47474
|
+
"name": "source",
|
|
47475
|
+
"type": "string",
|
|
47476
|
+
"deprecated": false,
|
|
47477
|
+
"deprecationMessage": ""
|
|
47478
|
+
}
|
|
47479
|
+
],
|
|
47480
|
+
"returnType": "string",
|
|
47481
|
+
"jsdoctags": [
|
|
47482
|
+
{
|
|
47483
|
+
"name": "source",
|
|
47484
|
+
"type": "string",
|
|
47485
|
+
"deprecated": false,
|
|
47486
|
+
"deprecationMessage": "",
|
|
47487
|
+
"tagName": {
|
|
47488
|
+
"text": "param"
|
|
47489
|
+
}
|
|
47490
|
+
}
|
|
47491
|
+
]
|
|
47492
|
+
},
|
|
47493
|
+
{
|
|
47494
|
+
"name": "unwrapExpression",
|
|
47495
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47496
|
+
"ctype": "miscellaneous",
|
|
47497
|
+
"subtype": "function",
|
|
47498
|
+
"coverageIgnore": false,
|
|
47499
|
+
"deprecated": false,
|
|
47500
|
+
"deprecationMessage": "",
|
|
47501
|
+
"rawdescription": "",
|
|
47502
|
+
"description": "",
|
|
47503
|
+
"displayName": "unwrapExpression",
|
|
47504
|
+
"args": [
|
|
47505
|
+
{
|
|
47506
|
+
"name": "expression",
|
|
47507
|
+
"deprecated": false,
|
|
47508
|
+
"deprecationMessage": ""
|
|
47509
|
+
}
|
|
47510
|
+
],
|
|
47511
|
+
"returnType": "ts.Expression",
|
|
47512
|
+
"jsdoctags": [
|
|
47513
|
+
{
|
|
47514
|
+
"name": "expression",
|
|
47515
|
+
"deprecated": false,
|
|
47516
|
+
"deprecationMessage": "",
|
|
47517
|
+
"tagName": {
|
|
47518
|
+
"text": "param"
|
|
47519
|
+
}
|
|
47520
|
+
}
|
|
47521
|
+
]
|
|
47522
|
+
},
|
|
47523
|
+
{
|
|
47524
|
+
"name": "visitDir",
|
|
47525
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47526
|
+
"ctype": "miscellaneous",
|
|
47527
|
+
"subtype": "function",
|
|
47528
|
+
"coverageIgnore": false,
|
|
47529
|
+
"deprecated": false,
|
|
47530
|
+
"deprecationMessage": "",
|
|
47531
|
+
"rawdescription": "",
|
|
47532
|
+
"description": "",
|
|
47533
|
+
"displayName": "visitDir",
|
|
47534
|
+
"args": [
|
|
47535
|
+
{
|
|
47536
|
+
"name": "dir",
|
|
47537
|
+
"type": "DirEntry",
|
|
47538
|
+
"deprecated": false,
|
|
47539
|
+
"deprecationMessage": ""
|
|
47540
|
+
},
|
|
47541
|
+
{
|
|
47542
|
+
"name": "callback",
|
|
47543
|
+
"deprecated": false,
|
|
47544
|
+
"deprecationMessage": ""
|
|
47545
|
+
}
|
|
47546
|
+
],
|
|
47547
|
+
"returnType": "void",
|
|
47548
|
+
"jsdoctags": [
|
|
47549
|
+
{
|
|
47550
|
+
"name": "dir",
|
|
47551
|
+
"type": "DirEntry",
|
|
47552
|
+
"deprecated": false,
|
|
47553
|
+
"deprecationMessage": "",
|
|
47554
|
+
"tagName": {
|
|
47555
|
+
"text": "param"
|
|
47556
|
+
}
|
|
47557
|
+
},
|
|
47558
|
+
{
|
|
47559
|
+
"name": "callback",
|
|
47560
|
+
"deprecated": false,
|
|
47561
|
+
"deprecationMessage": "",
|
|
47562
|
+
"tagName": {
|
|
47563
|
+
"text": "param"
|
|
47564
|
+
}
|
|
47565
|
+
}
|
|
47566
|
+
]
|
|
47567
|
+
},
|
|
47568
|
+
{
|
|
47569
|
+
"name": "visitNodes",
|
|
47570
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
47571
|
+
"ctype": "miscellaneous",
|
|
47572
|
+
"subtype": "function",
|
|
47573
|
+
"coverageIgnore": false,
|
|
47574
|
+
"deprecated": false,
|
|
47575
|
+
"deprecationMessage": "",
|
|
47576
|
+
"rawdescription": "",
|
|
47577
|
+
"description": "",
|
|
47578
|
+
"displayName": "visitNodes",
|
|
47579
|
+
"args": [
|
|
47580
|
+
{
|
|
47581
|
+
"name": "nodes",
|
|
47582
|
+
"deprecated": false,
|
|
47583
|
+
"deprecationMessage": ""
|
|
47584
|
+
},
|
|
47585
|
+
{
|
|
47586
|
+
"name": "edits",
|
|
47587
|
+
"deprecated": false,
|
|
47588
|
+
"deprecationMessage": ""
|
|
47589
|
+
}
|
|
47590
|
+
],
|
|
47591
|
+
"returnType": "void",
|
|
47592
|
+
"jsdoctags": [
|
|
47593
|
+
{
|
|
47594
|
+
"name": "nodes",
|
|
47595
|
+
"deprecated": false,
|
|
47596
|
+
"deprecationMessage": "",
|
|
47597
|
+
"tagName": {
|
|
47598
|
+
"text": "param"
|
|
47599
|
+
}
|
|
47600
|
+
},
|
|
47601
|
+
{
|
|
47602
|
+
"name": "edits",
|
|
47603
|
+
"deprecated": false,
|
|
47604
|
+
"deprecationMessage": "",
|
|
47605
|
+
"tagName": {
|
|
47606
|
+
"text": "param"
|
|
47607
|
+
}
|
|
47608
|
+
}
|
|
47609
|
+
]
|
|
47610
|
+
}
|
|
47611
|
+
],
|
|
47612
47612
|
"packages/core/schematics/migrate-to-standalone/index.ts": [
|
|
47613
47613
|
{
|
|
47614
47614
|
"name": "applyReplacements",
|