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

Add engine field verification with installed-check #581

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

voxpelli
Copy link
Contributor

@voxpelli voxpelli commented Apr 4, 2024

I used knip as a good project to verify the latest addition of workspace support in my installed-check module, and I thought I could just as well send a PR in case you are interested in running it yourself.

It mainly verifies that one doesn't promise more in engines.node than what ones dependencies can back up, but it also has checks for whether one is running an outdated node_modules installation (as else the other data will be wrong as it uses the locally installed data for verification) and whether one promises a wider peer dependency range than what ones dependencies does (not applicable to this project)

Running it in verbose mode (--verbose / -v) shows that there are a couple of dependencies who are not publishing a node.js engine range:

@knip/docs: @astro-community/astro-embed-youtube: Missing "engines.node"
@knip/docs: @astrojs/starlight: Missing "engines.node"
knip: easy-table: Missing "engines.node"
knip: jiti: Missing "engines.node"
knip: js-yaml: Missing "engines.node"
knip: minimist: Missing "engines.node"
knip: picocolors: Missing "engines.node"
knip: resolve: Missing "engines.node"
knip: summary: Missing "engines.node"
knip: zod: Missing "engines.node"

But apart from those it verified that knip itself has a good engine range right now and it suggested engine ranges for the two other workspaces as well.

I used `knip` as a good project to verify the latest addition of workspace support in my `installed-check` module, and I thought I could just as well send a PR in case you are interested in running it yourself
@webpro webpro merged commit f6684ad into webpro-nl:main Apr 5, 2024
8 of 11 checks passed
@webpro
Copy link
Collaborator

webpro commented Apr 5, 2024

TIL! This is a great project, thanks building it and for submitting the PR. I've had this issue many times with release-it, I'll install it there as well. Also kinda surprising it's not some built-in npm command, right?

Happy to merge!

@webpro
Copy link
Collaborator

webpro commented Apr 7, 2024

🚀 This pull request is included in v5.9.0. See Release 5.9.0 for release notes.

Using Knip in a commercial project? Please consider sponsoring me.

@voxpelli voxpelli deleted the verify-engines-field branch April 7, 2024 17:53
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.

2 participants