-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Feat/split extension package #30
Merged
Merged
Changes from 14 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
41ad9c6
feat: 初步抽离逻辑到wormhole中
c38773b
refactor: wormhole初步分离
2ed769d
chore: 暂时保存
6c9620f
chore: 初步分离
czhlin 225215c
Merge branch 'feature/v1.0.0-czhlin' into feat/split-extension-package
JOU-amjs 3ad72a6
feat: 分离出wormhole包
b6a5aaa
refactor: 重构work
93e478e
feat: 将模板拆分成一个包
a967057
chore: templates移动到packages里
fcb2224
refactor(vscode-extension): 将vscode插件移动到packages目录下
czhlin 97a42d0
fix: alova.config模板区分项目类型
czhlin 81bdf5b
fix(templates): 修复createApis模板中错误提示错误
aedc51b
chore: 合并release v0.0.10
13dcd22
Merge branch 'main' of github.com:alovajs/devtools into feat/split-ex…
befe59c
chore(wormhole): 调整tsconfig,移动templates
800ec19
build(wormhole): 使用unbuild打包wormhole
afc602e
build(wormhole): 修改wormhole的打包配置文件
czhlin 988bd1a
fix(wormhole/openapi2data): 修复handleApi修改时unkown类型问题
9e2e687
chore(whormhole): 控制需要导出的文件
d6377f5
feat: 添加defaultRequire,默认都是require选项
af51cba
feat(wormhole): 添加node命名行
czhlin 683c8f2
chore(wormhole): 添加没有配置文件提示
czhlin cf75e9c
feat: add vitest as unit test tool, change file operation synchronous…
JOU-amjs ad607fa
fix: transform to FormData when data contains blob
JOU-amjs 64e0bb9
fix: detect `FormData` existence
JOU-amjs 5005139
test(添加readconfig 测试): 修复readconfig没法跑通的问题
8c7a4c6
Merge pull request #37 from alovajs/test/splited-test-vitest
czhlin ea44aca
test: add `generate` unit tests
JOU-amjs 6ec8235
test: add all `generate` tests
JOU-amjs da64987
feat: add features workspaces & import statement in config file, test…
JOU-amjs e7bf76a
chore: husky cli fix
JOU-amjs e73bfeb
feat(vscode-extension): 完成wormhole分离适配
481f3af
feat: 解决wormhole打包后esbuild找不到依赖
czhlin 6667ced
fix(wormhole): 修复单元测试中toMatch处理多行文本问题/s
czhlin 00be2df
Merge branch 'feat/split-extension-package-czhlin' into feat/split-ex…
czhlin f7a5cc1
feat(vscode-extension): 去除work模式、去掉依赖esbuild,改为用户提供@alova/wormhole包
ea7076d
fix(wormhole): 修复bin/acitons ora 是esm模块需要使用动态import加载
9e6868c
fix(vscode-extension): getWormhole改成返回代理对象,解决无法激活插件的问题
0a50bba
feat(vscode-extension): 添加wormhole没有安装时状态按钮置灰效果
937559c
feat(vscode-extension): 1.@alova/wormhole禁用状态 2.handleApi调试 3.支持monor…
21a3ca3
feat: wormhole and devtools splited is completed
JOU-amjs 986e113
fix: initial version
JOU-amjs e7baff4
ci: add secret VSCE_PAT to env
JOU-amjs a9f2f74
test: correct test error
JOU-amjs 86dca8f
chore: translate Chinese to English in all files
JOU-amjs 6d0163b
Merge pull request #39 from alovajs/test/splited-test-vitest
czhlin 18de3d7
docs: fill the comments
JOU-amjs f24565d
feat(wormhole): support response data types starting with 2xx in open…
9f32cef
fix(vscode-extension): fix alova status button status problem
49e37b8
Merge branch 'feat/split-extension-package' of https://github.com/alo…
JOU-amjs 7e7c32d
chore: update pnpm-lock.yaml
JOU-amjs b18e7d4
ci: ci flows debug
JOU-amjs 7cc8bfd
Merge branch 'feat/split-extension-package' of https://github.com/alo…
JOU-amjs 4163652
Merge branch 'main' of https://github.com/alovajs/devtools into feat/…
JOU-amjs 3c60f92
test: update snapshot file
JOU-amjs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
enable-pre-post-scripts = true | ||
enable-pre-post-scripts = true | ||
link-workspace-packages = true | ||
prefer-workspace-packages = true | ||
recursive-install = true | ||
# 使用淘宝镜像源 | ||
registry = https://registry.npmmirror.com | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,21 @@ | ||
{ | ||
"name": "alova-vscode-extension", | ||
"name": "@alova/devtools", | ||
"displayName": "Alova", | ||
"description": "Generate and search APIs without API documentation any more", | ||
"version": "0.0.10", | ||
"description": "The devtools for alova.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个描述是我改的😂 |
||
"version": "0.0.9", | ||
"engines": { | ||
"vscode": "^1.89.0", | ||
"node": ">=18.19.0", | ||
"pnpm": ">=8.6.12" | ||
}, | ||
"categories": [ | ||
"Other" | ||
], | ||
"activationEvents": [ | ||
"workspaceContains:**/*.ts", | ||
"workspaceContains:**/*.js" | ||
], | ||
"main": "./out/extension.js", | ||
"icon": "resources/icon.png", | ||
"contributes": { | ||
"commands": [ | ||
{ | ||
"command": "Generate APIs", | ||
"category": "Alova", | ||
"title": "alova refresh" | ||
} | ||
], | ||
"icons": { | ||
"alova-icon-id": { | ||
"description": "alova icon", | ||
"default": { | ||
"fontPath": "./resources/logo.ttf", | ||
"fontCharacter": "\\E900" | ||
} | ||
} | ||
} | ||
}, | ||
"scripts": { | ||
"vscode:prepublish": "pnpm run package", | ||
"compile": "pnpm run check-types && pnpm run lint:fix && tsx esbuild.ts", | ||
"watch": "npm-run-all -p watch:*", | ||
"watch:esbuild": "tsx esbuild.ts --watch", | ||
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json", | ||
"package": "pnpm run check-types && pnpm run lint:fix && tsx esbuild.ts --production", | ||
"compile-tests": "tsc -p . --outDir out", | ||
"watch-tests": "tsc -p . -w --outDir out", | ||
"pretest": "pnpm run compile-tests && pnpm run compile && pnpm run lint", | ||
"check-types": "tsc --noEmit", | ||
"lint": "eslint . --ext .js,.ts", | ||
"lint:fix": "npm run lint -- --fix", | ||
"format": "prettier --check .", | ||
"format:fix": "prettier --write .", | ||
"test": "vscode-test", | ||
"api-test": "tsx scripts/api-test.ts", | ||
"commit": "git-cz && git push", | ||
"prepare": "husky && pnpm api-test", | ||
"pack:pre": "vsce package --no-dependencies --pre-release", | ||
"release:pre": "vsce publish --no-dependencies --pre-release", | ||
"pack": "vsce package --no-dependencies", | ||
"release": "vsce publish --no-dependencies" | ||
"prepare": "husky && pnpm api-test" | ||
}, | ||
"publisher": "Alova", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
|
@@ -73,26 +29,20 @@ | |
"*.js,*.ts": "npm run lint:fix" | ||
}, | ||
"devDependencies": { | ||
"@alova/wormhole": "workspace:^", | ||
"@commitlint/cli": "^19.3.0", | ||
"@commitlint/config-conventional": "^19.2.2", | ||
"@types/js-yaml": "^4.0.9", | ||
"@types/lodash": "^4.17.5", | ||
"@types/mocha": "^10.0.6", | ||
"@types/mustache": "^4.2.5", | ||
"@types/node": "18.x", | ||
"@types/node-fetch": "^2.6.11", | ||
"@types/serialize-javascript": "^5.0.4", | ||
"@types/swagger2openapi": "^7.0.4", | ||
"@types/vscode": "^1.89.0", | ||
"@typescript-eslint/eslint-plugin": "^7.13.0", | ||
"@typescript-eslint/parser": "^7.13.0", | ||
"@vscode/test-cli": "^0.0.9", | ||
"@vscode/test-electron": "^2.3.9", | ||
"@vscode/vsce": "^2.29.0", | ||
"commitizen": "^4.3.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"esbuild": "^0.23.0", | ||
"esbuild-plugin-alias": "^0.2.1", | ||
"eslint": "^8.57.0", | ||
"eslint-config-airbnb": "^19.0.4", | ||
"eslint-config-airbnb-typescript": "^18.0.0", | ||
|
@@ -121,7 +71,6 @@ | |
"lodash": "^4.17.21", | ||
"node-fetch": "^2.7.0", | ||
"openapi-types": "^12.1.3", | ||
"serialize-javascript": "^6.0.2", | ||
"swagger2openapi": "^7.0.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{{#if (eq type "typescript")}}import type { Config } from '@alova/wormhole'; | ||
|
||
|
||
{{/if}}// For more config detailed visit: | ||
// https://alova.js.org/tutorial/getting-started/extension-integration | ||
{{#if (not type "typescript")}}/** | ||
* @type {{#raw "{ " }}{{/raw}}import('@alova/wormhole').Config{{#raw " }" }}{{/raw}} | ||
*/{{/if}} | ||
{{#if (eq moduleType "ESModule")}}export default {{#if (eq type "typescript")}}<Config>{{/if}}{{else if (eq moduleType "commonJs")}}module.exports ={{/if}}{{#raw "{ " }}{{/raw}} | ||
generator: [ | ||
{ | ||
/** | ||
* file input. support: | ||
* 1. openapi json file url | ||
* 2. local file | ||
*/ | ||
input: 'http://localhost:3000', | ||
|
||
/** | ||
* input file platform. Currently only swagger is supported. | ||
* When this parameter is specified, the input field only needs to specify the document address without specifying the openapi file | ||
*/ | ||
platform: 'swagger', | ||
|
||
/** | ||
* output path of interface file and type file. | ||
* Multiple generators cannot have the same address, otherwise the generated code will overwrite each other. | ||
*/ | ||
output: 'src/api', | ||
|
||
/** | ||
* the mediaType of the generated response data. default is `application/json` | ||
*/ | ||
// responseMediaType: 'application/json', | ||
|
||
/** | ||
* the bodyMediaType of the generated request body data. default is `application/json` | ||
*/ | ||
// bodyMediaType: 'application/json', | ||
|
||
/** | ||
* the generated api version. options are `2` or `3`, default is `auto`. | ||
*/ | ||
// version: 'auto', | ||
|
||
/** | ||
* type of generated code. The options are `auto/ts/typescript/module/commonjs`. | ||
*/ | ||
// type: 'auto', | ||
|
||
/** | ||
* exported global api name, you can access the generated api globally through this name, default is `Apis`. | ||
* it is required when multiple generators are configured, and it cannot be repeated | ||
*/ | ||
// global: 'Apis', | ||
|
||
/** | ||
* filter or convert the generated api information, return an apiDescriptor, if this function is not specified, the apiDescripor object is not converted | ||
*/ | ||
// handleApi: apiDescriptor => { | ||
// return apiDescriptor; | ||
// } | ||
} | ||
], | ||
|
||
/** | ||
* extension only | ||
* whether to automatically update the interface, enabled by default, check every 5 minutes, closed when set to `false` | ||
*/ | ||
// autoUpdate: true | ||
{{#raw "};" }}{{/raw}} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default (filePath: string) => import(`./${filePath}.handlebars`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "@alova/templates", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.ts", | ||
"module": "index.ts", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Change Log | ||
|
||
All notable changes to the "helloworld" extension will be documented in this file. | ||
|
||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. | ||
|
||
## [Unreleased] | ||
|
||
- Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 alovajs | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# VSCode extension for alova | ||
|
||
## features | ||
|
||
1. Automatically generate request code and response data types, and experience IntelliSense for response in js projects. | ||
2. Embed API documents in the code to experience the effect of checking and using APIs. | ||
3. Update APIs regularly and actively notify front-end developers, no longer relying on server-side developers to notify. | ||
|
||
> [Detailed documentation](https://alova.js.org/tutorial/getting-started/extension-integration). | ||
|
||
## View API completed information | ||
|
||
You can view the complted API information in the Editor with the IntelliSense feature. | ||
|
||
![](https://alova.js.org/img/vscode-api-doc.png) | ||
|
||
## Quick access to API | ||
|
||
Using the trigger word `a->` to trigger apis quick positioning. | ||
|
||
### Search by url | ||
|
||
![](https://alova.js.org/img/vscode-query-with-url.png) | ||
|
||
### Search by description | ||
|
||
![](https://alova.js.org/img/vscode-query-with-description.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个最好不用设置,到时我们配置github actions后是在github服务器上安装依赖的