Skip to content
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
merged 11 commits into from
Jul 21, 2017

Conversation

vazexqi
Copy link
Contributor

@vazexqi vazexqi commented Jul 21, 2017

What does this PR do?

Adds scripts for publishing to the VS Code Marketplace.

Usually we would just use vsce publish. However, because of vscode-vsce#191, we need to also generate and publish a SHA 256 of each extension for verification.

This PR automates most of that – some steps are left as manual for now until we know what to streamline.

What is not in the scope of this PR?

No integration with travis.yml yet.

What issues does this PR fix or reference?

@W-4162004@

}

if (/win32/.test(process.platform)) {
shell.exec(`CertUtil -hashfile ${vsix} SHA256`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually foresee us using Windows to publish, but this is just in case.

@@ -66,7 +66,9 @@ runs but that is how you would check locally first.

## List of Useful commands

### `lerna bootstrap`
_These commands assume that they are executed from the top-level directory. Internally, they delegate to `lerna` to call them on each npm module in the packages directory._
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapping each one under npm scripts allows the calling mechanism to be simpler (e.g, since you no longer need to remember which ones to call with --concurrency 1).

@@ -23,7 +23,7 @@
"compile": "tsc -p ./",
"lint": "tslint --project .",
"watch": "tsc -watch -p .",
"clean": "rm -rf node_modules && rm -rf out",
"clean": "shx rm -rf node_modules && shx rm -rf out",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use shelljs/shx to make the script portable across platforms.

@@ -39,6 +38,32 @@
"message": 7
}
}
},
{
"taskName": "Lint",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added these tasks so that you can now do Cmd + Shift + P in VS Code, type task<space> and get a list of such task to invoke without going to the command line.

@vazexqi
Copy link
Contributor Author

vazexqi commented Jul 21, 2017

Here is a sample SHA256

838456002886a11840b68186d923eeb833808b6bbe5c7fbcd04d9f45ad364c33  salesforcedx-vscode-apex-0.1.0.vsix
38006cec5af12b44522e31e7ec320c6af8bddef426ff0a8027cc7b9c2824bca0  salesforcedx-vscode-core-0.1.0.vsix
5c0a318f7c92a6ae854cece9f42f943c2880d5b64347644783048722a89ec4ff  salesforcedx-vscode-lightning-0.1.0.vsix
a964ad456ca7ca0c3a2e76f8c1bb63e3342fe36b13b5f61da2f8123ec97931c5  salesforcedx-vscode-visualforce-0.1.0.vsix
7875049bbaad386575619dc1cd4eb9aed610e1e83620310860d49b849595dc9b  salesforcedx-vscode-0.1.0.vsix

I didn't want to commit this yet since we haven't actually published a version 0.1.0 to the Marketplace.

Nick Chen added 10 commits July 21, 2017 13:43
Also, reorder some of the commands in publish.js so that they make logical sense together.

@W-4162004@
This enables us to publish even if nothing has changed since the last time. Useful for situations where we just want to force an increment in version numbers.

See https://www.npmjs.com/package/lerna#--force-publish-packages

@W-4162004@

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

familiarizing?

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woudl -> would

Copy link
Contributor

@DatGuyJonathan DatGuyJonathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of typos. Else, LGTM.

@W-4162004@
@vazexqi vazexqi merged commit 13c5f0c into develop Jul 21, 2017
@vazexqi vazexqi deleted the nick/publish-with-sha256 branch July 21, 2017 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants