Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
37aa66f
chore: update pnpm workspace configuration and tsconfig settings
el-j Oct 7, 2026
b11c11a
chore: remove got-fetch dependency from package.json and pnpm-lock.yaml
el-j Oct 7, 2026
b1b06d0
chore: remove ESLint configuration file and unused type annotation
el-j Oct 7, 2026
ae34496
feat: update context and documentation for TanStack React Query v5 br…
el-j Oct 7, 2026
6316cd5
feat: add Vitest configuration and setup for testing
el-j Oct 7, 2026
9baddfd
feat: enhance type safety in prompt handling and configuration functions
el-j Oct 7, 2026
9b76d4b
Refactor TypeScript type definitions for improved readability and con…
el-j Oct 7, 2026
d9742b4
feat: upgrade TypeScript to version 6.0.2 across all packages
el-j Oct 7, 2026
45e2f8f
wip: explore TypeScript 7 compatibility
el-j Oct 7, 2026
7110e38
Remove useless vitest config
fabien0102 Oct 26, 2026
ed286d9
Fix handlePromptCancel type
fabien0102 Oct 26, 2026
f134fe2
Remove deprecated options
fabien0102 Oct 26, 2026
68765eb
Remove casting
fabien0102 Oct 26, 2026
0eafb6e
Remove useless notes
fabien0102 Oct 26, 2026
f705e0c
Remove falsy breaking change
fabien0102 Oct 26, 2026
d56aaec
Use `npx @oxlint/migrate --type-aware` to bring back rules from eslint
fabien0102 Oct 26, 2026
a6275b4
fix: format .oxlintrc.json, type propertySchema without any, add test…
el-j Oct 26, 2026
b13d5e1
Merge branch 'feat/update-2-latest' into feat/typescript-7-upgrade
el-j Oct 26, 2026
b762471
chore: update dependencies (@types/node, got, oxlint, prettier, vitest)
el-j Oct 26, 2026
384d47e
Merge branch 'feat/update-2-latest' into feat/typescript-7-upgrade
el-j Oct 26, 2026
e48d2f3
chore: upgrade to typescript 7.1.0-beta
el-j Oct 26, 2026
7f85a14
feat(typescript): implement initial TypeScript 7 compatibility adapter
el-j Oct 26, 2026
5ebe88a
refactor: update lint configuration, add runtime/tooling configs, and…
el-j Oct 26, 2026
734dedd
feat(typescript): support full JSDoc and comment printing fidelity in…
el-j Oct 26, 2026
01f6018
Merge branch 'main' into feat/typescript-7-upgrade
el-j Oct 29, 2026
86aff5f
Merge branch 'main' of github.com:fabien0102/openapi-codegen into fea…
el-j Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"access": "public"
},
"scripts": {
"build": "vp pack",
"build": "vp pack --no-dts && tsc -p tsconfig.package.json --emitDeclarationOnly --declaration --outDir dist && cp dist/index.d.ts dist/index.d.mts",
"prepublishOnly": "pnpm build"
},
"dependencies": {
Expand All @@ -50,7 +50,7 @@
"slash": "^5.1.0",
"swagger2openapi": "^7.0.8",
"typanion": "^3.14.0",
"typescript": "~6.0.2"
"typescript": "7.1.0-beta"
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
Expand Down
3 changes: 2 additions & 1 deletion cli/src/commands/InitCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export class InitCommand extends Command {
ts.isExportAssignment(node) &&
ts.isCallExpression(node.expression) &&
ts.isIdentifier(node.expression.expression) &&
node.expression.expression.escapedText === "defineConfig"
((node.expression.expression as unknown as Record<string, unknown>)
.escapedText || node.expression.expression.text) === "defineConfig"
) {
isValidConfig = true;
}
Expand Down
16 changes: 12 additions & 4 deletions cli/src/core/updateConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ export function updateConfig({
context
) => {
const visit = (node: ts.Node): ts.Node => {
node = ts.visitEachChild(node, visit, context);
node = (
ts.visitEachChild as unknown as (
n: ts.Node,
v: typeof visit,
c: unknown
) => ts.Node
)(node, visit, context);

if (
ts.isImportDeclaration(node) &&
Expand Down Expand Up @@ -88,7 +94,8 @@ export function updateConfig({
ts.isExportAssignment(node) &&
ts.isCallExpression(node.expression) &&
ts.isIdentifier(node.expression.expression) &&
node.expression.expression.escapedText === "defineConfig"
((node.expression.expression as unknown as Record<string, unknown>)
.escapedText || node.expression.expression.text) === "defineConfig"
) {
const prevProperties = ts.isObjectLiteralExpression(
node.expression.arguments[0]
Expand Down Expand Up @@ -179,8 +186,9 @@ function createImportStatements(imports: Map<string, string[]>) {

function getText(expression: ts.Expression) {
try {
// @ts-expect-error private field
return (expression.text as string) ?? "";
return (
((expression as unknown as Record<string, unknown>).text as string) ?? ""
);
} catch {
return "";
}
Expand Down
5 changes: 3 additions & 2 deletions cli/src/utils/getText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import ts from "typescript";

export function getText(expression: ts.Expression) {
try {
// @ts-expect-error this is a private field
return (expression.text as string) ?? "";
return (
((expression as unknown as Record<string, unknown>).text as string) ?? ""
);
} catch {
return "";
}
Expand Down
2 changes: 1 addition & 1 deletion examples/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@types/react": "19.3.0",
"@types/react-dom": "19.3.0",
"@vitejs/plugin-react": "6.1.2",
"typescript": "~6.0.2",
"typescript": "7.1.0-beta",
"vite": "catalog:",
"vite-plus": "catalog:"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/node": "^26.6.6",
"all-contributors-cli": "7.0.3",
"knip": "^6.45.1",
"typescript": "~6.0.3",
"typescript": "7.1.0-beta",
"vite": "catalog:",
"vite-plus": "catalog:"
},
Expand Down
4 changes: 2 additions & 2 deletions plugins/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"access": "public"
},
"scripts": {
"build": "vp pack src/index.ts",
"build": "vp pack src/index.ts --no-dts && tsc -p tsconfig.package.json --emitDeclarationOnly --declaration --outDir dist && cp dist/index.d.ts dist/index.d.mts",
"prepublishOnly": "pnpm build"
},
"dependencies": {
"case-anything": "^3.1.7",
"lodash-es": "^4.18.1",
"openapi3-ts": "^4.6.1",
"pluralize": "^8.0.0",
"typescript": "~6.0.2"
"typescript": "7.1.0-beta"
},
"type": "module",
"devDependencies": {
Expand Down
6 changes: 4 additions & 2 deletions plugins/typescript/src/core/analyzeImportUsage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ const setParentReferences = <T extends ts.Node>(node: T): T => {
writable: true,
configurable: true,
});
child.forEachChild((grandChild) => setParent(grandChild, child));
ts.forEachChild(child, (grandChild) =>
setParent(grandChild as ts.Node, child)
);
}
node.forEachChild((child) => setParent(child, node));
ts.forEachChild(node, (child) => setParent(child as ts.Node, node));
return node;
};

Expand Down
2 changes: 1 addition & 1 deletion plugins/typescript/src/core/analyzeImportUsage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const analyzeImportUsage = (
return !(usages.type && usages.value);
}

return !node.forEachChild((child) => !checkNode(child));
return !ts.forEachChild(node, (child) => !checkNode(child as ts.Node));
};

nodes.every(checkNode);
Expand Down
16 changes: 11 additions & 5 deletions plugins/typescript/src/core/createNamedImport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,33 @@ const setParentReferences = (node: ts.Node): ts.Node => {
writable: true,
configurable: true,
});
n.forEachChild((child) => setParent(child, n));
n.forEachChild((child: ts.Node) => setParent(child, n));
};

node.forEachChild((child) => setParent(child, node));
node.forEachChild((child: ts.Node) => setParent(child, node));
return node;
};

describe("createNamedImport", () => {
it("should create a regular import when isTypeOnly is false", () => {
const result = createNamedImport("MyType", "./types", false);
expect(result.importClause?.isTypeOnly).toBe(false);
expect(
(result.importClause as unknown as Record<string, unknown>)?.isTypeOnly
).toBe(false);
});

it("should create a type-only import when isTypeOnly is true", () => {
const result = createNamedImport("MyType", "./types", true);
expect(result.importClause?.isTypeOnly).toBe(true);
expect(
(result.importClause as unknown as Record<string, unknown>)?.isTypeOnly
).toBe(true);
});

it("should handle array of imports", () => {
const result = createNamedImport(["Type1", "Type2"], "./types", true);
expect(result.importClause?.isTypeOnly).toBe(true);
expect(
(result.importClause as unknown as Record<string, unknown>)?.isTypeOnly
).toBe(true);
expect(result.importClause?.namedBindings).toBeDefined();
});
});
Expand Down
13 changes: 9 additions & 4 deletions plugins/typescript/src/core/getUsedImports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,27 @@ export const getUsedImports = (
const visitor: ts.Visitor = (node) => {
if (ts.isQualifiedName(node)) {
// We can’t use `node.left.getText()` because the node is not compiled (no internal `text` property)
const text = camelCase(get(node.left, "escapedText", "") as string);
const text = camelCase(
((get(node.left, "escapedText") || get(node.left, "text", "")) ??
"") as string
);
if (text in imports) {
imports[text as keyof typeof imports].used = true;
}
}
if (imports.utils.type === "named" && ts.isTypeReferenceNode(node)) {
if (get(node.typeName, "escapedText", "") === clientErrorStatus) {
const typeNameText =
get(node.typeName, "escapedText") || get(node.typeName, "text", "");
if (typeNameText === clientErrorStatus) {
imports.utils.used = true;
imports.utils.imports.add(clientErrorStatus);
}
if (get(node.typeName, "escapedText", "") === serverErrorStatus) {
if (typeNameText === serverErrorStatus) {
imports.utils.used = true;
imports.utils.imports.add(serverErrorStatus);
}
}
return node.forEachChild(visitor);
return ts.forEachChild(node, visitor);
};

ts.visitNodes(f.createNodeArray(nodes), visitor);
Expand Down
4 changes: 3 additions & 1 deletion plugins/typescript/src/generators/generateFetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ export const generateFetchers = async (context: Context, config: Config) => {
ts.forEachChild(fetcherSourceFile, (node) => {
if (
ts.isTypeAliasDeclaration(node) &&
node.name.escapedText === fetcherExtraPropsTypeName &&
(node.name.text ||
(node.name as unknown as Record<string, unknown>).escapedText) ===
fetcherExtraPropsTypeName &&
ts.isTypeLiteralNode(node.type) &&
node.type.members.length > 0
) {
Expand Down
Loading