Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

35-update-contributing #61

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Contributing

<p align="center">
<a href="#best-practices">Best practices</a> ·
<a href="#pull-request-process">Pull request process</a>
<a href="#best-practices">Best practices</a> ·
<a href="#quickstart">Quickstart</a> ·
<a href="#pull-request-process">Pull request process</a> ·
<a href="#code-of-conduct">Code of conduct</a>
</p>

First of all, thanks for taking the time to contribute!
Expand All @@ -27,6 +29,50 @@ project. We encourage you to follow them and help us create a better product!
23-add-new-provider).
- Create commit messages following [conventional commit](https://conventionalcommits.org) specification.

## Quickstart

### Dependencies

To install dependencies, after cloning the repository, run:

```bash
npm ci
```

### Build

To build the application, run:

```bash
npm run build
```

### Usage

To execute the application run:

```bash
npm start -- -i example.yaml
```

### Clean

To clean output & build path run:

```bash
npm run clean
```

You can find all the options in our [README](./README.md) file

### Putting all together

When you are developing a new feature you must clean output & build path, rebuild the app and execute it. So this is a good command to _remember_:

```bash
npm run clean && npm start -- -i input/file.yaml
```

## Pull request process

1. Ensure any install or build dependencies are solved before doing a build.
Expand Down
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<p align="center">
<a href="#-summary">Summary</a> ·
<a href="#-getting-started">Getting started</a> ·
<a href="#-contributing">Contributing</a> ·
<a href="#-support">Support</a> ·
<a href="#license">License</a>
</p>
Expand All @@ -23,22 +24,30 @@

This generator requires the Node version >=17.7.1 to run properly

### How to install
### 🧑🏻‍💻 Usage

You can install it:

```bash
npm i @sngular/openapi-nodejs-cli --global
```

### 🧑🏻‍💻 Usage
and use as:

```bash
npx openapi-nodejs-cli -i input/schema.yaml
openapi-nodejs-cli -i input/schema.yaml
```

or use directly:

```bash
npx i @sngular/openapi-nodejs-cli -i input/schema.yaml
```

You can retrieve an option list with this command:

```bash
npx openapi-nodejs-cli --help
openapi-nodejs-cli --help
```

```bash
Expand All @@ -55,13 +64,17 @@ Options:
-h, --help shows this help
```

## 🤝 Contributing

If you want to collaborate with the project, please read our [CONTRIBUTING.md](./CONTRIBUTING.md) where you can find our guidelines

## 🧰 Support

We’ll be glad to talk and discuss how `openapi-nodejs-cli` can help you 😊

Reach us through [GitHub issues](https://github.com/sngular/openapi-nodejs-cli/issues), [email](mailto:[email protected]) or [Twitter](https://twitter.com/sngular).

## License
## 🔐 License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at [https://mozilla.org/MPL/2.0/](https://mozilla.org/MPL/2.0/).
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://github.com/sngular/openapi-nodejs-cli/blob/main/LICENSE)
24 changes: 24 additions & 0 deletions example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
openapi: 3.1.0
info:
title: Sample API
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
version: 0.1.9
servers:
- url: http://api.example.com/v1
description: Optional server description, e.g. Main (production) server
- url: http://staging-api.example.com
description: Optional server description, e.g. Internal staging server for testing
paths:
/users:
get:
summary: Returns a list of users.
description: Optional extended description in CommonMark or HTML.
responses:
'200': # status code
description: A JSON array of user names
content:
application/json:
schema:
type: array
items:
type: string
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"scripts": {
"test": "jest",
"coverage": "jest --coverage",
"clean": "rm -rf output",
"build": "tsc",
"build:clean": "tsc --build --clean",
"postprepare": "npm run build",
"prestart": "npm run build",
"start": "node .",
Expand All @@ -36,7 +36,8 @@
"format:eslint": "npm run lint:eslint -- --fix",
"format:prettier": "prettier --write .",
"prepare": "husky install",
"release": "npx semantic-release"
"release": "npx semantic-release",
"clean": "rm -rf output outputTest && npm run build:clean"
},
"repository": {
"type": "git",
Expand Down