k8stypes
This repository contains TypeScript type definitions for Kubernetes resources.
Usage
Installation
npm install -D k8stypes;
Usage
TypeScript
import { Deployment } from 'k8stypes/apps/v1/Deployment';
const deployment : Deployment = {/* ... */};
export deployment;
JavaScript
/**
* @typedef {import('k8stypes/apps/v1/Deployment').Deployment} Deployment
*/
/** @type {Deployment} */
const deployment = {/* ... */};
module.exports = deployment;
Development Runbook
All development should be done within the /src
directory. The root directory is used only for publishing to NPM.
Retrieving the latest Kubernetes OpenAPI specification
npm run update;
This has only been tested to work on Ubuntu.
Generating the TypeScript definitions
npm run generate;
This will result in a
./src
directory containing the TypeScript definitions.
Building the JavaScript version
npm run build;
This will result in the NPM publishable package at
./lib
. Runnpm publish
from./lib
of the repository to publish it:
Publishing the package
- Bump the appropriate version in
package.json
- Commit the change
-
Navigate to
./lib
and run:
npm publish;
License
This code is licensed under the MIT license.