mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	
							parent
							
								
									ea328e5b43
								
							
						
					
					
						commit
						0b2479517f
					
				| @ -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', | ||||
|         }, | ||||
|     }, | ||||
| }; | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user