@eui/core 22.0.0-alpha.66 → 22.0.0-alpha.67
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 +20 -0
- package/docs/changelog.html +10 -0
- package/docs/interfaces/Annotation.html +402 -0
- package/docs/interfaces/MigrateResult.html +39 -0
- package/docs/interfaces/RemovedAttr.html +0 -13
- package/docs/interfaces/RemovedIdentifier.html +0 -7
- package/docs/interfaces/RemovedTag.html +0 -7
- package/docs/interfaces/Schema-13.html +22 -15
- package/docs/js/menu-wc.js +3 -0
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/documentation.json +1480 -1050
- package/docs/llms.txt +35 -17
- package/docs/miscellaneous/functions.html +3344 -3039
- package/docs/miscellaneous/variables.html +68 -4
- package/docs/overview.html +1 -1
- package/docs/properties.html +1 -1
- package/migrations.json +1 -1
- package/package.json +2 -2
- package/schematics/collection.json +1 -1
- package/schematics/migrate-ecl-removed-components/index.d.ts +20 -15
- package/schematics/migrate-ecl-removed-components/index.js +99 -43
- package/schematics/migrate-ecl-removed-components/index.js.map +1 -1
- package/schematics/migrate-to-signals/index.js +125 -6
- package/schematics/migrate-to-signals/index.js.map +1 -1
|
@@ -224,6 +224,64 @@
|
|
|
224
224
|
"outgoing": []
|
|
225
225
|
}
|
|
226
226
|
},
|
|
227
|
+
{
|
|
228
|
+
"name": "Annotation",
|
|
229
|
+
"id": "interface-Annotation-0802af7de093a6df989cd8f4bc7da55cd9729f34d4642b7f5d9eae9f9a14cae4d644922a9d7ece99ba5b1c23696d54d83436ff79a54a50c37ade3ebbf0cbf92a",
|
|
230
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
231
|
+
"deprecated": false,
|
|
232
|
+
"deprecationMessage": "",
|
|
233
|
+
"type": "interface",
|
|
234
|
+
"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\n/**\n * Flags usages of ECL members removed in v22 that have no automatic drop-in\n * replacement.\n *\n * For each usage it:\n * 1. Logs a precise manual-action warning.\n * 2. Inserts a `TODO: [eUI v22 migration] ...` comment on the line above the\n * usage so it is easy to locate in the editor.\n *\n * It makes **no other edits** — it never comments out, deletes, or rewrites the\n * user's code. These removed members require a developer decision (they are\n * components/directives with different APIs, or have no replacement), so the\n * schematic only points at what needs attention and leaves the change to the\n * developer. Searching a project for `TODO: [eUI v22 migration]` after the run\n * surfaces every spot to migrate.\n *\n * Removed members handled:\n * - `EclDatePickerDirective` (`input[eclDatePicker]`) → `EclDatePickerDuetDirective`\n * on `<duet-date-picker eclDatePicker>`.\n * - `EUI_ECL_DATE_PICKER` — still exported (now provides the Duet directive);\n * only the markup needs updating.\n * - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`) → removed, no replacement.\n * - `EclPageHeaderNextComponent` → removed, no longer exported.\n * - `EclRadioHelpComponent` (`[eclRadioHelp]`) → `[eclHelpBlock]` (`EclHelpBlockDirective`).\n */\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst TODO_PREFIX = 'TODO: [eUI v22 migration]';\n\ninterface RemovedTag {\n tag: string;\n message: string;\n}\n\ninterface RemovedAttr {\n attr: string;\n onTag?: string;\n message: string;\n}\n\ninterface RemovedIdentifier {\n name: string;\n message: string;\n}\n\nconst REMOVED_TAGS: readonly RemovedTag[] = [\n {\n tag: 'ecl-site-header-banner-top',\n message:\n 'EclSiteHeaderBannerTopComponent (<ecl-site-header-banner-top>) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n];\n\nconst REMOVED_ATTRS: readonly RemovedAttr[] = [\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n 'EclDatePickerDirective (input[eclDatePicker]) was removed in v22. Use EclDatePickerDuetDirective on a <duet-date-picker eclDatePicker> element; yearRange/format/firstDayOfWeek are configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n 'EclRadioHelpComponent ([eclRadioHelp]) was removed in v22. Use [eclHelpBlock] (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n];\n\nconst REMOVED_IDENTIFIERS: readonly RemovedIdentifier[] = [\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective (it now provides EclDatePickerDuetDirective). The import still works; update your markup from <input eclDatePicker> to <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n];\n\n// Fast pre-check tokens — if none appear in a file, skip parsing it.\nconst TRIGGER_TOKENS = [\n ...REMOVED_TAGS.map((t) => t.tag),\n ...REMOVED_ATTRS.map((a) => a.attr),\n ...REMOVED_IDENTIFIERS.map((i) => i.name),\n];\n\n/** A TODO comment to insert above a given zero-based line. */\ninterface Annotation {\n line: number;\n commentStyle: 'ts' | 'html';\n message: string;\n}\n\nexport function migrateEclRemovedComponents(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let warningCount = 0;\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!TRIGGER_TOKENS.some((t) => source.includes(t))) return;\n\n const annotations = path.endsWith('.html')\n ? collectTemplateAnnotations(source, 0, 'html')\n : collectTypeScriptAnnotations(source, path);\n\n if (annotations.length === 0) return;\n\n for (const a of annotations) {\n context.logger.warn(`${path}:${a.line + 1} - ${a.message}`);\n warningCount++;\n }\n\n const result = applyAnnotations(source, annotations);\n if (result !== source) {\n if (options.dryRun) {\n logDryRun(context, `Would annotate removed ECL usage(s) with TODO comments in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n if (warningCount === 0) {\n context.logger.info('No usages of removed ECL components found.');\n } else {\n context.logger.info(\n `Found ${warningCount} usage(s) of removed ECL components in ${fileCount} file(s). Search for \"${TODO_PREFIX}\" and migrate them manually.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Templates\n// ---------------------------------------------------------------------------\n\nfunction collectTemplateAnnotations(template: string, lineOffset: number, commentStyle: 'html' | 'ts'): Annotation[] {\n let parsed;\n try {\n parsed = parseTemplate(template, '', { preserveWhitespaces: true });\n } catch {\n return [];\n }\n\n const annotations: Annotation[] = [];\n const visit = (nodes: TmplAstNode[]): void => {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n collectElementAnnotation(node, lineOffset, commentStyle, annotations);\n visit(node.children);\n }\n }\n };\n visit(parsed.nodes);\n return annotations;\n}\n\nfunction collectElementAnnotation(\n element: TmplAstElement,\n lineOffset: number,\n commentStyle: 'html' | 'ts',\n annotations: Annotation[],\n): void {\n const line = element.startSourceSpan.start.line + lineOffset;\n\n const removedTag = REMOVED_TAGS.find((t) => t.tag === element.name);\n if (removedTag) {\n annotations.push({ line, commentStyle, message: removedTag.message });\n }\n\n for (const removed of REMOVED_ATTRS) {\n const hasAttr =\n element.attributes.some((a) => a.name === removed.attr) || element.inputs.some((i) => i.name === removed.attr);\n if (!hasAttr) continue;\n if (removed.onTag && element.name !== removed.onTag) continue;\n annotations.push({ line, commentStyle, message: removed.message });\n }\n}\n\n// ---------------------------------------------------------------------------\n// TypeScript\n// ---------------------------------------------------------------------------\n\nfunction collectTypeScriptAnnotations(source: string, path: string): Annotation[] {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const annotations: Annotation[] = [];\n\n // 1. Inline templates — annotate with a `//` comment on the line of the\n // `template` property (inserting an HTML comment inside the template\n // literal is fragile across single/multi-line forms, so we place a TS\n // comment above the property instead).\n const visitForTemplates = (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 raw = init.getText(sourceFile).slice(1, -1);\n const inlineMessages = collectTemplateAnnotations(raw, 0, 'html').map((a) => a.message);\n if (inlineMessages.length > 0) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n annotations.push({ line, commentStyle: 'ts', message: [...new Set(inlineMessages)].join(' ') });\n }\n }\n }\n ts.forEachChild(node, visitForTemplates);\n };\n visitForTemplates(sourceFile);\n\n // 2. Identifier usages (imports, type references, array entries, etc.).\n // One annotation per affected line; merge messages for multiple symbols.\n const perLine = new Map<number, Set<string>>();\n const visitForIdentifiers = (node: ts.Node): void => {\n if (ts.isIdentifier(node)) {\n const removed = REMOVED_IDENTIFIERS.find((r) => r.name === node.text);\n if (removed) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n const set = perLine.get(line) ?? new Set<string>();\n set.add(removed.message);\n perLine.set(line, set);\n }\n }\n ts.forEachChild(node, visitForIdentifiers);\n };\n visitForIdentifiers(sourceFile);\n\n for (const [line, messages] of perLine) {\n annotations.push({ line, commentStyle: 'ts', message: [...messages].join(' ') });\n }\n\n return annotations;\n}\n\n// ---------------------------------------------------------------------------\n// Annotation application\n// ---------------------------------------------------------------------------\n\nfunction applyAnnotations(source: string, annotations: Annotation[]): string {\n if (annotations.length === 0) return source;\n\n const eol = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const lines = source.split(/\\r?\\n/);\n\n // One annotation per line (merge messages if several target the same line).\n const byLine = new Map<number, Annotation>();\n for (const a of annotations) {\n const existing = byLine.get(a.line);\n if (!existing) {\n byLine.set(a.line, { ...a });\n } else if (!existing.message.includes(a.message)) {\n existing.message = `${existing.message} ${a.message}`;\n }\n }\n\n // Skip lines whose preceding line already carries this TODO (idempotency).\n // Apply bottom-up so inserted lines don't shift later targets.\n const sorted = [...byLine.values()].sort((a, b) => b.line - a.line);\n\n for (const a of sorted) {\n if (a.line < 0 || a.line >= lines.length) continue;\n\n const indent = (lines[a.line].match(/^(\\s*)/)?.[1]) ?? '';\n const todo =\n a.commentStyle === 'html'\n ? `${indent}<!-- ${TODO_PREFIX} ${a.message} -->`\n : `${indent}// ${TODO_PREFIX} ${a.message}`;\n\n // Idempotency guard: if the line above already is this exact TODO, skip.\n const prev = a.line > 0 ? lines[a.line - 1] : '';\n if (prev.trim() === todo.trim()) continue;\n\n lines.splice(a.line, 0, todo);\n }\n\n return lines.join(eol);\n}\n\n// ---------------------------------------------------------------------------\n// Shared\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 (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\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 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",
|
|
235
|
+
"displayName": "Annotation",
|
|
236
|
+
"properties": [
|
|
237
|
+
{
|
|
238
|
+
"name": "commentStyle",
|
|
239
|
+
"coverageIgnore": false,
|
|
240
|
+
"deprecated": false,
|
|
241
|
+
"deprecationMessage": "",
|
|
242
|
+
"type": "\"ts\" | \"html\"",
|
|
243
|
+
"indexKey": "",
|
|
244
|
+
"optional": false,
|
|
245
|
+
"description": "",
|
|
246
|
+
"line": 113,
|
|
247
|
+
"rawdescription": "\n"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "line",
|
|
251
|
+
"coverageIgnore": false,
|
|
252
|
+
"deprecated": false,
|
|
253
|
+
"deprecationMessage": "",
|
|
254
|
+
"type": "number",
|
|
255
|
+
"indexKey": "",
|
|
256
|
+
"optional": false,
|
|
257
|
+
"description": "",
|
|
258
|
+
"line": 112,
|
|
259
|
+
"rawdescription": "\n"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "message",
|
|
263
|
+
"coverageIgnore": false,
|
|
264
|
+
"deprecated": false,
|
|
265
|
+
"deprecationMessage": "",
|
|
266
|
+
"type": "string",
|
|
267
|
+
"indexKey": "",
|
|
268
|
+
"optional": false,
|
|
269
|
+
"description": "",
|
|
270
|
+
"line": 114,
|
|
271
|
+
"rawdescription": "\n"
|
|
272
|
+
}
|
|
273
|
+
],
|
|
274
|
+
"indexSignatures": [],
|
|
275
|
+
"kind": 172,
|
|
276
|
+
"description": "<p>A TODO comment to insert above a given zero-based line.</p>\n",
|
|
277
|
+
"rawdescription": "\nA TODO comment to insert above a given zero-based line.",
|
|
278
|
+
"methods": [],
|
|
279
|
+
"extends": [],
|
|
280
|
+
"relationships": {
|
|
281
|
+
"incoming": [],
|
|
282
|
+
"outgoing": []
|
|
283
|
+
}
|
|
284
|
+
},
|
|
227
285
|
{
|
|
228
286
|
"name": "body",
|
|
229
287
|
"id": "interface-body-bae77523d3ee530142421ca60993222c56bd49a5d36da4cf4198c537ed455a5612e6d9ebcebef9c23a15a369ca676020be1733163ab63d001c125a9701e3002f",
|
|
@@ -1735,12 +1793,12 @@
|
|
|
1735
1793
|
},
|
|
1736
1794
|
{
|
|
1737
1795
|
"name": "Edit",
|
|
1738
|
-
"id": "interface-Edit-
|
|
1796
|
+
"id": "interface-Edit-a815c8902197362f2d1c353d86dc2b491bbb55ca3f82071af2eb0c5761303cb0f3dfc0beeb774a7d53512989fb9a3a10f69f98a5969ebe1e5c5b0ee6aab5c1ac-16",
|
|
1739
1797
|
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
1740
1798
|
"deprecated": false,
|
|
1741
1799
|
"deprecationMessage": "",
|
|
1742
1800
|
"type": "interface",
|
|
1743
|
-
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\nimport { EUI_SIGNAL_MAP as EUI_SIGNAL_MAP_RAW, EUI_SELECTOR_TO_CLASS as EUI_SELECTOR_TO_CLASS_RAW } from './signal-map';\nimport { ECL_SIGNAL_MAP, ECL_SELECTOR_TO_CLASS } from './ecl-signal-map';\n\n/**\n * Combined EUI + ECL signal maps. The migration logic is identical for both\n * libraries (plain field → signal getter), so the maps are merged and the rest\n * of the engine treats them uniformly. EUI and ECL class names don't collide\n * (Eui* vs Ecl* prefixes), and the selector namespaces are disjoint.\n */\nconst EUI_SIGNAL_MAP: Record<string, ReadonlySet<string>> = { ...EUI_SIGNAL_MAP_RAW, ...ECL_SIGNAL_MAP };\nconst EUI_SELECTOR_TO_CLASS: Record<string, string> = { ...EUI_SELECTOR_TO_CLASS_RAW, ...ECL_SELECTOR_TO_CLASS };\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\n/**\n * Migrates consumer code that accesses EUI or ECL component instances\n * programmatically.\n *\n * When EUI/ECL migrated @Input() → input(), @ViewChild() → viewChild(), and\n * @ContentChild() → contentChild(), properties that were plain class fields\n * became signal getters. Consumers who access them via @ViewChild need to\n * change `comp.prop` to `comp.prop()`.\n *\n * This schematic:\n * 1. Finds @ViewChild / @ContentChild fields typed as EUI component classes\n * 2. Resolves untyped @ViewChild('refName') by reading the component template\n * and matching #refName to an EUI element tag/selector\n * 3. Tracks which local variable names hold EUI component references (incl. aliases)\n * 4. Rewrites property accesses on those references: `ref.prop` → `ref.prop()`\n * (only for properties listed in the signal map)\n * 5. Does NOT touch template bindings — those are unaffected by signal migrations\n */\nexport function migrateToSignals(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n let propCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n // Skip spec files — test code may use different patterns\n if (path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n // Fast bail: file must mention at least one EUI class name or have\n // ViewChild/ContentChild with string refs (which might reference EUI elements)\n if (!hasEuiReference(original) && !hasStringRefQuery(original)) return;\n\n const result = migrateTypeScript(original, path, tree, context); if (result.source !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate ${result.editCount} signal property access(es) in ${path}`);\n } else {\n tree.overwrite(path, result.source);\n }\n fileCount++;\n propCount += result.editCount;\n }\n });\n\n context.logger.info(`Migrated ${propCount} property access(es) to signal getters in ${fileCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/** Quick check: does the file reference any EUI class name from the signal map? */\nfunction hasEuiReference(source: string): boolean {\n for (const className of Object.keys(EUI_SIGNAL_MAP)) {\n if (source.includes(className)) return true;\n }\n return false;\n}\n\n/** Quick check: does the file have @ViewChild('...') or @ContentChild('...') with string refs? */\nfunction hasStringRefQuery(source: string): boolean {\n return /(@ViewChild|@ContentChild|@ViewChildren|@ContentChildren)\\s*\\(\\s*['\"]/.test(source);\n}\n\ninterface MigrateResult {\n source: string;\n editCount: number;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, tree: Tree, context: SchematicContext): MigrateResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Phase 0: Build template ref map (#refName → EUI class name) from the component's template\n const templateRefMap = buildTemplateRefMap(sourceFile, source, filePath, tree);\n\n // Phase 1: Collect all variables/properties typed as EUI classes\n const euiRefs = collectEuiReferences(sourceFile, source, templateRefMap);\n\n if (euiRefs.size === 0) {\n return { source, editCount: 0 };\n }\n\n // Phase 2: Find property accesses on those references and rewrite signal props\n const visitNode = (node: ts.Node): void => {\n // Match: ref.prop (PropertyAccessExpression)\n if (ts.isPropertyAccessExpression(node)) {\n const rewrite = tryRewritePropertyAccess(node, euiRefs, sourceFile, source);\n if (rewrite) {\n edits.push(rewrite);\n }\n }\n ts.forEachChild(node, visitNode);\n };\n\n ts.forEachChild(sourceFile, visitNode);\n\n if (edits.length === 0) {\n return { source, editCount: 0 };\n }\n\n return {\n source: applyEdits(source, edits),\n editCount: edits.length,\n };\n}\n\n/**\n * Scans the source file for class properties or variables typed as EUI component classes.\n * Returns a map: localName → Set of signal property names.\n *\n * Handles:\n * @ViewChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild(EuiXxxComponent) name!: EuiXxxComponent;\n * @ViewChild('ref') name: EuiXxxComponent;\n * @ContentChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild('ref') name: ElementRef; (resolved via template #ref → EUI selector)\n * someVar: EuiXxxComponent; (typed class field, even without decorator)\n * const alias = this.viewChildRef; (alias tracking)\n */\nfunction collectEuiReferences(\n sourceFile: ts.SourceFile,\n source: string,\n templateRefMap: Map<string, string>,\n): Map<string, ReadonlySet<string>> {\n const refs = new Map<string, ReadonlySet<string>>();\n\n // Pass 1: collect directly-typed references\n const visitDirect = (node: ts.Node): void => {\n // Class property declarations\n if (ts.isPropertyDeclaration(node) && node.name && ts.isIdentifier(node.name)) {\n const euiClass = resolveEuiClassName(node, sourceFile, templateRefMap);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[euiClass]);\n }\n }\n\n // Variable declarations (const x: EuiXxxComponent = ...)\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n // Parameter declarations (method(ref: EuiXxxComponent))\n if (ts.isParameter(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n ts.forEachChild(node, visitDirect);\n };\n\n ts.forEachChild(sourceFile, visitDirect);\n\n // Pass 2: track aliases — variables assigned from already-tracked references\n // e.g. const alias = this.viewChildRef; or const alias = someParam;\n const visitAlias = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n // Skip if already tracked (has explicit type annotation)\n if (refs.has(node.name.text)) {\n ts.forEachChild(node, visitAlias);\n return;\n }\n\n const aliasedRef = resolveRefName(node.initializer);\n if (aliasedRef && refs.has(aliasedRef)) {\n refs.set(node.name.text, refs.get(aliasedRef)!);\n }\n }\n\n ts.forEachChild(node, visitAlias);\n };\n\n ts.forEachChild(sourceFile, visitAlias);\n return refs;\n}\n\n/**\n * Resolves the EUI class name from a property declaration.\n * Checks: type annotation → decorator class argument → template ref map.\n */\nfunction resolveEuiClassName(\n node: ts.PropertyDeclaration,\n sourceFile: ts.SourceFile,\n templateRefMap: Map<string, string>,\n): string | null {\n // Check type annotation first\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n return typeName;\n }\n\n // Check generic type argument: ElementRef<EuiXxxComponent>\n if (node.type && ts.isTypeReferenceNode(node.type) && node.type.typeArguments?.length) {\n const genericArg = getTypeAnnotationName(node.type.typeArguments[0]);\n if (genericArg && EUI_SIGNAL_MAP[genericArg]) {\n return genericArg;\n }\n }\n\n // Check decorator arguments: @ViewChild(EuiXxxComponent) or @ViewChild('refName')\n if (node.modifiers) {\n for (const modifier of node.modifiers) {\n if (!ts.isDecorator(modifier)) continue;\n if (!ts.isCallExpression(modifier.expression)) continue;\n\n const decoratorName = getDecoratorName(modifier.expression);\n if (!decoratorName) continue;\n if (!['ViewChild', 'ViewChildren', 'ContentChild', 'ContentChildren'].includes(decoratorName)) continue;\n\n const args = modifier.expression.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n\n // @ViewChild(EuiXxxComponent) — class reference\n if (ts.isIdentifier(firstArg) && EUI_SIGNAL_MAP[firstArg.text]) {\n return firstArg.text;\n }\n\n // @ViewChild('refName') — string template ref, resolve via template\n if (ts.isStringLiteralLike(firstArg)) {\n const refName = firstArg.text;\n const euiClass = templateRefMap.get(refName);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n return euiClass;\n }\n }\n }\n }\n }\n\n return null;\n}\n\nfunction getDecoratorName(callExpr: ts.CallExpression): string | null {\n if (ts.isIdentifier(callExpr.expression)) {\n return callExpr.expression.text;\n }\n return null;\n}\n\nfunction getTypeAnnotationName(typeNode: ts.TypeNode | undefined): string | null {\n if (!typeNode) return null;\n if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) {\n return typeNode.typeName.text;\n }\n return null;\n}\n\n/**\n * Checks if a property access `ref.prop` should be rewritten to `ref.prop()`.\n *\n * We rewrite if:\n * - `ref` is tracked in euiRefs\n * - `prop` is in the signal set for that EUI class\n * - The access is NOT already a call expression (not `ref.prop()` or `ref.prop(args)`)\n * - The access is NOT a write target (not `ref.prop = value`)\n * - The access is NOT a template binding argument (those are unaffected)\n */\nfunction tryRewritePropertyAccess(\n node: ts.PropertyAccessExpression,\n euiRefs: Map<string, ReadonlySet<string>>,\n sourceFile: ts.SourceFile,\n source: string,\n): Edit | null {\n const propName = node.name.text;\n\n // Resolve the reference name — handle `this.ref.prop` and `ref.prop`\n const refName = resolveRefName(node.expression);\n if (!refName) return null;\n\n const signalProps = euiRefs.get(refName);\n if (!signalProps || !signalProps.has(propName)) return null;\n\n // Skip if parent is already a call expression on this property: ref.prop(...)\n if (ts.isCallExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if this is the left side of an assignment: ref.prop = value\n if (ts.isBinaryExpression(node.parent) &&\n node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&\n node.parent.left === node) {\n return null;\n }\n\n // Skip if this is a compound assignment: ref.prop += value, ref.prop &&= value, etc.\n if (ts.isBinaryExpression(node.parent) && isAssignmentOperator(node.parent.operatorToken.kind) && node.parent.left === node) {\n return null;\n }\n\n // Skip if this is used with delete: delete ref.prop\n if (ts.isDeleteExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if inside a typeof: typeof ref.prop\n if (ts.isTypeOfExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip property access chains that go deeper: ref.prop.something → ref.prop().something\n // This IS correct — we still want to add ()\n\n // Rewrite: insert () after the property name\n const end = node.name.getEnd();\n return {\n start: end,\n end: end,\n replacement: '()',\n };\n}\n\nfunction isAssignmentOperator(kind: ts.SyntaxKind): boolean {\n return kind >= ts.SyntaxKind.FirstAssignment && kind <= ts.SyntaxKind.LastAssignment;\n}\n\n/**\n * Resolves a reference name from an expression.\n * Handles: `ref`, `this.ref`, `this._ref`\n */\nfunction resolveRefName(expr: ts.Expression): string | null {\n // Direct identifier: ref.prop\n if (ts.isIdentifier(expr)) {\n return expr.text;\n }\n\n // this.ref.prop\n if (ts.isPropertyAccessExpression(expr) && expr.expression.kind === ts.SyntaxKind.ThisKeyword) {\n return expr.name.text;\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Template ref resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Builds a map of template reference variable names (#ref) to EUI class names.\n *\n * Parses the component's template (inline or external) and finds elements like:\n * <eui-alert #myAlert> → myAlert → EuiAlertComponent\n * <input euiAutocomplete #ac> → ac → EuiAutocompleteComponent\n *\n * Returns Map<refName, euiClassName>.\n */\nfunction buildTemplateRefMap(\n sourceFile: ts.SourceFile,\n source: string,\n filePath: string,\n tree: Tree,\n): Map<string, string> {\n const refMap = new Map<string, string>();\n\n // Find @Component decorator\n const componentMeta = findComponentMetadata(sourceFile, source);\n if (!componentMeta) return refMap;\n\n let templateSource: string | null = null;\n\n if (componentMeta.inlineTemplate !== null) {\n templateSource = componentMeta.inlineTemplate;\n } else if (componentMeta.templateUrl) {\n // Resolve templateUrl relative to the TS file\n const dir = filePath.substring(0, filePath.lastIndexOf('/'));\n const templatePath = `${dir}/${componentMeta.templateUrl}`;\n const buffer = tree.read(templatePath);\n if (buffer) {\n templateSource = buffer.toString('utf-8');\n }\n }\n\n if (!templateSource) return refMap;\n\n // Parse the template and collect #refs\n try {\n const parsed = parseTemplate(templateSource, '', { preserveWhitespaces: true });\n collectTemplateRefs(parsed.nodes, refMap);\n } catch {\n // Template parse failure — silently skip (might be malformed or use third-party syntax)\n }\n\n return refMap;\n}\n\n/**\n * Extracts @Component metadata: templateUrl or inline template content.\n */\nfunction findComponentMetadata(\n sourceFile: ts.SourceFile,\n source: string,\n): { templateUrl: string | null; inlineTemplate: string | null } | null {\n let result: { templateUrl: string | null; inlineTemplate: string | null } | null = null;\n\n const visit = (node: ts.Node): void => {\n if (result) return;\n\n if (ts.isDecorator(node) && ts.isCallExpression(node.expression)) {\n const name = getDecoratorName(node.expression);\n if (name !== 'Component') {\n ts.forEachChild(node, visit);\n return;\n }\n\n const args = node.expression.arguments;\n if (args.length === 0 || !ts.isObjectLiteralExpression(args[0])) {\n ts.forEachChild(node, visit);\n return;\n }\n\n const meta: { templateUrl: string | null; inlineTemplate: string | null } = {\n templateUrl: null,\n inlineTemplate: null,\n };\n\n for (const prop of args[0].properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) continue;\n\n if (prop.name.text === 'templateUrl') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.templateUrl = init.text;\n }\n }\n\n if (prop.name.text === 'template') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.inlineTemplate = init.text;\n } else if (ts.isNoSubstitutionTemplateLiteral(init)) {\n meta.inlineTemplate = init.text;\n }\n }\n }\n\n result = meta;\n return;\n }\n\n ts.forEachChild(node, visit);\n };\n\n ts.forEachChild(sourceFile, visit);\n return result;\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\n/**\n * Recursively walks template AST nodes, collecting #refName → EUI class name mappings.\n *\n * For each element with a template reference (#ref), we try to resolve its EUI class:\n * 1. Match element tag name against EUI_SELECTOR_TO_CLASS (e.g. 'eui-alert' → EuiAlertComponent)\n * 2. Match element attributes against attribute selectors (e.g. [euiAutocomplete] → EuiAutocompleteComponent)\n */\nfunction collectTemplateRefs(nodes: TmplAstNode[], refMap: Map<string, string>): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.references && node.references.length > 0) {\n const euiClass = resolveElementToEuiClass(node);\n if (euiClass) {\n for (const ref of node.references) {\n refMap.set(ref.name, euiClass);\n }\n }\n }\n collectTemplateRefs(node.children, refMap);\n }\n }\n}\n\n/**\n * Given a template element, resolves it to an EUI class name by checking:\n * 1. Tag name: <eui-alert> → look up 'eui-alert' in EUI_SELECTOR_TO_CLASS\n * 2. Attribute selectors: <input euiAutocomplete> → look up 'input[euiAutocomplete]' or '[euiAutocomplete]'\n */\nfunction resolveElementToEuiClass(element: TmplAstElement): string | null {\n const tag = element.name;\n\n // Direct tag match: eui-alert, eui-dialog, etc.\n if (EUI_SELECTOR_TO_CLASS[tag]) {\n return EUI_SELECTOR_TO_CLASS[tag];\n }\n\n // Attribute selector match: check all attributes against known patterns\n const allAttrNames = [\n ...element.attributes.map((a) => a.name),\n ...element.inputs.map((i) => i.name),\n ];\n\n for (const attrName of allAttrNames) {\n // Try tag[attr] pattern first (e.g. 'button[euiButton]', 'input[euiAutocomplete]')\n const tagAttrSelector = `${tag}[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[tagAttrSelector]) {\n return EUI_SELECTOR_TO_CLASS[tagAttrSelector];\n }\n\n // Try [attr] pattern (e.g. '[euiTooltip]', '[euiLoading]')\n const attrSelector = `[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[attrSelector]) {\n return EUI_SELECTOR_TO_CLASS[attrSelector];\n }\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Edit helpers\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",
|
|
1801
|
+
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\nimport { EUI_SIGNAL_MAP as EUI_SIGNAL_MAP_RAW, EUI_SELECTOR_TO_CLASS as EUI_SELECTOR_TO_CLASS_RAW } from './signal-map';\nimport { ECL_SIGNAL_MAP, ECL_SELECTOR_TO_CLASS } from './ecl-signal-map';\n\n/**\n * Combined EUI + ECL signal maps. The migration logic is identical for both\n * libraries (plain field → signal getter), so the maps are merged and the rest\n * of the engine treats them uniformly. EUI and ECL class names don't collide\n * (Eui* vs Ecl* prefixes), and the selector namespaces are disjoint.\n */\nconst EUI_SIGNAL_MAP: Record<string, ReadonlySet<string>> = { ...EUI_SIGNAL_MAP_RAW, ...ECL_SIGNAL_MAP };\nconst EUI_SELECTOR_TO_CLASS: Record<string, string> = { ...EUI_SELECTOR_TO_CLASS_RAW, ...ECL_SELECTOR_TO_CLASS };\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\n/**\n * Migrates consumer code that accesses EUI or ECL component instances\n * programmatically.\n *\n * When EUI/ECL migrated @Input() → input(), @ViewChild() → viewChild(), and\n * @ContentChild() → contentChild(), properties that were plain class fields\n * became signal getters. Consumers who access them via @ViewChild need to\n * change `comp.prop` to `comp.prop()`.\n *\n * This schematic:\n * 1. Finds @ViewChild / @ContentChild fields typed as EUI component classes\n * 2. Resolves untyped @ViewChild('refName') by reading the component template\n * and matching #refName to an EUI element tag/selector\n * 3. Tracks which local variable names hold EUI component references (incl. aliases)\n * 4. Rewrites property accesses on those references: `ref.prop` → `ref.prop()`\n * (only for properties listed in the signal map)\n * 5. Does NOT touch template bindings — those are unaffected by signal migrations\n */\nexport function migrateToSignals(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n let propCount = 0;\n let todoCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n // Skip spec files — test code may use different patterns\n if (path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n // Fast bail: file must mention at least one EUI class name or have\n // ViewChild/ContentChild with string refs (which might reference EUI elements)\n if (!hasEuiReference(original) && !hasStringRefQuery(original)) return;\n\n const result = migrateTypeScript(original, path, tree, context); if (result.source !== original) {\n if (options.dryRun) {\n if (result.editCount > 0) {\n logDryRun(context, `Would migrate ${result.editCount} signal property access(es) in ${path}`);\n }\n if (result.todoCount > 0) {\n logDryRun(\n context,\n `Would comment out ${result.todoCount} programmatic signal-input write(s) with a TODO in ${path}`,\n );\n }\n } else {\n tree.overwrite(path, result.source);\n }\n fileCount++;\n propCount += result.editCount;\n todoCount += result.todoCount;\n }\n });\n\n context.logger.info(`Migrated ${propCount} property access(es) to signal getters in ${fileCount} file(s).`);\n if (todoCount > 0) {\n context.logger.info(\n `Commented out ${todoCount} programmatic signal-input write(s) and left a TODO — these cannot be migrated automatically and need a manual fix.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/** Quick check: does the file reference any EUI class name from the signal map? */\nfunction hasEuiReference(source: string): boolean {\n for (const className of Object.keys(EUI_SIGNAL_MAP)) {\n if (source.includes(className)) return true;\n }\n return false;\n}\n\n/** Quick check: does the file have @ViewChild('...') or @ContentChild('...') with string refs? */\nfunction hasStringRefQuery(source: string): boolean {\n return /(@ViewChild|@ContentChild|@ViewChildren|@ContentChildren)\\s*\\(\\s*['\"]/.test(source);\n}\n\ninterface MigrateResult {\n source: string;\n editCount: number;\n todoCount: number;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, tree: Tree, context: SchematicContext): MigrateResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n const todoEdits: Edit[] = [];\n\n // Phase 0: Build template ref map (#refName → EUI class name) from the component's template\n const templateRefMap = buildTemplateRefMap(sourceFile, source, filePath, tree);\n\n // Phase 1: Collect all variables/properties typed as EUI classes\n const euiRefs = collectEuiReferences(sourceFile, source, templateRefMap);\n\n if (euiRefs.size === 0) {\n return { source, editCount: 0, todoCount: 0 };\n }\n\n // Phase 2: Find property accesses on those references and rewrite signal props\n const visitNode = (node: ts.Node): void => {\n // Match: ref.prop (PropertyAccessExpression)\n if (ts.isPropertyAccessExpression(node)) {\n const rewrite = tryRewritePropertyAccess(node, euiRefs, sourceFile, source);\n if (rewrite) {\n edits.push(rewrite);\n }\n\n // Separately: a programmatic WRITE to a now-signal input cannot be\n // migrated automatically. Flag it with a TODO instead of silently\n // leaving a line that will fail to compile against the signal API.\n const todo = tryInsertWriteTodo(node, euiRefs, sourceFile, source);\n if (todo) {\n todoEdits.push(todo);\n }\n }\n ts.forEachChild(node, visitNode);\n };\n\n ts.forEachChild(sourceFile, visitNode);\n\n if (edits.length === 0 && todoEdits.length === 0) {\n return { source, editCount: 0, todoCount: 0 };\n }\n\n const dedupedTodos = deduplicateEdits(todoEdits);\n\n // A TODO edit comments out the whole write statement. Any read-rewrite `()`\n // edit whose position falls inside that commented-out range must be dropped,\n // otherwise we'd both edit and comment the same text (and produce overlapping\n // edits that corrupt the output).\n const keptEdits = edits.filter((edit) => !isInsideAnyRange(edit, dedupedTodos));\n\n return {\n source: applyEdits(source, [...keptEdits, ...dedupedTodos]),\n editCount: keptEdits.length,\n todoCount: dedupedTodos.length,\n };\n}\n\n/**\n * Scans the source file for class properties or variables typed as EUI component classes.\n * Returns a map: localName → Set of signal property names.\n *\n * Handles:\n * @ViewChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild(EuiXxxComponent) name!: EuiXxxComponent;\n * @ViewChild('ref') name: EuiXxxComponent;\n * @ContentChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild('ref') name: ElementRef; (resolved via template #ref → EUI selector)\n * someVar: EuiXxxComponent; (typed class field, even without decorator)\n * const alias = this.viewChildRef; (alias tracking)\n */\nfunction collectEuiReferences(\n sourceFile: ts.SourceFile,\n source: string,\n templateRefMap: Map<string, string>,\n): Map<string, ReadonlySet<string>> {\n const refs = new Map<string, ReadonlySet<string>>();\n\n // Pass 1: collect directly-typed references\n const visitDirect = (node: ts.Node): void => {\n // Class property declarations\n if (ts.isPropertyDeclaration(node) && node.name && ts.isIdentifier(node.name)) {\n const euiClass = resolveEuiClassName(node, sourceFile, templateRefMap);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[euiClass]);\n }\n }\n\n // Variable declarations (const x: EuiXxxComponent = ...)\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n // Parameter declarations (method(ref: EuiXxxComponent))\n if (ts.isParameter(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n ts.forEachChild(node, visitDirect);\n };\n\n ts.forEachChild(sourceFile, visitDirect);\n\n // Pass 2: track aliases — variables assigned from already-tracked references\n // e.g. const alias = this.viewChildRef; or const alias = someParam;\n const visitAlias = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n // Skip if already tracked (has explicit type annotation)\n if (refs.has(node.name.text)) {\n ts.forEachChild(node, visitAlias);\n return;\n }\n\n const aliasedRef = resolveRefName(node.initializer);\n if (aliasedRef && refs.has(aliasedRef)) {\n refs.set(node.name.text, refs.get(aliasedRef)!);\n }\n }\n\n ts.forEachChild(node, visitAlias);\n };\n\n ts.forEachChild(sourceFile, visitAlias);\n return refs;\n}\n\n/**\n * Resolves the EUI class name from a property declaration.\n * Checks: type annotation → decorator class argument → template ref map.\n */\nfunction resolveEuiClassName(\n node: ts.PropertyDeclaration,\n sourceFile: ts.SourceFile,\n templateRefMap: Map<string, string>,\n): string | null {\n // Check type annotation first\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n return typeName;\n }\n\n // Check generic type argument: ElementRef<EuiXxxComponent>\n if (node.type && ts.isTypeReferenceNode(node.type) && node.type.typeArguments?.length) {\n const genericArg = getTypeAnnotationName(node.type.typeArguments[0]);\n if (genericArg && EUI_SIGNAL_MAP[genericArg]) {\n return genericArg;\n }\n }\n\n // Check decorator arguments: @ViewChild(EuiXxxComponent) or @ViewChild('refName')\n if (node.modifiers) {\n for (const modifier of node.modifiers) {\n if (!ts.isDecorator(modifier)) continue;\n if (!ts.isCallExpression(modifier.expression)) continue;\n\n const decoratorName = getDecoratorName(modifier.expression);\n if (!decoratorName) continue;\n if (!['ViewChild', 'ViewChildren', 'ContentChild', 'ContentChildren'].includes(decoratorName)) continue;\n\n const args = modifier.expression.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n\n // @ViewChild(EuiXxxComponent) — class reference\n if (ts.isIdentifier(firstArg) && EUI_SIGNAL_MAP[firstArg.text]) {\n return firstArg.text;\n }\n\n // @ViewChild('refName') — string template ref, resolve via template\n if (ts.isStringLiteralLike(firstArg)) {\n const refName = firstArg.text;\n const euiClass = templateRefMap.get(refName);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n return euiClass;\n }\n }\n }\n }\n }\n\n return null;\n}\n\nfunction getDecoratorName(callExpr: ts.CallExpression): string | null {\n if (ts.isIdentifier(callExpr.expression)) {\n return callExpr.expression.text;\n }\n return null;\n}\n\nfunction getTypeAnnotationName(typeNode: ts.TypeNode | undefined): string | null {\n if (!typeNode) return null;\n if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) {\n return typeNode.typeName.text;\n }\n return null;\n}\n\n/**\n * Checks if a property access `ref.prop` should be rewritten to `ref.prop()`.\n *\n * We rewrite if:\n * - `ref` is tracked in euiRefs\n * - `prop` is in the signal set for that EUI class\n * - The access is NOT already a call expression (not `ref.prop()` or `ref.prop(args)`)\n * - The access is NOT a write target (not `ref.prop = value`)\n * - The access is NOT a template binding argument (those are unaffected)\n */\nfunction tryRewritePropertyAccess(\n node: ts.PropertyAccessExpression,\n euiRefs: Map<string, ReadonlySet<string>>,\n sourceFile: ts.SourceFile,\n source: string,\n): Edit | null {\n const propName = node.name.text;\n\n // Resolve the reference name — handle `this.ref.prop` and `ref.prop`\n const refName = resolveRefName(node.expression);\n if (!refName) return null;\n\n const signalProps = euiRefs.get(refName);\n if (!signalProps || !signalProps.has(propName)) return null;\n\n // Skip if parent is already a call expression on this property: ref.prop(...)\n if (ts.isCallExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if this is the left side of an assignment: ref.prop = value\n if (ts.isBinaryExpression(node.parent) &&\n node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&\n node.parent.left === node) {\n return null;\n }\n\n // Skip if this is a compound assignment: ref.prop += value, ref.prop &&= value, etc.\n if (ts.isBinaryExpression(node.parent) && isAssignmentOperator(node.parent.operatorToken.kind) && node.parent.left === node) {\n return null;\n }\n\n // Skip if this is used with delete: delete ref.prop\n if (ts.isDeleteExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if inside a typeof: typeof ref.prop\n if (ts.isTypeOfExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip property access chains that go deeper: ref.prop.something → ref.prop().something\n // This IS correct — we still want to add ()\n\n // Rewrite: insert () after the property name\n const end = node.name.getEnd();\n return {\n start: end,\n end: end,\n replacement: '()',\n };\n}\n\nfunction isAssignmentOperator(kind: ts.SyntaxKind): boolean {\n return kind >= ts.SyntaxKind.FirstAssignment && kind <= ts.SyntaxKind.LastAssignment;\n}\n\n/** Marker used to detect an already-inserted TODO so the schematic stays idempotent. */\nconst WRITE_TODO_MARKER = 'TODO(eui-signals):';\n\n/**\n * Detects a programmatic WRITE to a now-signal input and returns an edit that\n * comments out the offending statement and prepends an explanatory TODO.\n *\n * A signal input (`input()`) exposes a read-only getter — it cannot be assigned\n * from outside the component (`comp.prop = value` no longer compiles, and\n * `comp.prop()` is a getter, not a setter). There is no safe, mechanical\n * rewrite: the correct fix is to drive the value declaratively through a\n * template binding (`[prop]=\"...\"`) or, when a ComponentRef is genuinely\n * available, `componentRef.setInput('prop', value)`. Both require human\n * judgement, so instead of rewriting we comment the statement out (keeping the\n * build green) and leave a TODO pointing at the manual fix.\n *\n * Only acts when the assignment is the ENTIRE statement\n * (`ExpressionStatement` whose expression is exactly this assignment):\n * ref.prop = value (simple assignment)\n * ref.prop += value, etc. (compound assignment)\n * where `ref` is a tracked EUI/ECL reference and `prop` is in its signal set.\n *\n * When the write is only part of a larger statement (e.g. inside an `if`\n * without a block, or nested in another expression), commenting it out would\n * also remove unrelated logic, so we leave it untouched (it will surface as a\n * compile error the developer must resolve by hand).\n */\nfunction tryInsertWriteTodo(\n node: ts.PropertyAccessExpression,\n euiRefs: Map<string, ReadonlySet<string>>,\n sourceFile: ts.SourceFile,\n source: string,\n): Edit | null {\n const propName = node.name.text;\n\n const refName = resolveRefName(node.expression);\n if (!refName) return null;\n\n const signalProps = euiRefs.get(refName);\n if (!signalProps || !signalProps.has(propName)) return null;\n\n // Only act on assignment targets: `ref.prop = ...` or `ref.prop <op>= ...`\n if (\n !ts.isBinaryExpression(node.parent) ||\n node.parent.left !== node ||\n !isAssignmentOperator(node.parent.operatorToken.kind)\n ) {\n return null;\n }\n\n const assignment = node.parent;\n\n // Only comment out when the assignment IS the whole statement — otherwise we'd\n // delete unrelated logic from a larger statement.\n const statement = node.parent.parent;\n if (!statement || !ts.isExpressionStatement(statement) || statement.expression !== assignment) {\n return null;\n }\n\n // The statement must stand on its own (a direct child of a block/source), not\n // be the unbraced body of an `if`/`for`/`while` etc. — commenting those out by\n // line would swallow the surrounding `if (...)` and break the code.\n const parent = statement.parent;\n if (\n !parent ||\n !(ts.isBlock(parent) || ts.isSourceFile(parent) || ts.isModuleBlock(parent) || ts.isCaseClause(parent) || ts.isDefaultClause(parent))\n ) {\n return null;\n }\n\n const stmtStart = statement.getStart(sourceFile);\n const stmtEnd = statement.getEnd(); // includes the trailing semicolon\n const lineStart = getLineStartPosition(source, stmtStart);\n const indent = source.slice(lineStart, stmtStart);\n\n // The statement text, as written (may span multiple lines).\n const statementText = source.slice(stmtStart, stmtEnd);\n\n // Comment out every line of the statement, preserving each line's own\n // indentation (insert `// ` after the leading whitespace). The first line's\n // indentation was stripped by starting the replacement at lineStart, so we\n // re-add it explicitly.\n const commentedStatement = statementText\n .split('\\n')\n .map((line, i) => {\n if (i === 0) return `${indent}// ${line}`;\n const lineIndent = line.slice(0, line.length - line.trimStart().length);\n return `${lineIndent}// ${line.trimStart()}`;\n })\n .join('\\n');\n\n const todo =\n `${indent}// ${WRITE_TODO_MARKER} '${propName}' is now a signal input and cannot be assigned directly.\\n` +\n `${indent}// Set it via a template binding ([${propName}]=\"...\") or componentRef.setInput('${propName}', ...).\\n` +\n `${indent}// The original statement is commented out below so the build does not fail:\\n`;\n\n // Replace the statement (from the start of its line, to drop the original\n // indentation we re-add) with the TODO + commented-out statement.\n return {\n start: lineStart,\n end: stmtEnd,\n replacement: todo + commentedStatement,\n };\n}\n\n/** True if `edit`'s position falls within any of the given ranges. */\nfunction isInsideAnyRange(edit: Edit, ranges: Edit[]): boolean {\n return ranges.some((range) => edit.start >= range.start && edit.end <= range.end);\n}\n\n/** Returns the index of the first character of the line containing `pos`. */\nfunction getLineStartPosition(source: string, pos: number): number {\n const newlineIndex = source.lastIndexOf('\\n', pos - 1);\n return newlineIndex === -1 ? 0 : newlineIndex + 1;\n}\n\n/**\n * Resolves a reference name from an expression.\n * Handles: `ref`, `this.ref`, `this._ref`\n */\nfunction resolveRefName(expr: ts.Expression): string | null {\n // Direct identifier: ref.prop\n if (ts.isIdentifier(expr)) {\n return expr.text;\n }\n\n // this.ref.prop\n if (ts.isPropertyAccessExpression(expr) && expr.expression.kind === ts.SyntaxKind.ThisKeyword) {\n return expr.name.text;\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Template ref resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Builds a map of template reference variable names (#ref) to EUI class names.\n *\n * Parses the component's template (inline or external) and finds elements like:\n * <eui-alert #myAlert> → myAlert → EuiAlertComponent\n * <input euiAutocomplete #ac> → ac → EuiAutocompleteComponent\n *\n * Returns Map<refName, euiClassName>.\n */\nfunction buildTemplateRefMap(\n sourceFile: ts.SourceFile,\n source: string,\n filePath: string,\n tree: Tree,\n): Map<string, string> {\n const refMap = new Map<string, string>();\n\n // Find @Component decorator\n const componentMeta = findComponentMetadata(sourceFile, source);\n if (!componentMeta) return refMap;\n\n let templateSource: string | null = null;\n\n if (componentMeta.inlineTemplate !== null) {\n templateSource = componentMeta.inlineTemplate;\n } else if (componentMeta.templateUrl) {\n // Resolve templateUrl relative to the TS file\n const dir = filePath.substring(0, filePath.lastIndexOf('/'));\n const templatePath = `${dir}/${componentMeta.templateUrl}`;\n const buffer = tree.read(templatePath);\n if (buffer) {\n templateSource = buffer.toString('utf-8');\n }\n }\n\n if (!templateSource) return refMap;\n\n // Parse the template and collect #refs\n try {\n const parsed = parseTemplate(templateSource, '', { preserveWhitespaces: true });\n collectTemplateRefs(parsed.nodes, refMap);\n } catch {\n // Template parse failure — silently skip (might be malformed or use third-party syntax)\n }\n\n return refMap;\n}\n\n/**\n * Extracts @Component metadata: templateUrl or inline template content.\n */\nfunction findComponentMetadata(\n sourceFile: ts.SourceFile,\n source: string,\n): { templateUrl: string | null; inlineTemplate: string | null } | null {\n let result: { templateUrl: string | null; inlineTemplate: string | null } | null = null;\n\n const visit = (node: ts.Node): void => {\n if (result) return;\n\n if (ts.isDecorator(node) && ts.isCallExpression(node.expression)) {\n const name = getDecoratorName(node.expression);\n if (name !== 'Component') {\n ts.forEachChild(node, visit);\n return;\n }\n\n const args = node.expression.arguments;\n if (args.length === 0 || !ts.isObjectLiteralExpression(args[0])) {\n ts.forEachChild(node, visit);\n return;\n }\n\n const meta: { templateUrl: string | null; inlineTemplate: string | null } = {\n templateUrl: null,\n inlineTemplate: null,\n };\n\n for (const prop of args[0].properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) continue;\n\n if (prop.name.text === 'templateUrl') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.templateUrl = init.text;\n }\n }\n\n if (prop.name.text === 'template') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.inlineTemplate = init.text;\n } else if (ts.isNoSubstitutionTemplateLiteral(init)) {\n meta.inlineTemplate = init.text;\n }\n }\n }\n\n result = meta;\n return;\n }\n\n ts.forEachChild(node, visit);\n };\n\n ts.forEachChild(sourceFile, visit);\n return result;\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\n/**\n * Recursively walks template AST nodes, collecting #refName → EUI class name mappings.\n *\n * For each element with a template reference (#ref), we try to resolve its EUI class:\n * 1. Match element tag name against EUI_SELECTOR_TO_CLASS (e.g. 'eui-alert' → EuiAlertComponent)\n * 2. Match element attributes against attribute selectors (e.g. [euiAutocomplete] → EuiAutocompleteComponent)\n */\nfunction collectTemplateRefs(nodes: TmplAstNode[], refMap: Map<string, string>): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.references && node.references.length > 0) {\n const euiClass = resolveElementToEuiClass(node);\n if (euiClass) {\n for (const ref of node.references) {\n refMap.set(ref.name, euiClass);\n }\n }\n }\n collectTemplateRefs(node.children, refMap);\n }\n }\n}\n\n/**\n * Given a template element, resolves it to an EUI class name by checking:\n * 1. Tag name: <eui-alert> → look up 'eui-alert' in EUI_SELECTOR_TO_CLASS\n * 2. Attribute selectors: <input euiAutocomplete> → look up 'input[euiAutocomplete]' or '[euiAutocomplete]'\n */\nfunction resolveElementToEuiClass(element: TmplAstElement): string | null {\n const tag = element.name;\n\n // Direct tag match: eui-alert, eui-dialog, etc.\n if (EUI_SELECTOR_TO_CLASS[tag]) {\n return EUI_SELECTOR_TO_CLASS[tag];\n }\n\n // Attribute selector match: check all attributes against known patterns\n const allAttrNames = [\n ...element.attributes.map((a) => a.name),\n ...element.inputs.map((i) => i.name),\n ];\n\n for (const attrName of allAttrNames) {\n // Try tag[attr] pattern first (e.g. 'button[euiButton]', 'input[euiAutocomplete]')\n const tagAttrSelector = `${tag}[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[tagAttrSelector]) {\n return EUI_SELECTOR_TO_CLASS[tagAttrSelector];\n }\n\n // Try [attr] pattern (e.g. '[euiTooltip]', '[euiLoading]')\n const attrSelector = `[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[attrSelector]) {\n return EUI_SELECTOR_TO_CLASS[attrSelector];\n }\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Edit helpers\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",
|
|
1744
1802
|
"displayName": "Edit",
|
|
1745
1803
|
"properties": [
|
|
1746
1804
|
{
|
|
@@ -2521,12 +2579,12 @@
|
|
|
2521
2579
|
},
|
|
2522
2580
|
{
|
|
2523
2581
|
"name": "MigrateResult",
|
|
2524
|
-
"id": "interface-MigrateResult-
|
|
2582
|
+
"id": "interface-MigrateResult-a815c8902197362f2d1c353d86dc2b491bbb55ca3f82071af2eb0c5761303cb0f3dfc0beeb774a7d53512989fb9a3a10f69f98a5969ebe1e5c5b0ee6aab5c1ac",
|
|
2525
2583
|
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
2526
2584
|
"deprecated": false,
|
|
2527
2585
|
"deprecationMessage": "",
|
|
2528
2586
|
"type": "interface",
|
|
2529
|
-
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\nimport { EUI_SIGNAL_MAP as EUI_SIGNAL_MAP_RAW, EUI_SELECTOR_TO_CLASS as EUI_SELECTOR_TO_CLASS_RAW } from './signal-map';\nimport { ECL_SIGNAL_MAP, ECL_SELECTOR_TO_CLASS } from './ecl-signal-map';\n\n/**\n * Combined EUI + ECL signal maps. The migration logic is identical for both\n * libraries (plain field → signal getter), so the maps are merged and the rest\n * of the engine treats them uniformly. EUI and ECL class names don't collide\n * (Eui* vs Ecl* prefixes), and the selector namespaces are disjoint.\n */\nconst EUI_SIGNAL_MAP: Record<string, ReadonlySet<string>> = { ...EUI_SIGNAL_MAP_RAW, ...ECL_SIGNAL_MAP };\nconst EUI_SELECTOR_TO_CLASS: Record<string, string> = { ...EUI_SELECTOR_TO_CLASS_RAW, ...ECL_SELECTOR_TO_CLASS };\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\n/**\n * Migrates consumer code that accesses EUI or ECL component instances\n * programmatically.\n *\n * When EUI/ECL migrated @Input() → input(), @ViewChild() → viewChild(), and\n * @ContentChild() → contentChild(), properties that were plain class fields\n * became signal getters. Consumers who access them via @ViewChild need to\n * change `comp.prop` to `comp.prop()`.\n *\n * This schematic:\n * 1. Finds @ViewChild / @ContentChild fields typed as EUI component classes\n * 2. Resolves untyped @ViewChild('refName') by reading the component template\n * and matching #refName to an EUI element tag/selector\n * 3. Tracks which local variable names hold EUI component references (incl. aliases)\n * 4. Rewrites property accesses on those references: `ref.prop` → `ref.prop()`\n * (only for properties listed in the signal map)\n * 5. Does NOT touch template bindings — those are unaffected by signal migrations\n */\nexport function migrateToSignals(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n let propCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n // Skip spec files — test code may use different patterns\n if (path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n // Fast bail: file must mention at least one EUI class name or have\n // ViewChild/ContentChild with string refs (which might reference EUI elements)\n if (!hasEuiReference(original) && !hasStringRefQuery(original)) return;\n\n const result = migrateTypeScript(original, path, tree, context); if (result.source !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate ${result.editCount} signal property access(es) in ${path}`);\n } else {\n tree.overwrite(path, result.source);\n }\n fileCount++;\n propCount += result.editCount;\n }\n });\n\n context.logger.info(`Migrated ${propCount} property access(es) to signal getters in ${fileCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/** Quick check: does the file reference any EUI class name from the signal map? */\nfunction hasEuiReference(source: string): boolean {\n for (const className of Object.keys(EUI_SIGNAL_MAP)) {\n if (source.includes(className)) return true;\n }\n return false;\n}\n\n/** Quick check: does the file have @ViewChild('...') or @ContentChild('...') with string refs? */\nfunction hasStringRefQuery(source: string): boolean {\n return /(@ViewChild|@ContentChild|@ViewChildren|@ContentChildren)\\s*\\(\\s*['\"]/.test(source);\n}\n\ninterface MigrateResult {\n source: string;\n editCount: number;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, tree: Tree, context: SchematicContext): MigrateResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Phase 0: Build template ref map (#refName → EUI class name) from the component's template\n const templateRefMap = buildTemplateRefMap(sourceFile, source, filePath, tree);\n\n // Phase 1: Collect all variables/properties typed as EUI classes\n const euiRefs = collectEuiReferences(sourceFile, source, templateRefMap);\n\n if (euiRefs.size === 0) {\n return { source, editCount: 0 };\n }\n\n // Phase 2: Find property accesses on those references and rewrite signal props\n const visitNode = (node: ts.Node): void => {\n // Match: ref.prop (PropertyAccessExpression)\n if (ts.isPropertyAccessExpression(node)) {\n const rewrite = tryRewritePropertyAccess(node, euiRefs, sourceFile, source);\n if (rewrite) {\n edits.push(rewrite);\n }\n }\n ts.forEachChild(node, visitNode);\n };\n\n ts.forEachChild(sourceFile, visitNode);\n\n if (edits.length === 0) {\n return { source, editCount: 0 };\n }\n\n return {\n source: applyEdits(source, edits),\n editCount: edits.length,\n };\n}\n\n/**\n * Scans the source file for class properties or variables typed as EUI component classes.\n * Returns a map: localName → Set of signal property names.\n *\n * Handles:\n * @ViewChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild(EuiXxxComponent) name!: EuiXxxComponent;\n * @ViewChild('ref') name: EuiXxxComponent;\n * @ContentChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild('ref') name: ElementRef; (resolved via template #ref → EUI selector)\n * someVar: EuiXxxComponent; (typed class field, even without decorator)\n * const alias = this.viewChildRef; (alias tracking)\n */\nfunction collectEuiReferences(\n sourceFile: ts.SourceFile,\n source: string,\n templateRefMap: Map<string, string>,\n): Map<string, ReadonlySet<string>> {\n const refs = new Map<string, ReadonlySet<string>>();\n\n // Pass 1: collect directly-typed references\n const visitDirect = (node: ts.Node): void => {\n // Class property declarations\n if (ts.isPropertyDeclaration(node) && node.name && ts.isIdentifier(node.name)) {\n const euiClass = resolveEuiClassName(node, sourceFile, templateRefMap);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[euiClass]);\n }\n }\n\n // Variable declarations (const x: EuiXxxComponent = ...)\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n // Parameter declarations (method(ref: EuiXxxComponent))\n if (ts.isParameter(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n ts.forEachChild(node, visitDirect);\n };\n\n ts.forEachChild(sourceFile, visitDirect);\n\n // Pass 2: track aliases — variables assigned from already-tracked references\n // e.g. const alias = this.viewChildRef; or const alias = someParam;\n const visitAlias = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n // Skip if already tracked (has explicit type annotation)\n if (refs.has(node.name.text)) {\n ts.forEachChild(node, visitAlias);\n return;\n }\n\n const aliasedRef = resolveRefName(node.initializer);\n if (aliasedRef && refs.has(aliasedRef)) {\n refs.set(node.name.text, refs.get(aliasedRef)!);\n }\n }\n\n ts.forEachChild(node, visitAlias);\n };\n\n ts.forEachChild(sourceFile, visitAlias);\n return refs;\n}\n\n/**\n * Resolves the EUI class name from a property declaration.\n * Checks: type annotation → decorator class argument → template ref map.\n */\nfunction resolveEuiClassName(\n node: ts.PropertyDeclaration,\n sourceFile: ts.SourceFile,\n templateRefMap: Map<string, string>,\n): string | null {\n // Check type annotation first\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n return typeName;\n }\n\n // Check generic type argument: ElementRef<EuiXxxComponent>\n if (node.type && ts.isTypeReferenceNode(node.type) && node.type.typeArguments?.length) {\n const genericArg = getTypeAnnotationName(node.type.typeArguments[0]);\n if (genericArg && EUI_SIGNAL_MAP[genericArg]) {\n return genericArg;\n }\n }\n\n // Check decorator arguments: @ViewChild(EuiXxxComponent) or @ViewChild('refName')\n if (node.modifiers) {\n for (const modifier of node.modifiers) {\n if (!ts.isDecorator(modifier)) continue;\n if (!ts.isCallExpression(modifier.expression)) continue;\n\n const decoratorName = getDecoratorName(modifier.expression);\n if (!decoratorName) continue;\n if (!['ViewChild', 'ViewChildren', 'ContentChild', 'ContentChildren'].includes(decoratorName)) continue;\n\n const args = modifier.expression.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n\n // @ViewChild(EuiXxxComponent) — class reference\n if (ts.isIdentifier(firstArg) && EUI_SIGNAL_MAP[firstArg.text]) {\n return firstArg.text;\n }\n\n // @ViewChild('refName') — string template ref, resolve via template\n if (ts.isStringLiteralLike(firstArg)) {\n const refName = firstArg.text;\n const euiClass = templateRefMap.get(refName);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n return euiClass;\n }\n }\n }\n }\n }\n\n return null;\n}\n\nfunction getDecoratorName(callExpr: ts.CallExpression): string | null {\n if (ts.isIdentifier(callExpr.expression)) {\n return callExpr.expression.text;\n }\n return null;\n}\n\nfunction getTypeAnnotationName(typeNode: ts.TypeNode | undefined): string | null {\n if (!typeNode) return null;\n if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) {\n return typeNode.typeName.text;\n }\n return null;\n}\n\n/**\n * Checks if a property access `ref.prop` should be rewritten to `ref.prop()`.\n *\n * We rewrite if:\n * - `ref` is tracked in euiRefs\n * - `prop` is in the signal set for that EUI class\n * - The access is NOT already a call expression (not `ref.prop()` or `ref.prop(args)`)\n * - The access is NOT a write target (not `ref.prop = value`)\n * - The access is NOT a template binding argument (those are unaffected)\n */\nfunction tryRewritePropertyAccess(\n node: ts.PropertyAccessExpression,\n euiRefs: Map<string, ReadonlySet<string>>,\n sourceFile: ts.SourceFile,\n source: string,\n): Edit | null {\n const propName = node.name.text;\n\n // Resolve the reference name — handle `this.ref.prop` and `ref.prop`\n const refName = resolveRefName(node.expression);\n if (!refName) return null;\n\n const signalProps = euiRefs.get(refName);\n if (!signalProps || !signalProps.has(propName)) return null;\n\n // Skip if parent is already a call expression on this property: ref.prop(...)\n if (ts.isCallExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if this is the left side of an assignment: ref.prop = value\n if (ts.isBinaryExpression(node.parent) &&\n node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&\n node.parent.left === node) {\n return null;\n }\n\n // Skip if this is a compound assignment: ref.prop += value, ref.prop &&= value, etc.\n if (ts.isBinaryExpression(node.parent) && isAssignmentOperator(node.parent.operatorToken.kind) && node.parent.left === node) {\n return null;\n }\n\n // Skip if this is used with delete: delete ref.prop\n if (ts.isDeleteExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if inside a typeof: typeof ref.prop\n if (ts.isTypeOfExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip property access chains that go deeper: ref.prop.something → ref.prop().something\n // This IS correct — we still want to add ()\n\n // Rewrite: insert () after the property name\n const end = node.name.getEnd();\n return {\n start: end,\n end: end,\n replacement: '()',\n };\n}\n\nfunction isAssignmentOperator(kind: ts.SyntaxKind): boolean {\n return kind >= ts.SyntaxKind.FirstAssignment && kind <= ts.SyntaxKind.LastAssignment;\n}\n\n/**\n * Resolves a reference name from an expression.\n * Handles: `ref`, `this.ref`, `this._ref`\n */\nfunction resolveRefName(expr: ts.Expression): string | null {\n // Direct identifier: ref.prop\n if (ts.isIdentifier(expr)) {\n return expr.text;\n }\n\n // this.ref.prop\n if (ts.isPropertyAccessExpression(expr) && expr.expression.kind === ts.SyntaxKind.ThisKeyword) {\n return expr.name.text;\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Template ref resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Builds a map of template reference variable names (#ref) to EUI class names.\n *\n * Parses the component's template (inline or external) and finds elements like:\n * <eui-alert #myAlert> → myAlert → EuiAlertComponent\n * <input euiAutocomplete #ac> → ac → EuiAutocompleteComponent\n *\n * Returns Map<refName, euiClassName>.\n */\nfunction buildTemplateRefMap(\n sourceFile: ts.SourceFile,\n source: string,\n filePath: string,\n tree: Tree,\n): Map<string, string> {\n const refMap = new Map<string, string>();\n\n // Find @Component decorator\n const componentMeta = findComponentMetadata(sourceFile, source);\n if (!componentMeta) return refMap;\n\n let templateSource: string | null = null;\n\n if (componentMeta.inlineTemplate !== null) {\n templateSource = componentMeta.inlineTemplate;\n } else if (componentMeta.templateUrl) {\n // Resolve templateUrl relative to the TS file\n const dir = filePath.substring(0, filePath.lastIndexOf('/'));\n const templatePath = `${dir}/${componentMeta.templateUrl}`;\n const buffer = tree.read(templatePath);\n if (buffer) {\n templateSource = buffer.toString('utf-8');\n }\n }\n\n if (!templateSource) return refMap;\n\n // Parse the template and collect #refs\n try {\n const parsed = parseTemplate(templateSource, '', { preserveWhitespaces: true });\n collectTemplateRefs(parsed.nodes, refMap);\n } catch {\n // Template parse failure — silently skip (might be malformed or use third-party syntax)\n }\n\n return refMap;\n}\n\n/**\n * Extracts @Component metadata: templateUrl or inline template content.\n */\nfunction findComponentMetadata(\n sourceFile: ts.SourceFile,\n source: string,\n): { templateUrl: string | null; inlineTemplate: string | null } | null {\n let result: { templateUrl: string | null; inlineTemplate: string | null } | null = null;\n\n const visit = (node: ts.Node): void => {\n if (result) return;\n\n if (ts.isDecorator(node) && ts.isCallExpression(node.expression)) {\n const name = getDecoratorName(node.expression);\n if (name !== 'Component') {\n ts.forEachChild(node, visit);\n return;\n }\n\n const args = node.expression.arguments;\n if (args.length === 0 || !ts.isObjectLiteralExpression(args[0])) {\n ts.forEachChild(node, visit);\n return;\n }\n\n const meta: { templateUrl: string | null; inlineTemplate: string | null } = {\n templateUrl: null,\n inlineTemplate: null,\n };\n\n for (const prop of args[0].properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) continue;\n\n if (prop.name.text === 'templateUrl') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.templateUrl = init.text;\n }\n }\n\n if (prop.name.text === 'template') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.inlineTemplate = init.text;\n } else if (ts.isNoSubstitutionTemplateLiteral(init)) {\n meta.inlineTemplate = init.text;\n }\n }\n }\n\n result = meta;\n return;\n }\n\n ts.forEachChild(node, visit);\n };\n\n ts.forEachChild(sourceFile, visit);\n return result;\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\n/**\n * Recursively walks template AST nodes, collecting #refName → EUI class name mappings.\n *\n * For each element with a template reference (#ref), we try to resolve its EUI class:\n * 1. Match element tag name against EUI_SELECTOR_TO_CLASS (e.g. 'eui-alert' → EuiAlertComponent)\n * 2. Match element attributes against attribute selectors (e.g. [euiAutocomplete] → EuiAutocompleteComponent)\n */\nfunction collectTemplateRefs(nodes: TmplAstNode[], refMap: Map<string, string>): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.references && node.references.length > 0) {\n const euiClass = resolveElementToEuiClass(node);\n if (euiClass) {\n for (const ref of node.references) {\n refMap.set(ref.name, euiClass);\n }\n }\n }\n collectTemplateRefs(node.children, refMap);\n }\n }\n}\n\n/**\n * Given a template element, resolves it to an EUI class name by checking:\n * 1. Tag name: <eui-alert> → look up 'eui-alert' in EUI_SELECTOR_TO_CLASS\n * 2. Attribute selectors: <input euiAutocomplete> → look up 'input[euiAutocomplete]' or '[euiAutocomplete]'\n */\nfunction resolveElementToEuiClass(element: TmplAstElement): string | null {\n const tag = element.name;\n\n // Direct tag match: eui-alert, eui-dialog, etc.\n if (EUI_SELECTOR_TO_CLASS[tag]) {\n return EUI_SELECTOR_TO_CLASS[tag];\n }\n\n // Attribute selector match: check all attributes against known patterns\n const allAttrNames = [\n ...element.attributes.map((a) => a.name),\n ...element.inputs.map((i) => i.name),\n ];\n\n for (const attrName of allAttrNames) {\n // Try tag[attr] pattern first (e.g. 'button[euiButton]', 'input[euiAutocomplete]')\n const tagAttrSelector = `${tag}[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[tagAttrSelector]) {\n return EUI_SELECTOR_TO_CLASS[tagAttrSelector];\n }\n\n // Try [attr] pattern (e.g. '[euiTooltip]', '[euiLoading]')\n const attrSelector = `[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[attrSelector]) {\n return EUI_SELECTOR_TO_CLASS[attrSelector];\n }\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Edit helpers\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",
|
|
2587
|
+
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\nimport { EUI_SIGNAL_MAP as EUI_SIGNAL_MAP_RAW, EUI_SELECTOR_TO_CLASS as EUI_SELECTOR_TO_CLASS_RAW } from './signal-map';\nimport { ECL_SIGNAL_MAP, ECL_SELECTOR_TO_CLASS } from './ecl-signal-map';\n\n/**\n * Combined EUI + ECL signal maps. The migration logic is identical for both\n * libraries (plain field → signal getter), so the maps are merged and the rest\n * of the engine treats them uniformly. EUI and ECL class names don't collide\n * (Eui* vs Ecl* prefixes), and the selector namespaces are disjoint.\n */\nconst EUI_SIGNAL_MAP: Record<string, ReadonlySet<string>> = { ...EUI_SIGNAL_MAP_RAW, ...ECL_SIGNAL_MAP };\nconst EUI_SELECTOR_TO_CLASS: Record<string, string> = { ...EUI_SELECTOR_TO_CLASS_RAW, ...ECL_SELECTOR_TO_CLASS };\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\n/**\n * Migrates consumer code that accesses EUI or ECL component instances\n * programmatically.\n *\n * When EUI/ECL migrated @Input() → input(), @ViewChild() → viewChild(), and\n * @ContentChild() → contentChild(), properties that were plain class fields\n * became signal getters. Consumers who access them via @ViewChild need to\n * change `comp.prop` to `comp.prop()`.\n *\n * This schematic:\n * 1. Finds @ViewChild / @ContentChild fields typed as EUI component classes\n * 2. Resolves untyped @ViewChild('refName') by reading the component template\n * and matching #refName to an EUI element tag/selector\n * 3. Tracks which local variable names hold EUI component references (incl. aliases)\n * 4. Rewrites property accesses on those references: `ref.prop` → `ref.prop()`\n * (only for properties listed in the signal map)\n * 5. Does NOT touch template bindings — those are unaffected by signal migrations\n */\nexport function migrateToSignals(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n let propCount = 0;\n let todoCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n // Skip spec files — test code may use different patterns\n if (path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n // Fast bail: file must mention at least one EUI class name or have\n // ViewChild/ContentChild with string refs (which might reference EUI elements)\n if (!hasEuiReference(original) && !hasStringRefQuery(original)) return;\n\n const result = migrateTypeScript(original, path, tree, context); if (result.source !== original) {\n if (options.dryRun) {\n if (result.editCount > 0) {\n logDryRun(context, `Would migrate ${result.editCount} signal property access(es) in ${path}`);\n }\n if (result.todoCount > 0) {\n logDryRun(\n context,\n `Would comment out ${result.todoCount} programmatic signal-input write(s) with a TODO in ${path}`,\n );\n }\n } else {\n tree.overwrite(path, result.source);\n }\n fileCount++;\n propCount += result.editCount;\n todoCount += result.todoCount;\n }\n });\n\n context.logger.info(`Migrated ${propCount} property access(es) to signal getters in ${fileCount} file(s).`);\n if (todoCount > 0) {\n context.logger.info(\n `Commented out ${todoCount} programmatic signal-input write(s) and left a TODO — these cannot be migrated automatically and need a manual fix.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/** Quick check: does the file reference any EUI class name from the signal map? */\nfunction hasEuiReference(source: string): boolean {\n for (const className of Object.keys(EUI_SIGNAL_MAP)) {\n if (source.includes(className)) return true;\n }\n return false;\n}\n\n/** Quick check: does the file have @ViewChild('...') or @ContentChild('...') with string refs? */\nfunction hasStringRefQuery(source: string): boolean {\n return /(@ViewChild|@ContentChild|@ViewChildren|@ContentChildren)\\s*\\(\\s*['\"]/.test(source);\n}\n\ninterface MigrateResult {\n source: string;\n editCount: number;\n todoCount: number;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, tree: Tree, context: SchematicContext): MigrateResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n const todoEdits: Edit[] = [];\n\n // Phase 0: Build template ref map (#refName → EUI class name) from the component's template\n const templateRefMap = buildTemplateRefMap(sourceFile, source, filePath, tree);\n\n // Phase 1: Collect all variables/properties typed as EUI classes\n const euiRefs = collectEuiReferences(sourceFile, source, templateRefMap);\n\n if (euiRefs.size === 0) {\n return { source, editCount: 0, todoCount: 0 };\n }\n\n // Phase 2: Find property accesses on those references and rewrite signal props\n const visitNode = (node: ts.Node): void => {\n // Match: ref.prop (PropertyAccessExpression)\n if (ts.isPropertyAccessExpression(node)) {\n const rewrite = tryRewritePropertyAccess(node, euiRefs, sourceFile, source);\n if (rewrite) {\n edits.push(rewrite);\n }\n\n // Separately: a programmatic WRITE to a now-signal input cannot be\n // migrated automatically. Flag it with a TODO instead of silently\n // leaving a line that will fail to compile against the signal API.\n const todo = tryInsertWriteTodo(node, euiRefs, sourceFile, source);\n if (todo) {\n todoEdits.push(todo);\n }\n }\n ts.forEachChild(node, visitNode);\n };\n\n ts.forEachChild(sourceFile, visitNode);\n\n if (edits.length === 0 && todoEdits.length === 0) {\n return { source, editCount: 0, todoCount: 0 };\n }\n\n const dedupedTodos = deduplicateEdits(todoEdits);\n\n // A TODO edit comments out the whole write statement. Any read-rewrite `()`\n // edit whose position falls inside that commented-out range must be dropped,\n // otherwise we'd both edit and comment the same text (and produce overlapping\n // edits that corrupt the output).\n const keptEdits = edits.filter((edit) => !isInsideAnyRange(edit, dedupedTodos));\n\n return {\n source: applyEdits(source, [...keptEdits, ...dedupedTodos]),\n editCount: keptEdits.length,\n todoCount: dedupedTodos.length,\n };\n}\n\n/**\n * Scans the source file for class properties or variables typed as EUI component classes.\n * Returns a map: localName → Set of signal property names.\n *\n * Handles:\n * @ViewChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild(EuiXxxComponent) name!: EuiXxxComponent;\n * @ViewChild('ref') name: EuiXxxComponent;\n * @ContentChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild('ref') name: ElementRef; (resolved via template #ref → EUI selector)\n * someVar: EuiXxxComponent; (typed class field, even without decorator)\n * const alias = this.viewChildRef; (alias tracking)\n */\nfunction collectEuiReferences(\n sourceFile: ts.SourceFile,\n source: string,\n templateRefMap: Map<string, string>,\n): Map<string, ReadonlySet<string>> {\n const refs = new Map<string, ReadonlySet<string>>();\n\n // Pass 1: collect directly-typed references\n const visitDirect = (node: ts.Node): void => {\n // Class property declarations\n if (ts.isPropertyDeclaration(node) && node.name && ts.isIdentifier(node.name)) {\n const euiClass = resolveEuiClassName(node, sourceFile, templateRefMap);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[euiClass]);\n }\n }\n\n // Variable declarations (const x: EuiXxxComponent = ...)\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n // Parameter declarations (method(ref: EuiXxxComponent))\n if (ts.isParameter(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n ts.forEachChild(node, visitDirect);\n };\n\n ts.forEachChild(sourceFile, visitDirect);\n\n // Pass 2: track aliases — variables assigned from already-tracked references\n // e.g. const alias = this.viewChildRef; or const alias = someParam;\n const visitAlias = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n // Skip if already tracked (has explicit type annotation)\n if (refs.has(node.name.text)) {\n ts.forEachChild(node, visitAlias);\n return;\n }\n\n const aliasedRef = resolveRefName(node.initializer);\n if (aliasedRef && refs.has(aliasedRef)) {\n refs.set(node.name.text, refs.get(aliasedRef)!);\n }\n }\n\n ts.forEachChild(node, visitAlias);\n };\n\n ts.forEachChild(sourceFile, visitAlias);\n return refs;\n}\n\n/**\n * Resolves the EUI class name from a property declaration.\n * Checks: type annotation → decorator class argument → template ref map.\n */\nfunction resolveEuiClassName(\n node: ts.PropertyDeclaration,\n sourceFile: ts.SourceFile,\n templateRefMap: Map<string, string>,\n): string | null {\n // Check type annotation first\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n return typeName;\n }\n\n // Check generic type argument: ElementRef<EuiXxxComponent>\n if (node.type && ts.isTypeReferenceNode(node.type) && node.type.typeArguments?.length) {\n const genericArg = getTypeAnnotationName(node.type.typeArguments[0]);\n if (genericArg && EUI_SIGNAL_MAP[genericArg]) {\n return genericArg;\n }\n }\n\n // Check decorator arguments: @ViewChild(EuiXxxComponent) or @ViewChild('refName')\n if (node.modifiers) {\n for (const modifier of node.modifiers) {\n if (!ts.isDecorator(modifier)) continue;\n if (!ts.isCallExpression(modifier.expression)) continue;\n\n const decoratorName = getDecoratorName(modifier.expression);\n if (!decoratorName) continue;\n if (!['ViewChild', 'ViewChildren', 'ContentChild', 'ContentChildren'].includes(decoratorName)) continue;\n\n const args = modifier.expression.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n\n // @ViewChild(EuiXxxComponent) — class reference\n if (ts.isIdentifier(firstArg) && EUI_SIGNAL_MAP[firstArg.text]) {\n return firstArg.text;\n }\n\n // @ViewChild('refName') — string template ref, resolve via template\n if (ts.isStringLiteralLike(firstArg)) {\n const refName = firstArg.text;\n const euiClass = templateRefMap.get(refName);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n return euiClass;\n }\n }\n }\n }\n }\n\n return null;\n}\n\nfunction getDecoratorName(callExpr: ts.CallExpression): string | null {\n if (ts.isIdentifier(callExpr.expression)) {\n return callExpr.expression.text;\n }\n return null;\n}\n\nfunction getTypeAnnotationName(typeNode: ts.TypeNode | undefined): string | null {\n if (!typeNode) return null;\n if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) {\n return typeNode.typeName.text;\n }\n return null;\n}\n\n/**\n * Checks if a property access `ref.prop` should be rewritten to `ref.prop()`.\n *\n * We rewrite if:\n * - `ref` is tracked in euiRefs\n * - `prop` is in the signal set for that EUI class\n * - The access is NOT already a call expression (not `ref.prop()` or `ref.prop(args)`)\n * - The access is NOT a write target (not `ref.prop = value`)\n * - The access is NOT a template binding argument (those are unaffected)\n */\nfunction tryRewritePropertyAccess(\n node: ts.PropertyAccessExpression,\n euiRefs: Map<string, ReadonlySet<string>>,\n sourceFile: ts.SourceFile,\n source: string,\n): Edit | null {\n const propName = node.name.text;\n\n // Resolve the reference name — handle `this.ref.prop` and `ref.prop`\n const refName = resolveRefName(node.expression);\n if (!refName) return null;\n\n const signalProps = euiRefs.get(refName);\n if (!signalProps || !signalProps.has(propName)) return null;\n\n // Skip if parent is already a call expression on this property: ref.prop(...)\n if (ts.isCallExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if this is the left side of an assignment: ref.prop = value\n if (ts.isBinaryExpression(node.parent) &&\n node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&\n node.parent.left === node) {\n return null;\n }\n\n // Skip if this is a compound assignment: ref.prop += value, ref.prop &&= value, etc.\n if (ts.isBinaryExpression(node.parent) && isAssignmentOperator(node.parent.operatorToken.kind) && node.parent.left === node) {\n return null;\n }\n\n // Skip if this is used with delete: delete ref.prop\n if (ts.isDeleteExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if inside a typeof: typeof ref.prop\n if (ts.isTypeOfExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip property access chains that go deeper: ref.prop.something → ref.prop().something\n // This IS correct — we still want to add ()\n\n // Rewrite: insert () after the property name\n const end = node.name.getEnd();\n return {\n start: end,\n end: end,\n replacement: '()',\n };\n}\n\nfunction isAssignmentOperator(kind: ts.SyntaxKind): boolean {\n return kind >= ts.SyntaxKind.FirstAssignment && kind <= ts.SyntaxKind.LastAssignment;\n}\n\n/** Marker used to detect an already-inserted TODO so the schematic stays idempotent. */\nconst WRITE_TODO_MARKER = 'TODO(eui-signals):';\n\n/**\n * Detects a programmatic WRITE to a now-signal input and returns an edit that\n * comments out the offending statement and prepends an explanatory TODO.\n *\n * A signal input (`input()`) exposes a read-only getter — it cannot be assigned\n * from outside the component (`comp.prop = value` no longer compiles, and\n * `comp.prop()` is a getter, not a setter). There is no safe, mechanical\n * rewrite: the correct fix is to drive the value declaratively through a\n * template binding (`[prop]=\"...\"`) or, when a ComponentRef is genuinely\n * available, `componentRef.setInput('prop', value)`. Both require human\n * judgement, so instead of rewriting we comment the statement out (keeping the\n * build green) and leave a TODO pointing at the manual fix.\n *\n * Only acts when the assignment is the ENTIRE statement\n * (`ExpressionStatement` whose expression is exactly this assignment):\n * ref.prop = value (simple assignment)\n * ref.prop += value, etc. (compound assignment)\n * where `ref` is a tracked EUI/ECL reference and `prop` is in its signal set.\n *\n * When the write is only part of a larger statement (e.g. inside an `if`\n * without a block, or nested in another expression), commenting it out would\n * also remove unrelated logic, so we leave it untouched (it will surface as a\n * compile error the developer must resolve by hand).\n */\nfunction tryInsertWriteTodo(\n node: ts.PropertyAccessExpression,\n euiRefs: Map<string, ReadonlySet<string>>,\n sourceFile: ts.SourceFile,\n source: string,\n): Edit | null {\n const propName = node.name.text;\n\n const refName = resolveRefName(node.expression);\n if (!refName) return null;\n\n const signalProps = euiRefs.get(refName);\n if (!signalProps || !signalProps.has(propName)) return null;\n\n // Only act on assignment targets: `ref.prop = ...` or `ref.prop <op>= ...`\n if (\n !ts.isBinaryExpression(node.parent) ||\n node.parent.left !== node ||\n !isAssignmentOperator(node.parent.operatorToken.kind)\n ) {\n return null;\n }\n\n const assignment = node.parent;\n\n // Only comment out when the assignment IS the whole statement — otherwise we'd\n // delete unrelated logic from a larger statement.\n const statement = node.parent.parent;\n if (!statement || !ts.isExpressionStatement(statement) || statement.expression !== assignment) {\n return null;\n }\n\n // The statement must stand on its own (a direct child of a block/source), not\n // be the unbraced body of an `if`/`for`/`while` etc. — commenting those out by\n // line would swallow the surrounding `if (...)` and break the code.\n const parent = statement.parent;\n if (\n !parent ||\n !(ts.isBlock(parent) || ts.isSourceFile(parent) || ts.isModuleBlock(parent) || ts.isCaseClause(parent) || ts.isDefaultClause(parent))\n ) {\n return null;\n }\n\n const stmtStart = statement.getStart(sourceFile);\n const stmtEnd = statement.getEnd(); // includes the trailing semicolon\n const lineStart = getLineStartPosition(source, stmtStart);\n const indent = source.slice(lineStart, stmtStart);\n\n // The statement text, as written (may span multiple lines).\n const statementText = source.slice(stmtStart, stmtEnd);\n\n // Comment out every line of the statement, preserving each line's own\n // indentation (insert `// ` after the leading whitespace). The first line's\n // indentation was stripped by starting the replacement at lineStart, so we\n // re-add it explicitly.\n const commentedStatement = statementText\n .split('\\n')\n .map((line, i) => {\n if (i === 0) return `${indent}// ${line}`;\n const lineIndent = line.slice(0, line.length - line.trimStart().length);\n return `${lineIndent}// ${line.trimStart()}`;\n })\n .join('\\n');\n\n const todo =\n `${indent}// ${WRITE_TODO_MARKER} '${propName}' is now a signal input and cannot be assigned directly.\\n` +\n `${indent}// Set it via a template binding ([${propName}]=\"...\") or componentRef.setInput('${propName}', ...).\\n` +\n `${indent}// The original statement is commented out below so the build does not fail:\\n`;\n\n // Replace the statement (from the start of its line, to drop the original\n // indentation we re-add) with the TODO + commented-out statement.\n return {\n start: lineStart,\n end: stmtEnd,\n replacement: todo + commentedStatement,\n };\n}\n\n/** True if `edit`'s position falls within any of the given ranges. */\nfunction isInsideAnyRange(edit: Edit, ranges: Edit[]): boolean {\n return ranges.some((range) => edit.start >= range.start && edit.end <= range.end);\n}\n\n/** Returns the index of the first character of the line containing `pos`. */\nfunction getLineStartPosition(source: string, pos: number): number {\n const newlineIndex = source.lastIndexOf('\\n', pos - 1);\n return newlineIndex === -1 ? 0 : newlineIndex + 1;\n}\n\n/**\n * Resolves a reference name from an expression.\n * Handles: `ref`, `this.ref`, `this._ref`\n */\nfunction resolveRefName(expr: ts.Expression): string | null {\n // Direct identifier: ref.prop\n if (ts.isIdentifier(expr)) {\n return expr.text;\n }\n\n // this.ref.prop\n if (ts.isPropertyAccessExpression(expr) && expr.expression.kind === ts.SyntaxKind.ThisKeyword) {\n return expr.name.text;\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Template ref resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Builds a map of template reference variable names (#ref) to EUI class names.\n *\n * Parses the component's template (inline or external) and finds elements like:\n * <eui-alert #myAlert> → myAlert → EuiAlertComponent\n * <input euiAutocomplete #ac> → ac → EuiAutocompleteComponent\n *\n * Returns Map<refName, euiClassName>.\n */\nfunction buildTemplateRefMap(\n sourceFile: ts.SourceFile,\n source: string,\n filePath: string,\n tree: Tree,\n): Map<string, string> {\n const refMap = new Map<string, string>();\n\n // Find @Component decorator\n const componentMeta = findComponentMetadata(sourceFile, source);\n if (!componentMeta) return refMap;\n\n let templateSource: string | null = null;\n\n if (componentMeta.inlineTemplate !== null) {\n templateSource = componentMeta.inlineTemplate;\n } else if (componentMeta.templateUrl) {\n // Resolve templateUrl relative to the TS file\n const dir = filePath.substring(0, filePath.lastIndexOf('/'));\n const templatePath = `${dir}/${componentMeta.templateUrl}`;\n const buffer = tree.read(templatePath);\n if (buffer) {\n templateSource = buffer.toString('utf-8');\n }\n }\n\n if (!templateSource) return refMap;\n\n // Parse the template and collect #refs\n try {\n const parsed = parseTemplate(templateSource, '', { preserveWhitespaces: true });\n collectTemplateRefs(parsed.nodes, refMap);\n } catch {\n // Template parse failure — silently skip (might be malformed or use third-party syntax)\n }\n\n return refMap;\n}\n\n/**\n * Extracts @Component metadata: templateUrl or inline template content.\n */\nfunction findComponentMetadata(\n sourceFile: ts.SourceFile,\n source: string,\n): { templateUrl: string | null; inlineTemplate: string | null } | null {\n let result: { templateUrl: string | null; inlineTemplate: string | null } | null = null;\n\n const visit = (node: ts.Node): void => {\n if (result) return;\n\n if (ts.isDecorator(node) && ts.isCallExpression(node.expression)) {\n const name = getDecoratorName(node.expression);\n if (name !== 'Component') {\n ts.forEachChild(node, visit);\n return;\n }\n\n const args = node.expression.arguments;\n if (args.length === 0 || !ts.isObjectLiteralExpression(args[0])) {\n ts.forEachChild(node, visit);\n return;\n }\n\n const meta: { templateUrl: string | null; inlineTemplate: string | null } = {\n templateUrl: null,\n inlineTemplate: null,\n };\n\n for (const prop of args[0].properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) continue;\n\n if (prop.name.text === 'templateUrl') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.templateUrl = init.text;\n }\n }\n\n if (prop.name.text === 'template') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.inlineTemplate = init.text;\n } else if (ts.isNoSubstitutionTemplateLiteral(init)) {\n meta.inlineTemplate = init.text;\n }\n }\n }\n\n result = meta;\n return;\n }\n\n ts.forEachChild(node, visit);\n };\n\n ts.forEachChild(sourceFile, visit);\n return result;\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\n/**\n * Recursively walks template AST nodes, collecting #refName → EUI class name mappings.\n *\n * For each element with a template reference (#ref), we try to resolve its EUI class:\n * 1. Match element tag name against EUI_SELECTOR_TO_CLASS (e.g. 'eui-alert' → EuiAlertComponent)\n * 2. Match element attributes against attribute selectors (e.g. [euiAutocomplete] → EuiAutocompleteComponent)\n */\nfunction collectTemplateRefs(nodes: TmplAstNode[], refMap: Map<string, string>): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.references && node.references.length > 0) {\n const euiClass = resolveElementToEuiClass(node);\n if (euiClass) {\n for (const ref of node.references) {\n refMap.set(ref.name, euiClass);\n }\n }\n }\n collectTemplateRefs(node.children, refMap);\n }\n }\n}\n\n/**\n * Given a template element, resolves it to an EUI class name by checking:\n * 1. Tag name: <eui-alert> → look up 'eui-alert' in EUI_SELECTOR_TO_CLASS\n * 2. Attribute selectors: <input euiAutocomplete> → look up 'input[euiAutocomplete]' or '[euiAutocomplete]'\n */\nfunction resolveElementToEuiClass(element: TmplAstElement): string | null {\n const tag = element.name;\n\n // Direct tag match: eui-alert, eui-dialog, etc.\n if (EUI_SELECTOR_TO_CLASS[tag]) {\n return EUI_SELECTOR_TO_CLASS[tag];\n }\n\n // Attribute selector match: check all attributes against known patterns\n const allAttrNames = [\n ...element.attributes.map((a) => a.name),\n ...element.inputs.map((i) => i.name),\n ];\n\n for (const attrName of allAttrNames) {\n // Try tag[attr] pattern first (e.g. 'button[euiButton]', 'input[euiAutocomplete]')\n const tagAttrSelector = `${tag}[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[tagAttrSelector]) {\n return EUI_SELECTOR_TO_CLASS[tagAttrSelector];\n }\n\n // Try [attr] pattern (e.g. '[euiTooltip]', '[euiLoading]')\n const attrSelector = `[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[attrSelector]) {\n return EUI_SELECTOR_TO_CLASS[attrSelector];\n }\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Edit helpers\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",
|
|
2530
2588
|
"displayName": "MigrateResult",
|
|
2531
2589
|
"properties": [
|
|
2532
2590
|
{
|
|
@@ -2538,7 +2596,7 @@
|
|
|
2538
2596
|
"indexKey": "",
|
|
2539
2597
|
"optional": false,
|
|
2540
2598
|
"description": "",
|
|
2541
|
-
"line":
|
|
2599
|
+
"line": 115,
|
|
2542
2600
|
"rawdescription": "\n"
|
|
2543
2601
|
},
|
|
2544
2602
|
{
|
|
@@ -2550,7 +2608,19 @@
|
|
|
2550
2608
|
"indexKey": "",
|
|
2551
2609
|
"optional": false,
|
|
2552
2610
|
"description": "",
|
|
2553
|
-
"line":
|
|
2611
|
+
"line": 114,
|
|
2612
|
+
"rawdescription": "\n"
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
"name": "todoCount",
|
|
2616
|
+
"coverageIgnore": false,
|
|
2617
|
+
"deprecated": false,
|
|
2618
|
+
"deprecationMessage": "",
|
|
2619
|
+
"type": "number",
|
|
2620
|
+
"indexKey": "",
|
|
2621
|
+
"optional": false,
|
|
2622
|
+
"description": "",
|
|
2623
|
+
"line": 116,
|
|
2554
2624
|
"rawdescription": "\n"
|
|
2555
2625
|
}
|
|
2556
2626
|
],
|
|
@@ -2835,12 +2905,12 @@
|
|
|
2835
2905
|
},
|
|
2836
2906
|
{
|
|
2837
2907
|
"name": "RemovedAttr",
|
|
2838
|
-
"id": "interface-RemovedAttr-
|
|
2908
|
+
"id": "interface-RemovedAttr-0802af7de093a6df989cd8f4bc7da55cd9729f34d4642b7f5d9eae9f9a14cae4d644922a9d7ece99ba5b1c23696d54d83436ff79a54a50c37ade3ebbf0cbf92a",
|
|
2839
2909
|
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
2840
2910
|
"deprecated": false,
|
|
2841
2911
|
"deprecationMessage": "",
|
|
2842
2912
|
"type": "interface",
|
|
2843
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRunNote } from '../utils/dry-run';\n\n/**\n * Detects usages of ECL members removed in v22 that cannot be migrated\n * automatically, and reports a precise manual-action warning for each.\n *\n * This schematic makes **no edits** — it only scans and warns. The removed\n * members either have no replacement, or require a DOM-structure / semantic\n * change that must be made by a developer:\n *\n * - `EclDatePickerDirective` (`input[eclDatePicker]`): removed. Use\n * `EclDatePickerDuetDirective` on a `<duet-date-picker eclDatePicker>`\n * element instead of `<input eclDatePicker>`. Also flags imports of the\n * removed `EUI_ECL_DATE_PICKER` array / `EclDatePickerDirective` class.\n * - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`): removed\n * entirely, no replacement.\n * - `EclPageHeaderNextComponent`: removed, no longer exported.\n * - `EclRadioHelpComponent` (`[eclRadioHelp]`): removed. Use `[eclHelpBlock]`\n * (`EclHelpBlockDirective` from `@eui/ecl/components/ecl-help-block`).\n *\n * Because it is warn-only, dry-run and real runs behave identically.\n */\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\n/** A removed element tag (e.g. `<ecl-site-header-banner-top>`). */\ninterface RemovedTag {\n tag: string;\n message: string;\n}\n\n/** A removed attribute directive (e.g. `[eclRadioHelp]`). */\ninterface RemovedAttr {\n attr: string;\n /** If set, only flag when the attribute appears on this host tag. */\n onTag?: string;\n message: string;\n}\n\n/** A removed TypeScript identifier (class / token name). */\ninterface RemovedIdentifier {\n name: string;\n message: string;\n}\n\nconst REMOVED_TAGS: readonly RemovedTag[] = [\n {\n tag: 'ecl-site-header-banner-top',\n message:\n '<ecl-site-header-banner-top> (EclSiteHeaderBannerTopComponent) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n];\n\nconst REMOVED_ATTRS: readonly RemovedAttr[] = [\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n '\"input[eclDatePicker]\" (EclDatePickerDirective) was removed in v22. Use \"duet-date-picker[eclDatePicker]\" (EclDatePickerDuetDirective) instead: mount a <duet-date-picker eclDatePicker> element. yearRange/format/firstDayOfWeek are now configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n '\"[eclRadioHelp]\" (EclRadioHelpComponent) was removed in v22. Use \"[eclHelpBlock]\" (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n];\n\nconst REMOVED_IDENTIFIERS: readonly RemovedIdentifier[] = [\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective. Import EclDatePickerDuetDirective from @eui/ecl/components/ecl-date-picker and use <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n];\n\n// Fast pre-check tokens — if none appear in a file, skip parsing it.\nconst TRIGGER_TOKENS = [\n ...REMOVED_TAGS.map((t) => t.tag),\n ...REMOVED_ATTRS.map((a) => a.attr),\n ...REMOVED_IDENTIFIERS.map((i) => i.name),\n];\n\nexport function migrateEclRemovedComponents(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let warningCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!TRIGGER_TOKENS.some((t) => source.includes(t))) return;\n\n if (path.endsWith('.html')) {\n warningCount += scanTemplate(source, source, 0, path, context);\n } else {\n warningCount += scanTypeScript(source, path, context);\n }\n });\n\n if (warningCount === 0) {\n context.logger.info('No usages of removed ECL components found.');\n } else {\n context.logger.info(\n `Found ${warningCount} usage(s) of removed ECL components. Review the warnings above and migrate manually.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/**\n * Scans a template string for removed tags/attributes.\n * `lineOffset` shifts reported line numbers so inline templates report the line\n * within the host .ts file.\n */\nfunction scanTemplate(\n template: string,\n _fileSource: string,\n lineOffset: number,\n path: string,\n context: SchematicContext,\n): number {\n let parsed;\n try {\n parsed = parseTemplate(template, '', { preserveWhitespaces: true });\n } catch {\n return 0;\n }\n\n let count = 0;\n const visit = (nodes: TmplAstNode[]): void => {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n count += checkElement(node, lineOffset, path, context);\n visit(node.children);\n }\n }\n };\n visit(parsed.nodes);\n return count;\n}\n\nfunction checkElement(element: TmplAstElement, lineOffset: number, path: string, context: SchematicContext): number {\n let count = 0;\n const line = element.startSourceSpan.start.line + 1 + lineOffset;\n\n const removedTag = REMOVED_TAGS.find((t) => t.tag === element.name);\n if (removedTag) {\n context.logger.warn(`${path}:${line} - ${removedTag.message}`);\n count++;\n }\n\n for (const removed of REMOVED_ATTRS) {\n const hasAttr =\n element.attributes.some((a) => a.name === removed.attr) || element.inputs.some((i) => i.name === removed.attr);\n if (!hasAttr) continue;\n if (removed.onTag && element.name !== removed.onTag) continue;\n context.logger.warn(`${path}:${line} - ${removed.message}`);\n count++;\n }\n\n return count;\n}\n\nfunction scanTypeScript(source: string, path: string, context: SchematicContext): number {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n let count = 0;\n\n // 1. Inline templates — reuse the template scanner with a line offset.\n const visitForTemplates = (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 raw = init.getText(sourceFile).slice(1, -1); // strip quotes/backticks\n if (TRIGGER_TOKENS.some((t) => raw.includes(t))) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(init.getStart(sourceFile));\n count += scanTemplate(raw, source, line, path, context);\n }\n }\n }\n ts.forEachChild(node, visitForTemplates);\n };\n visitForTemplates(sourceFile);\n\n // 2. Identifier usages (imports, type references, array entries, etc.).\n const reportedLines = new Set<string>();\n const visitForIdentifiers = (node: ts.Node): void => {\n if (ts.isIdentifier(node)) {\n const removed = REMOVED_IDENTIFIERS.find((r) => r.name === node.text);\n if (removed) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n // De-duplicate multiple references to the same identifier on the same line.\n const key = `${removed.name}:${line}`;\n if (!reportedLines.has(key)) {\n reportedLines.add(key);\n context.logger.warn(`${path}:${line + 1} - ${removed.message}`);\n count++;\n }\n }\n }\n ts.forEachChild(node, visitForIdentifiers);\n };\n visitForIdentifiers(sourceFile);\n\n return count;\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 (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\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 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",
|
|
2913
|
+
"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\n/**\n * Flags usages of ECL members removed in v22 that have no automatic drop-in\n * replacement.\n *\n * For each usage it:\n * 1. Logs a precise manual-action warning.\n * 2. Inserts a `TODO: [eUI v22 migration] ...` comment on the line above the\n * usage so it is easy to locate in the editor.\n *\n * It makes **no other edits** — it never comments out, deletes, or rewrites the\n * user's code. These removed members require a developer decision (they are\n * components/directives with different APIs, or have no replacement), so the\n * schematic only points at what needs attention and leaves the change to the\n * developer. Searching a project for `TODO: [eUI v22 migration]` after the run\n * surfaces every spot to migrate.\n *\n * Removed members handled:\n * - `EclDatePickerDirective` (`input[eclDatePicker]`) → `EclDatePickerDuetDirective`\n * on `<duet-date-picker eclDatePicker>`.\n * - `EUI_ECL_DATE_PICKER` — still exported (now provides the Duet directive);\n * only the markup needs updating.\n * - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`) → removed, no replacement.\n * - `EclPageHeaderNextComponent` → removed, no longer exported.\n * - `EclRadioHelpComponent` (`[eclRadioHelp]`) → `[eclHelpBlock]` (`EclHelpBlockDirective`).\n */\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst TODO_PREFIX = 'TODO: [eUI v22 migration]';\n\ninterface RemovedTag {\n tag: string;\n message: string;\n}\n\ninterface RemovedAttr {\n attr: string;\n onTag?: string;\n message: string;\n}\n\ninterface RemovedIdentifier {\n name: string;\n message: string;\n}\n\nconst REMOVED_TAGS: readonly RemovedTag[] = [\n {\n tag: 'ecl-site-header-banner-top',\n message:\n 'EclSiteHeaderBannerTopComponent (<ecl-site-header-banner-top>) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n];\n\nconst REMOVED_ATTRS: readonly RemovedAttr[] = [\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n 'EclDatePickerDirective (input[eclDatePicker]) was removed in v22. Use EclDatePickerDuetDirective on a <duet-date-picker eclDatePicker> element; yearRange/format/firstDayOfWeek are configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n 'EclRadioHelpComponent ([eclRadioHelp]) was removed in v22. Use [eclHelpBlock] (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n];\n\nconst REMOVED_IDENTIFIERS: readonly RemovedIdentifier[] = [\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective (it now provides EclDatePickerDuetDirective). The import still works; update your markup from <input eclDatePicker> to <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n];\n\n// Fast pre-check tokens — if none appear in a file, skip parsing it.\nconst TRIGGER_TOKENS = [\n ...REMOVED_TAGS.map((t) => t.tag),\n ...REMOVED_ATTRS.map((a) => a.attr),\n ...REMOVED_IDENTIFIERS.map((i) => i.name),\n];\n\n/** A TODO comment to insert above a given zero-based line. */\ninterface Annotation {\n line: number;\n commentStyle: 'ts' | 'html';\n message: string;\n}\n\nexport function migrateEclRemovedComponents(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let warningCount = 0;\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!TRIGGER_TOKENS.some((t) => source.includes(t))) return;\n\n const annotations = path.endsWith('.html')\n ? collectTemplateAnnotations(source, 0, 'html')\n : collectTypeScriptAnnotations(source, path);\n\n if (annotations.length === 0) return;\n\n for (const a of annotations) {\n context.logger.warn(`${path}:${a.line + 1} - ${a.message}`);\n warningCount++;\n }\n\n const result = applyAnnotations(source, annotations);\n if (result !== source) {\n if (options.dryRun) {\n logDryRun(context, `Would annotate removed ECL usage(s) with TODO comments in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n if (warningCount === 0) {\n context.logger.info('No usages of removed ECL components found.');\n } else {\n context.logger.info(\n `Found ${warningCount} usage(s) of removed ECL components in ${fileCount} file(s). Search for \"${TODO_PREFIX}\" and migrate them manually.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Templates\n// ---------------------------------------------------------------------------\n\nfunction collectTemplateAnnotations(template: string, lineOffset: number, commentStyle: 'html' | 'ts'): Annotation[] {\n let parsed;\n try {\n parsed = parseTemplate(template, '', { preserveWhitespaces: true });\n } catch {\n return [];\n }\n\n const annotations: Annotation[] = [];\n const visit = (nodes: TmplAstNode[]): void => {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n collectElementAnnotation(node, lineOffset, commentStyle, annotations);\n visit(node.children);\n }\n }\n };\n visit(parsed.nodes);\n return annotations;\n}\n\nfunction collectElementAnnotation(\n element: TmplAstElement,\n lineOffset: number,\n commentStyle: 'html' | 'ts',\n annotations: Annotation[],\n): void {\n const line = element.startSourceSpan.start.line + lineOffset;\n\n const removedTag = REMOVED_TAGS.find((t) => t.tag === element.name);\n if (removedTag) {\n annotations.push({ line, commentStyle, message: removedTag.message });\n }\n\n for (const removed of REMOVED_ATTRS) {\n const hasAttr =\n element.attributes.some((a) => a.name === removed.attr) || element.inputs.some((i) => i.name === removed.attr);\n if (!hasAttr) continue;\n if (removed.onTag && element.name !== removed.onTag) continue;\n annotations.push({ line, commentStyle, message: removed.message });\n }\n}\n\n// ---------------------------------------------------------------------------\n// TypeScript\n// ---------------------------------------------------------------------------\n\nfunction collectTypeScriptAnnotations(source: string, path: string): Annotation[] {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const annotations: Annotation[] = [];\n\n // 1. Inline templates — annotate with a `//` comment on the line of the\n // `template` property (inserting an HTML comment inside the template\n // literal is fragile across single/multi-line forms, so we place a TS\n // comment above the property instead).\n const visitForTemplates = (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 raw = init.getText(sourceFile).slice(1, -1);\n const inlineMessages = collectTemplateAnnotations(raw, 0, 'html').map((a) => a.message);\n if (inlineMessages.length > 0) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n annotations.push({ line, commentStyle: 'ts', message: [...new Set(inlineMessages)].join(' ') });\n }\n }\n }\n ts.forEachChild(node, visitForTemplates);\n };\n visitForTemplates(sourceFile);\n\n // 2. Identifier usages (imports, type references, array entries, etc.).\n // One annotation per affected line; merge messages for multiple symbols.\n const perLine = new Map<number, Set<string>>();\n const visitForIdentifiers = (node: ts.Node): void => {\n if (ts.isIdentifier(node)) {\n const removed = REMOVED_IDENTIFIERS.find((r) => r.name === node.text);\n if (removed) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n const set = perLine.get(line) ?? new Set<string>();\n set.add(removed.message);\n perLine.set(line, set);\n }\n }\n ts.forEachChild(node, visitForIdentifiers);\n };\n visitForIdentifiers(sourceFile);\n\n for (const [line, messages] of perLine) {\n annotations.push({ line, commentStyle: 'ts', message: [...messages].join(' ') });\n }\n\n return annotations;\n}\n\n// ---------------------------------------------------------------------------\n// Annotation application\n// ---------------------------------------------------------------------------\n\nfunction applyAnnotations(source: string, annotations: Annotation[]): string {\n if (annotations.length === 0) return source;\n\n const eol = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const lines = source.split(/\\r?\\n/);\n\n // One annotation per line (merge messages if several target the same line).\n const byLine = new Map<number, Annotation>();\n for (const a of annotations) {\n const existing = byLine.get(a.line);\n if (!existing) {\n byLine.set(a.line, { ...a });\n } else if (!existing.message.includes(a.message)) {\n existing.message = `${existing.message} ${a.message}`;\n }\n }\n\n // Skip lines whose preceding line already carries this TODO (idempotency).\n // Apply bottom-up so inserted lines don't shift later targets.\n const sorted = [...byLine.values()].sort((a, b) => b.line - a.line);\n\n for (const a of sorted) {\n if (a.line < 0 || a.line >= lines.length) continue;\n\n const indent = (lines[a.line].match(/^(\\s*)/)?.[1]) ?? '';\n const todo =\n a.commentStyle === 'html'\n ? `${indent}<!-- ${TODO_PREFIX} ${a.message} -->`\n : `${indent}// ${TODO_PREFIX} ${a.message}`;\n\n // Idempotency guard: if the line above already is this exact TODO, skip.\n const prev = a.line > 0 ? lines[a.line - 1] : '';\n if (prev.trim() === todo.trim()) continue;\n\n lines.splice(a.line, 0, todo);\n }\n\n return lines.join(eol);\n}\n\n// ---------------------------------------------------------------------------\n// Shared\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 (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\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 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",
|
|
2844
2914
|
"displayName": "RemovedAttr",
|
|
2845
2915
|
"properties": [
|
|
2846
2916
|
{
|
|
@@ -2852,7 +2922,7 @@
|
|
|
2852
2922
|
"indexKey": "",
|
|
2853
2923
|
"optional": false,
|
|
2854
2924
|
"description": "",
|
|
2855
|
-
"line":
|
|
2925
|
+
"line": 45,
|
|
2856
2926
|
"rawdescription": "\n"
|
|
2857
2927
|
},
|
|
2858
2928
|
{
|
|
@@ -2864,7 +2934,7 @@
|
|
|
2864
2934
|
"indexKey": "",
|
|
2865
2935
|
"optional": false,
|
|
2866
2936
|
"description": "",
|
|
2867
|
-
"line":
|
|
2937
|
+
"line": 47,
|
|
2868
2938
|
"rawdescription": "\n"
|
|
2869
2939
|
},
|
|
2870
2940
|
{
|
|
@@ -2875,15 +2945,13 @@
|
|
|
2875
2945
|
"type": "string",
|
|
2876
2946
|
"indexKey": "",
|
|
2877
2947
|
"optional": true,
|
|
2878
|
-
"description": "
|
|
2879
|
-
"line":
|
|
2880
|
-
"rawdescription": "\
|
|
2948
|
+
"description": "",
|
|
2949
|
+
"line": 46,
|
|
2950
|
+
"rawdescription": "\n"
|
|
2881
2951
|
}
|
|
2882
2952
|
],
|
|
2883
2953
|
"indexSignatures": [],
|
|
2884
2954
|
"kind": 172,
|
|
2885
|
-
"description": "<p>A removed attribute directive (e.g. <code>[eclRadioHelp]</code>).</p>\n",
|
|
2886
|
-
"rawdescription": "\nA removed attribute directive (e.g. `[eclRadioHelp]`).",
|
|
2887
2955
|
"methods": [],
|
|
2888
2956
|
"extends": [],
|
|
2889
2957
|
"relationships": {
|
|
@@ -2893,12 +2961,12 @@
|
|
|
2893
2961
|
},
|
|
2894
2962
|
{
|
|
2895
2963
|
"name": "RemovedIdentifier",
|
|
2896
|
-
"id": "interface-RemovedIdentifier-
|
|
2964
|
+
"id": "interface-RemovedIdentifier-0802af7de093a6df989cd8f4bc7da55cd9729f34d4642b7f5d9eae9f9a14cae4d644922a9d7ece99ba5b1c23696d54d83436ff79a54a50c37ade3ebbf0cbf92a",
|
|
2897
2965
|
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
2898
2966
|
"deprecated": false,
|
|
2899
2967
|
"deprecationMessage": "",
|
|
2900
2968
|
"type": "interface",
|
|
2901
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRunNote } from '../utils/dry-run';\n\n/**\n * Detects usages of ECL members removed in v22 that cannot be migrated\n * automatically, and reports a precise manual-action warning for each.\n *\n * This schematic makes **no edits** — it only scans and warns. The removed\n * members either have no replacement, or require a DOM-structure / semantic\n * change that must be made by a developer:\n *\n * - `EclDatePickerDirective` (`input[eclDatePicker]`): removed. Use\n * `EclDatePickerDuetDirective` on a `<duet-date-picker eclDatePicker>`\n * element instead of `<input eclDatePicker>`. Also flags imports of the\n * removed `EUI_ECL_DATE_PICKER` array / `EclDatePickerDirective` class.\n * - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`): removed\n * entirely, no replacement.\n * - `EclPageHeaderNextComponent`: removed, no longer exported.\n * - `EclRadioHelpComponent` (`[eclRadioHelp]`): removed. Use `[eclHelpBlock]`\n * (`EclHelpBlockDirective` from `@eui/ecl/components/ecl-help-block`).\n *\n * Because it is warn-only, dry-run and real runs behave identically.\n */\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\n/** A removed element tag (e.g. `<ecl-site-header-banner-top>`). */\ninterface RemovedTag {\n tag: string;\n message: string;\n}\n\n/** A removed attribute directive (e.g. `[eclRadioHelp]`). */\ninterface RemovedAttr {\n attr: string;\n /** If set, only flag when the attribute appears on this host tag. */\n onTag?: string;\n message: string;\n}\n\n/** A removed TypeScript identifier (class / token name). */\ninterface RemovedIdentifier {\n name: string;\n message: string;\n}\n\nconst REMOVED_TAGS: readonly RemovedTag[] = [\n {\n tag: 'ecl-site-header-banner-top',\n message:\n '<ecl-site-header-banner-top> (EclSiteHeaderBannerTopComponent) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n];\n\nconst REMOVED_ATTRS: readonly RemovedAttr[] = [\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n '\"input[eclDatePicker]\" (EclDatePickerDirective) was removed in v22. Use \"duet-date-picker[eclDatePicker]\" (EclDatePickerDuetDirective) instead: mount a <duet-date-picker eclDatePicker> element. yearRange/format/firstDayOfWeek are now configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n '\"[eclRadioHelp]\" (EclRadioHelpComponent) was removed in v22. Use \"[eclHelpBlock]\" (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n];\n\nconst REMOVED_IDENTIFIERS: readonly RemovedIdentifier[] = [\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective. Import EclDatePickerDuetDirective from @eui/ecl/components/ecl-date-picker and use <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n];\n\n// Fast pre-check tokens — if none appear in a file, skip parsing it.\nconst TRIGGER_TOKENS = [\n ...REMOVED_TAGS.map((t) => t.tag),\n ...REMOVED_ATTRS.map((a) => a.attr),\n ...REMOVED_IDENTIFIERS.map((i) => i.name),\n];\n\nexport function migrateEclRemovedComponents(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let warningCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!TRIGGER_TOKENS.some((t) => source.includes(t))) return;\n\n if (path.endsWith('.html')) {\n warningCount += scanTemplate(source, source, 0, path, context);\n } else {\n warningCount += scanTypeScript(source, path, context);\n }\n });\n\n if (warningCount === 0) {\n context.logger.info('No usages of removed ECL components found.');\n } else {\n context.logger.info(\n `Found ${warningCount} usage(s) of removed ECL components. Review the warnings above and migrate manually.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/**\n * Scans a template string for removed tags/attributes.\n * `lineOffset` shifts reported line numbers so inline templates report the line\n * within the host .ts file.\n */\nfunction scanTemplate(\n template: string,\n _fileSource: string,\n lineOffset: number,\n path: string,\n context: SchematicContext,\n): number {\n let parsed;\n try {\n parsed = parseTemplate(template, '', { preserveWhitespaces: true });\n } catch {\n return 0;\n }\n\n let count = 0;\n const visit = (nodes: TmplAstNode[]): void => {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n count += checkElement(node, lineOffset, path, context);\n visit(node.children);\n }\n }\n };\n visit(parsed.nodes);\n return count;\n}\n\nfunction checkElement(element: TmplAstElement, lineOffset: number, path: string, context: SchematicContext): number {\n let count = 0;\n const line = element.startSourceSpan.start.line + 1 + lineOffset;\n\n const removedTag = REMOVED_TAGS.find((t) => t.tag === element.name);\n if (removedTag) {\n context.logger.warn(`${path}:${line} - ${removedTag.message}`);\n count++;\n }\n\n for (const removed of REMOVED_ATTRS) {\n const hasAttr =\n element.attributes.some((a) => a.name === removed.attr) || element.inputs.some((i) => i.name === removed.attr);\n if (!hasAttr) continue;\n if (removed.onTag && element.name !== removed.onTag) continue;\n context.logger.warn(`${path}:${line} - ${removed.message}`);\n count++;\n }\n\n return count;\n}\n\nfunction scanTypeScript(source: string, path: string, context: SchematicContext): number {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n let count = 0;\n\n // 1. Inline templates — reuse the template scanner with a line offset.\n const visitForTemplates = (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 raw = init.getText(sourceFile).slice(1, -1); // strip quotes/backticks\n if (TRIGGER_TOKENS.some((t) => raw.includes(t))) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(init.getStart(sourceFile));\n count += scanTemplate(raw, source, line, path, context);\n }\n }\n }\n ts.forEachChild(node, visitForTemplates);\n };\n visitForTemplates(sourceFile);\n\n // 2. Identifier usages (imports, type references, array entries, etc.).\n const reportedLines = new Set<string>();\n const visitForIdentifiers = (node: ts.Node): void => {\n if (ts.isIdentifier(node)) {\n const removed = REMOVED_IDENTIFIERS.find((r) => r.name === node.text);\n if (removed) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n // De-duplicate multiple references to the same identifier on the same line.\n const key = `${removed.name}:${line}`;\n if (!reportedLines.has(key)) {\n reportedLines.add(key);\n context.logger.warn(`${path}:${line + 1} - ${removed.message}`);\n count++;\n }\n }\n }\n ts.forEachChild(node, visitForIdentifiers);\n };\n visitForIdentifiers(sourceFile);\n\n return count;\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 (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\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 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",
|
|
2969
|
+
"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\n/**\n * Flags usages of ECL members removed in v22 that have no automatic drop-in\n * replacement.\n *\n * For each usage it:\n * 1. Logs a precise manual-action warning.\n * 2. Inserts a `TODO: [eUI v22 migration] ...` comment on the line above the\n * usage so it is easy to locate in the editor.\n *\n * It makes **no other edits** — it never comments out, deletes, or rewrites the\n * user's code. These removed members require a developer decision (they are\n * components/directives with different APIs, or have no replacement), so the\n * schematic only points at what needs attention and leaves the change to the\n * developer. Searching a project for `TODO: [eUI v22 migration]` after the run\n * surfaces every spot to migrate.\n *\n * Removed members handled:\n * - `EclDatePickerDirective` (`input[eclDatePicker]`) → `EclDatePickerDuetDirective`\n * on `<duet-date-picker eclDatePicker>`.\n * - `EUI_ECL_DATE_PICKER` — still exported (now provides the Duet directive);\n * only the markup needs updating.\n * - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`) → removed, no replacement.\n * - `EclPageHeaderNextComponent` → removed, no longer exported.\n * - `EclRadioHelpComponent` (`[eclRadioHelp]`) → `[eclHelpBlock]` (`EclHelpBlockDirective`).\n */\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst TODO_PREFIX = 'TODO: [eUI v22 migration]';\n\ninterface RemovedTag {\n tag: string;\n message: string;\n}\n\ninterface RemovedAttr {\n attr: string;\n onTag?: string;\n message: string;\n}\n\ninterface RemovedIdentifier {\n name: string;\n message: string;\n}\n\nconst REMOVED_TAGS: readonly RemovedTag[] = [\n {\n tag: 'ecl-site-header-banner-top',\n message:\n 'EclSiteHeaderBannerTopComponent (<ecl-site-header-banner-top>) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n];\n\nconst REMOVED_ATTRS: readonly RemovedAttr[] = [\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n 'EclDatePickerDirective (input[eclDatePicker]) was removed in v22. Use EclDatePickerDuetDirective on a <duet-date-picker eclDatePicker> element; yearRange/format/firstDayOfWeek are configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n 'EclRadioHelpComponent ([eclRadioHelp]) was removed in v22. Use [eclHelpBlock] (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n];\n\nconst REMOVED_IDENTIFIERS: readonly RemovedIdentifier[] = [\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective (it now provides EclDatePickerDuetDirective). The import still works; update your markup from <input eclDatePicker> to <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n];\n\n// Fast pre-check tokens — if none appear in a file, skip parsing it.\nconst TRIGGER_TOKENS = [\n ...REMOVED_TAGS.map((t) => t.tag),\n ...REMOVED_ATTRS.map((a) => a.attr),\n ...REMOVED_IDENTIFIERS.map((i) => i.name),\n];\n\n/** A TODO comment to insert above a given zero-based line. */\ninterface Annotation {\n line: number;\n commentStyle: 'ts' | 'html';\n message: string;\n}\n\nexport function migrateEclRemovedComponents(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let warningCount = 0;\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!TRIGGER_TOKENS.some((t) => source.includes(t))) return;\n\n const annotations = path.endsWith('.html')\n ? collectTemplateAnnotations(source, 0, 'html')\n : collectTypeScriptAnnotations(source, path);\n\n if (annotations.length === 0) return;\n\n for (const a of annotations) {\n context.logger.warn(`${path}:${a.line + 1} - ${a.message}`);\n warningCount++;\n }\n\n const result = applyAnnotations(source, annotations);\n if (result !== source) {\n if (options.dryRun) {\n logDryRun(context, `Would annotate removed ECL usage(s) with TODO comments in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n if (warningCount === 0) {\n context.logger.info('No usages of removed ECL components found.');\n } else {\n context.logger.info(\n `Found ${warningCount} usage(s) of removed ECL components in ${fileCount} file(s). Search for \"${TODO_PREFIX}\" and migrate them manually.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Templates\n// ---------------------------------------------------------------------------\n\nfunction collectTemplateAnnotations(template: string, lineOffset: number, commentStyle: 'html' | 'ts'): Annotation[] {\n let parsed;\n try {\n parsed = parseTemplate(template, '', { preserveWhitespaces: true });\n } catch {\n return [];\n }\n\n const annotations: Annotation[] = [];\n const visit = (nodes: TmplAstNode[]): void => {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n collectElementAnnotation(node, lineOffset, commentStyle, annotations);\n visit(node.children);\n }\n }\n };\n visit(parsed.nodes);\n return annotations;\n}\n\nfunction collectElementAnnotation(\n element: TmplAstElement,\n lineOffset: number,\n commentStyle: 'html' | 'ts',\n annotations: Annotation[],\n): void {\n const line = element.startSourceSpan.start.line + lineOffset;\n\n const removedTag = REMOVED_TAGS.find((t) => t.tag === element.name);\n if (removedTag) {\n annotations.push({ line, commentStyle, message: removedTag.message });\n }\n\n for (const removed of REMOVED_ATTRS) {\n const hasAttr =\n element.attributes.some((a) => a.name === removed.attr) || element.inputs.some((i) => i.name === removed.attr);\n if (!hasAttr) continue;\n if (removed.onTag && element.name !== removed.onTag) continue;\n annotations.push({ line, commentStyle, message: removed.message });\n }\n}\n\n// ---------------------------------------------------------------------------\n// TypeScript\n// ---------------------------------------------------------------------------\n\nfunction collectTypeScriptAnnotations(source: string, path: string): Annotation[] {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const annotations: Annotation[] = [];\n\n // 1. Inline templates — annotate with a `//` comment on the line of the\n // `template` property (inserting an HTML comment inside the template\n // literal is fragile across single/multi-line forms, so we place a TS\n // comment above the property instead).\n const visitForTemplates = (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 raw = init.getText(sourceFile).slice(1, -1);\n const inlineMessages = collectTemplateAnnotations(raw, 0, 'html').map((a) => a.message);\n if (inlineMessages.length > 0) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n annotations.push({ line, commentStyle: 'ts', message: [...new Set(inlineMessages)].join(' ') });\n }\n }\n }\n ts.forEachChild(node, visitForTemplates);\n };\n visitForTemplates(sourceFile);\n\n // 2. Identifier usages (imports, type references, array entries, etc.).\n // One annotation per affected line; merge messages for multiple symbols.\n const perLine = new Map<number, Set<string>>();\n const visitForIdentifiers = (node: ts.Node): void => {\n if (ts.isIdentifier(node)) {\n const removed = REMOVED_IDENTIFIERS.find((r) => r.name === node.text);\n if (removed) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n const set = perLine.get(line) ?? new Set<string>();\n set.add(removed.message);\n perLine.set(line, set);\n }\n }\n ts.forEachChild(node, visitForIdentifiers);\n };\n visitForIdentifiers(sourceFile);\n\n for (const [line, messages] of perLine) {\n annotations.push({ line, commentStyle: 'ts', message: [...messages].join(' ') });\n }\n\n return annotations;\n}\n\n// ---------------------------------------------------------------------------\n// Annotation application\n// ---------------------------------------------------------------------------\n\nfunction applyAnnotations(source: string, annotations: Annotation[]): string {\n if (annotations.length === 0) return source;\n\n const eol = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const lines = source.split(/\\r?\\n/);\n\n // One annotation per line (merge messages if several target the same line).\n const byLine = new Map<number, Annotation>();\n for (const a of annotations) {\n const existing = byLine.get(a.line);\n if (!existing) {\n byLine.set(a.line, { ...a });\n } else if (!existing.message.includes(a.message)) {\n existing.message = `${existing.message} ${a.message}`;\n }\n }\n\n // Skip lines whose preceding line already carries this TODO (idempotency).\n // Apply bottom-up so inserted lines don't shift later targets.\n const sorted = [...byLine.values()].sort((a, b) => b.line - a.line);\n\n for (const a of sorted) {\n if (a.line < 0 || a.line >= lines.length) continue;\n\n const indent = (lines[a.line].match(/^(\\s*)/)?.[1]) ?? '';\n const todo =\n a.commentStyle === 'html'\n ? `${indent}<!-- ${TODO_PREFIX} ${a.message} -->`\n : `${indent}// ${TODO_PREFIX} ${a.message}`;\n\n // Idempotency guard: if the line above already is this exact TODO, skip.\n const prev = a.line > 0 ? lines[a.line - 1] : '';\n if (prev.trim() === todo.trim()) continue;\n\n lines.splice(a.line, 0, todo);\n }\n\n return lines.join(eol);\n}\n\n// ---------------------------------------------------------------------------\n// Shared\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 (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\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 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",
|
|
2902
2970
|
"displayName": "RemovedIdentifier",
|
|
2903
2971
|
"properties": [
|
|
2904
2972
|
{
|
|
@@ -2910,7 +2978,7 @@
|
|
|
2910
2978
|
"indexKey": "",
|
|
2911
2979
|
"optional": false,
|
|
2912
2980
|
"description": "",
|
|
2913
|
-
"line":
|
|
2981
|
+
"line": 52,
|
|
2914
2982
|
"rawdescription": "\n"
|
|
2915
2983
|
},
|
|
2916
2984
|
{
|
|
@@ -2922,14 +2990,12 @@
|
|
|
2922
2990
|
"indexKey": "",
|
|
2923
2991
|
"optional": false,
|
|
2924
2992
|
"description": "",
|
|
2925
|
-
"line":
|
|
2993
|
+
"line": 51,
|
|
2926
2994
|
"rawdescription": "\n"
|
|
2927
2995
|
}
|
|
2928
2996
|
],
|
|
2929
2997
|
"indexSignatures": [],
|
|
2930
2998
|
"kind": 172,
|
|
2931
|
-
"description": "<p>A removed TypeScript identifier (class / token name).</p>\n",
|
|
2932
|
-
"rawdescription": "\nA removed TypeScript identifier (class / token name).",
|
|
2933
2999
|
"methods": [],
|
|
2934
3000
|
"extends": [],
|
|
2935
3001
|
"relationships": {
|
|
@@ -2939,12 +3005,12 @@
|
|
|
2939
3005
|
},
|
|
2940
3006
|
{
|
|
2941
3007
|
"name": "RemovedTag",
|
|
2942
|
-
"id": "interface-RemovedTag-
|
|
3008
|
+
"id": "interface-RemovedTag-0802af7de093a6df989cd8f4bc7da55cd9729f34d4642b7f5d9eae9f9a14cae4d644922a9d7ece99ba5b1c23696d54d83436ff79a54a50c37ade3ebbf0cbf92a",
|
|
2943
3009
|
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
2944
3010
|
"deprecated": false,
|
|
2945
3011
|
"deprecationMessage": "",
|
|
2946
3012
|
"type": "interface",
|
|
2947
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRunNote } from '../utils/dry-run';\n\n/**\n * Detects usages of ECL members removed in v22 that cannot be migrated\n * automatically, and reports a precise manual-action warning for each.\n *\n * This schematic makes **no edits** — it only scans and warns. The removed\n * members either have no replacement, or require a DOM-structure / semantic\n * change that must be made by a developer:\n *\n * - `EclDatePickerDirective` (`input[eclDatePicker]`): removed. Use\n * `EclDatePickerDuetDirective` on a `<duet-date-picker eclDatePicker>`\n * element instead of `<input eclDatePicker>`. Also flags imports of the\n * removed `EUI_ECL_DATE_PICKER` array / `EclDatePickerDirective` class.\n * - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`): removed\n * entirely, no replacement.\n * - `EclPageHeaderNextComponent`: removed, no longer exported.\n * - `EclRadioHelpComponent` (`[eclRadioHelp]`): removed. Use `[eclHelpBlock]`\n * (`EclHelpBlockDirective` from `@eui/ecl/components/ecl-help-block`).\n *\n * Because it is warn-only, dry-run and real runs behave identically.\n */\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\n/** A removed element tag (e.g. `<ecl-site-header-banner-top>`). */\ninterface RemovedTag {\n tag: string;\n message: string;\n}\n\n/** A removed attribute directive (e.g. `[eclRadioHelp]`). */\ninterface RemovedAttr {\n attr: string;\n /** If set, only flag when the attribute appears on this host tag. */\n onTag?: string;\n message: string;\n}\n\n/** A removed TypeScript identifier (class / token name). */\ninterface RemovedIdentifier {\n name: string;\n message: string;\n}\n\nconst REMOVED_TAGS: readonly RemovedTag[] = [\n {\n tag: 'ecl-site-header-banner-top',\n message:\n '<ecl-site-header-banner-top> (EclSiteHeaderBannerTopComponent) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n];\n\nconst REMOVED_ATTRS: readonly RemovedAttr[] = [\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n '\"input[eclDatePicker]\" (EclDatePickerDirective) was removed in v22. Use \"duet-date-picker[eclDatePicker]\" (EclDatePickerDuetDirective) instead: mount a <duet-date-picker eclDatePicker> element. yearRange/format/firstDayOfWeek are now configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n '\"[eclRadioHelp]\" (EclRadioHelpComponent) was removed in v22. Use \"[eclHelpBlock]\" (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n];\n\nconst REMOVED_IDENTIFIERS: readonly RemovedIdentifier[] = [\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective. Import EclDatePickerDuetDirective from @eui/ecl/components/ecl-date-picker and use <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n];\n\n// Fast pre-check tokens — if none appear in a file, skip parsing it.\nconst TRIGGER_TOKENS = [\n ...REMOVED_TAGS.map((t) => t.tag),\n ...REMOVED_ATTRS.map((a) => a.attr),\n ...REMOVED_IDENTIFIERS.map((i) => i.name),\n];\n\nexport function migrateEclRemovedComponents(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let warningCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!TRIGGER_TOKENS.some((t) => source.includes(t))) return;\n\n if (path.endsWith('.html')) {\n warningCount += scanTemplate(source, source, 0, path, context);\n } else {\n warningCount += scanTypeScript(source, path, context);\n }\n });\n\n if (warningCount === 0) {\n context.logger.info('No usages of removed ECL components found.');\n } else {\n context.logger.info(\n `Found ${warningCount} usage(s) of removed ECL components. Review the warnings above and migrate manually.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/**\n * Scans a template string for removed tags/attributes.\n * `lineOffset` shifts reported line numbers so inline templates report the line\n * within the host .ts file.\n */\nfunction scanTemplate(\n template: string,\n _fileSource: string,\n lineOffset: number,\n path: string,\n context: SchematicContext,\n): number {\n let parsed;\n try {\n parsed = parseTemplate(template, '', { preserveWhitespaces: true });\n } catch {\n return 0;\n }\n\n let count = 0;\n const visit = (nodes: TmplAstNode[]): void => {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n count += checkElement(node, lineOffset, path, context);\n visit(node.children);\n }\n }\n };\n visit(parsed.nodes);\n return count;\n}\n\nfunction checkElement(element: TmplAstElement, lineOffset: number, path: string, context: SchematicContext): number {\n let count = 0;\n const line = element.startSourceSpan.start.line + 1 + lineOffset;\n\n const removedTag = REMOVED_TAGS.find((t) => t.tag === element.name);\n if (removedTag) {\n context.logger.warn(`${path}:${line} - ${removedTag.message}`);\n count++;\n }\n\n for (const removed of REMOVED_ATTRS) {\n const hasAttr =\n element.attributes.some((a) => a.name === removed.attr) || element.inputs.some((i) => i.name === removed.attr);\n if (!hasAttr) continue;\n if (removed.onTag && element.name !== removed.onTag) continue;\n context.logger.warn(`${path}:${line} - ${removed.message}`);\n count++;\n }\n\n return count;\n}\n\nfunction scanTypeScript(source: string, path: string, context: SchematicContext): number {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n let count = 0;\n\n // 1. Inline templates — reuse the template scanner with a line offset.\n const visitForTemplates = (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 raw = init.getText(sourceFile).slice(1, -1); // strip quotes/backticks\n if (TRIGGER_TOKENS.some((t) => raw.includes(t))) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(init.getStart(sourceFile));\n count += scanTemplate(raw, source, line, path, context);\n }\n }\n }\n ts.forEachChild(node, visitForTemplates);\n };\n visitForTemplates(sourceFile);\n\n // 2. Identifier usages (imports, type references, array entries, etc.).\n const reportedLines = new Set<string>();\n const visitForIdentifiers = (node: ts.Node): void => {\n if (ts.isIdentifier(node)) {\n const removed = REMOVED_IDENTIFIERS.find((r) => r.name === node.text);\n if (removed) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n // De-duplicate multiple references to the same identifier on the same line.\n const key = `${removed.name}:${line}`;\n if (!reportedLines.has(key)) {\n reportedLines.add(key);\n context.logger.warn(`${path}:${line + 1} - ${removed.message}`);\n count++;\n }\n }\n }\n ts.forEachChild(node, visitForIdentifiers);\n };\n visitForIdentifiers(sourceFile);\n\n return count;\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 (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\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 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",
|
|
3013
|
+
"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\n/**\n * Flags usages of ECL members removed in v22 that have no automatic drop-in\n * replacement.\n *\n * For each usage it:\n * 1. Logs a precise manual-action warning.\n * 2. Inserts a `TODO: [eUI v22 migration] ...` comment on the line above the\n * usage so it is easy to locate in the editor.\n *\n * It makes **no other edits** — it never comments out, deletes, or rewrites the\n * user's code. These removed members require a developer decision (they are\n * components/directives with different APIs, or have no replacement), so the\n * schematic only points at what needs attention and leaves the change to the\n * developer. Searching a project for `TODO: [eUI v22 migration]` after the run\n * surfaces every spot to migrate.\n *\n * Removed members handled:\n * - `EclDatePickerDirective` (`input[eclDatePicker]`) → `EclDatePickerDuetDirective`\n * on `<duet-date-picker eclDatePicker>`.\n * - `EUI_ECL_DATE_PICKER` — still exported (now provides the Duet directive);\n * only the markup needs updating.\n * - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`) → removed, no replacement.\n * - `EclPageHeaderNextComponent` → removed, no longer exported.\n * - `EclRadioHelpComponent` (`[eclRadioHelp]`) → `[eclHelpBlock]` (`EclHelpBlockDirective`).\n */\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst TODO_PREFIX = 'TODO: [eUI v22 migration]';\n\ninterface RemovedTag {\n tag: string;\n message: string;\n}\n\ninterface RemovedAttr {\n attr: string;\n onTag?: string;\n message: string;\n}\n\ninterface RemovedIdentifier {\n name: string;\n message: string;\n}\n\nconst REMOVED_TAGS: readonly RemovedTag[] = [\n {\n tag: 'ecl-site-header-banner-top',\n message:\n 'EclSiteHeaderBannerTopComponent (<ecl-site-header-banner-top>) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n];\n\nconst REMOVED_ATTRS: readonly RemovedAttr[] = [\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n 'EclDatePickerDirective (input[eclDatePicker]) was removed in v22. Use EclDatePickerDuetDirective on a <duet-date-picker eclDatePicker> element; yearRange/format/firstDayOfWeek are configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n 'EclRadioHelpComponent ([eclRadioHelp]) was removed in v22. Use [eclHelpBlock] (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n];\n\nconst REMOVED_IDENTIFIERS: readonly RemovedIdentifier[] = [\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective (it now provides EclDatePickerDuetDirective). The import still works; update your markup from <input eclDatePicker> to <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n];\n\n// Fast pre-check tokens — if none appear in a file, skip parsing it.\nconst TRIGGER_TOKENS = [\n ...REMOVED_TAGS.map((t) => t.tag),\n ...REMOVED_ATTRS.map((a) => a.attr),\n ...REMOVED_IDENTIFIERS.map((i) => i.name),\n];\n\n/** A TODO comment to insert above a given zero-based line. */\ninterface Annotation {\n line: number;\n commentStyle: 'ts' | 'html';\n message: string;\n}\n\nexport function migrateEclRemovedComponents(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let warningCount = 0;\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!TRIGGER_TOKENS.some((t) => source.includes(t))) return;\n\n const annotations = path.endsWith('.html')\n ? collectTemplateAnnotations(source, 0, 'html')\n : collectTypeScriptAnnotations(source, path);\n\n if (annotations.length === 0) return;\n\n for (const a of annotations) {\n context.logger.warn(`${path}:${a.line + 1} - ${a.message}`);\n warningCount++;\n }\n\n const result = applyAnnotations(source, annotations);\n if (result !== source) {\n if (options.dryRun) {\n logDryRun(context, `Would annotate removed ECL usage(s) with TODO comments in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n if (warningCount === 0) {\n context.logger.info('No usages of removed ECL components found.');\n } else {\n context.logger.info(\n `Found ${warningCount} usage(s) of removed ECL components in ${fileCount} file(s). Search for \"${TODO_PREFIX}\" and migrate them manually.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Templates\n// ---------------------------------------------------------------------------\n\nfunction collectTemplateAnnotations(template: string, lineOffset: number, commentStyle: 'html' | 'ts'): Annotation[] {\n let parsed;\n try {\n parsed = parseTemplate(template, '', { preserveWhitespaces: true });\n } catch {\n return [];\n }\n\n const annotations: Annotation[] = [];\n const visit = (nodes: TmplAstNode[]): void => {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n collectElementAnnotation(node, lineOffset, commentStyle, annotations);\n visit(node.children);\n }\n }\n };\n visit(parsed.nodes);\n return annotations;\n}\n\nfunction collectElementAnnotation(\n element: TmplAstElement,\n lineOffset: number,\n commentStyle: 'html' | 'ts',\n annotations: Annotation[],\n): void {\n const line = element.startSourceSpan.start.line + lineOffset;\n\n const removedTag = REMOVED_TAGS.find((t) => t.tag === element.name);\n if (removedTag) {\n annotations.push({ line, commentStyle, message: removedTag.message });\n }\n\n for (const removed of REMOVED_ATTRS) {\n const hasAttr =\n element.attributes.some((a) => a.name === removed.attr) || element.inputs.some((i) => i.name === removed.attr);\n if (!hasAttr) continue;\n if (removed.onTag && element.name !== removed.onTag) continue;\n annotations.push({ line, commentStyle, message: removed.message });\n }\n}\n\n// ---------------------------------------------------------------------------\n// TypeScript\n// ---------------------------------------------------------------------------\n\nfunction collectTypeScriptAnnotations(source: string, path: string): Annotation[] {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const annotations: Annotation[] = [];\n\n // 1. Inline templates — annotate with a `//` comment on the line of the\n // `template` property (inserting an HTML comment inside the template\n // literal is fragile across single/multi-line forms, so we place a TS\n // comment above the property instead).\n const visitForTemplates = (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 raw = init.getText(sourceFile).slice(1, -1);\n const inlineMessages = collectTemplateAnnotations(raw, 0, 'html').map((a) => a.message);\n if (inlineMessages.length > 0) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n annotations.push({ line, commentStyle: 'ts', message: [...new Set(inlineMessages)].join(' ') });\n }\n }\n }\n ts.forEachChild(node, visitForTemplates);\n };\n visitForTemplates(sourceFile);\n\n // 2. Identifier usages (imports, type references, array entries, etc.).\n // One annotation per affected line; merge messages for multiple symbols.\n const perLine = new Map<number, Set<string>>();\n const visitForIdentifiers = (node: ts.Node): void => {\n if (ts.isIdentifier(node)) {\n const removed = REMOVED_IDENTIFIERS.find((r) => r.name === node.text);\n if (removed) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n const set = perLine.get(line) ?? new Set<string>();\n set.add(removed.message);\n perLine.set(line, set);\n }\n }\n ts.forEachChild(node, visitForIdentifiers);\n };\n visitForIdentifiers(sourceFile);\n\n for (const [line, messages] of perLine) {\n annotations.push({ line, commentStyle: 'ts', message: [...messages].join(' ') });\n }\n\n return annotations;\n}\n\n// ---------------------------------------------------------------------------\n// Annotation application\n// ---------------------------------------------------------------------------\n\nfunction applyAnnotations(source: string, annotations: Annotation[]): string {\n if (annotations.length === 0) return source;\n\n const eol = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const lines = source.split(/\\r?\\n/);\n\n // One annotation per line (merge messages if several target the same line).\n const byLine = new Map<number, Annotation>();\n for (const a of annotations) {\n const existing = byLine.get(a.line);\n if (!existing) {\n byLine.set(a.line, { ...a });\n } else if (!existing.message.includes(a.message)) {\n existing.message = `${existing.message} ${a.message}`;\n }\n }\n\n // Skip lines whose preceding line already carries this TODO (idempotency).\n // Apply bottom-up so inserted lines don't shift later targets.\n const sorted = [...byLine.values()].sort((a, b) => b.line - a.line);\n\n for (const a of sorted) {\n if (a.line < 0 || a.line >= lines.length) continue;\n\n const indent = (lines[a.line].match(/^(\\s*)/)?.[1]) ?? '';\n const todo =\n a.commentStyle === 'html'\n ? `${indent}<!-- ${TODO_PREFIX} ${a.message} -->`\n : `${indent}// ${TODO_PREFIX} ${a.message}`;\n\n // Idempotency guard: if the line above already is this exact TODO, skip.\n const prev = a.line > 0 ? lines[a.line - 1] : '';\n if (prev.trim() === todo.trim()) continue;\n\n lines.splice(a.line, 0, todo);\n }\n\n return lines.join(eol);\n}\n\n// ---------------------------------------------------------------------------\n// Shared\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 (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\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 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",
|
|
2948
3014
|
"displayName": "RemovedTag",
|
|
2949
3015
|
"properties": [
|
|
2950
3016
|
{
|
|
@@ -2956,7 +3022,7 @@
|
|
|
2956
3022
|
"indexKey": "",
|
|
2957
3023
|
"optional": false,
|
|
2958
3024
|
"description": "",
|
|
2959
|
-
"line":
|
|
3025
|
+
"line": 41,
|
|
2960
3026
|
"rawdescription": "\n"
|
|
2961
3027
|
},
|
|
2962
3028
|
{
|
|
@@ -2968,14 +3034,12 @@
|
|
|
2968
3034
|
"indexKey": "",
|
|
2969
3035
|
"optional": false,
|
|
2970
3036
|
"description": "",
|
|
2971
|
-
"line":
|
|
3037
|
+
"line": 40,
|
|
2972
3038
|
"rawdescription": "\n"
|
|
2973
3039
|
}
|
|
2974
3040
|
],
|
|
2975
3041
|
"indexSignatures": [],
|
|
2976
3042
|
"kind": 172,
|
|
2977
|
-
"description": "<p>A removed element tag (e.g. <code><ecl-site-header-banner-top></code>).</p>\n",
|
|
2978
|
-
"rawdescription": "\nA removed element tag (e.g. `<ecl-site-header-banner-top>`).",
|
|
2979
3043
|
"methods": [],
|
|
2980
3044
|
"extends": [],
|
|
2981
3045
|
"relationships": {
|
|
@@ -3144,12 +3208,12 @@
|
|
|
3144
3208
|
},
|
|
3145
3209
|
{
|
|
3146
3210
|
"name": "Schema",
|
|
3147
|
-
"id": "interface-Schema-
|
|
3148
|
-
"file": "packages/core/schematics/migrate/schema.ts",
|
|
3211
|
+
"id": "interface-Schema-5cd6db1920bd5b70a44c0b8a7f7e30f600bfd16a9950f218e6d451a1755ced95b462ef9a62ee87e39bcb8c392981b8d2597895bf0a272fd8aea71f03429ed976-2",
|
|
3212
|
+
"file": "packages/core/schematics/icon-migrate/schema.ts",
|
|
3149
3213
|
"deprecated": false,
|
|
3150
3214
|
"deprecationMessage": "",
|
|
3151
3215
|
"type": "interface",
|
|
3152
|
-
"sourceCode": "export interface Schema {\n /** The path to scan for files to migrate */\n path?: string;\n /** Whether to
|
|
3216
|
+
"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",
|
|
3153
3217
|
"displayName": "Schema",
|
|
3154
3218
|
"properties": [
|
|
3155
3219
|
{
|
|
@@ -3161,20 +3225,8 @@
|
|
|
3161
3225
|
"indexKey": "",
|
|
3162
3226
|
"optional": true,
|
|
3163
3227
|
"description": "<p>Whether to perform a dry run without making changes</p>\n",
|
|
3164
|
-
"line": 7,
|
|
3165
|
-
"rawdescription": "\nWhether to perform a dry run without making changes"
|
|
3166
|
-
},
|
|
3167
|
-
{
|
|
3168
|
-
"name": "mwp",
|
|
3169
|
-
"coverageIgnore": false,
|
|
3170
|
-
"deprecated": false,
|
|
3171
|
-
"deprecationMessage": "",
|
|
3172
|
-
"type": "boolean",
|
|
3173
|
-
"indexKey": "",
|
|
3174
|
-
"optional": true,
|
|
3175
|
-
"description": "<p>Whether to apply MyWorkplace-specific replacements</p>\n",
|
|
3176
3228
|
"line": 5,
|
|
3177
|
-
"rawdescription": "\nWhether to
|
|
3229
|
+
"rawdescription": "\nWhether to perform a dry run without making changes"
|
|
3178
3230
|
},
|
|
3179
3231
|
{
|
|
3180
3232
|
"name": "path",
|
|
@@ -3203,12 +3255,12 @@
|
|
|
3203
3255
|
},
|
|
3204
3256
|
{
|
|
3205
3257
|
"name": "Schema",
|
|
3206
|
-
"id": "interface-Schema-
|
|
3207
|
-
"file": "packages/core/schematics/
|
|
3258
|
+
"id": "interface-Schema-56b9fe60701ca349dc90e152829b0a18bb7a8a9bb303c4bac05f9764cd2e933cce0879775ca17168b4c881e202d0258af3668a2a3a1b940e561f7e4b2349b5cc-3",
|
|
3259
|
+
"file": "packages/core/schematics/migrate/schema.ts",
|
|
3208
3260
|
"deprecated": false,
|
|
3209
3261
|
"deprecationMessage": "",
|
|
3210
3262
|
"type": "interface",
|
|
3211
|
-
"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",
|
|
3263
|
+
"sourceCode": "export interface Schema {\n /** The path to scan for files to migrate */\n path?: string;\n /** Whether to apply MyWorkplace-specific replacements */\n mwp?: boolean;\n /** Whether to perform a dry run without making changes */\n dryRun?: boolean;\n}\n",
|
|
3212
3264
|
"displayName": "Schema",
|
|
3213
3265
|
"properties": [
|
|
3214
3266
|
{
|
|
@@ -3220,9 +3272,21 @@
|
|
|
3220
3272
|
"indexKey": "",
|
|
3221
3273
|
"optional": true,
|
|
3222
3274
|
"description": "<p>Whether to perform a dry run without making changes</p>\n",
|
|
3223
|
-
"line":
|
|
3275
|
+
"line": 7,
|
|
3224
3276
|
"rawdescription": "\nWhether to perform a dry run without making changes"
|
|
3225
3277
|
},
|
|
3278
|
+
{
|
|
3279
|
+
"name": "mwp",
|
|
3280
|
+
"coverageIgnore": false,
|
|
3281
|
+
"deprecated": false,
|
|
3282
|
+
"deprecationMessage": "",
|
|
3283
|
+
"type": "boolean",
|
|
3284
|
+
"indexKey": "",
|
|
3285
|
+
"optional": true,
|
|
3286
|
+
"description": "<p>Whether to apply MyWorkplace-specific replacements</p>\n",
|
|
3287
|
+
"line": 5,
|
|
3288
|
+
"rawdescription": "\nWhether to apply MyWorkplace-specific replacements"
|
|
3289
|
+
},
|
|
3226
3290
|
{
|
|
3227
3291
|
"name": "path",
|
|
3228
3292
|
"coverageIgnore": false,
|
|
@@ -3691,12 +3755,12 @@
|
|
|
3691
3755
|
},
|
|
3692
3756
|
{
|
|
3693
3757
|
"name": "Schema",
|
|
3694
|
-
"id": "interface-Schema-
|
|
3758
|
+
"id": "interface-Schema-0802af7de093a6df989cd8f4bc7da55cd9729f34d4642b7f5d9eae9f9a14cae4d644922a9d7ece99ba5b1c23696d54d83436ff79a54a50c37ade3ebbf0cbf92a-13",
|
|
3695
3759
|
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
3696
3760
|
"deprecated": false,
|
|
3697
3761
|
"deprecationMessage": "",
|
|
3698
3762
|
"type": "interface",
|
|
3699
|
-
"sourceCode": "import { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport * as ts from 'typescript';\nimport { logDryRunNote } from '../utils/dry-run';\n\n/**\n * Detects usages of ECL members removed in v22 that cannot be migrated\n * automatically, and reports a precise manual-action warning for each.\n *\n * This schematic makes **no edits** — it only scans and warns. The removed\n * members either have no replacement, or require a DOM-structure / semantic\n * change that must be made by a developer:\n *\n * - `EclDatePickerDirective` (`input[eclDatePicker]`): removed. Use\n * `EclDatePickerDuetDirective` on a `<duet-date-picker eclDatePicker>`\n * element instead of `<input eclDatePicker>`. Also flags imports of the\n * removed `EUI_ECL_DATE_PICKER` array / `EclDatePickerDirective` class.\n * - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`): removed\n * entirely, no replacement.\n * - `EclPageHeaderNextComponent`: removed, no longer exported.\n * - `EclRadioHelpComponent` (`[eclRadioHelp]`): removed. Use `[eclHelpBlock]`\n * (`EclHelpBlockDirective` from `@eui/ecl/components/ecl-help-block`).\n *\n * Because it is warn-only, dry-run and real runs behave identically.\n */\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\n/** A removed element tag (e.g. `<ecl-site-header-banner-top>`). */\ninterface RemovedTag {\n tag: string;\n message: string;\n}\n\n/** A removed attribute directive (e.g. `[eclRadioHelp]`). */\ninterface RemovedAttr {\n attr: string;\n /** If set, only flag when the attribute appears on this host tag. */\n onTag?: string;\n message: string;\n}\n\n/** A removed TypeScript identifier (class / token name). */\ninterface RemovedIdentifier {\n name: string;\n message: string;\n}\n\nconst REMOVED_TAGS: readonly RemovedTag[] = [\n {\n tag: 'ecl-site-header-banner-top',\n message:\n '<ecl-site-header-banner-top> (EclSiteHeaderBannerTopComponent) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n];\n\nconst REMOVED_ATTRS: readonly RemovedAttr[] = [\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n '\"input[eclDatePicker]\" (EclDatePickerDirective) was removed in v22. Use \"duet-date-picker[eclDatePicker]\" (EclDatePickerDuetDirective) instead: mount a <duet-date-picker eclDatePicker> element. yearRange/format/firstDayOfWeek are now configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n '\"[eclRadioHelp]\" (EclRadioHelpComponent) was removed in v22. Use \"[eclHelpBlock]\" (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n];\n\nconst REMOVED_IDENTIFIERS: readonly RemovedIdentifier[] = [\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective. Import EclDatePickerDuetDirective from @eui/ecl/components/ecl-date-picker and use <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n];\n\n// Fast pre-check tokens — if none appear in a file, skip parsing it.\nconst TRIGGER_TOKENS = [\n ...REMOVED_TAGS.map((t) => t.tag),\n ...REMOVED_ATTRS.map((a) => a.attr),\n ...REMOVED_IDENTIFIERS.map((i) => i.name),\n];\n\nexport function migrateEclRemovedComponents(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let warningCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!TRIGGER_TOKENS.some((t) => source.includes(t))) return;\n\n if (path.endsWith('.html')) {\n warningCount += scanTemplate(source, source, 0, path, context);\n } else {\n warningCount += scanTypeScript(source, path, context);\n }\n });\n\n if (warningCount === 0) {\n context.logger.info('No usages of removed ECL components found.');\n } else {\n context.logger.info(\n `Found ${warningCount} usage(s) of removed ECL components. Review the warnings above and migrate manually.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/**\n * Scans a template string for removed tags/attributes.\n * `lineOffset` shifts reported line numbers so inline templates report the line\n * within the host .ts file.\n */\nfunction scanTemplate(\n template: string,\n _fileSource: string,\n lineOffset: number,\n path: string,\n context: SchematicContext,\n): number {\n let parsed;\n try {\n parsed = parseTemplate(template, '', { preserveWhitespaces: true });\n } catch {\n return 0;\n }\n\n let count = 0;\n const visit = (nodes: TmplAstNode[]): void => {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n count += checkElement(node, lineOffset, path, context);\n visit(node.children);\n }\n }\n };\n visit(parsed.nodes);\n return count;\n}\n\nfunction checkElement(element: TmplAstElement, lineOffset: number, path: string, context: SchematicContext): number {\n let count = 0;\n const line = element.startSourceSpan.start.line + 1 + lineOffset;\n\n const removedTag = REMOVED_TAGS.find((t) => t.tag === element.name);\n if (removedTag) {\n context.logger.warn(`${path}:${line} - ${removedTag.message}`);\n count++;\n }\n\n for (const removed of REMOVED_ATTRS) {\n const hasAttr =\n element.attributes.some((a) => a.name === removed.attr) || element.inputs.some((i) => i.name === removed.attr);\n if (!hasAttr) continue;\n if (removed.onTag && element.name !== removed.onTag) continue;\n context.logger.warn(`${path}:${line} - ${removed.message}`);\n count++;\n }\n\n return count;\n}\n\nfunction scanTypeScript(source: string, path: string, context: SchematicContext): number {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n let count = 0;\n\n // 1. Inline templates — reuse the template scanner with a line offset.\n const visitForTemplates = (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 raw = init.getText(sourceFile).slice(1, -1); // strip quotes/backticks\n if (TRIGGER_TOKENS.some((t) => raw.includes(t))) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(init.getStart(sourceFile));\n count += scanTemplate(raw, source, line, path, context);\n }\n }\n }\n ts.forEachChild(node, visitForTemplates);\n };\n visitForTemplates(sourceFile);\n\n // 2. Identifier usages (imports, type references, array entries, etc.).\n const reportedLines = new Set<string>();\n const visitForIdentifiers = (node: ts.Node): void => {\n if (ts.isIdentifier(node)) {\n const removed = REMOVED_IDENTIFIERS.find((r) => r.name === node.text);\n if (removed) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n // De-duplicate multiple references to the same identifier on the same line.\n const key = `${removed.name}:${line}`;\n if (!reportedLines.has(key)) {\n reportedLines.add(key);\n context.logger.warn(`${path}:${line + 1} - ${removed.message}`);\n count++;\n }\n }\n }\n ts.forEachChild(node, visitForIdentifiers);\n };\n visitForIdentifiers(sourceFile);\n\n return count;\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 (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\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 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",
|
|
3763
|
+
"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\n/**\n * Flags usages of ECL members removed in v22 that have no automatic drop-in\n * replacement.\n *\n * For each usage it:\n * 1. Logs a precise manual-action warning.\n * 2. Inserts a `TODO: [eUI v22 migration] ...` comment on the line above the\n * usage so it is easy to locate in the editor.\n *\n * It makes **no other edits** — it never comments out, deletes, or rewrites the\n * user's code. These removed members require a developer decision (they are\n * components/directives with different APIs, or have no replacement), so the\n * schematic only points at what needs attention and leaves the change to the\n * developer. Searching a project for `TODO: [eUI v22 migration]` after the run\n * surfaces every spot to migrate.\n *\n * Removed members handled:\n * - `EclDatePickerDirective` (`input[eclDatePicker]`) → `EclDatePickerDuetDirective`\n * on `<duet-date-picker eclDatePicker>`.\n * - `EUI_ECL_DATE_PICKER` — still exported (now provides the Duet directive);\n * only the markup needs updating.\n * - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`) → removed, no replacement.\n * - `EclPageHeaderNextComponent` → removed, no longer exported.\n * - `EclRadioHelpComponent` (`[eclRadioHelp]`) → `[eclHelpBlock]` (`EclHelpBlockDirective`).\n */\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\nconst TODO_PREFIX = 'TODO: [eUI v22 migration]';\n\ninterface RemovedTag {\n tag: string;\n message: string;\n}\n\ninterface RemovedAttr {\n attr: string;\n onTag?: string;\n message: string;\n}\n\ninterface RemovedIdentifier {\n name: string;\n message: string;\n}\n\nconst REMOVED_TAGS: readonly RemovedTag[] = [\n {\n tag: 'ecl-site-header-banner-top',\n message:\n 'EclSiteHeaderBannerTopComponent (<ecl-site-header-banner-top>) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n];\n\nconst REMOVED_ATTRS: readonly RemovedAttr[] = [\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n 'EclDatePickerDirective (input[eclDatePicker]) was removed in v22. Use EclDatePickerDuetDirective on a <duet-date-picker eclDatePicker> element; yearRange/format/firstDayOfWeek are configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n 'EclRadioHelpComponent ([eclRadioHelp]) was removed in v22. Use [eclHelpBlock] (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n];\n\nconst REMOVED_IDENTIFIERS: readonly RemovedIdentifier[] = [\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective (it now provides EclDatePickerDuetDirective). The import still works; update your markup from <input eclDatePicker> to <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n];\n\n// Fast pre-check tokens — if none appear in a file, skip parsing it.\nconst TRIGGER_TOKENS = [\n ...REMOVED_TAGS.map((t) => t.tag),\n ...REMOVED_ATTRS.map((a) => a.attr),\n ...REMOVED_IDENTIFIERS.map((i) => i.name),\n];\n\n/** A TODO comment to insert above a given zero-based line. */\ninterface Annotation {\n line: number;\n commentStyle: 'ts' | 'html';\n message: string;\n}\n\nexport function migrateEclRemovedComponents(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let warningCount = 0;\n let fileCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const source = buffer.toString('utf-8');\n if (!TRIGGER_TOKENS.some((t) => source.includes(t))) return;\n\n const annotations = path.endsWith('.html')\n ? collectTemplateAnnotations(source, 0, 'html')\n : collectTypeScriptAnnotations(source, path);\n\n if (annotations.length === 0) return;\n\n for (const a of annotations) {\n context.logger.warn(`${path}:${a.line + 1} - ${a.message}`);\n warningCount++;\n }\n\n const result = applyAnnotations(source, annotations);\n if (result !== source) {\n if (options.dryRun) {\n logDryRun(context, `Would annotate removed ECL usage(s) with TODO comments in ${path}`);\n } else {\n tree.overwrite(path, result);\n }\n fileCount++;\n }\n });\n\n if (warningCount === 0) {\n context.logger.info('No usages of removed ECL components found.');\n } else {\n context.logger.info(\n `Found ${warningCount} usage(s) of removed ECL components in ${fileCount} file(s). Search for \"${TODO_PREFIX}\" and migrate them manually.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Templates\n// ---------------------------------------------------------------------------\n\nfunction collectTemplateAnnotations(template: string, lineOffset: number, commentStyle: 'html' | 'ts'): Annotation[] {\n let parsed;\n try {\n parsed = parseTemplate(template, '', { preserveWhitespaces: true });\n } catch {\n return [];\n }\n\n const annotations: Annotation[] = [];\n const visit = (nodes: TmplAstNode[]): void => {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n collectElementAnnotation(node, lineOffset, commentStyle, annotations);\n visit(node.children);\n }\n }\n };\n visit(parsed.nodes);\n return annotations;\n}\n\nfunction collectElementAnnotation(\n element: TmplAstElement,\n lineOffset: number,\n commentStyle: 'html' | 'ts',\n annotations: Annotation[],\n): void {\n const line = element.startSourceSpan.start.line + lineOffset;\n\n const removedTag = REMOVED_TAGS.find((t) => t.tag === element.name);\n if (removedTag) {\n annotations.push({ line, commentStyle, message: removedTag.message });\n }\n\n for (const removed of REMOVED_ATTRS) {\n const hasAttr =\n element.attributes.some((a) => a.name === removed.attr) || element.inputs.some((i) => i.name === removed.attr);\n if (!hasAttr) continue;\n if (removed.onTag && element.name !== removed.onTag) continue;\n annotations.push({ line, commentStyle, message: removed.message });\n }\n}\n\n// ---------------------------------------------------------------------------\n// TypeScript\n// ---------------------------------------------------------------------------\n\nfunction collectTypeScriptAnnotations(source: string, path: string): Annotation[] {\n const sourceFile = ts.createSourceFile(path, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const annotations: Annotation[] = [];\n\n // 1. Inline templates — annotate with a `//` comment on the line of the\n // `template` property (inserting an HTML comment inside the template\n // literal is fragile across single/multi-line forms, so we place a TS\n // comment above the property instead).\n const visitForTemplates = (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 raw = init.getText(sourceFile).slice(1, -1);\n const inlineMessages = collectTemplateAnnotations(raw, 0, 'html').map((a) => a.message);\n if (inlineMessages.length > 0) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n annotations.push({ line, commentStyle: 'ts', message: [...new Set(inlineMessages)].join(' ') });\n }\n }\n }\n ts.forEachChild(node, visitForTemplates);\n };\n visitForTemplates(sourceFile);\n\n // 2. Identifier usages (imports, type references, array entries, etc.).\n // One annotation per affected line; merge messages for multiple symbols.\n const perLine = new Map<number, Set<string>>();\n const visitForIdentifiers = (node: ts.Node): void => {\n if (ts.isIdentifier(node)) {\n const removed = REMOVED_IDENTIFIERS.find((r) => r.name === node.text);\n if (removed) {\n const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile));\n const set = perLine.get(line) ?? new Set<string>();\n set.add(removed.message);\n perLine.set(line, set);\n }\n }\n ts.forEachChild(node, visitForIdentifiers);\n };\n visitForIdentifiers(sourceFile);\n\n for (const [line, messages] of perLine) {\n annotations.push({ line, commentStyle: 'ts', message: [...messages].join(' ') });\n }\n\n return annotations;\n}\n\n// ---------------------------------------------------------------------------\n// Annotation application\n// ---------------------------------------------------------------------------\n\nfunction applyAnnotations(source: string, annotations: Annotation[]): string {\n if (annotations.length === 0) return source;\n\n const eol = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const lines = source.split(/\\r?\\n/);\n\n // One annotation per line (merge messages if several target the same line).\n const byLine = new Map<number, Annotation>();\n for (const a of annotations) {\n const existing = byLine.get(a.line);\n if (!existing) {\n byLine.set(a.line, { ...a });\n } else if (!existing.message.includes(a.message)) {\n existing.message = `${existing.message} ${a.message}`;\n }\n }\n\n // Skip lines whose preceding line already carries this TODO (idempotency).\n // Apply bottom-up so inserted lines don't shift later targets.\n const sorted = [...byLine.values()].sort((a, b) => b.line - a.line);\n\n for (const a of sorted) {\n if (a.line < 0 || a.line >= lines.length) continue;\n\n const indent = (lines[a.line].match(/^(\\s*)/)?.[1]) ?? '';\n const todo =\n a.commentStyle === 'html'\n ? `${indent}<!-- ${TODO_PREFIX} ${a.message} -->`\n : `${indent}// ${TODO_PREFIX} ${a.message}`;\n\n // Idempotency guard: if the line above already is this exact TODO, skip.\n const prev = a.line > 0 ? lines[a.line - 1] : '';\n if (prev.trim() === todo.trim()) continue;\n\n lines.splice(a.line, 0, todo);\n }\n\n return lines.join(eol);\n}\n\n// ---------------------------------------------------------------------------\n// Shared\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 (\n ts.isDecorator(callExpression.parent) &&\n ts.isIdentifier(callExpression.expression) &&\n callExpression.expression.text === 'Component'\n );\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 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",
|
|
3700
3764
|
"displayName": "Schema",
|
|
3701
3765
|
"properties": [
|
|
3702
3766
|
{
|
|
@@ -3708,7 +3772,7 @@
|
|
|
3708
3772
|
"indexKey": "",
|
|
3709
3773
|
"optional": true,
|
|
3710
3774
|
"description": "",
|
|
3711
|
-
"line":
|
|
3775
|
+
"line": 34,
|
|
3712
3776
|
"rawdescription": "\n"
|
|
3713
3777
|
},
|
|
3714
3778
|
{
|
|
@@ -3720,14 +3784,14 @@
|
|
|
3720
3784
|
"indexKey": "",
|
|
3721
3785
|
"optional": true,
|
|
3722
3786
|
"description": "",
|
|
3723
|
-
"line":
|
|
3787
|
+
"line": 33,
|
|
3724
3788
|
"rawdescription": "\n"
|
|
3725
3789
|
}
|
|
3726
3790
|
],
|
|
3727
3791
|
"indexSignatures": [],
|
|
3728
3792
|
"kind": 172,
|
|
3729
|
-
"description": "<p>
|
|
3730
|
-
"rawdescription": "\n\
|
|
3793
|
+
"description": "<p>Flags usages of ECL members removed in v22 that have no automatic drop-in\nreplacement.</p>\n<p>For each usage it:</p>\n<ol>\n<li>Logs a precise manual-action warning.</li>\n<li>Inserts a <code>TODO: [eUI v22 migration] ...</code> comment on the line above the\nusage so it is easy to locate in the editor.</li>\n</ol>\n<p>It makes <strong>no other edits</strong> — it never comments out, deletes, or rewrites the\nuser's code. These removed members require a developer decision (they are\ncomponents/directives with different APIs, or have no replacement), so the\nschematic only points at what needs attention and leaves the change to the\ndeveloper. Searching a project for <code>TODO: [eUI v22 migration]</code> after the run\nsurfaces every spot to migrate.</p>\n<p>Removed members handled:</p>\n<ul>\n<li><code>EclDatePickerDirective</code> (<code>input[eclDatePicker]</code>) → <code>EclDatePickerDuetDirective</code>\non <code><duet-date-picker eclDatePicker></code>.</li>\n<li><code>EUI_ECL_DATE_PICKER</code> — still exported (now provides the Duet directive);\nonly the markup needs updating.</li>\n<li><code>EclSiteHeaderBannerTopComponent</code> (<code>ecl-site-header-banner-top</code>) → removed, no replacement.</li>\n<li><code>EclPageHeaderNextComponent</code> → removed, no longer exported.</li>\n<li><code>EclRadioHelpComponent</code> (<code>[eclRadioHelp]</code>) → <code>[eclHelpBlock]</code> (<code>EclHelpBlockDirective</code>).</li>\n</ul>\n",
|
|
3794
|
+
"rawdescription": "\n\nFlags usages of ECL members removed in v22 that have no automatic drop-in\nreplacement.\n\nFor each usage it:\n 1. Logs a precise manual-action warning.\n 2. Inserts a `TODO: [eUI v22 migration] ...` comment on the line above the\n usage so it is easy to locate in the editor.\n\nIt makes **no other edits** — it never comments out, deletes, or rewrites the\nuser's code. These removed members require a developer decision (they are\ncomponents/directives with different APIs, or have no replacement), so the\nschematic only points at what needs attention and leaves the change to the\ndeveloper. Searching a project for `TODO: [eUI v22 migration]` after the run\nsurfaces every spot to migrate.\n\nRemoved members handled:\n - `EclDatePickerDirective` (`input[eclDatePicker]`) → `EclDatePickerDuetDirective`\n on `<duet-date-picker eclDatePicker>`.\n - `EUI_ECL_DATE_PICKER` — still exported (now provides the Duet directive);\n only the markup needs updating.\n - `EclSiteHeaderBannerTopComponent` (`ecl-site-header-banner-top`) → removed, no replacement.\n - `EclPageHeaderNextComponent` → removed, no longer exported.\n - `EclRadioHelpComponent` (`[eclRadioHelp]`) → `[eclHelpBlock]` (`EclHelpBlockDirective`).\n",
|
|
3731
3795
|
"methods": [],
|
|
3732
3796
|
"extends": [],
|
|
3733
3797
|
"isDuplicate": true,
|
|
@@ -4733,12 +4797,12 @@
|
|
|
4733
4797
|
},
|
|
4734
4798
|
{
|
|
4735
4799
|
"name": "Schema",
|
|
4736
|
-
"id": "interface-Schema-
|
|
4800
|
+
"id": "interface-Schema-a815c8902197362f2d1c353d86dc2b491bbb55ca3f82071af2eb0c5761303cb0f3dfc0beeb774a7d53512989fb9a3a10f69f98a5969ebe1e5c5b0ee6aab5c1ac-35",
|
|
4737
4801
|
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
4738
4802
|
"deprecated": false,
|
|
4739
4803
|
"deprecationMessage": "",
|
|
4740
4804
|
"type": "interface",
|
|
4741
|
-
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\nimport { EUI_SIGNAL_MAP as EUI_SIGNAL_MAP_RAW, EUI_SELECTOR_TO_CLASS as EUI_SELECTOR_TO_CLASS_RAW } from './signal-map';\nimport { ECL_SIGNAL_MAP, ECL_SELECTOR_TO_CLASS } from './ecl-signal-map';\n\n/**\n * Combined EUI + ECL signal maps. The migration logic is identical for both\n * libraries (plain field → signal getter), so the maps are merged and the rest\n * of the engine treats them uniformly. EUI and ECL class names don't collide\n * (Eui* vs Ecl* prefixes), and the selector namespaces are disjoint.\n */\nconst EUI_SIGNAL_MAP: Record<string, ReadonlySet<string>> = { ...EUI_SIGNAL_MAP_RAW, ...ECL_SIGNAL_MAP };\nconst EUI_SELECTOR_TO_CLASS: Record<string, string> = { ...EUI_SELECTOR_TO_CLASS_RAW, ...ECL_SELECTOR_TO_CLASS };\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\n/**\n * Migrates consumer code that accesses EUI or ECL component instances\n * programmatically.\n *\n * When EUI/ECL migrated @Input() → input(), @ViewChild() → viewChild(), and\n * @ContentChild() → contentChild(), properties that were plain class fields\n * became signal getters. Consumers who access them via @ViewChild need to\n * change `comp.prop` to `comp.prop()`.\n *\n * This schematic:\n * 1. Finds @ViewChild / @ContentChild fields typed as EUI component classes\n * 2. Resolves untyped @ViewChild('refName') by reading the component template\n * and matching #refName to an EUI element tag/selector\n * 3. Tracks which local variable names hold EUI component references (incl. aliases)\n * 4. Rewrites property accesses on those references: `ref.prop` → `ref.prop()`\n * (only for properties listed in the signal map)\n * 5. Does NOT touch template bindings — those are unaffected by signal migrations\n */\nexport function migrateToSignals(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n let propCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n // Skip spec files — test code may use different patterns\n if (path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n // Fast bail: file must mention at least one EUI class name or have\n // ViewChild/ContentChild with string refs (which might reference EUI elements)\n if (!hasEuiReference(original) && !hasStringRefQuery(original)) return;\n\n const result = migrateTypeScript(original, path, tree, context); if (result.source !== original) {\n if (options.dryRun) {\n logDryRun(context, `Would migrate ${result.editCount} signal property access(es) in ${path}`);\n } else {\n tree.overwrite(path, result.source);\n }\n fileCount++;\n propCount += result.editCount;\n }\n });\n\n context.logger.info(`Migrated ${propCount} property access(es) to signal getters in ${fileCount} file(s).`);\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/** Quick check: does the file reference any EUI class name from the signal map? */\nfunction hasEuiReference(source: string): boolean {\n for (const className of Object.keys(EUI_SIGNAL_MAP)) {\n if (source.includes(className)) return true;\n }\n return false;\n}\n\n/** Quick check: does the file have @ViewChild('...') or @ContentChild('...') with string refs? */\nfunction hasStringRefQuery(source: string): boolean {\n return /(@ViewChild|@ContentChild|@ViewChildren|@ContentChildren)\\s*\\(\\s*['\"]/.test(source);\n}\n\ninterface MigrateResult {\n source: string;\n editCount: number;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, tree: Tree, context: SchematicContext): MigrateResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n\n // Phase 0: Build template ref map (#refName → EUI class name) from the component's template\n const templateRefMap = buildTemplateRefMap(sourceFile, source, filePath, tree);\n\n // Phase 1: Collect all variables/properties typed as EUI classes\n const euiRefs = collectEuiReferences(sourceFile, source, templateRefMap);\n\n if (euiRefs.size === 0) {\n return { source, editCount: 0 };\n }\n\n // Phase 2: Find property accesses on those references and rewrite signal props\n const visitNode = (node: ts.Node): void => {\n // Match: ref.prop (PropertyAccessExpression)\n if (ts.isPropertyAccessExpression(node)) {\n const rewrite = tryRewritePropertyAccess(node, euiRefs, sourceFile, source);\n if (rewrite) {\n edits.push(rewrite);\n }\n }\n ts.forEachChild(node, visitNode);\n };\n\n ts.forEachChild(sourceFile, visitNode);\n\n if (edits.length === 0) {\n return { source, editCount: 0 };\n }\n\n return {\n source: applyEdits(source, edits),\n editCount: edits.length,\n };\n}\n\n/**\n * Scans the source file for class properties or variables typed as EUI component classes.\n * Returns a map: localName → Set of signal property names.\n *\n * Handles:\n * @ViewChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild(EuiXxxComponent) name!: EuiXxxComponent;\n * @ViewChild('ref') name: EuiXxxComponent;\n * @ContentChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild('ref') name: ElementRef; (resolved via template #ref → EUI selector)\n * someVar: EuiXxxComponent; (typed class field, even without decorator)\n * const alias = this.viewChildRef; (alias tracking)\n */\nfunction collectEuiReferences(\n sourceFile: ts.SourceFile,\n source: string,\n templateRefMap: Map<string, string>,\n): Map<string, ReadonlySet<string>> {\n const refs = new Map<string, ReadonlySet<string>>();\n\n // Pass 1: collect directly-typed references\n const visitDirect = (node: ts.Node): void => {\n // Class property declarations\n if (ts.isPropertyDeclaration(node) && node.name && ts.isIdentifier(node.name)) {\n const euiClass = resolveEuiClassName(node, sourceFile, templateRefMap);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[euiClass]);\n }\n }\n\n // Variable declarations (const x: EuiXxxComponent = ...)\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n // Parameter declarations (method(ref: EuiXxxComponent))\n if (ts.isParameter(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n ts.forEachChild(node, visitDirect);\n };\n\n ts.forEachChild(sourceFile, visitDirect);\n\n // Pass 2: track aliases — variables assigned from already-tracked references\n // e.g. const alias = this.viewChildRef; or const alias = someParam;\n const visitAlias = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n // Skip if already tracked (has explicit type annotation)\n if (refs.has(node.name.text)) {\n ts.forEachChild(node, visitAlias);\n return;\n }\n\n const aliasedRef = resolveRefName(node.initializer);\n if (aliasedRef && refs.has(aliasedRef)) {\n refs.set(node.name.text, refs.get(aliasedRef)!);\n }\n }\n\n ts.forEachChild(node, visitAlias);\n };\n\n ts.forEachChild(sourceFile, visitAlias);\n return refs;\n}\n\n/**\n * Resolves the EUI class name from a property declaration.\n * Checks: type annotation → decorator class argument → template ref map.\n */\nfunction resolveEuiClassName(\n node: ts.PropertyDeclaration,\n sourceFile: ts.SourceFile,\n templateRefMap: Map<string, string>,\n): string | null {\n // Check type annotation first\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n return typeName;\n }\n\n // Check generic type argument: ElementRef<EuiXxxComponent>\n if (node.type && ts.isTypeReferenceNode(node.type) && node.type.typeArguments?.length) {\n const genericArg = getTypeAnnotationName(node.type.typeArguments[0]);\n if (genericArg && EUI_SIGNAL_MAP[genericArg]) {\n return genericArg;\n }\n }\n\n // Check decorator arguments: @ViewChild(EuiXxxComponent) or @ViewChild('refName')\n if (node.modifiers) {\n for (const modifier of node.modifiers) {\n if (!ts.isDecorator(modifier)) continue;\n if (!ts.isCallExpression(modifier.expression)) continue;\n\n const decoratorName = getDecoratorName(modifier.expression);\n if (!decoratorName) continue;\n if (!['ViewChild', 'ViewChildren', 'ContentChild', 'ContentChildren'].includes(decoratorName)) continue;\n\n const args = modifier.expression.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n\n // @ViewChild(EuiXxxComponent) — class reference\n if (ts.isIdentifier(firstArg) && EUI_SIGNAL_MAP[firstArg.text]) {\n return firstArg.text;\n }\n\n // @ViewChild('refName') — string template ref, resolve via template\n if (ts.isStringLiteralLike(firstArg)) {\n const refName = firstArg.text;\n const euiClass = templateRefMap.get(refName);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n return euiClass;\n }\n }\n }\n }\n }\n\n return null;\n}\n\nfunction getDecoratorName(callExpr: ts.CallExpression): string | null {\n if (ts.isIdentifier(callExpr.expression)) {\n return callExpr.expression.text;\n }\n return null;\n}\n\nfunction getTypeAnnotationName(typeNode: ts.TypeNode | undefined): string | null {\n if (!typeNode) return null;\n if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) {\n return typeNode.typeName.text;\n }\n return null;\n}\n\n/**\n * Checks if a property access `ref.prop` should be rewritten to `ref.prop()`.\n *\n * We rewrite if:\n * - `ref` is tracked in euiRefs\n * - `prop` is in the signal set for that EUI class\n * - The access is NOT already a call expression (not `ref.prop()` or `ref.prop(args)`)\n * - The access is NOT a write target (not `ref.prop = value`)\n * - The access is NOT a template binding argument (those are unaffected)\n */\nfunction tryRewritePropertyAccess(\n node: ts.PropertyAccessExpression,\n euiRefs: Map<string, ReadonlySet<string>>,\n sourceFile: ts.SourceFile,\n source: string,\n): Edit | null {\n const propName = node.name.text;\n\n // Resolve the reference name — handle `this.ref.prop` and `ref.prop`\n const refName = resolveRefName(node.expression);\n if (!refName) return null;\n\n const signalProps = euiRefs.get(refName);\n if (!signalProps || !signalProps.has(propName)) return null;\n\n // Skip if parent is already a call expression on this property: ref.prop(...)\n if (ts.isCallExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if this is the left side of an assignment: ref.prop = value\n if (ts.isBinaryExpression(node.parent) &&\n node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&\n node.parent.left === node) {\n return null;\n }\n\n // Skip if this is a compound assignment: ref.prop += value, ref.prop &&= value, etc.\n if (ts.isBinaryExpression(node.parent) && isAssignmentOperator(node.parent.operatorToken.kind) && node.parent.left === node) {\n return null;\n }\n\n // Skip if this is used with delete: delete ref.prop\n if (ts.isDeleteExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if inside a typeof: typeof ref.prop\n if (ts.isTypeOfExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip property access chains that go deeper: ref.prop.something → ref.prop().something\n // This IS correct — we still want to add ()\n\n // Rewrite: insert () after the property name\n const end = node.name.getEnd();\n return {\n start: end,\n end: end,\n replacement: '()',\n };\n}\n\nfunction isAssignmentOperator(kind: ts.SyntaxKind): boolean {\n return kind >= ts.SyntaxKind.FirstAssignment && kind <= ts.SyntaxKind.LastAssignment;\n}\n\n/**\n * Resolves a reference name from an expression.\n * Handles: `ref`, `this.ref`, `this._ref`\n */\nfunction resolveRefName(expr: ts.Expression): string | null {\n // Direct identifier: ref.prop\n if (ts.isIdentifier(expr)) {\n return expr.text;\n }\n\n // this.ref.prop\n if (ts.isPropertyAccessExpression(expr) && expr.expression.kind === ts.SyntaxKind.ThisKeyword) {\n return expr.name.text;\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Template ref resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Builds a map of template reference variable names (#ref) to EUI class names.\n *\n * Parses the component's template (inline or external) and finds elements like:\n * <eui-alert #myAlert> → myAlert → EuiAlertComponent\n * <input euiAutocomplete #ac> → ac → EuiAutocompleteComponent\n *\n * Returns Map<refName, euiClassName>.\n */\nfunction buildTemplateRefMap(\n sourceFile: ts.SourceFile,\n source: string,\n filePath: string,\n tree: Tree,\n): Map<string, string> {\n const refMap = new Map<string, string>();\n\n // Find @Component decorator\n const componentMeta = findComponentMetadata(sourceFile, source);\n if (!componentMeta) return refMap;\n\n let templateSource: string | null = null;\n\n if (componentMeta.inlineTemplate !== null) {\n templateSource = componentMeta.inlineTemplate;\n } else if (componentMeta.templateUrl) {\n // Resolve templateUrl relative to the TS file\n const dir = filePath.substring(0, filePath.lastIndexOf('/'));\n const templatePath = `${dir}/${componentMeta.templateUrl}`;\n const buffer = tree.read(templatePath);\n if (buffer) {\n templateSource = buffer.toString('utf-8');\n }\n }\n\n if (!templateSource) return refMap;\n\n // Parse the template and collect #refs\n try {\n const parsed = parseTemplate(templateSource, '', { preserveWhitespaces: true });\n collectTemplateRefs(parsed.nodes, refMap);\n } catch {\n // Template parse failure — silently skip (might be malformed or use third-party syntax)\n }\n\n return refMap;\n}\n\n/**\n * Extracts @Component metadata: templateUrl or inline template content.\n */\nfunction findComponentMetadata(\n sourceFile: ts.SourceFile,\n source: string,\n): { templateUrl: string | null; inlineTemplate: string | null } | null {\n let result: { templateUrl: string | null; inlineTemplate: string | null } | null = null;\n\n const visit = (node: ts.Node): void => {\n if (result) return;\n\n if (ts.isDecorator(node) && ts.isCallExpression(node.expression)) {\n const name = getDecoratorName(node.expression);\n if (name !== 'Component') {\n ts.forEachChild(node, visit);\n return;\n }\n\n const args = node.expression.arguments;\n if (args.length === 0 || !ts.isObjectLiteralExpression(args[0])) {\n ts.forEachChild(node, visit);\n return;\n }\n\n const meta: { templateUrl: string | null; inlineTemplate: string | null } = {\n templateUrl: null,\n inlineTemplate: null,\n };\n\n for (const prop of args[0].properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) continue;\n\n if (prop.name.text === 'templateUrl') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.templateUrl = init.text;\n }\n }\n\n if (prop.name.text === 'template') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.inlineTemplate = init.text;\n } else if (ts.isNoSubstitutionTemplateLiteral(init)) {\n meta.inlineTemplate = init.text;\n }\n }\n }\n\n result = meta;\n return;\n }\n\n ts.forEachChild(node, visit);\n };\n\n ts.forEachChild(sourceFile, visit);\n return result;\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\n/**\n * Recursively walks template AST nodes, collecting #refName → EUI class name mappings.\n *\n * For each element with a template reference (#ref), we try to resolve its EUI class:\n * 1. Match element tag name against EUI_SELECTOR_TO_CLASS (e.g. 'eui-alert' → EuiAlertComponent)\n * 2. Match element attributes against attribute selectors (e.g. [euiAutocomplete] → EuiAutocompleteComponent)\n */\nfunction collectTemplateRefs(nodes: TmplAstNode[], refMap: Map<string, string>): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.references && node.references.length > 0) {\n const euiClass = resolveElementToEuiClass(node);\n if (euiClass) {\n for (const ref of node.references) {\n refMap.set(ref.name, euiClass);\n }\n }\n }\n collectTemplateRefs(node.children, refMap);\n }\n }\n}\n\n/**\n * Given a template element, resolves it to an EUI class name by checking:\n * 1. Tag name: <eui-alert> → look up 'eui-alert' in EUI_SELECTOR_TO_CLASS\n * 2. Attribute selectors: <input euiAutocomplete> → look up 'input[euiAutocomplete]' or '[euiAutocomplete]'\n */\nfunction resolveElementToEuiClass(element: TmplAstElement): string | null {\n const tag = element.name;\n\n // Direct tag match: eui-alert, eui-dialog, etc.\n if (EUI_SELECTOR_TO_CLASS[tag]) {\n return EUI_SELECTOR_TO_CLASS[tag];\n }\n\n // Attribute selector match: check all attributes against known patterns\n const allAttrNames = [\n ...element.attributes.map((a) => a.name),\n ...element.inputs.map((i) => i.name),\n ];\n\n for (const attrName of allAttrNames) {\n // Try tag[attr] pattern first (e.g. 'button[euiButton]', 'input[euiAutocomplete]')\n const tagAttrSelector = `${tag}[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[tagAttrSelector]) {\n return EUI_SELECTOR_TO_CLASS[tagAttrSelector];\n }\n\n // Try [attr] pattern (e.g. '[euiTooltip]', '[euiLoading]')\n const attrSelector = `[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[attrSelector]) {\n return EUI_SELECTOR_TO_CLASS[attrSelector];\n }\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Edit helpers\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",
|
|
4805
|
+
"sourceCode": "import { DirEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';\nimport { parseTemplate, TmplAstElement, TmplAstNode } from '@angular/compiler';\nimport * as ts from 'typescript';\nimport { logDryRun, logDryRunNote } from '../utils/dry-run';\nimport { EUI_SIGNAL_MAP as EUI_SIGNAL_MAP_RAW, EUI_SELECTOR_TO_CLASS as EUI_SELECTOR_TO_CLASS_RAW } from './signal-map';\nimport { ECL_SIGNAL_MAP, ECL_SELECTOR_TO_CLASS } from './ecl-signal-map';\n\n/**\n * Combined EUI + ECL signal maps. The migration logic is identical for both\n * libraries (plain field → signal getter), so the maps are merged and the rest\n * of the engine treats them uniformly. EUI and ECL class names don't collide\n * (Eui* vs Ecl* prefixes), and the selector namespaces are disjoint.\n */\nconst EUI_SIGNAL_MAP: Record<string, ReadonlySet<string>> = { ...EUI_SIGNAL_MAP_RAW, ...ECL_SIGNAL_MAP };\nconst EUI_SELECTOR_TO_CLASS: Record<string, string> = { ...EUI_SELECTOR_TO_CLASS_RAW, ...ECL_SELECTOR_TO_CLASS };\n\ninterface Schema {\n path?: string;\n dryRun?: boolean;\n}\n\ninterface Edit {\n start: number;\n end: number;\n replacement: string;\n}\n\n/**\n * Migrates consumer code that accesses EUI or ECL component instances\n * programmatically.\n *\n * When EUI/ECL migrated @Input() → input(), @ViewChild() → viewChild(), and\n * @ContentChild() → contentChild(), properties that were plain class fields\n * became signal getters. Consumers who access them via @ViewChild need to\n * change `comp.prop` to `comp.prop()`.\n *\n * This schematic:\n * 1. Finds @ViewChild / @ContentChild fields typed as EUI component classes\n * 2. Resolves untyped @ViewChild('refName') by reading the component template\n * and matching #refName to an EUI element tag/selector\n * 3. Tracks which local variable names hold EUI component references (incl. aliases)\n * 4. Rewrites property accesses on those references: `ref.prop` → `ref.prop()`\n * (only for properties listed in the signal map)\n * 5. Does NOT touch template bindings — those are unaffected by signal migrations\n */\nexport function migrateToSignals(options: Schema = {}): Rule {\n return (tree: Tree, context: SchematicContext) => {\n const scanPath = options.path ? '/' + options.path.replace(/^\\.?\\//, '').replace(/\\/$/, '') : '';\n let fileCount = 0;\n let propCount = 0;\n let todoCount = 0;\n\n visitDir(tree.getDir(scanPath || '/'), (path) => {\n if (!path.endsWith('.ts')) return;\n // Skip spec files — test code may use different patterns\n if (path.endsWith('.spec.ts')) return;\n\n const buffer = tree.read(path);\n if (!buffer) return;\n\n const original = buffer.toString('utf-8');\n\n // Fast bail: file must mention at least one EUI class name or have\n // ViewChild/ContentChild with string refs (which might reference EUI elements)\n if (!hasEuiReference(original) && !hasStringRefQuery(original)) return;\n\n const result = migrateTypeScript(original, path, tree, context); if (result.source !== original) {\n if (options.dryRun) {\n if (result.editCount > 0) {\n logDryRun(context, `Would migrate ${result.editCount} signal property access(es) in ${path}`);\n }\n if (result.todoCount > 0) {\n logDryRun(\n context,\n `Would comment out ${result.todoCount} programmatic signal-input write(s) with a TODO in ${path}`,\n );\n }\n } else {\n tree.overwrite(path, result.source);\n }\n fileCount++;\n propCount += result.editCount;\n todoCount += result.todoCount;\n }\n });\n\n context.logger.info(`Migrated ${propCount} property access(es) to signal getters in ${fileCount} file(s).`);\n if (todoCount > 0) {\n context.logger.info(\n `Commented out ${todoCount} programmatic signal-input write(s) and left a TODO — these cannot be migrated automatically and need a manual fix.`,\n );\n }\n if (options.dryRun) {\n logDryRunNote(context);\n }\n return tree;\n };\n}\n\n/** Quick check: does the file reference any EUI class name from the signal map? */\nfunction hasEuiReference(source: string): boolean {\n for (const className of Object.keys(EUI_SIGNAL_MAP)) {\n if (source.includes(className)) return true;\n }\n return false;\n}\n\n/** Quick check: does the file have @ViewChild('...') or @ContentChild('...') with string refs? */\nfunction hasStringRefQuery(source: string): boolean {\n return /(@ViewChild|@ContentChild|@ViewChildren|@ContentChildren)\\s*\\(\\s*['\"]/.test(source);\n}\n\ninterface MigrateResult {\n source: string;\n editCount: number;\n todoCount: number;\n}\n\nfunction migrateTypeScript(source: string, filePath: string, tree: Tree, context: SchematicContext): MigrateResult {\n const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);\n const edits: Edit[] = [];\n const todoEdits: Edit[] = [];\n\n // Phase 0: Build template ref map (#refName → EUI class name) from the component's template\n const templateRefMap = buildTemplateRefMap(sourceFile, source, filePath, tree);\n\n // Phase 1: Collect all variables/properties typed as EUI classes\n const euiRefs = collectEuiReferences(sourceFile, source, templateRefMap);\n\n if (euiRefs.size === 0) {\n return { source, editCount: 0, todoCount: 0 };\n }\n\n // Phase 2: Find property accesses on those references and rewrite signal props\n const visitNode = (node: ts.Node): void => {\n // Match: ref.prop (PropertyAccessExpression)\n if (ts.isPropertyAccessExpression(node)) {\n const rewrite = tryRewritePropertyAccess(node, euiRefs, sourceFile, source);\n if (rewrite) {\n edits.push(rewrite);\n }\n\n // Separately: a programmatic WRITE to a now-signal input cannot be\n // migrated automatically. Flag it with a TODO instead of silently\n // leaving a line that will fail to compile against the signal API.\n const todo = tryInsertWriteTodo(node, euiRefs, sourceFile, source);\n if (todo) {\n todoEdits.push(todo);\n }\n }\n ts.forEachChild(node, visitNode);\n };\n\n ts.forEachChild(sourceFile, visitNode);\n\n if (edits.length === 0 && todoEdits.length === 0) {\n return { source, editCount: 0, todoCount: 0 };\n }\n\n const dedupedTodos = deduplicateEdits(todoEdits);\n\n // A TODO edit comments out the whole write statement. Any read-rewrite `()`\n // edit whose position falls inside that commented-out range must be dropped,\n // otherwise we'd both edit and comment the same text (and produce overlapping\n // edits that corrupt the output).\n const keptEdits = edits.filter((edit) => !isInsideAnyRange(edit, dedupedTodos));\n\n return {\n source: applyEdits(source, [...keptEdits, ...dedupedTodos]),\n editCount: keptEdits.length,\n todoCount: dedupedTodos.length,\n };\n}\n\n/**\n * Scans the source file for class properties or variables typed as EUI component classes.\n * Returns a map: localName → Set of signal property names.\n *\n * Handles:\n * @ViewChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild(EuiXxxComponent) name!: EuiXxxComponent;\n * @ViewChild('ref') name: EuiXxxComponent;\n * @ContentChild(EuiXxxComponent) name: EuiXxxComponent;\n * @ViewChild('ref') name: ElementRef; (resolved via template #ref → EUI selector)\n * someVar: EuiXxxComponent; (typed class field, even without decorator)\n * const alias = this.viewChildRef; (alias tracking)\n */\nfunction collectEuiReferences(\n sourceFile: ts.SourceFile,\n source: string,\n templateRefMap: Map<string, string>,\n): Map<string, ReadonlySet<string>> {\n const refs = new Map<string, ReadonlySet<string>>();\n\n // Pass 1: collect directly-typed references\n const visitDirect = (node: ts.Node): void => {\n // Class property declarations\n if (ts.isPropertyDeclaration(node) && node.name && ts.isIdentifier(node.name)) {\n const euiClass = resolveEuiClassName(node, sourceFile, templateRefMap);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[euiClass]);\n }\n }\n\n // Variable declarations (const x: EuiXxxComponent = ...)\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n // Parameter declarations (method(ref: EuiXxxComponent))\n if (ts.isParameter(node) && ts.isIdentifier(node.name)) {\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n refs.set(node.name.text, EUI_SIGNAL_MAP[typeName]);\n }\n }\n\n ts.forEachChild(node, visitDirect);\n };\n\n ts.forEachChild(sourceFile, visitDirect);\n\n // Pass 2: track aliases — variables assigned from already-tracked references\n // e.g. const alias = this.viewChildRef; or const alias = someParam;\n const visitAlias = (node: ts.Node): void => {\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.initializer) {\n // Skip if already tracked (has explicit type annotation)\n if (refs.has(node.name.text)) {\n ts.forEachChild(node, visitAlias);\n return;\n }\n\n const aliasedRef = resolveRefName(node.initializer);\n if (aliasedRef && refs.has(aliasedRef)) {\n refs.set(node.name.text, refs.get(aliasedRef)!);\n }\n }\n\n ts.forEachChild(node, visitAlias);\n };\n\n ts.forEachChild(sourceFile, visitAlias);\n return refs;\n}\n\n/**\n * Resolves the EUI class name from a property declaration.\n * Checks: type annotation → decorator class argument → template ref map.\n */\nfunction resolveEuiClassName(\n node: ts.PropertyDeclaration,\n sourceFile: ts.SourceFile,\n templateRefMap: Map<string, string>,\n): string | null {\n // Check type annotation first\n const typeName = getTypeAnnotationName(node.type);\n if (typeName && EUI_SIGNAL_MAP[typeName]) {\n return typeName;\n }\n\n // Check generic type argument: ElementRef<EuiXxxComponent>\n if (node.type && ts.isTypeReferenceNode(node.type) && node.type.typeArguments?.length) {\n const genericArg = getTypeAnnotationName(node.type.typeArguments[0]);\n if (genericArg && EUI_SIGNAL_MAP[genericArg]) {\n return genericArg;\n }\n }\n\n // Check decorator arguments: @ViewChild(EuiXxxComponent) or @ViewChild('refName')\n if (node.modifiers) {\n for (const modifier of node.modifiers) {\n if (!ts.isDecorator(modifier)) continue;\n if (!ts.isCallExpression(modifier.expression)) continue;\n\n const decoratorName = getDecoratorName(modifier.expression);\n if (!decoratorName) continue;\n if (!['ViewChild', 'ViewChildren', 'ContentChild', 'ContentChildren'].includes(decoratorName)) continue;\n\n const args = modifier.expression.arguments;\n if (args.length > 0) {\n const firstArg = args[0];\n\n // @ViewChild(EuiXxxComponent) — class reference\n if (ts.isIdentifier(firstArg) && EUI_SIGNAL_MAP[firstArg.text]) {\n return firstArg.text;\n }\n\n // @ViewChild('refName') — string template ref, resolve via template\n if (ts.isStringLiteralLike(firstArg)) {\n const refName = firstArg.text;\n const euiClass = templateRefMap.get(refName);\n if (euiClass && EUI_SIGNAL_MAP[euiClass]) {\n return euiClass;\n }\n }\n }\n }\n }\n\n return null;\n}\n\nfunction getDecoratorName(callExpr: ts.CallExpression): string | null {\n if (ts.isIdentifier(callExpr.expression)) {\n return callExpr.expression.text;\n }\n return null;\n}\n\nfunction getTypeAnnotationName(typeNode: ts.TypeNode | undefined): string | null {\n if (!typeNode) return null;\n if (ts.isTypeReferenceNode(typeNode) && ts.isIdentifier(typeNode.typeName)) {\n return typeNode.typeName.text;\n }\n return null;\n}\n\n/**\n * Checks if a property access `ref.prop` should be rewritten to `ref.prop()`.\n *\n * We rewrite if:\n * - `ref` is tracked in euiRefs\n * - `prop` is in the signal set for that EUI class\n * - The access is NOT already a call expression (not `ref.prop()` or `ref.prop(args)`)\n * - The access is NOT a write target (not `ref.prop = value`)\n * - The access is NOT a template binding argument (those are unaffected)\n */\nfunction tryRewritePropertyAccess(\n node: ts.PropertyAccessExpression,\n euiRefs: Map<string, ReadonlySet<string>>,\n sourceFile: ts.SourceFile,\n source: string,\n): Edit | null {\n const propName = node.name.text;\n\n // Resolve the reference name — handle `this.ref.prop` and `ref.prop`\n const refName = resolveRefName(node.expression);\n if (!refName) return null;\n\n const signalProps = euiRefs.get(refName);\n if (!signalProps || !signalProps.has(propName)) return null;\n\n // Skip if parent is already a call expression on this property: ref.prop(...)\n if (ts.isCallExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if this is the left side of an assignment: ref.prop = value\n if (ts.isBinaryExpression(node.parent) &&\n node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&\n node.parent.left === node) {\n return null;\n }\n\n // Skip if this is a compound assignment: ref.prop += value, ref.prop &&= value, etc.\n if (ts.isBinaryExpression(node.parent) && isAssignmentOperator(node.parent.operatorToken.kind) && node.parent.left === node) {\n return null;\n }\n\n // Skip if this is used with delete: delete ref.prop\n if (ts.isDeleteExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip if inside a typeof: typeof ref.prop\n if (ts.isTypeOfExpression(node.parent) && node.parent.expression === node) {\n return null;\n }\n\n // Skip property access chains that go deeper: ref.prop.something → ref.prop().something\n // This IS correct — we still want to add ()\n\n // Rewrite: insert () after the property name\n const end = node.name.getEnd();\n return {\n start: end,\n end: end,\n replacement: '()',\n };\n}\n\nfunction isAssignmentOperator(kind: ts.SyntaxKind): boolean {\n return kind >= ts.SyntaxKind.FirstAssignment && kind <= ts.SyntaxKind.LastAssignment;\n}\n\n/** Marker used to detect an already-inserted TODO so the schematic stays idempotent. */\nconst WRITE_TODO_MARKER = 'TODO(eui-signals):';\n\n/**\n * Detects a programmatic WRITE to a now-signal input and returns an edit that\n * comments out the offending statement and prepends an explanatory TODO.\n *\n * A signal input (`input()`) exposes a read-only getter — it cannot be assigned\n * from outside the component (`comp.prop = value` no longer compiles, and\n * `comp.prop()` is a getter, not a setter). There is no safe, mechanical\n * rewrite: the correct fix is to drive the value declaratively through a\n * template binding (`[prop]=\"...\"`) or, when a ComponentRef is genuinely\n * available, `componentRef.setInput('prop', value)`. Both require human\n * judgement, so instead of rewriting we comment the statement out (keeping the\n * build green) and leave a TODO pointing at the manual fix.\n *\n * Only acts when the assignment is the ENTIRE statement\n * (`ExpressionStatement` whose expression is exactly this assignment):\n * ref.prop = value (simple assignment)\n * ref.prop += value, etc. (compound assignment)\n * where `ref` is a tracked EUI/ECL reference and `prop` is in its signal set.\n *\n * When the write is only part of a larger statement (e.g. inside an `if`\n * without a block, or nested in another expression), commenting it out would\n * also remove unrelated logic, so we leave it untouched (it will surface as a\n * compile error the developer must resolve by hand).\n */\nfunction tryInsertWriteTodo(\n node: ts.PropertyAccessExpression,\n euiRefs: Map<string, ReadonlySet<string>>,\n sourceFile: ts.SourceFile,\n source: string,\n): Edit | null {\n const propName = node.name.text;\n\n const refName = resolveRefName(node.expression);\n if (!refName) return null;\n\n const signalProps = euiRefs.get(refName);\n if (!signalProps || !signalProps.has(propName)) return null;\n\n // Only act on assignment targets: `ref.prop = ...` or `ref.prop <op>= ...`\n if (\n !ts.isBinaryExpression(node.parent) ||\n node.parent.left !== node ||\n !isAssignmentOperator(node.parent.operatorToken.kind)\n ) {\n return null;\n }\n\n const assignment = node.parent;\n\n // Only comment out when the assignment IS the whole statement — otherwise we'd\n // delete unrelated logic from a larger statement.\n const statement = node.parent.parent;\n if (!statement || !ts.isExpressionStatement(statement) || statement.expression !== assignment) {\n return null;\n }\n\n // The statement must stand on its own (a direct child of a block/source), not\n // be the unbraced body of an `if`/`for`/`while` etc. — commenting those out by\n // line would swallow the surrounding `if (...)` and break the code.\n const parent = statement.parent;\n if (\n !parent ||\n !(ts.isBlock(parent) || ts.isSourceFile(parent) || ts.isModuleBlock(parent) || ts.isCaseClause(parent) || ts.isDefaultClause(parent))\n ) {\n return null;\n }\n\n const stmtStart = statement.getStart(sourceFile);\n const stmtEnd = statement.getEnd(); // includes the trailing semicolon\n const lineStart = getLineStartPosition(source, stmtStart);\n const indent = source.slice(lineStart, stmtStart);\n\n // The statement text, as written (may span multiple lines).\n const statementText = source.slice(stmtStart, stmtEnd);\n\n // Comment out every line of the statement, preserving each line's own\n // indentation (insert `// ` after the leading whitespace). The first line's\n // indentation was stripped by starting the replacement at lineStart, so we\n // re-add it explicitly.\n const commentedStatement = statementText\n .split('\\n')\n .map((line, i) => {\n if (i === 0) return `${indent}// ${line}`;\n const lineIndent = line.slice(0, line.length - line.trimStart().length);\n return `${lineIndent}// ${line.trimStart()}`;\n })\n .join('\\n');\n\n const todo =\n `${indent}// ${WRITE_TODO_MARKER} '${propName}' is now a signal input and cannot be assigned directly.\\n` +\n `${indent}// Set it via a template binding ([${propName}]=\"...\") or componentRef.setInput('${propName}', ...).\\n` +\n `${indent}// The original statement is commented out below so the build does not fail:\\n`;\n\n // Replace the statement (from the start of its line, to drop the original\n // indentation we re-add) with the TODO + commented-out statement.\n return {\n start: lineStart,\n end: stmtEnd,\n replacement: todo + commentedStatement,\n };\n}\n\n/** True if `edit`'s position falls within any of the given ranges. */\nfunction isInsideAnyRange(edit: Edit, ranges: Edit[]): boolean {\n return ranges.some((range) => edit.start >= range.start && edit.end <= range.end);\n}\n\n/** Returns the index of the first character of the line containing `pos`. */\nfunction getLineStartPosition(source: string, pos: number): number {\n const newlineIndex = source.lastIndexOf('\\n', pos - 1);\n return newlineIndex === -1 ? 0 : newlineIndex + 1;\n}\n\n/**\n * Resolves a reference name from an expression.\n * Handles: `ref`, `this.ref`, `this._ref`\n */\nfunction resolveRefName(expr: ts.Expression): string | null {\n // Direct identifier: ref.prop\n if (ts.isIdentifier(expr)) {\n return expr.text;\n }\n\n // this.ref.prop\n if (ts.isPropertyAccessExpression(expr) && expr.expression.kind === ts.SyntaxKind.ThisKeyword) {\n return expr.name.text;\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Template ref resolution\n// ---------------------------------------------------------------------------\n\n/**\n * Builds a map of template reference variable names (#ref) to EUI class names.\n *\n * Parses the component's template (inline or external) and finds elements like:\n * <eui-alert #myAlert> → myAlert → EuiAlertComponent\n * <input euiAutocomplete #ac> → ac → EuiAutocompleteComponent\n *\n * Returns Map<refName, euiClassName>.\n */\nfunction buildTemplateRefMap(\n sourceFile: ts.SourceFile,\n source: string,\n filePath: string,\n tree: Tree,\n): Map<string, string> {\n const refMap = new Map<string, string>();\n\n // Find @Component decorator\n const componentMeta = findComponentMetadata(sourceFile, source);\n if (!componentMeta) return refMap;\n\n let templateSource: string | null = null;\n\n if (componentMeta.inlineTemplate !== null) {\n templateSource = componentMeta.inlineTemplate;\n } else if (componentMeta.templateUrl) {\n // Resolve templateUrl relative to the TS file\n const dir = filePath.substring(0, filePath.lastIndexOf('/'));\n const templatePath = `${dir}/${componentMeta.templateUrl}`;\n const buffer = tree.read(templatePath);\n if (buffer) {\n templateSource = buffer.toString('utf-8');\n }\n }\n\n if (!templateSource) return refMap;\n\n // Parse the template and collect #refs\n try {\n const parsed = parseTemplate(templateSource, '', { preserveWhitespaces: true });\n collectTemplateRefs(parsed.nodes, refMap);\n } catch {\n // Template parse failure — silently skip (might be malformed or use third-party syntax)\n }\n\n return refMap;\n}\n\n/**\n * Extracts @Component metadata: templateUrl or inline template content.\n */\nfunction findComponentMetadata(\n sourceFile: ts.SourceFile,\n source: string,\n): { templateUrl: string | null; inlineTemplate: string | null } | null {\n let result: { templateUrl: string | null; inlineTemplate: string | null } | null = null;\n\n const visit = (node: ts.Node): void => {\n if (result) return;\n\n if (ts.isDecorator(node) && ts.isCallExpression(node.expression)) {\n const name = getDecoratorName(node.expression);\n if (name !== 'Component') {\n ts.forEachChild(node, visit);\n return;\n }\n\n const args = node.expression.arguments;\n if (args.length === 0 || !ts.isObjectLiteralExpression(args[0])) {\n ts.forEachChild(node, visit);\n return;\n }\n\n const meta: { templateUrl: string | null; inlineTemplate: string | null } = {\n templateUrl: null,\n inlineTemplate: null,\n };\n\n for (const prop of args[0].properties) {\n if (!ts.isPropertyAssignment(prop) || !ts.isIdentifier(prop.name)) continue;\n\n if (prop.name.text === 'templateUrl') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.templateUrl = init.text;\n }\n }\n\n if (prop.name.text === 'template') {\n const init = unwrapExpression(prop.initializer);\n if (ts.isStringLiteralLike(init)) {\n meta.inlineTemplate = init.text;\n } else if (ts.isNoSubstitutionTemplateLiteral(init)) {\n meta.inlineTemplate = init.text;\n }\n }\n }\n\n result = meta;\n return;\n }\n\n ts.forEachChild(node, visit);\n };\n\n ts.forEachChild(sourceFile, visit);\n return result;\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\n/**\n * Recursively walks template AST nodes, collecting #refName → EUI class name mappings.\n *\n * For each element with a template reference (#ref), we try to resolve its EUI class:\n * 1. Match element tag name against EUI_SELECTOR_TO_CLASS (e.g. 'eui-alert' → EuiAlertComponent)\n * 2. Match element attributes against attribute selectors (e.g. [euiAutocomplete] → EuiAutocompleteComponent)\n */\nfunction collectTemplateRefs(nodes: TmplAstNode[], refMap: Map<string, string>): void {\n for (const node of nodes) {\n if (node instanceof TmplAstElement) {\n if (node.references && node.references.length > 0) {\n const euiClass = resolveElementToEuiClass(node);\n if (euiClass) {\n for (const ref of node.references) {\n refMap.set(ref.name, euiClass);\n }\n }\n }\n collectTemplateRefs(node.children, refMap);\n }\n }\n}\n\n/**\n * Given a template element, resolves it to an EUI class name by checking:\n * 1. Tag name: <eui-alert> → look up 'eui-alert' in EUI_SELECTOR_TO_CLASS\n * 2. Attribute selectors: <input euiAutocomplete> → look up 'input[euiAutocomplete]' or '[euiAutocomplete]'\n */\nfunction resolveElementToEuiClass(element: TmplAstElement): string | null {\n const tag = element.name;\n\n // Direct tag match: eui-alert, eui-dialog, etc.\n if (EUI_SELECTOR_TO_CLASS[tag]) {\n return EUI_SELECTOR_TO_CLASS[tag];\n }\n\n // Attribute selector match: check all attributes against known patterns\n const allAttrNames = [\n ...element.attributes.map((a) => a.name),\n ...element.inputs.map((i) => i.name),\n ];\n\n for (const attrName of allAttrNames) {\n // Try tag[attr] pattern first (e.g. 'button[euiButton]', 'input[euiAutocomplete]')\n const tagAttrSelector = `${tag}[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[tagAttrSelector]) {\n return EUI_SELECTOR_TO_CLASS[tagAttrSelector];\n }\n\n // Try [attr] pattern (e.g. '[euiTooltip]', '[euiLoading]')\n const attrSelector = `[${attrName}]`;\n if (EUI_SELECTOR_TO_CLASS[attrSelector]) {\n return EUI_SELECTOR_TO_CLASS[attrSelector];\n }\n }\n\n return null;\n}\n\n// ---------------------------------------------------------------------------\n// Edit helpers\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",
|
|
4742
4806
|
"displayName": "Schema",
|
|
4743
4807
|
"properties": [
|
|
4744
4808
|
{
|
|
@@ -25686,7 +25750,7 @@
|
|
|
25686
25750
|
"deprecated": false,
|
|
25687
25751
|
"deprecationMessage": "",
|
|
25688
25752
|
"type": "readonly RemovedAttr[]",
|
|
25689
|
-
"defaultValue": "[\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n '
|
|
25753
|
+
"defaultValue": "[\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n 'EclDatePickerDirective (input[eclDatePicker]) was removed in v22. Use EclDatePickerDuetDirective on a <duet-date-picker eclDatePicker> element; yearRange/format/firstDayOfWeek are configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n 'EclRadioHelpComponent ([eclRadioHelp]) was removed in v22. Use [eclHelpBlock] (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n]"
|
|
25690
25754
|
},
|
|
25691
25755
|
{
|
|
25692
25756
|
"name": "REMOVED_IDENTIFIERS",
|
|
@@ -25697,7 +25761,7 @@
|
|
|
25697
25761
|
"deprecated": false,
|
|
25698
25762
|
"deprecationMessage": "",
|
|
25699
25763
|
"type": "readonly RemovedIdentifier[]",
|
|
25700
|
-
"defaultValue": "[\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective
|
|
25764
|
+
"defaultValue": "[\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective (it now provides EclDatePickerDuetDirective). The import still works; update your markup from <input eclDatePicker> to <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n]"
|
|
25701
25765
|
},
|
|
25702
25766
|
{
|
|
25703
25767
|
"name": "REMOVED_INPUT",
|
|
@@ -25807,7 +25871,7 @@
|
|
|
25807
25871
|
"deprecated": false,
|
|
25808
25872
|
"deprecationMessage": "",
|
|
25809
25873
|
"type": "readonly RemovedTag[]",
|
|
25810
|
-
"defaultValue": "[\n {\n tag: 'ecl-site-header-banner-top',\n message:\n '<ecl-site-header-banner-top>
|
|
25874
|
+
"defaultValue": "[\n {\n tag: 'ecl-site-header-banner-top',\n message:\n 'EclSiteHeaderBannerTopComponent (<ecl-site-header-banner-top>) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n]"
|
|
25811
25875
|
},
|
|
25812
25876
|
{
|
|
25813
25877
|
"name": "REPLACEMENT_VALUE",
|
|
@@ -25947,6 +26011,17 @@
|
|
|
25947
26011
|
"type": "unknown",
|
|
25948
26012
|
"defaultValue": "new Map([\n ['isStickyColumn', 'isStickyCol'],\n ['sortable', 'isSortable'],\n])"
|
|
25949
26013
|
},
|
|
26014
|
+
{
|
|
26015
|
+
"name": "TODO_PREFIX",
|
|
26016
|
+
"ctype": "miscellaneous",
|
|
26017
|
+
"subtype": "variable",
|
|
26018
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
26019
|
+
"coverageIgnore": false,
|
|
26020
|
+
"deprecated": false,
|
|
26021
|
+
"deprecationMessage": "",
|
|
26022
|
+
"type": "string",
|
|
26023
|
+
"defaultValue": "'TODO: [eUI v22 migration]'"
|
|
26024
|
+
},
|
|
25950
26025
|
{
|
|
25951
26026
|
"name": "TR_INPUT_RENAMES",
|
|
25952
26027
|
"ctype": "miscellaneous",
|
|
@@ -26235,6 +26310,19 @@
|
|
|
26235
26310
|
"type": "unknown",
|
|
26236
26311
|
"defaultValue": "new Set([...PROPAGATED_INPUTS, 'chipRemove', 'isChipsRemovable', 'chipsLabelTruncateCount',\n 'maxVisibleChipsCount', 'isMaxVisibleChipsOpened', 'toggleLinkMoreLabel', 'toggleLinkLessLabel',\n 'isChipsSorted', 'chipsSortOrder'])"
|
|
26237
26312
|
},
|
|
26313
|
+
{
|
|
26314
|
+
"name": "WRITE_TODO_MARKER",
|
|
26315
|
+
"ctype": "miscellaneous",
|
|
26316
|
+
"subtype": "variable",
|
|
26317
|
+
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
26318
|
+
"coverageIgnore": false,
|
|
26319
|
+
"deprecated": false,
|
|
26320
|
+
"deprecationMessage": "",
|
|
26321
|
+
"type": "string",
|
|
26322
|
+
"defaultValue": "'TODO(eui-signals):'",
|
|
26323
|
+
"rawdescription": "Marker used to detect an already-inserted TODO so the schematic stays idempotent.",
|
|
26324
|
+
"description": "<p>Marker used to detect an already-inserted TODO so the schematic stays idempotent.</p>\n"
|
|
26325
|
+
},
|
|
26238
26326
|
{
|
|
26239
26327
|
"name": "YELLOW",
|
|
26240
26328
|
"ctype": "miscellaneous",
|
|
@@ -26558,6 +26646,51 @@
|
|
|
26558
26646
|
}
|
|
26559
26647
|
]
|
|
26560
26648
|
},
|
|
26649
|
+
{
|
|
26650
|
+
"name": "applyAnnotations",
|
|
26651
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
26652
|
+
"ctype": "miscellaneous",
|
|
26653
|
+
"subtype": "function",
|
|
26654
|
+
"coverageIgnore": false,
|
|
26655
|
+
"deprecated": false,
|
|
26656
|
+
"deprecationMessage": "",
|
|
26657
|
+
"rawdescription": "",
|
|
26658
|
+
"description": "",
|
|
26659
|
+
"displayName": "applyAnnotations",
|
|
26660
|
+
"args": [
|
|
26661
|
+
{
|
|
26662
|
+
"name": "source",
|
|
26663
|
+
"type": "string",
|
|
26664
|
+
"deprecated": false,
|
|
26665
|
+
"deprecationMessage": ""
|
|
26666
|
+
},
|
|
26667
|
+
{
|
|
26668
|
+
"name": "annotations",
|
|
26669
|
+
"deprecated": false,
|
|
26670
|
+
"deprecationMessage": ""
|
|
26671
|
+
}
|
|
26672
|
+
],
|
|
26673
|
+
"returnType": "string",
|
|
26674
|
+
"jsdoctags": [
|
|
26675
|
+
{
|
|
26676
|
+
"name": "source",
|
|
26677
|
+
"type": "string",
|
|
26678
|
+
"deprecated": false,
|
|
26679
|
+
"deprecationMessage": "",
|
|
26680
|
+
"tagName": {
|
|
26681
|
+
"text": "param"
|
|
26682
|
+
}
|
|
26683
|
+
},
|
|
26684
|
+
{
|
|
26685
|
+
"name": "annotations",
|
|
26686
|
+
"deprecated": false,
|
|
26687
|
+
"deprecationMessage": "",
|
|
26688
|
+
"tagName": {
|
|
26689
|
+
"text": "param"
|
|
26690
|
+
}
|
|
26691
|
+
}
|
|
26692
|
+
]
|
|
26693
|
+
},
|
|
26561
26694
|
{
|
|
26562
26695
|
"name": "applyChanges",
|
|
26563
26696
|
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
@@ -28083,8 +28216,8 @@
|
|
|
28083
28216
|
]
|
|
28084
28217
|
},
|
|
28085
28218
|
{
|
|
28086
|
-
"name": "
|
|
28087
|
-
"file": "packages/core/schematics/migrate-ecl-
|
|
28219
|
+
"name": "collectCategoryRemovals",
|
|
28220
|
+
"file": "packages/core/schematics/migrate-ecl-quiz/index.ts",
|
|
28088
28221
|
"ctype": "miscellaneous",
|
|
28089
28222
|
"subtype": "function",
|
|
28090
28223
|
"coverageIgnore": false,
|
|
@@ -28092,7 +28225,7 @@
|
|
|
28092
28225
|
"deprecationMessage": "",
|
|
28093
28226
|
"rawdescription": "",
|
|
28094
28227
|
"description": "",
|
|
28095
|
-
"displayName": "
|
|
28228
|
+
"displayName": "collectCategoryRemovals",
|
|
28096
28229
|
"args": [
|
|
28097
28230
|
{
|
|
28098
28231
|
"name": "element",
|
|
@@ -28101,25 +28234,18 @@
|
|
|
28101
28234
|
"deprecationMessage": ""
|
|
28102
28235
|
},
|
|
28103
28236
|
{
|
|
28104
|
-
"name": "
|
|
28105
|
-
"type": "number",
|
|
28106
|
-
"deprecated": false,
|
|
28107
|
-
"deprecationMessage": ""
|
|
28108
|
-
},
|
|
28109
|
-
{
|
|
28110
|
-
"name": "path",
|
|
28237
|
+
"name": "source",
|
|
28111
28238
|
"type": "string",
|
|
28112
28239
|
"deprecated": false,
|
|
28113
28240
|
"deprecationMessage": ""
|
|
28114
28241
|
},
|
|
28115
28242
|
{
|
|
28116
|
-
"name": "
|
|
28117
|
-
"type": "SchematicContext",
|
|
28243
|
+
"name": "edits",
|
|
28118
28244
|
"deprecated": false,
|
|
28119
28245
|
"deprecationMessage": ""
|
|
28120
28246
|
}
|
|
28121
28247
|
],
|
|
28122
|
-
"returnType": "
|
|
28248
|
+
"returnType": "void",
|
|
28123
28249
|
"jsdoctags": [
|
|
28124
28250
|
{
|
|
28125
28251
|
"name": "element",
|
|
@@ -28131,8 +28257,8 @@
|
|
|
28131
28257
|
}
|
|
28132
28258
|
},
|
|
28133
28259
|
{
|
|
28134
|
-
"name": "
|
|
28135
|
-
"type": "
|
|
28260
|
+
"name": "source",
|
|
28261
|
+
"type": "string",
|
|
28136
28262
|
"deprecated": false,
|
|
28137
28263
|
"deprecationMessage": "",
|
|
28138
28264
|
"tagName": {
|
|
@@ -28140,17 +28266,52 @@
|
|
|
28140
28266
|
}
|
|
28141
28267
|
},
|
|
28142
28268
|
{
|
|
28143
|
-
"name": "
|
|
28144
|
-
"type": "string",
|
|
28269
|
+
"name": "edits",
|
|
28145
28270
|
"deprecated": false,
|
|
28146
28271
|
"deprecationMessage": "",
|
|
28147
28272
|
"tagName": {
|
|
28148
28273
|
"text": "param"
|
|
28149
28274
|
}
|
|
28275
|
+
}
|
|
28276
|
+
]
|
|
28277
|
+
},
|
|
28278
|
+
{
|
|
28279
|
+
"name": "collectChildElementRenames",
|
|
28280
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
28281
|
+
"ctype": "miscellaneous",
|
|
28282
|
+
"subtype": "function",
|
|
28283
|
+
"coverageIgnore": false,
|
|
28284
|
+
"deprecated": false,
|
|
28285
|
+
"deprecationMessage": "",
|
|
28286
|
+
"rawdescription": "",
|
|
28287
|
+
"description": "",
|
|
28288
|
+
"displayName": "collectChildElementRenames",
|
|
28289
|
+
"args": [
|
|
28290
|
+
{
|
|
28291
|
+
"name": "element",
|
|
28292
|
+
"type": "TmplAstElement",
|
|
28293
|
+
"deprecated": false,
|
|
28294
|
+
"deprecationMessage": ""
|
|
28150
28295
|
},
|
|
28151
28296
|
{
|
|
28152
|
-
"name": "
|
|
28153
|
-
"
|
|
28297
|
+
"name": "edits",
|
|
28298
|
+
"deprecated": false,
|
|
28299
|
+
"deprecationMessage": ""
|
|
28300
|
+
}
|
|
28301
|
+
],
|
|
28302
|
+
"returnType": "void",
|
|
28303
|
+
"jsdoctags": [
|
|
28304
|
+
{
|
|
28305
|
+
"name": "element",
|
|
28306
|
+
"type": "TmplAstElement",
|
|
28307
|
+
"deprecated": false,
|
|
28308
|
+
"deprecationMessage": "",
|
|
28309
|
+
"tagName": {
|
|
28310
|
+
"text": "param"
|
|
28311
|
+
}
|
|
28312
|
+
},
|
|
28313
|
+
{
|
|
28314
|
+
"name": "edits",
|
|
28154
28315
|
"deprecated": false,
|
|
28155
28316
|
"deprecationMessage": "",
|
|
28156
28317
|
"tagName": {
|
|
@@ -28160,8 +28321,8 @@
|
|
|
28160
28321
|
]
|
|
28161
28322
|
},
|
|
28162
28323
|
{
|
|
28163
|
-
"name": "
|
|
28164
|
-
"file": "packages/core/schematics/migrate-
|
|
28324
|
+
"name": "collectChildInputRemovals",
|
|
28325
|
+
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
28165
28326
|
"ctype": "miscellaneous",
|
|
28166
28327
|
"subtype": "function",
|
|
28167
28328
|
"coverageIgnore": false,
|
|
@@ -28169,7 +28330,7 @@
|
|
|
28169
28330
|
"deprecationMessage": "",
|
|
28170
28331
|
"rawdescription": "",
|
|
28171
28332
|
"description": "",
|
|
28172
|
-
"displayName": "
|
|
28333
|
+
"displayName": "collectChildInputRemovals",
|
|
28173
28334
|
"args": [
|
|
28174
28335
|
{
|
|
28175
28336
|
"name": "element",
|
|
@@ -28187,6 +28348,18 @@
|
|
|
28187
28348
|
"name": "edits",
|
|
28188
28349
|
"deprecated": false,
|
|
28189
28350
|
"deprecationMessage": ""
|
|
28351
|
+
},
|
|
28352
|
+
{
|
|
28353
|
+
"name": "filePath",
|
|
28354
|
+
"type": "string",
|
|
28355
|
+
"deprecated": false,
|
|
28356
|
+
"deprecationMessage": ""
|
|
28357
|
+
},
|
|
28358
|
+
{
|
|
28359
|
+
"name": "context",
|
|
28360
|
+
"type": "SchematicContext",
|
|
28361
|
+
"deprecated": false,
|
|
28362
|
+
"deprecationMessage": ""
|
|
28190
28363
|
}
|
|
28191
28364
|
],
|
|
28192
28365
|
"returnType": "void",
|
|
@@ -28216,38 +28389,10 @@
|
|
|
28216
28389
|
"tagName": {
|
|
28217
28390
|
"text": "param"
|
|
28218
28391
|
}
|
|
28219
|
-
}
|
|
28220
|
-
]
|
|
28221
|
-
},
|
|
28222
|
-
{
|
|
28223
|
-
"name": "collectChildElementRenames",
|
|
28224
|
-
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
28225
|
-
"ctype": "miscellaneous",
|
|
28226
|
-
"subtype": "function",
|
|
28227
|
-
"coverageIgnore": false,
|
|
28228
|
-
"deprecated": false,
|
|
28229
|
-
"deprecationMessage": "",
|
|
28230
|
-
"rawdescription": "",
|
|
28231
|
-
"description": "",
|
|
28232
|
-
"displayName": "collectChildElementRenames",
|
|
28233
|
-
"args": [
|
|
28234
|
-
{
|
|
28235
|
-
"name": "element",
|
|
28236
|
-
"type": "TmplAstElement",
|
|
28237
|
-
"deprecated": false,
|
|
28238
|
-
"deprecationMessage": ""
|
|
28239
28392
|
},
|
|
28240
28393
|
{
|
|
28241
|
-
"name": "
|
|
28242
|
-
"
|
|
28243
|
-
"deprecationMessage": ""
|
|
28244
|
-
}
|
|
28245
|
-
],
|
|
28246
|
-
"returnType": "void",
|
|
28247
|
-
"jsdoctags": [
|
|
28248
|
-
{
|
|
28249
|
-
"name": "element",
|
|
28250
|
-
"type": "TmplAstElement",
|
|
28394
|
+
"name": "filePath",
|
|
28395
|
+
"type": "string",
|
|
28251
28396
|
"deprecated": false,
|
|
28252
28397
|
"deprecationMessage": "",
|
|
28253
28398
|
"tagName": {
|
|
@@ -28255,7 +28400,8 @@
|
|
|
28255
28400
|
}
|
|
28256
28401
|
},
|
|
28257
28402
|
{
|
|
28258
|
-
"name": "
|
|
28403
|
+
"name": "context",
|
|
28404
|
+
"type": "SchematicContext",
|
|
28259
28405
|
"deprecated": false,
|
|
28260
28406
|
"deprecationMessage": "",
|
|
28261
28407
|
"tagName": {
|
|
@@ -28265,8 +28411,8 @@
|
|
|
28265
28411
|
]
|
|
28266
28412
|
},
|
|
28267
28413
|
{
|
|
28268
|
-
"name": "
|
|
28269
|
-
"file": "packages/core/schematics/migrate-
|
|
28414
|
+
"name": "collectEclLinkEdits",
|
|
28415
|
+
"file": "packages/core/schematics/migrate-ecl-link/index.ts",
|
|
28270
28416
|
"ctype": "miscellaneous",
|
|
28271
28417
|
"subtype": "function",
|
|
28272
28418
|
"coverageIgnore": false,
|
|
@@ -28274,7 +28420,7 @@
|
|
|
28274
28420
|
"deprecationMessage": "",
|
|
28275
28421
|
"rawdescription": "",
|
|
28276
28422
|
"description": "",
|
|
28277
|
-
"displayName": "
|
|
28423
|
+
"displayName": "collectEclLinkEdits",
|
|
28278
28424
|
"args": [
|
|
28279
28425
|
{
|
|
28280
28426
|
"name": "element",
|
|
@@ -28355,8 +28501,8 @@
|
|
|
28355
28501
|
]
|
|
28356
28502
|
},
|
|
28357
28503
|
{
|
|
28358
|
-
"name": "
|
|
28359
|
-
"file": "packages/core/schematics/migrate-ecl-
|
|
28504
|
+
"name": "collectElementAnnotation",
|
|
28505
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
28360
28506
|
"ctype": "miscellaneous",
|
|
28361
28507
|
"subtype": "function",
|
|
28362
28508
|
"coverageIgnore": false,
|
|
@@ -28364,7 +28510,7 @@
|
|
|
28364
28510
|
"deprecationMessage": "",
|
|
28365
28511
|
"rawdescription": "",
|
|
28366
28512
|
"description": "",
|
|
28367
|
-
"displayName": "
|
|
28513
|
+
"displayName": "collectElementAnnotation",
|
|
28368
28514
|
"args": [
|
|
28369
28515
|
{
|
|
28370
28516
|
"name": "element",
|
|
@@ -28373,25 +28519,18 @@
|
|
|
28373
28519
|
"deprecationMessage": ""
|
|
28374
28520
|
},
|
|
28375
28521
|
{
|
|
28376
|
-
"name": "
|
|
28377
|
-
"type": "
|
|
28522
|
+
"name": "lineOffset",
|
|
28523
|
+
"type": "number",
|
|
28378
28524
|
"deprecated": false,
|
|
28379
28525
|
"deprecationMessage": ""
|
|
28380
28526
|
},
|
|
28381
28527
|
{
|
|
28382
|
-
"name": "
|
|
28528
|
+
"name": "commentStyle",
|
|
28383
28529
|
"deprecated": false,
|
|
28384
28530
|
"deprecationMessage": ""
|
|
28385
28531
|
},
|
|
28386
28532
|
{
|
|
28387
|
-
"name": "
|
|
28388
|
-
"type": "string",
|
|
28389
|
-
"deprecated": false,
|
|
28390
|
-
"deprecationMessage": ""
|
|
28391
|
-
},
|
|
28392
|
-
{
|
|
28393
|
-
"name": "context",
|
|
28394
|
-
"type": "SchematicContext",
|
|
28533
|
+
"name": "annotations",
|
|
28395
28534
|
"deprecated": false,
|
|
28396
28535
|
"deprecationMessage": ""
|
|
28397
28536
|
}
|
|
@@ -28408,16 +28547,8 @@
|
|
|
28408
28547
|
}
|
|
28409
28548
|
},
|
|
28410
28549
|
{
|
|
28411
|
-
"name": "
|
|
28412
|
-
"type": "
|
|
28413
|
-
"deprecated": false,
|
|
28414
|
-
"deprecationMessage": "",
|
|
28415
|
-
"tagName": {
|
|
28416
|
-
"text": "param"
|
|
28417
|
-
}
|
|
28418
|
-
},
|
|
28419
|
-
{
|
|
28420
|
-
"name": "edits",
|
|
28550
|
+
"name": "lineOffset",
|
|
28551
|
+
"type": "number",
|
|
28421
28552
|
"deprecated": false,
|
|
28422
28553
|
"deprecationMessage": "",
|
|
28423
28554
|
"tagName": {
|
|
@@ -28425,8 +28556,7 @@
|
|
|
28425
28556
|
}
|
|
28426
28557
|
},
|
|
28427
28558
|
{
|
|
28428
|
-
"name": "
|
|
28429
|
-
"type": "string",
|
|
28559
|
+
"name": "commentStyle",
|
|
28430
28560
|
"deprecated": false,
|
|
28431
28561
|
"deprecationMessage": "",
|
|
28432
28562
|
"tagName": {
|
|
@@ -28434,8 +28564,7 @@
|
|
|
28434
28564
|
}
|
|
28435
28565
|
},
|
|
28436
28566
|
{
|
|
28437
|
-
"name": "
|
|
28438
|
-
"type": "SchematicContext",
|
|
28567
|
+
"name": "annotations",
|
|
28439
28568
|
"deprecated": false,
|
|
28440
28569
|
"deprecationMessage": "",
|
|
28441
28570
|
"tagName": {
|
|
@@ -30212,6 +30341,66 @@
|
|
|
30212
30341
|
}
|
|
30213
30342
|
]
|
|
30214
30343
|
},
|
|
30344
|
+
{
|
|
30345
|
+
"name": "collectTemplateAnnotations",
|
|
30346
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
30347
|
+
"ctype": "miscellaneous",
|
|
30348
|
+
"subtype": "function",
|
|
30349
|
+
"coverageIgnore": false,
|
|
30350
|
+
"deprecated": false,
|
|
30351
|
+
"deprecationMessage": "",
|
|
30352
|
+
"rawdescription": "",
|
|
30353
|
+
"description": "",
|
|
30354
|
+
"displayName": "collectTemplateAnnotations",
|
|
30355
|
+
"args": [
|
|
30356
|
+
{
|
|
30357
|
+
"name": "template",
|
|
30358
|
+
"type": "string",
|
|
30359
|
+
"deprecated": false,
|
|
30360
|
+
"deprecationMessage": ""
|
|
30361
|
+
},
|
|
30362
|
+
{
|
|
30363
|
+
"name": "lineOffset",
|
|
30364
|
+
"type": "number",
|
|
30365
|
+
"deprecated": false,
|
|
30366
|
+
"deprecationMessage": ""
|
|
30367
|
+
},
|
|
30368
|
+
{
|
|
30369
|
+
"name": "commentStyle",
|
|
30370
|
+
"deprecated": false,
|
|
30371
|
+
"deprecationMessage": ""
|
|
30372
|
+
}
|
|
30373
|
+
],
|
|
30374
|
+
"returnType": "Annotation[]",
|
|
30375
|
+
"jsdoctags": [
|
|
30376
|
+
{
|
|
30377
|
+
"name": "template",
|
|
30378
|
+
"type": "string",
|
|
30379
|
+
"deprecated": false,
|
|
30380
|
+
"deprecationMessage": "",
|
|
30381
|
+
"tagName": {
|
|
30382
|
+
"text": "param"
|
|
30383
|
+
}
|
|
30384
|
+
},
|
|
30385
|
+
{
|
|
30386
|
+
"name": "lineOffset",
|
|
30387
|
+
"type": "number",
|
|
30388
|
+
"deprecated": false,
|
|
30389
|
+
"deprecationMessage": "",
|
|
30390
|
+
"tagName": {
|
|
30391
|
+
"text": "param"
|
|
30392
|
+
}
|
|
30393
|
+
},
|
|
30394
|
+
{
|
|
30395
|
+
"name": "commentStyle",
|
|
30396
|
+
"deprecated": false,
|
|
30397
|
+
"deprecationMessage": "",
|
|
30398
|
+
"tagName": {
|
|
30399
|
+
"text": "param"
|
|
30400
|
+
}
|
|
30401
|
+
}
|
|
30402
|
+
]
|
|
30403
|
+
},
|
|
30215
30404
|
{
|
|
30216
30405
|
"name": "collectTemplateEmptyMessageRename",
|
|
30217
30406
|
"file": "packages/core/schematics/migrate-eui-table/index.ts",
|
|
@@ -30302,6 +30491,53 @@
|
|
|
30302
30491
|
}
|
|
30303
30492
|
]
|
|
30304
30493
|
},
|
|
30494
|
+
{
|
|
30495
|
+
"name": "collectTypeScriptAnnotations",
|
|
30496
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
30497
|
+
"ctype": "miscellaneous",
|
|
30498
|
+
"subtype": "function",
|
|
30499
|
+
"coverageIgnore": false,
|
|
30500
|
+
"deprecated": false,
|
|
30501
|
+
"deprecationMessage": "",
|
|
30502
|
+
"rawdescription": "",
|
|
30503
|
+
"description": "",
|
|
30504
|
+
"displayName": "collectTypeScriptAnnotations",
|
|
30505
|
+
"args": [
|
|
30506
|
+
{
|
|
30507
|
+
"name": "source",
|
|
30508
|
+
"type": "string",
|
|
30509
|
+
"deprecated": false,
|
|
30510
|
+
"deprecationMessage": ""
|
|
30511
|
+
},
|
|
30512
|
+
{
|
|
30513
|
+
"name": "path",
|
|
30514
|
+
"type": "string",
|
|
30515
|
+
"deprecated": false,
|
|
30516
|
+
"deprecationMessage": ""
|
|
30517
|
+
}
|
|
30518
|
+
],
|
|
30519
|
+
"returnType": "Annotation[]",
|
|
30520
|
+
"jsdoctags": [
|
|
30521
|
+
{
|
|
30522
|
+
"name": "source",
|
|
30523
|
+
"type": "string",
|
|
30524
|
+
"deprecated": false,
|
|
30525
|
+
"deprecationMessage": "",
|
|
30526
|
+
"tagName": {
|
|
30527
|
+
"text": "param"
|
|
30528
|
+
}
|
|
30529
|
+
},
|
|
30530
|
+
{
|
|
30531
|
+
"name": "path",
|
|
30532
|
+
"type": "string",
|
|
30533
|
+
"deprecated": false,
|
|
30534
|
+
"deprecationMessage": "",
|
|
30535
|
+
"tagName": {
|
|
30536
|
+
"text": "param"
|
|
30537
|
+
}
|
|
30538
|
+
}
|
|
30539
|
+
]
|
|
30540
|
+
},
|
|
30305
30541
|
{
|
|
30306
30542
|
"name": "ConsoleHttpErrorCallbackFn",
|
|
30307
30543
|
"file": "packages/core/src/lib/services/errors/http-error-handler-callback-functions.ts",
|
|
@@ -32803,6 +33039,53 @@
|
|
|
32803
33039
|
}
|
|
32804
33040
|
]
|
|
32805
33041
|
},
|
|
33042
|
+
{
|
|
33043
|
+
"name": "getLineStartPosition",
|
|
33044
|
+
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
33045
|
+
"ctype": "miscellaneous",
|
|
33046
|
+
"subtype": "function",
|
|
33047
|
+
"coverageIgnore": false,
|
|
33048
|
+
"deprecated": false,
|
|
33049
|
+
"deprecationMessage": "",
|
|
33050
|
+
"rawdescription": "Returns the index of the first character of the line containing `pos`.",
|
|
33051
|
+
"description": "<p>Returns the index of the first character of the line containing <code>pos</code>.</p>\n",
|
|
33052
|
+
"displayName": "getLineStartPosition",
|
|
33053
|
+
"args": [
|
|
33054
|
+
{
|
|
33055
|
+
"name": "source",
|
|
33056
|
+
"type": "string",
|
|
33057
|
+
"deprecated": false,
|
|
33058
|
+
"deprecationMessage": ""
|
|
33059
|
+
},
|
|
33060
|
+
{
|
|
33061
|
+
"name": "pos",
|
|
33062
|
+
"type": "number",
|
|
33063
|
+
"deprecated": false,
|
|
33064
|
+
"deprecationMessage": ""
|
|
33065
|
+
}
|
|
33066
|
+
],
|
|
33067
|
+
"returnType": "number",
|
|
33068
|
+
"jsdoctags": [
|
|
33069
|
+
{
|
|
33070
|
+
"name": "source",
|
|
33071
|
+
"type": "string",
|
|
33072
|
+
"deprecated": false,
|
|
33073
|
+
"deprecationMessage": "",
|
|
33074
|
+
"tagName": {
|
|
33075
|
+
"text": "param"
|
|
33076
|
+
}
|
|
33077
|
+
},
|
|
33078
|
+
{
|
|
33079
|
+
"name": "pos",
|
|
33080
|
+
"type": "number",
|
|
33081
|
+
"deprecated": false,
|
|
33082
|
+
"deprecationMessage": "",
|
|
33083
|
+
"tagName": {
|
|
33084
|
+
"text": "param"
|
|
33085
|
+
}
|
|
33086
|
+
}
|
|
33087
|
+
]
|
|
33088
|
+
},
|
|
32806
33089
|
{
|
|
32807
33090
|
"name": "getLogAppendersConfig",
|
|
32808
33091
|
"file": "packages/core/src/lib/services/app/factories/log.ts",
|
|
@@ -34937,63 +35220,25 @@
|
|
|
34937
35220
|
]
|
|
34938
35221
|
},
|
|
34939
35222
|
{
|
|
34940
|
-
"name": "
|
|
34941
|
-
"file": "packages/core/
|
|
35223
|
+
"name": "isInsideAnyRange",
|
|
35224
|
+
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
34942
35225
|
"ctype": "miscellaneous",
|
|
34943
35226
|
"subtype": "function",
|
|
34944
35227
|
"coverageIgnore": false,
|
|
34945
35228
|
"deprecated": false,
|
|
34946
35229
|
"deprecationMessage": "",
|
|
34947
|
-
"rawdescription": "
|
|
34948
|
-
"description": "<p>
|
|
34949
|
-
"displayName": "
|
|
35230
|
+
"rawdescription": "True if `edit`'s position falls within any of the given ranges.",
|
|
35231
|
+
"description": "<p>True if <code>edit</code>'s position falls within any of the given ranges.</p>\n",
|
|
35232
|
+
"displayName": "isInsideAnyRange",
|
|
34950
35233
|
"args": [
|
|
34951
35234
|
{
|
|
34952
|
-
"name": "
|
|
34953
|
-
"type": "
|
|
35235
|
+
"name": "edit",
|
|
35236
|
+
"type": "Edit",
|
|
34954
35237
|
"deprecated": false,
|
|
34955
35238
|
"deprecationMessage": ""
|
|
34956
|
-
}
|
|
34957
|
-
],
|
|
34958
|
-
"returnType": "boolean",
|
|
34959
|
-
"jsdoctags": [
|
|
34960
|
-
{
|
|
34961
|
-
"name": "config",
|
|
34962
|
-
"type": "LogConfig",
|
|
34963
|
-
"deprecated": false,
|
|
34964
|
-
"deprecationMessage": "",
|
|
34965
|
-
"tagName": {
|
|
34966
|
-
"text": "param"
|
|
34967
|
-
}
|
|
34968
35239
|
},
|
|
34969
35240
|
{
|
|
34970
|
-
"
|
|
34971
|
-
"pos": 495,
|
|
34972
|
-
"end": 502,
|
|
34973
|
-
"kind": 80,
|
|
34974
|
-
"id": 0,
|
|
34975
|
-
"flags": 16777216,
|
|
34976
|
-
"transformFlags": 0,
|
|
34977
|
-
"escapedText": "returns"
|
|
34978
|
-
},
|
|
34979
|
-
"comment": "<p>true/false</p>\n"
|
|
34980
|
-
}
|
|
34981
|
-
]
|
|
34982
|
-
},
|
|
34983
|
-
{
|
|
34984
|
-
"name": "isPartOfImport",
|
|
34985
|
-
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
34986
|
-
"ctype": "miscellaneous",
|
|
34987
|
-
"subtype": "function",
|
|
34988
|
-
"coverageIgnore": false,
|
|
34989
|
-
"deprecated": false,
|
|
34990
|
-
"deprecationMessage": "",
|
|
34991
|
-
"rawdescription": "",
|
|
34992
|
-
"description": "",
|
|
34993
|
-
"displayName": "isPartOfImport",
|
|
34994
|
-
"args": [
|
|
34995
|
-
{
|
|
34996
|
-
"name": "node",
|
|
35241
|
+
"name": "ranges",
|
|
34997
35242
|
"deprecated": false,
|
|
34998
35243
|
"deprecationMessage": ""
|
|
34999
35244
|
}
|
|
@@ -35001,37 +35246,16 @@
|
|
|
35001
35246
|
"returnType": "boolean",
|
|
35002
35247
|
"jsdoctags": [
|
|
35003
35248
|
{
|
|
35004
|
-
"name": "
|
|
35249
|
+
"name": "edit",
|
|
35250
|
+
"type": "Edit",
|
|
35005
35251
|
"deprecated": false,
|
|
35006
35252
|
"deprecationMessage": "",
|
|
35007
35253
|
"tagName": {
|
|
35008
35254
|
"text": "param"
|
|
35009
35255
|
}
|
|
35010
|
-
}
|
|
35011
|
-
]
|
|
35012
|
-
},
|
|
35013
|
-
{
|
|
35014
|
-
"name": "isSelectorsDictionary",
|
|
35015
|
-
"file": "packages/core/src/lib/services/store/ngrx_kit.ts",
|
|
35016
|
-
"ctype": "miscellaneous",
|
|
35017
|
-
"subtype": "function",
|
|
35018
|
-
"coverageIgnore": false,
|
|
35019
|
-
"deprecated": false,
|
|
35020
|
-
"deprecationMessage": "",
|
|
35021
|
-
"rawdescription": "",
|
|
35022
|
-
"description": "",
|
|
35023
|
-
"displayName": "isSelectorsDictionary",
|
|
35024
|
-
"args": [
|
|
35025
|
-
{
|
|
35026
|
-
"name": "selectors",
|
|
35027
|
-
"deprecated": false,
|
|
35028
|
-
"deprecationMessage": ""
|
|
35029
|
-
}
|
|
35030
|
-
],
|
|
35031
|
-
"returnType": "Record<string | Selector<unknown, unknown>>",
|
|
35032
|
-
"jsdoctags": [
|
|
35256
|
+
},
|
|
35033
35257
|
{
|
|
35034
|
-
"name": "
|
|
35258
|
+
"name": "ranges",
|
|
35035
35259
|
"deprecated": false,
|
|
35036
35260
|
"deprecationMessage": "",
|
|
35037
35261
|
"tagName": {
|
|
@@ -35041,19 +35265,20 @@
|
|
|
35041
35265
|
]
|
|
35042
35266
|
},
|
|
35043
35267
|
{
|
|
35044
|
-
"name": "
|
|
35045
|
-
"file": "packages/core/
|
|
35268
|
+
"name": "isLogConfigDefined",
|
|
35269
|
+
"file": "packages/core/src/lib/services/app/factories/log.ts",
|
|
35046
35270
|
"ctype": "miscellaneous",
|
|
35047
35271
|
"subtype": "function",
|
|
35048
35272
|
"coverageIgnore": false,
|
|
35049
35273
|
"deprecated": false,
|
|
35050
35274
|
"deprecationMessage": "",
|
|
35051
|
-
"rawdescription": "",
|
|
35052
|
-
"description": "",
|
|
35053
|
-
"displayName": "
|
|
35275
|
+
"rawdescription": "Helper function to check if the log config is defined.\nDoes not check only for empty object, because the config can have other (non-log) parameters",
|
|
35276
|
+
"description": "<p>Helper function to check if the log config is defined.\nDoes not check only for empty object, because the config can have other (non-log) parameters</p>\n",
|
|
35277
|
+
"displayName": "isLogConfigDefined",
|
|
35054
35278
|
"args": [
|
|
35055
35279
|
{
|
|
35056
|
-
"name": "
|
|
35280
|
+
"name": "config",
|
|
35281
|
+
"type": "LogConfig",
|
|
35057
35282
|
"deprecated": false,
|
|
35058
35283
|
"deprecationMessage": ""
|
|
35059
35284
|
}
|
|
@@ -35061,18 +35286,31 @@
|
|
|
35061
35286
|
"returnType": "boolean",
|
|
35062
35287
|
"jsdoctags": [
|
|
35063
35288
|
{
|
|
35064
|
-
"name": "
|
|
35289
|
+
"name": "config",
|
|
35290
|
+
"type": "LogConfig",
|
|
35065
35291
|
"deprecated": false,
|
|
35066
35292
|
"deprecationMessage": "",
|
|
35067
35293
|
"tagName": {
|
|
35068
35294
|
"text": "param"
|
|
35069
35295
|
}
|
|
35296
|
+
},
|
|
35297
|
+
{
|
|
35298
|
+
"tagName": {
|
|
35299
|
+
"pos": 495,
|
|
35300
|
+
"end": 502,
|
|
35301
|
+
"kind": 80,
|
|
35302
|
+
"id": 0,
|
|
35303
|
+
"flags": 16777216,
|
|
35304
|
+
"transformFlags": 0,
|
|
35305
|
+
"escapedText": "returns"
|
|
35306
|
+
},
|
|
35307
|
+
"comment": "<p>true/false</p>\n"
|
|
35070
35308
|
}
|
|
35071
35309
|
]
|
|
35072
35310
|
},
|
|
35073
35311
|
{
|
|
35074
|
-
"name": "
|
|
35075
|
-
"file": "packages/core/schematics/migrate-
|
|
35312
|
+
"name": "isPartOfImport",
|
|
35313
|
+
"file": "packages/core/schematics/migrate-eui-tooltip/index.ts",
|
|
35076
35314
|
"ctype": "miscellaneous",
|
|
35077
35315
|
"subtype": "function",
|
|
35078
35316
|
"coverageIgnore": false,
|
|
@@ -35080,7 +35318,7 @@
|
|
|
35080
35318
|
"deprecationMessage": "",
|
|
35081
35319
|
"rawdescription": "",
|
|
35082
35320
|
"description": "",
|
|
35083
|
-
"displayName": "
|
|
35321
|
+
"displayName": "isPartOfImport",
|
|
35084
35322
|
"args": [
|
|
35085
35323
|
{
|
|
35086
35324
|
"name": "node",
|
|
@@ -35101,8 +35339,8 @@
|
|
|
35101
35339
|
]
|
|
35102
35340
|
},
|
|
35103
35341
|
{
|
|
35104
|
-
"name": "
|
|
35105
|
-
"file": "packages/core/
|
|
35342
|
+
"name": "isSelectorsDictionary",
|
|
35343
|
+
"file": "packages/core/src/lib/services/store/ngrx_kit.ts",
|
|
35106
35344
|
"ctype": "miscellaneous",
|
|
35107
35345
|
"subtype": "function",
|
|
35108
35346
|
"coverageIgnore": false,
|
|
@@ -35110,18 +35348,18 @@
|
|
|
35110
35348
|
"deprecationMessage": "",
|
|
35111
35349
|
"rawdescription": "",
|
|
35112
35350
|
"description": "",
|
|
35113
|
-
"displayName": "
|
|
35351
|
+
"displayName": "isSelectorsDictionary",
|
|
35114
35352
|
"args": [
|
|
35115
35353
|
{
|
|
35116
|
-
"name": "
|
|
35354
|
+
"name": "selectors",
|
|
35117
35355
|
"deprecated": false,
|
|
35118
35356
|
"deprecationMessage": ""
|
|
35119
35357
|
}
|
|
35120
35358
|
],
|
|
35121
|
-
"returnType": "
|
|
35359
|
+
"returnType": "Record<string | Selector<unknown, unknown>>",
|
|
35122
35360
|
"jsdoctags": [
|
|
35123
35361
|
{
|
|
35124
|
-
"name": "
|
|
35362
|
+
"name": "selectors",
|
|
35125
35363
|
"deprecated": false,
|
|
35126
35364
|
"deprecationMessage": "",
|
|
35127
35365
|
"tagName": {
|
|
@@ -35132,7 +35370,97 @@
|
|
|
35132
35370
|
},
|
|
35133
35371
|
{
|
|
35134
35372
|
"name": "isTemplateProperty",
|
|
35135
|
-
"file": "packages/core/schematics/migrate-ecl-
|
|
35373
|
+
"file": "packages/core/schematics/migrate-ecl-breadcrumb/index.ts",
|
|
35374
|
+
"ctype": "miscellaneous",
|
|
35375
|
+
"subtype": "function",
|
|
35376
|
+
"coverageIgnore": false,
|
|
35377
|
+
"deprecated": false,
|
|
35378
|
+
"deprecationMessage": "",
|
|
35379
|
+
"rawdescription": "",
|
|
35380
|
+
"description": "",
|
|
35381
|
+
"displayName": "isTemplateProperty",
|
|
35382
|
+
"args": [
|
|
35383
|
+
{
|
|
35384
|
+
"name": "node",
|
|
35385
|
+
"deprecated": false,
|
|
35386
|
+
"deprecationMessage": ""
|
|
35387
|
+
}
|
|
35388
|
+
],
|
|
35389
|
+
"returnType": "boolean",
|
|
35390
|
+
"jsdoctags": [
|
|
35391
|
+
{
|
|
35392
|
+
"name": "node",
|
|
35393
|
+
"deprecated": false,
|
|
35394
|
+
"deprecationMessage": "",
|
|
35395
|
+
"tagName": {
|
|
35396
|
+
"text": "param"
|
|
35397
|
+
}
|
|
35398
|
+
}
|
|
35399
|
+
]
|
|
35400
|
+
},
|
|
35401
|
+
{
|
|
35402
|
+
"name": "isTemplateProperty",
|
|
35403
|
+
"file": "packages/core/schematics/migrate-ecl-file/index.ts",
|
|
35404
|
+
"ctype": "miscellaneous",
|
|
35405
|
+
"subtype": "function",
|
|
35406
|
+
"coverageIgnore": false,
|
|
35407
|
+
"deprecated": false,
|
|
35408
|
+
"deprecationMessage": "",
|
|
35409
|
+
"rawdescription": "",
|
|
35410
|
+
"description": "",
|
|
35411
|
+
"displayName": "isTemplateProperty",
|
|
35412
|
+
"args": [
|
|
35413
|
+
{
|
|
35414
|
+
"name": "node",
|
|
35415
|
+
"deprecated": false,
|
|
35416
|
+
"deprecationMessage": ""
|
|
35417
|
+
}
|
|
35418
|
+
],
|
|
35419
|
+
"returnType": "boolean",
|
|
35420
|
+
"jsdoctags": [
|
|
35421
|
+
{
|
|
35422
|
+
"name": "node",
|
|
35423
|
+
"deprecated": false,
|
|
35424
|
+
"deprecationMessage": "",
|
|
35425
|
+
"tagName": {
|
|
35426
|
+
"text": "param"
|
|
35427
|
+
}
|
|
35428
|
+
}
|
|
35429
|
+
]
|
|
35430
|
+
},
|
|
35431
|
+
{
|
|
35432
|
+
"name": "isTemplateProperty",
|
|
35433
|
+
"file": "packages/core/schematics/migrate-ecl-icon/index.ts",
|
|
35434
|
+
"ctype": "miscellaneous",
|
|
35435
|
+
"subtype": "function",
|
|
35436
|
+
"coverageIgnore": false,
|
|
35437
|
+
"deprecated": false,
|
|
35438
|
+
"deprecationMessage": "",
|
|
35439
|
+
"rawdescription": "",
|
|
35440
|
+
"description": "",
|
|
35441
|
+
"displayName": "isTemplateProperty",
|
|
35442
|
+
"args": [
|
|
35443
|
+
{
|
|
35444
|
+
"name": "node",
|
|
35445
|
+
"deprecated": false,
|
|
35446
|
+
"deprecationMessage": ""
|
|
35447
|
+
}
|
|
35448
|
+
],
|
|
35449
|
+
"returnType": "boolean",
|
|
35450
|
+
"jsdoctags": [
|
|
35451
|
+
{
|
|
35452
|
+
"name": "node",
|
|
35453
|
+
"deprecated": false,
|
|
35454
|
+
"deprecationMessage": "",
|
|
35455
|
+
"tagName": {
|
|
35456
|
+
"text": "param"
|
|
35457
|
+
}
|
|
35458
|
+
}
|
|
35459
|
+
]
|
|
35460
|
+
},
|
|
35461
|
+
{
|
|
35462
|
+
"name": "isTemplateProperty",
|
|
35463
|
+
"file": "packages/core/schematics/migrate-ecl-inpage-navigation/index.ts",
|
|
35136
35464
|
"ctype": "miscellaneous",
|
|
35137
35465
|
"subtype": "function",
|
|
35138
35466
|
"coverageIgnore": false,
|
|
@@ -42071,160 +42399,6 @@
|
|
|
42071
42399
|
}
|
|
42072
42400
|
]
|
|
42073
42401
|
},
|
|
42074
|
-
{
|
|
42075
|
-
"name": "scanTemplate",
|
|
42076
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
42077
|
-
"ctype": "miscellaneous",
|
|
42078
|
-
"subtype": "function",
|
|
42079
|
-
"coverageIgnore": false,
|
|
42080
|
-
"deprecated": false,
|
|
42081
|
-
"deprecationMessage": "",
|
|
42082
|
-
"rawdescription": "Scans a template string for removed tags/attributes.\n`lineOffset` shifts reported line numbers so inline templates report the line\nwithin the host .ts file.",
|
|
42083
|
-
"description": "<p>Scans a template string for removed tags/attributes.\n<code>lineOffset</code> shifts reported line numbers so inline templates report the line\nwithin the host .ts file.</p>\n",
|
|
42084
|
-
"displayName": "scanTemplate",
|
|
42085
|
-
"args": [
|
|
42086
|
-
{
|
|
42087
|
-
"name": "template",
|
|
42088
|
-
"type": "string",
|
|
42089
|
-
"deprecated": false,
|
|
42090
|
-
"deprecationMessage": ""
|
|
42091
|
-
},
|
|
42092
|
-
{
|
|
42093
|
-
"name": "_fileSource",
|
|
42094
|
-
"type": "string",
|
|
42095
|
-
"deprecated": false,
|
|
42096
|
-
"deprecationMessage": ""
|
|
42097
|
-
},
|
|
42098
|
-
{
|
|
42099
|
-
"name": "lineOffset",
|
|
42100
|
-
"type": "number",
|
|
42101
|
-
"deprecated": false,
|
|
42102
|
-
"deprecationMessage": ""
|
|
42103
|
-
},
|
|
42104
|
-
{
|
|
42105
|
-
"name": "path",
|
|
42106
|
-
"type": "string",
|
|
42107
|
-
"deprecated": false,
|
|
42108
|
-
"deprecationMessage": ""
|
|
42109
|
-
},
|
|
42110
|
-
{
|
|
42111
|
-
"name": "context",
|
|
42112
|
-
"type": "SchematicContext",
|
|
42113
|
-
"deprecated": false,
|
|
42114
|
-
"deprecationMessage": ""
|
|
42115
|
-
}
|
|
42116
|
-
],
|
|
42117
|
-
"returnType": "number",
|
|
42118
|
-
"jsdoctags": [
|
|
42119
|
-
{
|
|
42120
|
-
"name": "template",
|
|
42121
|
-
"type": "string",
|
|
42122
|
-
"deprecated": false,
|
|
42123
|
-
"deprecationMessage": "",
|
|
42124
|
-
"tagName": {
|
|
42125
|
-
"text": "param"
|
|
42126
|
-
}
|
|
42127
|
-
},
|
|
42128
|
-
{
|
|
42129
|
-
"name": "_fileSource",
|
|
42130
|
-
"type": "string",
|
|
42131
|
-
"deprecated": false,
|
|
42132
|
-
"deprecationMessage": "",
|
|
42133
|
-
"tagName": {
|
|
42134
|
-
"text": "param"
|
|
42135
|
-
}
|
|
42136
|
-
},
|
|
42137
|
-
{
|
|
42138
|
-
"name": "lineOffset",
|
|
42139
|
-
"type": "number",
|
|
42140
|
-
"deprecated": false,
|
|
42141
|
-
"deprecationMessage": "",
|
|
42142
|
-
"tagName": {
|
|
42143
|
-
"text": "param"
|
|
42144
|
-
}
|
|
42145
|
-
},
|
|
42146
|
-
{
|
|
42147
|
-
"name": "path",
|
|
42148
|
-
"type": "string",
|
|
42149
|
-
"deprecated": false,
|
|
42150
|
-
"deprecationMessage": "",
|
|
42151
|
-
"tagName": {
|
|
42152
|
-
"text": "param"
|
|
42153
|
-
}
|
|
42154
|
-
},
|
|
42155
|
-
{
|
|
42156
|
-
"name": "context",
|
|
42157
|
-
"type": "SchematicContext",
|
|
42158
|
-
"deprecated": false,
|
|
42159
|
-
"deprecationMessage": "",
|
|
42160
|
-
"tagName": {
|
|
42161
|
-
"text": "param"
|
|
42162
|
-
}
|
|
42163
|
-
}
|
|
42164
|
-
]
|
|
42165
|
-
},
|
|
42166
|
-
{
|
|
42167
|
-
"name": "scanTypeScript",
|
|
42168
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
42169
|
-
"ctype": "miscellaneous",
|
|
42170
|
-
"subtype": "function",
|
|
42171
|
-
"coverageIgnore": false,
|
|
42172
|
-
"deprecated": false,
|
|
42173
|
-
"deprecationMessage": "",
|
|
42174
|
-
"rawdescription": "",
|
|
42175
|
-
"description": "",
|
|
42176
|
-
"displayName": "scanTypeScript",
|
|
42177
|
-
"args": [
|
|
42178
|
-
{
|
|
42179
|
-
"name": "source",
|
|
42180
|
-
"type": "string",
|
|
42181
|
-
"deprecated": false,
|
|
42182
|
-
"deprecationMessage": ""
|
|
42183
|
-
},
|
|
42184
|
-
{
|
|
42185
|
-
"name": "path",
|
|
42186
|
-
"type": "string",
|
|
42187
|
-
"deprecated": false,
|
|
42188
|
-
"deprecationMessage": ""
|
|
42189
|
-
},
|
|
42190
|
-
{
|
|
42191
|
-
"name": "context",
|
|
42192
|
-
"type": "SchematicContext",
|
|
42193
|
-
"deprecated": false,
|
|
42194
|
-
"deprecationMessage": ""
|
|
42195
|
-
}
|
|
42196
|
-
],
|
|
42197
|
-
"returnType": "number",
|
|
42198
|
-
"jsdoctags": [
|
|
42199
|
-
{
|
|
42200
|
-
"name": "source",
|
|
42201
|
-
"type": "string",
|
|
42202
|
-
"deprecated": false,
|
|
42203
|
-
"deprecationMessage": "",
|
|
42204
|
-
"tagName": {
|
|
42205
|
-
"text": "param"
|
|
42206
|
-
}
|
|
42207
|
-
},
|
|
42208
|
-
{
|
|
42209
|
-
"name": "path",
|
|
42210
|
-
"type": "string",
|
|
42211
|
-
"deprecated": false,
|
|
42212
|
-
"deprecationMessage": "",
|
|
42213
|
-
"tagName": {
|
|
42214
|
-
"text": "param"
|
|
42215
|
-
}
|
|
42216
|
-
},
|
|
42217
|
-
{
|
|
42218
|
-
"name": "context",
|
|
42219
|
-
"type": "SchematicContext",
|
|
42220
|
-
"deprecated": false,
|
|
42221
|
-
"deprecationMessage": "",
|
|
42222
|
-
"tagName": {
|
|
42223
|
-
"text": "param"
|
|
42224
|
-
}
|
|
42225
|
-
}
|
|
42226
|
-
]
|
|
42227
|
-
},
|
|
42228
42402
|
{
|
|
42229
42403
|
"name": "sessionStorageSync",
|
|
42230
42404
|
"file": "packages/core/src/lib/services/store/reducers/meta.reducers.ts",
|
|
@@ -42550,16 +42724,16 @@
|
|
|
42550
42724
|
]
|
|
42551
42725
|
},
|
|
42552
42726
|
{
|
|
42553
|
-
"name": "
|
|
42727
|
+
"name": "tryInsertWriteTodo",
|
|
42554
42728
|
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
42555
42729
|
"ctype": "miscellaneous",
|
|
42556
42730
|
"subtype": "function",
|
|
42557
42731
|
"coverageIgnore": false,
|
|
42558
42732
|
"deprecated": false,
|
|
42559
42733
|
"deprecationMessage": "",
|
|
42560
|
-
"rawdescription": "
|
|
42561
|
-
"description": "<p>
|
|
42562
|
-
"displayName": "
|
|
42734
|
+
"rawdescription": "Detects a programmatic WRITE to a now-signal input and returns an edit that\ncomments out the offending statement and prepends an explanatory TODO.\n\nA signal input (`input()`) exposes a read-only getter — it cannot be assigned\nfrom outside the component (`comp.prop = value` no longer compiles, and\n`comp.prop()` is a getter, not a setter). There is no safe, mechanical\nrewrite: the correct fix is to drive the value declaratively through a\ntemplate binding (`[prop]=\"...\"`) or, when a ComponentRef is genuinely\navailable, `componentRef.setInput('prop', value)`. Both require human\njudgement, so instead of rewriting we comment the statement out (keeping the\nbuild green) and leave a TODO pointing at the manual fix.\n\nOnly acts when the assignment is the ENTIRE statement\n(`ExpressionStatement` whose expression is exactly this assignment):\n ref.prop = value (simple assignment)\n ref.prop += value, etc. (compound assignment)\nwhere `ref` is a tracked EUI/ECL reference and `prop` is in its signal set.\n\nWhen the write is only part of a larger statement (e.g. inside an `if`\nwithout a block, or nested in another expression), commenting it out would\nalso remove unrelated logic, so we leave it untouched (it will surface as a\ncompile error the developer must resolve by hand).",
|
|
42735
|
+
"description": "<p>Detects a programmatic WRITE to a now-signal input and returns an edit that\ncomments out the offending statement and prepends an explanatory TODO.</p>\n<p>A signal input (<code>input()</code>) exposes a read-only getter — it cannot be assigned\nfrom outside the component (<code>comp.prop = value</code> no longer compiles, and\n<code>comp.prop()</code> is a getter, not a setter). There is no safe, mechanical\nrewrite: the correct fix is to drive the value declaratively through a\ntemplate binding (<code>[prop]="..."</code>) or, when a ComponentRef is genuinely\navailable, <code>componentRef.setInput('prop', value)</code>. Both require human\njudgement, so instead of rewriting we comment the statement out (keeping the\nbuild green) and leave a TODO pointing at the manual fix.</p>\n<p>Only acts when the assignment is the ENTIRE statement\n(<code>ExpressionStatement</code> whose expression is exactly this assignment):\n ref.prop = value (simple assignment)\n ref.prop += value, etc. (compound assignment)\nwhere <code>ref</code> is a tracked EUI/ECL reference and <code>prop</code> is in its signal set.</p>\n<p>When the write is only part of a larger statement (e.g. inside an <code>if</code>\nwithout a block, or nested in another expression), commenting it out would\nalso remove unrelated logic, so we leave it untouched (it will surface as a\ncompile error the developer must resolve by hand).</p>\n",
|
|
42736
|
+
"displayName": "tryInsertWriteTodo",
|
|
42563
42737
|
"args": [
|
|
42564
42738
|
{
|
|
42565
42739
|
"name": "node",
|
|
@@ -42623,27 +42797,70 @@
|
|
|
42623
42797
|
]
|
|
42624
42798
|
},
|
|
42625
42799
|
{
|
|
42626
|
-
"name": "
|
|
42627
|
-
"file": "packages/core/schematics/migrate-
|
|
42800
|
+
"name": "tryRewritePropertyAccess",
|
|
42801
|
+
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
42628
42802
|
"ctype": "miscellaneous",
|
|
42629
42803
|
"subtype": "function",
|
|
42630
42804
|
"coverageIgnore": false,
|
|
42631
42805
|
"deprecated": false,
|
|
42632
42806
|
"deprecationMessage": "",
|
|
42633
|
-
"rawdescription": "",
|
|
42634
|
-
"description": "",
|
|
42635
|
-
"displayName": "
|
|
42807
|
+
"rawdescription": "Checks if a property access `ref.prop` should be rewritten to `ref.prop()`.\n\nWe rewrite if:\n- `ref` is tracked in euiRefs\n- `prop` is in the signal set for that EUI class\n- The access is NOT already a call expression (not `ref.prop()` or `ref.prop(args)`)\n- The access is NOT a write target (not `ref.prop = value`)\n- The access is NOT a template binding argument (those are unaffected)",
|
|
42808
|
+
"description": "<p>Checks if a property access <code>ref.prop</code> should be rewritten to <code>ref.prop()</code>.</p>\n<p>We rewrite if:</p>\n<ul>\n<li><code>ref</code> is tracked in euiRefs</li>\n<li><code>prop</code> is in the signal set for that EUI class</li>\n<li>The access is NOT already a call expression (not <code>ref.prop()</code> or <code>ref.prop(args)</code>)</li>\n<li>The access is NOT a write target (not <code>ref.prop = value</code>)</li>\n<li>The access is NOT a template binding argument (those are unaffected)</li>\n</ul>\n",
|
|
42809
|
+
"displayName": "tryRewritePropertyAccess",
|
|
42636
42810
|
"args": [
|
|
42637
42811
|
{
|
|
42638
|
-
"name": "
|
|
42812
|
+
"name": "node",
|
|
42813
|
+
"deprecated": false,
|
|
42814
|
+
"deprecationMessage": ""
|
|
42815
|
+
},
|
|
42816
|
+
{
|
|
42817
|
+
"name": "euiRefs",
|
|
42818
|
+
"type": "Map",
|
|
42819
|
+
"deprecated": false,
|
|
42820
|
+
"deprecationMessage": ""
|
|
42821
|
+
},
|
|
42822
|
+
{
|
|
42823
|
+
"name": "sourceFile",
|
|
42824
|
+
"deprecated": false,
|
|
42825
|
+
"deprecationMessage": ""
|
|
42826
|
+
},
|
|
42827
|
+
{
|
|
42828
|
+
"name": "source",
|
|
42829
|
+
"type": "string",
|
|
42639
42830
|
"deprecated": false,
|
|
42640
42831
|
"deprecationMessage": ""
|
|
42641
42832
|
}
|
|
42642
42833
|
],
|
|
42643
|
-
"returnType": "
|
|
42834
|
+
"returnType": "Edit | null",
|
|
42644
42835
|
"jsdoctags": [
|
|
42645
42836
|
{
|
|
42646
|
-
"name": "
|
|
42837
|
+
"name": "node",
|
|
42838
|
+
"deprecated": false,
|
|
42839
|
+
"deprecationMessage": "",
|
|
42840
|
+
"tagName": {
|
|
42841
|
+
"text": "param"
|
|
42842
|
+
}
|
|
42843
|
+
},
|
|
42844
|
+
{
|
|
42845
|
+
"name": "euiRefs",
|
|
42846
|
+
"type": "Map",
|
|
42847
|
+
"deprecated": false,
|
|
42848
|
+
"deprecationMessage": "",
|
|
42849
|
+
"tagName": {
|
|
42850
|
+
"text": "param"
|
|
42851
|
+
}
|
|
42852
|
+
},
|
|
42853
|
+
{
|
|
42854
|
+
"name": "sourceFile",
|
|
42855
|
+
"deprecated": false,
|
|
42856
|
+
"deprecationMessage": "",
|
|
42857
|
+
"tagName": {
|
|
42858
|
+
"text": "param"
|
|
42859
|
+
}
|
|
42860
|
+
},
|
|
42861
|
+
{
|
|
42862
|
+
"name": "source",
|
|
42863
|
+
"type": "string",
|
|
42647
42864
|
"deprecated": false,
|
|
42648
42865
|
"deprecationMessage": "",
|
|
42649
42866
|
"tagName": {
|
|
@@ -42654,7 +42871,37 @@
|
|
|
42654
42871
|
},
|
|
42655
42872
|
{
|
|
42656
42873
|
"name": "unwrapExpression",
|
|
42657
|
-
"file": "packages/core/schematics/migrate-ecl-
|
|
42874
|
+
"file": "packages/core/schematics/migrate-ecl-breadcrumb/index.ts",
|
|
42875
|
+
"ctype": "miscellaneous",
|
|
42876
|
+
"subtype": "function",
|
|
42877
|
+
"coverageIgnore": false,
|
|
42878
|
+
"deprecated": false,
|
|
42879
|
+
"deprecationMessage": "",
|
|
42880
|
+
"rawdescription": "",
|
|
42881
|
+
"description": "",
|
|
42882
|
+
"displayName": "unwrapExpression",
|
|
42883
|
+
"args": [
|
|
42884
|
+
{
|
|
42885
|
+
"name": "expression",
|
|
42886
|
+
"deprecated": false,
|
|
42887
|
+
"deprecationMessage": ""
|
|
42888
|
+
}
|
|
42889
|
+
],
|
|
42890
|
+
"returnType": "ts.Expression",
|
|
42891
|
+
"jsdoctags": [
|
|
42892
|
+
{
|
|
42893
|
+
"name": "expression",
|
|
42894
|
+
"deprecated": false,
|
|
42895
|
+
"deprecationMessage": "",
|
|
42896
|
+
"tagName": {
|
|
42897
|
+
"text": "param"
|
|
42898
|
+
}
|
|
42899
|
+
}
|
|
42900
|
+
]
|
|
42901
|
+
},
|
|
42902
|
+
{
|
|
42903
|
+
"name": "unwrapExpression",
|
|
42904
|
+
"file": "packages/core/schematics/migrate-ecl-file/index.ts",
|
|
42658
42905
|
"ctype": "miscellaneous",
|
|
42659
42906
|
"subtype": "function",
|
|
42660
42907
|
"coverageIgnore": false,
|
|
@@ -49146,6 +49393,19 @@
|
|
|
49146
49393
|
"defaultValue": "{ ...EUI_SIGNAL_MAP_RAW, ...ECL_SIGNAL_MAP }",
|
|
49147
49394
|
"rawdescription": "Combined EUI + ECL signal maps. The migration logic is identical for both\nlibraries (plain field → signal getter), so the maps are merged and the rest\nof the engine treats them uniformly. EUI and ECL class names don't collide\n(Eui* vs Ecl* prefixes), and the selector namespaces are disjoint.",
|
|
49148
49395
|
"description": "<p>Combined EUI + ECL signal maps. The migration logic is identical for both\nlibraries (plain field → signal getter), so the maps are merged and the rest\nof the engine treats them uniformly. EUI and ECL class names don't collide\n(Eui* vs Ecl* prefixes), and the selector namespaces are disjoint.</p>\n"
|
|
49396
|
+
},
|
|
49397
|
+
{
|
|
49398
|
+
"name": "WRITE_TODO_MARKER",
|
|
49399
|
+
"ctype": "miscellaneous",
|
|
49400
|
+
"subtype": "variable",
|
|
49401
|
+
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
49402
|
+
"coverageIgnore": false,
|
|
49403
|
+
"deprecated": false,
|
|
49404
|
+
"deprecationMessage": "",
|
|
49405
|
+
"type": "string",
|
|
49406
|
+
"defaultValue": "'TODO(eui-signals):'",
|
|
49407
|
+
"rawdescription": "Marker used to detect an already-inserted TODO so the schematic stays idempotent.",
|
|
49408
|
+
"description": "<p>Marker used to detect an already-inserted TODO so the schematic stays idempotent.</p>\n"
|
|
49149
49409
|
}
|
|
49150
49410
|
],
|
|
49151
49411
|
"packages/core/schematics/migrate-to-signals/signal-map.ts": [
|
|
@@ -50108,7 +50368,7 @@
|
|
|
50108
50368
|
"deprecated": false,
|
|
50109
50369
|
"deprecationMessage": "",
|
|
50110
50370
|
"type": "readonly RemovedAttr[]",
|
|
50111
|
-
"defaultValue": "[\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n '
|
|
50371
|
+
"defaultValue": "[\n {\n attr: 'eclDatePicker',\n onTag: 'input',\n message:\n 'EclDatePickerDirective (input[eclDatePicker]) was removed in v22. Use EclDatePickerDuetDirective on a <duet-date-picker eclDatePicker> element; yearRange/format/firstDayOfWeek are configured on the <duet-date-picker> web component.',\n },\n {\n attr: 'eclRadioHelp',\n message:\n 'EclRadioHelpComponent ([eclRadioHelp]) was removed in v22. Use [eclHelpBlock] (EclHelpBlockDirective from @eui/ecl/components/ecl-help-block) instead.',\n },\n]"
|
|
50112
50372
|
},
|
|
50113
50373
|
{
|
|
50114
50374
|
"name": "REMOVED_IDENTIFIERS",
|
|
@@ -50119,7 +50379,7 @@
|
|
|
50119
50379
|
"deprecated": false,
|
|
50120
50380
|
"deprecationMessage": "",
|
|
50121
50381
|
"type": "readonly RemovedIdentifier[]",
|
|
50122
|
-
"defaultValue": "[\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective
|
|
50382
|
+
"defaultValue": "[\n {\n name: 'EclDatePickerDirective',\n message:\n 'EclDatePickerDirective was removed in v22. Use EclDatePickerDuetDirective (selector \"duet-date-picker[eclDatePicker]\") instead.',\n },\n {\n name: 'EUI_ECL_DATE_PICKER',\n message:\n 'EUI_ECL_DATE_PICKER no longer includes the removed EclDatePickerDirective (it now provides EclDatePickerDuetDirective). The import still works; update your markup from <input eclDatePicker> to <duet-date-picker eclDatePicker>.',\n },\n {\n name: 'EclSiteHeaderBannerTopComponent',\n message: 'EclSiteHeaderBannerTopComponent was removed in v22 with no replacement. Remove its usage.',\n },\n {\n name: 'EclPageHeaderNextComponent',\n message: 'EclPageHeaderNextComponent was removed in v22 and is no longer exported from the package. Remove its usage.',\n },\n {\n name: 'EclRadioHelpComponent',\n message:\n 'EclRadioHelpComponent was removed in v22. Use EclHelpBlockDirective ([eclHelpBlock]) from @eui/ecl/components/ecl-help-block instead.',\n },\n]"
|
|
50123
50383
|
},
|
|
50124
50384
|
{
|
|
50125
50385
|
"name": "REMOVED_TAGS",
|
|
@@ -50130,7 +50390,18 @@
|
|
|
50130
50390
|
"deprecated": false,
|
|
50131
50391
|
"deprecationMessage": "",
|
|
50132
50392
|
"type": "readonly RemovedTag[]",
|
|
50133
|
-
"defaultValue": "[\n {\n tag: 'ecl-site-header-banner-top',\n message:\n '<ecl-site-header-banner-top>
|
|
50393
|
+
"defaultValue": "[\n {\n tag: 'ecl-site-header-banner-top',\n message:\n 'EclSiteHeaderBannerTopComponent (<ecl-site-header-banner-top>) was removed in v22 with no replacement. Remove it and use the standard site-header variant without a banner-top.',\n },\n]"
|
|
50394
|
+
},
|
|
50395
|
+
{
|
|
50396
|
+
"name": "TODO_PREFIX",
|
|
50397
|
+
"ctype": "miscellaneous",
|
|
50398
|
+
"subtype": "variable",
|
|
50399
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
50400
|
+
"coverageIgnore": false,
|
|
50401
|
+
"deprecated": false,
|
|
50402
|
+
"deprecationMessage": "",
|
|
50403
|
+
"type": "string",
|
|
50404
|
+
"defaultValue": "'TODO: [eUI v22 migration]'"
|
|
50134
50405
|
},
|
|
50135
50406
|
{
|
|
50136
50407
|
"name": "TRIGGER_TOKENS",
|
|
@@ -53730,10 +54001,10 @@
|
|
|
53730
54001
|
]
|
|
53731
54002
|
}
|
|
53732
54003
|
],
|
|
53733
|
-
"packages/core/schematics/migrate-
|
|
54004
|
+
"packages/core/schematics/migrate-ecl-removed-components/index.ts": [
|
|
53734
54005
|
{
|
|
53735
|
-
"name": "
|
|
53736
|
-
"file": "packages/core/schematics/migrate-
|
|
54006
|
+
"name": "applyAnnotations",
|
|
54007
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
53737
54008
|
"ctype": "miscellaneous",
|
|
53738
54009
|
"subtype": "function",
|
|
53739
54010
|
"coverageIgnore": false,
|
|
@@ -53741,7 +54012,7 @@
|
|
|
53741
54012
|
"deprecationMessage": "",
|
|
53742
54013
|
"rawdescription": "",
|
|
53743
54014
|
"description": "",
|
|
53744
|
-
"displayName": "
|
|
54015
|
+
"displayName": "applyAnnotations",
|
|
53745
54016
|
"args": [
|
|
53746
54017
|
{
|
|
53747
54018
|
"name": "source",
|
|
@@ -53750,7 +54021,7 @@
|
|
|
53750
54021
|
"deprecationMessage": ""
|
|
53751
54022
|
},
|
|
53752
54023
|
{
|
|
53753
|
-
"name": "
|
|
54024
|
+
"name": "annotations",
|
|
53754
54025
|
"deprecated": false,
|
|
53755
54026
|
"deprecationMessage": ""
|
|
53756
54027
|
}
|
|
@@ -53767,7 +54038,7 @@
|
|
|
53767
54038
|
}
|
|
53768
54039
|
},
|
|
53769
54040
|
{
|
|
53770
|
-
"name": "
|
|
54041
|
+
"name": "annotations",
|
|
53771
54042
|
"deprecated": false,
|
|
53772
54043
|
"deprecationMessage": "",
|
|
53773
54044
|
"tagName": {
|
|
@@ -53777,8 +54048,8 @@
|
|
|
53777
54048
|
]
|
|
53778
54049
|
},
|
|
53779
54050
|
{
|
|
53780
|
-
"name": "
|
|
53781
|
-
"file": "packages/core/schematics/migrate-
|
|
54051
|
+
"name": "collectElementAnnotation",
|
|
54052
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
53782
54053
|
"ctype": "miscellaneous",
|
|
53783
54054
|
"subtype": "function",
|
|
53784
54055
|
"coverageIgnore": false,
|
|
@@ -53786,116 +54057,32 @@
|
|
|
53786
54057
|
"deprecationMessage": "",
|
|
53787
54058
|
"rawdescription": "",
|
|
53788
54059
|
"description": "",
|
|
53789
|
-
"displayName": "
|
|
54060
|
+
"displayName": "collectElementAnnotation",
|
|
53790
54061
|
"args": [
|
|
53791
54062
|
{
|
|
53792
|
-
"name": "
|
|
53793
|
-
"type": "string",
|
|
53794
|
-
"deprecated": false,
|
|
53795
|
-
"deprecationMessage": ""
|
|
53796
|
-
},
|
|
53797
|
-
{
|
|
53798
|
-
"name": "content",
|
|
53799
|
-
"type": "TmplAstElement",
|
|
53800
|
-
"deprecated": false,
|
|
53801
|
-
"deprecationMessage": ""
|
|
53802
|
-
}
|
|
53803
|
-
],
|
|
53804
|
-
"returnType": "string",
|
|
53805
|
-
"jsdoctags": [
|
|
53806
|
-
{
|
|
53807
|
-
"name": "source",
|
|
53808
|
-
"type": "string",
|
|
53809
|
-
"deprecated": false,
|
|
53810
|
-
"deprecationMessage": "",
|
|
53811
|
-
"tagName": {
|
|
53812
|
-
"text": "param"
|
|
53813
|
-
}
|
|
53814
|
-
},
|
|
53815
|
-
{
|
|
53816
|
-
"name": "content",
|
|
54063
|
+
"name": "element",
|
|
53817
54064
|
"type": "TmplAstElement",
|
|
53818
54065
|
"deprecated": false,
|
|
53819
|
-
"deprecationMessage": "",
|
|
53820
|
-
"tagName": {
|
|
53821
|
-
"text": "param"
|
|
53822
|
-
}
|
|
53823
|
-
}
|
|
53824
|
-
]
|
|
53825
|
-
},
|
|
53826
|
-
{
|
|
53827
|
-
"name": "buildHeaderReplacement",
|
|
53828
|
-
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
53829
|
-
"ctype": "miscellaneous",
|
|
53830
|
-
"subtype": "function",
|
|
53831
|
-
"coverageIgnore": false,
|
|
53832
|
-
"deprecated": false,
|
|
53833
|
-
"deprecationMessage": "",
|
|
53834
|
-
"rawdescription": "",
|
|
53835
|
-
"description": "",
|
|
53836
|
-
"displayName": "buildHeaderReplacement",
|
|
53837
|
-
"args": [
|
|
53838
|
-
{
|
|
53839
|
-
"name": "source",
|
|
53840
|
-
"type": "string",
|
|
53841
|
-
"deprecated": false,
|
|
53842
54066
|
"deprecationMessage": ""
|
|
53843
54067
|
},
|
|
53844
54068
|
{
|
|
53845
|
-
"name": "
|
|
53846
|
-
"type": "
|
|
54069
|
+
"name": "lineOffset",
|
|
54070
|
+
"type": "number",
|
|
53847
54071
|
"deprecated": false,
|
|
53848
54072
|
"deprecationMessage": ""
|
|
53849
|
-
}
|
|
53850
|
-
],
|
|
53851
|
-
"returnType": "string",
|
|
53852
|
-
"jsdoctags": [
|
|
53853
|
-
{
|
|
53854
|
-
"name": "source",
|
|
53855
|
-
"type": "string",
|
|
53856
|
-
"deprecated": false,
|
|
53857
|
-
"deprecationMessage": "",
|
|
53858
|
-
"tagName": {
|
|
53859
|
-
"text": "param"
|
|
53860
|
-
}
|
|
53861
54073
|
},
|
|
53862
54074
|
{
|
|
53863
|
-
"name": "
|
|
53864
|
-
"type": "TmplAstElement",
|
|
53865
|
-
"deprecated": false,
|
|
53866
|
-
"deprecationMessage": "",
|
|
53867
|
-
"tagName": {
|
|
53868
|
-
"text": "param"
|
|
53869
|
-
}
|
|
53870
|
-
}
|
|
53871
|
-
]
|
|
53872
|
-
},
|
|
53873
|
-
{
|
|
53874
|
-
"name": "findDirectChild",
|
|
53875
|
-
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
53876
|
-
"ctype": "miscellaneous",
|
|
53877
|
-
"subtype": "function",
|
|
53878
|
-
"coverageIgnore": false,
|
|
53879
|
-
"deprecated": false,
|
|
53880
|
-
"deprecationMessage": "",
|
|
53881
|
-
"rawdescription": "",
|
|
53882
|
-
"description": "",
|
|
53883
|
-
"displayName": "findDirectChild",
|
|
53884
|
-
"args": [
|
|
53885
|
-
{
|
|
53886
|
-
"name": "element",
|
|
53887
|
-
"type": "TmplAstElement",
|
|
54075
|
+
"name": "commentStyle",
|
|
53888
54076
|
"deprecated": false,
|
|
53889
54077
|
"deprecationMessage": ""
|
|
53890
54078
|
},
|
|
53891
54079
|
{
|
|
53892
|
-
"name": "
|
|
53893
|
-
"type": "string",
|
|
54080
|
+
"name": "annotations",
|
|
53894
54081
|
"deprecated": false,
|
|
53895
54082
|
"deprecationMessage": ""
|
|
53896
54083
|
}
|
|
53897
54084
|
],
|
|
53898
|
-
"returnType": "
|
|
54085
|
+
"returnType": "void",
|
|
53899
54086
|
"jsdoctags": [
|
|
53900
54087
|
{
|
|
53901
54088
|
"name": "element",
|
|
@@ -53907,91 +54094,16 @@
|
|
|
53907
54094
|
}
|
|
53908
54095
|
},
|
|
53909
54096
|
{
|
|
53910
|
-
"name": "
|
|
53911
|
-
"type": "
|
|
53912
|
-
"deprecated": false,
|
|
53913
|
-
"deprecationMessage": "",
|
|
53914
|
-
"tagName": {
|
|
53915
|
-
"text": "param"
|
|
53916
|
-
}
|
|
53917
|
-
}
|
|
53918
|
-
]
|
|
53919
|
-
},
|
|
53920
|
-
{
|
|
53921
|
-
"name": "findElements",
|
|
53922
|
-
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
53923
|
-
"ctype": "miscellaneous",
|
|
53924
|
-
"subtype": "function",
|
|
53925
|
-
"coverageIgnore": false,
|
|
53926
|
-
"deprecated": false,
|
|
53927
|
-
"deprecationMessage": "",
|
|
53928
|
-
"rawdescription": "",
|
|
53929
|
-
"description": "",
|
|
53930
|
-
"displayName": "findElements",
|
|
53931
|
-
"args": [
|
|
53932
|
-
{
|
|
53933
|
-
"name": "nodes",
|
|
53934
|
-
"deprecated": false,
|
|
53935
|
-
"deprecationMessage": ""
|
|
53936
|
-
},
|
|
53937
|
-
{
|
|
53938
|
-
"name": "name",
|
|
53939
|
-
"type": "string",
|
|
53940
|
-
"deprecated": false,
|
|
53941
|
-
"deprecationMessage": ""
|
|
53942
|
-
}
|
|
53943
|
-
],
|
|
53944
|
-
"returnType": "TmplAstElement[]",
|
|
53945
|
-
"jsdoctags": [
|
|
53946
|
-
{
|
|
53947
|
-
"name": "nodes",
|
|
53948
|
-
"deprecated": false,
|
|
53949
|
-
"deprecationMessage": "",
|
|
53950
|
-
"tagName": {
|
|
53951
|
-
"text": "param"
|
|
53952
|
-
}
|
|
53953
|
-
},
|
|
53954
|
-
{
|
|
53955
|
-
"name": "name",
|
|
53956
|
-
"type": "string",
|
|
54097
|
+
"name": "lineOffset",
|
|
54098
|
+
"type": "number",
|
|
53957
54099
|
"deprecated": false,
|
|
53958
54100
|
"deprecationMessage": "",
|
|
53959
54101
|
"tagName": {
|
|
53960
54102
|
"text": "param"
|
|
53961
54103
|
}
|
|
53962
|
-
}
|
|
53963
|
-
]
|
|
53964
|
-
},
|
|
53965
|
-
{
|
|
53966
|
-
"name": "formatInnerLines",
|
|
53967
|
-
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
53968
|
-
"ctype": "miscellaneous",
|
|
53969
|
-
"subtype": "function",
|
|
53970
|
-
"coverageIgnore": false,
|
|
53971
|
-
"deprecated": false,
|
|
53972
|
-
"deprecationMessage": "",
|
|
53973
|
-
"rawdescription": "",
|
|
53974
|
-
"description": "",
|
|
53975
|
-
"displayName": "formatInnerLines",
|
|
53976
|
-
"args": [
|
|
53977
|
-
{
|
|
53978
|
-
"name": "source",
|
|
53979
|
-
"type": "string",
|
|
53980
|
-
"deprecated": false,
|
|
53981
|
-
"deprecationMessage": ""
|
|
53982
54104
|
},
|
|
53983
54105
|
{
|
|
53984
|
-
"name": "
|
|
53985
|
-
"type": "string",
|
|
53986
|
-
"deprecated": false,
|
|
53987
|
-
"deprecationMessage": ""
|
|
53988
|
-
}
|
|
53989
|
-
],
|
|
53990
|
-
"returnType": "string[]",
|
|
53991
|
-
"jsdoctags": [
|
|
53992
|
-
{
|
|
53993
|
-
"name": "source",
|
|
53994
|
-
"type": "string",
|
|
54106
|
+
"name": "commentStyle",
|
|
53995
54107
|
"deprecated": false,
|
|
53996
54108
|
"deprecationMessage": "",
|
|
53997
54109
|
"tagName": {
|
|
@@ -53999,8 +54111,7 @@
|
|
|
53999
54111
|
}
|
|
54000
54112
|
},
|
|
54001
54113
|
{
|
|
54002
|
-
"name": "
|
|
54003
|
-
"type": "string",
|
|
54114
|
+
"name": "annotations",
|
|
54004
54115
|
"deprecated": false,
|
|
54005
54116
|
"deprecationMessage": "",
|
|
54006
54117
|
"tagName": {
|
|
@@ -54010,8 +54121,8 @@
|
|
|
54010
54121
|
]
|
|
54011
54122
|
},
|
|
54012
54123
|
{
|
|
54013
|
-
"name": "
|
|
54014
|
-
"file": "packages/core/schematics/migrate-
|
|
54124
|
+
"name": "collectTemplateAnnotations",
|
|
54125
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
54015
54126
|
"ctype": "miscellaneous",
|
|
54016
54127
|
"subtype": "function",
|
|
54017
54128
|
"coverageIgnore": false,
|
|
@@ -54019,31 +54130,30 @@
|
|
|
54019
54130
|
"deprecationMessage": "",
|
|
54020
54131
|
"rawdescription": "",
|
|
54021
54132
|
"description": "",
|
|
54022
|
-
"displayName": "
|
|
54133
|
+
"displayName": "collectTemplateAnnotations",
|
|
54023
54134
|
"args": [
|
|
54024
54135
|
{
|
|
54025
|
-
"name": "
|
|
54136
|
+
"name": "template",
|
|
54026
54137
|
"type": "string",
|
|
54027
54138
|
"deprecated": false,
|
|
54028
54139
|
"deprecationMessage": ""
|
|
54029
54140
|
},
|
|
54030
54141
|
{
|
|
54031
|
-
"name": "
|
|
54032
|
-
"type": "
|
|
54142
|
+
"name": "lineOffset",
|
|
54143
|
+
"type": "number",
|
|
54033
54144
|
"deprecated": false,
|
|
54034
54145
|
"deprecationMessage": ""
|
|
54035
54146
|
},
|
|
54036
54147
|
{
|
|
54037
|
-
"name": "
|
|
54038
|
-
"type": "string",
|
|
54148
|
+
"name": "commentStyle",
|
|
54039
54149
|
"deprecated": false,
|
|
54040
54150
|
"deprecationMessage": ""
|
|
54041
54151
|
}
|
|
54042
54152
|
],
|
|
54043
|
-
"returnType": "
|
|
54153
|
+
"returnType": "Annotation[]",
|
|
54044
54154
|
"jsdoctags": [
|
|
54045
54155
|
{
|
|
54046
|
-
"name": "
|
|
54156
|
+
"name": "template",
|
|
54047
54157
|
"type": "string",
|
|
54048
54158
|
"deprecated": false,
|
|
54049
54159
|
"deprecationMessage": "",
|
|
@@ -54052,64 +54162,16 @@
|
|
|
54052
54162
|
}
|
|
54053
54163
|
},
|
|
54054
54164
|
{
|
|
54055
|
-
"name": "
|
|
54056
|
-
"type": "TmplAstElement",
|
|
54057
|
-
"deprecated": false,
|
|
54058
|
-
"deprecationMessage": "",
|
|
54059
|
-
"tagName": {
|
|
54060
|
-
"text": "param"
|
|
54061
|
-
}
|
|
54062
|
-
},
|
|
54063
|
-
{
|
|
54064
|
-
"name": "tagName",
|
|
54065
|
-
"type": "string",
|
|
54066
|
-
"deprecated": false,
|
|
54067
|
-
"deprecationMessage": "",
|
|
54068
|
-
"tagName": {
|
|
54069
|
-
"text": "param"
|
|
54070
|
-
}
|
|
54071
|
-
}
|
|
54072
|
-
]
|
|
54073
|
-
},
|
|
54074
|
-
{
|
|
54075
|
-
"name": "getIndent",
|
|
54076
|
-
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54077
|
-
"ctype": "miscellaneous",
|
|
54078
|
-
"subtype": "function",
|
|
54079
|
-
"coverageIgnore": false,
|
|
54080
|
-
"deprecated": false,
|
|
54081
|
-
"deprecationMessage": "",
|
|
54082
|
-
"rawdescription": "",
|
|
54083
|
-
"description": "",
|
|
54084
|
-
"displayName": "getIndent",
|
|
54085
|
-
"args": [
|
|
54086
|
-
{
|
|
54087
|
-
"name": "source",
|
|
54088
|
-
"type": "string",
|
|
54089
|
-
"deprecated": false,
|
|
54090
|
-
"deprecationMessage": ""
|
|
54091
|
-
},
|
|
54092
|
-
{
|
|
54093
|
-
"name": "offset",
|
|
54165
|
+
"name": "lineOffset",
|
|
54094
54166
|
"type": "number",
|
|
54095
54167
|
"deprecated": false,
|
|
54096
|
-
"deprecationMessage": ""
|
|
54097
|
-
}
|
|
54098
|
-
],
|
|
54099
|
-
"returnType": "string",
|
|
54100
|
-
"jsdoctags": [
|
|
54101
|
-
{
|
|
54102
|
-
"name": "source",
|
|
54103
|
-
"type": "string",
|
|
54104
|
-
"deprecated": false,
|
|
54105
54168
|
"deprecationMessage": "",
|
|
54106
54169
|
"tagName": {
|
|
54107
54170
|
"text": "param"
|
|
54108
54171
|
}
|
|
54109
54172
|
},
|
|
54110
54173
|
{
|
|
54111
|
-
"name": "
|
|
54112
|
-
"type": "number",
|
|
54174
|
+
"name": "commentStyle",
|
|
54113
54175
|
"deprecated": false,
|
|
54114
54176
|
"deprecationMessage": "",
|
|
54115
54177
|
"tagName": {
|
|
@@ -54119,8 +54181,8 @@
|
|
|
54119
54181
|
]
|
|
54120
54182
|
},
|
|
54121
54183
|
{
|
|
54122
|
-
"name": "
|
|
54123
|
-
"file": "packages/core/schematics/migrate-
|
|
54184
|
+
"name": "collectTypeScriptAnnotations",
|
|
54185
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
54124
54186
|
"ctype": "miscellaneous",
|
|
54125
54187
|
"subtype": "function",
|
|
54126
54188
|
"coverageIgnore": false,
|
|
@@ -54128,7 +54190,7 @@
|
|
|
54128
54190
|
"deprecationMessage": "",
|
|
54129
54191
|
"rawdescription": "",
|
|
54130
54192
|
"description": "",
|
|
54131
|
-
"displayName": "
|
|
54193
|
+
"displayName": "collectTypeScriptAnnotations",
|
|
54132
54194
|
"args": [
|
|
54133
54195
|
{
|
|
54134
54196
|
"name": "source",
|
|
@@ -54137,13 +54199,13 @@
|
|
|
54137
54199
|
"deprecationMessage": ""
|
|
54138
54200
|
},
|
|
54139
54201
|
{
|
|
54140
|
-
"name": "
|
|
54141
|
-
"type": "
|
|
54202
|
+
"name": "path",
|
|
54203
|
+
"type": "string",
|
|
54142
54204
|
"deprecated": false,
|
|
54143
54205
|
"deprecationMessage": ""
|
|
54144
54206
|
}
|
|
54145
54207
|
],
|
|
54146
|
-
"returnType": "
|
|
54208
|
+
"returnType": "Annotation[]",
|
|
54147
54209
|
"jsdoctags": [
|
|
54148
54210
|
{
|
|
54149
54211
|
"name": "source",
|
|
@@ -54155,8 +54217,8 @@
|
|
|
54155
54217
|
}
|
|
54156
54218
|
},
|
|
54157
54219
|
{
|
|
54158
|
-
"name": "
|
|
54159
|
-
"type": "
|
|
54220
|
+
"name": "path",
|
|
54221
|
+
"type": "string",
|
|
54160
54222
|
"deprecated": false,
|
|
54161
54223
|
"deprecationMessage": "",
|
|
54162
54224
|
"tagName": {
|
|
@@ -54167,7 +54229,612 @@
|
|
|
54167
54229
|
},
|
|
54168
54230
|
{
|
|
54169
54231
|
"name": "isComponentMetadataProperty",
|
|
54170
|
-
"file": "packages/core/schematics/migrate-
|
|
54232
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
54233
|
+
"ctype": "miscellaneous",
|
|
54234
|
+
"subtype": "function",
|
|
54235
|
+
"coverageIgnore": false,
|
|
54236
|
+
"deprecated": false,
|
|
54237
|
+
"deprecationMessage": "",
|
|
54238
|
+
"rawdescription": "",
|
|
54239
|
+
"description": "",
|
|
54240
|
+
"displayName": "isComponentMetadataProperty",
|
|
54241
|
+
"args": [
|
|
54242
|
+
{
|
|
54243
|
+
"name": "node",
|
|
54244
|
+
"deprecated": false,
|
|
54245
|
+
"deprecationMessage": ""
|
|
54246
|
+
}
|
|
54247
|
+
],
|
|
54248
|
+
"returnType": "boolean",
|
|
54249
|
+
"jsdoctags": [
|
|
54250
|
+
{
|
|
54251
|
+
"name": "node",
|
|
54252
|
+
"deprecated": false,
|
|
54253
|
+
"deprecationMessage": "",
|
|
54254
|
+
"tagName": {
|
|
54255
|
+
"text": "param"
|
|
54256
|
+
}
|
|
54257
|
+
}
|
|
54258
|
+
]
|
|
54259
|
+
},
|
|
54260
|
+
{
|
|
54261
|
+
"name": "isTemplateProperty",
|
|
54262
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
54263
|
+
"ctype": "miscellaneous",
|
|
54264
|
+
"subtype": "function",
|
|
54265
|
+
"coverageIgnore": false,
|
|
54266
|
+
"deprecated": false,
|
|
54267
|
+
"deprecationMessage": "",
|
|
54268
|
+
"rawdescription": "",
|
|
54269
|
+
"description": "",
|
|
54270
|
+
"displayName": "isTemplateProperty",
|
|
54271
|
+
"args": [
|
|
54272
|
+
{
|
|
54273
|
+
"name": "node",
|
|
54274
|
+
"deprecated": false,
|
|
54275
|
+
"deprecationMessage": ""
|
|
54276
|
+
}
|
|
54277
|
+
],
|
|
54278
|
+
"returnType": "boolean",
|
|
54279
|
+
"jsdoctags": [
|
|
54280
|
+
{
|
|
54281
|
+
"name": "node",
|
|
54282
|
+
"deprecated": false,
|
|
54283
|
+
"deprecationMessage": "",
|
|
54284
|
+
"tagName": {
|
|
54285
|
+
"text": "param"
|
|
54286
|
+
}
|
|
54287
|
+
}
|
|
54288
|
+
]
|
|
54289
|
+
},
|
|
54290
|
+
{
|
|
54291
|
+
"name": "migrateEclRemovedComponents",
|
|
54292
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
54293
|
+
"ctype": "miscellaneous",
|
|
54294
|
+
"subtype": "function",
|
|
54295
|
+
"coverageIgnore": false,
|
|
54296
|
+
"deprecated": false,
|
|
54297
|
+
"deprecationMessage": "",
|
|
54298
|
+
"rawdescription": "",
|
|
54299
|
+
"description": "",
|
|
54300
|
+
"displayName": "migrateEclRemovedComponents",
|
|
54301
|
+
"args": [
|
|
54302
|
+
{
|
|
54303
|
+
"name": "options",
|
|
54304
|
+
"type": "Schema",
|
|
54305
|
+
"deprecated": false,
|
|
54306
|
+
"deprecationMessage": "",
|
|
54307
|
+
"defaultValue": "{}"
|
|
54308
|
+
}
|
|
54309
|
+
],
|
|
54310
|
+
"returnType": "Rule",
|
|
54311
|
+
"jsdoctags": [
|
|
54312
|
+
{
|
|
54313
|
+
"name": "options",
|
|
54314
|
+
"type": "Schema",
|
|
54315
|
+
"deprecated": false,
|
|
54316
|
+
"deprecationMessage": "",
|
|
54317
|
+
"defaultValue": "{}",
|
|
54318
|
+
"tagName": {
|
|
54319
|
+
"text": "param"
|
|
54320
|
+
}
|
|
54321
|
+
}
|
|
54322
|
+
]
|
|
54323
|
+
},
|
|
54324
|
+
{
|
|
54325
|
+
"name": "unwrapExpression",
|
|
54326
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
54327
|
+
"ctype": "miscellaneous",
|
|
54328
|
+
"subtype": "function",
|
|
54329
|
+
"coverageIgnore": false,
|
|
54330
|
+
"deprecated": false,
|
|
54331
|
+
"deprecationMessage": "",
|
|
54332
|
+
"rawdescription": "",
|
|
54333
|
+
"description": "",
|
|
54334
|
+
"displayName": "unwrapExpression",
|
|
54335
|
+
"args": [
|
|
54336
|
+
{
|
|
54337
|
+
"name": "expression",
|
|
54338
|
+
"deprecated": false,
|
|
54339
|
+
"deprecationMessage": ""
|
|
54340
|
+
}
|
|
54341
|
+
],
|
|
54342
|
+
"returnType": "ts.Expression",
|
|
54343
|
+
"jsdoctags": [
|
|
54344
|
+
{
|
|
54345
|
+
"name": "expression",
|
|
54346
|
+
"deprecated": false,
|
|
54347
|
+
"deprecationMessage": "",
|
|
54348
|
+
"tagName": {
|
|
54349
|
+
"text": "param"
|
|
54350
|
+
}
|
|
54351
|
+
}
|
|
54352
|
+
]
|
|
54353
|
+
},
|
|
54354
|
+
{
|
|
54355
|
+
"name": "visitDir",
|
|
54356
|
+
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
54357
|
+
"ctype": "miscellaneous",
|
|
54358
|
+
"subtype": "function",
|
|
54359
|
+
"coverageIgnore": false,
|
|
54360
|
+
"deprecated": false,
|
|
54361
|
+
"deprecationMessage": "",
|
|
54362
|
+
"rawdescription": "",
|
|
54363
|
+
"description": "",
|
|
54364
|
+
"displayName": "visitDir",
|
|
54365
|
+
"args": [
|
|
54366
|
+
{
|
|
54367
|
+
"name": "dir",
|
|
54368
|
+
"type": "DirEntry",
|
|
54369
|
+
"deprecated": false,
|
|
54370
|
+
"deprecationMessage": ""
|
|
54371
|
+
},
|
|
54372
|
+
{
|
|
54373
|
+
"name": "callback",
|
|
54374
|
+
"deprecated": false,
|
|
54375
|
+
"deprecationMessage": ""
|
|
54376
|
+
}
|
|
54377
|
+
],
|
|
54378
|
+
"returnType": "void",
|
|
54379
|
+
"jsdoctags": [
|
|
54380
|
+
{
|
|
54381
|
+
"name": "dir",
|
|
54382
|
+
"type": "DirEntry",
|
|
54383
|
+
"deprecated": false,
|
|
54384
|
+
"deprecationMessage": "",
|
|
54385
|
+
"tagName": {
|
|
54386
|
+
"text": "param"
|
|
54387
|
+
}
|
|
54388
|
+
},
|
|
54389
|
+
{
|
|
54390
|
+
"name": "callback",
|
|
54391
|
+
"deprecated": false,
|
|
54392
|
+
"deprecationMessage": "",
|
|
54393
|
+
"tagName": {
|
|
54394
|
+
"text": "param"
|
|
54395
|
+
}
|
|
54396
|
+
}
|
|
54397
|
+
]
|
|
54398
|
+
}
|
|
54399
|
+
],
|
|
54400
|
+
"packages/core/schematics/migrate-eui-tabs/index.ts": [
|
|
54401
|
+
{
|
|
54402
|
+
"name": "applyChanges",
|
|
54403
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54404
|
+
"ctype": "miscellaneous",
|
|
54405
|
+
"subtype": "function",
|
|
54406
|
+
"coverageIgnore": false,
|
|
54407
|
+
"deprecated": false,
|
|
54408
|
+
"deprecationMessage": "",
|
|
54409
|
+
"rawdescription": "",
|
|
54410
|
+
"description": "",
|
|
54411
|
+
"displayName": "applyChanges",
|
|
54412
|
+
"args": [
|
|
54413
|
+
{
|
|
54414
|
+
"name": "source",
|
|
54415
|
+
"type": "string",
|
|
54416
|
+
"deprecated": false,
|
|
54417
|
+
"deprecationMessage": ""
|
|
54418
|
+
},
|
|
54419
|
+
{
|
|
54420
|
+
"name": "changes",
|
|
54421
|
+
"deprecated": false,
|
|
54422
|
+
"deprecationMessage": ""
|
|
54423
|
+
}
|
|
54424
|
+
],
|
|
54425
|
+
"returnType": "string",
|
|
54426
|
+
"jsdoctags": [
|
|
54427
|
+
{
|
|
54428
|
+
"name": "source",
|
|
54429
|
+
"type": "string",
|
|
54430
|
+
"deprecated": false,
|
|
54431
|
+
"deprecationMessage": "",
|
|
54432
|
+
"tagName": {
|
|
54433
|
+
"text": "param"
|
|
54434
|
+
}
|
|
54435
|
+
},
|
|
54436
|
+
{
|
|
54437
|
+
"name": "changes",
|
|
54438
|
+
"deprecated": false,
|
|
54439
|
+
"deprecationMessage": "",
|
|
54440
|
+
"tagName": {
|
|
54441
|
+
"text": "param"
|
|
54442
|
+
}
|
|
54443
|
+
}
|
|
54444
|
+
]
|
|
54445
|
+
},
|
|
54446
|
+
{
|
|
54447
|
+
"name": "buildBodyReplacement",
|
|
54448
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54449
|
+
"ctype": "miscellaneous",
|
|
54450
|
+
"subtype": "function",
|
|
54451
|
+
"coverageIgnore": false,
|
|
54452
|
+
"deprecated": false,
|
|
54453
|
+
"deprecationMessage": "",
|
|
54454
|
+
"rawdescription": "",
|
|
54455
|
+
"description": "",
|
|
54456
|
+
"displayName": "buildBodyReplacement",
|
|
54457
|
+
"args": [
|
|
54458
|
+
{
|
|
54459
|
+
"name": "source",
|
|
54460
|
+
"type": "string",
|
|
54461
|
+
"deprecated": false,
|
|
54462
|
+
"deprecationMessage": ""
|
|
54463
|
+
},
|
|
54464
|
+
{
|
|
54465
|
+
"name": "content",
|
|
54466
|
+
"type": "TmplAstElement",
|
|
54467
|
+
"deprecated": false,
|
|
54468
|
+
"deprecationMessage": ""
|
|
54469
|
+
}
|
|
54470
|
+
],
|
|
54471
|
+
"returnType": "string",
|
|
54472
|
+
"jsdoctags": [
|
|
54473
|
+
{
|
|
54474
|
+
"name": "source",
|
|
54475
|
+
"type": "string",
|
|
54476
|
+
"deprecated": false,
|
|
54477
|
+
"deprecationMessage": "",
|
|
54478
|
+
"tagName": {
|
|
54479
|
+
"text": "param"
|
|
54480
|
+
}
|
|
54481
|
+
},
|
|
54482
|
+
{
|
|
54483
|
+
"name": "content",
|
|
54484
|
+
"type": "TmplAstElement",
|
|
54485
|
+
"deprecated": false,
|
|
54486
|
+
"deprecationMessage": "",
|
|
54487
|
+
"tagName": {
|
|
54488
|
+
"text": "param"
|
|
54489
|
+
}
|
|
54490
|
+
}
|
|
54491
|
+
]
|
|
54492
|
+
},
|
|
54493
|
+
{
|
|
54494
|
+
"name": "buildHeaderReplacement",
|
|
54495
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54496
|
+
"ctype": "miscellaneous",
|
|
54497
|
+
"subtype": "function",
|
|
54498
|
+
"coverageIgnore": false,
|
|
54499
|
+
"deprecated": false,
|
|
54500
|
+
"deprecationMessage": "",
|
|
54501
|
+
"rawdescription": "",
|
|
54502
|
+
"description": "",
|
|
54503
|
+
"displayName": "buildHeaderReplacement",
|
|
54504
|
+
"args": [
|
|
54505
|
+
{
|
|
54506
|
+
"name": "source",
|
|
54507
|
+
"type": "string",
|
|
54508
|
+
"deprecated": false,
|
|
54509
|
+
"deprecationMessage": ""
|
|
54510
|
+
},
|
|
54511
|
+
{
|
|
54512
|
+
"name": "label",
|
|
54513
|
+
"type": "TmplAstElement",
|
|
54514
|
+
"deprecated": false,
|
|
54515
|
+
"deprecationMessage": ""
|
|
54516
|
+
}
|
|
54517
|
+
],
|
|
54518
|
+
"returnType": "string",
|
|
54519
|
+
"jsdoctags": [
|
|
54520
|
+
{
|
|
54521
|
+
"name": "source",
|
|
54522
|
+
"type": "string",
|
|
54523
|
+
"deprecated": false,
|
|
54524
|
+
"deprecationMessage": "",
|
|
54525
|
+
"tagName": {
|
|
54526
|
+
"text": "param"
|
|
54527
|
+
}
|
|
54528
|
+
},
|
|
54529
|
+
{
|
|
54530
|
+
"name": "label",
|
|
54531
|
+
"type": "TmplAstElement",
|
|
54532
|
+
"deprecated": false,
|
|
54533
|
+
"deprecationMessage": "",
|
|
54534
|
+
"tagName": {
|
|
54535
|
+
"text": "param"
|
|
54536
|
+
}
|
|
54537
|
+
}
|
|
54538
|
+
]
|
|
54539
|
+
},
|
|
54540
|
+
{
|
|
54541
|
+
"name": "findDirectChild",
|
|
54542
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54543
|
+
"ctype": "miscellaneous",
|
|
54544
|
+
"subtype": "function",
|
|
54545
|
+
"coverageIgnore": false,
|
|
54546
|
+
"deprecated": false,
|
|
54547
|
+
"deprecationMessage": "",
|
|
54548
|
+
"rawdescription": "",
|
|
54549
|
+
"description": "",
|
|
54550
|
+
"displayName": "findDirectChild",
|
|
54551
|
+
"args": [
|
|
54552
|
+
{
|
|
54553
|
+
"name": "element",
|
|
54554
|
+
"type": "TmplAstElement",
|
|
54555
|
+
"deprecated": false,
|
|
54556
|
+
"deprecationMessage": ""
|
|
54557
|
+
},
|
|
54558
|
+
{
|
|
54559
|
+
"name": "name",
|
|
54560
|
+
"type": "string",
|
|
54561
|
+
"deprecated": false,
|
|
54562
|
+
"deprecationMessage": ""
|
|
54563
|
+
}
|
|
54564
|
+
],
|
|
54565
|
+
"returnType": "TmplAstElement | undefined",
|
|
54566
|
+
"jsdoctags": [
|
|
54567
|
+
{
|
|
54568
|
+
"name": "element",
|
|
54569
|
+
"type": "TmplAstElement",
|
|
54570
|
+
"deprecated": false,
|
|
54571
|
+
"deprecationMessage": "",
|
|
54572
|
+
"tagName": {
|
|
54573
|
+
"text": "param"
|
|
54574
|
+
}
|
|
54575
|
+
},
|
|
54576
|
+
{
|
|
54577
|
+
"name": "name",
|
|
54578
|
+
"type": "string",
|
|
54579
|
+
"deprecated": false,
|
|
54580
|
+
"deprecationMessage": "",
|
|
54581
|
+
"tagName": {
|
|
54582
|
+
"text": "param"
|
|
54583
|
+
}
|
|
54584
|
+
}
|
|
54585
|
+
]
|
|
54586
|
+
},
|
|
54587
|
+
{
|
|
54588
|
+
"name": "findElements",
|
|
54589
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54590
|
+
"ctype": "miscellaneous",
|
|
54591
|
+
"subtype": "function",
|
|
54592
|
+
"coverageIgnore": false,
|
|
54593
|
+
"deprecated": false,
|
|
54594
|
+
"deprecationMessage": "",
|
|
54595
|
+
"rawdescription": "",
|
|
54596
|
+
"description": "",
|
|
54597
|
+
"displayName": "findElements",
|
|
54598
|
+
"args": [
|
|
54599
|
+
{
|
|
54600
|
+
"name": "nodes",
|
|
54601
|
+
"deprecated": false,
|
|
54602
|
+
"deprecationMessage": ""
|
|
54603
|
+
},
|
|
54604
|
+
{
|
|
54605
|
+
"name": "name",
|
|
54606
|
+
"type": "string",
|
|
54607
|
+
"deprecated": false,
|
|
54608
|
+
"deprecationMessage": ""
|
|
54609
|
+
}
|
|
54610
|
+
],
|
|
54611
|
+
"returnType": "TmplAstElement[]",
|
|
54612
|
+
"jsdoctags": [
|
|
54613
|
+
{
|
|
54614
|
+
"name": "nodes",
|
|
54615
|
+
"deprecated": false,
|
|
54616
|
+
"deprecationMessage": "",
|
|
54617
|
+
"tagName": {
|
|
54618
|
+
"text": "param"
|
|
54619
|
+
}
|
|
54620
|
+
},
|
|
54621
|
+
{
|
|
54622
|
+
"name": "name",
|
|
54623
|
+
"type": "string",
|
|
54624
|
+
"deprecated": false,
|
|
54625
|
+
"deprecationMessage": "",
|
|
54626
|
+
"tagName": {
|
|
54627
|
+
"text": "param"
|
|
54628
|
+
}
|
|
54629
|
+
}
|
|
54630
|
+
]
|
|
54631
|
+
},
|
|
54632
|
+
{
|
|
54633
|
+
"name": "formatInnerLines",
|
|
54634
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54635
|
+
"ctype": "miscellaneous",
|
|
54636
|
+
"subtype": "function",
|
|
54637
|
+
"coverageIgnore": false,
|
|
54638
|
+
"deprecated": false,
|
|
54639
|
+
"deprecationMessage": "",
|
|
54640
|
+
"rawdescription": "",
|
|
54641
|
+
"description": "",
|
|
54642
|
+
"displayName": "formatInnerLines",
|
|
54643
|
+
"args": [
|
|
54644
|
+
{
|
|
54645
|
+
"name": "source",
|
|
54646
|
+
"type": "string",
|
|
54647
|
+
"deprecated": false,
|
|
54648
|
+
"deprecationMessage": ""
|
|
54649
|
+
},
|
|
54650
|
+
{
|
|
54651
|
+
"name": "indent",
|
|
54652
|
+
"type": "string",
|
|
54653
|
+
"deprecated": false,
|
|
54654
|
+
"deprecationMessage": ""
|
|
54655
|
+
}
|
|
54656
|
+
],
|
|
54657
|
+
"returnType": "string[]",
|
|
54658
|
+
"jsdoctags": [
|
|
54659
|
+
{
|
|
54660
|
+
"name": "source",
|
|
54661
|
+
"type": "string",
|
|
54662
|
+
"deprecated": false,
|
|
54663
|
+
"deprecationMessage": "",
|
|
54664
|
+
"tagName": {
|
|
54665
|
+
"text": "param"
|
|
54666
|
+
}
|
|
54667
|
+
},
|
|
54668
|
+
{
|
|
54669
|
+
"name": "indent",
|
|
54670
|
+
"type": "string",
|
|
54671
|
+
"deprecated": false,
|
|
54672
|
+
"deprecationMessage": "",
|
|
54673
|
+
"tagName": {
|
|
54674
|
+
"text": "param"
|
|
54675
|
+
}
|
|
54676
|
+
}
|
|
54677
|
+
]
|
|
54678
|
+
},
|
|
54679
|
+
{
|
|
54680
|
+
"name": "getAttributeText",
|
|
54681
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54682
|
+
"ctype": "miscellaneous",
|
|
54683
|
+
"subtype": "function",
|
|
54684
|
+
"coverageIgnore": false,
|
|
54685
|
+
"deprecated": false,
|
|
54686
|
+
"deprecationMessage": "",
|
|
54687
|
+
"rawdescription": "",
|
|
54688
|
+
"description": "",
|
|
54689
|
+
"displayName": "getAttributeText",
|
|
54690
|
+
"args": [
|
|
54691
|
+
{
|
|
54692
|
+
"name": "source",
|
|
54693
|
+
"type": "string",
|
|
54694
|
+
"deprecated": false,
|
|
54695
|
+
"deprecationMessage": ""
|
|
54696
|
+
},
|
|
54697
|
+
{
|
|
54698
|
+
"name": "element",
|
|
54699
|
+
"type": "TmplAstElement",
|
|
54700
|
+
"deprecated": false,
|
|
54701
|
+
"deprecationMessage": ""
|
|
54702
|
+
},
|
|
54703
|
+
{
|
|
54704
|
+
"name": "tagName",
|
|
54705
|
+
"type": "string",
|
|
54706
|
+
"deprecated": false,
|
|
54707
|
+
"deprecationMessage": ""
|
|
54708
|
+
}
|
|
54709
|
+
],
|
|
54710
|
+
"returnType": "string",
|
|
54711
|
+
"jsdoctags": [
|
|
54712
|
+
{
|
|
54713
|
+
"name": "source",
|
|
54714
|
+
"type": "string",
|
|
54715
|
+
"deprecated": false,
|
|
54716
|
+
"deprecationMessage": "",
|
|
54717
|
+
"tagName": {
|
|
54718
|
+
"text": "param"
|
|
54719
|
+
}
|
|
54720
|
+
},
|
|
54721
|
+
{
|
|
54722
|
+
"name": "element",
|
|
54723
|
+
"type": "TmplAstElement",
|
|
54724
|
+
"deprecated": false,
|
|
54725
|
+
"deprecationMessage": "",
|
|
54726
|
+
"tagName": {
|
|
54727
|
+
"text": "param"
|
|
54728
|
+
}
|
|
54729
|
+
},
|
|
54730
|
+
{
|
|
54731
|
+
"name": "tagName",
|
|
54732
|
+
"type": "string",
|
|
54733
|
+
"deprecated": false,
|
|
54734
|
+
"deprecationMessage": "",
|
|
54735
|
+
"tagName": {
|
|
54736
|
+
"text": "param"
|
|
54737
|
+
}
|
|
54738
|
+
}
|
|
54739
|
+
]
|
|
54740
|
+
},
|
|
54741
|
+
{
|
|
54742
|
+
"name": "getIndent",
|
|
54743
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54744
|
+
"ctype": "miscellaneous",
|
|
54745
|
+
"subtype": "function",
|
|
54746
|
+
"coverageIgnore": false,
|
|
54747
|
+
"deprecated": false,
|
|
54748
|
+
"deprecationMessage": "",
|
|
54749
|
+
"rawdescription": "",
|
|
54750
|
+
"description": "",
|
|
54751
|
+
"displayName": "getIndent",
|
|
54752
|
+
"args": [
|
|
54753
|
+
{
|
|
54754
|
+
"name": "source",
|
|
54755
|
+
"type": "string",
|
|
54756
|
+
"deprecated": false,
|
|
54757
|
+
"deprecationMessage": ""
|
|
54758
|
+
},
|
|
54759
|
+
{
|
|
54760
|
+
"name": "offset",
|
|
54761
|
+
"type": "number",
|
|
54762
|
+
"deprecated": false,
|
|
54763
|
+
"deprecationMessage": ""
|
|
54764
|
+
}
|
|
54765
|
+
],
|
|
54766
|
+
"returnType": "string",
|
|
54767
|
+
"jsdoctags": [
|
|
54768
|
+
{
|
|
54769
|
+
"name": "source",
|
|
54770
|
+
"type": "string",
|
|
54771
|
+
"deprecated": false,
|
|
54772
|
+
"deprecationMessage": "",
|
|
54773
|
+
"tagName": {
|
|
54774
|
+
"text": "param"
|
|
54775
|
+
}
|
|
54776
|
+
},
|
|
54777
|
+
{
|
|
54778
|
+
"name": "offset",
|
|
54779
|
+
"type": "number",
|
|
54780
|
+
"deprecated": false,
|
|
54781
|
+
"deprecationMessage": "",
|
|
54782
|
+
"tagName": {
|
|
54783
|
+
"text": "param"
|
|
54784
|
+
}
|
|
54785
|
+
}
|
|
54786
|
+
]
|
|
54787
|
+
},
|
|
54788
|
+
{
|
|
54789
|
+
"name": "getInnerText",
|
|
54790
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54791
|
+
"ctype": "miscellaneous",
|
|
54792
|
+
"subtype": "function",
|
|
54793
|
+
"coverageIgnore": false,
|
|
54794
|
+
"deprecated": false,
|
|
54795
|
+
"deprecationMessage": "",
|
|
54796
|
+
"rawdescription": "",
|
|
54797
|
+
"description": "",
|
|
54798
|
+
"displayName": "getInnerText",
|
|
54799
|
+
"args": [
|
|
54800
|
+
{
|
|
54801
|
+
"name": "source",
|
|
54802
|
+
"type": "string",
|
|
54803
|
+
"deprecated": false,
|
|
54804
|
+
"deprecationMessage": ""
|
|
54805
|
+
},
|
|
54806
|
+
{
|
|
54807
|
+
"name": "element",
|
|
54808
|
+
"type": "TmplAstElement",
|
|
54809
|
+
"deprecated": false,
|
|
54810
|
+
"deprecationMessage": ""
|
|
54811
|
+
}
|
|
54812
|
+
],
|
|
54813
|
+
"returnType": "string",
|
|
54814
|
+
"jsdoctags": [
|
|
54815
|
+
{
|
|
54816
|
+
"name": "source",
|
|
54817
|
+
"type": "string",
|
|
54818
|
+
"deprecated": false,
|
|
54819
|
+
"deprecationMessage": "",
|
|
54820
|
+
"tagName": {
|
|
54821
|
+
"text": "param"
|
|
54822
|
+
}
|
|
54823
|
+
},
|
|
54824
|
+
{
|
|
54825
|
+
"name": "element",
|
|
54826
|
+
"type": "TmplAstElement",
|
|
54827
|
+
"deprecated": false,
|
|
54828
|
+
"deprecationMessage": "",
|
|
54829
|
+
"tagName": {
|
|
54830
|
+
"text": "param"
|
|
54831
|
+
}
|
|
54832
|
+
}
|
|
54833
|
+
]
|
|
54834
|
+
},
|
|
54835
|
+
{
|
|
54836
|
+
"name": "isComponentMetadataProperty",
|
|
54837
|
+
"file": "packages/core/schematics/migrate-eui-tabs/index.ts",
|
|
54171
54838
|
"ctype": "miscellaneous",
|
|
54172
54839
|
"subtype": "function",
|
|
54173
54840
|
"coverageIgnore": false,
|
|
@@ -65325,6 +65992,53 @@
|
|
|
65325
65992
|
}
|
|
65326
65993
|
]
|
|
65327
65994
|
},
|
|
65995
|
+
{
|
|
65996
|
+
"name": "getLineStartPosition",
|
|
65997
|
+
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
65998
|
+
"ctype": "miscellaneous",
|
|
65999
|
+
"subtype": "function",
|
|
66000
|
+
"coverageIgnore": false,
|
|
66001
|
+
"deprecated": false,
|
|
66002
|
+
"deprecationMessage": "",
|
|
66003
|
+
"rawdescription": "Returns the index of the first character of the line containing `pos`.",
|
|
66004
|
+
"description": "<p>Returns the index of the first character of the line containing <code>pos</code>.</p>\n",
|
|
66005
|
+
"displayName": "getLineStartPosition",
|
|
66006
|
+
"args": [
|
|
66007
|
+
{
|
|
66008
|
+
"name": "source",
|
|
66009
|
+
"type": "string",
|
|
66010
|
+
"deprecated": false,
|
|
66011
|
+
"deprecationMessage": ""
|
|
66012
|
+
},
|
|
66013
|
+
{
|
|
66014
|
+
"name": "pos",
|
|
66015
|
+
"type": "number",
|
|
66016
|
+
"deprecated": false,
|
|
66017
|
+
"deprecationMessage": ""
|
|
66018
|
+
}
|
|
66019
|
+
],
|
|
66020
|
+
"returnType": "number",
|
|
66021
|
+
"jsdoctags": [
|
|
66022
|
+
{
|
|
66023
|
+
"name": "source",
|
|
66024
|
+
"type": "string",
|
|
66025
|
+
"deprecated": false,
|
|
66026
|
+
"deprecationMessage": "",
|
|
66027
|
+
"tagName": {
|
|
66028
|
+
"text": "param"
|
|
66029
|
+
}
|
|
66030
|
+
},
|
|
66031
|
+
{
|
|
66032
|
+
"name": "pos",
|
|
66033
|
+
"type": "number",
|
|
66034
|
+
"deprecated": false,
|
|
66035
|
+
"deprecationMessage": "",
|
|
66036
|
+
"tagName": {
|
|
66037
|
+
"text": "param"
|
|
66038
|
+
}
|
|
66039
|
+
}
|
|
66040
|
+
]
|
|
66041
|
+
},
|
|
65328
66042
|
{
|
|
65329
66043
|
"name": "getTypeAnnotationName",
|
|
65330
66044
|
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
@@ -65449,6 +66163,51 @@
|
|
|
65449
66163
|
}
|
|
65450
66164
|
]
|
|
65451
66165
|
},
|
|
66166
|
+
{
|
|
66167
|
+
"name": "isInsideAnyRange",
|
|
66168
|
+
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
66169
|
+
"ctype": "miscellaneous",
|
|
66170
|
+
"subtype": "function",
|
|
66171
|
+
"coverageIgnore": false,
|
|
66172
|
+
"deprecated": false,
|
|
66173
|
+
"deprecationMessage": "",
|
|
66174
|
+
"rawdescription": "True if `edit`'s position falls within any of the given ranges.",
|
|
66175
|
+
"description": "<p>True if <code>edit</code>'s position falls within any of the given ranges.</p>\n",
|
|
66176
|
+
"displayName": "isInsideAnyRange",
|
|
66177
|
+
"args": [
|
|
66178
|
+
{
|
|
66179
|
+
"name": "edit",
|
|
66180
|
+
"type": "Edit",
|
|
66181
|
+
"deprecated": false,
|
|
66182
|
+
"deprecationMessage": ""
|
|
66183
|
+
},
|
|
66184
|
+
{
|
|
66185
|
+
"name": "ranges",
|
|
66186
|
+
"deprecated": false,
|
|
66187
|
+
"deprecationMessage": ""
|
|
66188
|
+
}
|
|
66189
|
+
],
|
|
66190
|
+
"returnType": "boolean",
|
|
66191
|
+
"jsdoctags": [
|
|
66192
|
+
{
|
|
66193
|
+
"name": "edit",
|
|
66194
|
+
"type": "Edit",
|
|
66195
|
+
"deprecated": false,
|
|
66196
|
+
"deprecationMessage": "",
|
|
66197
|
+
"tagName": {
|
|
66198
|
+
"text": "param"
|
|
66199
|
+
}
|
|
66200
|
+
},
|
|
66201
|
+
{
|
|
66202
|
+
"name": "ranges",
|
|
66203
|
+
"deprecated": false,
|
|
66204
|
+
"deprecationMessage": "",
|
|
66205
|
+
"tagName": {
|
|
66206
|
+
"text": "param"
|
|
66207
|
+
}
|
|
66208
|
+
}
|
|
66209
|
+
]
|
|
66210
|
+
},
|
|
65452
66211
|
{
|
|
65453
66212
|
"name": "migrateToSignals",
|
|
65454
66213
|
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
@@ -65680,6 +66439,79 @@
|
|
|
65680
66439
|
}
|
|
65681
66440
|
]
|
|
65682
66441
|
},
|
|
66442
|
+
{
|
|
66443
|
+
"name": "tryInsertWriteTodo",
|
|
66444
|
+
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
66445
|
+
"ctype": "miscellaneous",
|
|
66446
|
+
"subtype": "function",
|
|
66447
|
+
"coverageIgnore": false,
|
|
66448
|
+
"deprecated": false,
|
|
66449
|
+
"deprecationMessage": "",
|
|
66450
|
+
"rawdescription": "Detects a programmatic WRITE to a now-signal input and returns an edit that\ncomments out the offending statement and prepends an explanatory TODO.\n\nA signal input (`input()`) exposes a read-only getter — it cannot be assigned\nfrom outside the component (`comp.prop = value` no longer compiles, and\n`comp.prop()` is a getter, not a setter). There is no safe, mechanical\nrewrite: the correct fix is to drive the value declaratively through a\ntemplate binding (`[prop]=\"...\"`) or, when a ComponentRef is genuinely\navailable, `componentRef.setInput('prop', value)`. Both require human\njudgement, so instead of rewriting we comment the statement out (keeping the\nbuild green) and leave a TODO pointing at the manual fix.\n\nOnly acts when the assignment is the ENTIRE statement\n(`ExpressionStatement` whose expression is exactly this assignment):\n ref.prop = value (simple assignment)\n ref.prop += value, etc. (compound assignment)\nwhere `ref` is a tracked EUI/ECL reference and `prop` is in its signal set.\n\nWhen the write is only part of a larger statement (e.g. inside an `if`\nwithout a block, or nested in another expression), commenting it out would\nalso remove unrelated logic, so we leave it untouched (it will surface as a\ncompile error the developer must resolve by hand).",
|
|
66451
|
+
"description": "<p>Detects a programmatic WRITE to a now-signal input and returns an edit that\ncomments out the offending statement and prepends an explanatory TODO.</p>\n<p>A signal input (<code>input()</code>) exposes a read-only getter — it cannot be assigned\nfrom outside the component (<code>comp.prop = value</code> no longer compiles, and\n<code>comp.prop()</code> is a getter, not a setter). There is no safe, mechanical\nrewrite: the correct fix is to drive the value declaratively through a\ntemplate binding (<code>[prop]="..."</code>) or, when a ComponentRef is genuinely\navailable, <code>componentRef.setInput('prop', value)</code>. Both require human\njudgement, so instead of rewriting we comment the statement out (keeping the\nbuild green) and leave a TODO pointing at the manual fix.</p>\n<p>Only acts when the assignment is the ENTIRE statement\n(<code>ExpressionStatement</code> whose expression is exactly this assignment):\n ref.prop = value (simple assignment)\n ref.prop += value, etc. (compound assignment)\nwhere <code>ref</code> is a tracked EUI/ECL reference and <code>prop</code> is in its signal set.</p>\n<p>When the write is only part of a larger statement (e.g. inside an <code>if</code>\nwithout a block, or nested in another expression), commenting it out would\nalso remove unrelated logic, so we leave it untouched (it will surface as a\ncompile error the developer must resolve by hand).</p>\n",
|
|
66452
|
+
"displayName": "tryInsertWriteTodo",
|
|
66453
|
+
"args": [
|
|
66454
|
+
{
|
|
66455
|
+
"name": "node",
|
|
66456
|
+
"deprecated": false,
|
|
66457
|
+
"deprecationMessage": ""
|
|
66458
|
+
},
|
|
66459
|
+
{
|
|
66460
|
+
"name": "euiRefs",
|
|
66461
|
+
"type": "Map",
|
|
66462
|
+
"deprecated": false,
|
|
66463
|
+
"deprecationMessage": ""
|
|
66464
|
+
},
|
|
66465
|
+
{
|
|
66466
|
+
"name": "sourceFile",
|
|
66467
|
+
"deprecated": false,
|
|
66468
|
+
"deprecationMessage": ""
|
|
66469
|
+
},
|
|
66470
|
+
{
|
|
66471
|
+
"name": "source",
|
|
66472
|
+
"type": "string",
|
|
66473
|
+
"deprecated": false,
|
|
66474
|
+
"deprecationMessage": ""
|
|
66475
|
+
}
|
|
66476
|
+
],
|
|
66477
|
+
"returnType": "Edit | null",
|
|
66478
|
+
"jsdoctags": [
|
|
66479
|
+
{
|
|
66480
|
+
"name": "node",
|
|
66481
|
+
"deprecated": false,
|
|
66482
|
+
"deprecationMessage": "",
|
|
66483
|
+
"tagName": {
|
|
66484
|
+
"text": "param"
|
|
66485
|
+
}
|
|
66486
|
+
},
|
|
66487
|
+
{
|
|
66488
|
+
"name": "euiRefs",
|
|
66489
|
+
"type": "Map",
|
|
66490
|
+
"deprecated": false,
|
|
66491
|
+
"deprecationMessage": "",
|
|
66492
|
+
"tagName": {
|
|
66493
|
+
"text": "param"
|
|
66494
|
+
}
|
|
66495
|
+
},
|
|
66496
|
+
{
|
|
66497
|
+
"name": "sourceFile",
|
|
66498
|
+
"deprecated": false,
|
|
66499
|
+
"deprecationMessage": "",
|
|
66500
|
+
"tagName": {
|
|
66501
|
+
"text": "param"
|
|
66502
|
+
}
|
|
66503
|
+
},
|
|
66504
|
+
{
|
|
66505
|
+
"name": "source",
|
|
66506
|
+
"type": "string",
|
|
66507
|
+
"deprecated": false,
|
|
66508
|
+
"deprecationMessage": "",
|
|
66509
|
+
"tagName": {
|
|
66510
|
+
"text": "param"
|
|
66511
|
+
}
|
|
66512
|
+
}
|
|
66513
|
+
]
|
|
66514
|
+
},
|
|
65683
66515
|
{
|
|
65684
66516
|
"name": "tryRewritePropertyAccess",
|
|
65685
66517
|
"file": "packages/core/schematics/migrate-to-signals/index.ts",
|
|
@@ -66459,408 +67291,6 @@
|
|
|
66459
67291
|
]
|
|
66460
67292
|
}
|
|
66461
67293
|
],
|
|
66462
|
-
"packages/core/schematics/migrate-ecl-removed-components/index.ts": [
|
|
66463
|
-
{
|
|
66464
|
-
"name": "checkElement",
|
|
66465
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
66466
|
-
"ctype": "miscellaneous",
|
|
66467
|
-
"subtype": "function",
|
|
66468
|
-
"coverageIgnore": false,
|
|
66469
|
-
"deprecated": false,
|
|
66470
|
-
"deprecationMessage": "",
|
|
66471
|
-
"rawdescription": "",
|
|
66472
|
-
"description": "",
|
|
66473
|
-
"displayName": "checkElement",
|
|
66474
|
-
"args": [
|
|
66475
|
-
{
|
|
66476
|
-
"name": "element",
|
|
66477
|
-
"type": "TmplAstElement",
|
|
66478
|
-
"deprecated": false,
|
|
66479
|
-
"deprecationMessage": ""
|
|
66480
|
-
},
|
|
66481
|
-
{
|
|
66482
|
-
"name": "lineOffset",
|
|
66483
|
-
"type": "number",
|
|
66484
|
-
"deprecated": false,
|
|
66485
|
-
"deprecationMessage": ""
|
|
66486
|
-
},
|
|
66487
|
-
{
|
|
66488
|
-
"name": "path",
|
|
66489
|
-
"type": "string",
|
|
66490
|
-
"deprecated": false,
|
|
66491
|
-
"deprecationMessage": ""
|
|
66492
|
-
},
|
|
66493
|
-
{
|
|
66494
|
-
"name": "context",
|
|
66495
|
-
"type": "SchematicContext",
|
|
66496
|
-
"deprecated": false,
|
|
66497
|
-
"deprecationMessage": ""
|
|
66498
|
-
}
|
|
66499
|
-
],
|
|
66500
|
-
"returnType": "number",
|
|
66501
|
-
"jsdoctags": [
|
|
66502
|
-
{
|
|
66503
|
-
"name": "element",
|
|
66504
|
-
"type": "TmplAstElement",
|
|
66505
|
-
"deprecated": false,
|
|
66506
|
-
"deprecationMessage": "",
|
|
66507
|
-
"tagName": {
|
|
66508
|
-
"text": "param"
|
|
66509
|
-
}
|
|
66510
|
-
},
|
|
66511
|
-
{
|
|
66512
|
-
"name": "lineOffset",
|
|
66513
|
-
"type": "number",
|
|
66514
|
-
"deprecated": false,
|
|
66515
|
-
"deprecationMessage": "",
|
|
66516
|
-
"tagName": {
|
|
66517
|
-
"text": "param"
|
|
66518
|
-
}
|
|
66519
|
-
},
|
|
66520
|
-
{
|
|
66521
|
-
"name": "path",
|
|
66522
|
-
"type": "string",
|
|
66523
|
-
"deprecated": false,
|
|
66524
|
-
"deprecationMessage": "",
|
|
66525
|
-
"tagName": {
|
|
66526
|
-
"text": "param"
|
|
66527
|
-
}
|
|
66528
|
-
},
|
|
66529
|
-
{
|
|
66530
|
-
"name": "context",
|
|
66531
|
-
"type": "SchematicContext",
|
|
66532
|
-
"deprecated": false,
|
|
66533
|
-
"deprecationMessage": "",
|
|
66534
|
-
"tagName": {
|
|
66535
|
-
"text": "param"
|
|
66536
|
-
}
|
|
66537
|
-
}
|
|
66538
|
-
]
|
|
66539
|
-
},
|
|
66540
|
-
{
|
|
66541
|
-
"name": "isComponentMetadataProperty",
|
|
66542
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
66543
|
-
"ctype": "miscellaneous",
|
|
66544
|
-
"subtype": "function",
|
|
66545
|
-
"coverageIgnore": false,
|
|
66546
|
-
"deprecated": false,
|
|
66547
|
-
"deprecationMessage": "",
|
|
66548
|
-
"rawdescription": "",
|
|
66549
|
-
"description": "",
|
|
66550
|
-
"displayName": "isComponentMetadataProperty",
|
|
66551
|
-
"args": [
|
|
66552
|
-
{
|
|
66553
|
-
"name": "node",
|
|
66554
|
-
"deprecated": false,
|
|
66555
|
-
"deprecationMessage": ""
|
|
66556
|
-
}
|
|
66557
|
-
],
|
|
66558
|
-
"returnType": "boolean",
|
|
66559
|
-
"jsdoctags": [
|
|
66560
|
-
{
|
|
66561
|
-
"name": "node",
|
|
66562
|
-
"deprecated": false,
|
|
66563
|
-
"deprecationMessage": "",
|
|
66564
|
-
"tagName": {
|
|
66565
|
-
"text": "param"
|
|
66566
|
-
}
|
|
66567
|
-
}
|
|
66568
|
-
]
|
|
66569
|
-
},
|
|
66570
|
-
{
|
|
66571
|
-
"name": "isTemplateProperty",
|
|
66572
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
66573
|
-
"ctype": "miscellaneous",
|
|
66574
|
-
"subtype": "function",
|
|
66575
|
-
"coverageIgnore": false,
|
|
66576
|
-
"deprecated": false,
|
|
66577
|
-
"deprecationMessage": "",
|
|
66578
|
-
"rawdescription": "",
|
|
66579
|
-
"description": "",
|
|
66580
|
-
"displayName": "isTemplateProperty",
|
|
66581
|
-
"args": [
|
|
66582
|
-
{
|
|
66583
|
-
"name": "node",
|
|
66584
|
-
"deprecated": false,
|
|
66585
|
-
"deprecationMessage": ""
|
|
66586
|
-
}
|
|
66587
|
-
],
|
|
66588
|
-
"returnType": "boolean",
|
|
66589
|
-
"jsdoctags": [
|
|
66590
|
-
{
|
|
66591
|
-
"name": "node",
|
|
66592
|
-
"deprecated": false,
|
|
66593
|
-
"deprecationMessage": "",
|
|
66594
|
-
"tagName": {
|
|
66595
|
-
"text": "param"
|
|
66596
|
-
}
|
|
66597
|
-
}
|
|
66598
|
-
]
|
|
66599
|
-
},
|
|
66600
|
-
{
|
|
66601
|
-
"name": "migrateEclRemovedComponents",
|
|
66602
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
66603
|
-
"ctype": "miscellaneous",
|
|
66604
|
-
"subtype": "function",
|
|
66605
|
-
"coverageIgnore": false,
|
|
66606
|
-
"deprecated": false,
|
|
66607
|
-
"deprecationMessage": "",
|
|
66608
|
-
"rawdescription": "",
|
|
66609
|
-
"description": "",
|
|
66610
|
-
"displayName": "migrateEclRemovedComponents",
|
|
66611
|
-
"args": [
|
|
66612
|
-
{
|
|
66613
|
-
"name": "options",
|
|
66614
|
-
"type": "Schema",
|
|
66615
|
-
"deprecated": false,
|
|
66616
|
-
"deprecationMessage": "",
|
|
66617
|
-
"defaultValue": "{}"
|
|
66618
|
-
}
|
|
66619
|
-
],
|
|
66620
|
-
"returnType": "Rule",
|
|
66621
|
-
"jsdoctags": [
|
|
66622
|
-
{
|
|
66623
|
-
"name": "options",
|
|
66624
|
-
"type": "Schema",
|
|
66625
|
-
"deprecated": false,
|
|
66626
|
-
"deprecationMessage": "",
|
|
66627
|
-
"defaultValue": "{}",
|
|
66628
|
-
"tagName": {
|
|
66629
|
-
"text": "param"
|
|
66630
|
-
}
|
|
66631
|
-
}
|
|
66632
|
-
]
|
|
66633
|
-
},
|
|
66634
|
-
{
|
|
66635
|
-
"name": "scanTemplate",
|
|
66636
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
66637
|
-
"ctype": "miscellaneous",
|
|
66638
|
-
"subtype": "function",
|
|
66639
|
-
"coverageIgnore": false,
|
|
66640
|
-
"deprecated": false,
|
|
66641
|
-
"deprecationMessage": "",
|
|
66642
|
-
"rawdescription": "Scans a template string for removed tags/attributes.\n`lineOffset` shifts reported line numbers so inline templates report the line\nwithin the host .ts file.",
|
|
66643
|
-
"description": "<p>Scans a template string for removed tags/attributes.\n<code>lineOffset</code> shifts reported line numbers so inline templates report the line\nwithin the host .ts file.</p>\n",
|
|
66644
|
-
"displayName": "scanTemplate",
|
|
66645
|
-
"args": [
|
|
66646
|
-
{
|
|
66647
|
-
"name": "template",
|
|
66648
|
-
"type": "string",
|
|
66649
|
-
"deprecated": false,
|
|
66650
|
-
"deprecationMessage": ""
|
|
66651
|
-
},
|
|
66652
|
-
{
|
|
66653
|
-
"name": "_fileSource",
|
|
66654
|
-
"type": "string",
|
|
66655
|
-
"deprecated": false,
|
|
66656
|
-
"deprecationMessage": ""
|
|
66657
|
-
},
|
|
66658
|
-
{
|
|
66659
|
-
"name": "lineOffset",
|
|
66660
|
-
"type": "number",
|
|
66661
|
-
"deprecated": false,
|
|
66662
|
-
"deprecationMessage": ""
|
|
66663
|
-
},
|
|
66664
|
-
{
|
|
66665
|
-
"name": "path",
|
|
66666
|
-
"type": "string",
|
|
66667
|
-
"deprecated": false,
|
|
66668
|
-
"deprecationMessage": ""
|
|
66669
|
-
},
|
|
66670
|
-
{
|
|
66671
|
-
"name": "context",
|
|
66672
|
-
"type": "SchematicContext",
|
|
66673
|
-
"deprecated": false,
|
|
66674
|
-
"deprecationMessage": ""
|
|
66675
|
-
}
|
|
66676
|
-
],
|
|
66677
|
-
"returnType": "number",
|
|
66678
|
-
"jsdoctags": [
|
|
66679
|
-
{
|
|
66680
|
-
"name": "template",
|
|
66681
|
-
"type": "string",
|
|
66682
|
-
"deprecated": false,
|
|
66683
|
-
"deprecationMessage": "",
|
|
66684
|
-
"tagName": {
|
|
66685
|
-
"text": "param"
|
|
66686
|
-
}
|
|
66687
|
-
},
|
|
66688
|
-
{
|
|
66689
|
-
"name": "_fileSource",
|
|
66690
|
-
"type": "string",
|
|
66691
|
-
"deprecated": false,
|
|
66692
|
-
"deprecationMessage": "",
|
|
66693
|
-
"tagName": {
|
|
66694
|
-
"text": "param"
|
|
66695
|
-
}
|
|
66696
|
-
},
|
|
66697
|
-
{
|
|
66698
|
-
"name": "lineOffset",
|
|
66699
|
-
"type": "number",
|
|
66700
|
-
"deprecated": false,
|
|
66701
|
-
"deprecationMessage": "",
|
|
66702
|
-
"tagName": {
|
|
66703
|
-
"text": "param"
|
|
66704
|
-
}
|
|
66705
|
-
},
|
|
66706
|
-
{
|
|
66707
|
-
"name": "path",
|
|
66708
|
-
"type": "string",
|
|
66709
|
-
"deprecated": false,
|
|
66710
|
-
"deprecationMessage": "",
|
|
66711
|
-
"tagName": {
|
|
66712
|
-
"text": "param"
|
|
66713
|
-
}
|
|
66714
|
-
},
|
|
66715
|
-
{
|
|
66716
|
-
"name": "context",
|
|
66717
|
-
"type": "SchematicContext",
|
|
66718
|
-
"deprecated": false,
|
|
66719
|
-
"deprecationMessage": "",
|
|
66720
|
-
"tagName": {
|
|
66721
|
-
"text": "param"
|
|
66722
|
-
}
|
|
66723
|
-
}
|
|
66724
|
-
]
|
|
66725
|
-
},
|
|
66726
|
-
{
|
|
66727
|
-
"name": "scanTypeScript",
|
|
66728
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
66729
|
-
"ctype": "miscellaneous",
|
|
66730
|
-
"subtype": "function",
|
|
66731
|
-
"coverageIgnore": false,
|
|
66732
|
-
"deprecated": false,
|
|
66733
|
-
"deprecationMessage": "",
|
|
66734
|
-
"rawdescription": "",
|
|
66735
|
-
"description": "",
|
|
66736
|
-
"displayName": "scanTypeScript",
|
|
66737
|
-
"args": [
|
|
66738
|
-
{
|
|
66739
|
-
"name": "source",
|
|
66740
|
-
"type": "string",
|
|
66741
|
-
"deprecated": false,
|
|
66742
|
-
"deprecationMessage": ""
|
|
66743
|
-
},
|
|
66744
|
-
{
|
|
66745
|
-
"name": "path",
|
|
66746
|
-
"type": "string",
|
|
66747
|
-
"deprecated": false,
|
|
66748
|
-
"deprecationMessage": ""
|
|
66749
|
-
},
|
|
66750
|
-
{
|
|
66751
|
-
"name": "context",
|
|
66752
|
-
"type": "SchematicContext",
|
|
66753
|
-
"deprecated": false,
|
|
66754
|
-
"deprecationMessage": ""
|
|
66755
|
-
}
|
|
66756
|
-
],
|
|
66757
|
-
"returnType": "number",
|
|
66758
|
-
"jsdoctags": [
|
|
66759
|
-
{
|
|
66760
|
-
"name": "source",
|
|
66761
|
-
"type": "string",
|
|
66762
|
-
"deprecated": false,
|
|
66763
|
-
"deprecationMessage": "",
|
|
66764
|
-
"tagName": {
|
|
66765
|
-
"text": "param"
|
|
66766
|
-
}
|
|
66767
|
-
},
|
|
66768
|
-
{
|
|
66769
|
-
"name": "path",
|
|
66770
|
-
"type": "string",
|
|
66771
|
-
"deprecated": false,
|
|
66772
|
-
"deprecationMessage": "",
|
|
66773
|
-
"tagName": {
|
|
66774
|
-
"text": "param"
|
|
66775
|
-
}
|
|
66776
|
-
},
|
|
66777
|
-
{
|
|
66778
|
-
"name": "context",
|
|
66779
|
-
"type": "SchematicContext",
|
|
66780
|
-
"deprecated": false,
|
|
66781
|
-
"deprecationMessage": "",
|
|
66782
|
-
"tagName": {
|
|
66783
|
-
"text": "param"
|
|
66784
|
-
}
|
|
66785
|
-
}
|
|
66786
|
-
]
|
|
66787
|
-
},
|
|
66788
|
-
{
|
|
66789
|
-
"name": "unwrapExpression",
|
|
66790
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
66791
|
-
"ctype": "miscellaneous",
|
|
66792
|
-
"subtype": "function",
|
|
66793
|
-
"coverageIgnore": false,
|
|
66794
|
-
"deprecated": false,
|
|
66795
|
-
"deprecationMessage": "",
|
|
66796
|
-
"rawdescription": "",
|
|
66797
|
-
"description": "",
|
|
66798
|
-
"displayName": "unwrapExpression",
|
|
66799
|
-
"args": [
|
|
66800
|
-
{
|
|
66801
|
-
"name": "expression",
|
|
66802
|
-
"deprecated": false,
|
|
66803
|
-
"deprecationMessage": ""
|
|
66804
|
-
}
|
|
66805
|
-
],
|
|
66806
|
-
"returnType": "ts.Expression",
|
|
66807
|
-
"jsdoctags": [
|
|
66808
|
-
{
|
|
66809
|
-
"name": "expression",
|
|
66810
|
-
"deprecated": false,
|
|
66811
|
-
"deprecationMessage": "",
|
|
66812
|
-
"tagName": {
|
|
66813
|
-
"text": "param"
|
|
66814
|
-
}
|
|
66815
|
-
}
|
|
66816
|
-
]
|
|
66817
|
-
},
|
|
66818
|
-
{
|
|
66819
|
-
"name": "visitDir",
|
|
66820
|
-
"file": "packages/core/schematics/migrate-ecl-removed-components/index.ts",
|
|
66821
|
-
"ctype": "miscellaneous",
|
|
66822
|
-
"subtype": "function",
|
|
66823
|
-
"coverageIgnore": false,
|
|
66824
|
-
"deprecated": false,
|
|
66825
|
-
"deprecationMessage": "",
|
|
66826
|
-
"rawdescription": "",
|
|
66827
|
-
"description": "",
|
|
66828
|
-
"displayName": "visitDir",
|
|
66829
|
-
"args": [
|
|
66830
|
-
{
|
|
66831
|
-
"name": "dir",
|
|
66832
|
-
"type": "DirEntry",
|
|
66833
|
-
"deprecated": false,
|
|
66834
|
-
"deprecationMessage": ""
|
|
66835
|
-
},
|
|
66836
|
-
{
|
|
66837
|
-
"name": "callback",
|
|
66838
|
-
"deprecated": false,
|
|
66839
|
-
"deprecationMessage": ""
|
|
66840
|
-
}
|
|
66841
|
-
],
|
|
66842
|
-
"returnType": "void",
|
|
66843
|
-
"jsdoctags": [
|
|
66844
|
-
{
|
|
66845
|
-
"name": "dir",
|
|
66846
|
-
"type": "DirEntry",
|
|
66847
|
-
"deprecated": false,
|
|
66848
|
-
"deprecationMessage": "",
|
|
66849
|
-
"tagName": {
|
|
66850
|
-
"text": "param"
|
|
66851
|
-
}
|
|
66852
|
-
},
|
|
66853
|
-
{
|
|
66854
|
-
"name": "callback",
|
|
66855
|
-
"deprecated": false,
|
|
66856
|
-
"deprecationMessage": "",
|
|
66857
|
-
"tagName": {
|
|
66858
|
-
"text": "param"
|
|
66859
|
-
}
|
|
66860
|
-
}
|
|
66861
|
-
]
|
|
66862
|
-
}
|
|
66863
|
-
],
|
|
66864
67294
|
"packages/core/schematics/migrate-eui-alert/index.ts": [
|
|
66865
67295
|
{
|
|
66866
67296
|
"name": "collectRemovals",
|