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

release: v2.4.2 #88

Merged
merged 2 commits into from
Nov 22, 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
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/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 = {
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