Skip to content

Commit

Permalink
Merge pull request #88 from long-woo/dev
Browse files Browse the repository at this point in the history
release: v2.4.2
  • Loading branch information
long-woo authored Nov 22, 2024
2 parents 595cebc + 12f0ca8 commit 460c8f4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ Create a `myPlugin.ts` file:

```ts
// 引用模块
// import { start } from 'https://deno.land/x/[email protected].1/mod.ts'
import { start } from 'jsr:@loongwoo/stc@^2.4.1'
// import { start } from 'https://deno.land/x/[email protected].2/mod.ts'
import { start } from 'jsr:@loongwoo/stc@^2.4.2'

// Defining plugins
const myPlugin: IPlugin = {
Expand Down
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/npm/pkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/defintion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { convertValue } from "../common.ts";
* @param data - 参数
*/
export const parserDefinition = (
data: Map<string, IDefinitionVirtualProperty[]>,
data: Map<string, IDefinitionVirtualProperty | IDefinitionVirtualProperty[]>,
options: IPluginOptions,
) => {
const _definitions: string[] = [];
Expand Down
9 changes: 7 additions & 2 deletions src/plugins/typeDeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ interface IPluginEvent {
* 类型定义事件
* @param data - 类型定义
*/
onDefinition?: (data: Map<string, IDefinitionVirtualProperty[]>) => void;
onDefinition?: (
data: Map<
string,
IDefinitionVirtualProperty | IDefinitionVirtualProperty[]
>,
) => void;
/**
* 接口数据事件
* @param data - 接口数据
Expand All @@ -27,7 +32,7 @@ interface IPluginEvent {
* @param action - 接口数据
*/
onTransform: (
def: Map<string, IDefinitionVirtualProperty[]>,
def: Map<string, IDefinitionVirtualProperty | IDefinitionVirtualProperty[]>,
action: Map<string, IPathVirtualProperty>,
) => Promise<IPluginTransform> | IPluginTransform;
/**
Expand Down

0 comments on commit 460c8f4

Please sign in to comment.