Skip to content

Commit da3a024

Browse files
author
asst2411038
committed
main pull
2 parents ccf4c8a + 30070e5 commit da3a024

File tree

436 files changed

+383166
-32246
lines changed

Some content is hidden

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

436 files changed

+383166
-32246
lines changed

.changeset/happy-singers-fry.md

-5
This file was deleted.

.changeset/little-knives-design.md

-5
This file was deleted.

.github/workflows/issue-stale.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
steps:
1111
- uses: actions/stale@v9
1212
with:
13-
stale-issue-message: "This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed."
13+
stale-issue-message: "This issue is stale because it has been open for 180 days with no activity. If there is no activity in the next 7 days, the issue will be closed."
1414
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem."
1515
ascending: false
1616
operations-per-run: 300
17-
days-before-issue-stale: 90
17+
days-before-issue-stale: 180
1818
days-before-issue-close: 7
1919
days-before-pr-stale: -1
2020
days-before-pr-close: -1

.github/workflows/release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
changelog:
1010
runs-on: ubuntu-latest
11+
if: ${{ github.repository_owner == 'openapi-ts' }}
1112
permissions:
1213
contents: write
1314
pull-requests: write
@@ -28,5 +29,5 @@ jobs:
2829
commit: "[ci] release"
2930
title: "[ci] release"
3031
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
GITHUB_TOKEN: ${{ secrets.OPENAPI_TS_BOT_GITHUB_TOKEN }}
3233
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
dist
33
node_modules
4+
coverage
45

56
packages/openapi-typescript/test/fixtures/cli-outputs/out
67

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"[markdown]": {
99
"editor.defaultFormatter": "esbenp.prettier-vscode"
1010
},
11-
"[typescript]": {
11+
"[typescript][typescriptreact]": {
1212
"editor.defaultFormatter": "biomejs.biome"
1313
}
1414
}

README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,23 @@ Ultra-fast fetching for TypeScript generated automatically from your OpenAPI sch
1616

1717
### 🥇 Gold Sponsors
1818

19-
<p align="center"><a href="https://zuplo.link/openapi-ts-gh"><img width="128" height="128" alt="Zuplo" src="https://avatars.githubusercontent.com/u/85497839?s=200&v=4"></a></p>
19+
<p align="center">
20+
<a href="https://zuplo.link/openapi-ts-gh"><img width="120" height="120" alt="Zuplo" src="https://avatars.githubusercontent.com/u/85497839?s=200&v=4"></a>
21+
<a href="https://www.speakeasy.com/product/sdk-generation?utm_source=pow_openapi_ts" target="_blank"><img width="276" height="120" src="./docs/public/assets/speakeasy.svg" /></a>
22+
</p>
2023

2124
### 🥈 Silver Sponsors
2225

2326
<p align="center"><a href="https://github.com/nanabit-inc"><img width="128" height="128" alt="nanabit" src="https://avatars.githubusercontent.com/u/154126976?s=200&v=4"></a></p>
2427

2528
### Backers
2629

27-
<p align="center"><a href="https://github.com/customerio"><img width="64" height="64" alt="@customerio on GitHub" src="https://avatars.githubusercontent.com/u/1152079?s=200&v=4"></a>
28-
<a href="https://github.com/shaunpersad"><img width="64" height="64" alt="@shaunpersad on GitHub" src="https://avatars.githubusercontent.com/u/1702976?s=52&v=4"></a><a href="https://github.com/yoshi2no"><img width="64" height="64" alt="@yoshi2no on GitHub" src="https://avatars.githubusercontent.com/u/57059705?v=4"></a></p>
30+
<p align="center">
31+
<a href="https://github.com/customerio"><img width="64" height="64" alt="@customerio on GitHub" src="https://avatars.githubusercontent.com/u/1152079?s=200&v=4"></a>
32+
<a href="https://github.com/shaunpersad"><img width="64" height="64" alt="@shaunpersad on GitHub" src="https://avatars.githubusercontent.com/u/1702976?s=52&v=4"></a>
33+
<a href="https://github.com/yoshi2no"><img width="64" height="64" alt="@yoshi2no on GitHub" src="https://avatars.githubusercontent.com/u/57059705?v=4"></a>
34+
<a href="https://github.com/siketyan"><img width="64" height="64" alt="@siketyan on GitHub" src="https://avatars.githubusercontent.com/u/12772118?v=4"></a>
35+
</p>
2936

3037
Become a sponsor by supporting this project on [OpenCollective](https://opencollective.com/openapi-ts)!
3138

biome.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
33
"organizeImports": {
44
"enabled": false
55
},

docs/.vitepress/en.ts

+44-4
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,48 @@ export default defineConfig({
7171
},
7272
{
7373
text: "openapi-react-query",
74+
base: "/openapi-react-query",
7475
items: [
75-
{ text: "Getting Started", link: "/openapi-react-query/" },
76-
{ text: "useQuery", link: "/openapi-react-query/use-query" },
77-
{ text: "useMutation", link: "/openapi-react-query/use-mutation" },
78-
{ text: "useSuspenseQuery", link: "/openapi-react-query/use-suspense-query" },
76+
{ text: "Getting Started", link: "/" },
77+
{ text: "useQuery", link: "/use-query" },
78+
{ text: "useMutation", link: "/use-mutation" },
79+
{
80+
text: "useSuspenseQuery",
81+
link: "/use-suspense-query",
82+
},
83+
{
84+
text: "queryOptions",
85+
link: "/query-options",
86+
},
7987
{ text: "About", link: "/openapi-react-query/about" },
8088
],
8189
},
90+
{
91+
text: "swr-openapi",
92+
base: "/swr-openapi",
93+
items: [
94+
{ text: "Getting Started", link: "/" },
95+
{ text: "Hook Builders", link: "/hook-builders" },
96+
{ text: "useQuery", link: "/use-query" },
97+
{ text: "useImmutable", link: "/use-immutable" },
98+
{ text: "useInfinite", link: "/use-infinite" },
99+
{ text: "useMutate", link: "/use-mutate" },
100+
{ text: "About", link: "/about" },
101+
],
102+
},
103+
{
104+
text: "openapi-metadata",
105+
base: "/openapi-metadata",
106+
items: [
107+
{ text: "Getting Started", link: "/" },
108+
{ text: "Decorators", link: "/decorators" },
109+
{ text: "Metadata", link: "/metadata" },
110+
{ text: "Type loader", link: "/type-loader" },
111+
{ text: "UI Integrations", link: "/ui" },
112+
{ text: "Examples", link: "/examples" },
113+
{ text: "About", link: "/about" },
114+
],
115+
},
82116
],
83117
},
84118
search: {
@@ -89,6 +123,12 @@ export default defineConfig({
89123
indexName: "openapi-ts",
90124
},
91125
},
126+
socialLinks: [
127+
{
128+
icon: "github",
129+
link: "https://github.com/openapi-ts/openapi-typescript",
130+
},
131+
],
92132
footer: {
93133
message:
94134
'Released under the <a href="https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-typescript/LICENSE">MIT License</a>.',

docs/.vitepress/shared.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { UserConfig } from "vitepress";
1+
import type { UserConfig, DefaultTheme } from "vitepress";
22
import { zhSearch } from "./zh";
33
import { jaSearch } from "./ja";
44

@@ -26,6 +26,7 @@ const shared: UserConfig = {
2626
themeConfig: {
2727
siteTitle: false,
2828
logo: "/assets/openapi-ts.svg",
29+
outline: 'deep',
2930
search: {
3031
provider: "algolia",
3132
options: {
@@ -44,7 +45,7 @@ const shared: UserConfig = {
4445
},
4546
{ icon: "github", link: "https://github.com/openapi-ts/openapi-typescript" },
4647
],
47-
},
48+
} satisfies DefaultTheme.Config,
4849
transformPageData({ relativePath, frontmatter }) {
4950
frontmatter.head ??= [];
5051
frontmatter.head.push([

docs/.vitepress/theme/CustomLayout.vue

+18-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,16 @@ const { Layout } = DefaultTheme;
4242
<!-- Silver sponsor logos -->
4343
<template #sidebar-nav-after>
4444
<div class="sidenav-sponsors">
45+
<h5>Gold Sponsors</h5>
46+
<ul class="sponsor-list sponsor-list--gold">
47+
<li v-for="sponsor in sponsors.gold" :key="sponsor.name">
48+
<a :href="sponsor.url" target="_blank" :title="sponsor.name">
49+
<img :src="sponsor.logo" :alt="sponsor.description" />
50+
</a>
51+
</li>
52+
</ul>
4553
<h5>Silver Sponsors</h5>
46-
<ul>
54+
<ul class="sponsor-list sponsor-list--silver">
4755
<li v-for="sponsor in sponsors.silver" :key="sponsor.name">
4856
<a :href="sponsor.url" target="_blank" :title="sponsor.name">
4957
<img :src="sponsor.logo" :alt="sponsor.description" />
@@ -124,11 +132,18 @@ const { Layout } = DefaultTheme;
124132
flex-wrap: wrap;
125133
gap: 1.25rem;
126134
list-style: none;
127-
margin: 1.5rem 0 0;
135+
margin: 1rem 0;
128136
padding: 0;
129137
}
130138
131-
.sidenav-sponsors img {
139+
.sponsor-list--gold {
140+
img {
141+
height: auto;
142+
width: 100%;
143+
}
144+
}
145+
146+
.sponsor-list--silver img {
132147
height: 3rem;
133148
width: auto;
134149
}

docs/.vitepress/theme/SponsorList.vue

+23-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,19 @@ import sponsors from "../../data/sponsors.json";
55
<template>
66
<ul class="sponsors-list">
77
<li
8-
v-for="sponsor in [...sponsors.gold, ...sponsors.silver]"
8+
v-for="sponsor in sponsors.gold"
9+
class="sponsor sponsor--gold"
10+
:key="sponsor.name"
11+
>
12+
<a :href="sponsor.url" target="_blank" :title="sponsor.name">
13+
<img :src="sponsor.logo" :alt="sponsor.description" />
14+
</a>
15+
</li>
16+
</ul>
17+
<ul class="sponsors-list">
18+
<li
19+
v-for="sponsor in sponsors.silver"
20+
class="sponsor sponsor--silver"
921
:key="sponsor.name"
1022
>
1123
<a :href="sponsor.url" target="_blank" :title="sponsor.name">
@@ -23,17 +35,22 @@ import sponsors from "../../data/sponsors.json";
2335
list-style: none;
2436
justify-content: center;
2537
gap: 1.5rem;
26-
margin: 0;
38+
margin: 0 auto 3rem;
2739
padding: 0;
2840
}
2941
30-
.sponsors-list li {
31-
margin: 0;
32-
padding: 0;
42+
.sponsor--gold img {
43+
height: 8rem;
44+
width: auto;
3345
}
3446
35-
.sponsors-list img {
47+
.sponsor--silver img {
3648
height: 3rem;
3749
width: auto;
3850
}
51+
52+
.sponsors-list li {
53+
margin: 0;
54+
padding: 0;
55+
}
3956
</style>

docs/cli.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ In previous versions globbing was supported, but that has been **deprecated** in
6565

6666
## Redocly config
6767

68-
A `redocly.yaml` file isn’t required to use openapi-typescript. By default it extends the `"minimal"` built-in config. But it is recommended if you want to have custom validation rules (or build types for [multiple schemas](#multiple-schemas)). The CLI will try to automatically find a `redocly.yaml` in the root of your project, but you can also provide its location with the `--redoc` flag:
68+
A `redocly.yaml` file isn’t required to use openapi-typescript. By default it extends the `"minimal"` built-in config. But it is recommended if you want to have custom validation rules (or build types for [multiple schemas](#multiple-schemas)). The CLI will try to automatically find a `redocly.yaml` in the root of your project, but you can also provide its location with the `--redocly` flag:
6969

7070
```bash
7171
npx openapi-typescript --redocly ./path/to/redocly.yaml
@@ -104,21 +104,23 @@ The following flags are supported in the CLI:
104104
| `--help` | | | Display inline help message and exit |
105105
| `--version` | | | Display this library’s version and exit |
106106
| `--output [location]` | `-o` | (stdout) | Where should the output file be saved? |
107-
| `--redocly [location]` | | | Path to a `redocly.yaml` file (see [Multiple schemas](#multiple-schemas)) |
107+
| `--redocly [location]` | | | Path to a `redocly.yaml` file (see [Multiple schemas](#multiple-schemas)) |
108108
| `--additional-properties` | | `false` | Allow arbitrary properties for all schema objects without `additionalProperties: false` |
109109
| `--alphabetize` | | `false` | Sort types alphabetically |
110110
| `--array-length` | | `false` | Generate tuples using array `minItems` / `maxItems` |
111-
| `--default-non-nullable` | | `true` | Treat schema objects with default values as non-nullable (with the exception of parameters) |
111+
| `--default-non-nullable` | | `true` | Treat schema objects with default values as non-nullable (with the exception of parameters) |
112112
| `--properties-required-by-default` | | `false` | Treat schema objects without `required` as having all properties required. |
113113
| `--empty-objects-unknown` | | `false` | Allow arbitrary properties for schema objects with no specified properties, and no specified `additionalProperties` |
114114
| `--enum` | | `false` | Generate true [TS enums](https://www.typescriptlang.org/docs/handbook/enums.html) rather than string unions. |
115115
| `--enum-values` | | `false` | Export enum values as arrays. |
116116
| `--dedupe-enums` | | `false` | Dedupe enum types when `--enum=true` is set |
117-
| `--check` | | `false` | Check that the generated types are up-to-date. |
117+
| `--check` | | `false` | Check that the generated types are up-to-date. |
118118
| `--exclude-deprecated` | | `false` | Exclude deprecated fields from types |
119119
| `--export-type` | `-t` | `false` | Export `type` instead of `interface` |
120120
| `--immutable` | | `false` | Generates immutable types (readonly properties and readonly array) |
121121
| `--path-params-as-types` | | `false` | Allow dynamic string lookups on the `paths` object |
122+
| `--root-types` | | `false` | Exports types from `components` as root level type aliases |
123+
| `--root-types-no-schema-prefix` | | `false` | Do not add "Schema" prefix to types at the root level (should only be used with --root-types) |
122124

123125
### pathParamsAsTypes
124126

@@ -175,7 +177,7 @@ For example, given the following schema:
175177
```yaml [my-openapi-3-schema.yaml]
176178
components:
177179
schemas:
178-
TupleType
180+
TupleType:
179181
type: array
180182
items:
181183
type: string

docs/data/contributors.json

+1-1
Large diffs are not rendered by default.

docs/data/sponsors.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"gold": [
33
{
4-
"name": "Zuplo",
5-
"logo": "https://avatars.githubusercontent.com/u/85497839?s=200&v=4",
6-
"url": "https://zuplo.link/openapi-ts-web"
4+
"name": "Speakeasy",
5+
"logo": "/assets/speakeasy.svg",
6+
"url": "https://www.speakeasy.com/product/sdk-generation?utm_source=pow_openapi_ts"
77
}
88
],
99
"silver": [

0 commit comments

Comments
 (0)