diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 979cd469c..19569a624 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -17,12 +17,11 @@ jobs: - uses: actions/setup-node@v3.1.1 with: node-version: "14.x" - - run: npm i - - run: npm i -g vsce + - run: npm install + - run: npm install --global vsce - uses: actions/setup-python@v3 with: python-version: "3.8" - - run: npm install - run: EXTENSIONS=$(node diff-extensions) node publish-extensions env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index db31bca3a..e24f6cf79 100644 --- a/README.md +++ b/README.md @@ -78,4 +78,16 @@ If a `custom` property is provided, then every command from the array is execute See all `ovsx` CLI options [here](https://github.com/eclipse/openvsx/blob/master/cli/README.md). +## Environment Variables +Custom commands such as `prepublish` and the ones inside the `custom`-array receive a few environment variables +in order to perform advanced tasks such as executing operations based on the extension version. + +Following environment variables are available: + - `EXTENSION_ID`: the extension ID, e.g. `rebornix.ruby` + - `EXTENSION_PUBLISHER`: the extension publisher, e.g. `rebornix` + - `EXTENSION_NAME`: the extension name, e.g. `ruby` + - `VERSION`: the version of the extension to publish, e.g. `0.1.0` + - `MS_VERSION`: the latest version of the extension on MS marketplace, e.g. `0.1.0` + - `OVSX_VERSION`: the latest version of the extension on Open VSX, e.g. `0.1.0` + [publish-extensions-job]: https://github.com/open-vsx/publish-extensions/blob/master/.github/workflows/publish-extensions.yml diff --git a/extensions.json b/extensions.json index 148572ff3..ae9ce8ad7 100644 --- a/extensions.json +++ b/extensions.json @@ -9,9 +9,6 @@ "abusaidm.html-snippets": { "repository": "https://github.com/abusaidm/html-snippets" }, - "adamhartford.vscode-base64": { - "repository": "https://github.com/adamhartford/vscode-base64" - }, "adelphes.android-dev-ext": { "repository": "https://github.com/adelphes/android-dev-ext" }, @@ -54,9 +51,6 @@ "amodio.tsl-problem-matcher": { "repository": "https://github.com/eamodio/vscode-tsl-problem-matcher" }, - "andreweinand.mock-debug": { - "repository": "https://github.com/microsoft/vscode-mock-debug" - }, "Angular.ng-template": { "repository": "https://github.com/angular/vscode-ng-language-service", "prepublish": "scripts/build.sh package.json" @@ -67,17 +61,11 @@ "apollographql.apollo-midnight-color-theme": { "repository": "https://github.com/apollographql/apollo-midnight" }, - "appulate.filewatcher": { - "repository": "https://github.com/appulate/vscode-file-watcher" - }, "arcanis.vscode-zipfs": { "repository": "https://github.com/yarnpkg/berry", "location": "packages/vscode-zipfs", "prepublish": "sed -ri \"s_ssh://git@github.com/yarnpkg/berry.git_https://github.com/yarnpkg/berry_g\" packages/vscode-zipfs/package.json" }, - "arjun.swagger-viewer": { - "repository": "https://github.com/arjun-g/vs-swagger-viewer" - }, "asabil.meson": { "repository": "https://github.com/asabil/vscode-meson" }, @@ -124,13 +112,20 @@ "repository": "https://github.com/mattbierner/vscode-emojisense" }, "bierner.markdown-image-size": { - "repository": "https://github.com/mjbvz/vscode-markdown-image-size" + "repository": "https://github.com/mjbvz/vscode-markdown-image-size", + "prepublish": "[ $VERSION = '0.0.4' ] && sed -i 's/\\(\"vscode\": \"\\).*\\(\"\\)/\\1^1.33.0\\2/g' package.json || true" }, "bierner.markdown-mermaid": { "repository": "https://github.com/mjbvz/vscode-markdown-mermaid" }, "bmalehorn.vscode-fish": { - "repository": "https://github.com/bmalehorn/vscode-fish" + "repository": "https://github.com/bmalehorn/vscode-fish", + "custom": [ + "[ $VERSION = '1.0.27' ] && sed -i '/\"\\(postinstall\\|test\\)\": \".*\"/d;s/\\(\"watch\": \".*\"\\),/\\1/g' package.json || true", + "[ $VERSION = '1.0.27' ] && rm -rf ./src/test || true", + "yarn install", + "vsce package -o extension.vsix" + ] }, "bmewburn.vscode-intelephense-client": { "repository": "https://github.com/bmewburn/vscode-intelephense" @@ -329,9 +324,6 @@ "felipecaputo.git-project-manager": { "repository": "https://github.com/felipecaputo/git-project-manager" }, - "felixfbecker.php-debug": { - "repository": "https://github.com/xdebug/vscode-php-debug" - }, "felixfbecker.php-intellisense": { "repository": "https://github.com/felixfbecker/vscode-php-intellisense" }, @@ -368,15 +360,9 @@ "formulahendry.vscode-mysql": { "repository": "https://github.com/formulahendry/vscode-mysql" }, - "formulahendry.vscode-node-red": { - "repository": "https://github.com/formulahendry/vscode-node-red" - }, "Fr43nk.seito-openfile": { "repository": "https://gitlab.com/fr43nk/seito-openfile" }, - "fraser.live-coder": { - "repository": "https://gitlab.com/Fraser-Greenlee/live-coder-vscode-extension" - }, "fredericbonnet.cmake-test-adapter": { "repository": "https://github.com/fredericbonnet/cmake-test-explorer" }, @@ -424,7 +410,8 @@ "repository": "https://github.com/halcyon-tech/code-for-ibmi" }, "halcyontechltd.git-client-ibmi": { - "repository": "https://github.com/halcyon-tech/git-client-ibmi" + "repository": "https://github.com/halcyon-tech/git-client-ibmi", + "prepublish": "[ $VERSION = '0.1.0' ] && mv LICENCE LICENSE || true" }, "halcyontechltd.vscode-ibmi-walkthroughs": { "repository": "https://github.com/halcyon-tech/vscode-ibmi-walkthroughs" @@ -436,9 +423,6 @@ "HanWang.android-adb-wlan": { "repository": "https://github.com/deskbtm/android-adb-wlan" }, - "hashicorp.terraform": { - "repository": "https://github.com/hashicorp/vscode-terraform" - }, "haskell.haskell": { "repository": "https://github.com/haskell/vscode-haskell" }, @@ -493,7 +477,8 @@ "repository": "https://github.com/iocave/customize-ui" }, "iocave.monkey-patch": { - "repository": "https://github.com/iocave/monkey-patch" + "repository": "https://github.com/iocave/monkey-patch", + "prepublish": "rm -rf ./src/test" }, "ipedrazas.kubernetes-snippets": { "repository": "https://github.com/ipedrazas/kubernetes-snippets" @@ -528,7 +513,8 @@ "repository": "https://github.com/jianbingfang/vscode-dup-checker" }, "jock.svg": { - "repository": "https://github.com/lishu/vscode-svg2" + "repository": "https://github.com/lishu/vscode-svg2", + "prepublish": "[ $VERSION = '1.4.17' ] && sed -i '/formatPlugins: .* = \\[/,/\\]/{/inlineStyles:/,${/}/{s/}/\\0 as any/g}}}' ./client/src/commands.ts || true" }, "johnpapa.Angular2": { "repository": "https://github.com/johnpapa/vscode-angular-snippets" @@ -541,27 +527,36 @@ }, "johnsoncodehk.volar": { "repository": "https://github.com/johnsoncodehk/volar", - "prepublish": "yarn install && yarn build", - "location": "extensions/vscode-vue-language-features" + "location": "extensions/vscode-vue-language-features", + "custom": [ + "npx pnpm install --no-frozen-lockfile --shamefully-hoist", + "npx pnpm run build", + "cd ./extensions/vscode-vue-language-features && npx vsce package -o extension.vsix" + ] }, "johnsoncodehk.vscode-typescript-vue-plugin": { "repository": "https://github.com/johnsoncodehk/volar", - "prepublish": "yarn install && yarn build", - "location": "extensions/vscode-typescript-vue-plugin" + "location": "extensions/vscode-typescript-vue-plugin", + "custom": [ + "npx pnpm install --no-frozen-lockfile --shamefully-hoist", + "npx pnpm run build", + "cd ./extensions/vscode-typescript-vue-plugin && npx vsce package -o extension.vsix" + ] }, "jolaleye.horizon-theme-vscode": { "repository": "https://github.com/jolaleye/horizon-theme-vscode", "prepublish": "npm run build" }, - "jpoissonnier.vscode-styled-components": { - "repository": "https://github.com/styled-components/vscode-styled-components" - }, "junstyle.php-cs-fixer": { "repository": "https://github.com/junstyle/vscode-php-cs-fixer" }, "justusadam.language-haskell": { "repository": "https://github.com/JustusAdam/language-haskell", - "prepublish": "npm i --save-dev @types/node@10 && make all" + "custom": [ + "[ $VERSION = '3.6.0' ] && git checkout 0475f2dace08a0b9f419c7521475564fa89f130f || true", + "npm install", + "vsce package -o extension.vsix" + ] }, "k--kato.docomment": { "repository": "https://github.com/kasecato/vscode-docomment" @@ -626,7 +621,11 @@ "repository": "https://github.com/mastazi/VS-code-vagrantfile" }, "marus25.cortex-debug": { - "repository": "https://github.com/Marus/cortex-debug" + "repository": "https://github.com/Marus/cortex-debug", + "custom": [ + "npm ci", + "vsce package -o extension.vsix" + ] }, "matepek.vscode-catch2-test-adapter": { "repository": "https://github.com/matepek/vscode-catch2-test-adapter" @@ -649,9 +648,6 @@ "MehediDracula.php-namespace-resolver": { "repository": "https://github.com/MehediDracula/PHP-Namespace-Resolver" }, - "miguel-savignano.ruby-symbols": { - "repository": "https://github.com/MiguelSavignano/vscode-ruby-symbols" - }, "miguelsolorio.fluent-icons": { "repository": "https://github.com/misolori/vscode-fluent-icons" }, @@ -764,6 +760,14 @@ "repository": "https://github.com/microsoft/vscode-loc", "location": "i18n/vscode-language-pack-zh-hant" }, + "ms-dotnettools.vscode-dotnet-runtime": { + "repository": "https://github.com/dotnet/vscode-dotnet-runtime", + "location": "vscode-dotnet-runtime-extension", + "custom": [ + "cp LICENSE* vscode-dotnet-runtime-extension", + "cd vscode-dotnet-runtime-extension && vsce package --ignoreFile ../.vscodeignore -o extension.vsix --yarn" + ] + }, "ms-kubernetes-tools.vscode-kubernetes-tools": { "repository": "https://github.com/Azure/vscode-kubernetes-tools" }, @@ -819,7 +823,12 @@ "extensionFile": "dist/js-debug.vsix" }, "ms-vscode.js-debug-companion": { - "repository": "https://github.com/microsoft/vscode-js-debug-companion" + "repository": "https://github.com/microsoft/vscode-js-debug-companion", + "custom": [ + "[ $VERSION = '1.0.16' ] && git checkout 638db88f56220c2d273aea633c4f67038c170c34 || true", + "npm install", + "vsce package -o extension.vsix" + ] }, "ms-vscode.live-server": { "repository": "https://github.com/microsoft/vscode-livepreview" @@ -827,6 +836,9 @@ "ms-vscode.makefile-tools": { "repository": "https://github.com/microsoft/vscode-makefile-tools" }, + "ms-vscode.mock-debug": { + "repository": "https://github.com/microsoft/vscode-mock-debug" + }, "ms-vscode.node-debug": { "repository": "https://github.com/microsoft/vscode-node-debug", "prepublish": "yarn prepublish && yarn package" @@ -856,20 +868,21 @@ "ms-vscode.vscode-js-profile-flame": { "repository": "https://github.com/microsoft/vscode-js-profile-visualizer", "location": "packages/vscode-js-profile-flame", - "prepublish": "npm run compile" - }, - "ms-vscode.vscode-js-profile-notebook": { - "repository": "https://github.com/microsoft/vscode-js-profile-visualizer", - "location": "packages/vscode-js-profile-notebook", - "prepublish": "npm run compile" + "custom": [ + "npx --ignore-existing npm install", + "npm run compile", + "cp LICENSE* packages/vscode-js-profile-flame", + "cd packages/vscode-js-profile-flame && vsce package --no-dependencies -o extension.vsix" + ] }, "ms-vscode.vscode-js-profile-table": { "repository": "https://github.com/microsoft/vscode-js-profile-visualizer", "location": "packages/vscode-js-profile-table", "custom": [ - "npm install", + "npx --ignore-existing npm install", "npm run compile", - "cd packages/vscode-js-profile-table && vsce package --yarn --out extension.vsix" + "cp LICENSE* packages/vscode-js-profile-table", + "cd packages/vscode-js-profile-table && vsce package --no-dependencies -o extension.vsix" ] }, "ms-vscode.vscode-smoketest-check": { @@ -897,7 +910,21 @@ "repository": "https://github.com/egonyans/vscode-ext-color-highlight" }, "neikeq.godot-csharp-vscode": { - "repository": "https://github.com/godotengine/godot-csharp-vscode" + "repository": "https://github.com/godotengine/godot-csharp-vscode", + "timeout": 10, + "custom": [ + "[ $VERSION = '0.2.1' ] && npm install --save-dev webpack@5.70.0 webpack-cli@4.9.2 || true", + "echo 'apt-get update -y' > /tmp/build-godot.sh", + "echo 'apt-get install -y apt-transport-https dirmngr gnupg ca-certificates' >> /tmp/build-godot.sh", + "echo 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF' >> /tmp/build-godot.sh", + "echo \"echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | tee /etc/apt/sources.list.d/mono-official-stable.list\" >> /tmp/build-godot.sh", + "echo 'apt-get update -y && apt-get install -y mono-devel' >> /tmp/build-godot.sh", + "echo \"usermod -u $(id -u) node\" >> /tmp/build-godot.sh", + "echo 'su -c \"npm install\" node' >> /tmp/build-godot.sh", + "echo 'su -c \"npm remove --no-save make\" node' >> /tmp/build-godot.sh", + "echo 'su -c \"npx --package vsce vsce package -o extension.vsix\" node' >> /tmp/build-godot.sh", + "cat /tmp/build-godot.sh | docker run -i -v $(pwd):/workspace -w /workspace node:lts bash" + ] }, "neilbrayfield.php-docblocker": { "repository": "https://github.com/neild3r/vscode-php-docblocker" @@ -940,9 +967,6 @@ "onecentlin.laravel5-snippets": { "repository": "https://github.com/onecentlin/laravel5-snippets-vscode" }, - "oouo-diogo-perdigao.docthis": { - "repository": "https://github.com/oouo-diogo-perdigao/vscode-docthis" - }, "openfl.lime-vscode-extension": { "repository": "https://github.com/openfl/lime-vscode-extension" }, @@ -950,7 +974,12 @@ "repository": "https://github.com/paiqo/Databricks-VSCode" }, "paragdiwan.gitpatch": { - "repository": "https://github.com/paragdiwan/vscode-git-patch" + "repository": "https://github.com/paragdiwan/vscode-git-patch", + "custom": [ + "[ $VERSION = '0.2.1' ] && git checkout a648bb3656d0c5c9e9c8cb281eb71d56fd0e9f6a || true", + "npm install", + "vsce package -o extension.vsix" + ] }, "patbenatar.advanced-new-file": { "repository": "https://github.com/patbenatar/vscode-advanced-new-file" @@ -962,7 +991,8 @@ "repository": "https://github.com/paulmolluzzo/convert-css-in-js" }, "peterj.proto": { - "repository": "https://github.com/pj3677/vscode-protobuf" + "repository": "https://github.com/pj3677/vscode-protobuf", + "prepublish": "[ $VERSION = '0.0.3' ] && sed -i 's/\\(\"icon\": \".*\\.\\)svg\\(\"\\)/\\1png\\2/g' package.json && npx svgexport ./images/protobuficon.svg ./images/protobuficon.png || true" }, "pflannery.vscode-versionlens": { "repository": "https://gitlab.com/versionlens/vscode-versionlens/" @@ -984,10 +1014,19 @@ }, "rebornix.ruby": { "repository": "https://github.com/rubyide/vscode-ruby", - "location": "packages/vscode-ruby-client" + "location": "packages/vscode-ruby-client", + "custom": [ + "[ $VERSION = '0.28.1' ] && sed -i 's/{/\\0\\n\\t\"concurrency\": 1,/g' lerna.json || true", + "npx yarn install", + "[ $VERSION = '0.28.1' ] && mkdir -p ./packages/language-server-ruby/dist || true", + "npx lerna run build", + "cp LICENSE* packages/vscode-ruby-client/", + "cd packages/vscode-ruby-client && vsce package --no-dependencies -o extension.vsix" + ] }, "reduckted.vscode-gitweblinks": { - "repository": "https://github.com/reduckted/vscode-gitweblinks" + "repository": "https://github.com/reduckted/GitWebLinks", + "location": "vscode" }, "ria.elastic": { "repository": "https://github.com/hsen-dev/vscode-elastic" @@ -995,9 +1034,6 @@ "richie5um2.vscode-sort-json": { "repository": "https://github.com/richie5um/vscode-sort-json" }, - "rintoj.json-organizer": { - "repository": "https://github.com/rintoj/json-organizer" - }, "ritwickdey.LiveServer": { "repository": "https://github.com/ritwickdey/vscode-live-server" }, @@ -1026,7 +1062,13 @@ "repository": "https://github.com/sdras/night-owl-vscode-theme" }, "serayuzgur.crates": { - "repository": "https://github.com/serayuzgur/crates" + "repository": "https://github.com/serayuzgur/crates", + "custom": [ + "[ $VERSION = '0.5.10' ] && git checkout f633224c84578a514d2171c0bb59395027716908 || true", + "[ $VERSION = '0.5.10' ] && sed -i 's/\\(\"version\": \"\\).*\\(\"\\)/\\1'$VERSION'\\2/g' package.json || true", + "npm install", + "vsce package -o extension.vsix" + ] }, "Serpen.vbsvscode": { "repository": "https://github.com/Serpen/VBS-VSCode" @@ -1053,9 +1095,6 @@ "shrey150.javafx-support": { "repository": "https://github.com/shrey150/vscode-javafx-support" }, - "shuworks.vscode-table-formatter": { - "repository": "https://github.com/shuGH/vscode-table-formatter" - }, "shyykoserhiy.git-autoconfig": { "repository": "https://github.com/ShyykoSerhiy/git-autoconfig" }, @@ -1083,15 +1122,15 @@ "snyk-security.vscode-vuln-cost": { "repository": "https://github.com/snyk/vulncost" }, - "sodatea.velocity": { - "repository": "https://github.com/trilogy-group/vscode-velocity" - }, "steoates.autoimport": { "repository": "https://github.com/soates/Auto-Import" }, "stripe.vscode-stripe": { "repository": "https://github.com/stripe/vscode-stripe" }, + "styled-components.vscode-styled-components": { + "repository": "https://github.com/styled-components/vscode-styled-components" + }, "stylelint.vscode-stylelint": { "repository": "https://github.com/stylelint/vscode-stylelint" }, @@ -1189,7 +1228,15 @@ "repository": "https://github.com/vscode-icons/vscode-icons" }, "vscode-org-mode.org-mode": { - "repository": "https://github.com/vscode-org-mode/vscode-org-mode" + "repository": "https://github.com/vscode-org-mode/vscode-org-mode", + "custom": [ + "[ $MS_VERSION = '1.0.0' ] && git checkout e8cc69868af427f5fd03c8ad125b493cbf2e8292 || true", + "[ $MS_VERSION = '1.0.0' ] && npm remove --save-dev vscode && npm install --save-dev typescript@3 @types/vscode@1.23 @types/node@7 || true", + "[ $MS_VERSION = '1.0.0' ] && sed -i '/\"categories\":\\s*\\[/,/\\[/{s/\\(\"\\)\\(Languages\"\\)/\\1Programming \\2/g}' package.json || true", + "[ $MS_VERSION = '1.0.0' ] && sed -i '/\"postinstall\": \".*\"/d' package.json || true", + "npm install", + "vsce package -o extension.vsix" + ] }, "vscode.smali": { "repository": "https://github.com/ViRb3/vscode-smali", @@ -1210,7 +1257,15 @@ }, "vshaxe.hxcpp-debugger": { "repository": "https://github.com/vshaxe/hxcpp-debugger", - "prepublish": "npx lix download" + "custom": [ + "[ $VERSION = '1.2.4' ] && git checkout 4a5fdc0adcce7e6d028fb64aaf9777695110341d || true", + "npm install", + "[ $VERSION = '1.2.4' ] && npm install --no-save lix || true", + "npx lix download", + "[ $VERSION = '1.2.4' ] && npx haxelib install vscode && npx haxelib install vscode-debugadapter || true", + "npx haxe build.hxml", + "vsce package -o extension.vsix" + ] }, "vsls-contrib.codetour": { "repository": "https://github.com/vsls-contrib/codetour" @@ -1233,15 +1288,20 @@ "location": "packages/vscode-import-cost", "prepublish": "cd packages/vscode-import-cost && git clean -xdf && npm install" }, - "wmaurer.change-case": { - "repository": "https://github.com/wmaurer/vscode-change-case" - }, "wongjn.php-sniffer": { "repository": "https://github.com/wongjn/vscode-php-sniffer" }, "Wscats.eno": { "repository": "https://github.com/Wscats/compile-hero", - "prepublish": "npm run build" + "custom": [ + "[ $VERSION = '2.3.53' ] && sed -i '/\"postinstall\": \".*\"/d' publish.js || true", + "[ $VERSION = '2.3.53' ] && sed -i '/\"devDependencies\": {/a\\ \"@types/vscode\": \"^1.39.0\",' publish.js || true", + "[ $VERSION = '2.3.53' ] && sed -i '/\"devDependencies\": {/,/}/{ /\"vscode\": \".*\"/d }' publish.js || true", + "[ $VERSION = '2.3.53' ] && rm -rf src/test || true", + "npm run build:beautify || true", + "npm install", + "vsce package -o extension.vsix" + ] }, "Wscats.omi-snippets": { "repository": "https://github.com/Wscats/omi-snippets" @@ -1256,8 +1316,17 @@ "xaver.clang-format": { "repository": "https://github.com/xaverh/vscode-clang-format-provider" }, + "xdebug.php-debug": { + "repository": "https://github.com/xdebug/vscode-php-debug" + }, "xirider.livecode": { - "repository": "https://github.com/xirider/livecode" + "repository": "https://github.com/xirider/livecode", + "custom": [ + "[ $VERSION = '1.3.10' ] && npx rimraf node_modules || true", + "[ $VERSION = '1.3.10' ] && sed -i '/\"license\": \".*\"/d' package.json || true", + "npm install", + "vsce package -o extension.vsix" + ] }, "xxamxx.vscode-rubygems": { "repository": "https://github.com/xxamxx/vscode-rubygems" diff --git a/publish-extension.js b/publish-extension.js index 7a9d7d1b9..0427cc054 100644 --- a/publish-extension.js +++ b/publish-extension.js @@ -38,6 +38,12 @@ const { createVSIX } = require('vsce'); options = { extensionFile: context.file }; } else if (context.repo && context.ref) { console.log(`${id}: preparing from ${context.repo}...`); + process.env.EXTENSION_ID = extension.id; + process.env.EXTENSION_PUBLISHER = context.msPublisher; + process.env.EXTENSION_NAME = extension.id.substring(context.msPublisher.length + 1); + process.env.VERSION = context.version; + process.env.MS_VERSION = context.msVersion; + process.env.OVSX_VERSION = context.ovsxVersion; await exec(`git checkout ${context.ref}`, { cwd: context.repo }); if (extension.custom) { try {