From 9a19fd7f308c0fb696e0df5d8cbf5820bd196698 Mon Sep 17 00:00:00 2001 From: Brian Ingles Date: Fri, 1 Nov 2024 11:07:36 -0500 Subject: [PATCH] docs: Updated package / publish scripts + corresponding docs (#164) --- CONTRIBUTING.md | 11 +++++++---- package.json | 10 +++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3160c6c..b74b2dae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,6 +44,9 @@ To run using `vscode` debugger: 4. You should see the tests start and `vscode` stop at the breakpoint. +## VSCE +[vsce](https://github.com/microsoft/vscode-vsce), short for "Visual Studio Code Extensions", is a command-line tool for packaging, publishing and managing VS Code extensions. The Deephaven extension calls `vsce` via npm scripts. Note that `vsce package` and `vsce publish` both call the `vscode:prepublish` script. + ## Installation from .VSIX This extension can also be installed directly from a `.vsix`. To get a `.vsix`, you can either: @@ -52,7 +55,7 @@ Download one from the [releases/](releases/) folder. or -Build a .vsix locally via `npm run package` +Build a .vsix locally via `npm run package:latest` (see [VSCE](#vsce) section) Then install in vscode: ![Install Deephaven in VS Code](docs/install.png) @@ -86,16 +89,16 @@ https://code.visualstudio.com/api/working-with-extensions/publishing-extension#p 1. Increment the version number in `package.json` (be sure to run `npm i` to update package-lock as well) > See [versioning strategy](#versioning-strategy) for details on our version number scheme. 1. If new content has been added that needs to be packaged that is not included by `.vscodeignore`, make appropriate changes (this should not be common). -1. Package latest `npm run vsix:latest` (inspect output to verify included files are as expected) +1. Package latest `npm run package:latest` (inspect output to verify included files are as expected) 1. Use `vsce` cli to publish to Visual Studio Marketplace ```sh # Pre-release - npm run publish:pre + npm run publish:prerelease ``` 1. Create a version tag with `-pre` suffix. ```sh - npm run vscode:tag + npm run publish:tag git push --tags ``` diff --git a/package.json b/package.json index 85c04d20..35681dff 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,11 @@ "check:types": "npm run clean && tsc --build ./tsconfig.json && tsc -p tsconfig.unit.json --noEmit --module preserve --moduleResolution bundler && tsc -p e2e/tsconfig.json --noEmit --skipLibCheck", "clean": "rm -rf out packages/*/tsconfig.tsbuildinfo", "compile": "npm run check:types && node scripts/esbuild.js", + "compile:prod": "npm run check:types && npm run test:lint && node scripts/esbuild.js --production", "icon:gen": "node icons/generate.mjs", - "package": "npm run check:types && npm run test:lint && node scripts/esbuild.js --production", - "publish:pre": "vsce publish --pre-release", + "package:latest": "vsce package -o releases/vscode-deephaven-latest.vsix", + "publish:prerelease": "vsce publish --pre-release", + "publish:tag": "git tag v$(node -p -e \"require('./package.json').version\")-pre", "report:ctrfmerge": "ctrf merge e2e/reports --keep-reports --output-dir test-reports --output ctrf-report.json", "report:ctrfsummary": "github-actions-ctrf test-reports/ctrf-report.json", "report:junit2ctrf": "junit-to-ctrf test-reports/vitest.junit.xml --output test-reports/ctrf-report.json", @@ -44,9 +46,7 @@ "test:lint": "eslint . --ext ts", "test:unit": "vitest --reporter=default --reporter=junit --outputFile=./test-reports/vitest.junit.xml", "test": "npm run test:unit", - "vscode:prepublish": "npm run package", - "vscode:tag": "git tag v$(node -p -e \"require('./package.json').version\")-pre", - "vsix:latest": "vsce package -o releases/vscode-deephaven-latest.vsix", + "vscode:prepublish": "compile:prod", "watch:esbuild": "node scripts/esbuild.js --watch", "watch:tsc": "npm run clean && tsc --build ./tsconfig.json --watch", "watch": "npm-run-all -p watch:*"