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

2.2.0 #77

Merged
merged 5 commits into from
Sep 23, 2024
Merged
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ examples/**/pnpm-lock.yaml
examples/**/yarn.lock
examples/**/package-lock.json

.DS_Store
.DS_Store
deno.lock
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ STC (Swagger Transform Code) is a tool for converting OpenApi/Swagger/Apifox int

## Features

- 🐹 Support for Swagger 2/3(OpenApi) and Apifox.
- 🐹 Support for **Swagger 2/3(OpenApi)** and **Apifox**.
- 💡 Support plug-in development.
- 🐣 Built-in transformation languages:
- TypeScript, almost equivalent to handwriting. Depends on **`axios`, `wx.request`, `fetch`**.
- **TypeScript**, almost equivalent to handwriting. Depends on **`axios`, `wx.request`, `fetch`**.
> `xhr/ajax、ofetch` planned
- JavaScript, from TypeScript to it.
- Dart, dependency on **`dio`**.
- 🚧 Swift ...
- **JavaScript**, from TypeScript to it.
- **Dart**, dependency on **`dio`**.
- 🚧 **Swift** ...

## Quick start

### Download executable files

[download](https://github.com/long-woo/stc/releases) by system:

- stc: Intel-based Mac
- stc-m: M-series Mac
- stc-linux:Linux
Expand Down Expand Up @@ -150,8 +151,8 @@ Create a `myPlugin.ts` file:

```ts
// 引用模块
// import { start } from 'https://deno.land/x/stc@2.1.0/mod.ts'
import { start } from 'jsr:@loongwoo/stc@^2.1.0'
// import { start } from 'https://deno.land/x/stc@2.2.0/mod.ts'
import { start } from 'jsr:@loongwoo/stc@^2.2.0'

// Defining plugins
const myPlugin: IPlugin = {
Expand Down
5 changes: 3 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@loongwoo/stc",
"version": "2.1.0",
"version": "2.2.0",
"exports": "./mod.ts",
"tasks": {
"pack": "deno run -A src/pack.ts",
"dev": "deno task pack && deno run -A --watch=src src/main.ts --url 'https://petstore3.swagger.io/api/v3/openapi.json'",
"dev": "deno task pack && deno run -A --watch=src src/main.ts --url='https://petstore3.swagger.io/api/v3/openapi.json' --lang=js",
"serve": "deno run -A --watch=src src/service.ts",
"version": "echo '2.1.0' > release/version",
"build:npm": "deno run -A src/npm/build.ts",
Expand All @@ -13,6 +13,7 @@
"build:win": "deno compile -A --target x86_64-pc-windows-msvc --icon resources/stc.svg --output release/stc-win src/main.ts",
"build:linux": "deno compile -A --target x86_64-unknown-linux-gnu --output release/stc-linux src/main.ts"
},
"exclude": ["**/shared/**/*"],
"lint": {
"include": [
"src/",
Expand Down
302 changes: 0 additions & 302 deletions deno.lock

This file was deleted.

3 changes: 0 additions & 3 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ export const start = async (options: ISwaggerOptions): Promise<void> => {
// 创建上下文
const context = createContext({ options });

// 清空控制台信息
Logs.clear();

// 初始化插件管理器
initPluginManager(context);

Expand Down
5 changes: 4 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ export const main = async (): Promise<ISwaggerOptions> => {
},
};

// 清空控制台信息
Logs.clear();

// 解析命令行参数和选项
const args: Args = parseArgs(Deno.args, argsConfig);
// 检查更新
Expand All @@ -233,7 +236,7 @@ export const main = async (): Promise<ISwaggerOptions> => {
printHelp();
}

if (args.platform) {
if (args.platform !== "axios") {
Logs.warn(getT("$t(cli.deprecatedOptionPlatform)"));
args.client = args.platform;
}
Expand Down
Loading