Skip to content

Commit 0b50852

Browse files
committed
first commit
0 parents  commit 0b50852

14 files changed

+3843
-0
lines changed

.github/pull_request_template.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
3+
Thank you for your contribution! 👍
4+
5+
-->
6+
7+
## Types of changes
8+
9+
- [ ] Bug fixes
10+
- resolves #<!-- Please add issue number -->
11+
- [ ] Features
12+
- resolves #<!-- Please add issue number -->
13+
- [ ] Maintenance
14+
- [ ] Documentation
15+
16+
## Changes
17+
18+
- ...
19+
20+
21+
## Additional context
22+
23+
24+
## Community note
25+
26+
<!-- Please keep this section. -->
27+
28+
Please upvote with reacting as :+1: to express your agreement.

.github/workflows/nodejs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Node.js CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: 'Test on Node:${{ matrix.node-version }} OS:${{ matrix.os }}'
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
node-version: [18, 20]
12+
os: [ubuntu-latest]
13+
include:
14+
- os: windows-latest
15+
node-version: 20
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: setup Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- uses: actions/cache@v2
23+
id: npm-cache
24+
with:
25+
path: 'node_modules'
26+
key: ${{ runner.os }}-node-v${{ matrix.node-version }}-npm-${{ hashFiles('package-lock.json') }}
27+
- run: npm install
28+
if: steps.npm-cache.outputs.cache-hit != 'true'
29+
- run: npm run lint
30+
if: matrix.os != 'windows-latest'
31+
- run: npm run typecheck
32+
- run: npm test
33+
- run: npm run build
34+
35+
release:
36+
runs-on: ubuntu-latest
37+
needs: test
38+
if: startsWith(github.ref, 'refs/tags/v')
39+
steps:
40+
- uses: actions/checkout@v3
41+
- name: Use Node.js
42+
uses: actions/setup-node@v3
43+
with:
44+
node-version: 20
45+
registry-url: 'https://registry.npmjs.org'
46+
- uses: actions/cache@v2
47+
id: npm-cache
48+
with:
49+
path: 'node_modules'
50+
key: ${{ runner.os }}-node-v20-npm-${{ hashFiles('package-lock.json') }}
51+
- run: npm install
52+
if: steps.npm-cache.outputs.cache-hit != 'true'
53+
- run: npm run build
54+
- run: |
55+
VERSION="$(node -e 'console.log(process.argv[1].match(/^refs\/tags\/v(\d+\.\d+\.\d+)$/)[1])' "${{ github.ref }}")"
56+
node -e 'console.log(JSON.stringify({...require("./package.json"),version:process.argv[1]}, null, 2))' "$VERSION" | tee ./tmp-package.json
57+
mv ./tmp-package.json ./package.json
58+
- run: npm publish
59+
env:
60+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
samples

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true,
4+
"plugins": ["prettier-plugin-organize-imports"]
5+
}

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
3+
}

.vscode/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"eslint.run": "onSave",
3+
"editor.formatOnSave": true,
4+
"editor.defaultFormatter": "esbenp.prettier-vscode",
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.eslint": "explicit"
7+
},
8+
"typescript.tsdk": "node_modules/typescript/lib",
9+
"typescript.referencesCodeLens.enabled": true,
10+
"files.eol": "\n",
11+
"editor.tabSize": 2,
12+
"files.insertFinalNewline": true,
13+
"files.trimTrailingWhitespace": true,
14+
"files.trimFinalNewlines": true,
15+
"explorer.fileNesting.enabled": true
16+
}

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) 2024-present, Solufa <[email protected]>
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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# aspida to OpenAPI
2+
3+
<br />
4+
<br />
5+
<picture>
6+
<source media="(prefers-color-scheme: dark)" srcset="https://aspida.github.io/aspida/logos/svg/white.svg">
7+
<source media="(prefers-color-scheme: light)" srcset="https://aspida.github.io/aspida/logos/svg/black.svg">
8+
<img alt="aspida logo image" src="https://aspida.github.io/aspida/logos/svg/black.svg">
9+
</picture>
10+
<br />
11+
<br />
12+
<br />
13+
<div align="center">
14+
<a href="https://www.npmjs.com/package/aspida2openapi">
15+
<img src="https://img.shields.io/npm/v/aspida2openapi" alt="npm version" />
16+
</a>
17+
<a href="https://www.npmjs.com/package/aspida2openapi">
18+
<img src="https://img.shields.io/npm/dm/aspida2openapi" alt="npm download" />
19+
</a>
20+
</div>
21+
<br />
22+
<p align="center">Convert aspida type definitions into OpenAPI Specification.</p>
23+
<br />
24+
<br />
25+
26+
## Getting Started
27+
28+
## License
29+
30+
aspida2openapi is licensed under a [MIT License](https://github.com/aspida/aspida2openapi/blob/main/LICENSE).

bin/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
require('../dist/cli').run(process.argv.slice(2));

eslint.config.mjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import js from '@eslint/js';
2+
import gitignore from 'eslint-config-flat-gitignore';
3+
import prettierConfig from 'eslint-config-prettier';
4+
import globals from 'globals';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{ files: ['**/*.ts'] },
9+
gitignore(),
10+
{ ignores: ['samples'] },
11+
js.configs.recommended,
12+
...tseslint.configs.recommended,
13+
{
14+
languageOptions: { globals: { ...globals.node, ...globals.es2020 } },
15+
rules: {
16+
eqeqeq: 'error',
17+
'no-param-reassign': 'error',
18+
'object-shorthand': ['error', 'always'],
19+
'prefer-template': 'error',
20+
'@typescript-eslint/consistent-type-imports': 'error',
21+
'@typescript-eslint/no-explicit-any': 'off',
22+
'@typescript-eslint/no-require-imports': 'off',
23+
},
24+
},
25+
prettierConfig,
26+
);

0 commit comments

Comments
 (0)