Skip to content

Commit b49032a

Browse files
authored
Merge branch 'main' into issue-2395
2 parents ae99831 + d08100b commit b49032a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3675
-327
lines changed

.changeset/eight-pillows-wash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": patch
3+
---
4+
5+
feat(tanstack-query): support generating `meta` fields

.changeset/hip-teachers-kiss.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": patch
3+
---
4+
5+
fix(sdk): prevent infinite loop when a schema tag matches operation ID

docs/.vitepress/config/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,5 @@ export default defineConfig({
305305
},
306306
],
307307
},
308+
title: 'Hey API',
308309
});

docs/.vitepress/config/shared.ts

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { defineConfig, type HeadConfig } from 'vitepress';
22

3+
const domain = process.env.SITE_DOMAIN || 'http://localhost:5173';
4+
35
export default defineConfig({
46
cleanUrls: true,
57
head: [
@@ -30,19 +32,6 @@ export default defineConfig({
3032
type: 'image/png',
3133
},
3234
],
33-
['meta', { content: 'website', property: 'og:type' }],
34-
['meta', { content: 'en', property: 'og:locale' }],
35-
[
36-
'meta',
37-
{
38-
content:
39-
'🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.',
40-
property: 'og:title',
41-
},
42-
],
43-
['meta', { content: 'OpenAPI TypeScript', property: 'og:site_name' }],
44-
['meta', { content: '/images/logo-640w.png', property: 'og:image' }],
45-
['meta', { content: 'https://heyapi.dev', property: 'og:url' }],
4635
[
4736
'script',
4837
{},
@@ -52,10 +41,14 @@ export default defineConfig({
5241
'script',
5342
{ defer: '', src: '/_vercel/insights/script.js' },
5443
],
55-
].filter(Boolean) as HeadConfig[],
56-
lastUpdated: false,
44+
].filter(Boolean) as Array<HeadConfig>,
45+
lastUpdated: true,
5746
sitemap: {
58-
hostname: 'https://heyapi.dev',
47+
hostname: domain,
48+
lastmodDateOnly: true,
49+
// filter out everything but index and `openapi-ts` pages
50+
transformItems: (items) =>
51+
items.filter((item) => !item.url || item.url.startsWith('openapi-ts')),
5952
},
6053
themeConfig: {
6154
externalLinkIcon: true,
@@ -69,5 +62,41 @@ export default defineConfig({
6962
{ icon: 'github', link: 'https://github.com/hey-api/openapi-ts' },
7063
],
7164
},
72-
title: 'Hey API',
65+
transformPageData: (pageData, context) => {
66+
pageData.frontmatter.head ??= [];
67+
68+
const canonicalUrl = pageData.relativePath
69+
.replace(/index\.md$/, '')
70+
.replace(/\.md$/, context.siteConfig.cleanUrls ? '' : '.html');
71+
const url = `${domain}/${canonicalUrl}`;
72+
73+
const head: Array<HeadConfig> = pageData.frontmatter.head;
74+
head.unshift(
75+
['link', { href: url, rel: 'canonical' }],
76+
['meta', { content: 'website', property: 'og:type' }],
77+
['meta', { content: 'en_US', property: 'og:locale' }],
78+
['meta', { content: 'Hey API', property: 'og:site_name' }],
79+
[
80+
'meta',
81+
{ content: `${domain}/images/logo-640w.png`, property: 'og:image' },
82+
],
83+
['meta', { content: url, property: 'og:url' }],
84+
[
85+
'meta',
86+
{
87+
content:
88+
pageData.frontmatter.description ||
89+
'🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.',
90+
property: 'og:description',
91+
},
92+
],
93+
[
94+
'meta',
95+
{
96+
content: pageData.frontmatter.title || 'OpenAPI TypeScript',
97+
property: 'og:title',
98+
},
99+
],
100+
);
101+
},
73102
});

docs/.vitepress/theme/custom.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,3 +404,8 @@ a.migration:focus {
404404
background-color: var(--vp-sidebar-bg-color);
405405
}
406406
}
407+
408+
footer.VPDocFooter > .edit-info > .last-updated {
409+
/* don't render last updated date */
410+
display: none;
411+
}

docs/openapi-ts/clients/axios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ client.setConfig({
238238

239239
You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom instance to be.
240240

241-
## Config API
241+
## API
242242

243243
You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@hey-api/client-axios/types.d.ts) interface.
244244

docs/openapi-ts/clients/fetch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ client.setConfig({
295295

296296
You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom method to be.
297297

298-
## Config API
298+
## API
299299

300300
You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@hey-api/client-fetch/types.d.ts) interface.
301301

docs/openapi-ts/clients/next-js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ client.setConfig({
282282

283283
You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom method to be.
284284

285-
## Config API
285+
## API
286286

287287
You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@hey-api/client-next/types.d.ts) interface.
288288

docs/openapi-ts/clients/nuxt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ client.setConfig({
251251

252252
You can use any of the approaches mentioned in [Configuration](#configuration), depending on how granular you want your custom method to be.
253253

254-
## Config API
254+
## API
255255

256256
You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@hey-api/client-nuxt/types.d.ts) interface.
257257

docs/openapi-ts/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Plugins are responsible for generating artifacts from your input. By default, He
155155

156156
You can learn more on the [Output](/openapi-ts/output) page.
157157

158-
## Config API
158+
## API
159159

160160
You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/types/config.d.ts) interface.
161161

0 commit comments

Comments
 (0)