Coder Social home page Coder Social logo

jsr-io / jsr Goto Github PK

View Code? Open in Web Editor NEW
2.2K 17.0 99.0 38.75 MB

The open-source package registry for modern JavaScript and TypeScript

Home Page: https://jsr.io

License: MIT License

Dockerfile 0.09% PLpgSQL 0.16% Rust 59.17% Handlebars 0.76% TypeScript 35.07% CSS 0.69% HCL 3.97% JavaScript 0.10%
javascript registry typescript

jsr's People

Contributors

bartlomieju avatar crowlkats avatar donjo avatar dsherret avatar flyingcaichong avatar furkankly avatar ghostdevv avatar hashrock avatar iuioiua avatar josh-collinsworth avatar kt3k avatar kwhinnery avatar litomore avatar lucacasonato avatar magurotuna avatar marvinhagemeister avatar morinokami avatar mxdvl avatar nakasyou avatar roj1512 avatar ry avatar ryuapp avatar tani avatar thisisjofrank avatar timharek avatar tisonkun avatar unbyte avatar ydcjeff avatar yykamei avatar zackshen 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

jsr's Issues

Request for Mirror Synchronization Capability

Dear jsr maintainers,

Greetings from the cnpm team, the provider of stable and free npm registry package mirror services in China, including the frontend at https://npmmirror.com/ and the registry at https://registry.npmmirror.com/.

After testing, we have found that we cannot directly access the npm.jsr.io content within mainland China. In order to provide better services in collaboration with jsr in the future, we would like to request mirror synchronization capabilities similar to those offered by npm registry.

We rely on the changesStream interface provided by npm registry to deliver streaming version change information at https://replicate.npmjs.com/_changes.

Additionally, for frontend display purposes, we also hope to provide manifest interfaces to showcase metadata information.

Looking forward to your response.

Store licenses for packages

Each package / package version should have a license field. This field should be a SPDX ID of a license.

This license should be visible via the API and UI, and could be useful for auditing purposes.

We should sniff the LICENSE file (like GitHub does) to populate this field. There should be a fallback where you can explicitly set the license SPDX ID via either a field in the package settings, or via a directive in the license file.

Sidebar on package page is full screen height, even if this doesn't make sense

image

Here to view the bottom of the sidebar, I need to scroll the viewport (the page), and the sidebar all the way to the bottom. This makes no sense, because the page content is small enough to fit on the page without the viewport having to scroll.

The current behaviour only made sense if the content was larger than the viewport (which it is not).

Make symbol search full screen

It would be nice if the symbol search took up the whole screen and occurred when the search bar has contents. Then you can exit out of the search by clearing the search bar (similar to how docs.rs works)

Render smaller truncated menu in mobile view

Currently the package navigation takes up a lot of space in mobile view and users have to scroll quite a bit to see any of the content.

image

I believe we should explore something like this where the navigation tabs get a bit smaller, hide or shrink any chips, and limit the displayed nav items to 3-4 and put the rest in a clickable menu. This mirrors the experience users have on github so it should be a pretty familiar mobile pattern to this audience.

image

Rough example of suggested change

image

Ability to link to a repository hosted outside of GitHub

I only use GitHub mostly for third-party contributions at this point, with my own code repositories being hosted somewhere else (right now, Codeberg)

While I wouldn't be able to take advantage of functionalities like provenance, I would expect being able to link to my actual repositories at the very least, where people can go to for bug tracking etc

Store queries in files instead of writing them inline

Some of the queries in api/src/db/database.rs are very large which makes them hard to read.

We should use sqlx::query_file! macro and move large queries to separate files in api/src/db/queries/.

One drawback is that we will need to specify them as sqlx::query_file!("api/src/db/queries/<query_name>.sql") which will not make them clickable, but it's probably still better.

Once we do that, we should set up SQL formatting as well (eg. https://github.com/dprint/dprint-plugin-sql).

Emit JavaScript modules for browsers like `esm.sh`

JSR doesn't have the ability to emit JavaScript from TypeScript sources to serve browsers.

The JavaScript emitted should also be cached.

Example of TypeScript code from JSR https://jsr.io/@kwhinnery/yassify/1.0.0/mod.ts:

export function yassify(str: string): string {
  return `${str} 💅✨👑`;
}

At this moment, this code doesn't work.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>JSR in the Browsers</title>
</head>
<body>
  <script type="module">
    import { yassify } from "https:/jsr.io/@kwhinnery/[email protected]";

    alert(yassify("In the browser!"));
  </script>
</body>
</html>

Although doing similar with esm.sh works:

<script type="module">
  import { yassify } from "https://esm.sh/jsr/@kwhinnery/[email protected]";

  alert(yassify("In the browser!"));
</script>

The jsr.io website actually displays that

JSR is designed for TypeScript. You publish TypeScript source, and JSR handles generating API docs, .d.ts files, and transpiling your code for cross-runtime compatibility.
JSR packages are distributed as web-standard ECMAScript modules.

JSR should implement emitting and caching for browsers. It would be the ultimate JavaScript registry.

Add a "publishing" page to redirect to after authorizing a publishing task

After going to /auth and approving publishing through the interactive flow in the CLI, we should navigate the user to an intermediate page where they can see the package progress, and once the package is published:

  • if just one is being published, redirect to the package page
  • if multiple are being published, show the list of published packages

Support rendering markdown "alerts" syntax

It would be great if we could add support for rendering "alerts" syntax that's available recently in GitHub: https://github.com/orgs/community/discussions/16925

An example that uses this syntax is @badrap/valita. As shown in the screenshot below, this syntax is rendered with no decoration, which is okay but not ideal.

Pasted_Image_2024_03_03_0_01

To support this syntax, we need to fix markdown parsing logic performed in the backend API server, which intenally calls deno_doc::html::jsdoc::markdown_to_html, and finally ending up with comrak crate as a markdown parser library. The problem is that this crate doesn't plan to support "alerts" syntax at least for the time being (see kivikakk/comrak#352). We need to come up with another solution here.

Namespace-relative references are being listed on the symbols page

I've published my own package that makes use of auto-generated TypeScript declarations, however, the symbols listing page looks wrong

https://jsr.io/@mary/bluesky-client/doc

  • The page isn't built to accommodate very long interface/type names resulting in horizontal overflows especially on mobile viewport
    image
  • There's some funny bug around Output that I can't tell exactly what caused it
    Screenshot_2024-03-01_at_09.14.27.png
  • A lot of these symbols are actually contained inside a namespace, and therefore will 404 if you click the links

I can only assume this is because they're being referenced relatively, like so:

image.png

Image not being rendered correctly in readme

Someone uses pics in readme to add a bit style. Like:
image
Github handle html tag with size adjustment:

<img height="18" src="https://raw.githubusercontent.com/PKief/vscode-material-icon-theme/main/icons/deno.svg">

But JSR front end shows this pic streached to fullsize:
image

Is it ok?

Autocomplete GH repository name

A bit of a stretch goal, but it would be cool if these inputs supported auto completion:

image

Doesn't actually seem too tricky - we can make requests to GitHub from the API server using the users' own oauth tokens. This will return the list of orgs they have access to, and the public repos in those orgs.

`jsr publish --fix`

I think that we can auto fix the majority of slow types diagnostics (missing return types, and explicit class types) by using TSC inference and then fixing up the source code with the explicit types gotten from TSC.

This is a bit of work, but would make supporting types in your package a matter of jsr publish --fix (or deno lint --fix). Right now the wall of slow types errors could be a bit daunting.

Allow inviting users to a scope with just an email

This would create an invite that is not bound to any specific GitHub user, and instead is valid for anyone who uses the invite link. This invite link would be sent to the invited user by email - they click on it, sign in with their GitHub account, and then accept the invite.

Abort early when version already exists

Current workflow:

  1. deno publish
  2. Visit to authorize publishing
  3. Click "approve"
  4. CLI detects that the version has already been published and prints
Skipping, already published <package>@<version>

It seems wrong that I have to authorize an action when it's known in advance that the action isn't possible to execute successfully. The CLI should already know that a conflicting version exists and bail out early.

Did you support JSON5?

Hi there,
great that you get forward.

I have a question because this project is new.
Will you implement support for json5 and the comment function in json?

Nodejs closed this issue: nodejs/node#40714
Npm will do when nodejs and js do something and locked the discussion: npm/feedback#56 (comment)

That is a usp for your project :)

Thanks for the attention.
Cheers

Support publishing with JSX

To publish with JSX, we need to take the JSX relevant config options from tsconfig.json / deno.json and put them into the source files via pragmas.

For example, when publishing this index.jsx file with this deno.json file:

import { renderToString } from "npm:preact-render-to-string";
console.log(renderToString(<div>jsx</div>));
{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "npm:preact"
  }
}

emit this before publish:

/** @jsxRuntime automatic *//** @jsxImportSource npm:preact */
import { renderToString } from "npm:preact-render-to-string";
console.log(renderToString(<div>jsx</div>));

Limitation of 20 characters for package name

Hi, really cool project but I am facing one problem to publish my package to JSR : the limitation of 20 characters and the fact my plugin name is vite-plugin-browser-sync. I think I will not be alone with all vite-plugin- prefix 😄

image

Maybe increase a little bit? You don't need to go crazy like npm 😃

`github:` dependencies are not supported (`uWebSockets.js`)

Hi. Today I noticed an issue when trying to publish an existing npm package that has optional peer dependency on uWebSockets.js which is officially only published on Github.

package.json:

{
  "peerDependencies": {
    "uWebSockets.js": "*"
  },
  "peerDependenciesMeta": {
    "uWebSockets.js": {
      "optional": true
    }
  }
}

deno.json: (I guess it is not picked btw)

{
  "imports": {
    "uWebSockets.js": "https://esm.sh/gh/uNetworking/uWebSockets.js"
  }
}

Deno publish (1.41.1)

deno publish --dry-run
error: npm package 'uWebSockets.js' does not exist.

Default-exported function is named as `default`

Hi, I tried JSR today and found an issue on documentation.

My package has a single default-exported function.

/**
 * ...
 */
export default function cloneJSON(value: JsonValue): JsonValue {
  // ...
}

I expected the name of this function was cloneJSON on the documentation.

import cloneJSON from "@rhy/fast-json-clone";

However it was listed as default actually.

import { default } from "@rhy/fast-json-clone";

When a default-exported function is named, the name should be respected in its documentation.

https://jsr.io/@rhy/fast-json-clone/doc/~/default

image

Doesn't process pnpm-workspace

Hi! Thanks a lot for this initiative to democratize package management 🔥

I just ran into an issue with pnpm workspace in my package neodrag. IG I can work around it by publishing the built files from dist, but would be neat if jsr could handle workspace:* version

PuruVJ/neodrag#143

CleanShot 2024-03-02 at 12 11 52@2x

Style GitHub Actions security settings

Screenshot 2024-02-28 at 10 52 05 AM

With our recent color updates there isn't much distinction between the security mode that is selected vs the one that isn't selected. This should be updated so the selected one is more clearly selected and the un-selected one is more clearly not selected (but selectable)

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.