Skip to content

Commit befe59c

Browse files
author
chenzhilin
committed
chore(wormhole): 调整tsconfig,移动templates
1 parent 13dcd22 commit befe59c

27 files changed

+61
-52
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"editor.formatOnSave": true,
3+
// "editor.formatOnSave": true,
44
"editor.tabSize": 2,
55
"editor.defaultFormatter": "esbenp.prettier-vscode",
66
"editor.suggestSelection": "recentlyUsedByPrefix",

packages/templates/package.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

packages/vscode-extension/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
3+
"include": ["src/**/*.ts", "./typings"],
34
"compilerOptions": {
5+
"outDir": "./dist",
6+
"baseUrl": ".",
47
"paths": {
58
"~/*": ["./typings/*"],
69
"@/*": ["./src/*"],

packages/wormhole/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@
1010
},
1111
"keywords": [],
1212
"author": "",
13-
"license": "ISC",
14-
"dependencies": {
15-
"@alova/templates": "workspace:^"
16-
}
13+
"license": "ISC"
1714
}

packages/wormhole/src/functions/openApi2Data.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ interface PathApis {
3838
export const getApiDefultValue = (api: Api) => {
3939
const configStrArr: string[] = [];
4040
if (api.pathParametersComment) {
41-
configStrArr.push(`pathParams: ${generateDefaultValues(api.pathParametersComment.replaceAll('*', ''))}`);
41+
configStrArr.push(`pathParams: ${generateDefaultValues(api.pathParametersComment.replace(/\*/g, ''))}`);
4242
}
4343
if (api.queryParametersComment) {
44-
configStrArr.push(`params: ${generateDefaultValues(api.queryParametersComment.replaceAll('*', ''))}`);
44+
configStrArr.push(`params: ${generateDefaultValues(api.queryParametersComment.replace(/\*/g, ''))}`);
4545
}
4646
if (api.requestComment) {
47-
configStrArr.push(`data: ${generateDefaultValues(api.requestComment.replaceAll('*', ''))}`);
47+
configStrArr.push(`data: ${generateDefaultValues(api.requestComment.replace(/\*/g, ''))}`);
4848
}
4949
return format(`${api.global}.${api.pathKey}({${configStrArr.join(',\n')}})`, {
5050
printWidth: 40, // 缩短printWidth以强制换行
@@ -411,7 +411,7 @@ export default async function openApi2Data(
411411
);
412412
const api: Api = {
413413
method: methodFormat,
414-
summary: methodInfo.summary?.replaceAll('\n', '') ?? '',
414+
summary: methodInfo.summary?.replace(/\n/g, '') ?? '',
415415
path,
416416
name: methodInfo.operationId ?? '',
417417
responseName,

0 commit comments

Comments
 (0)