diff --git a/Publish.md b/Publish.md new file mode 100644 index 0000000..a20ed6b --- /dev/null +++ b/Publish.md @@ -0,0 +1,69 @@ +# 如何发行你的插件 + +vsce login coder-xiaomo + +vsce publish + + INFO Publishing 'coder-xiaomo.variable-conversion v0.0.1'... + INFO Extension URL (might take a few minutes): https://marketplace.visualstudio.com/items?itemName=coder-xiaomo.variable-conversion + INFO Hub URL: https://marketplace.visualstudio.com/manage/publishers/coder-xiaomo/extensions/variable-conversion/hub + DONE Published coder-xiaomo.variable-conversion v0.0.1. + +具体步骤参考: +https://zhuanlan.zhihu.com/p/339695661 + +## 安装官方打包工具 + +首先我们要安装上这个官方的插件发行工具,可以把我们的插件工程打包成.vsix文件,也可以直接发布到插件市场当中 +npm i vsce -g + +后面使用命令发行插件时,如果你没有设置package.json里的repository会收到提示。但不是非要填(插件可以不开源),选N即可。 + +## 打包成 .vsix 文件 + +vsce package + +打包完成后,会在工程目录生成.vsix文件,这个文件的安装只能通过插件搜索右上方的菜单来进行 + + +## 把插件发行到插件市场 + +### 注册Azure开发者账号 + +先得有一个 微软通行证 https://login.live.com/ ,然后打开 azure开发者中心 https://aka.ms/SignupAzureDevOps ,新建一个 azure开发组织。 + +#### 新建个人令牌 + +注意选择 Full access 和 过期时间,如果令牌过期,需要回到这个页面再新建令牌。 + + +这步之后,一定要复制并保存好你的令牌字符串哦。之后只能新建,是找不到的。 + +### 注册插件市场发行账户 + +接着我们 注册插件市场发行账号,也在这可以管理所有市场中自己发布的插件。 + + +当然我们也可以使用vsce命令来创建发行账户 + +vsce create-publisher 发行账户名称 + +## 发行 + +vsce publish + +这个过程里还会检查一些package.json的必填项,一切无误的话,就会看到下面这个图 + + +发行成功啦! + +但此时我们的插件在市场中还搜不到,等个5-10分钟一般就有了。 + + +## 注意事项 +README.md是插件主页的详情介绍; +记得更新package.json里的版本号; +如果package.json中填写了repository字段,在发布时会要求你先提交仓库; +README.md中的图片资源必须全部是HTTPS的; +CHANGELOG.md是插件主页的变更选项卡; +一但用户安装了你的插件,只要不卸载,插件有新版时后会自动更新的。 diff --git a/README.md b/README.md index 8d1fc4e..96372d4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Variable Conversion 命名方式转换插件 -A variable naming conversion extension, support camel case, pascal case, snake case, snake camel case, snake pascal case, snake upper case, kebab(spinal) case, kebab camel case, kebab pascal case, kebab upper case, lower case, upper case, camel snake case, and more. +A variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), lower, upper case, and more. -一个变量命名方式互相转换的 VSCode 插件,支持小驼峰(驼峰)命名、大驼峰(帕斯卡)命名、下划线(蛇形)命名、下划线(蛇形) + 小驼峰(驼峰)命名、下划线(蛇形) + 大驼峰(帕斯卡)命名、下划线(蛇形) + 全大写命名、连字符(脊柱式)命名、连字符(脊柱式) + 小驼峰(驼峰)命名、连字符(脊柱式) + 大驼峰(帕斯卡)命名、连字符(脊柱式) + 全大写命名、全小写、全大写等常用命名方式 +变量名转换插件,支持右键菜单、快捷键、底栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、连字符(脊柱式)、全小写、全大写等常用命名方式(及组合)转换 -## Features +## Features 特点 Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. diff --git a/package-comment.jsonc b/package-comment.jsonc index a332d7c..7421b71 100644 --- a/package-comment.jsonc +++ b/package-comment.jsonc @@ -1,10 +1,11 @@ { // 插件 id 及名称 "name": "variable-conversion", - "displayName": "Variable Conversion", - "description": "A variable naming conversion extension, support camel case, pascal case, snake case, snake camel case, snake pascal case, snake upper case, kebab(spinal) case, kebab camel case, kebab pascal case, kebab upper case, lower case, upper case, camel snake case, and more. \n一个变量命名方式互相转换的 VSCode 插件,支持小驼峰(驼峰)命名、大驼峰(帕斯卡)命名、下划线(蛇形)命名、下划线(蛇形) + 小驼峰(驼峰)命名、下划线(蛇形) + 大驼峰(帕斯卡)命名、下划线(蛇形) + 全大写命名、连字符(脊柱式)命名、连字符(脊柱式) + 小驼峰(驼峰)命名、连字符(脊柱式) + 大驼峰(帕斯卡)命名、连字符(脊柱式) + 全大写命名、全小写、全大写等常用命名方式", + "displayName": "Variable Conversion [Under development(正在开发中)]", + "description": "A variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), lower, upper case, and more. \n变量名转换插件,支持右键菜单、快捷键、底栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、连字符(脊柱式)、全小写、全大写等常用命名方式(及组合)转换", // 版本号 "version": "0.0.1", + "publisher": "coder-xiaomo", "engines": { "vscode": "^1.87.0" }, @@ -27,9 +28,7 @@ } ], "main": "./out/extension.js", - "activationEvents": [ - "*" - ], + "activationEvents": [], "contributes": { "commands": [ /** @@ -250,7 +249,8 @@ "pretest": "npm run compile && npm run lint", "lint": "eslint src --ext ts", "test": "vscode-test", - "package": "echo \"start `vsce package`\" & vsce package" + "package": "echo \"start `vsce package`\" & vsce package", + "publish": "vsce publish" }, "devDependencies": { "@types/mocha": "^10.0.6", diff --git a/package.json b/package.json index dd4e4ab..b8b75b0 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "variable-conversion", - "displayName": "Variable Conversion", - "description": "A variable naming conversion extension, support camel case, pascal case, snake case, snake camel case, snake pascal case, snake upper case, kebab(spinal) case, kebab camel case, kebab pascal case, kebab upper case, lower case, upper case, camel snake case, and more. \n一个变量命名方式互相转换的 VSCode 插件,支持小驼峰(驼峰)命名、大驼峰(帕斯卡)命名、下划线(蛇形)命名、下划线(蛇形) + 小驼峰(驼峰)命名、下划线(蛇形) + 大驼峰(帕斯卡)命名、下划线(蛇形) + 全大写命名、连字符(脊柱式)命名、连字符(脊柱式) + 小驼峰(驼峰)命名、连字符(脊柱式) + 大驼峰(帕斯卡)命名、连字符(脊柱式) + 全大写命名、全小写、全大写等常用命名方式", - "version": "0.0.1", + "displayName": "Variable Conversion [Under development(正在开发中)]", + "description": "A variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), lower, upper case, and more. \n变量名转换插件,支持右键菜单、快捷键、底栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、连字符(脊柱式)、全小写、全大写等常用命名方式(及组合)转换", + "version": "0.0.2", + "publisher": "coder-xiaomo", "engines": { "vscode": "^1.87.0" }, @@ -24,9 +25,7 @@ } ], "main": "./out/extension.js", - "activationEvents": [ - "*" - ], + "activationEvents": [], "contributes": { "commands": [ { @@ -167,7 +166,8 @@ "pretest": "npm run compile && npm run lint", "lint": "eslint src --ext ts", "test": "vscode-test", - "package": "echo \"start `vsce package`\" & vsce package" + "package": "echo \"start `vsce package`\" & vsce package", + "publish": "vsce publish" }, "devDependencies": { "@types/mocha": "^10.0.6",