Giter Site home page Giter Site logo

eclipse / openvsx Goto Github PK

View Code? Open in Web Editor NEW
1.1K 25.0 123.0 6.92 MB

An open-source registry for VS Code extensions

Home Page: https://open-vsx.org/

License: Eclipse Public License 2.0

Dockerfile 0.14% TypeScript 22.60% JavaScript 0.24% Java 74.46% HTML 0.02% CSS 0.02% Shell 0.35% Scala 1.71% PLpgSQL 0.46%
registry marketplace extension vscode theia

openvsx's Introduction

Eclipse Open VSX

Gitpod Ready-to-Code Join the chat at https://gitter.im/eclipse/openvsx CI

Open VSX is a vendor-neutral open-source alternative to the Visual Studio Marketplace. It provides a server application that manages VS Code extensions in a database, a web application similar to the VS Code Marketplace, and a command-line tool for publishing extensions similar to vsce.

A public instance of Open VSX is running at open-vsx.org. Please report issues related to that instance at EclipseFdn/open-vsx.org.

Getting Started

See the openvsx Wiki for documentation of general concepts and usage of this project.

Development

The easiest way to get a development environment for this project is to open it in Gitpod.

Open in Gitpod

Click Open Browser on port 3000 to see the running web application.

cli

  • yarn build — build the library and ovsx command
  • yarn watch — watch (build continuously)

The command line tool is available at cli/lib/ovsx.

webui

The default frontend is the one bundled in the Docker image, and is also used for testing in the development environment. It depends on the compiled library, so make sure to build or watch the library before you build or watch the default frontend.

  • yarn build — build the library
  • yarn watch — watch (build continuously)
  • yarn build:default — build the default frontend (run webpack)
  • yarn watch:default — run webpack in watch mode
  • yarn start:default — start Express to serve the frontend on port 3000

The Express server is started automatically in Gitpod. A restart is usually not necessary.

server

  • ./gradlew build — build and test the server
  • ./gradlew assemble -t — build continuously (the server is restarted after every change)
  • ./gradlew runServer — start the Spring server on port 8080
  • ./scripts/test-report.sh — display test results on port 8081

The Spring server is started automatically in Gitpod. It includes spring-boot-devtools which detects changes in the compiled class files and restarts the server.

OAuth Setup

If you would like to test authorization through GitHub, you need to create an OAuth app with a callback URL pointing to the exposed port 8080 of your Gitpod workspace. You can get it by calling a script:

server/scripts/callback-url.sh github

Note that the callback URL needs to be updated on GitHub whenever you create a fresh Gitpod workspace.

After you created the GitHub OAuth app, the next step is to copy the Client ID and Client Secret into Gitpod environment variables named GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET and bound to this repository. If you change the variables in a running workspace, run scripts/generate-properties.sh in the server directory to update the application properties.

With these settings in place, you should be able to log in by authorizing your OAuth app.

Docker Compose Setup

If you prefer to quickly get started with a local, docker-based development environment, you can use the approach described in our docker compose setup. You can use our docker compose profiles, allowing you the option to either run a service directly in a docker container or to manually build and run it on your local machine.

Google Cloud Setup

If you would like to test file storage via Google Cloud, follow these steps:

  • Create a GCP project and a bucket.
  • Make the bucket public by granting the role "Storage Object Viewer" to allUsers.
  • Configure CORS on the bucket with origin "*" and method "GET".
  • Create environment variables named GCP_PROJECT_ID and GCS_BUCKET_ID containing your GCP project and bucket identifiers. If you change the variables in a running workspace, run scripts/generate-properties.sh in the server directory to update the application properties.
  • Create a GCP service account with role "Storage Object Admin" and copy its credentials file into your workspace.
  • Create an environment variable GOOGLE_APPLICATION_CREDENTIALS containing the path to the credentials file.

Azure Setup

If you would like to test file storage via Azure Blob, follow these steps:

  • Create a file storage account and a container named openvsx-resources (a different name is possible if you change the ovsx.storage.azure.blob-container property).
  • Allow Blob public access in the storage account and set the container's public access level to "Blob".
  • Configure CORS in your storage account with origin "*", method "GET" and allowed headers "x-market-client-id, x-market-user-id, x-client-name, x-client-version, x-machine-id, x-client-commit"
  • Create an environment variable AZURE_SERVICE_ENDPOINT with the "Blob service" URL of your storage account. If you change the variables in a running workspace, run scripts/generate-properties.sh in the server directory to update the application properties.
  • Generate a "Shared access signature" and put its token into an environment variable AZURE_SAS_TOKEN.

If you also would like to test download count via Azure Blob, follow these steps:

  • Create an additional storage account for diagnostics logging.
    • IMPORTANT: set the same location as the file storage account (e.g. North Europe).
    • Disable Blob public access.
  • In the file storage account
    • Open the diagnostic settings (Monitoring -> Diagnostic settings (preview)).
      • Click blob.
      • Click Add diagnostic setting.
      • Select StorageRead, Transaction and Archive to a storage account.
      • Select the diagnostic storage account you created in the previous step as Storage account.
  • Back to the diagnostic storage account
    • Navigate to Data Storage-> Containers
      • The insights-logs-storageread container should have been added (it might take a few minutes and you might need to do some test downloads or it won't get created).
      • Create a "Shared access token" for the insights-logs-storageread container.
        • Click on the insights-logs-storageread container.
          • Click on Settings -> Shared access token
            • Must have Read and List permissions.
            • Set the expiry date to a reasonable value
            • Set the "Allowed IP Addresses" to the server's IP address.
    • Go to Data Management-> Lifecycle management
      • Create a rule, so that logs don't pile up and the download count service stays performant.
      • Select Limit blobs with filters, Block blobs and Base blobs.
      • Pick number of days (e.g. 7).
      • Enter insights-logs-storageread/resourceId= blob prefix to limit the rule to the insights-logs-storageread container.
  • You need to add two environment variables to your server environment
    • AZURE_LOGS_SERVICE_ENDPOINT with the "Blob service" URL of your diagnostic storage account. The URL must end with a slash!
    • AZURE_LOGS_SAS_TOKEN with the shared access token for the insights-logs-storageread container.
    • If you change the variables in a running workspace, run scripts/generate-properties.sh in the server directory to update the application properties.

License

Eclipse Public License 2.0

openvsx's People

Contributors

akosyakov avatar alextugarev avatar amvanbaren avatar autumnfound avatar benoitf avatar danieldietrich avatar dependabot[bot] avatar felipecrs avatar filiptronicek avatar fladdimir avatar haaleo avatar irongeek avatar jankeromnes avatar jbicker avatar jeanp413 avatar joaosa avatar mbarbero avatar msujew avatar nisarhassan12 avatar quanzhuo avatar rectcircle avatar siddharth1010 avatar spoenemann avatar svenefftinge avatar tian-pengfei avatar vince-fugnitto avatar vymarkov avatar wangliang1oppo avatar xai avatar yiningwang11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openvsx's Issues

Conceptual change: publisher => namespace

In the Visual Studio Marketplace, the publisher field from the package.json is used to define the namespace under which an extension is published (see Publishing Extensions). One or more users can be granted the right to use a specific publisher name when publishing an extension. The actual user who published it is hidden in the marketplace, only the publisher is shown instead.

After a discussion with @svenefftinge, we'd like to follow a different approach in Open VSX.

  • Rename publisher to namespace (we still use the publisher field from package.json for compatibility with VS Code extensions).
  • Initially, there is no restriction on namespaces. Every user can publish to every namespace.
  • The user interface shall display the actual user who published an extension.
  • It shall be possible for users to claim a namespace so nobody else can publish to it. Later we'll also offer means to manage namespaces by granting access rights to other users (#5).
  • We'll create a GitHub service account named open-vsx through which we'll publish extensions to open-vsx.org using scripts. These scripts will be maintained in an open source repository at github.com/open-vsx/publish-extensions
  • Remove the --create-publisher flag from the CLI (#16) and introduce a command create-namespace instead.

This approach allows to keep the relationship of namespaces (i.e. publishers) to organizations or individual users, but in addition it gives us the flexibility of publishing a large number of extensions through scripts in a transparent way and still retain the original qualified names (publisher.extension). The open-vsx user is meant to create trust: instead of publishing third-party extensions in secrecy on someone's local machine, we'll do this openly and transparently.

Infinite scrolling of search results

The search endpoint already supports paging of search results. We should use this in the web UI to implement infinite scrolling by automatically loading more results as the user scrolls down.

Provide database migration strategy

Some new features will require changes in the database schema, most importantly #10. We should provide a strategy for database migration so existing data can be retained when breaking changes are rolled out.

Count and display downloads

The number of downloads of an extension (version) shall be counted and displayed on the extension detail page.

This should be considered when implementing #10.

[Q] Publishing new version of extension removes previous version?

I recently published a new version of vscode.cpp on open-vsx.org. The previous version (v1.39.1) is used by the Theia example applications: https://github.com/eclipse-theia/theia/blob/master/package.json#L86

Since publishing v1.43.2, it seems the previous version is no longer served:

$ wget http://open-vsx.org/api/vscode/cpp/file/vscode.cpp-1.39.1.vsix
--2020-03-26 22:11:29--  http://open-vsx.org/api/vscode/cpp/file/vscode.cpp-1.39.1.vsix
Resolving open-vsx.org (open-vsx.org)... 34.98.99.180
Connecting to open-vsx.org (open-vsx.org)|34.98.99.180|:80... connected.
HTTP request sent, awaiting response... 404 
2020-03-26 22:11:29 ERROR 404: (no description).

Is there perhaps a URL we could use to request the latest version of an extension, that would continue working after the extension is updated?

Or maybe the file name of the extension should not contain the version?

WDYT?

Further details to be shown on the extension detail page

See the VS Code Extension Manifest format.

  • preview: whether the last published version is a preview
  • markdown: control the Markdown rendering engine
  • galleryColor, galleryTheme: control the gallery banner style
  • qna: handle special values false and marketplace
  • badges: render a list of badges
  • dependencies, bundledExtensions: show links to extensions listed as dependencies

Display work in progress

The UI should indicate when a server request is in progress:

  • after submitting a review
  • after requesting an access token
  • while loading reviews or access tokens

This is especially important when a replacement is displayed in case there are no elements. For example, "You currently have no tokens" is shown initially even when there are tokens, but they have not been loaded yet. A load indicator should be shown initially instead of that text.

Provide page titles

The web UI currently has not page title. It should change based on current route.

Scroll-bar glitch when clicking on avatar

I can see a vertical and horizontal scroll-bar when I click on my avatar. See the screencast:

screencast 2020-03-13 13-41-46

Expected, I do not see the scroll-bars when I click on the avatar. Most likely related to #29.

Browser: Brave, Version 1.4.96 Chromium: 80.0.3987.132 (Official Build) (64-bit).

[cli] No message available

Whenever I try to publish an extension, I get the error message "No message available". I tried a little debugging myself, but cannot find that message in the source.

Example

$ ovsx publish --pat XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 DONE  Packaged: /var/folders/v8/qp51rjts5jgcb8cr74d4smd00000gn/T/tmp-46513iOV0AoO5Na1U.vsix (15 files, 237.38KB)

❌  No message available

OS: macOS 10.14.6
Node: 12.14.1
nvm: 0.35.3
npm: 6.14.1
ovsx: 0.1.0-next.9b4e999

Support VS Code / VSCodium

In order to allow VS Code/ VSCodium to connect to openvsx, we need to support the proprietary protocol from MS Marketplace, which needs to be revers engineered.
I think an extra endpoint that understands that protocol and adapts it to openvsx would make sense.

Store files outside of the database

For the sake of simplicity, files associated with an extension (VSIX archive, readme, icon) are stored as byte arrays in the database. This should be changed to some file storage provider for better scalability.

`ovsx create-namespace` fails (Cannot find module 'didyoumean')

❯ npm install --global ovsx
/usr/local/bin/ovsx -> /usr/local/lib/node_modules/ovsx/lib/ovsx
+ [email protected]
added 68 packages from 81 contributors in 7.394s
❯ ovsx create-namespace redhat
internal/modules/cjs/loader.js:983
  throw err;
  ^

Error: Cannot find module 'didyoumean'
Require stack:
- /usr/local/lib/node_modules/ovsx/lib/main.js
- /usr/local/lib/node_modules/ovsx/lib/ovsx
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/ovsx/lib/main.js:13:20)
    at Module._compile (internal/modules/cjs/loader.js:1151:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/ovsx/lib/main.js',
    '/usr/local/lib/node_modules/ovsx/lib/ovsx'
  ]
}
❯ npm -v
6.14.4
❯ node -v
v13.7.0

Validate field sizes before submitting

While writing a review or a token comment, the dialog should validate the size of the input fields to ensure the server will accept the submitted data. The limits are 2048 characters for review comments and 255 characters for other fields.

Allow to expose more metadata like the cloud-workspace metadata through plug-in

Hello,

Within Eclipse Che, we're interested in using this registry. One limitation is that for some extensions, we need to specify the OCI image to use. It also includes some extra information like the memory or cpu to allocate.

After some discussions, it seems we could then package the metadata (currently a meta.yaml) file inside the vsix.
Then, the metadata could be extracted when we submit vsix file and then stored in the registry.
Thus, registry endpoint could serve the meta yaml file when asking for it.

We would need as well to display on the UI part this kind of information stored in the meta.yaml.

That said, we agree that this kind of information is optional as it might not interest at all people wanted only to use the registry with VS Code for example.

Compromise seems that to provide this logic through a 'plug-in'.

'Cloud Eclipse Che plug-in' would

  • allow to extract/store more data when submitting vsix files
  • add UI part reusing this extracted information

So extra logic is done in a plug-in that can be installed or not on top of the registry

Server side rendering

Currently the whole content is generated by React in the browser. Crawlers do not execute JavaScript, and so the content should be made available to them with other means.

Expose the version

The version of the server shall be made visible with an API endpoint. This version shall also be displayed in the UI, e.g. in the footer.

Reduce bundle.js size

Currently the bundle.js file produced by Webpack is quite large. We should reduce its size, and if it helps to improve loading times, split the file into smaller chunks.

[webui] Proper error handling

Currently we handle errors in API requests with the function handleError (utils.ts), which displays an alert. This should be improved, e.g. with a Material-UI dialog.

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.