Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kubev2v/types

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kubev2v/types

Typescript interfaces and types for forklift

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
67
decreased by-21.18%
Maintainers
1
Weekly downloads
 
Created
Source

@kubev2v/types

Manual and auto generated typescript models and constants for Forklift controller.

SubdirectoryAuto generatedDescriptionContents
constantsAutoContains auto-generated Openshift Web Console model constants.Auto-generated models, that can be manually adjusted.
modelsAutoContains auto-generated types for Kubernetes (k8s) models used in the project.Kubernetes (k8s) models used in the project, auto-generated from API definitions or other sources.
typesManualContains manually created helper types and non-Kubernetes types used by the inventory API.- Helper types: Manually created types that assist in various tasks within the project.
- Non-Kubernetes types: Types that are used by the inventory API.

Auto generating new version

The typescript files are auto generated using forklift CRDs available from /ci/yaml/crds.

to generate new API version, update the CRDs in /ci/yaml/crds, and then:

a. run

bash ./ci/update-types-package.sh

b. manually cleanup the generated code. c. manually create or clean generated index files d. run linter fix for final touch.

npm run lint:fix
CRDRef
Openshifthttps://github.com/openshift/api/tree/master/console/v1
Forklifthttps://github.com/kubev2v/forklift/tree/main/operator/config/crd/bases

The script use the CRDs to generate OpenAPI file, and use that file to create model files.

Lint

Auto generated files will contain linting errors, you can run npm run lint:fix to cleanup the code after auto-re-generation.

Manual overrides

After auto generation is done, some manual tweeks can be done.

Setting the models color and abbr.

The model constant is auto generated with abbr that defaults to first two letters of the kind, and undefined color. It is sometimes advisable to manual change the defaults.

for example:

export const HostModel = {
  label: 'Host',
  labelPlural: 'Hosts',

  abbr: 'HO',
  color: undefined,
  ...
};

can be manually edited to:

export const HostModel = {
  label: 'Forklift Host',
  labelPlural: 'Forklift Hosts',

  abbr: 'H',
  color: '#f00',
  ...
};

Tools

The auto generation script update-types-package is a bash script that run the auto generation proccess.

ToolsDescroptionURL
crdtoapicreate OpenAPI file from CRDshttps://github.com/yaacov/crdtoapi
crdtomodelcreate k8s model constants from CRDshttps://github.com/yaacov/crdtoapi
openapi-generator-clicreate typescript interfaces from the OpenAPI filehttps://github.com/OpenAPITools/openapi-generator-cli

FAQs

Package last updated on 17 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc