Skip to content

Commit fa2f9dc

Browse files
committed
feat: add typescript-nextjs
# Conflicts: # packages/openapi-code-generator/src/typescript/client/typescript-fetch/typescript-fetch-client-builder.ts
1 parent f4187f7 commit fa2f9dc

File tree

35 files changed

+1811
-313
lines changed

35 files changed

+1811
-313
lines changed

biome.json

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"files": {
1212
"ignore": [
1313
"integration-tests/**/generated/*",
14+
"integration-tests/typescript-nextjs/src/app/**/*",
1415
"integration-tests-definitions/**/*",
1516
"e2e/src/generated/**/*",
1617
"schemas/*.json",
@@ -42,6 +43,7 @@
4243
"packages/openapi-code-generator/src/core/schemas/openapi-3.0-specification-validator.js",
4344
"packages/openapi-code-generator/src/core/schemas/openapi-3.1-specification-validator.js",
4445
"integration-tests/**/generated/*",
46+
"integration-tests/typescript-nextjs/src/app/**/*",
4547
"integration-tests-definitions/**/*",
4648
"e2e/src/generated/**/*",
4749
"schemas/*.json",
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {};
2+
const nextConfig = {}
33

4-
export default nextConfig;
4+
export default nextConfig

integration-tests/typescript-nextjs/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
"build": "next build",
88
"start": "next start",
99
"lint": "next lint",
10-
"clean": "rm -rf ./.next && rm -rf ./src/api",
10+
"clean": "rm -rf ./.next && rm -rf ./src/generated && rm -rf -- ./src/app/*/",
1111
"validate": "tsc -p ./tsconfig.json"
1212
},
1313
"dependencies": {
14-
"next": "14.1.4",
15-
"react": "^18",
16-
"react-dom": "^18"
14+
"next": "^15.3.1",
15+
"react": "^19.1.0",
16+
"react-dom": "^19.1.0"
1717
},
1818
"devDependencies": {
19-
"@types/node": "^20",
20-
"@types/react": "^18",
21-
"@types/react-dom": "^18",
22-
"typescript": "^5"
19+
"@types/node": "^22.15.3",
20+
"@types/react": "^19.1.2",
21+
"@types/react-dom": "^19.1.3",
22+
"typescript": "^5.8.3"
2323
}
2424
}

integration-tests/typescript-nextjs/src/app/globals.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
:root {
22
--max-width: 1100px;
33
--border-radius: 12px;
4-
--font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono",
4+
--font-mono:
5+
ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono",
56
"Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro",
67
"Fira Mono", "Droid Sans Mono", "Courier New", monospace;
78

Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import type { Metadata } from "next";
2-
import { Inter } from "next/font/google";
3-
import "./globals.css";
1+
import type {Metadata} from "next"
2+
import {Inter} from "next/font/google"
3+
import "./globals.css"
44

5-
const inter = Inter({ subsets: ["latin"] });
5+
const inter = Inter({subsets: ["latin"]})
66

77
export const metadata: Metadata = {
88
title: "Create Next App",
99
description: "Generated by create next app",
10-
};
10+
}
1111

1212
export default function RootLayout({
1313
children,
1414
}: Readonly<{
15-
children: React.ReactNode;
15+
children: React.ReactNode
1616
}>) {
1717
return (
1818
<html lang="en">
1919
<body className={inter.className}>{children}</body>
2020
</html>
21-
);
21+
)
2222
}

integration-tests/typescript-nextjs/src/app/page.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Image from "next/image";
2-
import styles from "./page.module.css";
1+
import Image from "next/image"
2+
import styles from "./page.module.css"
33

44
export default function Home() {
55
return (
@@ -91,5 +91,5 @@ export default function Home() {
9191
</a>
9292
</div>
9393
</main>
94-
);
94+
)
9595
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {
2+
_GET,
3+
_POST,
4+
} from "../../../generated/todo-lists.yaml/attachments/route"
5+
6+
export const GET = _GET(async ({}, respond, context) => {
7+
// TODO: implementation
8+
return respond.withStatus(501).body({ message: "not implemented" } as any)
9+
})
10+
export const POST = _POST(async ({ body }, respond, context) => {
11+
// TODO: implementation
12+
return respond.withStatus(501).body({ message: "not implemented" } as any)
13+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {
2+
_GET,
3+
_POST,
4+
} from "../../../../../generated/todo-lists.yaml/list/[listId]/items/route"
5+
6+
export const GET = _GET(async ({ params }, respond, context) => {
7+
// TODO: implementation
8+
return respond.withStatus(501).body({ message: "not implemented" } as any)
9+
})
10+
export const POST = _POST(async ({ params, body }, respond, context) => {
11+
// TODO: implementation
12+
return respond.withStatus(501).body({ message: "not implemented" } as any)
13+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {
2+
_GET,
3+
_PUT,
4+
_DELETE,
5+
} from "../../../../generated/todo-lists.yaml/list/[listId]/route"
6+
7+
export const GET = _GET(async ({ params }, respond, context) => {
8+
// TODO: implementation
9+
return respond.withStatus(501).body({ message: "not implemented" } as any)
10+
})
11+
export const PUT = _PUT(async ({ params, body }, respond, context) => {
12+
// TODO: implementation
13+
return respond.withStatus(501).body({ message: "not implemented" } as any)
14+
})
15+
export const DELETE = _DELETE(async ({ params }, respond, context) => {
16+
// TODO: implementation
17+
return respond.withStatus(501).body({ message: "not implemented" } as any)
18+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { _GET } from "../../../generated/todo-lists.yaml/list/route"
2+
3+
export const GET = _GET(async ({ query }, respond, context) => {
4+
// TODO: implementation
5+
return respond.withStatus(501).body({ message: "not implemented" } as any)
6+
})

integration-tests/typescript-nextjs/src/generated/todo-lists.yaml/attachments/route.ts

+111
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)