Skip to content
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: ?metadata=true for more information #4

Merged
merged 18 commits into from
Feb 4, 2025

Conversation

GeoffreyParrier
Copy link
Contributor

@GeoffreyParrier GeoffreyParrier commented Dec 28, 2024

Edit by Anthony Fu:

This PR introduces a new ?metadata=true field to both /:pkg and /versions/:pkg route, to return extra metadata like engines and deprecated (more in the future).

Previous post

Description

Adding support to the engines part to be able to add node compatibility in @antfu/taze (See this issue).

  • new path: /engines/[...pkg]
  • new query param for versions/[...pkg]
    • ?engines or ?engines=append -> add versionsEngines property
    • ?engines=concat -> On versions property, each version will have its engines ('3.0.0': { node: '>=14.18.0' })
  • new engines property for '/' path

Linked Issues

resolves: #3

antfu-collective/taze#146

Additional context

Copy link

netlify bot commented Dec 28, 2024

Deploy Preview for npm-meta-info ready!

Name Link
🔨 Latest commit 4c8875e
🔍 Latest deploy log https://app.netlify.com/sites/npm-meta-info/deploys/67a21e6f5abfe80008e05000
😎 Deploy Preview https://deploy-preview-4--npm-meta-info.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu
Copy link
Owner

antfu commented Jan 15, 2025

Looking forward to it! Let me know when it's ready to be reviewed!

@GeoffreyParrier GeoffreyParrier marked this pull request as ready for review January 28, 2025 17:41
README.md Outdated
Comment on lines 209 to 212
"versions": {
"0.6.1": {
"node": ">=10.0.0"
},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder when the concat mode is useful?

I am not even sure if this format makes sense, as it seems a bit confusing to have the node range directly in versions. And also a bit worried that this would make future extension of adding new fields harder. I think the versionsEngines mode should be good enough, where we could also simplify the engines query to a boolean.

README.md Outdated
@@ -176,6 +294,72 @@ Use `+` to separate the package names.
curl https://npm.antfu.dev/versions/vite+vue+nuxt
```

### `GET /engines/:pkg`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this API in taze? If not I prefer to not having it for now to limit the surface of maintenance.

@antfu
Copy link
Owner

antfu commented Feb 4, 2025

I am working on it

@GeoffreyParrier
Copy link
Contributor Author

@antfu past weeks was quite busy on my part, sorry for the wait and thanks for finishing it, I will continue working on Taze then, thanks again :)

@antfu antfu changed the title feat: Support engines with an option feat: ?metadata=true for more information Feb 4, 2025
@antfu antfu merged commit 7308e47 into antfu:main Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add deprecated to ResolvedPackageVersion Support engines part
2 participants