Skip to content

Commit 1bf75fe

Browse files
committed
docs: update Vite plugin readme
1 parent 17bd87b commit 1bf75fe

1 file changed

Lines changed: 80 additions & 12 deletions

File tree

packages/vite-plugin/README.md

Lines changed: 80 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,49 @@
11
<div align="center">
2-
<img alt="Hey API logo" height="150" src="https://heyapi.dev/assets/.gen/logo-astronaut-300w.png" width="150">
3-
<h1 align="center"><b>Vite Plugin</b></h1>
4-
<p align="center">🚀 Vite plugin for <code>@hey-api/openapi-ts</code> codegen.</p>
2+
<img alt="Hey API presents openapi-ts" height="214" src="https://heyapi.dev/assets/.gen/openapi-ts-hero-640w.png" width="438">
3+
<h1><b>Vite Plugin</b></h1>
4+
<p>Vite plugin for <code>@hey-api/openapi-ts</code>.</p>
55
</div>
66

7-
## Dashboard
7+
<p align="center">
8+
<a href="https://www.devtrends.dev/trends?c=v1.kZIAzQaO"><img src="https://api.devtrends.dev/badge/npm/%40hey-api%2Fvite-plugin?period=month&style=flat&view=value" alt="DevTrends badge for @hey-api/vite-plugin" /></a>
9+
<a href="https://www.devtrends.dev/trends?c=v1.kZIAzQaO&v=change"><img src="https://api.devtrends.dev/badge/npm/%40hey-api%2Fvite-plugin?period=year&style=flat&view=change" alt="DevTrends badge for @hey-api/vite-plugin" /></a>
10+
<a href="https://github.com/hey-api/openapi-ts/actions?query=branch%3Amain"><img src="https://github.com/hey-api/openapi-ts/actions/workflows/ci.yml/badge.svg?event=push&branch=main" alt="CI status" /></a>
11+
<a href="https://github.com/hey-api/openapi-ts"><img src="https://img.shields.io/github/stars/hey-api/openapi-ts?style=flat&logo=github&label=GitHub&color=54C82D" alt="GitHub stars" /></a>
12+
<a href="https://github.com/hey-api/openapi-ts/blob/main/LICENSE.md"><img src="https://img.shields.io/github/license/hey-api/openapi-ts" alt="MIT License"></a>
13+
</p>
814

9-
Access your projects and OpenAPI specifications in the [Hey API Platform](https://app.heyapi.dev/).
15+
<p align="center">
16+
<a href="https://heyapi.dev">Manual</a>
17+
<span>&nbsp;&nbsp;</span>
18+
<a href="https://github.com/hey-api/openapi-ts/issues">Issues</a>
19+
<span>&nbsp;&nbsp;</span>
20+
<a href="https://heyapi.dev/openapi-ts/community/contributing">Contribute</a>
21+
</p>
22+
23+
## About
24+
25+
[Vite](https://vite.dev) is a blazing fast frontend build tool powering the next generation of web applications.
26+
27+
The Vite plugin integrates [`@hey-api/openapi-ts`](https://heyapi.dev/openapi-ts) into the Vite build pipeline, running automatically whenever Vite resolves its configuration – no separate script or manual step required.
28+
29+
Part of the Hey API ecosystem.
30+
31+
## Features
32+
33+
- runs automatically as part of your Vite build
34+
- reads your existing configuration (or accepts inline config)
35+
- works with any Vite-based project
36+
- [sync with Hey API Registry](https://heyapi.dev/openapi-ts/integrations) for spec management
1037

1138
## Contributing
1239

1340
Want to see your code in products used by millions?
1441

1542
Start with our [Contributing](https://heyapi.dev/openapi-ts/community/contributing) guide and release your first feature.
1643

17-
## Documentation
18-
19-
Please visit our [website](https://heyapi.dev) for documentation, guides, migrating, and more.
20-
2144
## Sponsors
2245

23-
Help Hey API stay around for the long haul by becoming a [sponsor](https://github.com/sponsors/hey-api).
46+
Hey API is sponsor-funded. If you rely on Hey API in production, consider becoming a [sponsor](https://github.com/sponsors/hey-api) to accelerate the roadmap.
2447

2548
<h3 align="center">Gold</h3>
2649

@@ -125,20 +148,65 @@ Help Hey API stay around for the long haul by becoming a [sponsor](https://githu
125148
</tbody>
126149
</table>
127150

151+
## Installation
152+
153+
You can download `@hey-api/vite-plugin` from npm using your favorite package manager.
154+
155+
#### npm
156+
157+
```sh
158+
npm add @hey-api/vite-plugin -D -E
159+
```
160+
161+
#### pnpm
162+
163+
```sh
164+
pnpm add @hey-api/vite-plugin -D -E
165+
```
166+
167+
#### yarn
168+
169+
```sh
170+
yarn add @hey-api/vite-plugin -D -E
171+
```
172+
173+
#### bun
174+
175+
```sh
176+
bun add @hey-api/vite-plugin -D -E
177+
```
178+
128179
## Usage
129180

130-
Add to `plugins` inside your Vite configuration.
181+
Add the plugin to your `vite.config.ts`:
182+
183+
```ts
184+
import { heyApiPlugin } from '@hey-api/vite-plugin';
185+
import { defineConfig } from 'vite';
186+
187+
export default defineConfig({
188+
plugins: [heyApiPlugin()],
189+
});
190+
```
191+
192+
The plugin will automatically pick up your [configuration](https://heyapi.dev/openapi-ts/configuration) file. You can also pass options inline using the `config` option:
131193

132194
```ts
133195
import { heyApiPlugin } from '@hey-api/vite-plugin';
196+
import { defineConfig } from 'vite';
134197

135198
export default defineConfig({
136199
plugins: [
137200
heyApiPlugin({
138201
config: {
139-
// optional configuration instead of using the configuration file
202+
input: 'hey-api/backend', // sign up at app.heyapi.dev
203+
output: 'src/client',
140204
},
141205
}),
142206
],
143207
});
144208
```
209+
210+
## License
211+
212+
Released under the [MIT License](https://github.com/hey-api/openapi-ts/blob/main/LICENSE.md).

0 commit comments

Comments
 (0)