File tree Expand file tree Collapse file tree 4 files changed +15
-13
lines changed
Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -153,8 +153,8 @@ Create a `myPlugin.ts` file:
153153
154154``` ts
155155// 引用模块
156- // import { start } from 'https://deno.land/x/stc@2.14.4 /mod.ts'
157- import { start } from ' jsr:@lonu/stc@^2.14.4 '
156+ // import { start } from 'https://deno.land/x/stc@2.14.5 /mod.ts'
157+ import { start } from ' jsr:@lonu/stc@^2.14.5 '
158158
159159// Defining plugins
160160const myPlugin: IPlugin = {
Original file line number Diff line number Diff line change 11{
22 "name" : " @lonu/stc" ,
3- "version" : " 2.14.4 " ,
3+ "version" : " 2.14.5 " ,
44 "exports" : " ./mod.ts" ,
55 "tasks" : {
66 "pack" : " deno run -A src/pack.ts" ,
77 "dev" : " deno task pack && deno run -A --watch=src src/main.ts --url='https://petstore3.swagger.io/api/v3/openapi.json' --lang=js" ,
88 "serve" : " deno run -A --watch=src src/service.ts" ,
9- "version" : " echo '2.14.4 ' > release/version" ,
9+ "version" : " echo '2.14.5 ' > release/version" ,
1010 "build:npm" : " deno run -A src/npm/build.ts" ,
1111 "build:mac" : " deno compile -A --target x86_64-apple-darwin --output release/stc src/main.ts" ,
1212 "build:mac-m" : " deno compile -A --target aarch64-apple-darwin --output release/stc-m src/main.ts" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @lonu/stc" ,
3- "version" : " 2.14.4 " ,
3+ "version" : " 2.14.5 " ,
44 "description" : " A tool for converting OpenApi/Swagger/Apifox into code." ,
55 "type" : " module" ,
66 "module" : " esm/mod.js" ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type {
33 IPluginTransformDefinition ,
44} from "../typeDeclaration.ts" ;
55
6- import { createFile } from "../../utils.ts" ;
6+ import { createDiffFile , createFile } from "../../utils.ts" ;
77import shared from "../typescript/shared/index.ts" ;
88import { TypeScriptPlugin } from "../typescript/index.ts" ;
99import { renderEtaString } from "../common.ts" ;
@@ -52,6 +52,15 @@ export const JavaScriptPlugin: IPlugin = {
5252 } ;
5353 } ,
5454 onEnd ( options ) {
55+ // 创建接口声明文件
56+ actionDeclareData . forEach ( ( item , key ) => {
57+ createDiffFile (
58+ `${ options . outDir } /${ key } .d.ts` ,
59+ item ,
60+ options . clean ,
61+ ) ;
62+ } ) ;
63+
5564 if ( ! options . shared ) return ;
5665
5766 // 创建运行时需要的文件
@@ -78,13 +87,6 @@ export const JavaScriptPlugin: IPlugin = {
7887 _fetchRuntimeFile . code ,
7988 ) ;
8089
81- // 创建接口声明文件
82- actionDeclareData . forEach ( ( item , key ) => {
83- createFile (
84- `${ options . outDir } /${ key } .d.ts` ,
85- item ,
86- ) ;
87- } ) ;
8890 createFile (
8991 `${ options . outDir } /shared/apiClientBase.d.ts` ,
9092 _baseFile . declaration ?? "" ,
You can’t perform that action at this time.
0 commit comments