Skip to content

Comments

chore: update knip config & prep for prod mode#771

Merged
danielroe merged 6 commits intonpmx-dev:mainfrom
webpro:chore/knip-config
Feb 3, 2026
Merged

chore: update knip config & prep for prod mode#771
danielroe merged 6 commits intonpmx-dev:mainfrom
webpro:chore/knip-config

Conversation

@webpro
Copy link
Contributor

@webpro webpro commented Feb 2, 2026

Not using production mode may hide issues, as this PR shows. At the same time, some consider it good to be strict in fast-pacing projects, and others only annoying. Let me know if you want me to add it to CI anyway.

  • Bumped Knip
    • A package.json#scripts.postinstall no longer requires production dependencies (simple-git-hooks, lint-staged), so it won't flag these in production mode
  • Did not actually add pnpm knip --production to CI, but prepared for that:
    • Re-added a bunch of exclamation marks
    • Removed unused exports
    • Added @internal for exports only imported by tests
    • One issue remains: isn't unocss a dev dependency?
❯ pnpm knip --production
Unused dependencies (2)
@unocss/preset-wind4  package.json:63:6
unocss                package.json:87:6

No need to decide/fix now, as the changes don't affect how Knip is currently used in default/dev mode (but I'd be happy to if you agree!).

@vercel
Copy link

vercel bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 2, 2026 7:21pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 2, 2026 7:21pm
npmx-lunaria Ignored Ignored Feb 2, 2026 7:21pm

Request Review

@webpro webpro changed the title Update knip config chore: update knip config & prep for prod mode Feb 2, 2026
@danielroe
Copy link
Member

danielroe commented Feb 2, 2026

none of the dependencies in a nuxt project are actually used in prod so I tend to separate dev vs prod deps between lint/tooling stuff and the stuff required to actually build nuxt (which includes uno)

@webpro
Copy link
Contributor Author

webpro commented Feb 2, 2026

Production mode isn't about dependencies actually being installed or imported at runtime. It's about what's imported from production source code (regardless of getting bundled or not).

@webpro
Copy link
Contributor Author

webpro commented Feb 2, 2026

But yeah, some "faux production entries" are a result of that strategy, and that's fine from a Knip perspective, provided the ! suffixes everywhere are acceptable.

@webpro
Copy link
Contributor Author

webpro commented Feb 2, 2026

Rebased. Added a bunch of @internal tags for exports only imported in tests. A11y audit gives

TimeoutError: Navigation timeout of 60000 ms exceeded

@webpro webpro marked this pull request as ready for review February 2, 2026 19:28
@danielroe danielroe enabled auto-merge February 2, 2026 19:32
@danielroe
Copy link
Member

more than happy to enable --production if you think it gives us some extra protection 🙏

@webpro
Copy link
Contributor Author

webpro commented Feb 2, 2026

yeah it's just that we'd need both and run it twice

I'll open a separate PR for that

@danielroe danielroe added this pull request to the merge queue Feb 3, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 3, 2026
@danielroe danielroe added this pull request to the merge queue Feb 3, 2026
Merged via the queue into npmx-dev:main with commit ed6bf6f Feb 3, 2026
22 of 26 checks passed
@webpro webpro deleted the chore/knip-config branch February 3, 2026 05:31
taskyliz pushed a commit to taskyliz/npmx.dev that referenced this pull request Feb 7, 2026
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