Skip to content

Commit d80f835

Browse files
committed
feat: nuxt module initial release
1 parent bcc948f commit d80f835

File tree

24 files changed

+2776
-2803
lines changed

24 files changed

+2776
-2803
lines changed

.changeset/slow-days-kick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/client-nuxt': minor
3+
---
4+
5+
feat: drop cjs support

.changeset/spicy-swans-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/nuxt': minor
3+
---
4+
5+
feat: initial release

examples/openapi-ts-nuxt/nuxt.config.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default defineNuxtConfig({
77
future: {
88
compatibilityVersion: 4,
99
},
10-
heyapi: {
10+
heyApi: {
1111
config: {
1212
input:
1313
'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml',
@@ -27,5 +27,12 @@ export default defineNuxtConfig({
2727
],
2828
},
2929
},
30-
modules: ['@hey-api/client-nuxt'],
30+
imports: {
31+
transform: {
32+
// Build was throwing an error.
33+
// see https://github.com/nuxt/nuxt/issues/18823#issuecomment-1419704343
34+
exclude: [/\bclient-nuxt\b/],
35+
},
36+
},
37+
modules: ['@hey-api/nuxt'],
3138
});

examples/openapi-ts-nuxt/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
"build": "nuxt build",
88
"dev": "nuxt dev",
99
"generate": "nuxt generate",
10-
"postinstall": "nuxt prepare",
10+
"postinstall:enable-after-release": "nuxt prepare",
1111
"preview": "nuxt preview",
12-
"typecheck": "tsc --noEmit"
12+
"typecheck:old": "tsc --noEmit"
1313
},
1414
"dependencies": {
15-
"@hey-api/client-nuxt": "workspace:*",
15+
"@hey-api/nuxt": "workspace:*",
1616
"nuxt": "3.14.1592",
1717
"vue": "3.5.13",
1818
"vue-router": "4.5.0",
1919
"zod": "3.23.8"
2020
},
2121
"devDependencies": {
22-
"@hey-api/openapi-ts": "workspace:*",
2322
"vite": "6.0.9"
2423
}
2524
}

packages/client-nuxt/package.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,12 @@
3434
"main": "./dist/index.js",
3535
"exports": {
3636
".": "./dist/index.js",
37-
"./runtime": "./dist/index.js",
38-
"./module": "./dist/module.js",
3937
"./package.json": "./package.json"
4038
},
4139
"typesVersions": {
4240
"*": {
4341
".": [
4442
"./dist/index.d.ts"
45-
],
46-
"runtime": [
47-
"./dist/index.d.ts"
48-
],
49-
"module": [
50-
"./dist/module.d.ts"
5143
]
5244
}
5345
},
@@ -74,15 +66,7 @@
7466
},
7567
"devDependencies": {
7668
"@hey-api/client-core": "workspace:*",
77-
"@nuxt/schema": "3.15.4",
7869
"@nuxt/test-utils": "3.14.0",
7970
"vite": "6.0.9"
80-
},
81-
"dependencies": {
82-
"@hey-api/openapi-ts": "workspace:*",
83-
"@nuxt/kit": "3.15.4",
84-
"defu": "6.1.4",
85-
"jiti": "2.4.2",
86-
"mlly": "1.7.4"
8771
}
8872
}

packages/client-nuxt/rollup.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from 'node:path';
33
import { defineConfig } from 'rollup';
44
import dts from 'rollup-plugin-dts';
55

6-
const files = ['index.d.ts', 'module.d.ts'];
6+
const files = ['index.d.ts'];
77

88
export default files.map((file) =>
99
defineConfig({

packages/client-nuxt/src/module.ts

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

packages/client-nuxt/tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from 'tsup';
33
export default defineConfig((options) => ({
44
clean: true,
55
dts: true,
6-
entry: ['src/index.ts', 'src/module.ts'],
6+
entry: ['src/index.ts'],
77
format: ['esm'],
88
minify: !options.watch,
99
shims: false,

packages/nuxt/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Hey API
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/nuxt/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<div align="center">
2+
<img alt="Hey API logo" height="150" src="https://heyapi.dev/images/logo-300w.png" width="150">
3+
<h1 align="center"><b>Nuxt Module</b></h1>
4+
<p align="center">🚀 Nuxt module for `@hey-api/openapi-ts` codegen.</p>
5+
</div>
6+
7+
<!-- TODO: add working example once StackBlitz updates their Node version -->
8+
<!-- [Live demo](https://stackblitz.com/edit/hey-api-client-nuxt-example?file=openapi-ts.config.ts,src%2Fclient%2Fschemas.gen.ts,src%2Fclient%2Fsdk.gen.ts,src%2Fclient%2Ftypes.gen.ts,src%2Fcomponents%home.vue) -->
9+
10+
## Features
11+
12+
- seamless integration with `@hey-api/openapi-ts` ecosystem
13+
- type-safe response data and errors
14+
- response data validation and transformation
15+
- access to the original request and response
16+
- granular request and response customization options
17+
- minimal learning curve thanks to extending the underlying technology
18+
- support bundling inside the generated output
19+
- [platform](https://heyapi.dev/openapi-ts/integrations) for automating codegen builds
20+
21+
## Platform
22+
23+
Our platform for OpenAPI specifications is now available. Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations).
24+
25+
## Documentation
26+
27+
Please visit our [website](https://heyapi.dev/) for documentation, guides, migrating, and more.
28+
29+
## Sponsors
30+
31+
Love Hey API? Become our [sponsor](https://github.com/sponsors/hey-api).
32+
33+
<p>
34+
<a href="https://kutt.it/pkEZyc" target="_blank">
35+
<img alt="Stainless logo" height="50" src="https://heyapi.dev/images/stainless-logo-wordmark-480w.jpeg" />
36+
</a>
37+
</p>
38+
39+
## Migration Guides
40+
41+
[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating#openapi-typescript-codegen)

0 commit comments

Comments
 (0)