-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
438dac9
d1bb96c
c07a852
d4711ce
5947e2d
c889844
19929b4
7af9ef1
354c975
4d62e9d
5558a3b
395fb62
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 |
---|---|---|
@@ -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