-
-
Notifications
You must be signed in to change notification settings - Fork 173
feat(nx-plugin): add NX Plugin with OpenAPI client generator and executor #1947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
77f3f02
424b825
c8f11e7
24ccc93
6eb396d
cb7c7bc
13df17e
20296bb
722b752
90730a9
abca7a5
774c960
0d82a48
85d2df5
8fecfa9
1f2325f
9621692
a5c075e
895a0b3
aab87bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
node-version: ['18.20.5', '20.11.1', '22.11.0'] | ||
node-version: ['20.19.0', '22.12.0'] | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -38,7 +38,7 @@ jobs: | |
run: pnpm build --filter="@hey-api/**" | ||
|
||
- name: Build examples | ||
if: matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest' | ||
if: matrix.node-version == '24.0.1' && matrix.os == 'ubuntu-latest' | ||
run: pnpm build --filter="@examples/**" | ||
|
||
- name: Run linter | ||
|
@@ -54,7 +54,7 @@ jobs: | |
run: pnpm test:e2e | ||
|
||
- name: Publish preview packages | ||
if: github.event_name == 'pull_request' && matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest' | ||
if: github.event_name == 'pull_request' && matrix.node-version == '24.0.1' && matrix.os == 'ubuntu-latest' | ||
run: ./scripts/publish-preview-packages.sh | ||
env: | ||
TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
22.11.0 | ||
22.12.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,8 @@ | |
"typescript": "5.8.3", | ||
"vite": "6.2.6", | ||
"vitest": "3.1.1" | ||
}, | ||
"overrides": { | ||
"find-my-way": "9.2.0" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "../../node_modules/turbo/schema.json", | ||
"extends": ["//"], | ||
"tasks": { | ||
"build": { | ||
"cache": true, | ||
"dependsOn": ["^build"], | ||
"outputs": [".nuxt/**"] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,14 @@ import { | |
Section, | ||
} from '@radix-ui/themes'; | ||
|
||
// @ts-expect-error | ||
import { postFoo } from './client/sdk.gen'; | ||
import { addPet } from './client/sdk.gen'; | ||
|
||
function App() { | ||
const onClick = async () => { | ||
postFoo({ | ||
addPet({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed this file to use actual generated code, I was getting type errors how it was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sample is meant to be a playground for local development and testing. I thought I ignored it in ESLint? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe was an issue with my IDE, why not use actual code instead of adding broken imports and ignoring it with comments? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't remember, I was probably testing something and didn't clean it up. It's similar to the sample snapshot script except it contains a whole app with UI. The idea is to be able to test drive the output since snapshots are never actually executed. Obviously should be way more polished! |
||
body: { | ||
foo: [[1, 2]], | ||
name: 'test', | ||
photoUrls: ['test'], | ||
}, | ||
}); | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
// This file is auto-generated by @hey-api/openapi-ts | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ran the code gen |
||
|
||
import { createClient, createConfig } from '@hey-api/client-fetch'; | ||
import { | ||
type ClientOptions as DefaultClientOptions, | ||
type Config, | ||
createClient, | ||
createConfig, | ||
} from '@hey-api/client-fetch'; | ||
|
||
import { createClientConfig } from '../hey-api'; | ||
import type { ClientOptions } from './types.gen'; | ||
|
||
export const client = createClient(createClientConfig(createConfig())); | ||
/** | ||
* The `createClientConfig()` function will be called on client initialization | ||
* and the returned object will become the client's initial configuration. | ||
* | ||
* You may want to initialize your client this way instead of calling | ||
* `setConfig()`. This is useful for example if you're using Next.js | ||
* to ensure your client always has the correct values. | ||
*/ | ||
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = | ||
( | ||
override?: Config<DefaultClientOptions & T>, | ||
) => Config<Required<DefaultClientOptions> & T>; | ||
|
||
export const client = createClient( | ||
createClientConfig( | ||
createConfig<ClientOptions>({ | ||
baseUrl: 'https://petstore3.swagger.io/api/v3', | ||
}), | ||
), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this file to cache builds