This repository hosts shared functionality for OpsTooling projects.
Find the docs in paritytech.github.io/opstooling-js. They are deployed automatically.
Yarn: yarn add @eng-automation/js
NPM: npm install --save @eng-automation/js
Trigger the Release workflow which will create a tag with the version passed as input.
This package adds opstooling-scripts
executable, which is "umbrella" for arbitrary subcommands that we might want to share across projects.
See opstooling-scripts -h
to get a list of available commands, also check out src/cli
directory for sources
src/cli/commands
, use existing ones as examplesrc/cli/main.ts
We utilize joi-to-typescript to define types together with validation schemas.
src/schemas
(see src/schemas
in this repo as an example)src/types/generated
folder for the generated typesopstooling-scripts generate-types --schemas src/schemas --out src/types/generated
to generate types (makes sense to add it to scripts
in package.json
)export * from "./types/generated"
to src/types.ts
if neededimport { validate } from "opstooling-js"
import { YourType } from "#src/types"
import { YourTypeSchema } from "#src/schemas/YourTypeSchema"
const input: unknown = getSomeData()
const item = validate<YourType>(input, YourTypeSchema)