1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

bugfix: 解决 compile 时报错 activationEvents 不存在问题及其他若干问题

ERROR  Manifest needs the 'activationEvents' property, given it has a 'main' property.

 ERROR  Make sure to edit the README.md file before you package or publish your extension.

 WARNING  A 'repository' field is missing from the 'package.json' manifest file.

 WARNING  LICENSE.md, LICENSE.txt or LICENSE not found
This commit is contained in:
程序员小墨 2024-04-03 00:57:54 +08:00
parent 92c3268707
commit a2662a7f87
3 changed files with 40 additions and 4 deletions

30
GPT.md
View File

@ -168,3 +168,33 @@ https://code.visualstudio.com/api/references/contribution-points#contributes.sub
- 按下`F5`来运行和测试您的插件,确保上下文菜单正确显示并且命令能够正确执行。
通过这些步骤您应该能够为您的VSCode插件添加一个右键菜单并实现不同的字符串转换功能。如果您在实现过程中遇到任何问题或者需要更多帮助请随时联系我🛠
==========
VSCode开发的插件如何打包
在 Visual Studio Code (VSCode) 中,你可以按照以下步骤来打包你的插件:
1. **安装打包工具**:首先,你需要安装 VSCode 插件的专用打包工具 `vsce`。你可以通过 npm 来安装它,命令如下¹⁴⁵:
```bash
npm install -g vsce
```
2. **修改 README.md**:你需要修改项目根目录下的 README.md 文件内容,删除 “This is the README for your extension” 这句话¹。否则,你可能无法正常打包。
3. **处理静态文件与 node_modules 文件夹**:一些如 .txt、.json 文件等的静态文件可以在开发的时候放在根目录¹。
4. **打包插件**:接下来,你可以开始打包你的插件。使用以下命令来打包¹⁴⁵:
```bash
vsce package
```
这个命令会生成一个 `.vsix` 文件,这就是你的插件的安装包。
以上就是 VSCode 插件的基本打包流程。希望这个答案对你有所帮助!
源: 与必应的对话, 2024/4/3
(1) VSCode 插件开发(三):插件打包与本地安装 - 简书. https://www.jianshu.com/p/bb379a628004.
(2) VSCode打包插件及安装vsix包方法_npm from visx-CSDN博客. https://blog.csdn.net/qq_23350817/article/details/83374373.
(3) VSCode打包插件及安装vsix包方法 - 马克队长 - 博客园. https://www.cnblogs.com/baokang/p/13251495.html.
(4) vscode插件打包流程 - 知乎 - 知乎专栏. https://zhuanlan.zhihu.com/p/643962235.
(5) VSCode打包插件及安装vsix包方法 - 马克队长 - 博客园. https://bing.com/search?q=%e5%a6%82%e4%bd%95%e6%89%93%e5%8c%85VSCode%e6%8f%92%e4%bb%b6.

View File

@ -1,6 +1,6 @@
# text-conversion README
# README
This is the README for your extension "text-conversion". After writing up a brief description, we recommend including the following sections.
After writing up a brief description, we recommend including the following sections.
## Features

View File

@ -9,7 +9,12 @@
"categories": [
"Other"
],
"repository": {
"type": "git",
"url": "https://github.com/coder-xiaomo/text-conversion-vscode-extension.git"
},
"main": "./out/extension.js",
"activationEvents": [],
"contributes": {
"commands": [
{
@ -164,7 +169,8 @@
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "vscode-test"
"test": "vscode-test",
"package": "echo \"start `vsce package`\" & vsce package"
},
"devDependencies": {
"@types/mocha": "^10.0.6",