Skip to content

[feat] introduce jsdelivr registry, cross origin resource sharing npm/package@version/file #33209

Open
@loynoir

Description

@loynoir

Feature Description

In npm ecosystem, browser is able to access npm package inner resource.

Thus, I think, it would be nice to let browser able to access gitea npm package inner resource.


https://esm.sh/

import Module from "https://esm.sh/PKG@SEMVER[/PATH]";

https://www.unpkg.com/

unpkg.com/:package@:version/:file

https://www.jsdelivr.com/

https://cdn.jsdelivr.net/npm/package@version/file


https://docs.gitea.com/usage/packages/npm

Below feature seems missing in gitea

https://gitea/user/-/packages/npm/hello/1.0.0/asset/dist/index.mjs


And the url should be importmap friendly

https://github.com/WICG/import-maps

With importmap versionize

  "scopes": {
    "user-url-scope": {
      "hello/": "https://gitea/user/-/packages/npm/hello/1.0.0/asset/",

Code

import {hello} from "hello/dist/index.mjs"

Equivalent

import {hello} from "https://gitea/user/-/packages/npm/hello/1.0.0/asset/dist/index.mjs"

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/packagestype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions