From 27a4d7535308c027904ab6ccf4613003638c7870 Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Tue, 10 Dec 2024 11:57:18 +0100 Subject: [PATCH 1/4] Fix native dependencies --- .github/workflows/publish-vsx-latest.yml | 2 +- .github/workflows/publish-vsx-next.yml | 2 +- .github/workflows/publish-vsx-specific-latest.yml | 2 +- .github/workflows/publish-vsx-specific-next.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-vsx-latest.yml b/.github/workflows/publish-vsx-latest.yml index 0b23a7a..a06a9bc 100644 --- a/.github/workflows/publish-vsx-latest.yml +++ b/.github/workflows/publish-vsx-latest.yml @@ -22,7 +22,7 @@ jobs: # should be aligned with https://github.com/microsoft/vscode/blob/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/.github/workflows/ci.yml#L108 - run: | sudo apt-get update - sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 + sudo apt-get install -y libxkbfile-dev pkg-config libkrb5-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 sudo cp vscode/build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb sudo chmod +x /etc/init.d/xvfb sudo update-rc.d xvfb defaults diff --git a/.github/workflows/publish-vsx-next.yml b/.github/workflows/publish-vsx-next.yml index d520eac..c373dbc 100644 --- a/.github/workflows/publish-vsx-next.yml +++ b/.github/workflows/publish-vsx-next.yml @@ -22,7 +22,7 @@ jobs: # should be aligned with https://github.com/microsoft/vscode/blob/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/.github/workflows/ci.yml#L108 - run: | sudo apt-get update - sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 + sudo apt-get install -y libxkbfile-dev pkg-config libkrb5-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 sudo cp vscode/build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb sudo chmod +x /etc/init.d/xvfb sudo update-rc.d xvfb defaults diff --git a/.github/workflows/publish-vsx-specific-latest.yml b/.github/workflows/publish-vsx-specific-latest.yml index 32ab5cc..313b7a4 100644 --- a/.github/workflows/publish-vsx-specific-latest.yml +++ b/.github/workflows/publish-vsx-specific-latest.yml @@ -20,7 +20,7 @@ jobs: # should be aligned with https://github.com/microsoft/vscode/blob/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/.github/workflows/ci.yml#L108 - run: | sudo apt-get update - sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 + sudo apt-get install -y libxkbfile-dev pkg-config libkrb5-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 sudo cp vscode/build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb sudo chmod +x /etc/init.d/xvfb sudo update-rc.d xvfb defaults diff --git a/.github/workflows/publish-vsx-specific-next.yml b/.github/workflows/publish-vsx-specific-next.yml index 4f8a8de..5cb3a24 100644 --- a/.github/workflows/publish-vsx-specific-next.yml +++ b/.github/workflows/publish-vsx-specific-next.yml @@ -20,7 +20,7 @@ jobs: # should be aligned with https://github.com/microsoft/vscode/blob/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/.github/workflows/ci.yml#L108 - run: | sudo apt-get update - sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 + sudo apt-get install -y libxkbfile-dev pkg-config libkrb5-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 sudo cp vscode/build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb sudo chmod +x /etc/init.d/xvfb sudo update-rc.d xvfb defaults From 943f44f396b8a0f9412f939b127ac4b93b68d977 Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Tue, 10 Dec 2024 17:14:09 +0100 Subject: [PATCH 2/4] Refactor publishing guide --- ...lish-vsx-specific-latest.yml => build.yml} | 28 ++++++----- .github/workflows/publish-vsx-latest.yml | 49 ------------------- .github/workflows/publish-vsx-next.yml | 48 ------------------ .../workflows/publish-vsx-specific-next.yml | 43 ---------------- doc/Publishing.md | 41 ++++------------ 5 files changed, 26 insertions(+), 183 deletions(-) rename .github/workflows/{publish-vsx-specific-latest.yml => build.yml} (64%) delete mode 100644 .github/workflows/publish-vsx-latest.yml delete mode 100644 .github/workflows/publish-vsx-next.yml delete mode 100644 .github/workflows/publish-vsx-specific-next.yml diff --git a/.github/workflows/publish-vsx-specific-latest.yml b/.github/workflows/build.yml similarity index 64% rename from .github/workflows/publish-vsx-specific-latest.yml rename to .github/workflows/build.yml index 313b7a4..f05a409 100644 --- a/.github/workflows/publish-vsx-specific-latest.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,12 @@ -name: ovsx-solid---publish-vscode-built-in-extensions-specific-version +name: Build and Publish VS Code Extensions on: + workflow_dispatch: push: branches: - - ovsx-publish + - master + pull_request: + branches: + - master env: NODE_OPTIONS: --max-old-space-size=8192 jobs: @@ -29,15 +33,17 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: vscode/.nvmrc - - run: npx ovsx --version - name: Check ovsx version - - run: | + - name: Check ovsx version + run: npx ovsx --version + - name: Bundle Extensions + run: | yarn yarn build:extensions - name: Bundle Extensions - - run: yarn package-vsix:latest - name: Package Solid Version of Extensions - - run: yarn create-extension-pack:latest - name: Create built-in extensions pack - - run: yarn publish:vsix + - name: Package Solid Version of Extensions + run: yarn package-vsix:latest + - name: Create built-in extensions pack + run: yarn create-extension-pack:latest + # Only publish the extensions if the workflow was manually triggered + - if: ${{ github.event_name == 'workflow_dispatch' }} name: Publish Extensions to open-vsx.org + run: yarn publish:vsix diff --git a/.github/workflows/publish-vsx-latest.yml b/.github/workflows/publish-vsx-latest.yml deleted file mode 100644 index a06a9bc..0000000 --- a/.github/workflows/publish-vsx-latest.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: ovsx-solid---publish-vscode-built-in-extensions -on: - schedule: - - cron: "0 0 * * *" - push: - branches: - - master -env: - NODE_OPTIONS: --max-old-space-size=8192 -jobs: - linux: - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OVSX_PAT: ${{ secrets.OVSX_PAT}} - steps: - - uses: actions/checkout@v1 - - run: | - git submodule init - git submodule update - name: Checkout VS Code - # should be aligned with https://github.com/microsoft/vscode/blob/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/.github/workflows/ci.yml#L108 - - run: | - sudo apt-get update - sudo apt-get install -y libxkbfile-dev pkg-config libkrb5-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 - sudo cp vscode/build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb - sudo chmod +x /etc/init.d/xvfb - sudo update-rc.d xvfb defaults - sudo service xvfb start - name: Setup Build Environment - - uses: actions/setup-node@v4 - with: - node-version-file: vscode/.nvmrc - - run: yarn - name: Install Dependencies - - run: | - cd vscode - git fetch --tags - cd .. - yarn checkout-latest-vscode-release - name: Update vscode Repo and Checkout Latest Official Release - - run: yarn build:extensions - name: Bundle Extensions - - run: yarn package-vsix:latest - name: Package Solid Version of Extensions - - run: yarn create-extension-pack:latest - name: Create built-in extensions pack - # - run: yarn publish:vsix - # name: Publish Extensions to open-vsx.org diff --git a/.github/workflows/publish-vsx-next.yml b/.github/workflows/publish-vsx-next.yml deleted file mode 100644 index c373dbc..0000000 --- a/.github/workflows/publish-vsx-next.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: ovsx-preview--publish-vscode-built-in-extensions -on: - schedule: - - cron: "30 0 * * *" - push: - branches: - - master -env: - NODE_OPTIONS: --max-old-space-size=8192 -jobs: - linux: - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OVSX_PAT: ${{ secrets.OVSX_PAT}} - steps: - - uses: actions/checkout@v1 - - run: | - git submodule init - git submodule update - name: Checkout VS Code - # should be aligned with https://github.com/microsoft/vscode/blob/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/.github/workflows/ci.yml#L108 - - run: | - sudo apt-get update - sudo apt-get install -y libxkbfile-dev pkg-config libkrb5-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 - sudo cp vscode/build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb - sudo chmod +x /etc/init.d/xvfb - sudo update-rc.d xvfb defaults - sudo service xvfb start - name: Setup Build Environment - - uses: actions/setup-node@v4 - with: - node-version-file: vscode/.nvmrc - - run: | - cd vscode - git fetch --tags - git reset --hard origin/main - name: Reset to latest vscode main - - run: | - yarn - yarn build:extensions - name: Bundle Extensions from vscode main - - run: yarn package-vsix:next - name: Package Preview Version of Extensions - - run: yarn create-extension-pack:next - name: Create built-in extensions pack - # - run: yarn publish:vsix - # name: Publish Extensions to open-vsx.org diff --git a/.github/workflows/publish-vsx-specific-next.yml b/.github/workflows/publish-vsx-specific-next.yml deleted file mode 100644 index 5cb3a24..0000000 --- a/.github/workflows/publish-vsx-specific-next.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: ovsx-solid---publish-vscode-built-in-extensions-specific-version-next -on: - push: - branches: - - ovsx-publish-next -env: - NODE_OPTIONS: --max-old-space-size=8192 -jobs: - linux: - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OVSX_PAT: ${{ secrets.OVSX_PAT}} - steps: - - uses: actions/checkout@v1 - - run: | - git submodule init - git submodule update - name: Checkout VS Code - # should be aligned with https://github.com/microsoft/vscode/blob/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/.github/workflows/ci.yml#L108 - - run: | - sudo apt-get update - sudo apt-get install -y libxkbfile-dev pkg-config libkrb5-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 - sudo cp vscode/build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb - sudo chmod +x /etc/init.d/xvfb - sudo update-rc.d xvfb defaults - sudo service xvfb start - name: Setup Build Environment - - uses: actions/setup-node@v4 - with: - node-version-file: vscode/.nvmrc - - run: npx ovsx --version - name: Check ovsx version - - run: | - yarn - yarn build:extensions - name: Bundle Extensions - - run: yarn package-vsix:next - name: Package Intermediate Version of Extensions - - run: yarn create-extension-pack:next - name: Create built-in extensions pack - - run: yarn publish:vsix - name: Publish Extensions to open-vsx.org diff --git a/doc/Publishing.md b/doc/Publishing.md index 3bad61f..ac72578 100644 --- a/doc/Publishing.md +++ b/doc/Publishing.md @@ -121,41 +121,18 @@ check out the correct version of VS Code upon `git submodule update`. The conven ## Publishing to openvsx.org -**Before publishing to open-vsx, all issues opened in [internal](#ip-checks-for-vs-code-built-ins) and [external](#ip-checks-for-external-vs-code-built-ins) should be closed.** -Please work with the Eclipse Foundation staff and the Theia community if there are problems! +> [!IMPORTANT] +> **Before publishing to open-vsx, all issues opened in [internal](#ip-checks-for-vs-code-built-ins) and [external](#ip-checks-for-external-vs-code-built-ins) should be closed.** +> Please work with the Eclipse Foundation staff and the Theia community if there are problems! Publishing is done using GitHub Actions. In the vscode-builtin-extensions repo, a publish token for open-vsx.org has been set, that can be used to publish under the identity of the openvsx publish bot. -There are four workflows in this repo. +Both these Actions are triggered on a workflow dispatch, upon push to the master branch, and in PRs. +They only act on the currently selected `vscode` submodule commit in the specified branch. They do not fetch or pull any new data from the `microsoft/vscode` upstream repository. -- **publish-vsx-latest.yml:** Will check out the latest tagged version of VS Code and builds and packages a release version of the extensions and extension pack -- **publish-vsix-next.yml:** Will check out the VS Code `main branch` and build a prerelase version. +- **publish-vsx-specific-latest:** Creates and packages a **release** version of the built-ins. +- **publish-vsx-specific-next:** Creates and packages a **prerelease** version of the built-ins. -both these workflows are triggered on a regular schedule and upon push to the master branch +If triggered by a workflow dispatch trigger, the built extensions are **published to open vsx**. -- **publish-vsx-specific-latest:** This action is triggered upon pushes to the branch `ovsx-publish`. It checks out the version of VS Code that is checked in as a submodule -on the branch and creates and packages a release version of the built-ins. It then publishes the built-ins and extension pack to the open-vsx registry. -- **publish-vsx-specific-next:** This action is triggered upon pushes to the branch `ovsx-publish-next`. It checks out the version of VS Code that is checked in as a submodule -on the branch and creates and packages a prerelease version of the built-ins. It then publishes the built-ins and extension pack to the open-vsx registry. - -For "regular" vs. "prerelease" vesions see [Building.md](./Building.md)) - -In order to publish updated built-ins, we replace the contents of the `osvx-publish` branch. First, we make sure we're on the branch we're created in the "Testing" section: - - git checkout 1.72.2 - git branch -D ovsx-publish # delete the local version of the publsh branch - git checkout -b osvx-publish # copy our current branch to `osvx-publish` - git push origin # if the push fails because the branch can't be fast-forwarded, add the `-f` flag - -Go in the [Actions](https://github.com/eclipse-theia/vscode-builtin-extensions/actions) tab to observe the publishing progress. - -The publish workflow may fail, usually because the prerequisites for building the built-ins have changed. In this case, make the necessary change in the relevant workflows. In general, the setup should be aligned with the CI setup of VS Code: -. **Make sure you updated all the workflows that may be affected.** -Now push to `osvx-publish` again. Repeat until the publish succeeds. - -Now we make a copy of the publish branch "for the record": - - git checkout -b old-ovsx-publish-.. - git push origin - -At this point, make sure the also apply all changes you had to make to get the publish to succeed in the `master` branch as well. +For "regular" vs. "prerelease" versions see [Building.md](./Building.md). From f9dbc339c514e98d72def2ac4a590e227de2b84a Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Thu, 12 Dec 2024 01:02:49 +0100 Subject: [PATCH 3/4] Adjust scripts --- .github/workflows/build.yml | 4 ++-- doc/Building.md | 27 ++++++++++----------------- doc/Publishing.md | 11 +++-------- package.json | 6 ++---- src/package-vsix.js | 19 ++++--------------- src/version.js | 23 ++--------------------- 6 files changed, 23 insertions(+), 67 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f05a409..02d00eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,9 +40,9 @@ jobs: yarn yarn build:extensions - name: Package Solid Version of Extensions - run: yarn package-vsix:latest + run: yarn package-vsix - name: Create built-in extensions pack - run: yarn create-extension-pack:latest + run: yarn create-extension-pack # Only publish the extensions if the workflow was manually triggered - if: ${{ github.event_name == 'workflow_dispatch' }} name: Publish Extensions to open-vsx.org diff --git a/doc/Building.md b/doc/Building.md index f7dfe96..4f913a2 100644 --- a/doc/Building.md +++ b/doc/Building.md @@ -39,28 +39,21 @@ Remove part saying `mode: production` and redo the build Once we have built our extensions, we can packge them into `*.vsix`-files using this package script: - yarn package-vsix:latest + yarn package-vsix The script will produce `*.vsix` files in a folder called `./dist`. The vsix files will be named like `-.vsix`. Note that the publisher (msvscode) is not included. -If you want to create a prerelease version, you can do so by invoking - - yarn package-vsix:next - -This will generate `*.vsix` files of the form `--next..vsix` - -**Implementation Note:** the VS Code build process puts some shared dependencies in a `node_modules` folder which is located in the "extensions" folder at run time. In order to produce self-contained extensions, we need to include those modules (at the time, it's the typescript language server) into the packaged extensions (currently for `typescript-language-features` and `html-language-features`). The code doing this is located in `src/package-vsix.js`. We also need to patch the `typescript-language-features` extension because it contains a hard-code reference to `../node_modules`. +> [!NOTE] +> The VS Code build process puts some shared dependencies in a `node_modules` folder which is located in the "extensions" folder at run time. +> In order to produce self-contained extensions, we need to include those modules (at the time, it's the typescript language server) into the packaged extensions (currently for `typescript-language-features` and `html-language-features`). +> The code doing this is located in `src/package-vsix.js`. We also need to patch the `typescript-language-features` extension because it contains a hard-code reference to `../node_modules`. ### Creating the built-ins extension-pack -We also create an extension pack from the internal and external built-ins into the `dist` folder with a package script. The file name will be of the form: -builtin-extension-pack-.vsix. - - yarn create-extension-pack:latest - -Again, we can produce a preview release of the form `builtin-extension-pack--next-.vsix - - yarn create-extension-pack:next +We also create an extension pack from the internal and external built-ins into the `dist` folder with a package script. +The file name will be of the form: `builtin-extension-pack-.vsix`. -Note that you will have to package the `next` versions of the built-in extensions before they can be included in a `next` extensions pack. +```sh +yarn create-extension-pack +``` diff --git a/doc/Publishing.md b/doc/Publishing.md index ac72578..380068b 100644 --- a/doc/Publishing.md +++ b/doc/Publishing.md @@ -127,12 +127,7 @@ check out the correct version of VS Code upon `git submodule update`. The conven Publishing is done using GitHub Actions. In the vscode-builtin-extensions repo, a publish token for open-vsx.org has been set, that can be used to publish under the identity of the openvsx publish bot. -Both these Actions are triggered on a workflow dispatch, upon push to the master branch, and in PRs. -They only act on the currently selected `vscode` submodule commit in the specified branch. They do not fetch or pull any new data from the `microsoft/vscode` upstream repository. +Building and optionally publishing the extensions is done through the `Build and Publish VS Code Extensions` workflow. +On any pull request and push to the `master` branch, the workflow will build and package all VS Code extensions to ensure that the build scripts still work as expected. -- **publish-vsx-specific-latest:** Creates and packages a **release** version of the built-ins. -- **publish-vsx-specific-next:** Creates and packages a **prerelease** version of the built-ins. - -If triggered by a workflow dispatch trigger, the built extensions are **published to open vsx**. - -For "regular" vs. "prerelease" versions see [Building.md](./Building.md). +Triggering the workflow through the GitHub UI using the `workflow_dispatch` trigger will additionally publish the built extensions to open-vsx. diff --git a/package.json b/package.json index 11b0264..f484007 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,8 @@ "compile:extensions": "cross-env NODE_OPTIONS=--max-old-space-size=8192 node ./src/compile.js", "bundle:extensions": "cross-env NODE_OPTIONS=--max-old-space-size=8192 node ./src/bundle.js", "publish:vsix": "node ./src/publish-vsix.js", - "package-vsix:latest": "node src/package-vsix.js --tag latest", - "package-vsix:next": "node src/package-vsix.js --tag next", - "create-extension-pack:latest": "node src/create-extension-pack.js --tag latest", - "create-extension-pack:next": "node src/create-extension-pack.js --tag next", + "package-vsix": "node src/package-vsix.js", + "create-extension-pack": "node src/create-extension-pack.js", "checkout-latest-vscode-release": "node src/checkout-latest-vscode.js", "get-external-builtins": "node src/get-external-builtins.js", "clean": "git clean -ffdx; cd vscode && git clean -ffdx", diff --git a/src/package-vsix.js b/src/package-vsix.js index a8e88cc..7b9d31e 100644 --- a/src/package-vsix.js +++ b/src/package-vsix.js @@ -28,13 +28,10 @@ const os = require('os'); const yargs = require('yargs'); const capitalize = require('capitalize'); const { dist, extensions, vscode } = require('./paths.js'); -const { computeVersion, isPublished } = require('./version'); +const { resolveVscodeVersion, isPublished } = require('./version'); const vsce = require('@vscode/vsce'); -const { tag, force } = yargs.option('tag', { - choices: ['latest', 'next'] -}).demandOption('tag') -.option('force', { +const { force } = yargs.option('force', { description: 'package extensions even if found to be already published', boolean: true, default: false @@ -51,10 +48,8 @@ const repository = { }; (async () => { - // compute the version we'll use, given the type of packaging - // (latest/solid vs next/preview) and current vscode git submodule - // commit checked-out - let version = await computeVersion(tag); + // compute the version based on the current vscode git submodule commit checked-out + let version = await resolveVscodeVersion(); console.log(`Packaging builtins from VS Code version: ${version}\n`); const result = []; @@ -151,12 +146,6 @@ const repository = { } } - if (tag === 'next') { - pck.preview = true; - } else { - pck.preview = false; - } - // avoid having vsce run scripts during packaging, such as "vscode-prepublish" pck.scripts = {}; diff --git a/src/version.js b/src/version.js index e8b6d7c..82ce740 100644 --- a/src/version.js +++ b/src/version.js @@ -21,29 +21,10 @@ */ const {default : fetch} = require('node-fetch'); const fs = require('fs') -const { run, vscode } = require('./paths.js'); +const { vscode } = require('./paths.js'); const OPEN_VSX_ORG_URL = 'https://open-vsx.org' -/** - * Returns the version to use when packaging built-in extensions. Based - * on VS Code submodule version and whether it's to be a solid or preview - * release - * - * @param {'latest' | 'next'} releaseType - * @returns {Promise} - */ -async function computeVersion(releaseType) { - let version = await resolveVscodeVersion(); - // Use VS Code version and SHA when packaging 'next': - if (releaseType === 'next') { - const [major, minor, bugfix] = version.split('.'); - const shortRevision = await run('git', ['rev-parse', '--short', 'HEAD'], vscode()); - version = `${major}.${minor}.${bugfix}-next.${shortRevision}`; - } - return version; -} - async function resolveVscodeVersion() { const { version = '0.0.1' } = JSON.parse(await fs.promises.readFile(vscode('package.json'), 'utf-8')); return version; @@ -66,4 +47,4 @@ async function isPublished(version, extension, namespace = 'vscode') { } } -module.exports = { computeVersion, isPublished, resolveVscodeVersion }; +module.exports = { isPublished, resolveVscodeVersion }; From b7db913290d28811eaeb99c1b3062df92acdc6af Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Fri, 13 Dec 2024 09:06:58 +0000 Subject: [PATCH 4/4] Fix build --- src/create-extension-pack.js | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/create-extension-pack.js b/src/create-extension-pack.js index 7a50ea4..d937a7f 100644 --- a/src/create-extension-pack.js +++ b/src/create-extension-pack.js @@ -27,17 +27,14 @@ const path = require('path'); const vsce = require('@vscode/vsce'); const yargs = require('yargs'); -const { computeVersion, resolveVscodeVersion, isPublished } = require('./version'); +const { resolveVscodeVersion, isPublished } = require('./version'); const { dist, extensions, run, theiaExtension } = require('./paths.js'); -const { tag, force } = yargs.option('tag', { - choices: ['latest', 'next'] -}).demandOption('tag') - .option('force', { - description: 'Create extension pack even if it is found to be already available', - boolean: true, - default: false - }).argv; +const { force } = yargs.option('force', { + description: 'Create extension pack even if it is found to be already available', + boolean: true, + default: false +}).argv; const packageJson = 'package.json' const categories = ['Extension Packs']; @@ -55,11 +52,10 @@ const externalBuiltins = ['ms-vscode.js-debug-companion', 'ms-vscode.js-debug']; (async () => { const vscodeVersion = await resolveVscodeVersion(); - const packVersion = await computeVersion(tag); - const extPackNameAndVersion = packName + '-' + packVersion; + const extPackNameAndVersion = packName + '-' + vscodeVersion; - const extPackVsixPath = dist(packName + '-' + packVersion + '.vsix'); - const extensionPackAlreadyAvailable = await isAvailable(extPackVsixPath, packName, packVersion, publisher); + const extPackVsixPath = dist(packName + '-' + vscodeVersion + '.vsix'); + const extensionPackAlreadyAvailable = await isAvailable(extPackVsixPath, packName, vscodeVersion, publisher); if (extensionPackAlreadyAvailable && !force) { console.log("Exiting as this extension package is already created or published: " + extPackVsixPath); return; @@ -74,7 +70,7 @@ const externalBuiltins = ['ms-vscode.js-debug-companion', 'ms-vscode.js-debug']; extPack.name = packName; extPack.displayName = packName; extPack.description = 'Builtin extension pack associated to a version of vscode'; - extPack.version = packVersion; + extPack.version = vscodeVersion; extPack.publisher = publisher; extPack.license = 'EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0'; extPack.categories = categories; @@ -84,7 +80,7 @@ const externalBuiltins = ['ms-vscode.js-debug-companion', 'ms-vscode.js-debug']; if (extPack.extensionPack.length === 0) { process.exitCode = 1; - console.error('Aborting: No extension was found available for this version: ' + packVersion); + console.error('Aborting: No extension was found available for this version: ' + vscodeVersion); return; } @@ -123,8 +119,8 @@ const externalBuiltins = ['ms-vscode.js-debug-companion', 'ms-vscode.js-debug']; const content = fs.readFileSync(extDataPath, 'utf-8'); const extData = JSON.parse(content); - const extVsixPath = dist(extData.name + '-' + packVersion + '.vsix'); - if (!(await isAvailable(extVsixPath, extData.name, packVersion))) { + const extVsixPath = dist(extData.name + '-' + vscodeVersion + '.vsix'); + if (!(await isAvailable(extVsixPath, extData.name, vscodeVersion))) { console.log("Skipping extension, i.e. .vsix is not found and " + "neither published in the registry : " + extVsixPath); continue;