-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add script to get npm package data #499
feat: Add script to get npm package data #499
Conversation
✅ Deploy Preview for sveltesociety-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about creating a file by data type 🤔
If the data were to be updated separately, it could make sens, but here everything is updated together at each run
Yep for sure, definitely makes sense - I started off just with a Which one of these do you think would be better?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would reduce the font size of the date.
It's a bit too "in your face" right now. It has the same font-size as the description, making it as important as the description.
Also, I don't find use <code>
revelant here, it's a "none-technical" information nor a number
🎯 Changes
This PR adds auto-fetching package data from npm. The
scripts/updateNpm.js
script runs the npm CLI in parallel to get info listed here. For now, I've set it to save the latest release date, latest version (useful to show how up-to-date the info is and for other tools such as publint), and svelte peerDep (if available).For now, the latest version and date are added to the package card (if it exists). The date is rendered as a relative date using dayjs. I've moved the repo button from the bottom-left to the top-right of the card (this was the most space-efficient arrangement of stars, repo and date I could pick).
Before:
After:
✅ Checklist
pnpm run lint
locally on my changes