openapi-typesafe-migrate 0.0.0 → 1.0.0-rc.1

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":"main.mjs","sources":["../../src/adapters/json-lines-logger/json-lines-logger.ts","../../src/adapters/node-project-files/node-project-files.ts","../../src/domain/migration-findings.ts","../../src/adapters/typescript-parser/file-names.ts","../../src/adapters/typescript-parser/factory-type-text.ts","../../src/adapters/typescript-parser/transform-returns.ts","../../src/adapters/typescript-parser/rewriter.ts","../../src/domain/package-names.ts","../../src/domain/command-migration.ts","../../src/domain/override-targets.ts","../../src/domain/version-spec.ts","../../src/domain/manifest-migration.ts","../../src/domain/source-migration.ts","../../src/domain/workspace-catalog-migration.ts","../../src/application/file-migrations.ts","../../src/application/migrate-project.ts","../../src/domain/assert-never.ts","../../src/application/messages.ts","../../src/application/report.ts","../../src/cli/cli-arguments.ts","../../src/cli/cli-text.ts","../../src/cli/run-cli.ts","../../src/cli/main.ts"],"sourcesContent":["import { appendFileSync, mkdirSync } from \"node:fs\";\nimport { dirname } from \"node:path\";\nimport type { Logger } from \"../../application/ports.js\";\n\n/** The log file and the clock of the timestamps. */\nexport interface JsonLinesLoggerOptions {\n readonly path: string;\n readonly now: () => Date;\n}\n\ntype Level = \"info\" | \"warn\";\n\n/**\n * The Logger port as a JSON Lines file: one object per event with a UTC timestamp, the level and\n * the event's fields. Lines are appended synchronously, so the log is complete when the command\n * fails half way.\n */\nclass JsonLinesLogger implements Logger {\n readonly #options: JsonLinesLoggerOptions;\n\n constructor(options: JsonLinesLoggerOptions) {\n this.#options = options;\n mkdirSync(dirname(options.path), { recursive: true });\n }\n\n info(event: string, fields: Readonly<Record<string, unknown>> = {}): void {\n this.#append(\"info\", event, fields);\n }\n\n warn(event: string, fields: Readonly<Record<string, unknown>> = {}): void {\n this.#append(\"warn\", event, fields);\n }\n\n #append(level: Level, event: string, fields: Readonly<Record<string, unknown>>): void {\n const time = this.#options.now().toISOString();\n appendFileSync(this.#options.path, `${JSON.stringify({ time, level, event, ...fields })}\\n`);\n }\n}\n\n/** A logger that appends to the JSON Lines file at `options.path`, creating its directory. */\nexport function createJsonLinesLogger(options: JsonLinesLoggerOptions): Logger {\n return new JsonLinesLogger(options);\n}\n","import type { Dirent } from \"node:fs\";\nimport { readdir, readFile, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport type { ProjectFiles } from \"../../application/ports.js\";\n\n/**\n * Installed packages, git metadata, build output and the output folders of frameworks and test\n * tools are not the project's own files: rewriting them only adds noise to the dry run and the\n * diff.\n * `build` and `out` stay in, because some projects keep sources there. Links are not followed, so a\n * linked workspace package is migrated in its own project, not twice.\n */\nconst SKIPPED_DIRECTORIES: ReadonlySet<string> = new Set([\n \"node_modules\",\n \".git\",\n \"dist\",\n \".next\",\n \".nuxt\",\n \".output\",\n \".svelte-kit\",\n \".turbo\",\n \"coverage\",\n]);\n\nasync function listTree(root: string, relative: string): Promise<string[]> {\n const entries: Dirent[] = await readdir(join(root, relative), { withFileTypes: true });\n const nested = await Promise.all(\n entries.map((entry) => {\n const path = relative === \"\" ? entry.name : `${relative}/${entry.name}`;\n if (entry.isDirectory()) {\n return SKIPPED_DIRECTORIES.has(entry.name) ? [] : listTree(root, path);\n }\n return entry.isFile() ? [path] : [];\n }),\n );\n return nested.flat();\n}\n\nclass NodeProjectFiles implements ProjectFiles {\n readonly #root: string;\n\n constructor(root: string) {\n this.#root = root;\n }\n\n listFiles(): Promise<string[]> {\n return listTree(this.#root, \"\");\n }\n\n read(path: string): Promise<string> {\n return readFile(join(this.#root, path), \"utf8\");\n }\n\n write(path: string, text: string): Promise<void> {\n return writeFile(join(this.#root, path), text, \"utf8\");\n }\n}\n\n/** The files of the project in the directory `root`, by `/`-separated relative paths. */\nexport function createNodeProjectFiles(root: string): ProjectFiles {\n return new NodeProjectFiles(root);\n}\n","/**\n * What a migration found in one file: changes it made, and steps it leaves to the user. Both are\n * closed sets of facts, not text; the report turns them into messages (application/report.ts).\n */\n\nexport type Change =\n | {\n readonly kind: \"dependency-renamed\";\n readonly field: string;\n readonly from: string;\n readonly to: string;\n readonly spec: string;\n }\n | { readonly kind: \"catalog-entry-renamed\"; readonly from: string; readonly to: string }\n | { readonly kind: \"command-renamed\"; readonly location: string }\n | {\n readonly kind: \"flag-renamed\";\n readonly location: string;\n readonly from: string;\n readonly to: string;\n }\n | {\n readonly kind: \"specifier-renamed\";\n readonly line: number;\n readonly from: string;\n readonly to: string;\n }\n | { readonly kind: \"transform-rewritten\"; readonly line: number };\n\nexport type ManualStep =\n | { readonly kind: \"manifest-unreadable\"; readonly reason: string }\n | { readonly kind: \"peer-dependency-renamed\"; readonly name: string }\n | { readonly kind: \"spec-kept\"; readonly name: string; readonly spec: string }\n | { readonly kind: \"override-names-package\"; readonly field: string; readonly name: string }\n | { readonly kind: \"versioned-command\"; readonly location: string }\n | { readonly kind: \"deep-import\"; readonly line: number; readonly specifier: string }\n | {\n readonly kind: \"transform-not-rewritten\";\n readonly line: number;\n readonly reason: TransformKeepReason;\n }\n | { readonly kind: \"legacy-callback\"; readonly line: number; readonly callback: string };\n\n/** Why a `transform` callback was left as it is. */\nexport type TransformKeepReason =\n | \"other-callbacks\"\n | \"not-a-function\"\n | \"shared-function\"\n | \"unknown-return\";\n\n/** A file's new text and what was found in it. Unchanged text means nothing to write. */\nexport interface FileMigration {\n readonly text: string;\n readonly changes: readonly Change[];\n readonly manualSteps: readonly ManualStep[];\n}\n\n/** The result for a file that the migration does not touch. */\nexport function unchanged(text: string): FileMigration {\n return { text, changes: [], manualSteps: [] };\n}\n\n/** Line number (1-based) of a character offset. */\nexport function lineAt(text: string, offset: number): number {\n let line = 1;\n for (let index = text.indexOf(\"\\n\"); index !== -1 && index < offset; ) {\n line++;\n index = text.indexOf(\"\\n\", index + 1);\n }\n return line;\n}\n","import ts from \"@typescript/typescript6\";\nimport type { FactoryNames } from \"./factory-type-text.js\";\n\n/** What the rewriter needs to know about a file's imports and module-level constants. */\nexport interface FileNames extends FactoryNames {\n /** Local names of the generator's default export (`openapiTS` in `import openapiTS from …`). */\n readonly generatorFunctions: ReadonlySet<string>;\n /** Module-level function declarations, and `const` bindings of function expressions, by name. */\n readonly functions: ReadonlyMap<string, ts.FunctionLikeDeclaration>;\n}\n\n/** The generator after the specifier rename, and before it, for files the rename skipped. */\nconst GENERATOR_MODULES: ReadonlySet<string> = new Set([\"openapi-typesafe\", \"openapi-typescript\"]);\nconst TYPESCRIPT_MODULES: ReadonlySet<string> = new Set([\"typescript\", \"@typescript/typescript6\"]);\n\ninterface MutableNames {\n readonly typescriptModules: Set<string>;\n readonly typescriptImports: Map<string, string>;\n readonly helperImports: Map<string, string>;\n readonly constants: Map<string, ts.Expression>;\n readonly generatorFunctions: Set<string>;\n readonly functions: Map<string, ts.FunctionLikeDeclaration>;\n}\n\nfunction namedImports(clause: ts.ImportClause, into: Map<string, string>): void {\n const bindings = clause.namedBindings;\n if (bindings === undefined || !ts.isNamedImports(bindings)) {\n return;\n }\n for (const element of bindings.elements) {\n into.set(element.name.text, (element.propertyName ?? element.name).text);\n }\n}\n\nfunction addTypescriptImport(clause: ts.ImportClause, names: MutableNames): void {\n if (clause.name !== undefined) {\n names.typescriptModules.add(clause.name.text);\n }\n const bindings = clause.namedBindings;\n if (bindings !== undefined && ts.isNamespaceImport(bindings)) {\n names.typescriptModules.add(bindings.name.text);\n }\n namedImports(clause, names.typescriptImports);\n}\n\nfunction addGeneratorImport(clause: ts.ImportClause, names: MutableNames): void {\n if (clause.name !== undefined) {\n names.generatorFunctions.add(clause.name.text);\n }\n namedImports(clause, names.helperImports);\n}\n\nfunction addImport(statement: ts.ImportDeclaration, names: MutableNames): void {\n const clause = statement.importClause;\n if (clause === undefined || !ts.isStringLiteral(statement.moduleSpecifier)) {\n return;\n }\n const specifier = statement.moduleSpecifier.text;\n if (TYPESCRIPT_MODULES.has(specifier)) {\n addTypescriptImport(clause, names);\n } else if (GENERATOR_MODULES.has(specifier)) {\n addGeneratorImport(clause, names);\n }\n}\n\nfunction addConstants(statement: ts.VariableStatement, names: MutableNames): void {\n if ((statement.declarationList.flags & ts.NodeFlags.Const) === 0) {\n return;\n }\n for (const declaration of statement.declarationList.declarations) {\n const initializer = declaration.initializer;\n if (!ts.isIdentifier(declaration.name) || initializer === undefined) {\n continue;\n }\n names.constants.set(declaration.name.text, initializer);\n if (ts.isArrowFunction(initializer) || ts.isFunctionExpression(initializer)) {\n names.functions.set(declaration.name.text, initializer);\n }\n }\n}\n\n/** The imports and module-level `const` declarations of a source file. */\nexport function collectFileNames(file: ts.SourceFile): FileNames {\n const names: MutableNames = {\n typescriptModules: new Set(),\n typescriptImports: new Map(),\n helperImports: new Map(),\n constants: new Map(),\n generatorFunctions: new Set(),\n functions: new Map(),\n };\n for (const statement of file.statements) {\n if (ts.isImportDeclaration(statement)) {\n addImport(statement, names);\n } else if (ts.isVariableStatement(statement)) {\n addConstants(statement, names);\n } else if (ts.isFunctionDeclaration(statement) && statement.name !== undefined) {\n names.functions.set(statement.name.text, statement);\n }\n }\n return names;\n}\n","import ts from \"@typescript/typescript6\";\n\n/**\n * TypeScript type text for the `ts.factory` expressions of the classic `transform` recipe\n * (`createTypeReferenceNode`, keywords, `null` and literal types, unions, intersections, arrays),\n * and for the openapi-typesafe helper constants and `tsUnion` / `tsIntersection`. Anything else\n * returns undefined, so the callback is left as it is. Module-level constants such as\n * `const DATE = ts.factory.createTypeReferenceNode(\"Date\")` are followed by name.\n */\n\n/** How the file refers to the TypeScript module and to the openapi-typesafe helpers. */\nexport interface FactoryNames {\n /** Local names of the `typescript` module (`ts` in `import ts from \"typescript\"`). */\n readonly typescriptModules: ReadonlySet<string>;\n /** Local name → imported name, for named imports from `typescript` (`factory`, `SyntaxKind`). */\n readonly typescriptImports: ReadonlyMap<string, string>;\n /** Local name → imported name, for named imports from `openapi-typesafe`. */\n readonly helperImports: ReadonlyMap<string, string>;\n /** Initializers of module-level `const` declarations, by name. */\n readonly constants: ReadonlyMap<string, ts.Expression>;\n}\n\nconst KEYWORDS: ReadonlyMap<string, string> = new Map([\n [\"AnyKeyword\", \"any\"],\n [\"BigIntKeyword\", \"bigint\"],\n [\"BooleanKeyword\", \"boolean\"],\n [\"NeverKeyword\", \"never\"],\n [\"NumberKeyword\", \"number\"],\n [\"ObjectKeyword\", \"object\"],\n [\"StringKeyword\", \"string\"],\n [\"SymbolKeyword\", \"symbol\"],\n [\"UndefinedKeyword\", \"undefined\"],\n [\"UnknownKeyword\", \"unknown\"],\n [\"VoidKeyword\", \"void\"],\n]);\n\nconst HELPER_CONSTANTS: ReadonlyMap<string, string> = new Map([\n [\"BOOLEAN\", \"boolean\"],\n [\"FALSE\", \"false\"],\n [\"NEVER\", \"never\"],\n [\"NULL\", \"null\"],\n [\"NUMBER\", \"number\"],\n [\"STRING\", \"string\"],\n [\"TRUE\", \"true\"],\n [\"UNDEFINED\", \"undefined\"],\n [\"UNKNOWN\", \"unknown\"],\n]);\n\n/** A type name the type text can hold as written: `Date`, `Foo.Bar`. */\nconst TYPE_NAME_RE = /^[A-Za-z_$][\\w$]*(\\.[A-Za-z_$][\\w$]*)*$/;\n\n/** A type with a `|` or `&` at the top needs parentheses inside `[]`, and a union inside `&`. */\ninterface TypeText {\n readonly text: string;\n readonly operator: \"|\" | \"&\" | null;\n}\n\nconst plain = (text: string): TypeText => ({ text, operator: null });\n\n/** `ts.factory.createX` or `factory.createX`: the factory method name, if that is the callee. */\nfunction factoryMethod(callee: ts.Expression, names: FactoryNames): string | undefined {\n if (!ts.isPropertyAccessExpression(callee)) {\n return undefined;\n }\n const target = callee.expression;\n const isFactory = ts.isIdentifier(target)\n ? names.typescriptImports.get(target.text) === \"factory\"\n : ts.isPropertyAccessExpression(target) &&\n target.name.text === \"factory\" &&\n ts.isIdentifier(target.expression) &&\n names.typescriptModules.has(target.expression.text);\n return isFactory ? callee.name.text : undefined;\n}\n\n/** `ts.SyntaxKind.StringKeyword` or `SyntaxKind.StringKeyword`: the member name. */\nfunction syntaxKindMember(expression: ts.Expression, names: FactoryNames): string | undefined {\n if (!ts.isPropertyAccessExpression(expression)) {\n return undefined;\n }\n const target = expression.expression;\n const isSyntaxKind = ts.isIdentifier(target)\n ? names.typescriptImports.get(target.text) === \"SyntaxKind\"\n : ts.isPropertyAccessExpression(target) &&\n target.name.text === \"SyntaxKind\" &&\n ts.isIdentifier(target.expression) &&\n names.typescriptModules.has(target.expression.text);\n return isSyntaxKind ? expression.name.text : undefined;\n}\n\nfunction typeName(argument: ts.Expression | undefined, names: FactoryNames): string | undefined {\n if (argument === undefined) {\n return undefined;\n }\n if (ts.isStringLiteralLike(argument)) {\n return TYPE_NAME_RE.test(argument.text) ? argument.text : undefined;\n }\n if (\n ts.isCallExpression(argument) &&\n factoryMethod(argument.expression, names) === \"createIdentifier\"\n ) {\n return typeName(argument.arguments[0], names);\n }\n return undefined;\n}\n\nfunction literalText(argument: ts.Expression | undefined, names: FactoryNames): string | undefined {\n if (argument === undefined || !ts.isCallExpression(argument)) {\n return undefined;\n }\n const method = factoryMethod(argument.expression, names);\n const [value] = argument.arguments;\n switch (method) {\n case \"createNull\":\n return \"null\";\n case \"createTrue\":\n return \"true\";\n case \"createFalse\":\n return \"false\";\n case \"createStringLiteral\":\n return value !== undefined && ts.isStringLiteralLike(value)\n ? JSON.stringify(value.text)\n : undefined;\n case \"createNumericLiteral\":\n return value !== undefined && (ts.isNumericLiteral(value) || ts.isStringLiteralLike(value))\n ? String(Number(value.text))\n : undefined;\n default:\n return undefined;\n }\n}\n\nfunction joined(\n elements: ts.Expression | undefined,\n operator: \"|\" | \"&\",\n names: FactoryNames,\n): TypeText | undefined {\n if (\n elements === undefined ||\n !ts.isArrayLiteralExpression(elements) ||\n elements.elements.length === 0\n ) {\n return undefined;\n }\n const parts = elements.elements.map((element) => typeTextOf(element, names));\n if (parts.some((part) => part === undefined)) {\n return undefined;\n }\n const texts = (parts as TypeText[]).map((part) =>\n operator === \"&\" && part.operator === \"|\" ? `(${part.text})` : part.text,\n );\n return { text: texts.join(` ${operator} `), operator: texts.length > 1 ? operator : null };\n}\n\nfunction factoryCallText(\n call: ts.CallExpression,\n method: string,\n names: FactoryNames,\n): TypeText | undefined {\n const [first, second] = call.arguments;\n switch (method) {\n case \"createTypeReferenceNode\": {\n const name = second === undefined ? typeName(first, names) : undefined;\n return name === undefined ? undefined : plain(name);\n }\n case \"createKeywordTypeNode\": {\n const keyword =\n first === undefined ? undefined : KEYWORDS.get(syntaxKindMember(first, names) ?? \"\");\n return keyword === undefined ? undefined : plain(keyword);\n }\n case \"createLiteralTypeNode\": {\n const literal = literalText(first, names);\n return literal === undefined ? undefined : plain(literal);\n }\n case \"createUnionTypeNode\":\n return joined(first, \"|\", names);\n case \"createIntersectionTypeNode\":\n return joined(first, \"&\", names);\n case \"createArrayTypeNode\": {\n const element = first === undefined ? undefined : typeTextOf(first, names);\n return element === undefined\n ? undefined\n : plain(element.operator ? `(${element.text})[]` : `${element.text}[]`);\n }\n default:\n return undefined;\n }\n}\n\nfunction helperCallText(call: ts.CallExpression, names: FactoryNames): TypeText | undefined {\n if (!ts.isIdentifier(call.expression)) {\n return undefined;\n }\n const helper = names.helperImports.get(call.expression.text);\n if (helper === \"tsUnion\") {\n return joined(call.arguments[0], \"|\", names);\n }\n return helper === \"tsIntersection\" ? joined(call.arguments[0], \"&\", names) : undefined;\n}\n\nfunction identifierText(identifier: ts.Identifier, names: FactoryNames): TypeText | undefined {\n const helper = names.helperImports.get(identifier.text);\n const constant = helper === undefined ? undefined : HELPER_CONSTANTS.get(helper);\n if (constant !== undefined) {\n return plain(constant);\n }\n const initializer = names.constants.get(identifier.text);\n return initializer === undefined ? undefined : typeTextOf(initializer, names);\n}\n\n/** The type text of an expression that builds a type, or undefined. */\nexport function typeTextOf(expression: ts.Expression, names: FactoryNames): TypeText | undefined {\n if (ts.isParenthesizedExpression(expression)) {\n return typeTextOf(expression.expression, names);\n }\n if (ts.isIdentifier(expression)) {\n return identifierText(expression, names);\n }\n if (!ts.isCallExpression(expression)) {\n return undefined;\n }\n const method = factoryMethod(expression.expression, names);\n return method === undefined\n ? helperCallText(expression, names)\n : factoryCallText(expression, method, names);\n}\n","import ts from \"@typescript/typescript6\";\nimport { type FactoryNames, typeTextOf } from \"./factory-type-text.js\";\n\n/** A replacement of a source range by new text. */\nexport interface TextEdit {\n readonly start: number;\n readonly end: number;\n readonly text: string;\n}\n\n/** The returned expressions of a function, without those of functions nested in it. */\nexport function returnedExpressions(body: ts.ConciseBody): (ts.Expression | undefined)[] {\n if (!ts.isBlock(body)) {\n return [body];\n }\n const returned: (ts.Expression | undefined)[] = [];\n const visit = (node: ts.Node): void => {\n if (ts.isFunctionLike(node) || ts.isClassLike(node)) {\n return;\n }\n if (ts.isReturnStatement(node)) {\n returned.push(node.expression);\n }\n ts.forEachChild(node, visit);\n };\n ts.forEachChild(body, visit);\n return returned;\n}\n\nconst isUndefined = (expression: ts.Expression): boolean =>\n (ts.isIdentifier(expression) && expression.text === \"undefined\") ||\n ts.isVoidExpression(expression);\n\nfunction typeTextEdit(expression: ts.Expression, names: FactoryNames): TextEdit[] | undefined {\n const typeText = typeTextOf(expression, names);\n if (typeText === undefined) {\n return undefined;\n }\n const start = expression.getStart();\n return [{ start, end: expression.getEnd(), text: JSON.stringify(typeText.text) }];\n}\n\n/** `{ schema: <type>, questionToken: … }`: only the `schema` value changes. */\nfunction resultObjectEdits(\n object: ts.ObjectLiteralExpression,\n names: FactoryNames,\n): TextEdit[] | undefined {\n const schema = object.properties.find(\n (property) =>\n property.name !== undefined &&\n ts.isIdentifier(property.name) &&\n property.name.text === \"schema\",\n );\n const isPlain = object.properties.every(ts.isPropertyAssignment);\n if (schema === undefined || !isPlain || !ts.isPropertyAssignment(schema)) {\n return undefined;\n }\n return typeTextEdit(schema.initializer, names);\n}\n\n/**\n * The edits that turn one returned expression into type text, or undefined when it is not one of\n * the known type-building forms. `undefined` (keep the generated type) needs no edit.\n */\nexport function returnEdits(\n expression: ts.Expression | undefined,\n names: FactoryNames,\n): TextEdit[] | undefined {\n if (expression === undefined || isUndefined(expression)) {\n return [];\n }\n if (ts.isParenthesizedExpression(expression)) {\n return returnEdits(expression.expression, names);\n }\n if (ts.isConditionalExpression(expression)) {\n const whenTrue = returnEdits(expression.whenTrue, names);\n const whenFalse = returnEdits(expression.whenFalse, names);\n return whenTrue === undefined || whenFalse === undefined\n ? undefined\n : [...whenTrue, ...whenFalse];\n }\n if (ts.isObjectLiteralExpression(expression)) {\n return resultObjectEdits(expression, names);\n }\n return typeTextEdit(expression, names);\n}\n","import ts from \"@typescript/typescript6\";\nimport type { CallbackRewriter } from \"../../application/ports.js\";\nimport {\n type Change,\n type FileMigration,\n lineAt,\n type ManualStep,\n type TransformKeepReason,\n unchanged,\n} from \"../../domain/migration-findings.js\";\nimport { collectFileNames, type FileNames } from \"./file-names.js\";\nimport { returnEdits, returnedExpressions, type TextEdit } from \"./transform-returns.js\";\n\n/**\n * The CallbackRewriter port on the TypeScript 6 parser (ADR-015). In each `openapiTS(source, {…})`\n * call where `transform` is the only callback and every value it returns builds a type with\n * `ts.factory` or the helpers, the returns become TypeScript type text and `irCallbacks: true` is\n * added. Every other legacy callback is reported, not changed: it still works, with a warning.\n */\n\nconst TRANSFORM = \"transform\";\nconst LEGACY_ONLY_CALLBACKS = [\"postTransform\", \"transformProperty\"] as const;\nconst IR_CALLBACKS_OPTION = \"irCallbacks\";\n\ninterface CallFindings {\n readonly edits: TextEdit[];\n readonly changes: Change[];\n readonly manualSteps: ManualStep[];\n}\n\nconst SCRIPT_KINDS: ReadonlyMap<string, ts.ScriptKind> = new Map([\n [\".ts\", ts.ScriptKind.TS],\n [\".mts\", ts.ScriptKind.TS],\n [\".cts\", ts.ScriptKind.TS],\n [\".tsx\", ts.ScriptKind.TSX],\n [\".js\", ts.ScriptKind.JS],\n [\".mjs\", ts.ScriptKind.JS],\n [\".cjs\", ts.ScriptKind.JS],\n [\".jsx\", ts.ScriptKind.JSX],\n]);\n\n/** Single-file components (`.vue`, `.svelte`, `.astro`) are not plain scripts; they are left. */\nfunction scriptKindOf(path: string): ts.ScriptKind | undefined {\n return SCRIPT_KINDS.get(path.slice(path.lastIndexOf(\".\")));\n}\n\nfunction propertyNamed(\n options: ts.ObjectLiteralExpression,\n name: string,\n): ts.ObjectLiteralElementLike | undefined {\n return options.properties.find((property) => {\n const key = property.name;\n return (\n key !== undefined && (ts.isIdentifier(key) || ts.isStringLiteral(key)) && key.text === name\n );\n });\n}\n\n/**\n * The function a `transform` property holds: a method, an arrow function or a function, inline or\n * by the name of a module-level function.\n */\nfunction callbackFunction(\n property: ts.ObjectLiteralElementLike,\n names: FileNames,\n): ts.FunctionLikeDeclaration | undefined {\n if (ts.isMethodDeclaration(property)) {\n return property;\n }\n if (!ts.isPropertyAssignment(property)) {\n return undefined;\n }\n const value = property.initializer;\n if (ts.isIdentifier(value)) {\n return names.functions.get(value.text);\n }\n return ts.isArrowFunction(value) || ts.isFunctionExpression(value) ? value : undefined;\n}\n\n/**\n * A function named by `transform` is rewritten only when its name appears just twice in the file\n * (where it is defined, and here): other callers would get type text where they expect nodes.\n */\nfunction isSharedFunction(property: ts.ObjectLiteralElementLike, text: string): boolean {\n if (!ts.isPropertyAssignment(property) || !ts.isIdentifier(property.initializer)) {\n return false;\n }\n const name = property.initializer.text.replaceAll(\"$\", \"\\\\$\");\n const uses = text.match(new RegExp(`(?<![\\\\w$])${name}(?![\\\\w$])`, \"g\")) ?? [];\n return uses.length > 2;\n}\n\n/**\n * A declared return type names TypeScript nodes (`ts.TypeNode`), which type text does not match,\n * so it is removed and the type is inferred from the new returns.\n */\nfunction returnTypeEdits(callback: ts.FunctionLikeDeclaration, text: string): TextEdit[] {\n const type = callback.type;\n if (type === undefined) {\n return [];\n }\n const colon = text.lastIndexOf(\":\", type.getStart());\n return [{ start: colon, end: type.getEnd(), text: \"\" }];\n}\n\n/** The edits for the returns of `transform`, or the reason to keep it. */\nfunction transformEdits(\n property: ts.ObjectLiteralElementLike,\n names: FileNames,\n text: string,\n): TextEdit[] | TransformKeepReason {\n const callback = callbackFunction(property, names);\n if (callback?.body === undefined) {\n return \"not-a-function\";\n }\n if (isSharedFunction(property, text)) {\n return \"shared-function\";\n }\n const edits = returnTypeEdits(callback, text);\n for (const returned of returnedExpressions(callback.body)) {\n const returnEditList = returnEdits(returned, names);\n if (returnEditList === undefined) {\n return \"unknown-return\";\n }\n edits.push(...returnEditList);\n }\n return edits;\n}\n\n/**\n * The `irCallbacks: true` option, placed before `transform`: on its own line with the same\n * indentation when `transform` starts a line, else on the same line.\n */\nfunction irCallbacksOption(text: string, transformStart: number): string {\n const lineStart = text.lastIndexOf(\"\\n\", transformStart - 1) + 1;\n const before = text.slice(lineStart, transformStart);\n const option = `${IR_CALLBACKS_OPTION}: true,`;\n return /^\\s*$/.test(before) ? `${option}\\n${before}` : `${option} `;\n}\n\nfunction keepReason(options: ts.ObjectLiteralExpression): TransformKeepReason | undefined {\n const hasOther = LEGACY_ONLY_CALLBACKS.some((name) => propertyNamed(options, name) !== undefined);\n return hasOther ? \"other-callbacks\" : undefined;\n}\n\nfunction legacyCallbackSteps(options: ts.ObjectLiteralExpression, text: string): ManualStep[] {\n return LEGACY_ONLY_CALLBACKS.flatMap((callback) => {\n const property = propertyNamed(options, callback);\n return property === undefined\n ? []\n : [{ kind: \"legacy-callback\" as const, line: lineAt(text, property.getStart()), callback }];\n });\n}\n\n/** The findings of one `openapiTS(source, options)` call with an options object literal. */\nfunction migrateOptions(\n options: ts.ObjectLiteralExpression,\n text: string,\n names: FileNames,\n): CallFindings {\n // With irCallbacks set, the callbacks already use the IR form: nothing to migrate.\n if (propertyNamed(options, IR_CALLBACKS_OPTION) !== undefined) {\n return { edits: [], changes: [], manualSteps: [] };\n }\n const findings: CallFindings = {\n edits: [],\n changes: [],\n manualSteps: legacyCallbackSteps(options, text),\n };\n const transform = propertyNamed(options, TRANSFORM);\n if (transform === undefined) {\n return findings;\n }\n const start = transform.getStart();\n const line = lineAt(text, start);\n const result = keepReason(options) ?? transformEdits(transform, names, text);\n if (typeof result === \"string\") {\n findings.manualSteps.push({ kind: \"transform-not-rewritten\", line, reason: result });\n return findings;\n }\n findings.edits.push({ start, end: start, text: irCallbacksOption(text, start) }, ...result);\n findings.changes.push({ kind: \"transform-rewritten\", line });\n return findings;\n}\n\n/** The options object of a generator call, if it is written in place. */\nfunction generatorOptions(node: ts.Node, names: FileNames): ts.ObjectLiteralExpression | undefined {\n if (!ts.isCallExpression(node) || !ts.isIdentifier(node.expression)) {\n return undefined;\n }\n const options = node.arguments[1];\n const isGenerator = names.generatorFunctions.has(node.expression.text);\n return isGenerator && options !== undefined && ts.isObjectLiteralExpression(options)\n ? options\n : undefined;\n}\n\n/** Apply edits from the end of the text, so earlier offsets stay valid. */\nfunction applyEdits(text: string, edits: readonly TextEdit[]): string {\n return [...edits]\n .sort((left, right) => right.start - left.start)\n .reduce(\n (result, edit) => result.slice(0, edit.start) + edit.text + result.slice(edit.end),\n text,\n );\n}\n\nfunction findCallFindings(file: ts.SourceFile, text: string, names: FileNames): CallFindings {\n const all: CallFindings = { edits: [], changes: [], manualSteps: [] };\n const visit = (node: ts.Node): void => {\n const options = generatorOptions(node, names);\n if (options !== undefined) {\n const found = migrateOptions(options, text, names);\n all.edits.push(...found.edits);\n all.changes.push(...found.changes);\n all.manualSteps.push(...found.manualSteps);\n }\n ts.forEachChild(node, visit);\n };\n visit(file);\n return all;\n}\n\nclass TypescriptCallbackRewriter implements CallbackRewriter {\n rewrite(text: string, path: string): FileMigration {\n const scriptKind = scriptKindOf(path);\n if (scriptKind === undefined) {\n return unchanged(text);\n }\n const file = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true, scriptKind);\n const names = collectFileNames(file);\n if (names.generatorFunctions.size === 0) {\n return unchanged(text);\n }\n const { edits, changes, manualSteps } = findCallFindings(file, text, names);\n return { text: applyEdits(text, edits), changes, manualSteps };\n }\n}\n\n/** A callback rewriter that parses each file with the TypeScript 6 parser. */\nexport function createTypescriptCallbackRewriter(): CallbackRewriter {\n return new TypescriptCallbackRewriter();\n}\n","/**\n * What the migration renames (ENGINEERING_PLAN 10.1). openapi-typesafe is a drop-in successor, so\n * moving a project is a matter of names: packages, the CLI command and a few renamed CLI flags.\n */\n\n/** Original package name → openapi-typesafe package name. */\nexport const PACKAGE_RENAMES: ReadonlyMap<string, string> = new Map([\n [\"openapi-typescript\", \"openapi-typesafe\"],\n [\"openapi-fetch\", \"openapi-typesafe-fetch\"],\n [\"openapi-react-query\", \"openapi-typesafe-react-query\"],\n [\"openapi-typescript-helpers\", \"openapi-typesafe-helpers\"],\n]);\n\n/** The generator's command, as package.json scripts and shell lines run it. */\nexport const GENERATOR_COMMAND = \"openapi-typescript\";\nexport const MIGRATED_GENERATOR_COMMAND = \"openapi-typesafe\";\n\n/**\n * Flags that openapi-typescript 6 and 7 renamed; the openapi-typesafe CLI rejects the old spelling\n * with CLI_FLAG_REMOVED, so the migration writes the new one.\n */\nexport const FLAG_RENAMES: ReadonlyMap<string, string> = new Map([\n [\"--immutable-types\", \"--immutable\"],\n [\"-it\", \"--immutable\"],\n [\"--support-array-length\", \"--array-length\"],\n [\"--redoc\", \"--redocly\"],\n [\"-ap\", \"--additional-properties\"],\n]);\n\n/** The dependency fields of package.json that install packages, in the order npm documents them. */\nexport const DEPENDENCY_FIELDS = [\n \"dependencies\",\n \"devDependencies\",\n \"peerDependencies\",\n \"optionalDependencies\",\n] as const;\n\nexport type DependencyField = (typeof DEPENDENCY_FIELDS)[number];\n\n/** Fields that can name a package without installing it; they are reported, not rewritten. */\nexport const OVERRIDE_FIELDS = [\"overrides\", \"resolutions\", \"pnpm\"] as const;\n","import type { Change, ManualStep } from \"./migration-findings.js\";\nimport { FLAG_RENAMES, GENERATOR_COMMAND, MIGRATED_GENERATOR_COMMAND } from \"./package-names.js\";\n\n/**\n * The generator command in a script or shell line. It counts only as a whole word that starts a\n * command or follows white space or shell punctuation, so `node_modules/openapi-typescript/...`\n * and `openapi-typescript-helpers` are left alone.\n */\nconst COMMAND_RE = new RegExp(`(?<=^|[\\\\s\"'\\`;&|(])${GENERATOR_COMMAND}(?=$|[\\\\s\"'\\`;&|)])`, \"g\");\n/** `openapi-typescript@7` pins the old package for npx; a new version cannot be guessed. */\nconst VERSIONED_COMMAND_RE = new RegExp(`(?<=^|[\\\\s\"'\\`;&|(])${GENERATOR_COMMAND}@`);\nconst MIGRATED_COMMAND_RE = new RegExp(\n `(?<=^|[\\\\s\"'\\`;&|(])${MIGRATED_GENERATOR_COMMAND}(?=$|[\\\\s\"'\\`;&|)])`,\n);\nconst FLAG_RE = new RegExp(`(?<=\\\\s)(${[...FLAG_RENAMES.keys()].join(\"|\")})(?=$|[\\\\s=])`, \"g\");\n\n/** One command line or script after the migration. */\nexport interface CommandMigration {\n readonly text: string;\n readonly changes: readonly Change[];\n readonly manualSteps: readonly ManualStep[];\n}\n\nfunction renameFlags(text: string, location: string, changes: Change[]): string {\n if (!MIGRATED_COMMAND_RE.test(text)) {\n return text;\n }\n return text.replace(FLAG_RE, (flag) => {\n const renamed = FLAG_RENAMES.get(flag) as string;\n changes.push({ kind: \"flag-renamed\", location, from: flag, to: renamed });\n return renamed;\n });\n}\n\n/**\n * Rename the generator command in one script or line, and then the renamed flags of that command.\n * `location` names the place for the report (a script name, or `file:line`).\n */\nexport function migrateCommand(text: string, location: string): CommandMigration {\n const changes: Change[] = [];\n const manualSteps: ManualStep[] = [];\n if (VERSIONED_COMMAND_RE.test(text)) {\n manualSteps.push({ kind: \"versioned-command\", location });\n }\n const renamed = text.replace(COMMAND_RE, () => {\n changes.push({ kind: \"command-renamed\", location });\n return MIGRATED_GENERATOR_COMMAND;\n });\n return { text: renameFlags(renamed, location, changes), changes, manualSteps };\n}\n\n/** Every line of a shell script, CI workflow or Makefile, through `migrateCommand`. */\nexport function migrateCommandLines(text: string, file: string): CommandMigration {\n const changes: Change[] = [];\n const manualSteps: ManualStep[] = [];\n const lines = text.split(\"\\n\").map((line, index) => {\n const migrated = migrateCommand(line, `${file}:${index + 1}`);\n changes.push(...migrated.changes);\n manualSteps.push(...migrated.manualSteps);\n return migrated.text;\n });\n return { text: lines.join(\"\\n\"), changes, manualSteps };\n}\n","import { PACKAGE_RENAMES } from \"./package-names.js\";\n\n/**\n * Override, resolution and patch keys name a package with a path or a version around it:\n * `app>openapi-fetch` (pnpm), `**\\/openapi-fetch` (Yarn), `openapi-fetch@0.13` (pnpm, npm).\n * Matching the name as a substring took `openapi-typescript-helpers` for `openapi-typescript` too.\n */\n\nconst PARENT_SEPARATOR = \">\";\nconst PATH_SEPARATOR = \"/\";\nconst SCOPE_PREFIX = \"@\";\n\n/** The package a key targets: the last parent and path segment, without a version. */\nexport function overrideTarget(key: string): string {\n const child = key.split(PARENT_SEPARATOR).at(-1) ?? key;\n const segments = child.split(PATH_SEPARATOR);\n const isScoped = segments.length > 1 && segments.at(-2)?.startsWith(SCOPE_PREFIX) === true;\n const name = isScoped ? segments.slice(-2).join(PATH_SEPARATOR) : (segments.at(-1) ?? child);\n const versionAt = name.indexOf(SCOPE_PREFIX, 1);\n return versionAt === -1 ? name : name.slice(0, versionAt);\n}\n\nfunction keysOf(value: unknown): string[] {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return [];\n }\n return Object.entries(value).flatMap(([key, nested]) => [key, ...keysOf(nested)]);\n}\n\n/** The original packages that keys of `value`, at any depth, target; each once, in key order. */\nexport function overriddenPackages(value: unknown): string[] {\n const targets = keysOf(value).map(overrideTarget);\n return [...new Set(targets.filter((target) => PACKAGE_RENAMES.has(target)))];\n}\n","/**\n * The version spec a renamed dependency gets. A plain version or range keeps its style (`^`, `~`\n * or exact) and gets the openapi-typesafe version; `catalog:` and `workspace:` stay, because they\n * point elsewhere; anything else (a tag, a URL, a file or an npm alias) is kept and reported.\n */\n\nconst VERSION_STYLE_RE = /^([\\^~]|>=)?\\d/;\nconst KEPT_PROTOCOLS = [\"catalog:\", \"workspace:\"] as const;\n\nexport type SpecDecision =\n | { readonly kind: \"replaced\"; readonly spec: string }\n | { readonly kind: \"kept\"; readonly spec: string; readonly isReported: boolean };\n\n/** The new spec for a renamed dependency whose old spec was `spec`. */\nexport function migrateVersionSpec(spec: string, version: string): SpecDecision {\n if (KEPT_PROTOCOLS.some((protocol) => spec.startsWith(protocol))) {\n return { kind: \"kept\", spec, isReported: false };\n }\n const style = VERSION_STYLE_RE.exec(spec);\n if (style === null) {\n return { kind: \"kept\", spec, isReported: true };\n }\n // `>=` means \"this or newer\"; with a new package line, a caret range says the same safely.\n const prefix = style[1] === \">=\" ? \"^\" : (style[1] ?? \"\");\n return { kind: \"replaced\", spec: `${prefix}${version}` };\n}\n","import { migrateCommand } from \"./command-migration.js\";\nimport {\n type Change,\n type FileMigration,\n type ManualStep,\n unchanged,\n} from \"./migration-findings.js\";\nimport { overriddenPackages } from \"./override-targets.js\";\nimport { DEPENDENCY_FIELDS, OVERRIDE_FIELDS, PACKAGE_RENAMES } from \"./package-names.js\";\nimport { migrateVersionSpec } from \"./version-spec.js\";\n\ntype JsonObject = Record<string, unknown>;\n\ninterface Findings {\n readonly changes: Change[];\n readonly manualSteps: ManualStep[];\n}\n\nconst INDENT_RE = /^[ \\t]+(?=\")/m;\nconst DEFAULT_INDENT = \" \";\n\nfunction isObject(value: unknown): value is JsonObject {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** The manifest as written again: same indentation, and a final newline only if it had one. */\nfunction formatLike(original: string, manifest: JsonObject): string {\n const indent = INDENT_RE.exec(original)?.[0] ?? DEFAULT_INDENT;\n const ending = original.endsWith(\"\\n\") ? \"\\n\" : \"\";\n return `${JSON.stringify(manifest, null, indent)}${ending}`;\n}\n\nfunction renameDependencies(\n field: string,\n dependencies: JsonObject,\n version: string,\n findings: Findings,\n): JsonObject {\n // Rebuilt key by key, so a renamed dependency keeps its place in the list.\n return Object.fromEntries(\n Object.entries(dependencies).map(([name, spec]) => {\n const renamed = PACKAGE_RENAMES.get(name);\n if (renamed === undefined || typeof spec !== \"string\") {\n return [name, spec];\n }\n const decision = migrateVersionSpec(spec, version);\n findings.changes.push({\n kind: \"dependency-renamed\",\n field,\n from: name,\n to: renamed,\n spec: decision.spec,\n });\n if (decision.kind === \"kept\" && decision.isReported) {\n findings.manualSteps.push({ kind: \"spec-kept\", name: renamed, spec });\n }\n if (field === \"peerDependencies\") {\n findings.manualSteps.push({ kind: \"peer-dependency-renamed\", name: renamed });\n }\n return [renamed, decision.spec];\n }),\n );\n}\n\nfunction migrateScripts(scripts: JsonObject, findings: Findings): JsonObject {\n return Object.fromEntries(\n Object.entries(scripts).map(([name, script]) => {\n if (typeof script !== \"string\") {\n return [name, script];\n }\n const migrated = migrateCommand(script, `scripts.${name}`);\n findings.changes.push(...migrated.changes);\n findings.manualSteps.push(...migrated.manualSteps);\n return [name, migrated.text];\n }),\n );\n}\n\n/** Overrides and resolutions can pin the old packages; changing them needs the user's intent. */\nfunction reportOverrides(manifest: JsonObject, findings: Findings): void {\n for (const field of OVERRIDE_FIELDS) {\n for (const name of overriddenPackages(manifest[field])) {\n findings.manualSteps.push({ kind: \"override-names-package\", field, name });\n }\n }\n}\n\nfunction migrateFields(manifest: JsonObject, version: string, findings: Findings): JsonObject {\n const migrated: JsonObject = { ...manifest };\n for (const field of DEPENDENCY_FIELDS) {\n const dependencies = manifest[field];\n if (isObject(dependencies)) {\n migrated[field] = renameDependencies(field, dependencies, version, findings);\n }\n }\n if (isObject(manifest.scripts)) {\n migrated.scripts = migrateScripts(manifest.scripts, findings);\n }\n reportOverrides(manifest, findings);\n return migrated;\n}\n\n/**\n * Migrate a package.json: rename the original packages in the dependency fields (with\n * `version` as the new version), rename the generator command and its renamed flags in scripts,\n * and report overrides that name the original packages. Text that is not a JSON object is left.\n */\nexport function migratePackageManifest(text: string, version: string): FileMigration {\n let manifest: unknown;\n try {\n manifest = JSON.parse(text);\n } catch (error) {\n // A package.json that does not parse is not ours to fix; the user is told where it is.\n const reason = error instanceof Error ? error.message : String(error);\n return { ...unchanged(text), manualSteps: [{ kind: \"manifest-unreadable\", reason }] };\n }\n if (!isObject(manifest)) {\n return unchanged(text);\n }\n const findings: Findings = { changes: [], manualSteps: [] };\n const migrated = migrateFields(manifest, version, findings);\n const isChanged = findings.changes.length > 0;\n return { text: isChanged ? formatLike(text, migrated) : text, ...findings };\n}\n","import { type Change, type FileMigration, lineAt, type ManualStep } from \"./migration-findings.js\";\nimport { PACKAGE_RENAMES } from \"./package-names.js\";\n\n/**\n * Module specifiers in source files: `\"openapi-fetch\"` and `'openapi-fetch/subpath'` in\n * imports, `require()`, `import()`, `vi.mock()`, `declare module` and tool configs alike. Only a\n * whole quoted string that is exactly a package name, or a name and a subpath, is renamed, so\n * text that merely mentions a package (comments, `@scope/openapi-fetch`, `openapi-fetch-gen`)\n * stays.\n */\nconst SPECIFIER_RE = new RegExp(\n `([\"'\\`])(${[...PACKAGE_RENAMES.keys()].join(\"|\")})(/[^\"'\\`\\\\s]*)?\\\\1`,\n \"g\",\n);\n\n/** Source file extensions whose text can hold module specifiers. */\nexport const SOURCE_EXTENSIONS: ReadonlySet<string> = new Set([\n \".ts\",\n \".tsx\",\n \".mts\",\n \".cts\",\n \".js\",\n \".jsx\",\n \".mjs\",\n \".cjs\",\n \".vue\",\n \".svelte\",\n \".astro\",\n]);\n\n/** Rename the original packages in the module specifiers of one source file. */\nexport function migrateModuleSpecifiers(text: string): FileMigration {\n const changes: Change[] = [];\n const manualSteps: ManualStep[] = [];\n let migrated = \"\";\n let copiedUpTo = 0;\n for (const match of text.matchAll(SPECIFIER_RE)) {\n const [whole, quote, name, subpath] = match as unknown as [string, string, string, string?];\n const line = lineAt(text, match.index);\n const to = `${PACKAGE_RENAMES.get(name) as string}${subpath ?? \"\"}`;\n changes.push({ kind: \"specifier-renamed\", line, from: whole.slice(1, -1), to });\n // A deep import reaches into the package's files, whose layout is not part of the contract.\n if (subpath !== undefined) {\n manualSteps.push({ kind: \"deep-import\", line, specifier: to });\n }\n migrated += `${text.slice(copiedUpTo, match.index)}${quote}${to}${quote}`;\n copiedUpTo = match.index + whole.length;\n }\n return { text: migrated + text.slice(copiedUpTo), changes, manualSteps };\n}\n","import {\n type Change,\n type FileMigration,\n type ManualStep,\n unchanged,\n} from \"./migration-findings.js\";\nimport { overriddenPackages } from \"./override-targets.js\";\nimport { PACKAGE_RENAMES } from \"./package-names.js\";\nimport { migrateVersionSpec } from \"./version-spec.js\";\n\n/**\n * pnpm catalogs (`pnpm-workspace.yaml`): a project whose package.json says `\"openapi-fetch\":\n * \"catalog:\"` keeps its version here. The file is edited line by line, not parsed and written\n * again, so comments and formatting stay. Only entries under `catalog:` or `catalogs:` are renamed;\n * `overrides:` and `patchedDependencies:` entries that name an original package are reported, like\n * the same fields of package.json.\n */\n\n/** ` openapi-fetch: ^0.13.1`, ` \"openapi-fetch\": \"0.13\"`; groups: indent, quote, name, spec. */\nconst ENTRY_RE = /^(\\s+)([\"']?)([\\w@./-]+)\\2:\\s*([\"']?)([^\"'#\\s]+)\\4(.*)$/;\nconst TOP_LEVEL_KEY_RE = /^([\\w-]+):/;\n/** ` \"app>openapi-fetch\": 1.0.0`; groups: quote, key. */\nconst KEY_RE = /^\\s+([\"']?)(.+?)\\1:(?:\\s|$)/;\nconst CATALOG_SECTIONS: ReadonlySet<string> = new Set([\"catalog\", \"catalogs\"]);\nconst REPORTED_SECTIONS: ReadonlySet<string> = new Set([\"overrides\", \"patchedDependencies\"]);\n\ninterface LineResult {\n readonly line: string;\n readonly change?: Change;\n readonly manualStep?: ManualStep;\n}\n\nfunction migrateEntry(line: string, version: string): LineResult {\n const entry = ENTRY_RE.exec(line);\n const renamed = entry === null ? undefined : PACKAGE_RENAMES.get(entry[3] as string);\n if (entry === null || renamed === undefined) {\n return { line };\n }\n const [, indent, keyQuote, name, specQuote, spec, rest] = entry as unknown as string[];\n const decision = migrateVersionSpec(spec as string, version);\n const key = `${keyQuote}${renamed}${keyQuote}`;\n const migrated = `${indent}${key}: ${specQuote}${decision.spec}${specQuote}${rest}`;\n const change: Change = { kind: \"catalog-entry-renamed\", from: name as string, to: renamed };\n if (decision.kind === \"kept\" && decision.isReported) {\n return {\n line: migrated,\n change,\n manualStep: { kind: \"spec-kept\", name: renamed, spec: spec as string },\n };\n }\n return { line: migrated, change };\n}\n\n/** The manual step for an override or patch entry that names an original package. */\nfunction reportEntry(line: string, field: string): ManualStep[] {\n const key = KEY_RE.exec(line)?.[2];\n return key === undefined\n ? []\n : overriddenPackages({ [key]: null }).map((name) => ({\n kind: \"override-names-package\",\n field,\n name,\n }));\n}\n\n/** Rename the original packages in the catalogs of a pnpm-workspace.yaml; report its overrides. */\nexport function migrateWorkspaceCatalogs(text: string, version: string): FileMigration {\n const changes: Change[] = [];\n const manualSteps: ManualStep[] = [];\n let section: string | undefined;\n const lines = text.split(\"\\n\").map((line) => {\n const topLevelKey = TOP_LEVEL_KEY_RE.exec(line)?.[1];\n if (topLevelKey !== undefined) {\n section = topLevelKey;\n return line;\n }\n if (section !== undefined && REPORTED_SECTIONS.has(section)) {\n manualSteps.push(...reportEntry(line, section));\n return line;\n }\n if (section === undefined || !CATALOG_SECTIONS.has(section)) {\n return line;\n }\n const result = migrateEntry(line, version);\n changes.push(...(result.change ? [result.change] : []));\n manualSteps.push(...(result.manualStep ? [result.manualStep] : []));\n return result.line;\n });\n return changes.length === 0\n ? { ...unchanged(text), manualSteps }\n : { text: lines.join(\"\\n\"), changes, manualSteps };\n}\n","import { migrateCommandLines } from \"../domain/command-migration.js\";\nimport { migratePackageManifest } from \"../domain/manifest-migration.js\";\nimport type { Change, FileMigration, ManualStep } from \"../domain/migration-findings.js\";\nimport { migrateModuleSpecifiers, SOURCE_EXTENSIONS } from \"../domain/source-migration.js\";\nimport { migrateWorkspaceCatalogs } from \"../domain/workspace-catalog-migration.js\";\nimport type { CallbackRewriter } from \"./ports.js\";\n\n/** What a migration of one kind of file needs besides the text. */\nexport interface MigrationContext {\n readonly version: string;\n readonly rewriter: CallbackRewriter;\n}\n\n/** One kind of file the migration knows, and how to migrate it. */\ninterface FileKind {\n readonly matches: (path: string) => boolean;\n readonly migrate: (text: string, path: string, context: MigrationContext) => FileMigration;\n}\n\nconst SCRIPT_EXTENSIONS: ReadonlySet<string> = new Set([\".sh\", \".bash\", \".zsh\", \".yml\", \".yaml\"]);\nconst SCRIPT_NAMES: ReadonlySet<string> = new Set([\"Makefile\", \"justfile\", \"Dockerfile\"]);\nconst WORKSPACE_FILE = \"pnpm-workspace.yaml\";\nconst MANIFEST_FILE = \"package.json\";\n/** The package manager writes these again on install; their entries are not commands. */\nconst LOCK_FILES: ReadonlySet<string> = new Set([\"pnpm-lock.yaml\", \"yarn.lock\", \"bun.lock\"]);\n\nfunction baseName(path: string): string {\n return path.slice(path.lastIndexOf(\"/\") + 1);\n}\n\nfunction extensionOf(path: string): string {\n const name = baseName(path);\n const dot = name.lastIndexOf(\".\");\n return dot <= 0 ? \"\" : name.slice(dot);\n}\n\n/** Two migrations of the same text, one after the other, with their findings joined. */\nfunction chain(first: FileMigration, next: (text: string) => FileMigration): FileMigration {\n const second = next(first.text);\n const changes: Change[] = [...first.changes, ...second.changes];\n const manualSteps: ManualStep[] = [...first.manualSteps, ...second.manualSteps];\n return { text: second.text, changes, manualSteps };\n}\n\n/** The kinds in order; the first that matches a path migrates it. */\nconst FILE_KINDS: readonly FileKind[] = [\n {\n matches: (path) => baseName(path) === MANIFEST_FILE,\n migrate: (text, _path, context) => migratePackageManifest(text, context.version),\n },\n {\n matches: (path) => baseName(path) === WORKSPACE_FILE,\n migrate: (text, _path, context) => migrateWorkspaceCatalogs(text, context.version),\n },\n {\n matches: (path) => SOURCE_EXTENSIONS.has(extensionOf(path)),\n migrate: (text, path, context) =>\n chain(migrateModuleSpecifiers(text), (renamed) => context.rewriter.rewrite(renamed, path)),\n },\n {\n matches: (path) => SCRIPT_EXTENSIONS.has(extensionOf(path)) || SCRIPT_NAMES.has(baseName(path)),\n migrate: (text, path) => migrateCommandLines(text, path),\n },\n];\n\n/** The migration for a file, or undefined when the migration does not read that kind of file. */\nexport function fileMigrationFor(path: string): FileKind[\"migrate\"] | undefined {\n if (LOCK_FILES.has(baseName(path))) {\n return undefined;\n }\n return FILE_KINDS.find((kind) => kind.matches(path))?.migrate;\n}\n","import type { Change, ManualStep } from \"../domain/migration-findings.js\";\nimport { fileMigrationFor, type MigrationContext } from \"./file-migrations.js\";\nimport type { CallbackRewriter, Logger, ProjectFiles } from \"./ports.js\";\n\nexport interface MigrateProjectDependencies {\n readonly files: ProjectFiles;\n readonly rewriter: CallbackRewriter;\n readonly logger: Logger;\n}\n\nexport interface MigrateProjectInput {\n /** The openapi-typesafe version that renamed dependencies get. */\n readonly version: string;\n /** Write the changed files; without it the migration only reports (dry run). */\n readonly isWrite: boolean;\n}\n\n/** What the migration found in one file. */\nexport interface FileReport {\n readonly path: string;\n readonly isChanged: boolean;\n readonly changes: readonly Change[];\n readonly manualSteps: readonly ManualStep[];\n}\n\nasync function migrateFile(\n path: string,\n dependencies: MigrateProjectDependencies,\n input: MigrateProjectInput,\n): Promise<FileReport | undefined> {\n const migrate = fileMigrationFor(path);\n if (migrate === undefined) {\n return undefined;\n }\n const text = await dependencies.files.read(path);\n const context: MigrationContext = { version: input.version, rewriter: dependencies.rewriter };\n const migration = migrate(text, path, context);\n const isChanged = migration.text !== text;\n if (isChanged && input.isWrite) {\n await dependencies.files.write(path, migration.text);\n }\n const { changes, manualSteps } = migration;\n if (isChanged || manualSteps.length > 0) {\n dependencies.logger.info(\"file_migrated\", { path, isChanged, changes, manualSteps });\n }\n return { path, isChanged, changes, manualSteps };\n}\n\n/**\n * Migrate every file of a project (ENGINEERING_PLAN 10.1): package.json files, pnpm catalogs,\n * module specifiers and `transform` callbacks in sources, and the generator command in scripts.\n * Writes only with `isWrite`. Returns the files with changes or manual steps, in path order.\n */\nexport async function migrateProject(\n dependencies: MigrateProjectDependencies,\n input: MigrateProjectInput,\n): Promise<FileReport[]> {\n const paths = (await dependencies.files.listFiles()).sort();\n dependencies.logger.info(\"migration_started\", { fileCount: paths.length, ...input });\n const reports: FileReport[] = [];\n for (const path of paths) {\n const report = await migrateFile(path, dependencies, input);\n if (report !== undefined && (report.isChanged || report.manualSteps.length > 0)) {\n reports.push(report);\n }\n }\n dependencies.logger.info(\"migration_finished\", { changedFiles: reports.length });\n return reports;\n}\n","/** Compile-time proof that a switch over a closed union handled every variant. */\nexport function assertNever(value: never): never {\n throw new Error(`Unexpected variant: ${JSON.stringify(value)}`);\n}\n","import { assertNever } from \"../domain/assert-never.js\";\nimport type { Change, ManualStep, TransformKeepReason } from \"../domain/migration-findings.js\";\n\n/** The user-facing text of the report (CODING_PRINCIPLES 7.8: kept apart from the logic). */\n\n// The same guide the generator links in its deprecation warning.\nconst IR_CALLBACKS_GUIDE =\n \"https://github.com/openapi-typesafe/openapi-typesafe/blob/main/docs/node.md#ir-callbacks\";\n\nexport function changeMessage(change: Change): string {\n switch (change.kind) {\n case \"dependency-renamed\":\n return `${change.field}: ${change.from} → ${change.to}@${change.spec}`;\n case \"catalog-entry-renamed\":\n return `catalog: ${change.from} → ${change.to}`;\n case \"command-renamed\":\n return `${change.location}: openapi-typescript → openapi-typesafe`;\n case \"flag-renamed\":\n return `${change.location}: ${change.from} → ${change.to}`;\n case \"specifier-renamed\":\n return `line ${change.line}: \"${change.from}\" → \"${change.to}\"`;\n case \"transform-rewritten\":\n return `line ${change.line}: transform returns type text; irCallbacks: true added`;\n default:\n return assertNever(change);\n }\n}\n\nconst KEEP_REASONS: Readonly<Record<TransformKeepReason, string>> = {\n \"other-callbacks\":\n \"postTransform or transformProperty are set too, and they need TypeScript nodes\",\n \"not-a-function\": \"it is not an inline function or a function of this file\",\n \"shared-function\": \"the function it names is used elsewhere too\",\n \"unknown-return\": \"a return value is not a plain ts.factory type\",\n};\n\nconst PEER_NOTE = \"users of this package must switch too (a breaking change for them)\";\nconst PINNED_NOTE = \"change it to openapi-typesafe@<version>\";\nconst DEEP_IMPORT_NOTE = \"imports a file inside the package; check that it exists\";\nconst KEPT_NOTE = `it works, with a deprecation warning. See ${IR_CALLBACKS_GUIDE}`;\nconst LEGACY_CALLBACK_NOTE = `receives TypeScript nodes (deprecated). See ${IR_CALLBACKS_GUIDE}`;\n\nexport function manualStepMessage(step: ManualStep): string {\n switch (step.kind) {\n case \"manifest-unreadable\":\n return `package.json is not valid JSON (${step.reason}); migrate it by hand`;\n case \"peer-dependency-renamed\":\n return `${step.name} is a peer dependency: ${PEER_NOTE}`;\n case \"spec-kept\":\n return `${step.name} kept the spec \"${step.spec}\": point it at an openapi-typesafe version`;\n case \"override-names-package\":\n return `\"${step.field}\" names ${step.name}: update or remove that override`;\n case \"versioned-command\":\n return `${step.location} runs a pinned openapi-typescript@<version>: ${PINNED_NOTE}`;\n case \"deep-import\":\n return `line ${step.line}: \"${step.specifier}\" ${DEEP_IMPORT_NOTE}`;\n case \"transform-not-rewritten\":\n return `line ${step.line}: transform kept (${KEEP_REASONS[step.reason]}); ${KEPT_NOTE}`;\n case \"legacy-callback\":\n return `line ${step.line}: ${step.callback} ${LEGACY_CALLBACK_NOTE}`;\n default:\n return assertNever(step);\n }\n}\n\nexport const NEXT_STEPS: readonly string[] = [\n \"Install: run your package manager's install, so the lockfile has the new packages.\",\n \"Regenerate your types and commit them once: the file header names openapi-typesafe now, \" +\n \"so `--check` fails until you do.\",\n \"Run your type check and tests.\",\n];\n\nexport const DRY_RUN_NOTE = \"Dry run: nothing was written. Run again with --write to apply.\";\nexport const WRITTEN_NOTE = \"Files were written.\";\nexport const NOTHING_FOUND =\n \"Nothing to migrate: no openapi-typescript, openapi-fetch, openapi-react-query \" +\n \"or openapi-typescript-helpers found.\";\n","import {\n changeMessage,\n DRY_RUN_NOTE,\n manualStepMessage,\n NEXT_STEPS,\n NOTHING_FOUND,\n WRITTEN_NOTE,\n} from \"./messages.js\";\nimport type { FileReport } from \"./migrate-project.js\";\n\nfunction changesSection(reports: readonly FileReport[]): string[] {\n const changed = reports.filter((report) => report.changes.length > 0);\n if (changed.length === 0) {\n return [];\n }\n return [\n \"Changes:\",\n ...changed.flatMap((report) => [\n ` ${report.path}`,\n ...report.changes.map((change) => ` ${changeMessage(change)}`),\n ]),\n \"\",\n ];\n}\n\nfunction manualStepsSection(reports: readonly FileReport[]): string[] {\n const steps = reports.flatMap((report) =>\n report.manualSteps.map((step) => ` ${report.path}: ${manualStepMessage(step)}`),\n );\n return steps.length === 0 ? [] : [\"Manual steps:\", ...steps, \"\"];\n}\n\n/** The summary the command prints: changes per file, manual steps, and what to do next. */\nexport function renderReport(reports: readonly FileReport[], isWrite: boolean): string {\n if (reports.length === 0) {\n return `${NOTHING_FOUND}\\n`;\n }\n const lines = [\n ...changesSection(reports),\n ...manualStepsSection(reports),\n \"Next steps:\",\n ...NEXT_STEPS.map((step, index) => ` ${index + 1}. ${step}`),\n \"\",\n isWrite ? WRITTEN_NOTE : DRY_RUN_NOTE,\n ];\n return `${lines.join(\"\\n\")}\\n`;\n}\n","import { parseArgs } from \"node:util\";\n\n/** What the command was asked to do. */\nexport type CliRequest =\n | { readonly kind: \"help\" }\n | { readonly kind: \"version\" }\n | {\n readonly kind: \"migrate\";\n readonly isWrite: boolean;\n readonly root: string | undefined;\n readonly logPath: string | undefined;\n };\n\nconst OPTIONS = {\n write: { type: \"boolean\" },\n root: { type: \"string\" },\n log: { type: \"string\" },\n help: { type: \"boolean\", short: \"h\" },\n version: { type: \"boolean\", short: \"v\" },\n} as const;\n\n/** Parse the arguments; unknown options and positionals throw a TypeError with Node's message. */\nexport function parseCliArguments(argv: readonly string[]): CliRequest {\n const { values } = parseArgs({ args: [...argv], options: OPTIONS, strict: true });\n if (values.help === true) {\n return { kind: \"help\" };\n }\n if (values.version === true) {\n return { kind: \"version\" };\n }\n return {\n kind: \"migrate\",\n isWrite: values.write === true,\n root: values.root,\n logPath: values.log,\n };\n}\n","/** The command's own text: help, usage errors and the closing notes. */\n\nexport const HELP_TEXT = `Usage\n openapi-typesafe-migrate [options]\n\nMove a project from openapi-typescript, openapi-fetch, openapi-react-query and\nopenapi-typescript-helpers to the openapi-typesafe packages. Without --write it only reports.\n\nOptions\n --write Write the changes (default: dry run)\n --root <dir> The project directory (default: the current directory)\n --log <file> The JSON Lines log file (default: a new file in the temporary directory)\n --help, -h Show this help\n --version, -v Show the version\n\nExit codes\n 0 Done\n 1 The migration failed (the message and the log say why)\n 2 Unknown option or argument\n`;\n\nexport const usageError = (message: string): string =>\n `${message}\\nRun openapi-typesafe-migrate --help for the options.\\n`;\n\nexport const logNote = (path: string): string => `Log: ${path}\\n`;\n","import { migrateProject } from \"../application/migrate-project.js\";\nimport type { CallbackRewriter, Logger, ProjectFiles } from \"../application/ports.js\";\nimport { renderReport } from \"../application/report.js\";\nimport { type CliRequest, parseCliArguments } from \"./cli-arguments.js\";\nimport { HELP_TEXT, logNote, usageError } from \"./cli-text.js\";\n\n/** Everything the command takes from the process, so tests run it with fakes. */\nexport interface CliDependencies {\n readonly version: string;\n readonly cwd: string;\n readonly writeStdout: (text: string) => void;\n readonly writeStderr: (text: string) => void;\n readonly createFiles: (root: string) => ProjectFiles;\n readonly createLogger: (path: string | undefined) => {\n readonly logger: Logger;\n readonly path: string;\n };\n readonly rewriter: CallbackRewriter;\n readonly resolvePath: (cwd: string, path: string) => string;\n}\n\nexport const EXIT_CODES = { success: 0, failure: 1, usage: 2 } as const;\n\nfunction parseRequest(\n argv: readonly string[],\n dependencies: CliDependencies,\n): CliRequest | undefined {\n try {\n return parseCliArguments(argv);\n } catch (error) {\n // parseArgs reports unknown options and stray positionals as a TypeError.\n if (error instanceof TypeError) {\n dependencies.writeStderr(usageError(error.message));\n return undefined;\n }\n throw error;\n }\n}\n\nasync function runMigration(\n request: Extract<CliRequest, { kind: \"migrate\" }>,\n dependencies: CliDependencies,\n): Promise<number> {\n const root = dependencies.resolvePath(dependencies.cwd, request.root ?? \".\");\n const { logger, path } = dependencies.createLogger(request.logPath);\n try {\n const files = dependencies.createFiles(root);\n const input = { version: dependencies.version, isWrite: request.isWrite };\n const reports = await migrateProject({ files, rewriter: dependencies.rewriter, logger }, input);\n dependencies.writeStdout(renderReport(reports, request.isWrite));\n return EXIT_CODES.success;\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n logger.warn(\"migration_failed\", { root, message });\n dependencies.writeStderr(`${message}\\n`);\n return EXIT_CODES.failure;\n } finally {\n dependencies.writeStdout(logNote(path));\n }\n}\n\n/** Run the command; resolves to the exit code. */\nexport async function runCli(\n argv: readonly string[],\n dependencies: CliDependencies,\n): Promise<number> {\n const request = parseRequest(argv, dependencies);\n if (request === undefined) {\n return EXIT_CODES.usage;\n }\n if (request.kind === \"help\") {\n dependencies.writeStdout(HELP_TEXT);\n return EXIT_CODES.success;\n }\n if (request.kind === \"version\") {\n dependencies.writeStdout(`${dependencies.version}\\n`);\n return EXIT_CODES.success;\n }\n return runMigration(request, dependencies);\n}\n","import { readFileSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join, resolve } from \"node:path\";\nimport { createJsonLinesLogger } from \"../adapters/json-lines-logger/json-lines-logger.js\";\nimport { createNodeProjectFiles } from \"../adapters/node-project-files/node-project-files.js\";\nimport { createTypescriptCallbackRewriter } from \"../adapters/typescript-parser/rewriter.js\";\nimport { type CliDependencies, runCli } from \"./run-cli.js\";\n\n/**\n * The composition root: the only module that touches the process. `bin/migrate.js` imports the\n * built copy of this module.\n */\n\n/** The same path from `src/cli/` and from the built `dist/cli/`. */\nconst PACKAGE_JSON = new URL(\"../../package.json\", import.meta.url);\nconst LOG_DIRECTORY = \"openapi-typesafe-migrate\";\n\nfunction readVersion(): string {\n const packageJson: { version: string } = JSON.parse(readFileSync(PACKAGE_JSON, \"utf8\"));\n return packageJson.version;\n}\n\nconst now = (): Date => new Date();\n\n/** Without `--log`, a new file per run in the temporary directory, named by its UTC start time. */\nfunction createLogger(path: string | undefined): ReturnType<CliDependencies[\"createLogger\"]> {\n const logPath =\n path === undefined\n ? join(tmpdir(), LOG_DIRECTORY, `${now().toISOString().replaceAll(\":\", \"-\")}.jsonl`)\n : resolve(path);\n return { logger: createJsonLinesLogger({ path: logPath, now }), path: logPath };\n}\n\nconst dependencies: CliDependencies = {\n version: readVersion(),\n cwd: process.cwd(),\n writeStdout: (text) => process.stdout.write(text),\n writeStderr: (text) => process.stderr.write(text),\n createFiles: createNodeProjectFiles,\n createLogger,\n rewriter: createTypescriptCallbackRewriter(),\n resolvePath: resolve,\n};\n\nrunCli(process.argv.slice(2), dependencies).then((exitCode) => {\n process.exitCode = exitCode;\n});\n"],"names":[],"mappings":";;;;;;;AAiBA,MAAM,eAAA,CAAkC;AAAA,EAC7B,QAAA;AAAA,EAET,YAAY,OAAA,EAAiC;AAC3C,IAAA,IAAA,CAAK,QAAA,GAAW,OAAA;AAChB,IAAA,SAAA,CAAU,QAAQ,OAAA,CAAQ,IAAI,GAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAAA,EACtD;AAAA,EAEA,IAAA,CAAK,KAAA,EAAe,MAAA,GAA4C,EAAC,EAAS;AACxE,IAAA,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,KAAA,EAAO,MAAM,CAAA;AAAA,EACpC;AAAA,EAEA,IAAA,CAAK,KAAA,EAAe,MAAA,GAA4C,EAAC,EAAS;AACxE,IAAA,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,KAAA,EAAO,MAAM,CAAA;AAAA,EACpC;AAAA,EAEA,OAAA,CAAQ,KAAA,EAAc,KAAA,EAAe,MAAA,EAAiD;AACpF,IAAA,MAAM,IAAA,GAAO,IAAA,CAAK,QAAA,CAAS,GAAA,GAAM,WAAA,EAAY;AAC7C,IAAA,cAAA,CAAe,IAAA,CAAK,QAAA,CAAS,IAAA,EAAM,CAAA,EAAG,IAAA,CAAK,SAAA,CAAU,EAAE,IAAA,EAAM,KAAA,EAAO,KAAA,EAAO,GAAG,MAAA,EAAQ,CAAC;AAAA,CAAI,CAAA;AAAA,EAC7F;AACF;AAGO,SAAS,sBAAsB,OAAA,EAAyC;AAC7E,EA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AC,IAAA,KAAS,OAAA,CAAQ,MAAA,CAAO,MAAM,IAAI,CAAA;AAAA,EAChD,WAAA,EAAa,sBAAA;AAAA,EACb,YAAA;AAAA,EACA,UAAU,gCAAA,EAAiC;AAAA,EAC3C,WAAA,EAAa;AACf,CAAA;AAEA,MAAA,CAAO,OAAA,CAAQ,KAAK,KAAA,CAAM,CAAC,GAAG,YAAY,CAAA,CAAE,IAAA,CAAK,CAAC,QAAA,KAAa;AAC7D,EAAA,OAAA,CAAQ,QAAA,GAAW,QAAA;AACrB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "openapi-typesafe-migrate",
3
- "version": "0.0.0",
4
- "description": "Reserved for openapi-typesafe. Contains no code.",
5
- "license": "MIT"
6
- }
3
+ "description": "Move a project from openapi-typescript and openapi-fetch to openapi-typesafe",
4
+ "version": "1.0.0-rc.1",
5
+ "author": {
6
+ "name": "Fedor Chishchin",
7
+ "url": "https://github.com/fedorello"
8
+ },
9
+ "license": "MIT",
10
+ "type": "module",
11
+ "bin": {
12
+ "openapi-typesafe-migrate": "bin/migrate.js"
13
+ },
14
+ "files": [
15
+ "bin",
16
+ "dist"
17
+ ],
18
+ "homepage": "https://github.com/openapi-typesafe/openapi-typesafe#readme",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/openapi-typesafe/openapi-typesafe.git",
22
+ "directory": "packages/openapi-typesafe-migrate"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/openapi-typesafe/openapi-typesafe/issues"
26
+ },
27
+ "keywords": [
28
+ "openapi",
29
+ "openapi-typescript",
30
+ "openapi-fetch",
31
+ "openapi-typesafe",
32
+ "codemod",
33
+ "migration"
34
+ ],
35
+ "dependencies": {
36
+ "@typescript/typescript6": "^6.0.2"
37
+ },
38
+ "devDependencies": {
39
+ "dependency-cruiser": "18.7.0",
40
+ "vite-node": "6.0.0"
41
+ },
42
+ "engines": {
43
+ "node": ">=22"
44
+ },
45
+ "scripts": {
46
+ "build": "unbuild",
47
+ "format": "biome format . --write",
48
+ "lint": "pnpm run lint:js && pnpm run lint:ts && pnpm run lint:deps && pnpm run lint:sizes",
49
+ "lint:js": "biome check .",
50
+ "lint:ts": "tsc --noEmit",
51
+ "lint:deps": "depcruise src --config .dependency-cruiser.cjs",
52
+ "lint:sizes": "vite-node ../openapi-typesafe/scripts/size-rules/check-sizes.ts src",
53
+ "test": "pnpm run test:js && pnpm run test:exports",
54
+ "test:js": "vitest run",
55
+ "test:coverage": "vitest run --coverage",
56
+ "test:exports": "pnpm run build && ../../scripts/check-exports.sh --cli-only"
57
+ }
58
+ }