@trackunit/css-class-variance-utilities 2.0.14 → 2.0.15-alpha-55a192f4ee4.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/css/class-variance-utilities/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":"ast-utils.js","sourceRoot":"","sources":["../../../../../../libs/css/class-variance-utilities/migrations/utils/ast-utils.ts"],"names":[],"mappings":";;;;AAAA,uCAAqE;AACrE,uDAAiC;AAEjC;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAElF,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAW,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtG,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAW,EAAE,CACvD,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAE9E,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAW,EAAE,CAChD,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAE5F;;;;GAIG;AACI,MAAM,YAAY,GAAG,CAC1B,IAAU,EACV,MAAc,EACd,QAA0E,EAClE,EAAE;IACV,IAAI,OAAO,GAAG,CAAC,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,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,UAAU,cAcrB","sourcesContent":["import { logger, type Tree, visitNotIgnoredFiles } from \"@nx/devkit\";\nimport * as ts from \"typescript\";\n\n/**\n * Migrations are compiled per package (`tsconfig.migrations.json` sets `rootDir: \".\"`),\n * so these helpers deliberately mirror `libs/react/components/migrations/utils/jsx-utils.ts`\n * rather than importing it across package boundaries.\n */\n\n/**\n * Plain JavaScript is included because consumer repos running these migrations\n * aren't all TypeScript, and a skipped file is a silent miss rather than a flag.\n */\nconst SOURCE_EXTENSIONS = [\".ts\", \".tsx\", \".js\", \".jsx\", \".mjs\", \".cjs\"] as const;\n\nconst isTsFile = (filePath: string): boolean => SOURCE_EXTENSIONS.some(ext => filePath.endsWith(ext));\n\nconst isUnderNodeModules = (filePath: string): boolean =>\n filePath.includes(\"/node_modules/\") || filePath.startsWith(\"node_modules/\");\n\nconst isUnderDist = (filePath: string): boolean =>\n filePath.includes(\"/dist/\") || filePath.startsWith(\"dist/\") || filePath.includes(\"/.nx/\");\n\n/**\n * Visits every TypeScript file under the workspace root and invokes the callback\n * with the file path and its contents. Files not containing the marker substring\n * are skipped, which keeps a ~30k-file workspace cheap to scan.\n */\nexport const visitTsFiles = (\n tree: Tree,\n marker: string,\n callback: (filePath: string, content: string) => string | null | undefined\n): number => {\n let touched = 0;\n visitNotIgnoredFiles(tree, \"/\", filePath => {\n if (!isTsFile(filePath)) return;\n if (isUnderNodeModules(filePath) || isUnderDist(filePath)) return;\n const content = tree.read(filePath, \"utf-8\");\n if (content === null) return;\n if (!content.includes(marker)) return;\n const updated = callback(filePath, content);\n if (updated !== null && updated !== undefined && updated !== content) {\n tree.write(filePath, updated);\n touched += 1;\n }\n });\n return touched;\n};\n\n/**\n * `.tsx`/`.jsx` need `ScriptKind.TSX` so JSX is recognised; anything else needs a\n * non-JSX kind, because TSX reinterprets angle brackets. A `.ts` file containing\n * `<TValue>(value: TValue) => …` (a generic arrow) or `<Foo>expr` (an old-style\n * assertion) parses as JSX under TSX instead, which silently produces zero call\n * sites rather than the file this codemod is meant to see.\n */\nconst scriptKindOf = (fileName: string): ts.ScriptKind => {\n if (fileName.endsWith(\".tsx\") || fileName.endsWith(\".jsx\")) return ts.ScriptKind.TSX;\n if (fileName.endsWith(\".js\") || fileName.endsWith(\".mjs\") || fileName.endsWith(\".cjs\")) return ts.ScriptKind.JS;\n return ts.ScriptKind.TS;\n};\n\n/**\n * Parses `content` for its extension's grammar. `setParentNodes` is on because the\n * codemod relies on `getStart(sourceFile)` for text-range edits.\n */\nexport const parseTs = (content: string, fileName = \"file.ts\"): ts.SourceFile =>\n ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true, scriptKindOf(fileName));\n\n/**\n * True when `content` does not parse cleanly as its extension's grammar. Checked\n * through the public `transpileModule` API -- syntactic diagnostics only, no\n * type-checking -- so a file this codemod cannot safely analyse is flagged instead\n * of silently skipped or, worse, misread as some other file type's grammar.\n */\nexport const hasSyntaxErrors = (content: string, fileName: string): boolean => {\n const { diagnostics } = ts.transpileModule(content, {\n fileName,\n reportDiagnostics: true,\n compilerOptions: { jsx: ts.JsxEmit.ReactJSX },\n });\n return (diagnostics ?? []).length > 0;\n};\n\nexport type TextEdit = {\n readonly start: number;\n readonly end: number;\n readonly text: string;\n};\n\n/**\n * Applies edits back onto the original source text, highest offset first so\n * earlier offsets stay valid. Rewriting text ranges rather than re-printing the\n * AST is what preserves comments and formatting outside the edited spans.\n *\n * Overlapping edits are rejected rather than applied: because every replacement is\n * built by slicing the *original* text, applying two edits over the same range\n * corrupts the file silently. A codemod that crashes is recoverable; one that\n * quietly emits broken source is not.\n */\nexport const applyEdits = (content: string, edits: ReadonlyArray<TextEdit>): string => {\n const ordered = [...edits].sort((a, b) => b.start - a.start);\n\n for (const [index, edit] of ordered.entries()) {\n const next = ordered[index + 1];\n if (next !== undefined && next.end > edit.start) {\n throw new Error(\n `applyEdits received overlapping edits: [${next.start}, ${next.end}) overlaps [${edit.start}, ${edit.end})`\n );\n }\n }\n\n let updated = content;\n for (const { start, end, text } of ordered) {\n updated = updated.slice(0, start) + text + updated.slice(end);\n }\n return updated;\n};\n\n/** A call site the codemod declined to rewrite, reported for manual follow-up. */\nexport type FlaggedSite = {\n readonly filePath: string;\n /** 1-based, matching editor and `file:line` conventions. */\n readonly line: number;\n readonly reason: string;\n readonly snippet: string;\n};\n\n/** Resolves a node offset to a 1-based line number. */\nexport const lineOf = (sourceFile: ts.SourceFile, position: number): number =>\n sourceFile.getLineAndCharacterOfPosition(position).line + 1;\n\n/**\n * Logs a one-line summary plus, when present, every flagged call site with a\n * resolvable `file:line` so a developer can work through them by hand.\n */\nexport const logSummary = (migrationName: string, touched: number, flagged: ReadonlyArray<FlaggedSite>): void => {\n if (touched === 0) {\n logger.info(` ${migrationName}: no files changed`);\n } else {\n logger.info(` ${migrationName}: updated ${touched} file(s)`);\n }\n\n if (flagged.length === 0) return;\n\n logger.warn(` ${migrationName}: ${flagged.length} call site(s) need manual migration:`);\n for (const site of flagged) {\n logger.warn(` ${site.filePath}:${site.line} — ${site.reason}`);\n logger.warn(` ${site.snippet}`);\n }\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cva-merge-to-cva.js","sourceRoot":"","sources":["../../../../../../libs/css/class-variance-utilities/migrations/v2-0-0/cva-merge-to-cva.ts"],"names":[],"mappings":";;;;AACA,uDAAiC;AACjC,kDAS4B;AAE5B,MAAM,cAAc,GAAG,yBAAyB,CAAC;AACjD,MAAM,MAAM,GAAG,yCAAyC,CAAC;AACzD,MAAM,aAAa,GAAG,UAAU,CAAC;AACjC,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAiB/B,MAAM,eAAe,GAAG,CAAC,UAAyB,EAAe,EAAE;IACjE,IAAI,eAAe,GAA8B,IAAI,CAAC;IACtD,IAAI,aAAa,GAAG,KAAK,CAAC;I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;AATW,QAAA,mBAAmB,uBAS9B;AAEF;;;;;;;;;GASG;AACI,MAAM,aAAa,GAAG,CAAC,IAAU,EAAQ,EAAE;IAChD,MAAM,OAAO,GAAuB,EAAE,CAAC;IAEvC,MAAM,OAAO,GAAG,IAAA,wBAAY,EAAC,IAAI,EAAE,aAAa,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE;QACtE,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,IAAA,sBAAU,EAAC,cAAc,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC,CAAC;AAVW,QAAA,aAAa,iBAUxB;AAEF,kBAAe,qBAAa,CAAC","sourcesContent":["import { type Tree } from \"@nx/devkit\";\nimport * as ts from \"typescript\";\nimport {\n applyEdits,\n type FlaggedSite,\n hasSyntaxErrors,\n lineOf,\n logSummary,\n parseTs,\n type TextEdit,\n visitTsFiles,\n} from \"../utils/ast-utils\";\n\nconst MIGRATION_NAME = \"v2-0-0-cva-merge-to-cva\";\nconst MODULE = \"@trackunit/css-class-variance-utilities\";\nconst LEGACY_EXPORT = \"cvaMerge\";\nconst NEXT_EXPORT = \"cva\";\n\nconst MAX_SNIPPET_LENGTH = 100;\n\ntype UnsupportedShape = {\n readonly reason: string;\n readonly node: ts.Node;\n};\n\ntype ImportUsage = {\n /** The `cvaMerge` specifier node, when imported under its own name. */\n readonly legacySpecifier: ts.ImportSpecifier | null;\n /** True when `cva` is already imported from the same module. */\n readonly hasNextExport: boolean;\n readonly namedImports: ts.NamedImports | null;\n /** An import or re-export whose call sites can't be mapped back to the import. */\n readonly unsupportedShape: UnsupportedShape | null;\n};\n\nconst findImportUsage = (sourceFile: ts.SourceFile): ImportUsage => {\n let legacySpecifier: ts.ImportSpecifier | null = null;\n let hasNextExport = false;\n let namedImports: ts.NamedImports | null = null;\n let unsupportedShape: UnsupportedShape | null = null;\n\n const isOwnModule = (moduleSpecifier: ts.Expression | undefined): boolean =>\n moduleSpecifier !== undefined && ts.isStringLiteral(moduleSpecifier) && moduleSpecifier.text === MODULE;\n\n for (const statement of sourceFile.statements) {\n // `export { cvaMerge } from \"…\"` re-publishes the old name, so rewriting the\n // re-export would break whoever imports it from here.\n if (ts.isExportDeclaration(statement) && isOwnModule(statement.moduleSpecifier)) {\n const clause = statement.exportClause;\n if (\n clause !== undefined &&\n ts.isNamedExports(clause) &&\n clause.elements.some(element => (element.propertyName?.text ?? element.name.text) === LEGACY_EXPORT)\n ) {\n unsupportedShape ??= {\n reason: `${LEGACY_EXPORT} is re-exported from this file, so removing it would break importers`,\n node: statement,\n };\n }\n continue;\n }\n\n if (!ts.isImportDeclaration(statement)) continue;\n if (!isOwnModule(statement.moduleSpecifier)) continue;\n\n const bindings = statement.importClause?.namedBindings;\n if (bindings === undefined) continue;\n\n // `import * as utils` then `utils.cvaMerge(...)` — the call sites are property\n // accesses, which this codemod doesn't rewrite.\n if (ts.isNamespaceImport(bindings)) {\n unsupportedShape ??= {\n reason: `${MODULE} is imported as a namespace, so ${LEGACY_EXPORT} call sites were left untouched`,\n node: statement,\n };\n continue;\n }\n\n if (!ts.isNamedImports(bindings)) continue;\n\n for (const element of bindings.elements) {\n const importedName = element.propertyName?.text ?? element.name.text;\n if (importedName === LEGACY_EXPORT) {\n namedImports = bindings;\n if (element.propertyName !== undefined) {\n // `cvaMerge as somethingElse` — call sites don't spell `cvaMerge`, so\n // rewriting them safely would mean tracking the alias everywhere.\n unsupportedShape ??= {\n reason: `${LEGACY_EXPORT} is imported under an alias, so its call sites were left untouched`,\n node: element,\n };\n } else {\n legacySpecifier = element;\n }\n }\n if (importedName === NEXT_EXPORT && element.propertyName === undefined) {\n hasNextExport = true;\n }\n }\n }\n\n return { legacySpecifier, hasNextExport, namedImports, unsupportedShape };\n};\n\nconst findLegacyCalls = (sourceFile: ts.SourceFile): ReadonlyArray<ts.CallExpression> => {\n const calls: Array<ts.CallExpression> = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isCallExpression(node) && ts.isIdentifier(node.expression) && node.expression.text === LEGACY_EXPORT) {\n calls.push(node);\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return calls;\n};\n\n/**\n * Every use of the bare identifier, excluding the import specifier that declares it\n * and `x.cvaMerge` property accesses that resolve elsewhere. Used to decide whether\n * retiring the import would leave a dangling reference behind.\n */\nconst findIdentifierReferences = (sourceFile: ts.SourceFile, name: string): ReadonlyArray<ts.Identifier> => {\n const references: Array<ts.Identifier> = [];\n\n const visit = (node: ts.Node): void => {\n if (ts.isIdentifier(node) && node.text === name) {\n const { parent } = node;\n const declaresTheBinding = ts.isImportSpecifier(parent);\n const isMemberName = ts.isPropertyAccessExpression(parent) && parent.name === node;\n if (!declaresTheBinding && !isMemberName) {\n references.push(node);\n }\n }\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return references;\n};\n\n/**\n * True when a binding name -- a plain identifier, or a (possibly nested)\n * destructuring pattern -- binds `name` anywhere inside it. `const { cva } = registry`\n * is idiomatic in this package's own `src/cva.ts` (`export const { cva, cx } =\n * defineConfig(...)`), so a plain `ts.isIdentifier` check on the top-level name misses\n * exactly the shape most likely to appear here.\n */\nconst bindingNameBinds = (bindingName: ts.BindingName, name: string): boolean => {\n if (ts.isIdentifier(bindingName)) {\n return bindingName.text === name;\n }\n\n return bindingName.elements.some(\n element => !ts.isOmittedExpression(element) && bindingNameBinds(element.name, name)\n );\n};\n\n/** True when the file declares `name` itself, which would shadow or collide with an import. */\nconst declaresNameLocally = (sourceFile: ts.SourceFile, name: string): ts.Node | null => {\n let found: ts.Node | null = null;\n\n const visit = (node: ts.Node): void => {\n if (found !== null) return;\n\n if ((ts.isVariableDeclaration(node) || ts.isParameter(node)) && bindingNameBinds(node.name, name)) {\n found = node;\n return;\n }\n\n const isSimpleNamedDeclaration =\n ts.isFunctionDeclaration(node) ||\n ts.isClassDeclaration(node) ||\n ts.isTypeAliasDeclaration(node) ||\n ts.isInterfaceDeclaration(node) ||\n ts.isEnumDeclaration(node);\n if (isSimpleNamedDeclaration && node.name !== undefined && node.name.text === name) {\n found = node;\n return;\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n return found;\n};\n\n/**\n * Any binding of `name` other than the already-tracked unaliased `cva` import from\n * this library (`hasNextExport`, checked by the caller before this runs).\n *\n * Every import declaration is scanned, including ones from this library: an aliased\n * import such as `import { twMerge as cva, cvaMerge } from MODULE` binds `cva` just as\n * much as one from any other module does, and skipping this library's own imports\n * wholesale used to let exactly that alias through unnoticed.\n */\nconst bindsForeignName = (sourceFile: ts.SourceFile, name: string): ts.Node | null => {\n for (const statement of sourceFile.statements) {\n if (!ts.isImportDeclaration(statement)) continue;\n\n const clause = statement.importClause;\n if (clause === undefined) continue;\n if (clause.name?.text === name) return statement;\n\n const bindings = clause.namedBindings;\n if (bindings === undefined) continue;\n if (ts.isNamespaceImport(bindings)) {\n if (bindings.name.text === name) return statement;\n continue;\n }\n if (bindings.elements.some(element => element.name.text === name)) return statement;\n }\n\n return declaresNameLocally(sourceFile, name);\n};\n\n/**\n * A base argument is safe to relocate when it is a literal we can move verbatim.\n * Array literals qualify regardless of what their elements are — spreads and call\n * expressions inside are moved along with the literal, never interpreted.\n */\nconst isRelocatableBase = (node: ts.Expression): boolean =>\n ts.isArrayLiteralExpression(node) || ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node);\n\nconst isRelocatableConfig = (node: ts.Expression | undefined): boolean => {\n if (node === undefined) return true;\n if (!ts.isObjectLiteralExpression(node)) return false;\n // A spread could itself carry a `base` key, which would then race with the\n // `base` we are introducing. Not worth guessing at.\n return !node.properties.some(property => ts.isSpreadAssignment(property));\n};\n\n/**\n * The replacement re-emits the arguments but not the punctuation between them, so\n * a comment living in that punctuation would be dropped silently.\n */\nconst hasCommentOutsideArguments = (content: string, sourceFile: ts.SourceFile, call: ts.CallExpression): boolean => {\n const [base, config] = call.arguments;\n if (base === undefined) return false;\n\n const carriesComment = (from: number, to: number): boolean => {\n const between = content.slice(from, to);\n return between.includes(\"//\") || between.includes(\"/*\");\n };\n\n // Covers the callee → `(` → base span too: `buildReplacement` re-emits only\n // `baseText` and the config interior, so a comment anywhere else in the call\n // -- including here -- would otherwise disappear silently.\n if (carriesComment(call.getStart(sourceFile), base.getStart(sourceFile))) return true;\n\n if (config === undefined) return carriesComment(base.getEnd(), call.getEnd());\n\n return carriesComment(base.getEnd(), config.getStart(sourceFile)) || carriesComment(config.getEnd(), call.getEnd());\n};\n\n/**\n * Two legacy calls where one encloses the other would produce overlapping edits,\n * because each replacement is built by slicing the *original* text.\n */\nconst findOverlappingCalls = (\n calls: ReadonlyArray<ts.CallExpression>,\n sourceFile: ts.SourceFile\n): ReadonlySet<ts.CallExpression> => {\n const overlapping = new Set<ts.CallExpression>();\n\n for (const outer of calls) {\n for (const inner of calls) {\n if (outer === inner) continue;\n if (outer.getStart(sourceFile) <= inner.getStart(sourceFile) && outer.getEnd() >= inner.getEnd()) {\n overlapping.add(outer);\n overlapping.add(inner);\n }\n }\n }\n\n return overlapping;\n};\n\n/** Why a call site was left for a human, phrased for the migration report. */\nconst rejectionReason = (\n content: string,\n sourceFile: ts.SourceFile,\n call: ts.CallExpression,\n overlapping: ReadonlySet<ts.CallExpression>\n): string | null => {\n if (overlapping.has(call)) {\n return `nested ${LEGACY_EXPORT} calls cannot be rewritten as one edit; migrate the innermost call by hand first`;\n }\n\n if (call.arguments.length > 2) {\n return `unexpected argument count (${call.arguments.length}); ${LEGACY_EXPORT} takes at most 2`;\n }\n\n const [base, config] = call.arguments;\n\n if (base !== undefined && !isRelocatableBase(base)) {\n return \"base is not an array or string literal, so it cannot be folded into `base:` automatically\";\n }\n\n if (config !== undefined && !isRelocatableConfig(config)) {\n return ts.isObjectLiteralExpression(config)\n ? \"config object uses a spread, which may itself define `base`\"\n : \"config is not an object literal, so its properties cannot be merged into the new config\";\n }\n\n if (hasCommentOutsideArguments(content, sourceFile, call)) {\n return \"a comment sits between the arguments, which the rewrite would discard\";\n }\n\n return null;\n};\n\nconst buildReplacement = (content: string, sourceFile: ts.SourceFile, call: ts.CallExpression): string => {\n const [base, config] = call.arguments;\n\n if (base === undefined) return `${NEXT_EXPORT}({})`;\n\n const baseText = content.slice(base.getStart(sourceFile), base.getEnd());\n\n let inner = \"\";\n if (config !== undefined) {\n // Slice between the braces so interior comments and formatting survive.\n inner = content.slice(config.getStart(sourceFile) + 1, config.getEnd() - 1).trim();\n }\n\n if (inner === \"\") return `${NEXT_EXPORT}({ base: ${baseText} })`;\n\n // The closing brace goes on its own line: the sliced interior can end in a `//`\n // comment, which would otherwise swallow it. Prettier reflows short configs back\n // onto one line afterwards.\n return `${NEXT_EXPORT}({\\n base: ${baseText},\\n ${inner}\\n})`;\n};\n\nconst COMMENT = /\\/\\*[\\s\\S]*?\\*\\/|\\/\\/[^\\n]*/;\n\n/**\n * Removes a named import specifier along with the comma that joins it to its\n * neighbour, so `{ cva, cvaMerge }` becomes `{ cva }` rather than `{ cva, }`.\n *\n * When a comment lives in that joining span, the comma is left in place instead —\n * a trailing comma in a named import list is legal, and keeping it is what lets the\n * comment survive.\n */\nconst buildSpecifierRemoval = (\n content: string,\n sourceFile: ts.SourceFile,\n namedImports: ts.NamedImports,\n specifier: ts.ImportSpecifier\n): TextEdit => {\n const elements = namedImports.elements;\n\n if (elements.length === 1) {\n // Emptying the list would leave `import {} from \"…\";` behind.\n const declaration = namedImports.parent.parent;\n return { start: declaration.getStart(sourceFile), end: declaration.getEnd(), text: \"\" };\n }\n\n const index = elements.indexOf(specifier);\n const previous = index > 0 ? elements[index - 1] : undefined;\n const next = elements[index + 1];\n\n const start = previous === undefined ? specifier.getStart(sourceFile) : previous.getEnd();\n const end = previous === undefined && next !== undefined ? next.getStart(sourceFile) : specifier.getEnd();\n\n if (COMMENT.test(content.slice(start, end))) {\n return { start: specifier.getStart(sourceFile), end: specifier.getEnd(), text: \"\" };\n }\n\n return { start, end, text: \"\" };\n};\n\ntype FileAnalysis = {\n readonly updated: string | null;\n readonly flagged: ReadonlyArray<FlaggedSite>;\n};\n\nconst analyzeFile = (filePath: string, content: string): FileAnalysis => {\n // Checked before parsing for this codemod's own purposes: a file that doesn't\n // parse cleanly can't be trusted to report an accurate call-site list, so it's\n // flagged instead of silently analysed with whatever the parser recovered.\n if (hasSyntaxErrors(content, filePath)) {\n return { updated: null, flagged: [{ filePath, line: 1, reason: \"file does not parse cleanly\", snippet: \"\" }] };\n }\n\n const sourceFile = parseTs(content, filePath);\n const { legacySpecifier, hasNextExport, namedImports, unsupportedShape } = findImportUsage(sourceFile);\n\n const snippetOf = (node: ts.Node): string => {\n const text = content.slice(node.getStart(sourceFile), node.getEnd()).replace(/\\s+/g, \" \");\n return text.length > MAX_SNIPPET_LENGTH ? `${text.slice(0, MAX_SNIPPET_LENGTH)}…` : text;\n };\n\n const bail = (node: ts.Node, reason: string): FileAnalysis => ({\n updated: null,\n flagged: [{ filePath, line: lineOf(sourceFile, node.getStart(sourceFile)), reason, snippet: snippetOf(node) }],\n });\n\n if (unsupportedShape !== null) {\n return bail(unsupportedShape.node, unsupportedShape.reason);\n }\n\n // Not imported from our module — a same-named local helper, or an unrelated file.\n if (legacySpecifier === null || namedImports === null) {\n return { updated: null, flagged: [] };\n }\n\n // A local `cvaMerge` shadows the import inside its scope, so a bare `cvaMerge(...)`\n // may not be this library's function at all. Rewriting it would change behaviour\n // without a compile error to catch it.\n const shadow = declaresNameLocally(sourceFile, LEGACY_EXPORT);\n if (shadow !== null) {\n return bail(shadow, `this file also declares its own ${LEGACY_EXPORT}, so call sites are ambiguous`);\n }\n\n // Introducing `cva` on top of an existing `cva` binding is a duplicate identifier\n // in TypeScript and a silent shadow in plain JavaScript.\n if (!hasNextExport) {\n const collision = bindsForeignName(sourceFile, NEXT_EXPORT);\n if (collision !== null) {\n return bail(collision, `the name ${NEXT_EXPORT} is already bound in this file, so the import cannot be renamed`);\n }\n }\n\n const calls = findLegacyCalls(sourceFile);\n const overlapping = findOverlappingCalls(calls, sourceFile);\n\n const edits: Array<TextEdit> = [];\n const flagged: Array<FlaggedSite> = [];\n /** Offsets of the callee identifiers this run consumed, keyed by position. */\n const rewrittenCallees = new Set<number>();\n\n for (const call of calls) {\n const reason = rejectionReason(content, sourceFile, call, overlapping);\n\n if (reason !== null) {\n flagged.push({\n filePath,\n line: lineOf(sourceFile, call.getStart(sourceFile)),\n reason,\n snippet: snippetOf(call),\n });\n continue;\n }\n\n edits.push({\n start: call.getStart(sourceFile),\n end: call.getEnd(),\n text: buildReplacement(content, sourceFile, call),\n });\n rewrittenCallees.add(call.expression.getStart(sourceFile));\n }\n\n if (rewrittenCallees.size === 0) {\n return { updated: null, flagged };\n }\n\n // The import can only be retired once *every* reference is gone, not just every\n // call: `export { cvaMerge }` and `typeof cvaMerge` keep needing the binding.\n const leftoverReferences = findIdentifierReferences(sourceFile, LEGACY_EXPORT).filter(\n reference => !rewrittenCallees.has(reference.getStart(sourceFile))\n );\n\n for (const reference of leftoverReferences) {\n if (ts.isCallExpression(reference.parent) && reference.parent.expression === reference) continue;\n flagged.push({\n filePath,\n line: lineOf(sourceFile, reference.getStart(sourceFile)),\n reason: `${LEGACY_EXPORT} is used here without being called, so the import was kept`,\n snippet: snippetOf(reference.parent),\n });\n }\n\n if (leftoverReferences.length === 0) {\n edits.push(\n hasNextExport\n ? buildSpecifierRemoval(content, sourceFile, namedImports, legacySpecifier)\n : {\n start: legacySpecifier.getStart(sourceFile),\n end: legacySpecifier.getEnd(),\n text: NEXT_EXPORT,\n }\n );\n } else if (!hasNextExport) {\n edits.push({\n start: legacySpecifier.getStart(sourceFile),\n end: legacySpecifier.getStart(sourceFile),\n text: `${NEXT_EXPORT}, `,\n });\n }\n\n return { updated: applyEdits(content, edits), flagged };\n};\n\n/**\n * Reports every `cvaMerge` call site the codemod would decline to rewrite,\n * without modifying the tree. Exported so the bulk cutover can preview the\n * manual work before committing to a run.\n */\nexport const collectFlaggedSites = (tree: Tree): ReadonlyArray<FlaggedSite> => {\n const flagged: Array<FlaggedSite> = [];\n\n visitTsFiles(tree, LEGACY_EXPORT, (filePath, content) => {\n flagged.push(...analyzeFile(filePath, content).flagged);\n return null;\n });\n\n return flagged;\n};\n\n/**\n * Rewrites `cvaMerge(base, config)` call sites to cva 1.0's `cva({ base, ...config })`\n * shape and updates the corresponding imports.\n *\n * Call sites that cannot be rewritten with confidence are left exactly as they are\n * and reported instead. A missed rewrite costs one manual edit; a wrong rewrite\n * silently changes rendered classnames, which the upgrade explicitly forbids.\n *\n * Running twice is a no-op: migrated code calls `cva`, which this codemod ignores.\n */\nexport const cvaMergeToCva = (tree: Tree): void => {\n const flagged: Array<FlaggedSite> = [];\n\n const touched = visitTsFiles(tree, LEGACY_EXPORT, (filePath, content) => {\n const analysis = analyzeFile(filePath, content);\n flagged.push(...analysis.flagged);\n return analysis.updated;\n });\n\n logSummary(MIGRATION_NAME, touched, flagged);\n};\n\nexport default cvaMergeToCva;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/css-class-variance-utilities",
3
- "version": "2.0.14",
3
+ "version": "2.0.15-alpha-55a192f4ee4.0",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {