jsr-io / jsr

The open-source package registry for modern JavaScript and TypeScript
https://jsr.io
MIT License
2.29k stars 100 forks source link

Use cases for non-typed developers #610

Open toviszsolt opened 2 months ago

toviszsolt commented 2 months ago

I tried guys! I am trying really hard! 😁

Npm concept: time has proven that this is not the right approach.

Developers embed everything in packages as "distribution", when "distribution" should be the usable code, not the source code. Even in its smallest, compressed form. The repo with the source code is linked (in most of cases).

I have taken the time and the energy to learn and practice how to do it well on my part. Start a project → Setup rollup as bundler → build a dist version for CommonJS AND ES Modules AND TypeScript → Publish the dry necessary files only

I'm a JS developer, I hate TypeScript, no one is going to tell me that TypeScript is good, because I'll tell you to learn JS if you want to code in JS. And I also write the JSDoc in a separate file because it interferes with reading the code, just like TypeScript.

So guys, please find a place for people like me, and figure out how "Has docs for most symbols" challenge will be passed. 😎

The "Has provenance" challange I am able to solve. 👌

https://jsr.io/@toviszsolt/react-scrollspy

sachaw commented 2 months ago

You are able to consume JSR packages in vanilla JS projects just fine. Only ESM code is supported by design, let's not regress, the point is to let CJS and other obsolete module systems die.

toviszsolt commented 2 months ago

@sachaw

Has docs for most symbols At least 80% of the packages' symbols should have symbol documentation. Currently 0% of symbols are documented.

JSDoc in the separated d.ts file. 🧐

lucacasonato commented 1 month ago

Do you mean you'd like to upload .js files with accompanying .d.ts files? Or .js files containing /** @type */ TSDoc annotaitons?

toviszsolt commented 1 month ago

.js files with accompanying .d.ts files containing /** @type */ TSDoc

I'm linking the package again, because even though I've already linked it, no one seems to bother to look at the files. https://jsr.io/@toviszsolt/react-scrollspy/2.0.6/dist

lucacasonato commented 1 month ago

That is already supported, as long as you add // @ts-self-types="./react-scrollspy.d.ts" to the top of your JS file 👍

toviszsolt commented 1 month ago

@lucacasonato

Thanks you for your answer, but this is not possible. There cannot be the suggested comment. Any other solution?

Klustre commented 1 month ago

JSR supports and encourages publishing TypeScript source code rather than pairs of .js + .d.ts files. This allows JSR to provide more helpful auto-generated documentation, and helps provide improved auto-completion in editors.

From the docs