1、 Release method
After the plug-in is developed, how to release it and share it with others? There are three main methods
- Method 1: directly send the folder to others, let others find the directory where vscode plug-ins are stored and put it in it, and then restart vscode, which is generally not recommended;
- Method 2: package it into a vsix plug-in and send it to others for installation. If your plug-in involves secrets and is not convenient to publish to the application market, you can try this method;
- Method 3: register the developer’s account and publish it to the official website application market. This release, like NPM, does not need to be approved.
2、 Local packaging
Whether it’s local packaging or publishing to the application market, you need to use the
npm i vsce -g
If there is no setting when packing
repositoryThere will be a prompt, so it’s better to set it.
The generated vsix file cannot be directly dragged into the installation, and can only be selected from the upper right corner of the extension
Install from VSIXInstallation:
3、 Release application market
The application market of visual studio code is based on Microsoft’s own
Azure DevOps, plug-in authentication, hosting and management are all here.
To publish to the application market, there must be an application market
publisherAccount number; and to have a publishing account, you must first have one
Azure DevOpsOrganization; and before you create an organization, you have to create it
AzureAccount number; create
AzureYou have to have an account number first
It’s a little dizzy. Let’s sort it out
One Microsoft account can create multiple
AzureOrganizations; an organization can create multiple
publisherAccount number; an organization can create multiple accounts at the same time
Personal Access Token, personal access token);
Registered account number
First visit https://login.live.com/ Log in to your
MicrosoftIf you don’t have one, register one first
Then visit: https://aka.ms/SignupAzureDevOps , if you have never used azure, you will see the following prompt:
Click continue to create an organization with the name of mailbox prefix by default.
After entering the homepage of the organization by default, click
Click to create a new personal access token, especially here
all accessible organizations，
Full accessOtherwise, the subsequent press conference will fail.
After the token is created successfully, you need to write it down locally, because the website will not save it for you.
Create publishing account
After obtaining the personal access token, use the
vsceThe following command creates a new Publisher:
vsce create-publisher your-publisher-name
your-publisher-nameIt must be an alphanumeric underline, which is the only account in the whole network. Then, it will ask for the nickname, mailbox and token in turn:
After successful creation, you will log in to this account by default. Next, you can publish it directly. Of course, if you created it in other places, you can try it out
vsce login your-publisher-nameTo log in.
In addition to using commands, you can also use the web version to create a publishing account: https://marketplace.visualstudio.com/manage
The release is simple:
It will take a few minutes to find it in the app market. In a few minutes, you can visit the home page of the web version of the plug-in: https://marketplace.visualstudio.com/items?itemName=sxei.vscode-plugin-demo
You can also find it in vscode:
README.mdThe file will be displayed on the plug-in home page by default;
README.mdAll resources in must be
HTTPSYes, if it is
HTTPFailed to publish;
CHANGELOG.mdIf the code is placed in the GIT repository and the repository field is set, GIT must be submitted before publishing, otherwise it will be prompted
Git working directory not clean；
In addition, as mentioned above, if
OrganizationThere is no choice
all accessible organizationsOr
ScopesThere is no choice
Full accessThe following errors may be reported when publishing:
Error: Failed Request: Unauthorized(401) – https://marketplace.visualstudio.com/_apis/gallery
Be sure to use a Personal Access Token which has access to **all accessible accounts**.
See https://code.visualstudio.com/docs/tools/vscecli#_common-questions for more information.
3.4.2 incremental release
If you want to increase the patch number automatically after the release, for example:
1.0.3It can be as follows:
vsce publish patch
This command will be modified automatically
package.jsonThe version number inside. In the same way,
vsce publish minorIt’s OK.
3.5 cancel Publishing
vsce unpublish (publisher name).(extension name)
If you modify the plug-in code and want to redistribute it, just change the version number and execute it again
vsce publishThat’s fine.
4. Plug in upgrade
4.1 was released to the application market
If it is released to the application market, generally speaking, it will automatically detect whether there is a new version, and if some will be automatically upgraded without perception. However, I have not studied the specific time to detect it. What has been determined is that searching for the plug-in name in the extension panel will automatically detect it, and restarting vscode will also detect it.
4.2 in case of local packaging
If it is packaged into
vsixThen you can only realize the upgrade detection function by yourself. By comparing the version number of a file on the server, I will not elaborate on the details.
This article on the vscode plug-in development strategy (10) package, release, upgrade article introduced here, more related vscode packaging, release, upgrade content, please search the previous articles of developeppaer or continue to browse the related articles below, I hope you can support developeppaer more in the future!