@trackunit/iris-app 2.16.14 → 2.16.16

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/migrations/entry.js.map +1 -0
  3. package/migrations/p-content-space-codemod/invent-content-space.js.map +1 -0
  4. package/migrations/p-content-space-codemod/orchestrator.js.map +1 -0
  5. package/migrations/p-content-space-codemod/remove-redundant-padding.js.map +1 -0
  6. package/migrations/p-content-space-codemod/report-run-messaging.js.map +1 -0
  7. package/migrations/p-content-space-codemod/report-unresolved.js.map +1 -0
  8. package/migrations/p-content-space-codemod/resolve-content-shell.js.map +1 -0
  9. package/migrations/p-content-space-codemod/rewrite-page-content.js.map +1 -0
  10. package/migrations/p-content-space-codemod/shell-skip-reason.js.map +1 -0
  11. package/migrations/repair-tsconfig/repair-tsconfig.js +205 -0
  12. package/migrations/repair-tsconfig/repair-tsconfig.js.map +1 -0
  13. package/migrations/utils/classname-ast-rewrite.js.map +1 -0
  14. package/migrations/utils/resolve-extension-types.js.map +1 -0
  15. package/migrations.json +5 -0
  16. package/package.json +20 -6
  17. package/src/executors/submit/executor.js.map +1 -0
  18. package/src/executors/unpublish/executor.js.map +1 -0
  19. package/src/executors/utils/authentication.js.map +1 -0
  20. package/src/executors/utils/irisAppServerSettings.js.map +1 -0
  21. package/src/executors/utils/src/index.js.map +1 -0
  22. package/src/generators/ai-agent-sync/generator.js.map +1 -0
  23. package/src/generators/create/files/tsconfig.app.json__template__ +1 -0
  24. package/src/generators/create/generator.js +13 -21
  25. package/src/generators/create/generator.js.map +1 -0
  26. package/src/generators/extend/dependencies.js.map +1 -0
  27. package/src/generators/extend/generator.js +26 -34
  28. package/src/generators/extend/generator.js.map +1 -0
  29. package/src/generators/preset/generator.js +3 -7
  30. package/src/generators/preset/generator.js.map +1 -0
  31. package/src/generators/utils/get-package-manifest.js.map +1 -0
  32. package/src/generators/utils/link-claude-skills.js.map +1 -0
  33. package/src/generators/utils/own-package-json/own-package-json.d.ts +14 -0
  34. package/src/generators/utils/own-package-json/own-package-json.js +29 -0
  35. package/src/generators/utils/own-package-json/own-package-json.js.map +1 -0
  36. package/src/generators/utils/pinned-versions/pinned-versions.d.ts +30 -0
  37. package/src/generators/utils/pinned-versions/pinned-versions.js +45 -0
  38. package/src/generators/utils/pinned-versions/pinned-versions.js.map +1 -0
  39. package/src/generators/utils/uses-trackunit-eslint-plugin.js.map +1 -0
  40. package/src/generators/utils/write-trackunit-project-eslint-config.js.map +1 -0
  41. package/src/index.js.map +1 -0
  42. package/src/utils/ast/astUtils.js.map +1 -0
  43. package/src/utils/fileUpdater.js.map +1 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## 2.16.16 (2026-11-13)
2
+
3
+ This was a version bump only for iris-app to align it with other projects, there were no code changes.
4
+
5
+ ## 2.16.15 (2026-11-12)
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated iris-app-build-utilities to 3.0.28
10
+ - Updated iris-app-api to 2.13.16
11
+ - Updated react-vite-test-setup to 0.0.216
12
+ - Updated css-classname-utils to 0.0.124
13
+ - Updated react-graphql-tools to 1.23.47
14
+ - Updated shared-utils to 1.22.43
15
+
1
16
  ## 2.16.14 (2026-11-12)
2
17
 
3
18
  ### 🧱 Updated Dependencies
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["// Migration entry point for @nx/js:tsc build target.\n// Migrations are registered in ../migrations.json and resolved by NX at runtime.\nexport {};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invent-content-space.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/migrations/p-content-space-codemod/invent-content-space.ts"],"names":[],"mappings":";;;AACA,wEAAsF;AACtF,oDAAyE;AACzE,4EAAsE;AACtE,0EAMwC;AAExC,2DAA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AAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,8BAA8B,GAAG,CAAC,OAAyB,EAAE,KAAoB,EAAyB,EAAE;IAChH,IAAI,IAAI,GAA0B,IAAI,CAAC;IACvC,IAAA,kCAAc,EAAC,OAAO,EAAE;QACtB,KAAK,EAAE,IAAI,CAAC,EAAE;YACZ,IAAI,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,cAAc;gBAAE,OAAO;YACxD,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gBAAE,OAAO;YAC7E,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvE,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;YACpB,CAAC;QACH,CAAC;KACF,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import type { Tree } from \"@nx/devkit\";\nimport { splitClasses, type ClassnameLocation } from \"@trackunit/css-classname-utils\";\nimport { AST_NODE_TYPES, type TSESTree } from \"@typescript-eslint/types\";\nimport { simpleTraverse } from \"@typescript-eslint/typescript-estree\";\nimport {\n applyEdits,\n buildEditsForLocation,\n findClassnameLocations,\n parseTsestreeSource,\n type ClassnameEdit,\n} from \"../utils/classname-ast-rewrite\";\nimport type { ResolvedExtension } from \"../utils/resolve-extension-types\";\nimport { findUnresolvedSurface, type MigrationChangeReport } from \"./report-unresolved\";\nimport { resolveContentShells, type ResolvedContentShell } from \"./resolve-content-shell\";\nimport type { ShellSkipReason } from \"./shell-skip-reason\";\n\nconst CONTENT_SPACE_TOKEN = \"p-content-space\";\n\n/**\n * Extension types that may invent/convert content-shell padding. Fleet/Customer\n * remain swap-only (page-content rewrite) and must never invent or convert.\n * Shared with the orchestrator so the ASA gate lives in exactly one place.\n */\nexport const ASSET_SITE_ADMIN_TYPES: ReadonlySet<string> = new Set([\n \"ASSET_HOME_EXTENSION\",\n \"SITE_HOME_EXTENSION\",\n \"ADMIN_EXTENSION\",\n]);\n\nconst SHELL_INSET_SIDES = [\"p\", \"px\", \"py\", \"pt\", \"pr\", \"pb\", \"pl\"] as const;\nconst SHELL_INSET_VALUES = [\n \"1\",\n \"1.5\",\n \"2\",\n \"2.5\",\n \"3\",\n \"3.5\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"11\",\n \"12\",\n \"14\",\n \"16\",\n \"20\",\n \"24\",\n \"28\",\n \"32\",\n \"36\",\n \"40\",\n \"44\",\n \"48\",\n \"52\",\n \"56\",\n \"60\",\n \"64\",\n \"72\",\n \"80\",\n \"96\",\n \"responsive-space\",\n] as const;\nconst BREAKPOINT_VARIANTS = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"] as const;\n\nconst escapeRegExp = (value: string): string => value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Tailwind padding utilities treated as content-region shell inset candidates.\n * Enumerated (not `.+`) so reset tokens (`px-0`, `pb-0.5`) and state/print\n * variants (`hover:`, `focus:`, `print:`) are left alone. Breakpoint variants\n * (`md:p-6`) are still converted — those are lossy and logged as such.\n */\nconst SHELL_PADDING_TOKEN = new RegExp(\n `^(?:(?:${BREAKPOINT_VARIANTS.join(\"|\")}):)?(?:${SHELL_INSET_SIDES.join(\"|\")})-(?:${SHELL_INSET_VALUES.map(escapeRegExp).join(\"|\")})$`\n);\n\nconst tokenBase = (token: string): string => (token.includes(\":\") ? token.slice(token.lastIndexOf(\":\") + 1) : token);\n\nconst isContentSpaceToken = (token: string): boolean => tokenBase(token) === CONTENT_SPACE_TOKEN;\n\nconst isShellPaddingToken = (token: string): boolean => {\n if (isContentSpaceToken(token)) {\n return false;\n }\n return SHELL_PADDING_TOKEN.test(token);\n};\n\ntype InventContentSpaceResult = {\n filesChanged: ReadonlyArray<string>;\n changes: ReadonlyArray<MigrationChangeReport>;\n skippedRouteNames: ReadonlyArray<string>;\n /** Set when shell discovery returned unresolved (invent made no edits). */\n unresolvedReason: ShellSkipReason | null;\n};\n\nconst emptyResult = (unresolvedReason: ShellSkipReason | null = null): InventContentSpaceResult => ({\n filesChanged: [],\n changes: [],\n skippedRouteNames: [],\n unresolvedReason,\n});\n\n/**\n * Ensures each resolved ASA content shell carries `p-content-space`:\n * - invents the token on a bare shell (reported as `addition`)\n * - converts custom shell padding (`p-*` / `px-*` / `py-*` / sides /\n * `p-responsive-space` / `pb-responsive-space`) to `p-content-space`,\n * removing those custom tokens (reported as `conversion`)\n *\n * Uses {@link resolveContentShells}: shared layout Outlet shells yield one\n * target; multi-route without a shared layout invents/converts each clear\n * leaf. Only classname locations bound to each host are edited — inner layout\n * padding is left alone. Idempotent when a shell already has `p-content-space`\n * (including a variant-prefixed form) and no custom shell padding (including\n * whitespace-only differences). Never invents an `overflow-*` token — existing\n * scroll ownership is preserved. Fleet/Customer types are a no-op (swap-only\n * surfaces).\n *\n * Returns empty `filesChanged` / `changes` (never throws) when shells are\n * unresolved, the extension type is out of scope, or already in the desired state.\n * `skippedRouteNames` names unanalysable routes on a partial graph so the\n * orchestrator can report them instead of treating the extension as fully migrated.\n */\nexport const inventContentSpace = (tree: Tree, extension: ResolvedExtension): InventContentSpaceResult => {\n if (!ASSET_SITE_ADMIN_TYPES.has(extension.type)) {\n return emptyResult();\n }\n\n const resolved = resolveContentShells(tree, extension);\n if (resolved.status === \"unresolved\") {\n return emptyResult(resolved.reason);\n }\n\n const skippedRouteNames = [...resolved.skippedRouteNames];\n\n // Single resolved shell that already carries the token (or page-content):\n // do not invent a second inset. A token on a *nested* file is not enough —\n // that hid Device Administration's layout shell (GLU-1903). Multi-route\n // graphs skip this so a padded sibling leaf does not leave other leaves flush.\n if (resolved.shells.length === 1 && findUnresolvedSurface(tree, extension) === null) {\n return { filesChanged: [], changes: [], skippedRouteNames, unresolvedReason: null };\n }\n\n const shellsByFile = groupShellsByFile(resolved.shells);\n const filesChanged: Array<string> = [];\n const changes: Array<MigrationChangeReport> = [];\n\n for (const [filePath, shells] of shellsByFile) {\n const content = tree.read(filePath, \"utf-8\");\n if (content === null) {\n continue;\n }\n\n let program: TSESTree.Program;\n try {\n program = parseTsestreeSource(content);\n } catch {\n continue;\n }\n\n // Edit later ranges first so earlier offsets stay valid in one applyEdits pass.\n const orderedShells = [...shells].sort(\n (left, right) => right.location.reportNode.range[0] - left.location.reportNode.range[0]\n );\n\n const fileEdits: Array<ClassnameEdit> = [];\n const fileChanges: Array<MigrationChangeReport> = [];\n\n for (const shell of orderedShells) {\n const hostLocations = collectHostClassnameLocations(program, shell.location);\n const combinedBefore = hostLocations.map(hostLocation => hostLocation.value).join(\" \");\n const combinedPlan = planContentSpaceOnShell(combinedBefore);\n if (!combinedPlan.changed) {\n continue;\n }\n\n const alreadyHasContentSpace = splitClasses(combinedBefore).some(isContentSpaceToken);\n const primaryRange = shell.location.fixNode.range;\n const orderedLocations = [...hostLocations].sort((left, right) => {\n const leftIsPrimary = rangesEqual(left.fixNode.range, primaryRange);\n const rightIsPrimary = rangesEqual(right.fixNode.range, primaryRange);\n if (leftIsPrimary === rightIsPrimary) {\n return left.fixNode.range[0] - right.fixNode.range[0];\n }\n return leftIsPrimary ? -1 : 1;\n });\n\n let addedToken = alreadyHasContentSpace;\n const shellEdits: Array<ClassnameEdit> = [];\n for (const hostLocation of orderedLocations) {\n const locationEdits = buildEditsForLocation(\n hostLocation,\n value => {\n const next = transformClassnamePreservingWhitespace(value, { addContentSpace: !addedToken });\n if (!addedToken && splitClasses(next).some(isContentSpaceToken)) {\n addedToken = true;\n }\n return next;\n },\n content\n );\n shellEdits.push(...locationEdits);\n }\n\n if (shellEdits.length === 0) {\n continue;\n }\n\n fileEdits.push(...shellEdits);\n fileChanges.push({\n extensionId: extension.id,\n sourceRoot: extension.sourceRoot,\n filePath,\n kind: combinedPlan.removedTokens.length > 0 ? \"conversion\" : \"addition\",\n before: shell.classnameValue,\n after: planContentSpaceOnShell(shell.location.value).next,\n removedTokens: combinedPlan.removedTokens,\n });\n }\n\n if (fileEdits.length === 0) {\n continue;\n }\n\n tree.write(filePath, applyEdits(content, fileEdits));\n filesChanged.push(filePath);\n changes.push(...fileChanges.reverse());\n }\n\n if (filesChanged.length === 0) {\n return { filesChanged: [], changes: [], skippedRouteNames, unresolvedReason: null };\n }\n\n return { filesChanged, changes, skippedRouteNames, unresolvedReason: null };\n};\n\nconst groupShellsByFile = (shells: ReadonlyArray<ResolvedContentShell>): Map<string, Array<ResolvedContentShell>> => {\n const byFile = new Map<string, Array<ResolvedContentShell>>();\n for (const shell of shells) {\n const existing = byFile.get(shell.filePath);\n if (existing === undefined) {\n byFile.set(shell.filePath, [shell]);\n } else {\n existing.push(shell);\n }\n }\n return byFile;\n};\n\ntype ContentSpacePlan = {\n readonly next: string;\n readonly changed: boolean;\n readonly removedTokens: Array<string>;\n};\n\n/**\n * Strips custom shell-inset padding tokens and ensures `p-content-space` is\n * present, preserving the relative order of non-padding tokens.\n *\n * `changed` is true only when custom padding was stripped or `p-content-space`\n * was missing — not when the only difference would be whitespace normalization.\n */\nconst planContentSpaceOnShell = (classnameValue: string): ContentSpacePlan => {\n const classes = splitClasses(classnameValue);\n const removedTokens = classes.filter(isShellPaddingToken);\n const withoutCustomPadding = classes.filter(token => !isShellPaddingToken(token));\n const hadContentSpace = withoutCustomPadding.some(isContentSpaceToken);\n const nextClasses = hadContentSpace ? withoutCustomPadding : [...withoutCustomPadding, CONTENT_SPACE_TOKEN];\n return {\n next: nextClasses.join(\" \"),\n changed: removedTokens.length > 0 || !hadContentSpace,\n removedTokens,\n };\n};\n\nconst transformClassnamePreservingWhitespace = (value: string, options: { addContentSpace: boolean }): string => {\n const trimmedStart = value.length - value.trimStart().length;\n const trimmedEnd = value.length - value.trimEnd().length;\n const leading = value.slice(0, trimmedStart);\n const trailing = trimmedStart === value.length ? \"\" : value.slice(value.length - trimmedEnd);\n const classes = splitClasses(value);\n const kept = classes.filter(token => !isShellPaddingToken(token));\n const hasToken = kept.some(isContentSpaceToken);\n const nextClasses = options.addContentSpace && !hasToken ? [...kept, CONTENT_SPACE_TOKEN] : kept;\n const core = nextClasses.join(\" \");\n if (core === \"\") {\n return `${leading}${trailing}`;\n }\n return `${leading}${core}${trailing}`;\n};\n\nconst rangesEqual = (left: TSESTree.Range, right: TSESTree.Range): boolean =>\n left[0] === right[0] && left[1] === right[1];\n\n/**\n * All editable classname args bound to the same host as `primary` (every\n * string argument of a `cn()` / `cva()` call). Plain JSX literals stay a\n * single location. CVA variant objects are excluded so variant padding is\n * not stripped as if it were shell inset.\n */\nconst collectHostClassnameLocations = (\n program: TSESTree.Program,\n primary: ClassnameLocation\n): Array<ClassnameLocation> => {\n if (primary.context.type !== \"function-call\" && primary.context.type !== \"array-element\") {\n return [primary];\n }\n\n const callRange = findSmallestEnclosingCallRange(program, primary.reportNode);\n if (callRange === null) {\n return [primary];\n }\n\n const siblings = findClassnameLocations(program).filter(location => {\n if (location.reportNode.range[0] < callRange[0] || location.reportNode.range[1] > callRange[1]) {\n return false;\n }\n return location.context.type === \"function-call\" || location.context.type === \"array-element\";\n });\n\n return siblings.length > 0 ? siblings : [primary];\n};\n\nconst findSmallestEnclosingCallRange = (program: TSESTree.Program, inner: TSESTree.Node): TSESTree.Range | null => {\n let best: TSESTree.Range | null = null;\n simpleTraverse(program, {\n enter: node => {\n if (node.type !== AST_NODE_TYPES.CallExpression) return;\n if (inner.range[0] < node.range[0] || inner.range[1] > node.range[1]) return;\n if (best === null || node.range[1] - node.range[0] < best[1] - best[0]) {\n best = node.range;\n }\n },\n });\n return best;\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/migrations/p-content-space-codemod/orchestrator.ts"],"names":[],"mappings":";;AAoDA,oDA4EC;AAhID,uCAA+C;AAC/C,8EAAyE;AACzE,iEAAoF;AACpF,yEAAoE;AACpE,iEAA4F;AAC5F,2DAK6B;AAC7B,iEAA4D;AAE5D,MAAM,cAAc,GAAG,yBAAyB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,yBAAyB,GAAwB,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,yBAAyB,CAAC,CAAC,CAAC;AAE/G;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,oBAAoB,CAAC,IAAU;IAC7C,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAA,+CAAqB,EAAC,IAAI,CAAC,CAAC;IAE7D,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IACvC,MAAM,OAAO,GAAiC,EAAE,CAAC;IACjD,MAAM,OAAO,GAAmC,EAAE,CAAC;IACnD,IAAI,eAAe,GAAG,KAAK,CAAC;IAE5B,KAAK,MAAM,SAAS,IAAI,QAAQ,EAAE,CAAC;QACjC,IAAI,6CAAsB,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/C,eAAe,GAAG,IAAI,CAAC;YACvB,MAAM,CAAC,YAAY,EAAE,IAAA,yCAAkB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC;YACvE,MAAM,YAAY,GAAG,IAAA,yCAAkB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YACzD,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;YAChD,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;YACtC,0EAA0E;Y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G,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAExH,sGAAsG;AACtG,SAAS,UAAU,CAAC,OAAe,EAAE,kBAA0B;IAC7D,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;QAClB,eAAM,CAAC,IAAI,CAAC,KAAK,cAAc,oBAAoB,CAAC,CAAC;QACrD,OAAO;IACT,CAAC;IACD,MAAM,YAAY,GAAG,kBAAkB,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,kBAAkB,kCAAkC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7G,eAAM,CAAC,IAAI,CAAC,KAAK,cAAc,aAAa,OAAO,WAAW,YAAY,EAAE,CAAC,CAAC;AAChF,CAAC;AAED;;;GAGG;AACH,SAAS,kBAAkB,CAAC,MAA6B;IACvD,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,KAAK,cAAc,kBAAkB,MAAM,CAAC,WAAW,MAAM,MAAM,CAAC,QAAQ,OAAO,MAAM,CAAC,MAAM,QAAQ,MAAM,CAAC,KAAK,GAAG,CAAC;IACjI,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,OAAO,KAAK,cAAc,oBAAoB,MAAM,CAAC,WAAW,MAAM,MAAM,CAAC,QAAQ,eAAe,OAAO,OAAO,MAAM,CAAC,MAAM,QAAQ,MAAM,CAAC,KAAK,GAAG,CAAC;AACzJ,CAAC;AAED,kBAAe,oBAAoB,CAAC","sourcesContent":["import { logger, type Tree } from \"@nx/devkit\";\nimport { resolveExtensionTypes } from \"../utils/resolve-extension-types\";\nimport { ASSET_SITE_ADMIN_TYPES, inventContentSpace } from \"./invent-content-space\";\nimport { removeRedundantPadding } from \"./remove-redundant-padding\";\nimport { collectAsaEndOfRunMessages, formatUnresolvedReport } from \"./report-run-messaging\";\nimport {\n findUnresolvedSurface,\n PADDING_DOCS_LINK,\n type MigrationChangeReport,\n type UnresolvedSurfaceReport,\n} from \"./report-unresolved\";\nimport { rewritePageContent } from \"./rewrite-page-content\";\n\nconst MIGRATION_NAME = \"p-content-space-codemod\";\n\n/**\n * Extension types that get the swap-only `page-content` -> `overflow-auto\n * p-content-space` rewrite (GLU-1732). Unlike `ASSET_SITE_ADMIN_TYPES`, these\n * are always expected to already have a `page-content` region, so redundant-\n * padding removal, invent/convert, and unresolved-surface reporting don't apply\n * to this group — Fleet/Customer Home never received platform inset.\n */\nconst FLEET_CUSTOMER_HOME_TYPES: ReadonlySet<string> = new Set([\"FLEET_EXTENSION\", \"CUSTOMER_HOME_EXTENSION\"]);\n\n/**\n * Composes the extension-type resolver with the page-content rewrite,\n * redundant-padding removal, content-shell invent/convert, change reporting,\n * and unresolved-surface report for every resolved Asset Home/Site Home/Admin\n * extension in the workspace, and the swap-only page-content rewrite for every\n * resolved Fleet/Customer Home extension. Every other extension type is left\n * untouched.\n *\n * Ordering for Asset Home/Site Home/Admin:\n * 1. `rewritePageContent` — so a just-migrated region already carries\n * `p-content-space` before invent and padding cleanup look for it.\n * 2. `inventContentSpace` — invents or converts `p-content-space` on a\n * high-confidence content shell (ASA only); change reports distinguish\n * addition vs conversion.\n * 3. `removeRedundantPadding` — only strips `pb-*` from classname strings\n * that carry `p-content-space`, including tokens invent just added, so\n * unresolved extensions (no padded region) and local component spacing\n * are left alone by construction.\n * 4. `findUnresolvedSurface` — against post-rewrite/invent Tree state;\n * invented/converted surfaces must not be reported as unresolved.\n *\n * Formatting is intentionally the caller's job: `@trackunit/migrations`'\n * `run-migrations` generator already awaits `formatFiles(tree)` after every\n * migration. Invoking this orchestrator directly (e.g. against an `FsTree`\n * for an in-repo corpus run) must also call `formatFiles` before flushing,\n * otherwise Prettier/Tailwind class order will leave migrated files failing\n * the format gate.\n */\nexport function pContentSpaceCodemod(tree: Tree): void {\n const { resolved, unresolved } = resolveExtensionTypes(tree);\n\n const filesChanged = new Set<string>();\n const changes: Array<MigrationChangeReport> = [];\n const reports: Array<UnresolvedSurfaceReport> = [];\n let asaWorkOccurred = false;\n\n for (const extension of resolved) {\n if (ASSET_SITE_ADMIN_TYPES.has(extension.type)) {\n asaWorkOccurred = true;\n addAll(filesChanged, rewritePageContent(tree, extension).filesChanged);\n const inventResult = inventContentSpace(tree, extension);\n addAll(filesChanged, inventResult.filesChanged);\n changes.push(...inventResult.changes);\n // Runs after invent so a just-invented shell also loses redundant `pb-*`.\n // Removal is keyed on `p-content-space` being present in the same\n // classname string, so unresolved surfaces are a no-op.\n addAll(filesChanged, removeRedundantPadding(tree, extension).filesChanged);\n\n const entryComponentPath = `${extension.sourceRoot}/${extension.main ?? \"index.tsx\"}`;\n for (const skippedRouteName of inventResult.skippedRouteNames) {\n reports.push({\n extensionId: extension.id,\n sourceRoot: extension.sourceRoot,\n entryComponentPath: tree.exists(entryComponentPath) ? entryComponentPath : null,\n docsLink: PADDING_DOCS_LINK,\n skippedRouteName,\n skipReason: {\n code: \"router-no-analysable-leaves\",\n message: `route \"${skippedRouteName}\" could not be analysed into an inventable overflow content shell`,\n },\n });\n }\n\n const report = findUnresolvedSurface(tree, extension);\n if (report !== null) {\n reports.push({\n ...report,\n skipReason: inventResult.unresolvedReason ?? report.skipReason,\n });\n }\n continue;\n }\n\n if (FLEET_CUSTOMER_HOME_TYPES.has(extension.type)) {\n addAll(filesChanged, rewritePageContent(tree, extension).filesChanged);\n continue;\n }\n }\n\n const lossyConversionCount = changes.filter(isLossyConversion).length;\n logSummary(filesChanged.size, reports.length + lossyConversionCount);\n\n for (const change of changes) {\n const message = formatChangeReport(change);\n if (isLossyConversion(change)) {\n logger.warn(message);\n } else {\n logger.info(message);\n }\n }\n\n for (const report of reports) {\n logger.warn(formatUnresolvedReport(report));\n }\n\n for (const message of collectAsaEndOfRunMessages({ asaWorkOccurred, changes, unresolvedReports: reports })) {\n logger.info(message);\n }\n\n for (const item of unresolved) {\n logger.warn(\n ` ${MIGRATION_NAME}: could not resolve extension import \"${item.specifier}\" referenced by app \"${item.app}\"`\n );\n }\n}\n\nfunction addAll(target: Set<string>, items: ReadonlyArray<string>): void {\n for (const item of items) target.add(item);\n}\n\nconst isLossyConversion = (change: MigrationChangeReport): boolean =>\n change.kind === \"conversion\" && change.removedTokens.some(token => token.includes(\":\") || /-(?:0|0\\.5)$/.test(token));\n\n/** Mirrors the log style of `logSummary` in `libs/react/components/migrations/utils/jsx-utils.ts`. */\nfunction logSummary(touched: number, manualReviewNeeded: number): void {\n if (touched === 0) {\n logger.info(` ${MIGRATION_NAME}: no files changed`);\n return;\n }\n const reviewSuffix = manualReviewNeeded > 0 ? ` (${manualReviewNeeded} location(s) need manual review)` : \"\";\n logger.info(` ${MIGRATION_NAME}: updated ${touched} file(s)${reviewSuffix}`);\n}\n\n/**\n * Explicit addition/conversion log so a third-party reading the migration\n * output knows exactly what invent/convert did on each shell.\n */\nfunction formatChangeReport(change: MigrationChangeReport): string {\n if (change.kind === \"addition\") {\n return ` ${MIGRATION_NAME}: addition on \"${change.extensionId}\" (${change.filePath}): \"${change.before}\" → \"${change.after}\"`;\n }\n const removed = change.removedTokens.join(\", \");\n return ` ${MIGRATION_NAME}: conversion on \"${change.extensionId}\" (${change.filePath}): removed [${removed}]; \"${change.before}\" → \"${change.after}\"`;\n}\n\nexport default pContentSpaceCodemod;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-redundant-padding.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/migrations/p-content-space-codemod/remove-redundant-padding.ts"],"names":[],"mappings":";;AAyBA,wDAiBC;AAzCD,wEAAiF;AACjF,0EAAoF;AAGpF,MAAM,sBAAsB,GAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,CAAC,CAAC;AAC9F,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAE9C;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,sBAAsB,CAAC,IAAU,EAAE,SAA4B;IAC7E,OAAO,IAAA,0DAAkC,EACvC,IAAI,EACJ,SAAS,CAAC,UAAU,EACpB,OAAO,CAAC,EAAE,CACR,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EACxG,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,IAAA,kCAAY,EAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;YACvD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,KAAK,MAAM,KAAK,IAAI,sBAAsB,EAAE,CAAC;YAC3C,MAAM,GAAG,IAAA,uCAAiB,EAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import type { Tree } from \"@nx/devkit\";\nimport { replaceClassToken, splitClasses } from \"@trackunit/css-classname-utils\";\nimport { transformClassnamesUnderSourceRoot } from \"../utils/classname-ast-rewrite\";\nimport type { ResolvedExtension } from \"../utils/resolve-extension-types\";\n\nconst REDUNDANT_INSET_TOKENS: Array<string> = [\"pb-8\", \"pb-6\", \"pb-4\", \"pb-responsive-space\"];\nconst PADDED_REGION_TOKEN = \"p-content-space\";\n\n/**\n * Removes the redundant bottom-inset Tailwind tokens (`pb-8`, `pb-6`, `pb-4`,\n * `pb-responsive-space`) from classname strings that already carry\n * `p-content-space` under a single resolved extension's `sourceRoot`.\n *\n * Scoped to the padded region on purpose: local `pb-*` used as component\n * spacing (cards, timeline entries, wizard steps) must not be stripped just\n * because they live under the same `sourceRoot`. Callers must run\n * `rewritePageContent` first so a just-migrated `page-content` region already\n * reads as `p-content-space` before this transform looks for it. Extensions\n * with no padded region (the ones `findUnresolvedSurface` will report) are\n * therefore a complete no-op here — there is no `p-content-space` token to\n * key off.\n *\n * Scoped to one extension per call — the caller (the orchestrator) loops\n * over every Asset Home/Site Home/Admin extension.\n */\nexport function removeRedundantPadding(tree: Tree, extension: ResolvedExtension): { filesChanged: Array<string> } {\n return transformClassnamesUnderSourceRoot(\n tree,\n extension.sourceRoot,\n content =>\n content.includes(PADDED_REGION_TOKEN) && REDUNDANT_INSET_TOKENS.some(token => content.includes(token)),\n value => {\n if (!splitClasses(value).includes(PADDED_REGION_TOKEN)) {\n return value;\n }\n let result = value;\n for (const token of REDUNDANT_INSET_TOKENS) {\n result = replaceClassToken(result, token, \"\");\n }\n return result;\n }\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-run-messaging.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/migrations/p-content-space-codemod/report-run-messaging.ts"],"names":[],"mappings":";;;AAAA,wEAA8D;AAC9D,2DAAkH;AAElH,MAAM,cAAc,GAAG,yBAAyB,CAAC;AASjD;;;;;GAKG;AACI,MAAM,gCAAgC,GAAG,GAAW,EAAE,CAC3D,KAAK,cAAc,8GAA8G,CAAC;AADvH,QAAA,gCAAgC,oCACuF;AAEpI;;;;GAIG;AACI,MAAM,6BAA6B,GAAG,GAAW,EAAE,CACxD,KAAK,cAAc,qYAAqY,qCAAiB,EAAE,CAAC;AADja,QAAA,6BAA6B,iCACoY;AAE9a;;;GAGG;AACI,MAAM,sBAAsB,GAAG,CAAC,MAA+B,EAAU,EAAE;IAChF,MAAM,YAAY,GAChB,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,MAAM,CAAC,UAAU,CAAC,IAAI,MAAM,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IAE/G,IAAI,MAAM,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,KAAK,cAAc,gBAAgB,MAAM,CAAC,WAAW,MAAM,MAAM,CAAC,U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AAG,CAAC,EAAE,CAAC;QACzC,QAAQ,CAAC,IAAI,CAAC,IAAA,qCAA6B,GAAE,CAAC,CAAC;IACjD,CAAC;IACD,QAAQ,CAAC,IAAI,CAAC,IAAA,wCAAgC,GAAE,CAAC,CAAC;IAClD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAXW,QAAA,0BAA0B,8BAWrC;AAEF,MAAM,sBAAsB,GAAG,CAAC,cAAsB,EAAW,EAAE;IACjE,OAAO,IAAA,kCAAY,EAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9E,CAAC,CAAC","sourcesContent":["import { splitClasses } from \"@trackunit/css-classname-utils\";\nimport { PADDING_DOCS_LINK, type MigrationChangeReport, type UnresolvedSurfaceReport } from \"./report-unresolved\";\n\nconst MIGRATION_NAME = \"p-content-space-codemod\";\n\nexport type AsaEndOfRunContext = {\n /** True when any ASA extension was visited this migration run. */\n readonly asaWorkOccurred: boolean;\n readonly changes: ReadonlyArray<MigrationChangeReport>;\n readonly unresolvedReports: ReadonlyArray<UnresolvedSurfaceReport>;\n};\n\n/**\n * Developer-facing end-of-run reminder: verify appearance after migration, and\n * note that intentional edge-to-edge (no content inset) remains an allowed choice.\n * Emitted at most once per run when any ASA work happened — including runs that\n * only produced unresolved reports and no invent/convert edits.\n */\nexport const buildVerifyAndEdgeToEdgeReminder = (): string =>\n ` ${MIGRATION_NAME}: verify UI after migration; edge-to-edge content (no p-content-space) is an allowed choice when intentional`;\n\n/**\n * Explains what an inventable overflow content shell is when the migration\n * could not auto-pad one or more Asset/Site/Admin surfaces. Emitted once per\n * run that produced unresolved reports.\n */\nexport const buildUnresolvedInventGuidance = (): string =>\n ` ${MIGRATION_NAME}: could not auto-invent p-content-space on the surface(s) above — invent only targets a single inventable overflow content shell (a div/main/section with an editable className that itself owns overflow-auto/scroll, with no PageHeader/Topbar child). Card-only roots, multi-route graphs, and unclear shells need a manual p-content-space on that scroll owner (or accept edge-to-edge). See ${PADDING_DOCS_LINK}`;\n\n/**\n * Per-extension unresolved warning. Prefer this over a bare \"no token\" line so\n * developers learn *why* invent skipped them.\n */\nexport const formatUnresolvedReport = (report: UnresolvedSurfaceReport): string => {\n const reasonSuffix =\n report.skipReason === undefined ? \"\" : ` — reason [${report.skipReason.code}]: ${report.skipReason.message}`;\n\n if (report.skippedRouteName !== undefined) {\n return ` ${MIGRATION_NAME}: extension \"${report.extensionId}\" (${report.sourceRoot}) skipped route \"${report.skippedRouteName}\"${reasonSuffix || \" — no inventable overflow content shell on that route\"}; see ${report.docsLink}`;\n }\n\n if (report.skipReason !== undefined) {\n return ` ${MIGRATION_NAME}: extension \"${report.extensionId}\" (${report.sourceRoot}) not auto-invented${reasonSuffix}; add p-content-space manually on the scroll owner or accept edge-to-edge — see ${report.docsLink}`;\n }\n\n return ` ${MIGRATION_NAME}: extension \"${report.extensionId}\" (${report.sourceRoot}) has no page-content/p-content-space and no inventable overflow content shell (needs a scrolling div/main/section with editable className, not e.g. a bare Card) — add p-content-space manually or accept edge-to-edge; see ${report.docsLink}`;\n};\n\n/**\n * Advisory-only scrollbar notes for invent/convert onto a self-scrolling\n * (`overflow-*`) shell. Cannot measure real DOM scrollbars in the codemod —\n * documents the preferred flush-scrollbar outcome after content owns padding.\n */\nexport const buildScrollbarAdvisoryMessages = (changes: ReadonlyArray<MigrationChangeReport>): Array<string> => {\n const messages: Array<string> = [];\n for (const change of changes) {\n if (!shellHasOverflowScroll(change.before) && !shellHasOverflowScroll(change.after)) {\n continue;\n }\n messages.push(\n ` ${MIGRATION_NAME}: scrollbar note on \"${change.extensionId}\" (${change.filePath}): shell uses overflow scrolling — prefer a flush scrollbar at the panel edge after content owns padding`\n );\n }\n return messages;\n};\n\n/**\n * Collects end-of-run ASA developer messages (scrollbar advisories, unresolved\n * invent guidance when needed, + single verify/edge-to-edge reminder). Empty\n * when no ASA work occurred this run.\n */\nexport const collectAsaEndOfRunMessages = (context: AsaEndOfRunContext): Array<string> => {\n if (!context.asaWorkOccurred) {\n return [];\n }\n\n const messages = buildScrollbarAdvisoryMessages(context.changes);\n if (context.unresolvedReports.length > 0) {\n messages.push(buildUnresolvedInventGuidance());\n }\n messages.push(buildVerifyAndEdgeToEdgeReminder());\n return messages;\n};\n\nconst shellHasOverflowScroll = (classnameValue: string): boolean => {\n return splitClasses(classnameValue).some(cls => /(^|:)overflow-/.test(cls));\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-unresolved.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/migrations/p-content-space-codemod/report-unresolved.ts"],"names":[],"mappings":";;;AAyGA,sDAqBC;AA7HD,wEAA8D;AAC9D,0EAAmH;AAEnH,mEAA+D;AAE/D,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAC1C,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAC9C,MAAM,eAAe,GAAkB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;AAEjF,MAAM,SAAS,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAErH,MAAM,eAAe,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAE/F,MAAM,4BAA4B,GAAG,WAAW,CAAC;AAEjD,kGAAkG;AACrF,QAAA,iBAAiB,GAAG,qEAAqE,CAAC;AAmCvG;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,OAAe;IAC3C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,C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QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,kBAAkB,GAAG,GAAG,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,IAAI,IAAI,4BAA4B,EAAE,CAAC;IAEvG,OAAO;QACL,WAAW,EAAE,SAAS,CAAC,EAAE;QACzB,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,kBAAkB,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI;QAC/E,QAAQ,EAAE,yBAAiB;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["import type { Tree } from \"@nx/devkit\";\nimport { splitClasses } from \"@trackunit/css-classname-utils\";\nimport { findClassnameLocations, parseTsestreeSource, visitRewritableFiles } from \"../utils/classname-ast-rewrite\";\nimport type { ResolvedExtension } from \"../utils/resolve-extension-types\";\nimport { resolveContentShells } from \"./resolve-content-shell\";\n\nconst PAGE_CONTENT_TOKEN = \"page-content\";\nconst CONTENT_SPACE_TOKEN = \"p-content-space\";\nconst RESOLVED_TOKENS: Array<string> = [PAGE_CONTENT_TOKEN, CONTENT_SPACE_TOKEN];\n\nconst tokenBase = (token: string): string => (token.includes(\":\") ? token.slice(token.lastIndexOf(\":\") + 1) : token);\n\nconst isResolvedToken = (token: string): boolean => RESOLVED_TOKENS.includes(tokenBase(token));\n\nconst DEFAULT_ENTRY_COMPONENT_FILE = \"index.tsx\";\n\n/** In-repo docs for inventable overflow content shells (GLU-1571 / p-content-space migration). */\nexport const PADDING_DOCS_LINK = \"docs/tech/TAILWIND-ARCHITECTURE.md#p-content-space-inventable-shell\";\n\nexport type MigrationChangeKind = \"addition\" | \"conversion\";\n\n/**\n * Structured invent/convert outcome for a single content-shell edit. Emitted\n * so the orchestrator can log exactly what changed (added vs converted).\n */\nexport type MigrationChangeReport = {\n extensionId: string;\n sourceRoot: string;\n filePath: string;\n kind: MigrationChangeKind;\n /** Classname string on the shell before invent/convert. */\n before: string;\n /** Classname string on the shell after invent/convert. */\n after: string;\n /** Custom shell padding tokens removed (empty for pure additions). */\n removedTokens: Array<string>;\n};\n\nimport type { ShellSkipReason } from \"./shell-skip-reason\";\n\nexport type UnresolvedSurfaceReport = {\n extensionId: string;\n sourceRoot: string;\n /** Best-effort resolved path to the extension's entry component; `null` when it can't be found in the Tree. */\n entryComponentPath: string | null;\n docsLink: string;\n /** Route component or imported route binding that could not be analysed on a partial graph. */\n skippedRouteName?: string;\n /** Why invent/resolve declined this surface (when known). */\n skipReason?: ShellSkipReason;\n};\n\n/**\n * Read-only check for whether a single file already contains `page-content`\n * or `p-content-space` as a whole classname token (not matching inside e.g.\n * `page-content-with-gap`). Used as a suppressor on unresolvable graphs so\n * resolver limits do not permanently light up already-migrated extensions.\n */\nfunction fileHasResolvedToken(content: string): boolean {\n if (!RESOLVED_TOKENS.some(token => content.includes(token))) return false;\n\n const program = parseTsestreeSource(content);\n const locations = findClassnameLocations(program);\n return locations.some(location => splitClasses(location.value).some(isResolvedToken));\n}\n\nfunction sourceRootHasResolvedToken(tree: Tree, extension: ResolvedExtension): boolean {\n let found = false;\n visitRewritableFiles(tree, extension.sourceRoot, (_filePath, content) => {\n if (found) return;\n if (fileHasResolvedToken(content)) {\n found = true;\n }\n });\n return found;\n}\n\n/**\n * Determines whether the inventable content shell of an Asset Home/Site Home/Admin\n * extension still lacks `page-content` / `p-content-space`, and if so, builds a\n * report entry describing it.\n *\n * A token on a nested file is not enough when the graph *resolves*: Device\n * Administration hid behind `p-content-space` on a job-details leaf while the\n * layout shell still used `pb-responsive-space` (GLU-1903). Returns `null` only\n * when every *resolved content shell* already carries a resolved token (or still\n * uses `page-content`, which `rewritePageContent` handles separately so it must\n * not be double-reported).\n *\n * An unresolvable graph is *not* treated as a leftover if any rewritable file\n * already has a resolved token — otherwise Device Administration (and ~24 other\n * ASA extensions the walker cannot follow) stay permanently-on after padding.\n * Unresolvable graphs with no token anywhere still report.\n *\n * This function is read-only: it never calls `tree.write`. Callers must run it\n * against Tree state that already reflects `rewritePageContent`'s and\n * `removeRedundantPadding`'s edits for the same extension, since those two\n * transforms mutate `page-content` into `p-content-space` in place — running\n * this check first, against pre-rewrite content, would misreport a\n * just-fixed extension as unresolved.\n *\n * A `sourceRoot` that doesn't exist in the Tree at all (or contains no\n * rewritable files) is treated the same as \"no page-content and no\n * p-content-space found\": it gets reported, not silently skipped.\n */\nexport function findUnresolvedSurface(tree: Tree, extension: ResolvedExtension): UnresolvedSurfaceReport | null {\n const resolved = resolveContentShells(tree, extension);\n if (resolved.status === \"resolved\") {\n const everyShellHasResolvedToken = resolved.shells.every(shell =>\n splitClasses(shell.combinedClassnameValue).some(isResolvedToken)\n );\n if (everyShellHasResolvedToken) {\n return null;\n }\n } else if (sourceRootHasResolvedToken(tree, extension)) {\n return null;\n }\n\n const entryComponentPath = `${extension.sourceRoot}/${extension.main ?? DEFAULT_ENTRY_COMPONENT_FILE}`;\n\n return {\n extensionId: extension.id,\n sourceRoot: extension.sourceRoot,\n entryComponentPath: tree.exists(entryComponentPath) ? entryComponentPath : null,\n docsLink: PADDING_DOCS_LINK,\n };\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-content-shell.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/migrations/p-content-space-codemod/resolve-content-shell.ts"],"names":[],"mappings":";;;;AACA,wEAA0G;AAC1G,oDAAyE;AACzE,4EAAsE;AACtE,wDAAwB;AACxB,0EAA6F;AAE7F,2DAAsG;AA0CtG,MAAM,4BAA4B,GAAG,WAAW,CAAC;AAEjD,MAAM,eAAe,GAAG,CAAC,IAAyB,EAAE,MAAe,EAA6B,EAAE,CAAC,CAAC;IAClG,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,IAAA,mCAAe,EAAC,IAAI,EAAE,MAAM,CAAC;CACtC,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,IAAyB,EAAE,MAAe,EAA8B,EAAE,CAAC,CAAC;I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OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,cAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QACjD,MAAM,kBAAkB,GAAG,cAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;QACrF,MAAM,UAAU,GAAG;YACjB,kBAAkB;YAClB,GAAG,kBAAkB,MAAM;YAC3B,GAAG,kBAAkB,KAAK;YAC1B,GAAG,kBAAkB,YAAY;YACjC,GAAG,kBAAkB,WAAW;SACjC,CAAC;QAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,SAAS,KAAK,YAAY;gBAAE,SAAS;YACzC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC,IAAI,SAAS,KAAK,UAAU;gBAAE,SAAS;YAClF,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBAAE,SAAS;YACzE,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC3B,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC;IAED,8EAA8E;IAC9E,uBAAuB;IACvB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,MAAyC,EAAE,IAAY,EAAW,EAAE;IACzF,OAAO,MAAM,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAC3E,CAAC,CAAC","sourcesContent":["import type { Tree } from \"@nx/devkit\";\nimport { isTailwindFunction, splitClasses, type ClassnameLocation } from \"@trackunit/css-classname-utils\";\nimport { AST_NODE_TYPES, type TSESTree } from \"@typescript-eslint/types\";\nimport { simpleTraverse } from \"@typescript-eslint/typescript-estree\";\nimport path from \"path\";\nimport { findClassnameLocations, parseTsestreeSource } from \"../utils/classname-ast-rewrite\";\nimport type { ResolvedExtension } from \"../utils/resolve-extension-types\";\nimport { shellSkipReason, type ShellSkipReason, type ShellSkipReasonCode } from \"./shell-skip-reason\";\n\n/**\n * A high-confidence content-region classname host discovered under an\n * extension entry (literal / cva / cn on a div-like shell).\n */\nexport type ResolvedContentShell = {\n readonly filePath: string;\n /** Current classname string at the editable host. */\n readonly classnameValue: string;\n /**\n * Every classname bound to the same host, joined. A cva/cn call can split\n * tokens across arguments (`cva({ base: [\"p-content-space\", \"overflow-auto\"] })`);\n * leftover reporting must look at this combined value, not `classnameValue`\n * alone, or it disagrees with invent.\n */\n readonly combinedClassnameValue: string;\n /** AST classname location invent uses to splice the edit. */\n readonly location: ClassnameLocation;\n};\n\nexport type ResolveContentShellResult =\n | { readonly status: \"resolved\"; readonly shell: ResolvedContentShell }\n | { readonly status: \"unresolved\"; readonly reason: ShellSkipReason };\n\n/**\n * Plural discovery result. Multi-route ASA apps may yield 0..N shells:\n * - shared layout content `div` wrapping `<Outlet />` → that layout's shell\n * - no shared layout → one shell per clear route leaf (static imports only)\n * - layout-wins is scoped to that layout's descendant leaves only\n * - unclear / unanalysable routes are named in `skippedRouteNames` when any\n * sibling still resolved (a partial graph must not look fully migrated)\n * - unclear graphs with no resolvable shells → unresolved (never guess a first-div)\n */\nexport type ResolveContentShellsResult =\n | {\n readonly status: \"resolved\";\n readonly shells: ReadonlyArray<ResolvedContentShell>;\n readonly skippedRouteNames: ReadonlyArray<string>;\n }\n | { readonly status: \"unresolved\"; readonly reason: ShellSkipReason };\n\nconst DEFAULT_ENTRY_COMPONENT_FILE = \"index.tsx\";\n\nconst unresolvedShell = (code: ShellSkipReasonCode, detail?: string): ResolveContentShellResult => ({\n status: \"unresolved\",\n reason: shellSkipReason(code, detail),\n});\n\nconst unresolvedShells = (code: ShellSkipReasonCode, detail?: string): ResolveContentShellsResult => ({\n status: \"unresolved\",\n reason: shellSkipReason(code, detail),\n});\n\n/** Intrinsic hosts treated as content-region shells for this walking skeleton. */\nconst DIV_LIKE_ELEMENTS: ReadonlySet<string> = new Set([\"div\", \"main\", \"section\"]);\n\n/**\n * Known non-DOM wrappers to skip when walking from an extension entry toward\n * the content shell (providers, Suspense, fragments).\n * `RouterProvider` is intentionally NOT a wrapper — it branches into light-touch\n * multi-route discovery instead of being skipped.\n */\nconst isKnownWrapperName = (name: string): boolean => {\n if (\n name === \"Suspense\" ||\n name === \"Fragment\" ||\n name === \"TrackunitInternalProviders\" ||\n name === \"TrackunitProviders\"\n ) {\n return true;\n }\n return name.endsWith(\"Provider\") && name !== \"RouterProvider\";\n};\n\n/**\n * Walks from `extension.main` through known non-DOM wrappers and static\n * imports to identify editable content-region classname host(s).\n *\n * Multi-route policy (light-touch, static imports only):\n * 1. Shared layout shell (div-like host wrapping `<Outlet />`) wins → one target.\n * 2. Else each resolvable route leaf with a clear shell is targeted.\n * 3. Exotic / unclear graphs → `{ status: \"unresolved\" }` (never throws; no first-div guess).\n */\nexport const resolveContentShells = (tree: Tree, extension: ResolvedExtension): ResolveContentShellsResult => {\n const entryPath = `${extension.sourceRoot}/${extension.main ?? DEFAULT_ENTRY_COMPONENT_FILE}`;\n if (!tree.exists(entryPath)) {\n return unresolvedShells(\"entry-missing\", entryPath);\n }\n\n return resolveShellsFromFile(tree, entryPath, extension.sourceRoot, new Set());\n};\n\n/**\n * Single-shell convenience wrapper over {@link resolveContentShells}.\n * Returns the first resolved shell when discovery finds one or more; unresolved\n * when none. Prefer {@link resolveContentShells} for RouterProvider / multi-route\n * graphs — an arbitrary one of N leaves is not a useful production answer.\n */\nexport const resolveContentShell = (tree: Tree, extension: ResolvedExtension): ResolveContentShellResult => {\n const result = resolveContentShells(tree, extension);\n if (result.status === \"unresolved\") {\n return { status: \"unresolved\", reason: result.reason };\n }\n const shell = result.shells[0];\n if (shell === undefined) {\n return unresolvedShell(\"unclear-graph\", \"resolved status with empty shells list\");\n }\n return { status: \"resolved\", shell };\n};\n\nconst resolveShellsFromFile = (\n tree: Tree,\n filePath: string,\n sourceRoot: string,\n visited: Set<string>\n): ResolveContentShellsResult => {\n if (visited.has(filePath)) {\n return unresolvedShells(\"cycle\", filePath);\n }\n visited.add(filePath);\n\n const content = tree.read(filePath, \"utf-8\");\n if (content === null) {\n return unresolvedShells(\"entry-missing\", filePath);\n }\n\n let program: TSESTree.Program;\n try {\n program = parseTsestreeSource(content);\n } catch {\n return unresolvedShells(\"parse-failed\", filePath);\n }\n\n const rootJsx = findRootJsxElement(program);\n if (rootJsx === null) {\n return unresolvedShells(\"no-root-jsx\", filePath);\n }\n\n const leaf = unwrapWrappers(rootJsx);\n if (leaf === null) {\n return unresolvedShells(\"empty-wrapper\", filePath);\n }\n\n if (isDivLikeHost(leaf) && leaf.type === AST_NODE_TYPES.JSXElement) {\n const single = pickContentShellInFile(filePath, program, leaf);\n if (single.status === \"unresolved\") {\n return { status: \"unresolved\", reason: single.reason };\n }\n return { status: \"resolved\", shells: [single.shell], skippedRouteNames: [] };\n }\n\n const componentName = getJsxComponentName(leaf);\n if (componentName === null) {\n return unresolvedShells(\"non-host-element\", filePath);\n }\n\n if (componentName === \"RouterProvider\" && leaf.type === AST_NODE_TYPES.JSXElement) {\n return resolveFromRouterProvider(tree, filePath, program, leaf, sourceRoot, visited);\n }\n\n if (isDynamicComponent(program, componentName)) {\n return unresolvedShells(\"dynamic-component\", componentName);\n }\n\n const importPath = resolveStaticLocalImport(tree, program, filePath, sourceRoot, componentName);\n if (importPath === null) {\n return unresolvedShells(\"unresolvable-import\", componentName);\n }\n\n return resolveShellsFromFile(tree, importPath, sourceRoot, visited);\n};\n\n/**\n * Light-touch RouterProvider follow: read `router={name}`, resolve the router\n * module (import or same-file), collect Identifier `component:` targets from\n * `createRootRoute` / `createRoute` / `createRootRouteWithContext`. Skip arrow\n * wrappers and exotic graphs rather than guessing.\n */\nconst resolveFromRouterProvider = (\n tree: Tree,\n filePath: string,\n program: TSESTree.Program,\n routerProvider: TSESTree.JSXElement,\n sourceRoot: string,\n visited: Set<string>\n): ResolveContentShellsResult => {\n const routerName = getRouterPropIdentifier(routerProvider);\n if (routerName === null) {\n return unresolvedShells(\"router-prop-unresolved\");\n }\n\n const routerModulePath = resolveStaticLocalImport(tree, program, filePath, sourceRoot, routerName);\n if (routerModulePath !== null) {\n return collectShellsFromRouterModule(tree, routerModulePath, sourceRoot, visited);\n }\n\n // Same-file router (route factories live alongside RouterProvider).\n return collectShellsFromRouterProgram(tree, filePath, program, sourceRoot, visited);\n};\n\nconst collectShellsFromRouterModule = (\n tree: Tree,\n routerModulePath: string,\n sourceRoot: string,\n visited: Set<string>\n): ResolveContentShellsResult => {\n if (visited.has(routerModulePath)) {\n return unresolvedShells(\"cycle\", routerModulePath);\n }\n visited.add(routerModulePath);\n\n const content = tree.read(routerModulePath, \"utf-8\");\n if (content === null) {\n return unresolvedShells(\"entry-missing\", routerModulePath);\n }\n\n let program: TSESTree.Program;\n try {\n program = parseTsestreeSource(content);\n } catch {\n return unresolvedShells(\"parse-failed\", routerModulePath);\n }\n\n return collectShellsFromRouterProgram(tree, routerModulePath, program, sourceRoot, visited);\n};\n\ntype RouterRoute = {\n readonly variableName: string | null;\n readonly componentName: string | null;\n readonly parentVariableName: string | null;\n};\n\ntype AnalyzedRoute = RouterRoute & {\n readonly analysis: RouteComponentAnalysis | null;\n};\n\nconst collectShellsFromRouterProgram = (\n tree: Tree,\n routerFilePath: string,\n program: TSESTree.Program,\n sourceRoot: string,\n visited: Set<string>\n): ResolveContentShellsResult => {\n const routes = collectRouterRoutes(program);\n if (routes.length === 0) {\n return unresolvedShells(\"router-no-analysable-leaves\", \"no createRoute/createRootRoute factories found\");\n }\n\n if (routes.every(route => route.componentName === null)) {\n return unresolvedShells(\"router-inline-arrow-components\", routerFilePath);\n }\n\n const definedVariableNames = new Set(\n routes.flatMap(route => (route.variableName === null ? [] : [route.variableName]))\n );\n const skippedRouteNames: Array<string> = collectAddChildrenIdentifiers(program).filter(\n name => !definedVariableNames.has(name)\n );\n\n const analyzed: Array<AnalyzedRoute> = [];\n for (const route of routes) {\n if (route.componentName === null) {\n analyzed.push({ ...route, analysis: null });\n continue;\n }\n\n const componentFile = resolveComponentModulePath(tree, program, routerFilePath, sourceRoot, route.componentName);\n if (componentFile === null) {\n skippedRouteNames.push(route.componentName);\n analyzed.push({ ...route, analysis: null });\n continue;\n }\n\n const analysis = analyzeRouteComponent(tree, componentFile, route.componentName, sourceRoot, new Set(visited));\n if (analysis === null) {\n skippedRouteNames.push(route.componentName);\n analyzed.push({ ...route, analysis: null });\n continue;\n }\n\n analyzed.push({ ...route, analysis });\n }\n\n const shells = selectShellsForInvent(analyzed);\n if (shells.length === 0) {\n const skipped = uniqueNames(skippedRouteNames);\n return unresolvedShells(\n \"router-no-analysable-leaves\",\n skipped.length > 0 ? `skipped: ${skipped.join(\", \")}` : routerFilePath\n );\n }\n return {\n status: \"resolved\",\n shells: dedupeShells(shells),\n skippedRouteNames: uniqueNames(skippedRouteNames),\n };\n};\n\ntype RouteComponentAnalysis =\n | { readonly kind: \"layout-shell\"; readonly shell: ResolvedContentShell }\n | { readonly kind: \"leaf-shell\"; readonly shell: ResolvedContentShell };\n\nconst analyzeRouteComponent = (\n tree: Tree,\n filePath: string,\n componentName: string,\n sourceRoot: string,\n visited: Set<string>\n): RouteComponentAnalysis | null => {\n if (visited.has(`${filePath}#${componentName}`)) {\n return null;\n }\n visited.add(`${filePath}#${componentName}`);\n\n const content = tree.read(filePath, \"utf-8\");\n if (content === null) {\n return null;\n }\n\n let program: TSESTree.Program;\n try {\n program = parseTsestreeSource(content);\n } catch {\n return null;\n }\n\n const rootJsx = findJsxReturnedByName(program, componentName);\n if (rootJsx === null) {\n return null;\n }\n\n const leaf = unwrapWrappers(rootJsx);\n if (leaf === null) {\n return null;\n }\n\n if (isDivLikeHost(leaf) && leaf.type === AST_NODE_TYPES.JSXElement) {\n const shellResult = pickContentShellInFile(filePath, program, leaf);\n if (shellResult.status === \"unresolved\") {\n return null;\n }\n const wrapsOutlet =\n elementContainsOutlet(leaf) || hostWrapsOutletOneHop(tree, filePath, program, leaf, sourceRoot, visited);\n return { kind: wrapsOutlet ? \"layout-shell\" : \"leaf-shell\", shell: shellResult.shell };\n }\n\n const childName = getJsxComponentName(leaf);\n if (childName === null || childName === \"Outlet\") {\n return null;\n }\n if (isDynamicComponent(program, childName)) {\n return null;\n }\n\n const importPath = resolveStaticLocalImport(tree, program, filePath, sourceRoot, childName);\n if (importPath === null) {\n return null;\n }\n\n // Preserve nested kind: a one-hop wrapper around an Outlet layout\n // (`Root` → `Shell` with Outlet) must stay `layout-shell` so shared layout\n // wins over clear leaves. Forcing `leaf-shell` here double-invents.\n return analyzeRouteComponent(tree, importPath, childName, sourceRoot, visited);\n};\n\nconst getRouterPropIdentifier = (element: TSESTree.JSXElement): string | null => {\n for (const attribute of element.openingElement.attributes) {\n if (attribute.type !== AST_NODE_TYPES.JSXAttribute) continue;\n if (attribute.name.type !== AST_NODE_TYPES.JSXIdentifier || attribute.name.name !== \"router\") continue;\n if (attribute.value?.type !== AST_NODE_TYPES.JSXExpressionContainer) continue;\n if (attribute.value.expression.type === AST_NODE_TYPES.Identifier) {\n return attribute.value.expression.name;\n }\n }\n return null;\n};\n\nconst getVariableDeclaratorInit = (declarator: TSESTree.VariableDeclarator): TSESTree.Expression | null => {\n if (!(\"init\" in declarator)) {\n return null;\n }\n return declarator.init ?? null;\n};\n\n/**\n * Collects TanStack route factory bindings (`createRootRoute` / `createRoute` /\n * `createRootRouteWithContext`) with parent links from `getParentRoute`.\n * Arrow `component` wrappers have `componentName: null` (not guessed).\n */\nconst collectRouterRoutes = (program: TSESTree.Program): Array<RouterRoute> => {\n const coveredRanges = new Set<string>();\n const routes: Array<RouterRoute> = [];\n\n simpleTraverse(program, {\n enter: node => {\n if (node.type !== AST_NODE_TYPES.VariableDeclarator) return;\n if (node.id.type !== AST_NODE_TYPES.Identifier) return;\n const init = getVariableDeclaratorInit(node);\n if (init === null || init.type !== AST_NODE_TYPES.CallExpression) return;\n if (!isRouteFactoryCall(init)) return;\n const options = init.arguments[0];\n if (options?.type !== AST_NODE_TYPES.ObjectExpression) return;\n coveredRanges.add(`${init.range[0]}:${init.range[1]}`);\n routes.push({\n variableName: node.id.name,\n componentName: getComponentIdentifierFromOptions(options),\n parentVariableName: getParentRouteIdentifier(options),\n });\n },\n });\n\n simpleTraverse(program, {\n enter: node => {\n if (node.type !== AST_NODE_TYPES.CallExpression) return;\n if (!isRouteFactoryCall(node)) return;\n if (coveredRanges.has(`${node.range[0]}:${node.range[1]}`)) return;\n const options = node.arguments[0];\n if (options?.type !== AST_NODE_TYPES.ObjectExpression) return;\n routes.push({\n variableName: null,\n componentName: getComponentIdentifierFromOptions(options),\n parentVariableName: getParentRouteIdentifier(options),\n });\n },\n });\n\n return routes;\n};\n\nconst getParentRouteIdentifier = (options: TSESTree.ObjectExpression): string | null => {\n for (const property of options.properties) {\n if (property.type !== AST_NODE_TYPES.Property) continue;\n if (property.key.type !== AST_NODE_TYPES.Identifier || property.key.name !== \"getParentRoute\") continue;\n if (\n property.value.type !== AST_NODE_TYPES.ArrowFunctionExpression &&\n property.value.type !== AST_NODE_TYPES.FunctionExpression\n ) {\n continue;\n }\n if (property.value.body.type === AST_NODE_TYPES.Identifier) {\n return property.value.body.name;\n }\n if (property.value.body.type === AST_NODE_TYPES.BlockStatement) {\n for (const statement of property.value.body.body) {\n if (statement.type !== AST_NODE_TYPES.ReturnStatement || statement.argument === null) continue;\n const arg = unwrapParentheses(statement.argument);\n if (arg.type === AST_NODE_TYPES.Identifier) {\n return arg.name;\n }\n }\n }\n }\n return null;\n};\n\nconst collectAddChildrenIdentifiers = (program: TSESTree.Program): Array<string> => {\n const names: Array<string> = [];\n simpleTraverse(program, {\n enter: node => {\n if (node.type !== AST_NODE_TYPES.CallExpression) return;\n if (node.callee.type !== AST_NODE_TYPES.MemberExpression || node.callee.computed) return;\n if (node.callee.property.type !== AST_NODE_TYPES.Identifier) return;\n if (node.callee.property.name !== \"addChildren\") return;\n const arg = node.arguments[0];\n if (arg?.type !== AST_NODE_TYPES.ArrayExpression) return;\n for (const element of arg.elements) {\n if (element?.type === AST_NODE_TYPES.Identifier) {\n names.push(element.name);\n }\n }\n },\n });\n return names;\n};\n\nconst CONTENT_SPACE_TOKEN = \"p-content-space\";\n\nconst shellHasContentSpace = (shell: ResolvedContentShell): boolean =>\n splitClasses(shell.classnameValue).includes(CONTENT_SPACE_TOKEN);\n\n/**\n * Layout-wins is per route subtree: a layout covers only descendant leaves.\n * Already-migrated descendant leaves must not get a second inset on the layout.\n */\nconst selectShellsForInvent = (routes: ReadonlyArray<AnalyzedRoute>): Array<ResolvedContentShell> => {\n const byVariable = new Map<string, AnalyzedRoute>();\n for (const route of routes) {\n if (route.variableName !== null) {\n byVariable.set(route.variableName, route);\n }\n }\n\n const layouts = routes.filter(route => route.analysis?.kind === \"layout-shell\");\n const leaves = routes.filter(route => route.analysis?.kind === \"leaf-shell\");\n const coveredLeaves = new Set<AnalyzedRoute>();\n const selected: Array<ResolvedContentShell> = [];\n\n for (const layout of layouts) {\n if (layout.analysis?.kind !== \"layout-shell\") continue;\n const descendants = leaves.filter(leaf => isDescendantOf(leaf, layout, byVariable));\n const descendantsAlreadyMigrated = descendants.some(\n leaf => leaf.analysis !== null && shellHasContentSpace(leaf.analysis.shell)\n );\n if (descendantsAlreadyMigrated) {\n continue;\n }\n selected.push(layout.analysis.shell);\n for (const descendant of descendants) {\n coveredLeaves.add(descendant);\n }\n }\n\n for (const leaf of leaves) {\n if (coveredLeaves.has(leaf) || leaf.analysis?.kind !== \"leaf-shell\") continue;\n selected.push(leaf.analysis.shell);\n }\n\n return selected;\n};\n\nconst isDescendantOf = (\n leaf: AnalyzedRoute,\n layout: AnalyzedRoute,\n byVariable: Map<string, AnalyzedRoute>\n): boolean => {\n if (layout.variableName === null) return false;\n let current = leaf.parentVariableName;\n const seen = new Set<string>();\n while (current !== null && !seen.has(current)) {\n if (current === layout.variableName) return true;\n seen.add(current);\n current = byVariable.get(current)?.parentVariableName ?? null;\n }\n return false;\n};\n\nconst uniqueNames = (names: ReadonlyArray<string>): Array<string> => {\n const seen = new Set<string>();\n const result: Array<string> = [];\n for (const name of names) {\n if (seen.has(name)) continue;\n seen.add(name);\n result.push(name);\n }\n return result;\n};\n\nconst isRouteFactoryCall = (node: TSESTree.CallExpression): boolean => {\n const directName = getCalleeIdentifierName(node.callee);\n if (directName === \"createRootRoute\" || directName === \"createRoute\") {\n return true;\n }\n // createRootRouteWithContext<T>()({ ... })\n if (node.callee.type === AST_NODE_TYPES.CallExpression) {\n const innerName = getCalleeIdentifierName(node.callee.callee);\n return innerName === \"createRootRouteWithContext\";\n }\n return false;\n};\n\nconst getCalleeIdentifierName = (\n callee: TSESTree.Expression | TSESTree.Super | TSESTree.PrivateIdentifier\n): string | null => {\n if (callee.type === AST_NODE_TYPES.Identifier) {\n return callee.name;\n }\n if (callee.type === AST_NODE_TYPES.TSInstantiationExpression) {\n return getCalleeIdentifierName(callee.expression);\n }\n return null;\n};\n\nconst getComponentIdentifierFromOptions = (options: TSESTree.ObjectExpression): string | null => {\n for (const property of options.properties) {\n if (property.type !== AST_NODE_TYPES.Property) continue;\n if (property.key.type !== AST_NODE_TYPES.Identifier || property.key.name !== \"component\") continue;\n if (property.value.type === AST_NODE_TYPES.Identifier) {\n return property.value.name;\n }\n }\n return null;\n};\n\nconst resolveComponentModulePath = (\n tree: Tree,\n program: TSESTree.Program,\n fromFilePath: string,\n sourceRoot: string,\n componentName: string\n): string | null => {\n const imported = resolveStaticLocalImport(tree, program, fromFilePath, sourceRoot, componentName);\n if (imported !== null) {\n return imported;\n }\n if (findJsxReturnedByName(program, componentName) !== null) {\n return fromFilePath;\n }\n return null;\n};\n\nconst elementContainsOutlet = (element: TSESTree.JSXElement | TSESTree.JSXFragment): boolean => {\n let found = false;\n simpleTraverse(element, {\n enter: node => {\n if (found) return;\n if (node.type !== AST_NODE_TYPES.JSXOpeningElement) return;\n const name = getJsxOpeningName(node.name);\n if (name === \"Outlet\") {\n found = true;\n }\n },\n });\n return found;\n};\n\n/**\n * True when a div-like shell's `<Outlet />` lives one custom-component hop\n * below (`<div><Main /></div>` where `Main` returns `<Outlet />`). Without this,\n * the ancestor is padded as a leaf alongside real route leaves.\n */\nconst hostWrapsOutletOneHop = (\n tree: Tree,\n filePath: string,\n program: TSESTree.Program,\n host: TSESTree.JSXElement,\n sourceRoot: string,\n visited: Set<string>\n): boolean => {\n for (const childName of collectCustomChildComponentNames(host)) {\n if (childName === \"Outlet\") {\n return true;\n }\n if (componentReturnsOutletOneHop(tree, filePath, program, childName, sourceRoot, visited)) {\n return true;\n }\n }\n return false;\n};\n\nconst collectCustomChildComponentNames = (host: TSESTree.JSXElement): Array<string> => {\n const names: Array<string> = [];\n for (const child of host.children) {\n if (child.type !== AST_NODE_TYPES.JSXElement) continue;\n const name = getJsxComponentName(child);\n if (name !== null) {\n names.push(name);\n }\n }\n return names;\n};\n\nconst componentReturnsOutletOneHop = (\n tree: Tree,\n fromFilePath: string,\n fromProgram: TSESTree.Program,\n componentName: string,\n sourceRoot: string,\n visited: Set<string>\n): boolean => {\n const visitKey = `${fromFilePath}#outlet-hop#${componentName}`;\n if (visited.has(visitKey)) {\n return false;\n }\n visited.add(visitKey);\n\n let program = fromProgram;\n if (findJsxReturnedByName(fromProgram, componentName) === null) {\n const importPath = resolveStaticLocalImport(tree, fromProgram, fromFilePath, sourceRoot, componentName);\n if (importPath === null) {\n return false;\n }\n const content = tree.read(importPath, \"utf-8\");\n if (content === null) {\n return false;\n }\n try {\n program = parseTsestreeSource(content);\n } catch {\n return false;\n }\n }\n\n const jsx = findJsxReturnedByName(program, componentName);\n if (jsx === null) {\n return false;\n }\n if (getJsxComponentName(jsx) === \"Outlet\") {\n return true;\n }\n return elementContainsOutlet(jsx);\n};\n\nconst dedupeShells = (shells: ReadonlyArray<ResolvedContentShell>): Array<ResolvedContentShell> => {\n const seen = new Set<string>();\n const result: Array<ResolvedContentShell> = [];\n for (const shell of shells) {\n const key = `${shell.filePath}:${shell.location.reportNode.range[0]}:${shell.location.reportNode.range[1]}`;\n if (seen.has(key)) continue;\n seen.add(key);\n result.push(shell);\n }\n return result;\n};\n\n/**\n * Finds the JSX element returned by the entry's primary component:\n * `singleSpaReact({ rootComponent })` when present, otherwise the first\n * exported function/const whose body returns JSX.\n */\nconst findRootJsxElement = (program: TSESTree.Program): TSESTree.JSXElement | TSESTree.JSXFragment | null => {\n const singleSpaRootName = findSingleSpaRootComponentName(program);\n if (singleSpaRootName !== null) {\n return findJsxReturnedByName(program, singleSpaRootName);\n }\n\n for (const statement of program.body) {\n const name = getExportedComponentName(statement);\n if (name === null) continue;\n const jsx = findJsxReturnedByName(program, name);\n if (jsx !== null) return jsx;\n }\n\n return null;\n};\n\nconst findSingleSpaRootComponentName = (program: TSESTree.Program): string | null => {\n let result: string | null = null;\n\n simpleTraverse(program, {\n enter: node => {\n if (result !== null) return;\n if (node.type !== AST_NODE_TYPES.CallExpression) return;\n if (!isCalleeNamed(node.callee, \"singleSpaReact\")) return;\n if (node.arguments[0]?.type !== AST_NODE_TYPES.ObjectExpression) return;\n\n for (const property of node.arguments[0].properties) {\n if (property.type !== AST_NODE_TYPES.Property) continue;\n if (property.key.type !== AST_NODE_TYPES.Identifier || property.key.name !== \"rootComponent\") continue;\n if (property.value.type === AST_NODE_TYPES.Identifier) {\n result = property.value.name;\n }\n }\n },\n });\n\n return result;\n};\n\nconst getExportedComponentName = (statement: TSESTree.ProgramStatement): string | null => {\n if (statement.type === AST_NODE_TYPES.ExportNamedDeclaration) {\n if (statement.declaration?.type === AST_NODE_TYPES.FunctionDeclaration) {\n return statement.declaration.id?.name ?? null;\n }\n if (statement.declaration?.type === AST_NODE_TYPES.VariableDeclaration) {\n const declarator = statement.declaration.declarations[0];\n if (declarator.id.type === AST_NODE_TYPES.Identifier) {\n return declarator.id.name;\n }\n }\n }\n if (statement.type === AST_NODE_TYPES.ExportDefaultDeclaration) {\n if (statement.declaration.type === AST_NODE_TYPES.Identifier) {\n return statement.declaration.name;\n }\n if (statement.declaration.type === AST_NODE_TYPES.FunctionDeclaration) {\n return statement.declaration.id?.name ?? null;\n }\n }\n return null;\n};\n\nconst findJsxReturnedByName = (\n program: TSESTree.Program,\n name: string\n): TSESTree.JSXElement | TSESTree.JSXFragment | null => {\n for (const statement of program.body) {\n const fn = matchNamedFunctionLike(statement, name);\n if (fn !== null) {\n return findReturnedJsx(fn);\n }\n }\n return null;\n};\n\nconst matchNamedFunctionLike = (\n statement: TSESTree.ProgramStatement,\n name: string\n): TSESTree.BlockStatement | TSESTree.Expression | null => {\n const decl =\n statement.type === AST_NODE_TYPES.ExportNamedDeclaration ||\n statement.type === AST_NODE_TYPES.ExportDefaultDeclaration\n ? statement.declaration\n : statement;\n\n if (decl === null) return null;\n\n if (decl.type === AST_NODE_TYPES.FunctionDeclaration && decl.id !== null && decl.id.name === name) {\n return decl.body;\n }\n\n if (decl.type === AST_NODE_TYPES.VariableDeclaration) {\n for (const declarator of decl.declarations) {\n if (declarator.id.type !== AST_NODE_TYPES.Identifier || declarator.id.name !== name) continue;\n const init = declarator.init;\n if (init === null) return null;\n if (init.type === AST_NODE_TYPES.ArrowFunctionExpression || init.type === AST_NODE_TYPES.FunctionExpression) {\n return init.body;\n }\n }\n }\n\n if (statement.type === AST_NODE_TYPES.FunctionDeclaration && statement.id.name === name) {\n return statement.body;\n }\n\n return null;\n};\n\nconst findReturnedJsx = (\n body: TSESTree.BlockStatement | TSESTree.Expression\n): TSESTree.JSXElement | TSESTree.JSXFragment | null => {\n if (body.type === AST_NODE_TYPES.JSXElement || body.type === AST_NODE_TYPES.JSXFragment) {\n return body;\n }\n if (body.type === AST_NODE_TYPES.BlockStatement) {\n for (const statement of body.body) {\n if (statement.type !== AST_NODE_TYPES.ReturnStatement || statement.argument === null) continue;\n const arg = unwrapParentheses(statement.argument);\n if (arg.type === AST_NODE_TYPES.JSXElement || arg.type === AST_NODE_TYPES.JSXFragment) {\n return arg;\n }\n }\n }\n return null;\n};\n\nconst unwrapParentheses = (expression: TSESTree.Expression): TSESTree.Expression => {\n let current = expression;\n while (current.type === AST_NODE_TYPES.TSAsExpression || current.type === AST_NODE_TYPES.TSSatisfiesExpression) {\n current = current.expression;\n }\n return current;\n};\n\n/**\n * Skips known provider / Suspense / fragment wrappers down to the first\n * meaningful child (host element or custom component).\n */\nconst unwrapWrappers = (\n node: TSESTree.JSXElement | TSESTree.JSXFragment\n): TSESTree.JSXElement | TSESTree.JSXFragment | null => {\n let current: TSESTree.JSXElement | TSESTree.JSXFragment = node;\n\n for (;;) {\n if (current.type === AST_NODE_TYPES.JSXFragment) {\n const child = firstJsxChild(current.children);\n if (child === null) return null;\n current = child;\n continue;\n }\n\n const name = getJsxComponentName(current);\n if (name !== null && isKnownWrapperName(name)) {\n const child = firstJsxChild(current.children);\n if (child === null) return null;\n current = child;\n continue;\n }\n\n return current;\n }\n};\n\nconst firstJsxChild = (\n children: ReadonlyArray<TSESTree.JSXChild>\n): TSESTree.JSXElement | TSESTree.JSXFragment | null => {\n for (const child of children) {\n if (child.type === AST_NODE_TYPES.JSXElement || child.type === AST_NODE_TYPES.JSXFragment) {\n return child;\n }\n }\n return null;\n};\n\nconst isDivLikeHost = (element: TSESTree.JSXElement | TSESTree.JSXFragment): boolean => {\n if (element.type !== AST_NODE_TYPES.JSXElement) return false;\n const name = getJsxOpeningName(element.openingElement.name);\n return name !== null && DIV_LIKE_ELEMENTS.has(name);\n};\n\nconst getJsxComponentName = (element: TSESTree.JSXElement | TSESTree.JSXFragment): string | null => {\n if (element.type !== AST_NODE_TYPES.JSXElement) return null;\n const name = getJsxOpeningName(element.openingElement.name);\n if (name === null) return null;\n if (DIV_LIKE_ELEMENTS.has(name)) return null;\n if (/^[a-z]/.test(name)) return null;\n return name;\n};\n\nconst getJsxOpeningName = (name: TSESTree.JSXTagNameExpression): string | null => {\n if (name.type === AST_NODE_TYPES.JSXIdentifier) return name.name;\n return null;\n};\n\n/**\n * Confidence rule for this phase: a single editable content-region classname\n * host that itself owns scrollable overflow (`overflow-auto` / `scroll` /\n * `overlay`, including axis-prefixed forms). Clipping overflow (`hidden` /\n * `clip`), a scrolling descendant, or a header-ish child (`PageHeader` /\n * `Topbar` / `Header`) make the host unresolved — those cases go to the\n * unresolved-surface report for a human to place the inset.\n *\n * Classnames must be bound to the host's `className`/`class` attribute (literal\n * on the attribute, direct Tailwind call in the attribute, or the local\n * binding of that attribute's identifier/callee). Never invent from unrelated\n * file-wide classname locations.\n */\nconst pickContentShellInFile = (\n filePath: string,\n program: TSESTree.Program,\n host: TSESTree.JSXElement\n): ResolveContentShellResult => {\n const hostClassnames = collectEditableClassnamesForHost(program, host);\n if (hostClassnames.length === 0) {\n return unresolvedShell(\"no-editable-classname\", filePath);\n }\n\n if (hostClassnames.some(classname => classListHasClippingOverflow(splitClasses(classname.value)))) {\n return unresolvedShell(\"clipping-overflow-on-host\", filePath);\n }\n\n const candidates = hostClassnames.filter(isContentShellClassname);\n if (candidates.length === 0) {\n return unresolvedShell(\"no-overflow-on-host\", filePath);\n }\n if (candidates.length > 1) {\n return unresolvedShell(\"multiple-overflow-candidates\", filePath);\n }\n\n if (hostRendersHeader(host)) {\n return unresolvedShell(\"header-on-shell\", filePath);\n }\n if (descendantOwnsScroll(program, host)) {\n return unresolvedShell(\"descendant-owns-scroll\", filePath);\n }\n\n const location = candidates[0];\n if (location === undefined) {\n return unresolvedShell(\"unclear-graph\", filePath);\n }\n return {\n status: \"resolved\",\n shell: {\n filePath,\n classnameValue: location.value,\n combinedClassnameValue: hostClassnames.map(hostLocation => hostLocation.value).join(\" \"),\n location,\n },\n };\n};\n\nconst collectEditableClassnamesForHost = (\n program: TSESTree.Program,\n host: TSESTree.JSXElement\n): Array<ClassnameLocation> => {\n const attribute = host.openingElement.attributes.find(\n (attr): attr is TSESTree.JSXAttribute =>\n attr.type === AST_NODE_TYPES.JSXAttribute &&\n attr.name.type === AST_NODE_TYPES.JSXIdentifier &&\n (attr.name.name === \"className\" || attr.name.name === \"class\")\n );\n if (attribute === undefined) return [];\n\n // Direct literal classnames on the attribute.\n const fromAttribute = findClassnameLocations(program).filter(location => {\n if (location.context.type !== \"jsx-attribute\") return false;\n return location.reportNode.range[0] >= attribute.range[0] && location.reportNode.range[1] <= attribute.range[1];\n });\n if (fromAttribute.length > 0) return fromAttribute;\n\n const value = attribute.value;\n if (value?.type !== AST_NODE_TYPES.JSXExpressionContainer) return [];\n const expression = value.expression;\n\n if (expression.type === AST_NODE_TYPES.CallExpression) {\n return collectClassnamesBoundToCallExpression(program, expression);\n }\n if (expression.type === AST_NODE_TYPES.Identifier) {\n return collectClassnamesBoundToIdentifier(program, expression.name);\n }\n return [];\n};\n\n/**\n * `className={cva(\"...\")}` — locations inside this call only.\n * `className={layout()}` — locations inside the local binding of `layout` only.\n */\nconst collectClassnamesBoundToCallExpression = (\n program: TSESTree.Program,\n callExpression: TSESTree.CallExpression\n): Array<ClassnameLocation> => {\n if (callExpression.callee.type !== AST_NODE_TYPES.Identifier) {\n return [];\n }\n\n const calleeName = callExpression.callee.name;\n if (isTailwindFunction(calleeName)) {\n return findClassnameLocations(program).filter(\n location =>\n location.reportNode.range[0] >= callExpression.range[0] &&\n location.reportNode.range[1] <= callExpression.range[1]\n );\n }\n\n return collectClassnamesBoundToIdentifier(program, calleeName);\n};\n\nconst collectClassnamesBoundToIdentifier = (program: TSESTree.Program, name: string): Array<ClassnameLocation> => {\n const bindingRange = findLocalBindingInitializerRange(program, name);\n if (bindingRange === null) {\n return [];\n }\n\n return findClassnameLocations(program).filter(\n location => location.reportNode.range[0] >= bindingRange[0] && location.reportNode.range[1] <= bindingRange[1]\n );\n};\n\nconst findLocalBindingInitializerRange = (program: TSESTree.Program, name: string): TSESTree.Range | null => {\n let result: TSESTree.Range | null = null;\n\n simpleTraverse(program, {\n enter: node => {\n if (result !== null) return;\n if (node.type !== AST_NODE_TYPES.VariableDeclarator) return;\n if (node.id.type !== AST_NODE_TYPES.Identifier || node.id.name !== name) return;\n if (node.init === null) return;\n result = node.init.range;\n },\n });\n\n return result;\n};\n\nconst SCROLLABLE_OVERFLOW = /(^|:)overflow-(x-|y-)?(auto|scroll|overlay)$/;\nconst CLIPPING_OVERFLOW = /(^|:)overflow-(x-|y-)?(hidden|clip)$/;\n\nconst classListHasScrollableOverflow = (classes: ReadonlyArray<string>): boolean =>\n classes.some(cls => SCROLLABLE_OVERFLOW.test(cls));\n\nconst classListHasClippingOverflow = (classes: ReadonlyArray<string>): boolean =>\n classes.some(cls => CLIPPING_OVERFLOW.test(cls));\n\nconst isContentShellClassname = (location: ClassnameLocation): boolean => {\n const classes = splitClasses(location.value);\n if (classListHasClippingOverflow(classes)) return false;\n return classListHasScrollableOverflow(classes);\n};\n\nconst HEADER_ISH_NAMES: ReadonlySet<string> = new Set([\"PageHeader\", \"Topbar\", \"Header\"]);\n\nconst hostRendersHeader = (host: TSESTree.JSXElement): boolean =>\n jsxElementsUnder(host).some(element => {\n const name = getJsxOpeningName(element.openingElement.name);\n return name !== null && HEADER_ISH_NAMES.has(name);\n });\n\nconst descendantOwnsScroll = (program: TSESTree.Program, host: TSESTree.JSXElement): boolean =>\n jsxElementsUnder(host).some(element =>\n collectEditableClassnamesForHost(program, element).some(isContentShellClassname)\n );\n\nconst jsxElementsUnder = (host: TSESTree.JSXElement): Array<TSESTree.JSXElement> => {\n const found: Array<TSESTree.JSXElement> = [];\n const visit = (children: ReadonlyArray<TSESTree.JSXChild>): void => {\n for (const child of children) {\n if (child.type === AST_NODE_TYPES.JSXElement) {\n found.push(child);\n visit(child.children);\n } else if (child.type === AST_NODE_TYPES.JSXFragment) {\n visit(child.children);\n }\n }\n };\n visit(host.children);\n return found;\n};\n\nconst isDynamicComponent = (program: TSESTree.Program, componentName: string): boolean => {\n let isDynamic = false;\n\n simpleTraverse(program, {\n enter: node => {\n if (isDynamic) return;\n if (node.type !== AST_NODE_TYPES.VariableDeclarator) return;\n if (node.id.type !== AST_NODE_TYPES.Identifier || node.id.name !== componentName) return;\n if (node.init === null) return;\n if (containsDynamicImport(node.init)) {\n isDynamic = true;\n }\n },\n });\n\n return isDynamic;\n};\n\nconst containsDynamicImport = (node: TSESTree.Node): boolean => {\n let found = false;\n simpleTraverse(node, {\n enter: child => {\n if (found) return;\n if (child.type === AST_NODE_TYPES.ImportExpression) {\n found = true;\n }\n },\n });\n return found;\n};\n\n/**\n * Resolves a component name to a static relative/local import under\n * `sourceRoot`. Returns null for external packages or missing bindings.\n */\nconst resolveStaticLocalImport = (\n tree: Tree,\n program: TSESTree.Program,\n fromFilePath: string,\n sourceRoot: string,\n componentName: string\n): string | null => {\n for (const statement of program.body) {\n if (statement.type !== AST_NODE_TYPES.ImportDeclaration) continue;\n const specifier = statement.source.value;\n if (typeof specifier !== \"string\") continue;\n const bindsComponent = statement.specifiers.some(spec => {\n if (spec.type === AST_NODE_TYPES.ImportDefaultSpecifier) {\n return spec.local.name === componentName;\n }\n if (spec.type === AST_NODE_TYPES.ImportSpecifier) {\n return spec.local.name === componentName;\n }\n return false;\n });\n if (!bindsComponent) continue;\n\n if (!(specifier.startsWith(\"./\") || specifier.startsWith(\"../\"))) {\n return null;\n }\n\n const fromDir = path.posix.dirname(fromFilePath);\n const resolvedWithoutExt = path.posix.normalize(path.posix.join(fromDir, specifier));\n const candidates = [\n resolvedWithoutExt,\n `${resolvedWithoutExt}.tsx`,\n `${resolvedWithoutExt}.ts`,\n `${resolvedWithoutExt}/index.tsx`,\n `${resolvedWithoutExt}/index.ts`,\n ];\n\n for (const candidate of candidates) {\n if (candidate === fromFilePath) continue;\n if (!candidate.startsWith(`${sourceRoot}/`) && candidate !== sourceRoot) continue;\n if (!(candidate.endsWith(\".tsx\") || candidate.endsWith(\".ts\"))) continue;\n if (tree.exists(candidate)) {\n return candidate;\n }\n }\n }\n\n // Local const binding (e.g. LazyPage) without an import — not followable as a\n // static local module.\n return null;\n};\n\nconst isCalleeNamed = (callee: TSESTree.CallExpression[\"callee\"], name: string): boolean => {\n return callee.type === AST_NODE_TYPES.Identifier && callee.name === name;\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rewrite-page-content.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/migrations/p-content-space-codemod/rewrite-page-content.ts"],"names":[],"mappings":";;AAmCA,gDAYC;AA9CD,wEAAiF;AACjF,0EAAoF;AAGpF,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAC5C,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAC9C,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAE5C;;;GAGG;AACH,SAAS,gBAAgB,CAAC,OAA8B;IACtD,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,kBAAkB,CAAC,IAAU,EAAE,SAA4B;IACzE,OAAO,IAAA,0DAAkC,EACvC,IAAI,EACJ,SAAS,CAAC,UAAU,EACpB,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EACjD,KAAK,CAAC,EAAE;QACN,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAA,kCAAY,EAAC,KAAK,CAAC,CAAC;YACvD,CAAC,CAAC,mBAAmB;YACrB,CAAC,CAAC,GAAG,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;QACpD,OAAO,IAAA,uCAAiB,EAAC,KAAK,EAAE,oBAAoB,EAAE,WAAW,CAAC,CAAC;IACrE,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import type { Tree } from \"@nx/devkit\";\nimport { replaceClassToken, splitClasses } from \"@trackunit/css-classname-utils\";\nimport { transformClassnamesUnderSourceRoot } from \"../utils/classname-ast-rewrite\";\nimport type { ResolvedExtension } from \"../utils/resolve-extension-types\";\n\nconst PAGE_CONTENT_PATTERN = \"page-content\";\nconst CONTENT_SPACE_TOKEN = \"p-content-space\";\nconst OVERFLOW_AUTO_TOKEN = \"overflow-auto\";\n\n/**\n * True when `token` is already present as a whole class token, including when\n * wrapped in Tailwind variant prefixes (e.g. `xl:overflow-hidden`).\n */\nfunction hasOverflowToken(classes: ReadonlyArray<string>): boolean {\n return classes.some(cls => /(^|:)overflow-/.test(cls));\n}\n\n/**\n * Rewrites the legacy `page-content` Tailwind class to\n * `overflow-auto p-content-space` across every rewritable file under a\n * single resolved extension's `sourceRoot`.\n *\n * When the classname already declares its own `overflow-*` token, only\n * `p-content-space` is inserted — emitting a second `overflow-auto` would be\n * dead (or, when an identical `overflow-auto` is already present, a\n * duplicate). Scroll ownership stays with the element's existing overflow\n * declaration.\n *\n * Scoped to one extension per call — the caller (the orchestrator) loops\n * over every Asset Home/Site Home/Admin extension.\n *\n * Only performs the `page-content` classname rewrite: it does not touch\n * `pb-*`/`pb-responsive-space` classes or produce a report, both of which are\n * separate migration steps.\n */\nexport function rewritePageContent(tree: Tree, extension: ResolvedExtension): { filesChanged: Array<string> } {\n return transformClassnamesUnderSourceRoot(\n tree,\n extension.sourceRoot,\n content => content.includes(PAGE_CONTENT_PATTERN),\n value => {\n const replacement = hasOverflowToken(splitClasses(value))\n ? CONTENT_SPACE_TOKEN\n : `${OVERFLOW_AUTO_TOKEN} ${CONTENT_SPACE_TOKEN}`;\n return replaceClassToken(value, PAGE_CONTENT_PATTERN, replacement);\n }\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-skip-reason.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/migrations/p-content-space-codemod/shell-skip-reason.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA4BH,MAAM,QAAQ,GAAwC;IACpD,eAAe,EAAE,qDAAqD;IACtE,cAAc,EAAE,8DAA8D;IAC9E,aAAa,EAAE,yDAAyD;IACxE,eAAe,EAAE,mEAAmE;IACpF,KAAK,EAAE,uEAAuE;IAC9E,mBAAmB,EAAE,0EAA0E;IAC/F,qBAAqB,EAAE,gEAAgE;IACvF,kBAAkB,EAAE,sEAAsE;IAC1F,wBAAwB,EAAE,8DAA8D;IACxF,gCAAgC,EAC9B,+HAA+H;IACjI,6BAA6B,EAC3B,uFAAuF;IACzF,uBAAuB,EAAE,0FAA0F;IACnH,qBAAqB,EACnB,qIAAqI;IACvI,8BAA8B,EAAE,0EAA0E;IAC1G,iBAAiB,EAAE,4FAA4F;IAC/G,wBAAwB,EAAE,qFAAqF;IAC/G,2BAA2B,EACzB,kGAAkG;IACpG,eAAe,EAAE,sEAAsE;CACxF,CAAC;AAEF;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAAC,IAAyB,EAAE,MAAe,EAAmB,EAAE,CAAC,CAAC;IAC/F,IAAI;IACJ,OAAO,EAAE,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,MAAM,GAAG;CACxG,CAAC,CAAC;AAHU,QAAA,eAAe,mBAGzB","sourcesContent":["/**\n * Why invent/resolve declined to pick an ASA content shell. Surfaced in\n * migration console output and UnresolvedSurfaceReport so humans (and\n * third parties) can plan manual `p-content-space` placement.\n */\n\nexport type ShellSkipReasonCode =\n | \"entry-missing\"\n | \"parse-failed\"\n | \"no-root-jsx\"\n | \"empty-wrapper\"\n | \"cycle\"\n | \"dynamic-component\"\n | \"unresolvable-import\"\n | \"non-host-element\"\n | \"router-prop-unresolved\"\n | \"router-inline-arrow-components\"\n | \"router-no-analysable-leaves\"\n | \"no-editable-classname\"\n | \"no-overflow-on-host\"\n | \"multiple-overflow-candidates\"\n | \"header-on-shell\"\n | \"descendant-owns-scroll\"\n | \"clipping-overflow-on-host\"\n | \"unclear-graph\";\n\nexport type ShellSkipReason = {\n readonly code: ShellSkipReasonCode;\n /** Human-readable explanation (safe to print to the console). */\n readonly message: string;\n};\n\nconst MESSAGES: Record<ShellSkipReasonCode, string> = {\n \"entry-missing\": \"extension entry file was not found under sourceRoot\",\n \"parse-failed\": \"extension entry/source could not be parsed as TypeScript/TSX\",\n \"no-root-jsx\": \"could not find a root JSX return in the entry component\",\n \"empty-wrapper\": \"provider/Suspense/Fragment wrappers had no JSX child to walk into\",\n cycle: \"component graph walked into a cycle while resolving the content shell\",\n \"dynamic-component\": \"content shell is behind a dynamic import / lazy component (not followed)\",\n \"unresolvable-import\": \"could not resolve a static local import for the host component\",\n \"non-host-element\": \"leaf JSX is not a div/main/section with an inventable className host\",\n \"router-prop-unresolved\": \"RouterProvider router={...} prop was not a simple identifier\",\n \"router-inline-arrow-components\":\n \"TanStack routes use inline arrow `component: () => <...>` instead of a named component identifier — invent cannot follow them\",\n \"router-no-analysable-leaves\":\n \"router graph had no analysable named route leaves with a clear overflow content shell\",\n \"no-editable-classname\": \"div/main/section host has no editable className/class (literal or bound Tailwind helper)\",\n \"no-overflow-on-host\":\n \"host has a className but does not itself own scrollable overflow (overflow-auto/scroll/overlay) — invent only pads the scroll owner\",\n \"multiple-overflow-candidates\": \"host has more than one inventable overflow classname binding (ambiguous)\",\n \"header-on-shell\": \"host also renders PageHeader/Topbar/Header — pad the body below the header, not this shell\",\n \"descendant-owns-scroll\": \"a descendant owns overflow scrolling — pad that scroll owner, not the outer wrapper\",\n \"clipping-overflow-on-host\":\n \"host uses overflow-hidden/clip (full-bleed / clipping shell) — not inventable as a content inset\",\n \"unclear-graph\": \"content-shell graph was unclear; invent refused to guess a first-div\",\n};\n\n/**\n * Builds a structured skip reason for invent/resolve console + report output.\n *\n * @param code - Stable skip-reason code from the inventable-shell contract\n * @param detail - Optional path / leaf list / host name appended in parentheses\n * @returns {ShellSkipReason} Structured reason with a human-readable message\n */\nexport const shellSkipReason = (code: ShellSkipReasonCode, detail?: string): ShellSkipReason => ({\n code,\n message: detail === undefined || detail.length === 0 ? MESSAGES[code] : `${MESSAGES[code]} (${detail})`,\n});\n"]}
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.repairTsconfig = exports.addJsxToIrisApps = exports.repairSdkPathAliases = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const js_1 = require("@nx/js");
6
+ // An internal entry point: safe only because iris-app pins @nx/js exactly. Check this export on every @nx/js bump.
7
+ const internal_1 = require("@nx/js/internal");
8
+ const typescript_1 = require("typescript");
9
+ /**
10
+ * Repairs the TypeScript configuration of workspaces the SDK itself left
11
+ * unbuildable under a type-checked `nx build` (SDK-649).
12
+ *
13
+ * Root cause (path aliases): the `extend` generator wrote `tsconfig.base.json` `paths` entries
14
+ * without a leading `./` while the workspace preset leaves `baseUrl` unset, and
15
+ * TypeScript 6 rejects that combination with TS5090. Generators fixed in the
16
+ * SDK only help new workspaces, so existing ones are repaired here.
17
+ *
18
+ * Root cause (jsx): `iris-app:create` generated a `tsconfig.app.json` with no
19
+ * `jsx`, so once an extension manifest imports `./src/routeTree` (`.tsx`) the
20
+ * app's type-check fails with TS6142.
21
+ *
22
+ * Only alias targets that are non-relative and point at an existing
23
+ * `extension-manifest.ts` (the shape the SDK's `extend` generator writes) are
24
+ * touched; other aliases that would still trip TS5090 are reported with a
25
+ * warning. A file is only written when something in it changes, and is then
26
+ * re-serialised like every other JSON edit the SDK makes, so comments and
27
+ * trailing commas in that file are lost. A file this migration cannot read is
28
+ * skipped with a warning and never aborts the migration.
29
+ */
30
+ const EXTENSION_MANIFEST_FILE = "extension-manifest.ts";
31
+ const IRIS_APP_MANIFEST_FILE = "iris-app-manifest.ts";
32
+ const APP_TSCONFIG_FILE = "tsconfig.app.json";
33
+ const JSX_VALUE = "react-jsx";
34
+ // TODO(SDK-742): promote `isRecord` and `errorMessage` to @trackunit/shared-utils; they are copied here for now.
35
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
36
+ const errorMessage = (error) => (error instanceof Error ? error.message : String(error));
37
+ /** Reads a tsconfig (devkit's `readJson` accepts comments and trailing commas); `undefined` when it is not a JSON object. */
38
+ const readJsonObject = (tree, filePath) => {
39
+ const parsed = (0, devkit_1.readJson)(tree, filePath);
40
+ return isRecord(parsed) ? parsed : undefined;
41
+ };
42
+ /** TypeScript's own syntax diagnostics (TS1xxx), such as "'}' expected": the JSON of a file in the chain is broken. */
43
+ const isSyntaxDiagnostic = (diagnostic) => diagnostic.code < 2000;
44
+ /**
45
+ * What TypeScript itself makes of a tsconfig, `extends` chain included: the options and whether the chain could be
46
+ * read in full. The Tree-backed host resolves the chain exactly like `tsc`, package-form bases such as
47
+ * `@tsconfig/strictest` included. A chain with a missing base or broken JSON is not read in full, since an option
48
+ * missing from what could be read may be set in what could not.
49
+ */
50
+ const resolveEffectiveConfig = (tree, filePath) => {
51
+ const parsed = (0, js_1.readTsConfig)(filePath, (0, internal_1.createTreeParseConfigHost)(tree));
52
+ return {
53
+ options: parsed.options,
54
+ chainReadable: !(0, js_1.extendsResolutionFailed)(parsed.errors) && !parsed.errors.some(isSyntaxDiagnostic),
55
+ };
56
+ };
57
+ /**
58
+ * The forward-slash form of an alias target the SDK wrote, or `undefined` when
59
+ * the target is not one. The `extend` generator builds targets with
60
+ * `path.join`, so ones created on Windows carry backslashes.
61
+ */
62
+ const sdkExtensionManifestTarget = (tree, target) => {
63
+ if (typeof target !== "string") {
64
+ return undefined;
65
+ }
66
+ const normalised = (0, devkit_1.normalizePath)(target);
67
+ const isManifest = normalised === EXTENSION_MANIFEST_FILE || normalised.endsWith(`/${EXTENSION_MANIFEST_FILE}`);
68
+ return isManifest && !(0, typescript_1.isExternalModuleNameRelative)(normalised) && tree.exists(normalised) ? normalised : undefined;
69
+ };
70
+ /** Whether any target of `paths` is an SDK extension manifest target that still lacks its `./`. */
71
+ const hasSdkAliasToRepair = (tree, paths) => Object.values(paths).some(targets => Array.isArray(targets) && targets.some(target => sdkExtensionManifestTarget(tree, target) !== undefined));
72
+ /**
73
+ * Prefixes `./` onto every SDK extension manifest target of `paths`, in place.
74
+ * The prefix never changes what an alias resolves to: with `baseUrl` set,
75
+ * targets resolve against it and `./libs/x` is the same path as `libs/x`;
76
+ * without it they resolve against the tsconfig and TypeScript 6 requires the
77
+ * `./`.
78
+ */
79
+ const prefixSdkAliases = (tree, paths) => {
80
+ for (const targets of Object.values(paths)) {
81
+ if (!Array.isArray(targets)) {
82
+ continue;
83
+ }
84
+ targets.forEach((target, index) => {
85
+ const manifestPath = sdkExtensionManifestTarget(tree, target);
86
+ if (manifestPath !== undefined) {
87
+ targets[index] = `./${manifestPath}`;
88
+ }
89
+ });
90
+ }
91
+ };
92
+ /**
93
+ * Aliases this migration leaves alone that still break a type-checked build:
94
+ * TS5090 applies to every non-relative `paths` target once no `baseUrl`
95
+ * applies, not only the SDK's. They are reported, never rewritten.
96
+ */
97
+ const remainingNonRelativeAliases = (tree, paths) => Object.entries(paths)
98
+ .filter(([, targets]) => Array.isArray(targets) &&
99
+ targets.some((target) => typeof target === "string" &&
100
+ !(0, typescript_1.isExternalModuleNameRelative)((0, devkit_1.normalizePath)(target)) &&
101
+ sdkExtensionManifestTarget(tree, target) === undefined))
102
+ .map(([alias]) => alias);
103
+ const repairPathAliasesIn = (tree, rootTsConfigPath) => {
104
+ const tsConfig = readJsonObject(tree, rootTsConfigPath);
105
+ if (tsConfig === undefined || !isRecord(tsConfig.compilerOptions) || !isRecord(tsConfig.compilerOptions.paths)) {
106
+ return;
107
+ }
108
+ const { paths } = tsConfig.compilerOptions;
109
+ // The warning is only true when no baseUrl applies, whether the file sets it or inherits it through `extends`.
110
+ // A chain that cannot be read leaves that unknown, and an unknown is not worth a possibly false warning.
111
+ const { options, chainReadable } = resolveEffectiveConfig(tree, rootTsConfigPath);
112
+ const remaining = chainReadable && options.baseUrl === undefined ? remainingNonRelativeAliases(tree, paths) : [];
113
+ if (remaining.length > 0) {
114
+ devkit_1.logger.warn(`${rootTsConfigPath} has path aliases with non-relative targets, which TypeScript rejects when no baseUrl is set (TS5090): ${remaining.join(", ")}. They were not written by the Iris App SDK, so they were left as they are; add a leading "./" to their targets if the workspace sets no baseUrl.`);
115
+ }
116
+ if (hasSdkAliasToRepair(tree, paths)) {
117
+ (0, devkit_1.updateJson)(tree, rootTsConfigPath, json => {
118
+ if (isRecord(json.compilerOptions) && isRecord(json.compilerOptions.paths)) {
119
+ prefixSdkAliases(tree, json.compilerOptions.paths);
120
+ }
121
+ return json;
122
+ });
123
+ devkit_1.logger.info(`Repaired SDK path aliases in ${rootTsConfigPath}: prefixed "./" onto extension manifest paths.`);
124
+ }
125
+ };
126
+ /**
127
+ * Prefixes `./` onto the `paths` entries of the root tsconfig that point at an
128
+ * existing project's `extension-manifest.ts`.
129
+ *
130
+ * @param tree - Nx virtual file tree.
131
+ */
132
+ const repairSdkPathAliases = (tree) => {
133
+ // Typed `string | null`, but at runtime it falls back to `tsconfig.base.json` even when neither candidate exists,
134
+ // so a path that is not there has to be checked for as well.
135
+ const rootTsConfigPath = (0, js_1.getRootTsConfigPathInTree)(tree);
136
+ if (rootTsConfigPath === null || !tree.exists(rootTsConfigPath)) {
137
+ return;
138
+ }
139
+ try {
140
+ repairPathAliasesIn(tree, rootTsConfigPath);
141
+ }
142
+ catch (error) {
143
+ devkit_1.logger.warn(`Skipped path alias repair for ${rootTsConfigPath}: ${errorMessage(error)}`);
144
+ }
145
+ };
146
+ exports.repairSdkPathAliases = repairSdkPathAliases;
147
+ const irisAppRoots = (tree) => Array.from((0, devkit_1.getProjects)(tree).values(), project => project.root).filter(root => tree.exists((0, devkit_1.joinPathFragments)(root, IRIS_APP_MANIFEST_FILE)));
148
+ const addJsxToApp = (tree, appRoot) => {
149
+ const appTsConfigPath = (0, devkit_1.joinPathFragments)(appRoot, APP_TSCONFIG_FILE);
150
+ if (!tree.isFile(appTsConfigPath)) {
151
+ devkit_1.logger.warn(`Skipped jsx repair for ${appRoot}: ${appTsConfigPath} not found.`);
152
+ return;
153
+ }
154
+ const appTsConfig = readJsonObject(tree, appTsConfigPath);
155
+ if (appTsConfig === undefined) {
156
+ devkit_1.logger.warn(`Skipped jsx repair for ${appTsConfigPath}: it is not a JSON object.`);
157
+ return;
158
+ }
159
+ if (appTsConfig.compilerOptions !== undefined && !isRecord(appTsConfig.compilerOptions)) {
160
+ devkit_1.logger.warn(`Skipped jsx repair for ${appTsConfigPath}: its compilerOptions is not an object.`);
161
+ return;
162
+ }
163
+ // Only a chain read in full can show `jsx` is missing, so an unreadable one is left alone.
164
+ const { options, chainReadable } = resolveEffectiveConfig(tree, appTsConfigPath);
165
+ if (!chainReadable || options.jsx !== undefined) {
166
+ return;
167
+ }
168
+ (0, devkit_1.updateJson)(tree, appTsConfigPath, json => ({
169
+ ...json,
170
+ compilerOptions: { ...(isRecord(json.compilerOptions) ? json.compilerOptions : {}), jsx: JSX_VALUE },
171
+ }));
172
+ devkit_1.logger.info(`Added "jsx": "${JSX_VALUE}" to ${appTsConfigPath}.`);
173
+ };
174
+ /**
175
+ * Adds `jsx: "react-jsx"` to the `tsconfig.app.json` of every Iris app (a
176
+ * project with an `iris-app-manifest.ts`) whose effective tsconfig chain
177
+ * (`tsconfig.app.json` -> `tsconfig.json` -> `tsconfig.base.json`, via
178
+ * `extends`) sets no `jsx`. An app that configures `jsx` anywhere in the chain,
179
+ * or whose chain cannot be read in full, is left alone.
180
+ *
181
+ * @param tree - Nx virtual file tree.
182
+ */
183
+ const addJsxToIrisApps = (tree) => {
184
+ for (const appRoot of irisAppRoots(tree)) {
185
+ try {
186
+ addJsxToApp(tree, appRoot);
187
+ }
188
+ catch (error) {
189
+ devkit_1.logger.warn(`Skipped jsx repair for ${appRoot}: ${errorMessage(error)}`);
190
+ }
191
+ }
192
+ };
193
+ exports.addJsxToIrisApps = addJsxToIrisApps;
194
+ /**
195
+ * Repairs tsconfig defects the SDK left in existing workspaces.
196
+ *
197
+ * @param tree - Nx virtual file tree.
198
+ */
199
+ const repairTsconfig = (tree) => {
200
+ (0, exports.repairSdkPathAliases)(tree);
201
+ (0, exports.addJsxToIrisApps)(tree);
202
+ };
203
+ exports.repairTsconfig = repairTsconfig;
204
+ exports.default = exports.repairTsconfig;
205
+ //# sourceMappingURL=repair-tsconfig.js.map