Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skonves/ility
Convert OpenAPI into portability, agility, reusability, readability, and dependability
https://github.com/skonves/ility
Last synced: 1 day ago
JSON representation
Convert OpenAPI into portability, agility, reusability, readability, and dependability
- Host: GitHub
- URL: https://github.com/skonves/ility
- Owner: skonves
- License: mit
- Created: 2021-10-09T00:20:09.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-29T00:29:21.000Z (almost 3 years ago)
- Last Synced: 2024-05-01T13:47:28.980Z (7 months ago)
- Language: TypeScript
- Size: 632 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![master](https://github.com/skonves/ility/workflows/build/badge.svg?branch=main&event=push)](https://github.com/skonves/ility/actions?query=workflow%3Abuild+branch%3Amain+event%3Apush)
[![master](https://img.shields.io/npm/v/ility)](https://www.npmjs.com/package/ility)# ility
Multilingual code generation from OpenAPI
## CLI Usage
The generator is available using the `ility` command:
```
ility -i path/to/your/schema.json -l typescript
```### Input file
Use `-i`, `--input` to supply the input file path:
```
ility --input path/to/your/schema.json
```Or pipe contents in via stdio:
```
cat path/to/your/schema.json | ility
```### Output file
Use `-o`, `--output` to supply the output folder:
```
ility --output path/to/your/output/folder
```### Language
Use `-t`, `--title` to supply the target language:
```
ility --lauguage typescript
```Available laguages are currently `typescript` and `ruby-sorbet`
## Programatic Usage
The generator is available by importing the `generate` function.
```js
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
1. Build the code: `npm run build`
1. 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
1. Add tests by creating files with the `.tests.ts` suffix
1. Run the tests: `npm t`
1. Test coverage can be viewed at `/coverage/lcov-report/index.html`### Publish a new version to NPM
Publishing is automated via a [workflow](https://github.com/skonves/ility/actions?query=workflow%3Apublish). To run this workflow:
1. Checkout `main` and pull latest changes.
1. Run `npm version [major|minor|patch]` to create a new version commit and tag
1. Run `git push origin main --follow-tags` to push the tag (and version commit) and start the workflow
1. Wait for [the workflow](https://github.com/skonves/ility/actions?query=workflow%3Apublish) to detect the tag and publish the package.---
Generated with [generator-ts-console](https://www.npmjs.com/package/generator-ts-console)