Git Product home page Git Product logo

publish-extensions's Introduction

Publish Extensions to Open VSX

Gitpod Ready-to-Code GitHub Workflow Status

A CI script for publishing open-source VS Code extensions to open-vsx.org.

When to Add an Extension?

One goal of Open VSX is to have extension maintainers publish their extensions according to the documentation. However, you may be missing specific extensions that have not been published by their maintainers: either they are not willing to do it, or they haven't found time to do it, or simply they haven't heard about Open VSX yet. Though the preferred solution for such a situation is to convince the maintainers to start publishing themselves, you can add the extensions here to have them published by our CI workflow.

⚠️ We accept only extensions with OSI-approved open source licenses here. If you want to have an extension with a proprietary or non-approved license, please ask its maintainers to publish it.

How to Add an Extension?

To automatically publish an extension to Open VSX, simply add it to extensions.json with the options described below. You can run node add-extension [REPOSITORY] --checkout to create an entry automatically.

⚠️ Some extensions require additional build steps, and failing to execute them may lead to a broken extension published to Open VSX. Please check the extension's scripts section in the package.json file to find such steps; usually they are named build or similar. In case the build steps are included in the vscode:prepublish script, they are executed automatically, so it's not necessary to mention them explicitly. Otherwise, please include them in the prepublish value, e.g. "prepublish": "npm run build".

Click the button below to start a Gitpod workspace where you can run the scripts contained in this repository:

Open in Gitpod

Publishing Options

The best way to add an extension here is to open this repository in Gitpod (using the blue button above) and to run this helper script:

node add-extension $REPOSITORY_URL --checkout

Notes:

  • Simply replace $REPOSITORY_URL with the extension's actual repository URL
  • This will update extensions.json automatically, which you can commit to send a Pull Request
  • Adding --checkout (without an explicit value) will auto-detect the latest available Git release tag or branch

If you're curious, here are the expected formats of an extensions.json entry:

    {
      // Unique Open VSX extension ID in the form "<namespace>.<name>"
      "id": "rebornix.ruby",
      // A full URL from which to download the extension package
      "download": "https://github.com/rubyide/vscode-ruby/releases/download/v0.25.0/ruby-0.25.0.vsix",
      // (RECOMMENDED) The version that should be published; the script compares this version with the latest published version
      "version": "0.25.0"
    },

Or, in cases where the extension maintainers don't provide a .vsix release to download, you can build the extension from source instead:

    {
      // Unique Open VSX extension ID in the form "<namespace>.<name>"
      "id": "redhat.vscode-yaml",
      // Repository URL to clone and publish from
      "repository": "https://github.com/redhat-developer/vscode-yaml"
    },

Here are all the supported values, including optional ones, to build extensions from source:

    {
      // Unique Open VSX extension ID in the form "<namespace>.<name>"
      "id": "rebornix.ruby",
      // Repository URL to clone and publish from
      "repository": "https://github.com/rubyide/vscode-ruby",
      // (RECOMMENDED) The version that should be published; the script compares this version with the latest published version
      "version": "0.27.0",
      // (RECOMMENDED) The Git branch, tag, or commit to check out before publishing (defaults to the repository's default branch)
      "checkout": "v0.27.0",
      // (OPTIONAL) Location of the extension's package.json in the repository (defaults to the repository's root directory)
      "location": "packages/vscode-ruby-client",
      // (OPTIONAL) Extra commands to run just before publishing to Open VSX (i.e. after "yarn/npm install", but before "vscode:prepublish")
      "prepublish": "npm run build",
      // (OPTIONAL) Relative path of the extension vsix file inside the git repo (i.e. when it is built by prepublish commands
      "extensionFile": "dist/js-debug.vsix"
    },

How are Extensions Published?

Every night at 03:03 UTC, a GitHub workflow goes through all entries in extensions.json, and checks if the specified "version" needs to be published to https://open-vsx.org or not.

The publishing process can be summarized like this:

  1. git clone "repository"
  2. (git checkout "checkout" if a "checkout" value is specified)
  3. npm install (or yarn install if a yarn.lock file is detected in the repository)
  4. ("prepublish")
  5. (ovsx create-namespace "publisher" if it doesn't already exist)
  6. ovsx publish (with --yarn if a yarn.lock file was detected earlier)

See all ovsx CLI options here.

publish-extensions's People

Contributors

alexventuraio avatar andhet avatar averageunicorn avatar awea avatar bryphe avatar cd4d avatar demsullivan avatar dododedodonl avatar eduardomezencio avatar edwintorok avatar github-actions[bot] avatar glandos avatar herandol avatar houhoulis avatar jankeromnes avatar johannrichard avatar kitattyor avatar marcdumais-work avatar niklaskeerl avatar noah1510 avatar p4vook avatar pschyska avatar shahar-h avatar spoenemann avatar svenefftinge avatar tchernobog avatar tymick avatar vymarkov avatar xcesiv avatar yorch avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.