jsr-io / jsr-npm

A cli tool to make installing packages form jsr.io in node easy
https://npmjs.com/package/jsr
MIT License
102 stars 13 forks source link

Add an `init` command #109

Open cshaa opened 1 month ago

cshaa commented 1 month ago

I work on a package that is published to NPM, but internally uses some JSR modules. Currently, if anyone wants to use the package, they have to manually create a .npmrc file and add @jsr:registry=https://npm.jsr.io into it. It would be great to have some kind of jsr init command which we could tell the users to use before installing our package.

dirkluijk commented 1 month ago

Isn’t this something npx jsr add already does?

cshaa commented 1 month ago

Running just npx jsr add throws with:

ERR_PNPM_MISSING_PACKAGE_NAME  `pnpm add` requires the package name
Child process exited with: 1

Therefore, we'd have to tell the users of our package to either explicitly install one of its dependencies, or to install a dummy JSR package, neither of which sounds ideal.

dirkluijk commented 1 month ago

So you basically wanna initialize the .npmrc without having to add a specific package. Makes sense! Upvoted the idea.