@eui/core 23.0.0-alpha.4 → 23.0.0-alpha.6
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 +71 -0
- package/docs/changelog.html +95 -0
- package/docs/interfaces/Edit-3.html +395 -0
- 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-19.html +1 -1
- package/docs/interfaces/Schema-20.html +1 -1
- package/docs/interfaces/Schema-21.html +368 -0
- 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/js/menu-wc.js +6 -0
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/documentation.json +1050 -266
- package/docs/llms.txt +75 -40
- package/docs/miscellaneous/functions.html +632 -116
- package/docs/miscellaneous/variables.html +94 -33
- package/docs/overview.html +1 -1
- package/docs/properties.html +1 -1
- package/package.json +2 -2
- package/schematics/collection.json +5 -0
- package/schematics/migrate-all/index.js +1 -0
- package/schematics/migrate-all/index.js.map +1 -1
- package/schematics/migrate-eui-tooltip/index.d.ts +7 -0
- package/schematics/migrate-eui-tooltip/index.js +263 -0
- package/schematics/migrate-eui-tooltip/index.js.map +1 -0
|
@@ -966,6 +966,65 @@
|
|
|
966
966
|
"outgoing": []
|
|
967
967
|
}
|
|
968
968
|
},
|
|
969
|
+
{
|
|
970
|
+
"name": "Edit",
|
|
971
|
+
"id": "interface-Edit-d36032102ed30a7ada1e3d36bb9ca41b7234b855760cac9783a25818f7ffe2097e1ebd8e808b574ddec0760f827272f6cd561f45f3eb1578f87f39ee2633730a-3",
|
|
972
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
973
|
+
"deprecated": false,
|
|
974
|
+
"deprecationMessage": "",
|
|
975
|
+
"type": "interface",
|
|
976
|
+
"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",
|
|
977
|
+
"displayName": "Edit",
|
|
978
|
+
"properties": [
|
|
979
|
+
{
|
|
980
|
+
"name": "end",
|
|
981
|
+
"coverageIgnore": false,
|
|
982
|
+
"deprecated": false,
|
|
983
|
+
"deprecationMessage": "",
|
|
984
|
+
"type": "number",
|
|
985
|
+
"indexKey": "",
|
|
986
|
+
"optional": false,
|
|
987
|
+
"description": "",
|
|
988
|
+
"line": 12,
|
|
989
|
+
"rawdescription": "\n"
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"name": "replacement",
|
|
993
|
+
"coverageIgnore": false,
|
|
994
|
+
"deprecated": false,
|
|
995
|
+
"deprecationMessage": "",
|
|
996
|
+
"type": "string",
|
|
997
|
+
"indexKey": "",
|
|
998
|
+
"optional": false,
|
|
999
|
+
"description": "",
|
|
1000
|
+
"line": 13,
|
|
1001
|
+
"rawdescription": "\n"
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"name": "start",
|
|
1005
|
+
"coverageIgnore": false,
|
|
1006
|
+
"deprecated": false,
|
|
1007
|
+
"deprecationMessage": "",
|
|
1008
|
+
"type": "number",
|
|
1009
|
+
"indexKey": "",
|
|
1010
|
+
"optional": false,
|
|
1011
|
+
"description": "",
|
|
1012
|
+
"line": 11,
|
|
1013
|
+
"rawdescription": "\n"
|
|
1014
|
+
}
|
|
1015
|
+
],
|
|
1016
|
+
"indexSignatures": [],
|
|
1017
|
+
"kind": 172,
|
|
1018
|
+
"methods": [],
|
|
1019
|
+
"extends": [],
|
|
1020
|
+
"isDuplicate": true,
|
|
1021
|
+
"duplicateId": 3,
|
|
1022
|
+
"duplicateName": "Edit-3",
|
|
1023
|
+
"relationships": {
|
|
1024
|
+
"incoming": [],
|
|
1025
|
+
"outgoing": []
|
|
1026
|
+
}
|
|
1027
|
+
},
|
|
969
1028
|
{
|
|
970
1029
|
"name": "EuiComponentEntry",
|
|
971
1030
|
"id": "interface-EuiComponentEntry-e1068f4f156ce8f48ed51476e062ee969ff7e7d064af3045181da54f7aba582003387dd6cf5412d907b9637791a85232c11b467fbdfa8c5545d9e7c3e181e873",
|
|
@@ -1583,12 +1642,12 @@
|
|
|
1583
1642
|
},
|
|
1584
1643
|
{
|
|
1585
1644
|
"name": "MigrateAllSchema",
|
|
1586
|
-
"id": "interface-MigrateAllSchema-
|
|
1645
|
+
"id": "interface-MigrateAllSchema-37175caf2db4e728d285d5a8d2261bef3f77ac6b132960846be25241de1387993b11f30e57a3c71bb7a5a5b2b8ebcae465c22562e7b570e634ab547299274e59",
|
|
1587
1646
|
"file": "packages/core/schematics/migrate-all/index.ts",
|
|
1588
1647
|
"deprecated": false,
|
|
1589
1648
|
"deprecationMessage": "",
|
|
1590
1649
|
"type": "interface",
|
|
1591
|
-
"sourceCode": "import { Rule, chain, schematic } from '@angular-devkit/schematics';\n\nexport interface MigrateAllSchema {\n path?: string;\n dryRun?: boolean;\n mwp?: boolean;\n useClassArray?: boolean;\n}\n\nexport function migrateAll(options: MigrateAllSchema): Rule {\n const base = { path: options.path || './src', dryRun: options.dryRun || false };\n\n return chain([\n schematic('migrate', { ...base, mwp: options.mwp || false }),\n schematic('migrate-eui-tabs', base),\n schematic('migrate-to-standalone', base),\n schematic('migrate-eui-alert', base),\n schematic('migrate-eui-progress-circle', base),\n schematic('migrate-eui-popover', base),\n schematic('migrate-eui-icon-toggle', base),\n schematic('migrate-eui-icon-svg', base),\n schematic('migrate-eui-fieldset', base),\n schematic('migrate-eui-avatar', base),\n schematic('migrate-eui-editor', base),\n schematic('migrate-eui-discussion-thread', base),\n schematic('migrate-eui-button', base),\n schematic('migrate-eui-accent', base),\n schematic('migrate-eui-toolbar-menu', base),\n schematic('migrate-eui-table', base),\n schematic('migrate-eui-chip-list', base),\n schematic('migrate-eui-chip', base),\n schematic('add-eui-imports', { ...base, useClassArray: options.useClassArray || false }),\n schematic('fix-no-multiple-empty-lines', base),\n ]);\n}\n",
|
|
1650
|
+
"sourceCode": "import { Rule, chain, schematic } from '@angular-devkit/schematics';\n\nexport interface MigrateAllSchema {\n path?: string;\n dryRun?: boolean;\n mwp?: boolean;\n useClassArray?: boolean;\n}\n\nexport function migrateAll(options: MigrateAllSchema): Rule {\n const base = { path: options.path || './src', dryRun: options.dryRun || false };\n\n return chain([\n schematic('migrate', { ...base, mwp: options.mwp || false }),\n schematic('migrate-eui-tabs', base),\n schematic('migrate-to-standalone', base),\n schematic('migrate-eui-alert', base),\n schematic('migrate-eui-progress-circle', base),\n schematic('migrate-eui-popover', base),\n schematic('migrate-eui-icon-toggle', base),\n schematic('migrate-eui-icon-svg', base),\n schematic('migrate-eui-fieldset', base),\n schematic('migrate-eui-avatar', base),\n schematic('migrate-eui-editor', base),\n schematic('migrate-eui-discussion-thread', base),\n schematic('migrate-eui-button', base),\n schematic('migrate-eui-accent', base),\n schematic('migrate-eui-toolbar-menu', base),\n schematic('migrate-eui-table', base),\n schematic('migrate-eui-chip-list', base),\n schematic('migrate-eui-chip', base),\n schematic('migrate-eui-tooltip', base),\n schematic('add-eui-imports', { ...base, useClassArray: options.useClassArray || false }),\n schematic('fix-no-multiple-empty-lines', base),\n ]);\n}\n",
|
|
1592
1651
|
"displayName": "MigrateAllSchema",
|
|
1593
1652
|
"properties": [
|
|
1594
1653
|
{
|
|
@@ -2033,12 +2092,12 @@
|
|
|
2033
2092
|
},
|
|
2034
2093
|
{
|
|
2035
2094
|
"name": "Schema",
|
|
2036
|
-
"id": "interface-Schema-
|
|
2037
|
-
"file": "packages/core/schematics/
|
|
2095
|
+
"id": "interface-Schema-5cd6db1920bd5b70a44c0b8a7f7e30f600bfd16a9950f218e6d451a1755ced95b462ef9a62ee87e39bcb8c392981b8d2597895bf0a272fd8aea71f03429ed976-1",
|
|
2096
|
+
"file": "packages/core/schematics/icon-migrate/schema.ts",
|
|
2038
2097
|
"deprecated": false,
|
|
2039
2098
|
"deprecationMessage": "",
|
|
2040
2099
|
"type": "interface",
|
|
2041
|
-
"sourceCode": "
|
|
2100
|
+
"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",
|
|
2042
2101
|
"displayName": "Schema",
|
|
2043
2102
|
"properties": [
|
|
2044
2103
|
{
|
|
@@ -2049,9 +2108,9 @@
|
|
|
2049
2108
|
"type": "boolean",
|
|
2050
2109
|
"indexKey": "",
|
|
2051
2110
|
"optional": true,
|
|
2052
|
-
"description": "",
|
|
2053
|
-
"line":
|
|
2054
|
-
"rawdescription": "\
|
|
2111
|
+
"description": "<p>Whether to perform a dry run without making changes</p>\n",
|
|
2112
|
+
"line": 5,
|
|
2113
|
+
"rawdescription": "\nWhether to perform a dry run without making changes"
|
|
2055
2114
|
},
|
|
2056
2115
|
{
|
|
2057
2116
|
"name": "path",
|
|
@@ -2061,9 +2120,9 @@
|
|
|
2061
2120
|
"type": "string",
|
|
2062
2121
|
"indexKey": "",
|
|
2063
2122
|
"optional": true,
|
|
2064
|
-
"description": "",
|
|
2065
|
-
"line":
|
|
2066
|
-
"rawdescription": "\
|
|
2123
|
+
"description": "<p>The path to scan for files to migrate</p>\n",
|
|
2124
|
+
"line": 3,
|
|
2125
|
+
"rawdescription": "\nThe path to scan for files to migrate"
|
|
2067
2126
|
}
|
|
2068
2127
|
],
|
|
2069
2128
|
"indexSignatures": [],
|
|
@@ -2139,12 +2198,12 @@
|
|
|
2139
2198
|
},
|
|
2140
2199
|
{
|
|
2141
2200
|
"name": "Schema",
|
|
2142
|
-
"id": "interface-Schema-
|
|
2143
|
-
"file": "packages/core/schematics/
|
|
2201
|
+
"id": "interface-Schema-4fe31ff3e9f1d34845a6b865d605e215f33552094b88c3d0eab0b180187fe64ce4d68d687516cb3d62c57d2678a103969b2dacbb18a49b26060f78096678fcce-3",
|
|
2202
|
+
"file": "packages/core/schematics/fix-no-multiple-empty-lines/index.ts",
|
|
2144
2203
|
"deprecated": false,
|
|
2145
2204
|
"deprecationMessage": "",
|
|
2146
2205
|
"type": "interface",
|
|
2147
|
-
"sourceCode": "
|
|
2206
|
+
"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
2207
|
"displayName": "Schema",
|
|
2149
2208
|
"properties": [
|
|
2150
2209
|
{
|
|
@@ -2155,9 +2214,9 @@
|
|
|
2155
2214
|
"type": "boolean",
|
|
2156
2215
|
"indexKey": "",
|
|
2157
2216
|
"optional": true,
|
|
2158
|
-
"description": "
|
|
2159
|
-
"line":
|
|
2160
|
-
"rawdescription": "\
|
|
2217
|
+
"description": "",
|
|
2218
|
+
"line": 7,
|
|
2219
|
+
"rawdescription": "\n"
|
|
2161
2220
|
},
|
|
2162
2221
|
{
|
|
2163
2222
|
"name": "path",
|
|
@@ -2167,9 +2226,9 @@
|
|
|
2167
2226
|
"type": "string",
|
|
2168
2227
|
"indexKey": "",
|
|
2169
2228
|
"optional": true,
|
|
2170
|
-
"description": "
|
|
2171
|
-
"line":
|
|
2172
|
-
"rawdescription": "\
|
|
2229
|
+
"description": "",
|
|
2230
|
+
"line": 6,
|
|
2231
|
+
"rawdescription": "\n"
|
|
2173
2232
|
}
|
|
2174
2233
|
],
|
|
2175
2234
|
"indexSignatures": [],
|
|
@@ -2468,12 +2527,12 @@
|
|
|
2468
2527
|
},
|
|
2469
2528
|
{
|
|
2470
2529
|
"name": "Schema",
|
|
2471
|
-
"id": "interface-Schema-
|
|
2472
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2530
|
+
"id": "interface-Schema-869dfc324e9111966817cbebb3553eabfe200acfe33bb77efa71a6c46e1cba0ff5852de7b9ade3060f87264035b99591361331a9e0622daaac22b8d59146c761-10",
|
|
2531
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
2473
2532
|
"deprecated": false,
|
|
2474
2533
|
"deprecationMessage": "",
|
|
2475
2534
|
"type": "interface",
|
|
2476
|
-
"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\
|
|
2535
|
+
"sourceCode": "import { parseTemplate, TmplAstBoundAttribute, 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 Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst COMPONENT_TAG = 'eui-discussion-thread';\n\nexport function migrateEuiDiscussionThread(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(COMPONENT_TAG)) 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 [trackBy] binding 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('trackByFn')) {\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 === 'trackByFn') {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(`${path}:${line + 1} - \"trackByFn\" has been removed from ${COMPONENT_TAG}. Remove this reference manually.`);\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n });\n\n context.logger.info(`Removed trackByFn-based [trackBy] bindings from ${COMPONENT_TAG} 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 removals: { start: number; end: number }[] = [];\n\n visitNodes(parsed.nodes, source, removals);\n\n let result = source;\n for (const { start, end } of removals.sort((a, b) => b.start - a.start)) {\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(COMPONENT_TAG)) 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[], source: string, removals: { start: number; end: number }[]): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.name === COMPONENT_TAG) collectRemovals(node, source, removals);\n visitNodes(node.children, source, removals);\n }\n }\n}\n\nfunction collectRemovals(element: TmplAstElement, source: string, removals: { start: number; end: number }[]): void {\n for (const input of element.inputs) {\n if (input.name === 'trackBy') {\n const valueSource = source.slice(input.sourceSpan.start.offset, input.sourceSpan.end.offset);\n if (valueSource.includes('trackByFn')) {\n removals.push({ start: input.sourceSpan.start.offset, end: input.sourceSpan.end.offset });\n }\n }\n }\n}\n",
|
|
2477
2536
|
"displayName": "Schema",
|
|
2478
2537
|
"properties": [
|
|
2479
2538
|
{
|
|
@@ -2485,7 +2544,7 @@
|
|
|
2485
2544
|
"indexKey": "",
|
|
2486
2545
|
"optional": true,
|
|
2487
2546
|
"description": "",
|
|
2488
|
-
"line":
|
|
2547
|
+
"line": 8,
|
|
2489
2548
|
"rawdescription": "\n"
|
|
2490
2549
|
},
|
|
2491
2550
|
{
|
|
@@ -2497,7 +2556,7 @@
|
|
|
2497
2556
|
"indexKey": "",
|
|
2498
2557
|
"optional": true,
|
|
2499
2558
|
"description": "",
|
|
2500
|
-
"line":
|
|
2559
|
+
"line": 7,
|
|
2501
2560
|
"rawdescription": "\n"
|
|
2502
2561
|
}
|
|
2503
2562
|
],
|
|
@@ -2515,12 +2574,12 @@
|
|
|
2515
2574
|
},
|
|
2516
2575
|
{
|
|
2517
2576
|
"name": "Schema",
|
|
2518
|
-
"id": "interface-Schema-
|
|
2519
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2577
|
+
"id": "interface-Schema-375dc0924084a2acbafe4a6a32577d59f631c9a386d151180d8fb1c89e7e7cd23da9fd459e597592ed823692adb6ad2633c50baf16621f003246e8c9bb1c6ce0-11",
|
|
2578
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
2520
2579
|
"deprecated": false,
|
|
2521
2580
|
"deprecationMessage": "",
|
|
2522
2581
|
"type": "interface",
|
|
2523
|
-
"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\
|
|
2582
|
+
"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 COMPONENT_TAG = 'eui-editor';\nconst OLD_NAME = 'onEditorChanged';\nconst NEW_NAME = 'contentChange';\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nexport function migrateEuiEditor(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\n if (path.endsWith('.html')) {\n if (!original.includes(COMPONENT_TAG)) return;\n const result = migrateTemplate(original);\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 count++;\n }\n return;\n }\n\n // .ts file — handle both migration and warnings in one pass\n const hasTag = original.includes(COMPONENT_TAG);\n const hasOldName = original.includes(OLD_NAME);\n if (!hasTag && !hasOldName) return;\n\n if (hasTag) {\n const result = migrateInlineTemplates(original);\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 count++;\n }\n }\n\n // Warn about TS property access usages (skip spec files)\n if (hasOldName && !path.endsWith('.spec.ts')) {\n warnPropertyAccesses(path, original, context);\n }\n });\n\n context.logger.info(`Renamed '(${OLD_NAME})' → '(${NEW_NAME})' on ${COMPONENT_TAG} 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(COMPONENT_TAG)) {\n ts.forEachChild(node, visit); return;\n}\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) changes.push({ start, end, text: migrated });\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 warnPropertyAccesses(path: string, source: string, context: SchematicContext): void {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true);\n\n const visit = (node: ts.Node): void => {\n if (ts.isPropertyAccessExpression(node) && ts.isIdentifier(node.name) && node.name.text === OLD_NAME) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(`${path}:${line + 1} - \"${OLD_NAME}\" has been renamed to \"${NEW_NAME}\" on ${COMPONENT_TAG}. Update this reference manually.`);\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\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 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) collectRenames(node, edits);\n visitNodes(node.children, edits);\n }\n }\n}\n\nfunction collectRenames(element: TmplAstElement, edits: { start: number; end: number; replacement: string }[]): void {\n for (const output of element.outputs) {\n if (output.name === OLD_NAME) {\n edits.push({ start: output.keySpan!.start.offset, end: output.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",
|
|
2524
2583
|
"displayName": "Schema",
|
|
2525
2584
|
"properties": [
|
|
2526
2585
|
{
|
|
@@ -2532,7 +2591,7 @@
|
|
|
2532
2591
|
"indexKey": "",
|
|
2533
2592
|
"optional": true,
|
|
2534
2593
|
"description": "",
|
|
2535
|
-
"line":
|
|
2594
|
+
"line": 12,
|
|
2536
2595
|
"rawdescription": "\n"
|
|
2537
2596
|
},
|
|
2538
2597
|
{
|
|
@@ -2544,7 +2603,7 @@
|
|
|
2544
2603
|
"indexKey": "",
|
|
2545
2604
|
"optional": true,
|
|
2546
2605
|
"description": "",
|
|
2547
|
-
"line":
|
|
2606
|
+
"line": 11,
|
|
2548
2607
|
"rawdescription": "\n"
|
|
2549
2608
|
}
|
|
2550
2609
|
],
|
|
@@ -2562,12 +2621,12 @@
|
|
|
2562
2621
|
},
|
|
2563
2622
|
{
|
|
2564
2623
|
"name": "Schema",
|
|
2565
|
-
"id": "interface-Schema-
|
|
2566
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2624
|
+
"id": "interface-Schema-0ee574e11dd651dd971057cb66220845e5b87b2949c69c623c8ddf7355af92a396c58c237a52a05f18c22a5332a2695b717bcfeb8ea840c4e7df8d0084c2b49c-12",
|
|
2625
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
2567
2626
|
"deprecated": false,
|
|
2568
2627
|
"deprecationMessage": "",
|
|
2569
2628
|
"type": "interface",
|
|
2570
|
-
"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 Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst COMPONENT_TAG = 'eui-
|
|
2629
|
+
"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 Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst COMPONENT_TAG = 'eui-fieldset';\nconst OLD_NAME = 'iconSvgType';\nconst NEW_NAME = 'iconSvgName';\n\nexport function migrateEuiFieldset(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(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 }\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 count++;\n }\n\n // Warn about TS property access usages (merged from warnTsUsages)\n if (path.endsWith('.ts') && !path.endsWith('.spec.ts') && original.includes(OLD_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) && node.name.text === OLD_NAME) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());\n context.logger.warn(`${path}:${line + 1} - \"${OLD_NAME}\" has been renamed to \"${NEW_NAME}\" on ${COMPONENT_TAG}. Update this reference manually.`);\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n });\n\n context.logger.info(`Renamed '${OLD_NAME}' → '${NEW_NAME}' on ${COMPONENT_TAG} 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(COMPONENT_TAG)) {\n ts.forEachChild(node, visit); return; \n}\n const migrated = migrateTemplate(rawTemplate);\n if (migrated !== rawTemplate) changes.push({ start, end, text: migrated });\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)) current = current.expression;\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) collectRenames(node, edits);\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",
|
|
2571
2630
|
"displayName": "Schema",
|
|
2572
2631
|
"properties": [
|
|
2573
2632
|
{
|
|
@@ -2609,12 +2668,12 @@
|
|
|
2609
2668
|
},
|
|
2610
2669
|
{
|
|
2611
2670
|
"name": "Schema",
|
|
2612
|
-
"id": "interface-Schema-
|
|
2613
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2671
|
+
"id": "interface-Schema-b3ff4600c4a5ca1888c45e5baf3600fa6dc6477f1e473e5241ff6682e2929dc8950a5dfa8b1048a348dba7ad1f0ce8cc3681471933911b689e04713334ef4811-13",
|
|
2672
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
2614
2673
|
"deprecated": false,
|
|
2615
2674
|
"deprecationMessage": "",
|
|
2616
2675
|
"type": "interface",
|
|
2617
|
-
"sourceCode": "import { parseTemplate,
|
|
2676
|
+
"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 Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst COMPONENT_TAG = 'eui-icon-svg';\n\nconst INPUT_RENAMES = new Map([\n ['variant', 'fillColor'],\n ['aria-label', 'ariaLabel'],\n]);\n\nconst TS_PROPERTY_RENAMES = new Map([\n ['variant', 'fillColor'],\n]);\n\nexport function migrateEuiIconSvg(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(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 deprecated inputs in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n count++;\n }\n });\n\n context.logger.info(`Migrated eui-icon-svg 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(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) && 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\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 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",
|
|
2618
2677
|
"displayName": "Schema",
|
|
2619
2678
|
"properties": [
|
|
2620
2679
|
{
|
|
@@ -2703,12 +2762,12 @@
|
|
|
2703
2762
|
},
|
|
2704
2763
|
{
|
|
2705
2764
|
"name": "Schema",
|
|
2706
|
-
"id": "interface-Schema-
|
|
2707
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2765
|
+
"id": "interface-Schema-a806c1769fb526271565003a6a3ef9ab4c67e421d93ee0cb54e1f6de223807afc1f16ad294656ef614a77a91a38cc914ce41ac97ed3a8a4195a1e74a729c0c08-15",
|
|
2766
|
+
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
2708
2767
|
"deprecated": false,
|
|
2709
2768
|
"deprecationMessage": "",
|
|
2710
2769
|
"type": "interface",
|
|
2711
|
-
"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 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",
|
|
2712
2771
|
"displayName": "Schema",
|
|
2713
2772
|
"properties": [
|
|
2714
2773
|
{
|
|
@@ -2750,12 +2809,12 @@
|
|
|
2750
2809
|
},
|
|
2751
2810
|
{
|
|
2752
2811
|
"name": "Schema",
|
|
2753
|
-
"id": "interface-Schema-
|
|
2754
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2812
|
+
"id": "interface-Schema-90e62c16ce9ada881e8d434336bb633dae9745236106ddf60964afbd11de6aa579255a13d6036b384281860eb6ed2ee329194b519c51fdaf20f79bc511d0f64f-16",
|
|
2813
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
2755
2814
|
"deprecated": false,
|
|
2756
2815
|
"deprecationMessage": "",
|
|
2757
2816
|
"type": "interface",
|
|
2758
|
-
"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",
|
|
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",
|
|
2759
2818
|
"displayName": "Schema",
|
|
2760
2819
|
"properties": [
|
|
2761
2820
|
{
|
|
@@ -2767,7 +2826,7 @@
|
|
|
2767
2826
|
"indexKey": "",
|
|
2768
2827
|
"optional": true,
|
|
2769
2828
|
"description": "",
|
|
2770
|
-
"line":
|
|
2829
|
+
"line": 8,
|
|
2771
2830
|
"rawdescription": "\n"
|
|
2772
2831
|
},
|
|
2773
2832
|
{
|
|
@@ -2779,7 +2838,7 @@
|
|
|
2779
2838
|
"indexKey": "",
|
|
2780
2839
|
"optional": true,
|
|
2781
2840
|
"description": "",
|
|
2782
|
-
"line":
|
|
2841
|
+
"line": 7,
|
|
2783
2842
|
"rawdescription": "\n"
|
|
2784
2843
|
}
|
|
2785
2844
|
],
|
|
@@ -2797,12 +2856,12 @@
|
|
|
2797
2856
|
},
|
|
2798
2857
|
{
|
|
2799
2858
|
"name": "Schema",
|
|
2800
|
-
"id": "interface-Schema-
|
|
2801
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2859
|
+
"id": "interface-Schema-91c9f900bf3ebb82488fb65644938ef486ceaa447cff8bfd9d710df9595d82acb267b26f3c252173bc684353f362473120226426ed7ee5d98b33e30011dd9383-17",
|
|
2860
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
2802
2861
|
"deprecated": false,
|
|
2803
2862
|
"deprecationMessage": "",
|
|
2804
2863
|
"type": "interface",
|
|
2805
|
-
"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",
|
|
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",
|
|
2806
2865
|
"displayName": "Schema",
|
|
2807
2866
|
"properties": [
|
|
2808
2867
|
{
|
|
@@ -2814,7 +2873,7 @@
|
|
|
2814
2873
|
"indexKey": "",
|
|
2815
2874
|
"optional": true,
|
|
2816
2875
|
"description": "",
|
|
2817
|
-
"line":
|
|
2876
|
+
"line": 49,
|
|
2818
2877
|
"rawdescription": "\n"
|
|
2819
2878
|
},
|
|
2820
2879
|
{
|
|
@@ -2826,7 +2885,7 @@
|
|
|
2826
2885
|
"indexKey": "",
|
|
2827
2886
|
"optional": true,
|
|
2828
2887
|
"description": "",
|
|
2829
|
-
"line":
|
|
2888
|
+
"line": 48,
|
|
2830
2889
|
"rawdescription": "\n"
|
|
2831
2890
|
}
|
|
2832
2891
|
],
|
|
@@ -2844,12 +2903,12 @@
|
|
|
2844
2903
|
},
|
|
2845
2904
|
{
|
|
2846
2905
|
"name": "Schema",
|
|
2847
|
-
"id": "interface-Schema-
|
|
2848
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
2906
|
+
"id": "interface-Schema-760dec88d3f709d5b38226e55f7cbfb1e5fabcea6c004fd46e611be1dd563b8b247e9e6c77667e5582fe7b443374ba2c4facd2b2db2985edb46c9a4a37a8a876-18",
|
|
2907
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
2849
2908
|
"deprecated": false,
|
|
2850
2909
|
"deprecationMessage": "",
|
|
2851
2910
|
"type": "interface",
|
|
2852
|
-
"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",
|
|
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",
|
|
2853
2912
|
"displayName": "Schema",
|
|
2854
2913
|
"properties": [
|
|
2855
2914
|
{
|
|
@@ -2861,7 +2920,7 @@
|
|
|
2861
2920
|
"indexKey": "",
|
|
2862
2921
|
"optional": true,
|
|
2863
2922
|
"description": "",
|
|
2864
|
-
"line":
|
|
2923
|
+
"line": 20,
|
|
2865
2924
|
"rawdescription": "\n"
|
|
2866
2925
|
},
|
|
2867
2926
|
{
|
|
@@ -2873,7 +2932,7 @@
|
|
|
2873
2932
|
"indexKey": "",
|
|
2874
2933
|
"optional": true,
|
|
2875
2934
|
"description": "",
|
|
2876
|
-
"line":
|
|
2935
|
+
"line": 19,
|
|
2877
2936
|
"rawdescription": "\n"
|
|
2878
2937
|
}
|
|
2879
2938
|
],
|
|
@@ -2938,7 +2997,54 @@
|
|
|
2938
2997
|
},
|
|
2939
2998
|
{
|
|
2940
2999
|
"name": "Schema",
|
|
2941
|
-
"id": "interface-Schema-
|
|
3000
|
+
"id": "interface-Schema-d36032102ed30a7ada1e3d36bb9ca41b7234b855760cac9783a25818f7ffe2097e1ebd8e808b574ddec0760f827272f6cd561f45f3eb1578f87f39ee2633730a-20",
|
|
3001
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
3002
|
+
"deprecated": false,
|
|
3003
|
+
"deprecationMessage": "",
|
|
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\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",
|
|
3006
|
+
"displayName": "Schema",
|
|
3007
|
+
"properties": [
|
|
3008
|
+
{
|
|
3009
|
+
"name": "dryRun",
|
|
3010
|
+
"coverageIgnore": false,
|
|
3011
|
+
"deprecated": false,
|
|
3012
|
+
"deprecationMessage": "",
|
|
3013
|
+
"type": "boolean",
|
|
3014
|
+
"indexKey": "",
|
|
3015
|
+
"optional": true,
|
|
3016
|
+
"description": "",
|
|
3017
|
+
"line": 7,
|
|
3018
|
+
"rawdescription": "\n"
|
|
3019
|
+
},
|
|
3020
|
+
{
|
|
3021
|
+
"name": "path",
|
|
3022
|
+
"coverageIgnore": false,
|
|
3023
|
+
"deprecated": false,
|
|
3024
|
+
"deprecationMessage": "",
|
|
3025
|
+
"type": "string",
|
|
3026
|
+
"indexKey": "",
|
|
3027
|
+
"optional": true,
|
|
3028
|
+
"description": "",
|
|
3029
|
+
"line": 6,
|
|
3030
|
+
"rawdescription": "\n"
|
|
3031
|
+
}
|
|
3032
|
+
],
|
|
3033
|
+
"indexSignatures": [],
|
|
3034
|
+
"kind": 172,
|
|
3035
|
+
"methods": [],
|
|
3036
|
+
"extends": [],
|
|
3037
|
+
"isDuplicate": true,
|
|
3038
|
+
"duplicateId": 20,
|
|
3039
|
+
"duplicateName": "Schema-20",
|
|
3040
|
+
"relationships": {
|
|
3041
|
+
"incoming": [],
|
|
3042
|
+
"outgoing": []
|
|
3043
|
+
}
|
|
3044
|
+
},
|
|
3045
|
+
{
|
|
3046
|
+
"name": "Schema",
|
|
3047
|
+
"id": "interface-Schema-817c4b549cc3eab9fcf4936acab2e71182d90a4480369f5c003cbbda10792efa587ad99d65acf049f64e7030e32589e4fabc4a6d7a5621e4fe54725ef91dc9e8-21",
|
|
2942
3048
|
"file": "packages/core/schematics/migrate-to-standalone/index.ts",
|
|
2943
3049
|
"deprecated": false,
|
|
2944
3050
|
"deprecationMessage": "",
|
|
@@ -2976,8 +3082,8 @@
|
|
|
2976
3082
|
"methods": [],
|
|
2977
3083
|
"extends": [],
|
|
2978
3084
|
"isDuplicate": true,
|
|
2979
|
-
"duplicateId":
|
|
2980
|
-
"duplicateName": "Schema-
|
|
3085
|
+
"duplicateId": 21,
|
|
3086
|
+
"duplicateName": "Schema-21",
|
|
2981
3087
|
"relationships": {
|
|
2982
3088
|
"incoming": [],
|
|
2983
3089
|
"outgoing": []
|
|
@@ -21963,45 +22069,45 @@
|
|
|
21963
22069
|
"name": "COMPONENT_TAG",
|
|
21964
22070
|
"ctype": "miscellaneous",
|
|
21965
22071
|
"subtype": "variable",
|
|
21966
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
22072
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
21967
22073
|
"coverageIgnore": false,
|
|
21968
22074
|
"deprecated": false,
|
|
21969
22075
|
"deprecationMessage": "",
|
|
21970
22076
|
"type": "string",
|
|
21971
|
-
"defaultValue": "'eui-
|
|
22077
|
+
"defaultValue": "'eui-discussion-thread'"
|
|
21972
22078
|
},
|
|
21973
22079
|
{
|
|
21974
22080
|
"name": "COMPONENT_TAG",
|
|
21975
22081
|
"ctype": "miscellaneous",
|
|
21976
22082
|
"subtype": "variable",
|
|
21977
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
22083
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
21978
22084
|
"coverageIgnore": false,
|
|
21979
22085
|
"deprecated": false,
|
|
21980
22086
|
"deprecationMessage": "",
|
|
21981
22087
|
"type": "string",
|
|
21982
|
-
"defaultValue": "'eui-
|
|
22088
|
+
"defaultValue": "'eui-editor'"
|
|
21983
22089
|
},
|
|
21984
22090
|
{
|
|
21985
22091
|
"name": "COMPONENT_TAG",
|
|
21986
22092
|
"ctype": "miscellaneous",
|
|
21987
22093
|
"subtype": "variable",
|
|
21988
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
22094
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
21989
22095
|
"coverageIgnore": false,
|
|
21990
22096
|
"deprecated": false,
|
|
21991
22097
|
"deprecationMessage": "",
|
|
21992
22098
|
"type": "string",
|
|
21993
|
-
"defaultValue": "'eui-
|
|
22099
|
+
"defaultValue": "'eui-fieldset'"
|
|
21994
22100
|
},
|
|
21995
22101
|
{
|
|
21996
22102
|
"name": "COMPONENT_TAG",
|
|
21997
22103
|
"ctype": "miscellaneous",
|
|
21998
22104
|
"subtype": "variable",
|
|
21999
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
22105
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
22000
22106
|
"coverageIgnore": false,
|
|
22001
22107
|
"deprecated": false,
|
|
22002
22108
|
"deprecationMessage": "",
|
|
22003
22109
|
"type": "string",
|
|
22004
|
-
"defaultValue": "'eui-
|
|
22110
|
+
"defaultValue": "'eui-icon-svg'"
|
|
22005
22111
|
},
|
|
22006
22112
|
{
|
|
22007
22113
|
"name": "COMPONENT_TAG",
|
|
@@ -22865,6 +22971,17 @@
|
|
|
22865
22971
|
"type": "string",
|
|
22866
22972
|
"defaultValue": "'EuiMenuItem'"
|
|
22867
22973
|
},
|
|
22974
|
+
{
|
|
22975
|
+
"name": "NEW_INTERFACE",
|
|
22976
|
+
"ctype": "miscellaneous",
|
|
22977
|
+
"subtype": "variable",
|
|
22978
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
22979
|
+
"coverageIgnore": false,
|
|
22980
|
+
"deprecated": false,
|
|
22981
|
+
"deprecationMessage": "",
|
|
22982
|
+
"type": "string",
|
|
22983
|
+
"defaultValue": "'EuiTooltipInterface'"
|
|
22984
|
+
},
|
|
22868
22985
|
{
|
|
22869
22986
|
"name": "NEW_INTERFACE_PATH",
|
|
22870
22987
|
"ctype": "miscellaneous",
|
|
@@ -22966,6 +23083,17 @@
|
|
|
22966
23083
|
"rawdescription": "Provides read-only equivalent of jQuery's offset function:\nhttp://api.jquery.com/offset/",
|
|
22967
23084
|
"description": "<p>Provides read-only equivalent of jQuery's offset function:\n<a href=\"http://api.jquery.com/offset/\">http://api.jquery.com/offset/</a></p>\n"
|
|
22968
23085
|
},
|
|
23086
|
+
{
|
|
23087
|
+
"name": "OLD_CLASS",
|
|
23088
|
+
"ctype": "miscellaneous",
|
|
23089
|
+
"subtype": "variable",
|
|
23090
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
23091
|
+
"coverageIgnore": false,
|
|
23092
|
+
"deprecated": false,
|
|
23093
|
+
"deprecationMessage": "",
|
|
23094
|
+
"type": "string",
|
|
23095
|
+
"defaultValue": "'EuiTooltipConfig'"
|
|
23096
|
+
},
|
|
22969
23097
|
{
|
|
22970
23098
|
"name": "OLD_COMPONENT",
|
|
22971
23099
|
"ctype": "miscellaneous",
|
|
@@ -23238,23 +23366,23 @@
|
|
|
23238
23366
|
"name": "REMOVED_INPUTS",
|
|
23239
23367
|
"ctype": "miscellaneous",
|
|
23240
23368
|
"subtype": "variable",
|
|
23241
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
23369
|
+
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
23242
23370
|
"coverageIgnore": false,
|
|
23243
23371
|
"deprecated": false,
|
|
23244
23372
|
"deprecationMessage": "",
|
|
23245
23373
|
"type": "unknown",
|
|
23246
|
-
"defaultValue": "new Set(['
|
|
23374
|
+
"defaultValue": "new Set(['type'])"
|
|
23247
23375
|
},
|
|
23248
23376
|
{
|
|
23249
23377
|
"name": "REMOVED_INPUTS",
|
|
23250
23378
|
"ctype": "miscellaneous",
|
|
23251
23379
|
"subtype": "variable",
|
|
23252
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
23380
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
23253
23381
|
"coverageIgnore": false,
|
|
23254
23382
|
"deprecated": false,
|
|
23255
23383
|
"deprecationMessage": "",
|
|
23256
23384
|
"type": "unknown",
|
|
23257
|
-
"defaultValue": "new Set(['
|
|
23385
|
+
"defaultValue": "new Set(['euiTableBordered', 'isHoverable', 'defaultMultiOrder', 'paginable'])"
|
|
23258
23386
|
},
|
|
23259
23387
|
{
|
|
23260
23388
|
"name": "REMOVED_OUTPUT",
|
|
@@ -24454,6 +24582,51 @@
|
|
|
24454
24582
|
}
|
|
24455
24583
|
]
|
|
24456
24584
|
},
|
|
24585
|
+
{
|
|
24586
|
+
"name": "applyEdits",
|
|
24587
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
24588
|
+
"ctype": "miscellaneous",
|
|
24589
|
+
"subtype": "function",
|
|
24590
|
+
"coverageIgnore": false,
|
|
24591
|
+
"deprecated": false,
|
|
24592
|
+
"deprecationMessage": "",
|
|
24593
|
+
"rawdescription": "",
|
|
24594
|
+
"description": "",
|
|
24595
|
+
"displayName": "applyEdits",
|
|
24596
|
+
"args": [
|
|
24597
|
+
{
|
|
24598
|
+
"name": "source",
|
|
24599
|
+
"type": "string",
|
|
24600
|
+
"deprecated": false,
|
|
24601
|
+
"deprecationMessage": ""
|
|
24602
|
+
},
|
|
24603
|
+
{
|
|
24604
|
+
"name": "edits",
|
|
24605
|
+
"deprecated": false,
|
|
24606
|
+
"deprecationMessage": ""
|
|
24607
|
+
}
|
|
24608
|
+
],
|
|
24609
|
+
"returnType": "string",
|
|
24610
|
+
"jsdoctags": [
|
|
24611
|
+
{
|
|
24612
|
+
"name": "source",
|
|
24613
|
+
"type": "string",
|
|
24614
|
+
"deprecated": false,
|
|
24615
|
+
"deprecationMessage": "",
|
|
24616
|
+
"tagName": {
|
|
24617
|
+
"text": "param"
|
|
24618
|
+
}
|
|
24619
|
+
},
|
|
24620
|
+
{
|
|
24621
|
+
"name": "edits",
|
|
24622
|
+
"deprecated": false,
|
|
24623
|
+
"deprecationMessage": "",
|
|
24624
|
+
"tagName": {
|
|
24625
|
+
"text": "param"
|
|
24626
|
+
}
|
|
24627
|
+
}
|
|
24628
|
+
]
|
|
24629
|
+
},
|
|
24457
24630
|
{
|
|
24458
24631
|
"name": "applyReplacements",
|
|
24459
24632
|
"file": "packages/core/schematics/migrate-to-standalone/index.ts",
|
|
@@ -26419,6 +26592,36 @@
|
|
|
26419
26592
|
}
|
|
26420
26593
|
]
|
|
26421
26594
|
},
|
|
26595
|
+
{
|
|
26596
|
+
"name": "deduplicateEdits",
|
|
26597
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
26598
|
+
"ctype": "miscellaneous",
|
|
26599
|
+
"subtype": "function",
|
|
26600
|
+
"coverageIgnore": false,
|
|
26601
|
+
"deprecated": false,
|
|
26602
|
+
"deprecationMessage": "",
|
|
26603
|
+
"rawdescription": "",
|
|
26604
|
+
"description": "",
|
|
26605
|
+
"displayName": "deduplicateEdits",
|
|
26606
|
+
"args": [
|
|
26607
|
+
{
|
|
26608
|
+
"name": "edits",
|
|
26609
|
+
"deprecated": false,
|
|
26610
|
+
"deprecationMessage": ""
|
|
26611
|
+
}
|
|
26612
|
+
],
|
|
26613
|
+
"returnType": "Edit[]",
|
|
26614
|
+
"jsdoctags": [
|
|
26615
|
+
{
|
|
26616
|
+
"name": "edits",
|
|
26617
|
+
"deprecated": false,
|
|
26618
|
+
"deprecationMessage": "",
|
|
26619
|
+
"tagName": {
|
|
26620
|
+
"text": "param"
|
|
26621
|
+
}
|
|
26622
|
+
}
|
|
26623
|
+
]
|
|
26624
|
+
},
|
|
26422
26625
|
{
|
|
26423
26626
|
"name": "defaultMemoize",
|
|
26424
26627
|
"file": "packages/core/src/lib/services/store/ngrx_kit.ts",
|
|
@@ -29427,6 +29630,36 @@
|
|
|
29427
29630
|
}
|
|
29428
29631
|
]
|
|
29429
29632
|
},
|
|
29633
|
+
{
|
|
29634
|
+
"name": "isPartOfImport",
|
|
29635
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
29636
|
+
"ctype": "miscellaneous",
|
|
29637
|
+
"subtype": "function",
|
|
29638
|
+
"coverageIgnore": false,
|
|
29639
|
+
"deprecated": false,
|
|
29640
|
+
"deprecationMessage": "",
|
|
29641
|
+
"rawdescription": "",
|
|
29642
|
+
"description": "",
|
|
29643
|
+
"displayName": "isPartOfImport",
|
|
29644
|
+
"args": [
|
|
29645
|
+
{
|
|
29646
|
+
"name": "node",
|
|
29647
|
+
"deprecated": false,
|
|
29648
|
+
"deprecationMessage": ""
|
|
29649
|
+
}
|
|
29650
|
+
],
|
|
29651
|
+
"returnType": "boolean",
|
|
29652
|
+
"jsdoctags": [
|
|
29653
|
+
{
|
|
29654
|
+
"name": "node",
|
|
29655
|
+
"deprecated": false,
|
|
29656
|
+
"deprecationMessage": "",
|
|
29657
|
+
"tagName": {
|
|
29658
|
+
"text": "param"
|
|
29659
|
+
}
|
|
29660
|
+
}
|
|
29661
|
+
]
|
|
29662
|
+
},
|
|
29430
29663
|
{
|
|
29431
29664
|
"name": "isSelectorsDictionary",
|
|
29432
29665
|
"file": "packages/core/src/lib/services/store/ngrx_kit.ts",
|
|
@@ -31193,6 +31426,40 @@
|
|
|
31193
31426
|
}
|
|
31194
31427
|
]
|
|
31195
31428
|
},
|
|
31429
|
+
{
|
|
31430
|
+
"name": "migrateEuiTooltip",
|
|
31431
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
31432
|
+
"ctype": "miscellaneous",
|
|
31433
|
+
"subtype": "function",
|
|
31434
|
+
"coverageIgnore": false,
|
|
31435
|
+
"deprecated": false,
|
|
31436
|
+
"deprecationMessage": "",
|
|
31437
|
+
"rawdescription": "",
|
|
31438
|
+
"description": "",
|
|
31439
|
+
"displayName": "migrateEuiTooltip",
|
|
31440
|
+
"args": [
|
|
31441
|
+
{
|
|
31442
|
+
"name": "options",
|
|
31443
|
+
"type": "Schema",
|
|
31444
|
+
"deprecated": false,
|
|
31445
|
+
"deprecationMessage": "",
|
|
31446
|
+
"defaultValue": "{}"
|
|
31447
|
+
}
|
|
31448
|
+
],
|
|
31449
|
+
"returnType": "Rule",
|
|
31450
|
+
"jsdoctags": [
|
|
31451
|
+
{
|
|
31452
|
+
"name": "options",
|
|
31453
|
+
"type": "Schema",
|
|
31454
|
+
"deprecated": false,
|
|
31455
|
+
"deprecationMessage": "",
|
|
31456
|
+
"defaultValue": "{}",
|
|
31457
|
+
"tagName": {
|
|
31458
|
+
"text": "param"
|
|
31459
|
+
}
|
|
31460
|
+
}
|
|
31461
|
+
]
|
|
31462
|
+
},
|
|
31196
31463
|
{
|
|
31197
31464
|
"name": "migrateImportsAndTypes",
|
|
31198
31465
|
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
@@ -31447,6 +31714,38 @@
|
|
|
31447
31714
|
}
|
|
31448
31715
|
]
|
|
31449
31716
|
},
|
|
31717
|
+
{
|
|
31718
|
+
"name": "migrateInlineTemplates",
|
|
31719
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
31720
|
+
"ctype": "miscellaneous",
|
|
31721
|
+
"subtype": "function",
|
|
31722
|
+
"coverageIgnore": false,
|
|
31723
|
+
"deprecated": false,
|
|
31724
|
+
"deprecationMessage": "",
|
|
31725
|
+
"rawdescription": "",
|
|
31726
|
+
"description": "",
|
|
31727
|
+
"displayName": "migrateInlineTemplates",
|
|
31728
|
+
"args": [
|
|
31729
|
+
{
|
|
31730
|
+
"name": "source",
|
|
31731
|
+
"type": "string",
|
|
31732
|
+
"deprecated": false,
|
|
31733
|
+
"deprecationMessage": ""
|
|
31734
|
+
}
|
|
31735
|
+
],
|
|
31736
|
+
"returnType": "string",
|
|
31737
|
+
"jsdoctags": [
|
|
31738
|
+
{
|
|
31739
|
+
"name": "source",
|
|
31740
|
+
"type": "string",
|
|
31741
|
+
"deprecated": false,
|
|
31742
|
+
"deprecationMessage": "",
|
|
31743
|
+
"tagName": {
|
|
31744
|
+
"text": "param"
|
|
31745
|
+
}
|
|
31746
|
+
}
|
|
31747
|
+
]
|
|
31748
|
+
},
|
|
31450
31749
|
{
|
|
31451
31750
|
"name": "migrateInlineTemplates",
|
|
31452
31751
|
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
@@ -31545,7 +31844,7 @@
|
|
|
31545
31844
|
},
|
|
31546
31845
|
{
|
|
31547
31846
|
"name": "migrateInlineTemplates",
|
|
31548
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
31847
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
31549
31848
|
"ctype": "miscellaneous",
|
|
31550
31849
|
"subtype": "function",
|
|
31551
31850
|
"coverageIgnore": false,
|
|
@@ -31577,7 +31876,7 @@
|
|
|
31577
31876
|
},
|
|
31578
31877
|
{
|
|
31579
31878
|
"name": "migrateInlineTemplates",
|
|
31580
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
31879
|
+
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
31581
31880
|
"ctype": "miscellaneous",
|
|
31582
31881
|
"subtype": "function",
|
|
31583
31882
|
"coverageIgnore": false,
|
|
@@ -31703,7 +32002,7 @@
|
|
|
31703
32002
|
},
|
|
31704
32003
|
{
|
|
31705
32004
|
"name": "migrateInlineTemplates",
|
|
31706
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32005
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
31707
32006
|
"ctype": "miscellaneous",
|
|
31708
32007
|
"subtype": "function",
|
|
31709
32008
|
"coverageIgnore": false,
|
|
@@ -31718,6 +32017,18 @@
|
|
|
31718
32017
|
"type": "string",
|
|
31719
32018
|
"deprecated": false,
|
|
31720
32019
|
"deprecationMessage": ""
|
|
32020
|
+
},
|
|
32021
|
+
{
|
|
32022
|
+
"name": "filePath",
|
|
32023
|
+
"type": "string",
|
|
32024
|
+
"deprecated": false,
|
|
32025
|
+
"deprecationMessage": ""
|
|
32026
|
+
},
|
|
32027
|
+
{
|
|
32028
|
+
"name": "context",
|
|
32029
|
+
"type": "SchematicContext",
|
|
32030
|
+
"deprecated": false,
|
|
32031
|
+
"deprecationMessage": ""
|
|
31721
32032
|
}
|
|
31722
32033
|
],
|
|
31723
32034
|
"returnType": "string",
|
|
@@ -31730,12 +32041,30 @@
|
|
|
31730
32041
|
"tagName": {
|
|
31731
32042
|
"text": "param"
|
|
31732
32043
|
}
|
|
32044
|
+
},
|
|
32045
|
+
{
|
|
32046
|
+
"name": "filePath",
|
|
32047
|
+
"type": "string",
|
|
32048
|
+
"deprecated": false,
|
|
32049
|
+
"deprecationMessage": "",
|
|
32050
|
+
"tagName": {
|
|
32051
|
+
"text": "param"
|
|
32052
|
+
}
|
|
32053
|
+
},
|
|
32054
|
+
{
|
|
32055
|
+
"name": "context",
|
|
32056
|
+
"type": "SchematicContext",
|
|
32057
|
+
"deprecated": false,
|
|
32058
|
+
"deprecationMessage": "",
|
|
32059
|
+
"tagName": {
|
|
32060
|
+
"text": "param"
|
|
32061
|
+
}
|
|
31733
32062
|
}
|
|
31734
32063
|
]
|
|
31735
32064
|
},
|
|
31736
32065
|
{
|
|
31737
|
-
"name": "
|
|
31738
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32066
|
+
"name": "migrateTemplate",
|
|
32067
|
+
"file": "packages/core/schematics/migrate-eui-accent/index.ts",
|
|
31739
32068
|
"ctype": "miscellaneous",
|
|
31740
32069
|
"subtype": "function",
|
|
31741
32070
|
"coverageIgnore": false,
|
|
@@ -31743,23 +32072,43 @@
|
|
|
31743
32072
|
"deprecationMessage": "",
|
|
31744
32073
|
"rawdescription": "",
|
|
31745
32074
|
"description": "",
|
|
31746
|
-
"displayName": "
|
|
32075
|
+
"displayName": "migrateTemplate",
|
|
31747
32076
|
"args": [
|
|
31748
32077
|
{
|
|
31749
32078
|
"name": "source",
|
|
31750
32079
|
"type": "string",
|
|
31751
32080
|
"deprecated": false,
|
|
31752
32081
|
"deprecationMessage": ""
|
|
31753
|
-
}
|
|
32082
|
+
}
|
|
32083
|
+
],
|
|
32084
|
+
"returnType": "string",
|
|
32085
|
+
"jsdoctags": [
|
|
31754
32086
|
{
|
|
31755
|
-
"name": "
|
|
32087
|
+
"name": "source",
|
|
31756
32088
|
"type": "string",
|
|
31757
32089
|
"deprecated": false,
|
|
31758
|
-
"deprecationMessage": ""
|
|
31759
|
-
|
|
32090
|
+
"deprecationMessage": "",
|
|
32091
|
+
"tagName": {
|
|
32092
|
+
"text": "param"
|
|
32093
|
+
}
|
|
32094
|
+
}
|
|
32095
|
+
]
|
|
32096
|
+
},
|
|
32097
|
+
{
|
|
32098
|
+
"name": "migrateTemplate",
|
|
32099
|
+
"file": "packages/core/schematics/migrate-eui-alert/index.ts",
|
|
32100
|
+
"ctype": "miscellaneous",
|
|
32101
|
+
"subtype": "function",
|
|
32102
|
+
"coverageIgnore": false,
|
|
32103
|
+
"deprecated": false,
|
|
32104
|
+
"deprecationMessage": "",
|
|
32105
|
+
"rawdescription": "",
|
|
32106
|
+
"description": "",
|
|
32107
|
+
"displayName": "migrateTemplate",
|
|
32108
|
+
"args": [
|
|
31760
32109
|
{
|
|
31761
|
-
"name": "
|
|
31762
|
-
"type": "
|
|
32110
|
+
"name": "source",
|
|
32111
|
+
"type": "string",
|
|
31763
32112
|
"deprecated": false,
|
|
31764
32113
|
"deprecationMessage": ""
|
|
31765
32114
|
}
|
|
@@ -31774,19 +32123,65 @@
|
|
|
31774
32123
|
"tagName": {
|
|
31775
32124
|
"text": "param"
|
|
31776
32125
|
}
|
|
31777
|
-
}
|
|
32126
|
+
}
|
|
32127
|
+
]
|
|
32128
|
+
},
|
|
32129
|
+
{
|
|
32130
|
+
"name": "migrateTemplate",
|
|
32131
|
+
"file": "packages/core/schematics/migrate-eui-avatar/index.ts",
|
|
32132
|
+
"ctype": "miscellaneous",
|
|
32133
|
+
"subtype": "function",
|
|
32134
|
+
"coverageIgnore": false,
|
|
32135
|
+
"deprecated": false,
|
|
32136
|
+
"deprecationMessage": "",
|
|
32137
|
+
"rawdescription": "",
|
|
32138
|
+
"description": "",
|
|
32139
|
+
"displayName": "migrateTemplate",
|
|
32140
|
+
"args": [
|
|
31778
32141
|
{
|
|
31779
|
-
"name": "
|
|
32142
|
+
"name": "source",
|
|
32143
|
+
"type": "string",
|
|
32144
|
+
"deprecated": false,
|
|
32145
|
+
"deprecationMessage": ""
|
|
32146
|
+
}
|
|
32147
|
+
],
|
|
32148
|
+
"returnType": "string",
|
|
32149
|
+
"jsdoctags": [
|
|
32150
|
+
{
|
|
32151
|
+
"name": "source",
|
|
31780
32152
|
"type": "string",
|
|
31781
32153
|
"deprecated": false,
|
|
31782
32154
|
"deprecationMessage": "",
|
|
31783
32155
|
"tagName": {
|
|
31784
32156
|
"text": "param"
|
|
31785
32157
|
}
|
|
31786
|
-
}
|
|
32158
|
+
}
|
|
32159
|
+
]
|
|
32160
|
+
},
|
|
32161
|
+
{
|
|
32162
|
+
"name": "migrateTemplate",
|
|
32163
|
+
"file": "packages/core/schematics/migrate-eui-button/index.ts",
|
|
32164
|
+
"ctype": "miscellaneous",
|
|
32165
|
+
"subtype": "function",
|
|
32166
|
+
"coverageIgnore": false,
|
|
32167
|
+
"deprecated": false,
|
|
32168
|
+
"deprecationMessage": "",
|
|
32169
|
+
"rawdescription": "",
|
|
32170
|
+
"description": "",
|
|
32171
|
+
"displayName": "migrateTemplate",
|
|
32172
|
+
"args": [
|
|
31787
32173
|
{
|
|
31788
|
-
"name": "
|
|
31789
|
-
"type": "
|
|
32174
|
+
"name": "source",
|
|
32175
|
+
"type": "string",
|
|
32176
|
+
"deprecated": false,
|
|
32177
|
+
"deprecationMessage": ""
|
|
32178
|
+
}
|
|
32179
|
+
],
|
|
32180
|
+
"returnType": "string",
|
|
32181
|
+
"jsdoctags": [
|
|
32182
|
+
{
|
|
32183
|
+
"name": "source",
|
|
32184
|
+
"type": "string",
|
|
31790
32185
|
"deprecated": false,
|
|
31791
32186
|
"deprecationMessage": "",
|
|
31792
32187
|
"tagName": {
|
|
@@ -31797,7 +32192,7 @@
|
|
|
31797
32192
|
},
|
|
31798
32193
|
{
|
|
31799
32194
|
"name": "migrateTemplate",
|
|
31800
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32195
|
+
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
31801
32196
|
"ctype": "miscellaneous",
|
|
31802
32197
|
"subtype": "function",
|
|
31803
32198
|
"coverageIgnore": false,
|
|
@@ -31829,7 +32224,7 @@
|
|
|
31829
32224
|
},
|
|
31830
32225
|
{
|
|
31831
32226
|
"name": "migrateTemplate",
|
|
31832
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32227
|
+
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
31833
32228
|
"ctype": "miscellaneous",
|
|
31834
32229
|
"subtype": "function",
|
|
31835
32230
|
"coverageIgnore": false,
|
|
@@ -31861,7 +32256,7 @@
|
|
|
31861
32256
|
},
|
|
31862
32257
|
{
|
|
31863
32258
|
"name": "migrateTemplate",
|
|
31864
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32259
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
31865
32260
|
"ctype": "miscellaneous",
|
|
31866
32261
|
"subtype": "function",
|
|
31867
32262
|
"coverageIgnore": false,
|
|
@@ -31893,103 +32288,7 @@
|
|
|
31893
32288
|
},
|
|
31894
32289
|
{
|
|
31895
32290
|
"name": "migrateTemplate",
|
|
31896
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
31897
|
-
"ctype": "miscellaneous",
|
|
31898
|
-
"subtype": "function",
|
|
31899
|
-
"coverageIgnore": false,
|
|
31900
|
-
"deprecated": false,
|
|
31901
|
-
"deprecationMessage": "",
|
|
31902
|
-
"rawdescription": "",
|
|
31903
|
-
"description": "",
|
|
31904
|
-
"displayName": "migrateTemplate",
|
|
31905
|
-
"args": [
|
|
31906
|
-
{
|
|
31907
|
-
"name": "source",
|
|
31908
|
-
"type": "string",
|
|
31909
|
-
"deprecated": false,
|
|
31910
|
-
"deprecationMessage": ""
|
|
31911
|
-
}
|
|
31912
|
-
],
|
|
31913
|
-
"returnType": "string",
|
|
31914
|
-
"jsdoctags": [
|
|
31915
|
-
{
|
|
31916
|
-
"name": "source",
|
|
31917
|
-
"type": "string",
|
|
31918
|
-
"deprecated": false,
|
|
31919
|
-
"deprecationMessage": "",
|
|
31920
|
-
"tagName": {
|
|
31921
|
-
"text": "param"
|
|
31922
|
-
}
|
|
31923
|
-
}
|
|
31924
|
-
]
|
|
31925
|
-
},
|
|
31926
|
-
{
|
|
31927
|
-
"name": "migrateTemplate",
|
|
31928
|
-
"file": "packages/core/schematics/migrate-eui-chip/index.ts",
|
|
31929
|
-
"ctype": "miscellaneous",
|
|
31930
|
-
"subtype": "function",
|
|
31931
|
-
"coverageIgnore": false,
|
|
31932
|
-
"deprecated": false,
|
|
31933
|
-
"deprecationMessage": "",
|
|
31934
|
-
"rawdescription": "",
|
|
31935
|
-
"description": "",
|
|
31936
|
-
"displayName": "migrateTemplate",
|
|
31937
|
-
"args": [
|
|
31938
|
-
{
|
|
31939
|
-
"name": "source",
|
|
31940
|
-
"type": "string",
|
|
31941
|
-
"deprecated": false,
|
|
31942
|
-
"deprecationMessage": ""
|
|
31943
|
-
}
|
|
31944
|
-
],
|
|
31945
|
-
"returnType": "string",
|
|
31946
|
-
"jsdoctags": [
|
|
31947
|
-
{
|
|
31948
|
-
"name": "source",
|
|
31949
|
-
"type": "string",
|
|
31950
|
-
"deprecated": false,
|
|
31951
|
-
"deprecationMessage": "",
|
|
31952
|
-
"tagName": {
|
|
31953
|
-
"text": "param"
|
|
31954
|
-
}
|
|
31955
|
-
}
|
|
31956
|
-
]
|
|
31957
|
-
},
|
|
31958
|
-
{
|
|
31959
|
-
"name": "migrateTemplate",
|
|
31960
|
-
"file": "packages/core/schematics/migrate-eui-chip-list/index.ts",
|
|
31961
|
-
"ctype": "miscellaneous",
|
|
31962
|
-
"subtype": "function",
|
|
31963
|
-
"coverageIgnore": false,
|
|
31964
|
-
"deprecated": false,
|
|
31965
|
-
"deprecationMessage": "",
|
|
31966
|
-
"rawdescription": "",
|
|
31967
|
-
"description": "",
|
|
31968
|
-
"displayName": "migrateTemplate",
|
|
31969
|
-
"args": [
|
|
31970
|
-
{
|
|
31971
|
-
"name": "source",
|
|
31972
|
-
"type": "string",
|
|
31973
|
-
"deprecated": false,
|
|
31974
|
-
"deprecationMessage": ""
|
|
31975
|
-
}
|
|
31976
|
-
],
|
|
31977
|
-
"returnType": "string",
|
|
31978
|
-
"jsdoctags": [
|
|
31979
|
-
{
|
|
31980
|
-
"name": "source",
|
|
31981
|
-
"type": "string",
|
|
31982
|
-
"deprecated": false,
|
|
31983
|
-
"deprecationMessage": "",
|
|
31984
|
-
"tagName": {
|
|
31985
|
-
"text": "param"
|
|
31986
|
-
}
|
|
31987
|
-
}
|
|
31988
|
-
]
|
|
31989
|
-
},
|
|
31990
|
-
{
|
|
31991
|
-
"name": "migrateTemplate",
|
|
31992
|
-
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
32291
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
31993
32292
|
"ctype": "miscellaneous",
|
|
31994
32293
|
"subtype": "function",
|
|
31995
32294
|
"coverageIgnore": false,
|
|
@@ -32085,7 +32384,7 @@
|
|
|
32085
32384
|
},
|
|
32086
32385
|
{
|
|
32087
32386
|
"name": "migrateTemplate",
|
|
32088
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32387
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
32089
32388
|
"ctype": "miscellaneous",
|
|
32090
32389
|
"subtype": "function",
|
|
32091
32390
|
"coverageIgnore": false,
|
|
@@ -32117,7 +32416,7 @@
|
|
|
32117
32416
|
},
|
|
32118
32417
|
{
|
|
32119
32418
|
"name": "migrateTemplate",
|
|
32120
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
32419
|
+
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
32121
32420
|
"ctype": "miscellaneous",
|
|
32122
32421
|
"subtype": "function",
|
|
32123
32422
|
"coverageIgnore": false,
|
|
@@ -32303,38 +32602,6 @@
|
|
|
32303
32602
|
}
|
|
32304
32603
|
]
|
|
32305
32604
|
},
|
|
32306
|
-
{
|
|
32307
|
-
"name": "migrateTemplate",
|
|
32308
|
-
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
32309
|
-
"ctype": "miscellaneous",
|
|
32310
|
-
"subtype": "function",
|
|
32311
|
-
"coverageIgnore": false,
|
|
32312
|
-
"deprecated": false,
|
|
32313
|
-
"deprecationMessage": "",
|
|
32314
|
-
"rawdescription": "",
|
|
32315
|
-
"description": "",
|
|
32316
|
-
"displayName": "migrateTemplate",
|
|
32317
|
-
"args": [
|
|
32318
|
-
{
|
|
32319
|
-
"name": "source",
|
|
32320
|
-
"type": "string",
|
|
32321
|
-
"deprecated": false,
|
|
32322
|
-
"deprecationMessage": ""
|
|
32323
|
-
}
|
|
32324
|
-
],
|
|
32325
|
-
"returnType": "string",
|
|
32326
|
-
"jsdoctags": [
|
|
32327
|
-
{
|
|
32328
|
-
"name": "source",
|
|
32329
|
-
"type": "string",
|
|
32330
|
-
"deprecated": false,
|
|
32331
|
-
"deprecationMessage": "",
|
|
32332
|
-
"tagName": {
|
|
32333
|
-
"text": "param"
|
|
32334
|
-
}
|
|
32335
|
-
}
|
|
32336
|
-
]
|
|
32337
|
-
},
|
|
32338
32605
|
{
|
|
32339
32606
|
"name": "migrateTemplate",
|
|
32340
32607
|
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
@@ -32617,6 +32884,68 @@
|
|
|
32617
32884
|
}
|
|
32618
32885
|
]
|
|
32619
32886
|
},
|
|
32887
|
+
{
|
|
32888
|
+
"name": "migrateTypeScript",
|
|
32889
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
32890
|
+
"ctype": "miscellaneous",
|
|
32891
|
+
"subtype": "function",
|
|
32892
|
+
"coverageIgnore": false,
|
|
32893
|
+
"deprecated": false,
|
|
32894
|
+
"deprecationMessage": "",
|
|
32895
|
+
"rawdescription": "",
|
|
32896
|
+
"description": "",
|
|
32897
|
+
"displayName": "migrateTypeScript",
|
|
32898
|
+
"args": [
|
|
32899
|
+
{
|
|
32900
|
+
"name": "source",
|
|
32901
|
+
"type": "string",
|
|
32902
|
+
"deprecated": false,
|
|
32903
|
+
"deprecationMessage": ""
|
|
32904
|
+
},
|
|
32905
|
+
{
|
|
32906
|
+
"name": "filePath",
|
|
32907
|
+
"type": "string",
|
|
32908
|
+
"deprecated": false,
|
|
32909
|
+
"deprecationMessage": ""
|
|
32910
|
+
},
|
|
32911
|
+
{
|
|
32912
|
+
"name": "context",
|
|
32913
|
+
"type": "SchematicContext",
|
|
32914
|
+
"deprecated": false,
|
|
32915
|
+
"deprecationMessage": ""
|
|
32916
|
+
}
|
|
32917
|
+
],
|
|
32918
|
+
"returnType": "string",
|
|
32919
|
+
"jsdoctags": [
|
|
32920
|
+
{
|
|
32921
|
+
"name": "source",
|
|
32922
|
+
"type": "string",
|
|
32923
|
+
"deprecated": false,
|
|
32924
|
+
"deprecationMessage": "",
|
|
32925
|
+
"tagName": {
|
|
32926
|
+
"text": "param"
|
|
32927
|
+
}
|
|
32928
|
+
},
|
|
32929
|
+
{
|
|
32930
|
+
"name": "filePath",
|
|
32931
|
+
"type": "string",
|
|
32932
|
+
"deprecated": false,
|
|
32933
|
+
"deprecationMessage": "",
|
|
32934
|
+
"tagName": {
|
|
32935
|
+
"text": "param"
|
|
32936
|
+
}
|
|
32937
|
+
},
|
|
32938
|
+
{
|
|
32939
|
+
"name": "context",
|
|
32940
|
+
"type": "SchematicContext",
|
|
32941
|
+
"deprecated": false,
|
|
32942
|
+
"deprecationMessage": "",
|
|
32943
|
+
"tagName": {
|
|
32944
|
+
"text": "param"
|
|
32945
|
+
}
|
|
32946
|
+
}
|
|
32947
|
+
]
|
|
32948
|
+
},
|
|
32620
32949
|
{
|
|
32621
32950
|
"name": "parseSelector",
|
|
32622
32951
|
"file": "packages/core/schematics/add-eui-imports/selector-map.ts",
|
|
@@ -33063,6 +33392,75 @@
|
|
|
33063
33392
|
}
|
|
33064
33393
|
]
|
|
33065
33394
|
},
|
|
33395
|
+
{
|
|
33396
|
+
"name": "removeImportSpecifier",
|
|
33397
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
33398
|
+
"ctype": "miscellaneous",
|
|
33399
|
+
"subtype": "function",
|
|
33400
|
+
"coverageIgnore": false,
|
|
33401
|
+
"deprecated": false,
|
|
33402
|
+
"deprecationMessage": "",
|
|
33403
|
+
"rawdescription": "",
|
|
33404
|
+
"description": "",
|
|
33405
|
+
"displayName": "removeImportSpecifier",
|
|
33406
|
+
"args": [
|
|
33407
|
+
{
|
|
33408
|
+
"name": "namedImports",
|
|
33409
|
+
"deprecated": false,
|
|
33410
|
+
"deprecationMessage": ""
|
|
33411
|
+
},
|
|
33412
|
+
{
|
|
33413
|
+
"name": "specifier",
|
|
33414
|
+
"deprecated": false,
|
|
33415
|
+
"deprecationMessage": ""
|
|
33416
|
+
},
|
|
33417
|
+
{
|
|
33418
|
+
"name": "sourceFile",
|
|
33419
|
+
"deprecated": false,
|
|
33420
|
+
"deprecationMessage": ""
|
|
33421
|
+
},
|
|
33422
|
+
{
|
|
33423
|
+
"name": "edits",
|
|
33424
|
+
"deprecated": false,
|
|
33425
|
+
"deprecationMessage": ""
|
|
33426
|
+
}
|
|
33427
|
+
],
|
|
33428
|
+
"returnType": "void",
|
|
33429
|
+
"jsdoctags": [
|
|
33430
|
+
{
|
|
33431
|
+
"name": "namedImports",
|
|
33432
|
+
"deprecated": false,
|
|
33433
|
+
"deprecationMessage": "",
|
|
33434
|
+
"tagName": {
|
|
33435
|
+
"text": "param"
|
|
33436
|
+
}
|
|
33437
|
+
},
|
|
33438
|
+
{
|
|
33439
|
+
"name": "specifier",
|
|
33440
|
+
"deprecated": false,
|
|
33441
|
+
"deprecationMessage": "",
|
|
33442
|
+
"tagName": {
|
|
33443
|
+
"text": "param"
|
|
33444
|
+
}
|
|
33445
|
+
},
|
|
33446
|
+
{
|
|
33447
|
+
"name": "sourceFile",
|
|
33448
|
+
"deprecated": false,
|
|
33449
|
+
"deprecationMessage": "",
|
|
33450
|
+
"tagName": {
|
|
33451
|
+
"text": "param"
|
|
33452
|
+
}
|
|
33453
|
+
},
|
|
33454
|
+
{
|
|
33455
|
+
"name": "edits",
|
|
33456
|
+
"deprecated": false,
|
|
33457
|
+
"deprecationMessage": "",
|
|
33458
|
+
"tagName": {
|
|
33459
|
+
"text": "param"
|
|
33460
|
+
}
|
|
33461
|
+
}
|
|
33462
|
+
]
|
|
33463
|
+
},
|
|
33066
33464
|
{
|
|
33067
33465
|
"name": "renameTsProperties",
|
|
33068
33466
|
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
@@ -34777,6 +35175,51 @@
|
|
|
34777
35175
|
}
|
|
34778
35176
|
]
|
|
34779
35177
|
},
|
|
35178
|
+
{
|
|
35179
|
+
"name": "visitDir",
|
|
35180
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
35181
|
+
"ctype": "miscellaneous",
|
|
35182
|
+
"subtype": "function",
|
|
35183
|
+
"coverageIgnore": false,
|
|
35184
|
+
"deprecated": false,
|
|
35185
|
+
"deprecationMessage": "",
|
|
35186
|
+
"rawdescription": "",
|
|
35187
|
+
"description": "",
|
|
35188
|
+
"displayName": "visitDir",
|
|
35189
|
+
"args": [
|
|
35190
|
+
{
|
|
35191
|
+
"name": "dir",
|
|
35192
|
+
"type": "DirEntry",
|
|
35193
|
+
"deprecated": false,
|
|
35194
|
+
"deprecationMessage": ""
|
|
35195
|
+
},
|
|
35196
|
+
{
|
|
35197
|
+
"name": "callback",
|
|
35198
|
+
"deprecated": false,
|
|
35199
|
+
"deprecationMessage": ""
|
|
35200
|
+
}
|
|
35201
|
+
],
|
|
35202
|
+
"returnType": "void",
|
|
35203
|
+
"jsdoctags": [
|
|
35204
|
+
{
|
|
35205
|
+
"name": "dir",
|
|
35206
|
+
"type": "DirEntry",
|
|
35207
|
+
"deprecated": false,
|
|
35208
|
+
"deprecationMessage": "",
|
|
35209
|
+
"tagName": {
|
|
35210
|
+
"text": "param"
|
|
35211
|
+
}
|
|
35212
|
+
},
|
|
35213
|
+
{
|
|
35214
|
+
"name": "callback",
|
|
35215
|
+
"deprecated": false,
|
|
35216
|
+
"deprecationMessage": "",
|
|
35217
|
+
"tagName": {
|
|
35218
|
+
"text": "param"
|
|
35219
|
+
}
|
|
35220
|
+
}
|
|
35221
|
+
]
|
|
35222
|
+
},
|
|
34780
35223
|
{
|
|
34781
35224
|
"name": "visitDir",
|
|
34782
35225
|
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
@@ -34914,7 +35357,7 @@
|
|
|
34914
35357
|
},
|
|
34915
35358
|
{
|
|
34916
35359
|
"name": "visitDir",
|
|
34917
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35360
|
+
"file": "packages/core/schematics/migrate-eui-icon-toggle/index.ts",
|
|
34918
35361
|
"ctype": "miscellaneous",
|
|
34919
35362
|
"subtype": "function",
|
|
34920
35363
|
"coverageIgnore": false,
|
|
@@ -34959,7 +35402,7 @@
|
|
|
34959
35402
|
},
|
|
34960
35403
|
{
|
|
34961
35404
|
"name": "visitDir",
|
|
34962
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35405
|
+
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
34963
35406
|
"ctype": "miscellaneous",
|
|
34964
35407
|
"subtype": "function",
|
|
34965
35408
|
"coverageIgnore": false,
|
|
@@ -35139,7 +35582,7 @@
|
|
|
35139
35582
|
},
|
|
35140
35583
|
{
|
|
35141
35584
|
"name": "visitDir",
|
|
35142
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35585
|
+
"file": "packages/core/schematics/migrate-eui-toolbar-menu/index.ts",
|
|
35143
35586
|
"ctype": "miscellaneous",
|
|
35144
35587
|
"subtype": "function",
|
|
35145
35588
|
"coverageIgnore": false,
|
|
@@ -35184,7 +35627,7 @@
|
|
|
35184
35627
|
},
|
|
35185
35628
|
{
|
|
35186
35629
|
"name": "visitDir",
|
|
35187
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
35630
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
35188
35631
|
"ctype": "miscellaneous",
|
|
35189
35632
|
"subtype": "function",
|
|
35190
35633
|
"coverageIgnore": false,
|
|
@@ -35592,7 +36035,7 @@
|
|
|
35592
36035
|
},
|
|
35593
36036
|
{
|
|
35594
36037
|
"name": "visitNodes",
|
|
35595
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36038
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
35596
36039
|
"ctype": "miscellaneous",
|
|
35597
36040
|
"subtype": "function",
|
|
35598
36041
|
"coverageIgnore": false,
|
|
@@ -35608,7 +36051,13 @@
|
|
|
35608
36051
|
"deprecationMessage": ""
|
|
35609
36052
|
},
|
|
35610
36053
|
{
|
|
35611
|
-
"name": "
|
|
36054
|
+
"name": "source",
|
|
36055
|
+
"type": "string",
|
|
36056
|
+
"deprecated": false,
|
|
36057
|
+
"deprecationMessage": ""
|
|
36058
|
+
},
|
|
36059
|
+
{
|
|
36060
|
+
"name": "removals",
|
|
35612
36061
|
"deprecated": false,
|
|
35613
36062
|
"deprecationMessage": ""
|
|
35614
36063
|
}
|
|
@@ -35624,7 +36073,16 @@
|
|
|
35624
36073
|
}
|
|
35625
36074
|
},
|
|
35626
36075
|
{
|
|
35627
|
-
"name": "
|
|
36076
|
+
"name": "source",
|
|
36077
|
+
"type": "string",
|
|
36078
|
+
"deprecated": false,
|
|
36079
|
+
"deprecationMessage": "",
|
|
36080
|
+
"tagName": {
|
|
36081
|
+
"text": "param"
|
|
36082
|
+
}
|
|
36083
|
+
},
|
|
36084
|
+
{
|
|
36085
|
+
"name": "removals",
|
|
35628
36086
|
"deprecated": false,
|
|
35629
36087
|
"deprecationMessage": "",
|
|
35630
36088
|
"tagName": {
|
|
@@ -35635,7 +36093,7 @@
|
|
|
35635
36093
|
},
|
|
35636
36094
|
{
|
|
35637
36095
|
"name": "visitNodes",
|
|
35638
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36096
|
+
"file": "packages/core/schematics/migrate-eui-editor/index.ts",
|
|
35639
36097
|
"ctype": "miscellaneous",
|
|
35640
36098
|
"subtype": "function",
|
|
35641
36099
|
"coverageIgnore": false,
|
|
@@ -35678,7 +36136,7 @@
|
|
|
35678
36136
|
},
|
|
35679
36137
|
{
|
|
35680
36138
|
"name": "visitNodes",
|
|
35681
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36139
|
+
"file": "packages/core/schematics/migrate-eui-fieldset/index.ts",
|
|
35682
36140
|
"ctype": "miscellaneous",
|
|
35683
36141
|
"subtype": "function",
|
|
35684
36142
|
"coverageIgnore": false,
|
|
@@ -35721,7 +36179,7 @@
|
|
|
35721
36179
|
},
|
|
35722
36180
|
{
|
|
35723
36181
|
"name": "visitNodes",
|
|
35724
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36182
|
+
"file": "packages/core/schematics/migrate-eui-icon-svg/index.ts",
|
|
35725
36183
|
"ctype": "miscellaneous",
|
|
35726
36184
|
"subtype": "function",
|
|
35727
36185
|
"coverageIgnore": false,
|
|
@@ -35737,13 +36195,7 @@
|
|
|
35737
36195
|
"deprecationMessage": ""
|
|
35738
36196
|
},
|
|
35739
36197
|
{
|
|
35740
|
-
"name": "
|
|
35741
|
-
"type": "string",
|
|
35742
|
-
"deprecated": false,
|
|
35743
|
-
"deprecationMessage": ""
|
|
35744
|
-
},
|
|
35745
|
-
{
|
|
35746
|
-
"name": "removals",
|
|
36198
|
+
"name": "edits",
|
|
35747
36199
|
"deprecated": false,
|
|
35748
36200
|
"deprecationMessage": ""
|
|
35749
36201
|
}
|
|
@@ -35759,16 +36211,7 @@
|
|
|
35759
36211
|
}
|
|
35760
36212
|
},
|
|
35761
36213
|
{
|
|
35762
|
-
"name": "
|
|
35763
|
-
"type": "string",
|
|
35764
|
-
"deprecated": false,
|
|
35765
|
-
"deprecationMessage": "",
|
|
35766
|
-
"tagName": {
|
|
35767
|
-
"text": "param"
|
|
35768
|
-
}
|
|
35769
|
-
},
|
|
35770
|
-
{
|
|
35771
|
-
"name": "removals",
|
|
36214
|
+
"name": "edits",
|
|
35772
36215
|
"deprecated": false,
|
|
35773
36216
|
"deprecationMessage": "",
|
|
35774
36217
|
"tagName": {
|
|
@@ -35822,7 +36265,7 @@
|
|
|
35822
36265
|
},
|
|
35823
36266
|
{
|
|
35824
36267
|
"name": "visitNodes",
|
|
35825
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36268
|
+
"file": "packages/core/schematics/migrate-eui-popover/index.ts",
|
|
35826
36269
|
"ctype": "miscellaneous",
|
|
35827
36270
|
"subtype": "function",
|
|
35828
36271
|
"coverageIgnore": false,
|
|
@@ -35838,7 +36281,7 @@
|
|
|
35838
36281
|
"deprecationMessage": ""
|
|
35839
36282
|
},
|
|
35840
36283
|
{
|
|
35841
|
-
"name": "
|
|
36284
|
+
"name": "removals",
|
|
35842
36285
|
"deprecated": false,
|
|
35843
36286
|
"deprecationMessage": ""
|
|
35844
36287
|
}
|
|
@@ -35854,7 +36297,7 @@
|
|
|
35854
36297
|
}
|
|
35855
36298
|
},
|
|
35856
36299
|
{
|
|
35857
|
-
"name": "
|
|
36300
|
+
"name": "removals",
|
|
35858
36301
|
"deprecated": false,
|
|
35859
36302
|
"deprecationMessage": "",
|
|
35860
36303
|
"tagName": {
|
|
@@ -35865,7 +36308,7 @@
|
|
|
35865
36308
|
},
|
|
35866
36309
|
{
|
|
35867
36310
|
"name": "visitNodes",
|
|
35868
|
-
"file": "packages/core/schematics/migrate-eui-
|
|
36311
|
+
"file": "packages/core/schematics/migrate-eui-progress-circle/index.ts",
|
|
35869
36312
|
"ctype": "miscellaneous",
|
|
35870
36313
|
"subtype": "function",
|
|
35871
36314
|
"coverageIgnore": false,
|
|
@@ -35881,7 +36324,7 @@
|
|
|
35881
36324
|
"deprecationMessage": ""
|
|
35882
36325
|
},
|
|
35883
36326
|
{
|
|
35884
|
-
"name": "
|
|
36327
|
+
"name": "edits",
|
|
35885
36328
|
"deprecated": false,
|
|
35886
36329
|
"deprecationMessage": ""
|
|
35887
36330
|
}
|
|
@@ -35897,7 +36340,7 @@
|
|
|
35897
36340
|
}
|
|
35898
36341
|
},
|
|
35899
36342
|
{
|
|
35900
|
-
"name": "
|
|
36343
|
+
"name": "edits",
|
|
35901
36344
|
"deprecated": false,
|
|
35902
36345
|
"deprecationMessage": "",
|
|
35903
36346
|
"tagName": {
|
|
@@ -37551,6 +37994,19 @@
|
|
|
37551
37994
|
"description": "<p>Provides read-only equivalent of jQuery's position function:\n<a href=\"http://api.jquery.com/position/\">http://api.jquery.com/position/</a></p>\n"
|
|
37552
37995
|
}
|
|
37553
37996
|
],
|
|
37997
|
+
"packages/core/schematics/migrate-eui-discussion-thread/index.ts": [
|
|
37998
|
+
{
|
|
37999
|
+
"name": "COMPONENT_TAG",
|
|
38000
|
+
"ctype": "miscellaneous",
|
|
38001
|
+
"subtype": "variable",
|
|
38002
|
+
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
38003
|
+
"coverageIgnore": false,
|
|
38004
|
+
"deprecated": false,
|
|
38005
|
+
"deprecationMessage": "",
|
|
38006
|
+
"type": "string",
|
|
38007
|
+
"defaultValue": "'eui-discussion-thread'"
|
|
38008
|
+
}
|
|
38009
|
+
],
|
|
37554
38010
|
"packages/core/schematics/migrate-eui-editor/index.ts": [
|
|
37555
38011
|
{
|
|
37556
38012
|
"name": "COMPONENT_TAG",
|
|
@@ -37656,19 +38112,6 @@
|
|
|
37656
38112
|
"defaultValue": "new Map([\n ['variant', 'fillColor'],\n])"
|
|
37657
38113
|
}
|
|
37658
38114
|
],
|
|
37659
|
-
"packages/core/schematics/migrate-eui-discussion-thread/index.ts": [
|
|
37660
|
-
{
|
|
37661
|
-
"name": "COMPONENT_TAG",
|
|
37662
|
-
"ctype": "miscellaneous",
|
|
37663
|
-
"subtype": "variable",
|
|
37664
|
-
"file": "packages/core/schematics/migrate-eui-discussion-thread/index.ts",
|
|
37665
|
-
"coverageIgnore": false,
|
|
37666
|
-
"deprecated": false,
|
|
37667
|
-
"deprecationMessage": "",
|
|
37668
|
-
"type": "string",
|
|
37669
|
-
"defaultValue": "'eui-discussion-thread'"
|
|
37670
|
-
}
|
|
37671
|
-
],
|
|
37672
38115
|
"packages/core/schematics/migrate-eui-icon-toggle/index.ts": [
|
|
37673
38116
|
{
|
|
37674
38117
|
"name": "COMPONENT_TAG",
|
|
@@ -38557,6 +39000,30 @@
|
|
|
38557
39000
|
"defaultValue": "'menuItemClick'"
|
|
38558
39001
|
}
|
|
38559
39002
|
],
|
|
39003
|
+
"packages/core/schematics/migrate-eui-tooltip/index.ts": [
|
|
39004
|
+
{
|
|
39005
|
+
"name": "NEW_INTERFACE",
|
|
39006
|
+
"ctype": "miscellaneous",
|
|
39007
|
+
"subtype": "variable",
|
|
39008
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
39009
|
+
"coverageIgnore": false,
|
|
39010
|
+
"deprecated": false,
|
|
39011
|
+
"deprecationMessage": "",
|
|
39012
|
+
"type": "string",
|
|
39013
|
+
"defaultValue": "'EuiTooltipInterface'"
|
|
39014
|
+
},
|
|
39015
|
+
{
|
|
39016
|
+
"name": "OLD_CLASS",
|
|
39017
|
+
"ctype": "miscellaneous",
|
|
39018
|
+
"subtype": "variable",
|
|
39019
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
39020
|
+
"coverageIgnore": false,
|
|
39021
|
+
"deprecated": false,
|
|
39022
|
+
"deprecationMessage": "",
|
|
39023
|
+
"type": "string",
|
|
39024
|
+
"defaultValue": "'EuiTooltipConfig'"
|
|
39025
|
+
}
|
|
39026
|
+
],
|
|
38560
39027
|
"packages/core/schematics/migrate-eui-button/index.ts": [
|
|
38561
39028
|
{
|
|
38562
39029
|
"name": "NEW_NAME",
|
|
@@ -46813,6 +47280,323 @@
|
|
|
46813
47280
|
]
|
|
46814
47281
|
}
|
|
46815
47282
|
],
|
|
47283
|
+
"packages/core/schematics/migrate-eui-tooltip/index.ts": [
|
|
47284
|
+
{
|
|
47285
|
+
"name": "applyEdits",
|
|
47286
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
47287
|
+
"ctype": "miscellaneous",
|
|
47288
|
+
"subtype": "function",
|
|
47289
|
+
"coverageIgnore": false,
|
|
47290
|
+
"deprecated": false,
|
|
47291
|
+
"deprecationMessage": "",
|
|
47292
|
+
"rawdescription": "",
|
|
47293
|
+
"description": "",
|
|
47294
|
+
"displayName": "applyEdits",
|
|
47295
|
+
"args": [
|
|
47296
|
+
{
|
|
47297
|
+
"name": "source",
|
|
47298
|
+
"type": "string",
|
|
47299
|
+
"deprecated": false,
|
|
47300
|
+
"deprecationMessage": ""
|
|
47301
|
+
},
|
|
47302
|
+
{
|
|
47303
|
+
"name": "edits",
|
|
47304
|
+
"deprecated": false,
|
|
47305
|
+
"deprecationMessage": ""
|
|
47306
|
+
}
|
|
47307
|
+
],
|
|
47308
|
+
"returnType": "string",
|
|
47309
|
+
"jsdoctags": [
|
|
47310
|
+
{
|
|
47311
|
+
"name": "source",
|
|
47312
|
+
"type": "string",
|
|
47313
|
+
"deprecated": false,
|
|
47314
|
+
"deprecationMessage": "",
|
|
47315
|
+
"tagName": {
|
|
47316
|
+
"text": "param"
|
|
47317
|
+
}
|
|
47318
|
+
},
|
|
47319
|
+
{
|
|
47320
|
+
"name": "edits",
|
|
47321
|
+
"deprecated": false,
|
|
47322
|
+
"deprecationMessage": "",
|
|
47323
|
+
"tagName": {
|
|
47324
|
+
"text": "param"
|
|
47325
|
+
}
|
|
47326
|
+
}
|
|
47327
|
+
]
|
|
47328
|
+
},
|
|
47329
|
+
{
|
|
47330
|
+
"name": "deduplicateEdits",
|
|
47331
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
47332
|
+
"ctype": "miscellaneous",
|
|
47333
|
+
"subtype": "function",
|
|
47334
|
+
"coverageIgnore": false,
|
|
47335
|
+
"deprecated": false,
|
|
47336
|
+
"deprecationMessage": "",
|
|
47337
|
+
"rawdescription": "",
|
|
47338
|
+
"description": "",
|
|
47339
|
+
"displayName": "deduplicateEdits",
|
|
47340
|
+
"args": [
|
|
47341
|
+
{
|
|
47342
|
+
"name": "edits",
|
|
47343
|
+
"deprecated": false,
|
|
47344
|
+
"deprecationMessage": ""
|
|
47345
|
+
}
|
|
47346
|
+
],
|
|
47347
|
+
"returnType": "Edit[]",
|
|
47348
|
+
"jsdoctags": [
|
|
47349
|
+
{
|
|
47350
|
+
"name": "edits",
|
|
47351
|
+
"deprecated": false,
|
|
47352
|
+
"deprecationMessage": "",
|
|
47353
|
+
"tagName": {
|
|
47354
|
+
"text": "param"
|
|
47355
|
+
}
|
|
47356
|
+
}
|
|
47357
|
+
]
|
|
47358
|
+
},
|
|
47359
|
+
{
|
|
47360
|
+
"name": "isPartOfImport",
|
|
47361
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
47362
|
+
"ctype": "miscellaneous",
|
|
47363
|
+
"subtype": "function",
|
|
47364
|
+
"coverageIgnore": false,
|
|
47365
|
+
"deprecated": false,
|
|
47366
|
+
"deprecationMessage": "",
|
|
47367
|
+
"rawdescription": "",
|
|
47368
|
+
"description": "",
|
|
47369
|
+
"displayName": "isPartOfImport",
|
|
47370
|
+
"args": [
|
|
47371
|
+
{
|
|
47372
|
+
"name": "node",
|
|
47373
|
+
"deprecated": false,
|
|
47374
|
+
"deprecationMessage": ""
|
|
47375
|
+
}
|
|
47376
|
+
],
|
|
47377
|
+
"returnType": "boolean",
|
|
47378
|
+
"jsdoctags": [
|
|
47379
|
+
{
|
|
47380
|
+
"name": "node",
|
|
47381
|
+
"deprecated": false,
|
|
47382
|
+
"deprecationMessage": "",
|
|
47383
|
+
"tagName": {
|
|
47384
|
+
"text": "param"
|
|
47385
|
+
}
|
|
47386
|
+
}
|
|
47387
|
+
]
|
|
47388
|
+
},
|
|
47389
|
+
{
|
|
47390
|
+
"name": "migrateEuiTooltip",
|
|
47391
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
47392
|
+
"ctype": "miscellaneous",
|
|
47393
|
+
"subtype": "function",
|
|
47394
|
+
"coverageIgnore": false,
|
|
47395
|
+
"deprecated": false,
|
|
47396
|
+
"deprecationMessage": "",
|
|
47397
|
+
"rawdescription": "",
|
|
47398
|
+
"description": "",
|
|
47399
|
+
"displayName": "migrateEuiTooltip",
|
|
47400
|
+
"args": [
|
|
47401
|
+
{
|
|
47402
|
+
"name": "options",
|
|
47403
|
+
"type": "Schema",
|
|
47404
|
+
"deprecated": false,
|
|
47405
|
+
"deprecationMessage": "",
|
|
47406
|
+
"defaultValue": "{}"
|
|
47407
|
+
}
|
|
47408
|
+
],
|
|
47409
|
+
"returnType": "Rule",
|
|
47410
|
+
"jsdoctags": [
|
|
47411
|
+
{
|
|
47412
|
+
"name": "options",
|
|
47413
|
+
"type": "Schema",
|
|
47414
|
+
"deprecated": false,
|
|
47415
|
+
"deprecationMessage": "",
|
|
47416
|
+
"defaultValue": "{}",
|
|
47417
|
+
"tagName": {
|
|
47418
|
+
"text": "param"
|
|
47419
|
+
}
|
|
47420
|
+
}
|
|
47421
|
+
]
|
|
47422
|
+
},
|
|
47423
|
+
{
|
|
47424
|
+
"name": "migrateTypeScript",
|
|
47425
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
47426
|
+
"ctype": "miscellaneous",
|
|
47427
|
+
"subtype": "function",
|
|
47428
|
+
"coverageIgnore": false,
|
|
47429
|
+
"deprecated": false,
|
|
47430
|
+
"deprecationMessage": "",
|
|
47431
|
+
"rawdescription": "",
|
|
47432
|
+
"description": "",
|
|
47433
|
+
"displayName": "migrateTypeScript",
|
|
47434
|
+
"args": [
|
|
47435
|
+
{
|
|
47436
|
+
"name": "source",
|
|
47437
|
+
"type": "string",
|
|
47438
|
+
"deprecated": false,
|
|
47439
|
+
"deprecationMessage": ""
|
|
47440
|
+
},
|
|
47441
|
+
{
|
|
47442
|
+
"name": "filePath",
|
|
47443
|
+
"type": "string",
|
|
47444
|
+
"deprecated": false,
|
|
47445
|
+
"deprecationMessage": ""
|
|
47446
|
+
},
|
|
47447
|
+
{
|
|
47448
|
+
"name": "context",
|
|
47449
|
+
"type": "SchematicContext",
|
|
47450
|
+
"deprecated": false,
|
|
47451
|
+
"deprecationMessage": ""
|
|
47452
|
+
}
|
|
47453
|
+
],
|
|
47454
|
+
"returnType": "string",
|
|
47455
|
+
"jsdoctags": [
|
|
47456
|
+
{
|
|
47457
|
+
"name": "source",
|
|
47458
|
+
"type": "string",
|
|
47459
|
+
"deprecated": false,
|
|
47460
|
+
"deprecationMessage": "",
|
|
47461
|
+
"tagName": {
|
|
47462
|
+
"text": "param"
|
|
47463
|
+
}
|
|
47464
|
+
},
|
|
47465
|
+
{
|
|
47466
|
+
"name": "filePath",
|
|
47467
|
+
"type": "string",
|
|
47468
|
+
"deprecated": false,
|
|
47469
|
+
"deprecationMessage": "",
|
|
47470
|
+
"tagName": {
|
|
47471
|
+
"text": "param"
|
|
47472
|
+
}
|
|
47473
|
+
},
|
|
47474
|
+
{
|
|
47475
|
+
"name": "context",
|
|
47476
|
+
"type": "SchematicContext",
|
|
47477
|
+
"deprecated": false,
|
|
47478
|
+
"deprecationMessage": "",
|
|
47479
|
+
"tagName": {
|
|
47480
|
+
"text": "param"
|
|
47481
|
+
}
|
|
47482
|
+
}
|
|
47483
|
+
]
|
|
47484
|
+
},
|
|
47485
|
+
{
|
|
47486
|
+
"name": "removeImportSpecifier",
|
|
47487
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
47488
|
+
"ctype": "miscellaneous",
|
|
47489
|
+
"subtype": "function",
|
|
47490
|
+
"coverageIgnore": false,
|
|
47491
|
+
"deprecated": false,
|
|
47492
|
+
"deprecationMessage": "",
|
|
47493
|
+
"rawdescription": "",
|
|
47494
|
+
"description": "",
|
|
47495
|
+
"displayName": "removeImportSpecifier",
|
|
47496
|
+
"args": [
|
|
47497
|
+
{
|
|
47498
|
+
"name": "namedImports",
|
|
47499
|
+
"deprecated": false,
|
|
47500
|
+
"deprecationMessage": ""
|
|
47501
|
+
},
|
|
47502
|
+
{
|
|
47503
|
+
"name": "specifier",
|
|
47504
|
+
"deprecated": false,
|
|
47505
|
+
"deprecationMessage": ""
|
|
47506
|
+
},
|
|
47507
|
+
{
|
|
47508
|
+
"name": "sourceFile",
|
|
47509
|
+
"deprecated": false,
|
|
47510
|
+
"deprecationMessage": ""
|
|
47511
|
+
},
|
|
47512
|
+
{
|
|
47513
|
+
"name": "edits",
|
|
47514
|
+
"deprecated": false,
|
|
47515
|
+
"deprecationMessage": ""
|
|
47516
|
+
}
|
|
47517
|
+
],
|
|
47518
|
+
"returnType": "void",
|
|
47519
|
+
"jsdoctags": [
|
|
47520
|
+
{
|
|
47521
|
+
"name": "namedImports",
|
|
47522
|
+
"deprecated": false,
|
|
47523
|
+
"deprecationMessage": "",
|
|
47524
|
+
"tagName": {
|
|
47525
|
+
"text": "param"
|
|
47526
|
+
}
|
|
47527
|
+
},
|
|
47528
|
+
{
|
|
47529
|
+
"name": "specifier",
|
|
47530
|
+
"deprecated": false,
|
|
47531
|
+
"deprecationMessage": "",
|
|
47532
|
+
"tagName": {
|
|
47533
|
+
"text": "param"
|
|
47534
|
+
}
|
|
47535
|
+
},
|
|
47536
|
+
{
|
|
47537
|
+
"name": "sourceFile",
|
|
47538
|
+
"deprecated": false,
|
|
47539
|
+
"deprecationMessage": "",
|
|
47540
|
+
"tagName": {
|
|
47541
|
+
"text": "param"
|
|
47542
|
+
}
|
|
47543
|
+
},
|
|
47544
|
+
{
|
|
47545
|
+
"name": "edits",
|
|
47546
|
+
"deprecated": false,
|
|
47547
|
+
"deprecationMessage": "",
|
|
47548
|
+
"tagName": {
|
|
47549
|
+
"text": "param"
|
|
47550
|
+
}
|
|
47551
|
+
}
|
|
47552
|
+
]
|
|
47553
|
+
},
|
|
47554
|
+
{
|
|
47555
|
+
"name": "visitDir",
|
|
47556
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
47557
|
+
"ctype": "miscellaneous",
|
|
47558
|
+
"subtype": "function",
|
|
47559
|
+
"coverageIgnore": false,
|
|
47560
|
+
"deprecated": false,
|
|
47561
|
+
"deprecationMessage": "",
|
|
47562
|
+
"rawdescription": "",
|
|
47563
|
+
"description": "",
|
|
47564
|
+
"displayName": "visitDir",
|
|
47565
|
+
"args": [
|
|
47566
|
+
{
|
|
47567
|
+
"name": "dir",
|
|
47568
|
+
"type": "DirEntry",
|
|
47569
|
+
"deprecated": false,
|
|
47570
|
+
"deprecationMessage": ""
|
|
47571
|
+
},
|
|
47572
|
+
{
|
|
47573
|
+
"name": "callback",
|
|
47574
|
+
"deprecated": false,
|
|
47575
|
+
"deprecationMessage": ""
|
|
47576
|
+
}
|
|
47577
|
+
],
|
|
47578
|
+
"returnType": "void",
|
|
47579
|
+
"jsdoctags": [
|
|
47580
|
+
{
|
|
47581
|
+
"name": "dir",
|
|
47582
|
+
"type": "DirEntry",
|
|
47583
|
+
"deprecated": false,
|
|
47584
|
+
"deprecationMessage": "",
|
|
47585
|
+
"tagName": {
|
|
47586
|
+
"text": "param"
|
|
47587
|
+
}
|
|
47588
|
+
},
|
|
47589
|
+
{
|
|
47590
|
+
"name": "callback",
|
|
47591
|
+
"deprecated": false,
|
|
47592
|
+
"deprecationMessage": "",
|
|
47593
|
+
"tagName": {
|
|
47594
|
+
"text": "param"
|
|
47595
|
+
}
|
|
47596
|
+
}
|
|
47597
|
+
]
|
|
47598
|
+
}
|
|
47599
|
+
],
|
|
46816
47600
|
"packages/core/schematics/migrate-to-standalone/index.ts": [
|
|
46817
47601
|
{
|
|
46818
47602
|
"name": "applyReplacements",
|