0.0.8 • Published 4 years ago
ility v0.0.8
ility
Multilingual code generation from OpenAPI
CLI Usage
The generator is available using the ility command:
ility -i path/to/your/schema.json -l typescriptInput file
Use -i, --input to supply the input file path:
ility --input path/to/your/schema.jsonOr pipe contents in via stdio:
cat path/to/your/schema.json | ilityOutput file
Use -o, --output to supply the output folder:
ility --output path/to/your/output/folderLanguage
Use -t, --title to supply the target language:
ility --lauguage typescriptAvailable laguages are currently typescript and ruby-sorbet
Programatic Usage
The generator is available by importing the generate function.
import { readFileSync } from 'fs';
import { generate } from 'ility';
const schema = readFileSync('path/to/your/schema.json').toString('utf8');
const title = 'widget service';
const language = 'ruby-sorbet';
const files = generate(schema, title, language);How to:
Run this project
- Build the code:
npm run build - Run it!
npm start
Note that the lint script is run prior to build. Auto-fixable linting or formatting errors may be fixed by running lint:fix.
Create and run tests
- Add tests by creating files with the
.tests.tssuffix - Run the tests:
npm t - Test coverage can be viewed at
/coverage/lcov-report/index.html
Publish a new version to NPM
Publishing is automated via a workflow. To run this workflow:
- Checkout
mainand pull latest changes. - Run
npm version [major|minor|patch]to create a new version commit and tag - Run
git push origin main --follow-tagsto push the tag (and version commit) and start the workflow - Wait for the workflow to detect the tag and publish the package.
Generated with generator-ts-console