Skip to content

Commit 9fdcd04

Browse files
authored
Merge branch 'acacode:main' into patch-2
2 parents bb69900 + 4df21b2 commit 9fdcd04

File tree

428 files changed

+120528
-191885
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

428 files changed

+120528
-191885
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.env.example

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/FUNDING.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
ko_fi: js2me
21
custom: ["https://paypal.me/acacode"]
2+
github: smorimoto
3+
ko_fi: js2me

.github/workflows/main.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
- push
55
- pull_request
66

7+
permissions: read-all
8+
79
jobs:
810
build-and-test:
911
runs-on: ubuntu-latest
10-
1112
steps:
1213
- name: Checkout tree
1314
uses: actions/checkout@v4
@@ -18,11 +19,12 @@ jobs:
1819
node-version: 22
1920
check-latest: true
2021

21-
- name: Install dependencies
22-
run: yarn install --immutable
22+
- run: corepack enable
23+
24+
- run: yarn install --immutable
25+
26+
- run: yarn format:check
2327

24-
- name: Check formatting
25-
run: yarn format:check
28+
- run: yarn build
2629

27-
- name: Run the tests
28-
run: yarn test-all
30+
- run: yarn test

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
permissions: read-all
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
steps:
19+
- name: Checkout tree
20+
uses: actions/checkout@v4
21+
22+
- name: Set-up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
check-latest: true
27+
28+
- run: corepack enable
29+
30+
- run: yarn install --immutable
31+
32+
- run: yarn npm publish --tolerate-republish
33+
env:
34+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.gitignore

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/.yarn/*
2-
!/.yarn/releases
3-
4-
/.idea/
5-
/.vscode/
1+
/.yarn/
62
/dist/
73
/node_modules/
8-
9-
.env
10-
swagger-test-cli
11-
swagger-test-cli.*

.yarn/releases/yarn-4.2.2.cjs

Lines changed: 0 additions & 894 deletions
This file was deleted.

.yarnrc.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
defaultSemverRangePrefix: ""
2+
13
nodeLinker: node-modules
24

3-
preferInteractive: true
5+
npmRegistries:
6+
//registry.npmjs.org:
7+
npmAuthToken: "${NPM_TOKEN:-''}"
48

5-
yarnPath: .yarn/releases/yarn-4.2.2.cjs
9+
preferInteractive: true

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1919
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
2020
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2121
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
11
# swagger-typescript-api
22

3-
<img
4-
src="https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/swagger-typescript-api-logo.png"
5-
title="swagger-typescript-api logo by js2me"
6-
align="left"
7-
height="180"
8-
width="93"
9-
/>
3+
- Support for OpenAPI 3.0, 2.0, JSON and YAML
4+
- Generate the API Client for Fetch or Axios from an OpenAPI Specification
105

11-
- Generate api via swagger scheme
12-
- Supports OA 3.0, 2.0, JSON, yaml
13-
- Generated api module use [**Fetch Api**](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) or [**Axios**](https://github.com/axios/axios) to make requests.
6+
Any questions you can ask [**here**](https://github.com/acacode/swagger-typescript-api/discussions)
147

15-
<br>
8+
## Examples
169

17-
Any questions you can ask [**here**](https://github.com/acacode/swagger-typescript-api/issues) or in [**our Slack**](https://join.slack.com/t/acacode/shared_invite/enQtOTQ5ODgyODQzMzYwLWYxOGI1MzQ3Yzg1ZWI5ZTI5NzNiZjExZTE5OWI1YjQ4NjBiNTk4NWVlNjM5YmU1ZWI2ZDkyMzZkZGIxNjA5NTQ)(**#swagger-typescript-api** channel)
10+
All examples you can find [**here**](https://github.com/acacode/swagger-typescript-api/tree/main/tests)
1811

19-
![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/components-converter-example.jpg)
20-
21-
Thanks to [JetBrains](https://www.jetbrains.com/?from=swaggertypescriptapi) for providing a free license for their excellent Webstorm IDE.
22-
23-
## 👀 Examples
24-
25-
All examples you can find [**here**](https://github.com/acacode/swagger-typescript-api/tree/master/tests)
26-
27-
## 📄 Usage
12+
## Usage
2813

2914
```muse
3015
Usage: sta [options]
@@ -95,9 +80,9 @@ npx swagger-typescript-api -p ./swagger.json -o ./src -n myApi.ts
9580
You can use this package from nodejs:
9681

9782
```js
98-
const { generateApi, generateTemplates } = require("swagger-typescript-api");
99-
const path = require("path");
100-
const fs = require("fs");
83+
import fs from "node:fs";
84+
import path from "node:path";
85+
import { generateApi, generateTemplates } from "swagger-typescript-api";
10186

10287
/* NOTE: all fields are optional expect one of `input`, `url`, `spec` */
10388
generateApi({
@@ -203,7 +188,7 @@ generateTemplates({
203188
});
204189
```
205190

206-
## 💎 options
191+
## Options
207192

208193
### **`--templates`**
209194

@@ -487,21 +472,13 @@ generateApi({
487472

488473
See more about [swagger schema type/format data here](https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times)
489474

490-
## 📄 Mass media
475+
## Mass media
491476

492477
- [5 Lessons learned about swagger-typescript-api](https://christo8989.medium.com/5-lessons-learned-about-swagger-typescript-api-511240b34c1)
493478
- [Why Swagger schemes are needed in frontend development ?](https://dev.to/js2me/why-swagger-schemes-are-needed-in-frontend-development-2cb4)
494479
- [Migration en douceur vers TypeScript (French)](https://www.premieroctet.com/blog/migration-typescript/)
495480
- [swagger-typescript-api usage (Japanese)](https://zenn.dev/watahaya/articles/2f4a716c47903b)
496481

497-
## 🚀 How it looks
498-
499-
![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/npx.gif)
500-
501-
![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/auth-example.gif)
502-
503-
![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/typings1.gif)
504-
505-
## 📝 License
482+
## License
506483

507-
Licensed under the [MIT License](https://github.com/acacode/swagger-typescript-api/blob/master/LICENSE).
484+
Licensed under the [MIT License](https://github.com/acacode/swagger-typescript-api/blob/main/LICENSE).

0 commit comments

Comments
 (0)