Skip to content

Commit

Permalink
main pull
Browse files Browse the repository at this point in the history
  • Loading branch information
asst2411038 committed Nov 28, 2024
2 parents ccf4c8a + 30070e5 commit da3a024
Show file tree
Hide file tree
Showing 436 changed files with 383,166 additions and 32,246 deletions.
5 changes: 0 additions & 5 deletions .changeset/happy-singers-fry.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/little-knives-design.md

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/issue-stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
steps:
- uses: actions/stale@v9
with:
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."
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."
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."
ascending: false
operations-per-run: 300
days-before-issue-stale: 90
days-before-issue-stale: 180
days-before-issue-close: 7
days-before-pr-stale: -1
days-before-pr-close: -1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
changelog:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'openapi-ts' }}
permissions:
contents: write
pull-requests: write
Expand All @@ -28,5 +29,5 @@ jobs:
commit: "[ci] release"
title: "[ci] release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.OPENAPI_TS_BOT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
dist
node_modules
coverage

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

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"[typescript][typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ Ultra-fast fetching for TypeScript generated automatically from your OpenAPI sch

### 🥇 Gold Sponsors

<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>
<p align="center">
<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>
<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>
</p>

### 🥈 Silver Sponsors

<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>

### Backers

<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>
<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>
<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>
<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>
<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>
</p>

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

Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": false
},
Expand Down
48 changes: 44 additions & 4 deletions docs/.vitepress/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,48 @@ export default defineConfig({
},
{
text: "openapi-react-query",
base: "/openapi-react-query",
items: [
{ text: "Getting Started", link: "/openapi-react-query/" },
{ text: "useQuery", link: "/openapi-react-query/use-query" },
{ text: "useMutation", link: "/openapi-react-query/use-mutation" },
{ text: "useSuspenseQuery", link: "/openapi-react-query/use-suspense-query" },
{ text: "Getting Started", link: "/" },
{ text: "useQuery", link: "/use-query" },
{ text: "useMutation", link: "/use-mutation" },
{
text: "useSuspenseQuery",
link: "/use-suspense-query",
},
{
text: "queryOptions",
link: "/query-options",
},
{ text: "About", link: "/openapi-react-query/about" },
],
},
{
text: "swr-openapi",
base: "/swr-openapi",
items: [
{ text: "Getting Started", link: "/" },
{ text: "Hook Builders", link: "/hook-builders" },
{ text: "useQuery", link: "/use-query" },
{ text: "useImmutable", link: "/use-immutable" },
{ text: "useInfinite", link: "/use-infinite" },
{ text: "useMutate", link: "/use-mutate" },
{ text: "About", link: "/about" },
],
},
{
text: "openapi-metadata",
base: "/openapi-metadata",
items: [
{ text: "Getting Started", link: "/" },
{ text: "Decorators", link: "/decorators" },
{ text: "Metadata", link: "/metadata" },
{ text: "Type loader", link: "/type-loader" },
{ text: "UI Integrations", link: "/ui" },
{ text: "Examples", link: "/examples" },
{ text: "About", link: "/about" },
],
},
],
},
search: {
Expand All @@ -89,6 +123,12 @@ export default defineConfig({
indexName: "openapi-ts",
},
},
socialLinks: [
{
icon: "github",
link: "https://github.com/openapi-ts/openapi-typescript",
},
],
footer: {
message:
'Released under the <a href="https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-typescript/LICENSE">MIT License</a>.',
Expand Down
5 changes: 3 additions & 2 deletions docs/.vitepress/shared.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { UserConfig } from "vitepress";
import type { UserConfig, DefaultTheme } from "vitepress";
import { zhSearch } from "./zh";
import { jaSearch } from "./ja";

Expand Down Expand Up @@ -26,6 +26,7 @@ const shared: UserConfig = {
themeConfig: {
siteTitle: false,
logo: "/assets/openapi-ts.svg",
outline: 'deep',
search: {
provider: "algolia",
options: {
Expand All @@ -44,7 +45,7 @@ const shared: UserConfig = {
},
{ icon: "github", link: "https://github.com/openapi-ts/openapi-typescript" },
],
},
} satisfies DefaultTheme.Config,
transformPageData({ relativePath, frontmatter }) {
frontmatter.head ??= [];
frontmatter.head.push([
Expand Down
21 changes: 18 additions & 3 deletions docs/.vitepress/theme/CustomLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@ const { Layout } = DefaultTheme;
<!-- Silver sponsor logos -->
<template #sidebar-nav-after>
<div class="sidenav-sponsors">
<h5>Gold Sponsors</h5>
<ul class="sponsor-list sponsor-list--gold">
<li v-for="sponsor in sponsors.gold" :key="sponsor.name">
<a :href="sponsor.url" target="_blank" :title="sponsor.name">
<img :src="sponsor.logo" :alt="sponsor.description" />
</a>
</li>
</ul>
<h5>Silver Sponsors</h5>
<ul>
<ul class="sponsor-list sponsor-list--silver">
<li v-for="sponsor in sponsors.silver" :key="sponsor.name">
<a :href="sponsor.url" target="_blank" :title="sponsor.name">
<img :src="sponsor.logo" :alt="sponsor.description" />
Expand Down Expand Up @@ -124,11 +132,18 @@ const { Layout } = DefaultTheme;
flex-wrap: wrap;
gap: 1.25rem;
list-style: none;
margin: 1.5rem 0 0;
margin: 1rem 0;
padding: 0;
}
.sidenav-sponsors img {
.sponsor-list--gold {
img {
height: auto;
width: 100%;
}
}
.sponsor-list--silver img {
height: 3rem;
width: auto;
}
Expand Down
29 changes: 23 additions & 6 deletions docs/.vitepress/theme/SponsorList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@ import sponsors from "../../data/sponsors.json";
<template>
<ul class="sponsors-list">
<li
v-for="sponsor in [...sponsors.gold, ...sponsors.silver]"
v-for="sponsor in sponsors.gold"
class="sponsor sponsor--gold"
:key="sponsor.name"
>
<a :href="sponsor.url" target="_blank" :title="sponsor.name">
<img :src="sponsor.logo" :alt="sponsor.description" />
</a>
</li>
</ul>
<ul class="sponsors-list">
<li
v-for="sponsor in sponsors.silver"
class="sponsor sponsor--silver"
:key="sponsor.name"
>
<a :href="sponsor.url" target="_blank" :title="sponsor.name">
Expand All @@ -23,17 +35,22 @@ import sponsors from "../../data/sponsors.json";
list-style: none;
justify-content: center;
gap: 1.5rem;
margin: 0;
margin: 0 auto 3rem;
padding: 0;
}
.sponsors-list li {
margin: 0;
padding: 0;
.sponsor--gold img {
height: 8rem;
width: auto;
}
.sponsors-list img {
.sponsor--silver img {
height: 3rem;
width: auto;
}
.sponsors-list li {
margin: 0;
padding: 0;
}
</style>
12 changes: 7 additions & 5 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ In previous versions globbing was supported, but that has been **deprecated** in

## Redocly config

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:
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:

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

### pathParamsAsTypes

Expand Down Expand Up @@ -175,7 +177,7 @@ For example, given the following schema:
```yaml [my-openapi-3-schema.yaml]
components:
schemas:
TupleType
TupleType:
type: array
items:
type: string
Expand Down
2 changes: 1 addition & 1 deletion docs/data/contributors.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/data/sponsors.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"gold": [
{
"name": "Zuplo",
"logo": "https://avatars.githubusercontent.com/u/85497839?s=200&v=4",
"url": "https://zuplo.link/openapi-ts-web"
"name": "Speakeasy",
"logo": "/assets/speakeasy.svg",
"url": "https://www.speakeasy.com/product/sdk-generation?utm_source=pow_openapi_ts"
}
],
"silver": [
Expand Down
Loading

0 comments on commit da3a024

Please sign in to comment.