Skip to content

Commit 026bfab

Browse files
authored
Merge branch 'hey-api:main' into main
2 parents a52092d + 4bc4dd1 commit 026bfab

File tree

3,116 files changed

+367689
-217085
lines changed

Some content is hidden

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

3,116 files changed

+367689
-217085
lines changed

.changeset/soft-wolves-develop.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(parser): input supports ReadMe API Registry with `readme:` prefix

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
* text=auto eol=lf
2+
bun.lockb linguist-generated=true
3+
package-lock.json linguist-generated=true
4+
pnpm-lock.yaml linguist-generated=true
5+
yarn.lock linguist-generated=true

.github/dependabot.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
matrix:
2020
os: [macos-latest, ubuntu-latest, windows-latest]
21-
node-version: ['18.20.5', '20.11.1', '22.11.0']
21+
node-version: ['20.19.0', '22.12.0']
2222
steps:
2323
- uses: actions/[email protected]
2424
with:
@@ -38,7 +38,7 @@ jobs:
3838
run: pnpm build --filter="@hey-api/**"
3939

4040
- name: Build examples
41-
if: matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest'
41+
if: matrix.node-version == '22.12.0' && matrix.os == 'ubuntu-latest'
4242
run: pnpm build --filter="@examples/**"
4343

4444
- name: Run linter
@@ -54,7 +54,7 @@ jobs:
5454
run: pnpm test:e2e
5555

5656
- name: Publish preview packages
57-
if: github.event_name == 'pull_request' && matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest'
57+
if: github.event_name == 'pull_request' && matrix.node-version == '22.12.0' && matrix.os == 'ubuntu-latest'
5858
run: ./scripts/publish-preview-packages.sh
5959
env:
6060
TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.11.0
1+
22.12.0

debug-helpers/graph-hotspots.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import fs from 'node:fs';
2+
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = path.dirname(__filename);
7+
8+
// Load your exported graph
9+
const nodes = JSON.parse(
10+
fs.readFileSync(path.resolve(__dirname, 'graph.json'), 'utf-8'),
11+
);
12+
13+
// Annotate nodes with children count
14+
const annotatedNodes = nodes.map((n) => ({
15+
childrenCount: n.childrenPointers?.length ?? 0,
16+
pointer: n.pointer,
17+
}));
18+
19+
// Sort by childrenCount descending
20+
annotatedNodes.sort((a, b) => b.childrenCount - a.childrenCount);
21+
22+
// Print top 20 hotspots
23+
console.log('Top 20 potential bottleneck nodes:\n');
24+
annotatedNodes.slice(0, 20).forEach((n) => {
25+
console.log(`${n.pointer} — children: ${n.childrenCount}`);
26+
});

debug-helpers/json-to-dot.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import fs from 'node:fs';
2+
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = path.dirname(__filename);
7+
8+
const nodes = JSON.parse(
9+
fs.readFileSync(path.resolve(__dirname, 'graph.json'), 'utf-8'),
10+
);
11+
12+
// --- Filter nodes for readability ---
13+
const threshold = 10; // high-fanout threshold
14+
const filteredSet = new Set();
15+
16+
// Include nodes with children > threshold and their immediate children
17+
for (const n of nodes) {
18+
const childCount = n.childrenPointers?.length ?? 0;
19+
if (childCount > threshold) {
20+
filteredSet.add(n.pointer);
21+
for (const child of n.childrenPointers || []) {
22+
filteredSet.add(child);
23+
}
24+
}
25+
}
26+
27+
// Filtered nodes list
28+
const filteredNodes = nodes.filter((n) => filteredSet.has(n.pointer));
29+
30+
// Start the .dot file
31+
let dot = 'digraph OpenAPIGraph {\nrankdir=LR;\nnode [style=filled];\n';
32+
33+
// Add nodes with color based on fanout
34+
for (const n of filteredNodes) {
35+
const childCount = n.childrenPointers?.length ?? 0;
36+
const color =
37+
childCount > 50 ? 'red' : childCount > 20 ? 'orange' : 'lightgray';
38+
dot += `"${n.pointer}" [label="${n.pointer}\\n${childCount} children", fillcolor=${color}];\n`;
39+
}
40+
41+
// Add edges: node -> its children
42+
for (const n of filteredNodes) {
43+
for (const child of n.childrenPointers || []) {
44+
if (filteredSet.has(child)) {
45+
dot += `"${n.pointer}" -> "${child}";\n`;
46+
}
47+
}
48+
}
49+
50+
dot += '}\n';
51+
52+
// Write to a file
53+
fs.writeFileSync(path.resolve(__dirname, 'graph.dot'), dot);
54+
console.log('graph.dot created!');
55+
56+
// Instructions:
57+
// Render with Graphviz:
58+
// dot -Tpng graph.dot -o graph.png
59+
// or
60+
// dot -Tsvg graph.dot -o graph.svg

docs/.vitepress/config/en.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ export default defineConfig({
9494
link: '/openapi-ts/clients/fetch',
9595
text: 'Fetch API',
9696
},
97+
{
98+
link: '/openapi-ts/clients/angular',
99+
text: 'Angular',
100+
},
97101
{
98102
link: '/openapi-ts/clients/axios',
99103
text: 'Axios',
@@ -106,10 +110,6 @@ export default defineConfig({
106110
link: '/openapi-ts/clients/nuxt',
107111
text: 'Nuxt',
108112
},
109-
{
110-
link: '/openapi-ts/clients/angular',
111-
text: 'Angular <span data-soon>soon</span>',
112-
},
113113
{
114114
link: '/openapi-ts/clients/effect',
115115
text: 'Effect <span data-soon>soon</span>',
@@ -218,6 +218,10 @@ export default defineConfig({
218218
{
219219
collapsed: true,
220220
items: [
221+
{
222+
link: '/openapi-ts/plugins/angular',
223+
text: 'Angular',
224+
},
221225
{
222226
link: '/openapi-ts/plugins/fastify',
223227
text: 'Fastify',

docs/.vitepress/config/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
import { defineConfig } from 'vitepress';
22

3-
import en from './en';
4-
import shared from './shared';
3+
import en from './en.js';
4+
import shared from './shared.js';
55

66
export default defineConfig({
77
...shared,
88
locales: {
99
...shared.locales,
1010
root: { label: 'English', ...en },
1111
},
12-
vite: {
13-
...shared.vite,
14-
resolve: {
15-
...shared.vite?.resolve,
16-
preserveSymlinks: true,
17-
},
18-
},
1912
});

docs/.vitepress/config/shared.ts

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import path from 'node:path';
2+
13
import { defineConfig, type HeadConfig } from 'vitepress';
4+
import llmstxt from 'vitepress-plugin-llms';
25

36
const domain = process.env.SITE_DOMAIN || 'http://localhost:5173';
47

@@ -32,14 +35,13 @@ export default defineConfig({
3235
type: 'image/png',
3336
},
3437
],
35-
[
36-
'script',
37-
{},
38-
'window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };',
39-
],
4038
process.env.NODE_ENV === 'production' && [
4139
'script',
42-
{ defer: '', src: '/_vercel/insights/script.js' },
40+
{
41+
'data-website-id': '4dffba2d-03a6-4358-9d90-229038c8575d',
42+
defer: '',
43+
src: 'https://cloud.umami.is/script.js',
44+
},
4345
],
4446
].filter(Boolean) as Array<HeadConfig>,
4547
lastUpdated: true,
@@ -54,10 +56,18 @@ export default defineConfig({
5456
externalLinkIcon: true,
5557
logo: '/images/logo-48w.png',
5658
search: {
57-
provider: 'local',
59+
options: {
60+
apiKey: '2565c35b4ad91c2f8f8ae32cf9bbe899',
61+
appId: 'OWEH2O8E50',
62+
disableUserPersonalization: false,
63+
indexName: 'openapi-ts docs',
64+
insights: true,
65+
},
66+
provider: 'algolia',
5867
},
5968
socialLinks: [
6069
{ icon: 'linkedin', link: 'https://linkedin.com/company/heyapi' },
70+
{ icon: 'bluesky', link: 'https://bsky.app/profile/heyapi.dev' },
6171
{ icon: 'x', link: 'https://x.com/mrlubos' },
6272
{ icon: 'github', link: 'https://github.com/hey-api/openapi-ts' },
6373
],
@@ -99,4 +109,30 @@ export default defineConfig({
99109
],
100110
);
101111
},
112+
vite: {
113+
plugins: [
114+
llmstxt({
115+
experimental: {
116+
depth: 2,
117+
},
118+
}),
119+
],
120+
resolve: {
121+
alias: [
122+
{
123+
find: '@components',
124+
replacement: path.resolve(__dirname, '..', 'theme', 'components'),
125+
},
126+
{
127+
find: '@data',
128+
replacement: path.resolve(__dirname, '..', '..', 'data'),
129+
},
130+
{
131+
find: '@versions',
132+
replacement: path.resolve(__dirname, '..', 'theme', 'versions'),
133+
},
134+
],
135+
preserveSymlinks: true,
136+
},
137+
},
102138
});

0 commit comments

Comments
 (0)