-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add scripts for publishing to VS Code Marketplace #12
Merged
+358
−56
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
96a22a9
Simplify command invocations are npm scripts
489036e
Add shortcuts for running these commands from VS Code
87ef518
Use shx to run scripts in platform-agnostic manner
dd7ab87
Add scripts to help with packaging and publishing of .vsix
6ebb82d
Add instructions on how to publish
fa5ad35
Remove node as the caller for mocha
759f0dc
Clarify how to run on Windows
c62a557
Fix typos
a3da78a
v0.2.0
4f5fe51
Add force-publish
d38a549
Fix typos
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
Add instructions on how to publish
Also, reorder some of the commands in publish.js so that they make logical sense together. @W-4162004@
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Introduction | ||
|
||
This is a guide for publishing to the Visual Studio Code Marketplace. Most | ||
contributors will not need to worry about publishing. However, it might be | ||
worthwhile familiaring yourself with the steps in case you need to share the | ||
extensions through the .vsix files. | ||
|
||
# Goal | ||
|
||
The goal of publishing is to take the extensions under /packages, bundle them as | ||
.vsix files, and push them to the [Visual Studio Code | ||
Marketplace](https://marketplace.visualstudio.com/vscode). | ||
|
||
For more information about publishing take a look at | ||
|
||
* [Publishing VS Code Extensions](https://code.visualstudio.com/docs/extensions/publish-extension) | ||
* [Managing Extensions](https://code.visualstudio.com/docs/editor/extension-gallery) | ||
|
||
# Steps | ||
|
||
The scripts/publish.js contains the end-to-end flow. It is possible to run each step manually. | ||
|
||
The files under scripts use [shelljs/shx](https://github.com/shelljs/shx) and | ||
[shelljs/shelljs](https://github.com/shelljs/shelljs) to write scripts in a | ||
portable manner across platforms. | ||
|
||
## Packaging as .vsix | ||
|
||
### Prerequisite | ||
|
||
* Lerna is properly installed. | ||
|
||
### Steps | ||
|
||
1. `npm run bootstrap` to install all the dependencies and to symlink interdependent local modules. | ||
1. `npm run compile` to compile all the TypeScript files. | ||
1. `npm run test` to run all the tests. | ||
1. `lerna publish ...` will increment the version in the individual package.json | ||
to prepare for publication. **This also commits the changes to git and adds a | ||
tag.** | ||
1. `npm run vscode:package` packages _each_ extension as a .vsix. | ||
|
||
**At this stage, it is possible to share the .vsix directly for manual installation.** | ||
|
||
## Generating SHA256 | ||
|
||
Due to [vscode-vsce#191](https://github.com/Microsoft/vscode-vsce/issues/191) | ||
the .vsix are neither signed nor verified. To ensure that they have not been | ||
tampered with, we generate a SHA256 of the contents and publish that to | ||
https://developer.salesforce.com/media/vscode/SHA256 | ||
|
||
### Prequisite | ||
|
||
* You have access to our S3 bucket at s3://dfc-data-production/media/vscode | ||
* You have the [AWS CLI](https://aws.amazon.com/cli/) installed and configured | ||
via `aws configure` or have the `AWS_ACCESS_KEY_ID` and | ||
`AWS_SECRET_ACCESS_KEY` exported as environment variables. | ||
|
||
### Steps | ||
|
||
1. `npm run vscode:sha256` will compute the SHA256 for the .vsix generated in | ||
the previous stage. | ||
1. The SHA256 are appended to the top-level SHA256 file. | ||
1. This file is then copied over to our S3 bucket. | ||
1. Finally the file is added to git so that it can be committed. | ||
|
||
## Pushing .vsix to Visual Studio Marketplace | ||
|
||
### Prequisite | ||
|
||
* You have a personal access token that for the salesforce publisher id that is | ||
exported as `VSCE_PERSONAL_ACCESS_TOKEN`. | ||
* Or, you have vsce installed and configured with the salesforce publisher id. | ||
|
||
### Steps | ||
|
||
1. `npm run vscode:publish` takes the .vsix that you had _before_ and uploads | ||
it to the Visual Studio Code Marketplace. | ||
|
||
It's **crucial** that you publish the .vsix that you had before so that the | ||
SHA256 match. If you were to repackage, the SHA256 woudl be different. | ||
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. woudl -> would |
||
|
||
# Tips | ||
|
||
1. After publishing, you will need to run `npm run bootstrap` again to continue | ||
development. This is because the `npm run vscode:package` step does a `npm | ||
prune --production`. This is required due to the way Lerna does symlinking. | ||
See [vscode-vsce#52](https://github.com/Microsoft/vscode-vsce/issues/52) for | ||
more information. |
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
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.
familiarizing?