From fabe7d2041c658d26642e35a13ef31ff09a99514 Mon Sep 17 00:00:00 2001 From: "loong.woo" Date: Fri, 22 Nov 2024 15:45:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20build=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/defintion.ts | 2 +- src/plugins/typeDeclaration.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/defintion.ts b/src/plugins/defintion.ts index 0fe5d6c..d1af898 100644 --- a/src/plugins/defintion.ts +++ b/src/plugins/defintion.ts @@ -10,7 +10,7 @@ import { convertValue } from "../common.ts"; * @param data - 参数 */ export const parserDefinition = ( - data: Map, + data: Map, options: IPluginOptions, ) => { const _definitions: string[] = []; diff --git a/src/plugins/typeDeclaration.ts b/src/plugins/typeDeclaration.ts index 6b2756e..5ba6a2a 100644 --- a/src/plugins/typeDeclaration.ts +++ b/src/plugins/typeDeclaration.ts @@ -15,7 +15,12 @@ interface IPluginEvent { * 类型定义事件 * @param data - 类型定义 */ - onDefinition?: (data: Map) => void; + onDefinition?: ( + data: Map< + string, + IDefinitionVirtualProperty | IDefinitionVirtualProperty[] + >, + ) => void; /** * 接口数据事件 * @param data - 接口数据 @@ -27,7 +32,7 @@ interface IPluginEvent { * @param action - 接口数据 */ onTransform: ( - def: Map, + def: Map, action: Map, ) => Promise | IPluginTransform; /** From 12f0ca80dda11da61315635b6796807e6adcabd4 Mon Sep 17 00:00:00 2001 From: "loong.woo" Date: Fri, 22 Nov 2024 15:46:25 +0800 Subject: [PATCH 2/2] release: v2.4.2 --- README.md | 4 ++-- deno.json | 4 ++-- src/npm/pkg.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f0a30df..5d06ea2 100644 --- a/README.md +++ b/README.md @@ -150,8 +150,8 @@ Create a `myPlugin.ts` file: ```ts // 引用模块 -// import { start } from 'https://deno.land/x/stc@2.4.1/mod.ts' -import { start } from 'jsr:@loongwoo/stc@^2.4.1' +// import { start } from 'https://deno.land/x/stc@2.4.2/mod.ts' +import { start } from 'jsr:@loongwoo/stc@^2.4.2' // Defining plugins const myPlugin: IPlugin = { diff --git a/deno.json b/deno.json index e4e06f2..2e2e296 100644 --- a/deno.json +++ b/deno.json @@ -1,12 +1,12 @@ { "name": "@loongwoo/stc", - "version": "2.4.1", + "version": "2.4.2", "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' --lang=ts", "serve": "deno run -A --watch=src src/service.ts", - "version": "echo '2.4.1' > release/version", + "version": "echo '2.4.2' > release/version", "build:npm": "deno run -A src/npm/build.ts", "build:mac": "deno compile -A --target x86_64-apple-darwin --output release/stc src/main.ts", "build:mac-m": "deno compile -A --target aarch64-apple-darwin --output release/stc-m src/main.ts", diff --git a/src/npm/pkg.json b/src/npm/pkg.json index e88bb4b..dce0ead 100644 --- a/src/npm/pkg.json +++ b/src/npm/pkg.json @@ -1,6 +1,6 @@ { "name": "@loongwoo/stc", - "version": "2.4.1", + "version": "2.4.2", "description": "A tool for converting OpenApi/Swagger/Apifox into code.", "type": "module", "module": "esm/mod.js",