1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

feat: update Orval config (#8038)

Simplify running frontend `gen:api`
This commit is contained in:
Tymoteusz Czech 2024-09-02 15:14:48 +02:00 committed by GitHub
parent ea328e5b43
commit 0b2479517f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -2,10 +2,8 @@
* How to generate OpenAPI client
*
* For now we only use generated types (src/openapi/models).
* We will use methods (src/openapi/apis) for new features soon.
* 1. `yarn gen:api` to generate the client
* 2. `rm -rf src/openapi/apis` to remove methods (! except if you want to use some of those)
* 3. clean up `src/openapi/index.ts` imports
* Run `yarn gen:api` to generate the client.
* We may use methods (src/openapi/apis) for new features in the future.
*/
module.exports = {
unleashApi: {
@ -34,5 +32,8 @@ module.exports = {
process.env.UNLEASH_OPENAPI_URL ||
'http://localhost:4242/docs/openapi.json',
},
hooks: {
afterAllFilesWrite: './scripts/clean_orval_generated.sh',
},
},
};

View File

@ -5,9 +5,8 @@ rm -rf src/openapi/apis
# Remove all but last line from index.ts
echo "Cleaning index.ts..."
tail -1 src/openapi/index.ts > index_tmp ;
cat index_tmp > src/openapi/index.ts ;
rm index_tmp
echo "export * from './models';" > src/openapi/index.ts
echo '' >> src/openapi/index.ts
echo "Formatting..."
yarn fmt