This document outlines the steps to publish new versions of the ContextShare extension to the Visual Studio Marketplace.
- Node.js and npm: Ensure you have Node.js (which includes npm) installed.
- Azure DevOps Account: You need an Azure DevOps account to create a Personal Access Token (PAT).
- Publisher Account: You must be a member of the "ContextShare" publisher account on the VS Code Marketplace.
To publish to the Marketplace, you need a Personal Access Token (PAT) with publishing rights.
-
Create a PAT:
- Navigate to your Azure DevOps organization (e.g.,
https://dev.azure.com/{your_organization_name}). - Go to User settings (the gear icon) > Personal Access Tokens.
- Click + New Token.
- Give it a descriptive name (e.g.,
vsce-publish-contextshare). - Set the Organization to "All accessible organizations".
- Set the Scope to Custom defined and click Show all scopes.
- Find and select Marketplace (Manage).
- Click Create.
- Navigate to your Azure DevOps organization (e.g.,
-
Store the PAT:
- IMPORTANT: Copy the generated token immediately. You will not be able to see it again.
- Create a new file named
.envin the root of this project. - Add the following line to your
.envfile, replacing{your_pat}with the token you just copied:VSCE_PAT={your_pat} - The
.envfile is already listed in.gitignore, so it will not be committed to source control.
Use this for testing new features before a stable release. The version in package.json (e.g., 0.4.0) will be published as a pre-release.
-
Ensure
package.jsonhas the correct version number. -
Run the following command:
npm run publish:prerelease
This will build, test, and publish the extension as a pre-release (e.g., 0.4.0 (Pre-release)).
Once a pre-release version has been tested and is ready for general availability, you can publish it as a stable release.
-
Ensure
package.jsonhas the correct version number. -
Run the following command:
npm run publish:stable
This will publish the version as a stable release, making it the default for all users.
If you only want to create the .vsix file without publishing it to the Marketplace, run:
npm run packageThe generated .vsix file will be in the root of the project directory.