Skip to content

Commit

Permalink
Merge branch 'acacode:main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Untaek authored Sep 20, 2024
2 parents bb69900 + 4df21b2 commit 9fdcd04
Show file tree
Hide file tree
Showing 428 changed files with 120,528 additions and 191,885 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 0 additions & 3 deletions .env.example

This file was deleted.

3 changes: 2 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ko_fi: js2me
custom: ["https://paypal.me/acacode"]
github: smorimoto
ko_fi: js2me
16 changes: 9 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ on:
- push
- pull_request

permissions: read-all

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout tree
uses: actions/checkout@v4
Expand All @@ -18,11 +19,12 @@ jobs:
node-version: 22
check-latest: true

- name: Install dependencies
run: yarn install --immutable
- run: corepack enable

- run: yarn install --immutable

- run: yarn format:check

- name: Check formatting
run: yarn format:check
- run: yarn build

- name: Run the tests
run: yarn test-all
- run: yarn test
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish

on:
release:
types:
- published

permissions: read-all

jobs:
publish:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
check-latest: true

- run: corepack enable

- run: yarn install --immutable

- run: yarn npm publish --tolerate-republish
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
10 changes: 1 addition & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/.yarn/*
!/.yarn/releases

/.idea/
/.vscode/
/.yarn/
/dist/
/node_modules/

.env
swagger-test-cli
swagger-test-cli.*
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.2.2.cjs

This file was deleted.

8 changes: 6 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
defaultSemverRangePrefix: ""

nodeLinker: node-modules

preferInteractive: true
npmRegistries:
//registry.npmjs.org:
npmAuthToken: "${NPM_TOKEN:-''}"

yarnPath: .yarn/releases/yarn-4.2.2.cjs
preferInteractive: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49 changes: 13 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
# swagger-typescript-api

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

- Generate api via swagger scheme
- Supports OA 3.0, 2.0, JSON, yaml
- 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.
Any questions you can ask [**here**](https://github.com/acacode/swagger-typescript-api/discussions)

<br>
## Examples

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)
All examples you can find [**here**](https://github.com/acacode/swagger-typescript-api/tree/main/tests)

![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/components-converter-example.jpg)

Thanks to [JetBrains](https://www.jetbrains.com/?from=swaggertypescriptapi) for providing a free license for their excellent Webstorm IDE.

## 👀 Examples

All examples you can find [**here**](https://github.com/acacode/swagger-typescript-api/tree/master/tests)

## 📄 Usage
## Usage

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

```js
const { generateApi, generateTemplates } = require("swagger-typescript-api");
const path = require("path");
const fs = require("fs");
import fs from "node:fs";
import path from "node:path";
import { generateApi, generateTemplates } from "swagger-typescript-api";

/* NOTE: all fields are optional expect one of `input`, `url`, `spec` */
generateApi({
Expand Down Expand Up @@ -203,7 +188,7 @@ generateTemplates({
});
```

## 💎 options
## Options

### **`--templates`**

Expand Down Expand Up @@ -487,21 +472,13 @@ generateApi({

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

## 📄 Mass media
## Mass media

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

## 🚀 How it looks

![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/npx.gif)

![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/auth-example.gif)

![](https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/typings1.gif)

## 📝 License
## License

Licensed under the [MIT License](https://github.com/acacode/swagger-typescript-api/blob/master/LICENSE).
Licensed under the [MIT License](https://github.com/acacode/swagger-typescript-api/blob/main/LICENSE).
Binary file removed assets/auth-example.gif
Binary file not shown.
Binary file removed assets/components-converter-example.jpg
Binary file not shown.
Binary file removed assets/npx.gif
Binary file not shown.
Binary file removed assets/swagger-typescript-api-logo.png
Binary file not shown.
Binary file removed assets/typings1.gif
Binary file not shown.
12 changes: 2 additions & 10 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
{
"$schema": "node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": [
"package.json",
"tests/**/expected.ts",
"tests/**/expected/**",
"tests/**/generated/**",
"tests/**/schema.d.ts",
"tests/**/schema.js",
"tests/**/schema.ts"
],
"ignore": ["package.json"],
"maxSize": 10000000
},
"formatter": {
"enabled": true,
"indentStyle": "space"
"useEditorconfig": true
},
"linter": {
"enabled": true,
Expand Down
10 changes: 0 additions & 10 deletions cli/constants.js

This file was deleted.

Loading

0 comments on commit 9fdcd04

Please sign in to comment.