Skip to content

Latest commit

 

History

History

kubevirt

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Auto generate typescritp types

Note I - Building and publishing

# From pacjage root directory bump version
vim package.json

# Build the package
npm run build
npm run lint

# Publish no npm.io
npm publish

Note II - Updating models

npm i @openapitools/openapi-generator-cli

curl https://raw.githubusercontent.com/kubevirt/kubevirt/main/api/openapi-spec/swagger.json -o swagger.json

npx openapi-generator-cli generate -g typescript-fetch --skip-validate-spec -o $(pwd) -i $(pwd)/swagger.json

rm -rf apis index.ts runtime.ts .openapi-generator*

find ./models -type f -exec sed -i 's/\.\.\/runtime/\.\.\/\.\.\/runtime/g' {} +

echo "export * from './models';" > index.ts