Skip to content

Conversation

@franky47
Copy link
Member

@franky47 franky47 commented Oct 1, 2025

  • Enable test coverage
  • Remove unused dependencies
  • Refactor some internals
  • Export CreateStandardSchemaV1Options type
  • Run knip in CI (needs all deps, maybe move it to its own job)
  • Enable knip for docs
  • Enable knip for e2e tests
  • Enable knip for examples

@franky47 franky47 added the internal Internal issues & discussions label Oct 1, 2025
@franky47 franky47 added this to the 🪵 Backlog milestone Oct 1, 2025
@vercel
Copy link

vercel bot commented Oct 1, 2025

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

Project Deployment Preview Comments Updated (UTC)
nuqs Ready Ready Preview Comment Oct 1, 2025 7:28pm

@socket-security
Copy link

socket-security bot commented Oct 1, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedfumadocs-mdx@​11.7.5 ⏵ 11.10.199 +110074 +396 +1100
Updatedfumadocs-core@​15.6.12 ⏵ 15.8.198 +110076 +396 +1100
Updatedfumadocs-ui@​15.6.12 ⏵ 15.8.199 +110076 +296 +1100
Added@​tailwindcss/​postcss@​4.1.131001008099100
Updateddayjs@​1.11.13 ⏵ 1.11.1810010010086100
Updatedeffect@​3.17.8 ⏵ 3.18.0100 +110091 +198 +1100

View full report

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 1, 2025

pnpm add https://pkg.pr.new/nuqs@1154

commit: c081d61

@franky47
Copy link
Member Author

franky47 commented Oct 1, 2025

@webpro I get a failure when running knip in CI (and can reproduce locally) with the following conditions:

  • I install only the --workspace-root dependencies (where knip is defined)
  • I run pnpm run lint:knip --workspace packages/nuqs to only check the nuqs package
  • It fails when trying to load something unrelated in the e2e environments:
$ pnpm run lint:knip --workspace packages/nuqs

> [email protected] lint:knip /Users/franky/dev/playground/47ng/nuqs
> knip --workspace packages/nuqs

ERROR: Error loading /Users/franky/dev/playground/47ng/nuqs/packages/e2e/react-router/v6/cypress.config.ts
Reason: Cannot find module 'e2e-shared/cypress.config'
Require stack:
- /Users/franky/dev/playground/47ng/nuqs/packages/e2e/react-router/v6/cypress.config.ts
 ELIFECYCLE  Command failed with exit code 2.
zsh: exit 2     pnpm run lint:knip --workspace packages/nuqs

Running pnpm run lint:knip --workspace packages/nuqs works fine if I have all the monorepo dependencies installed (although it takes a bit longer than when I had knip only set up as a dependency of the nuqs package).

Is knip trying to check somewhere it shouldn't?

@webpro
Copy link

webpro commented Oct 2, 2025

Thanks for giving Knip a shot! There are two things relevant here:

  • When linting a single workspace, Knip includes ancestor and dependent workspaces. For instance, to figure out what exports of the linted workspace are unused. (It might be interesting to look into optimizations here to see exactly what operations could be skipped, but at the moment Knip calculates the relevant workspaces and does its thing on all of 'em and eventually reports only the issues for the provided workspace.)
  • Knip is a mostly static analysis tool, but it loads/imports configuration files like cypress.config.ts. That's because, in most cases, we want the resolved exported configuration object to find entry points and dependencies. Some plugins have an (additional) AST resolver, but it's not as common.

The result is that dependencies of at least the ancestors and dependents should be installed upfront.

Does that help?

@franky47
Copy link
Member Author

franky47 commented Oct 2, 2025

That makes sense, thanks for the explanation! I'll run knip on a fully-installed dependencies setup then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Internal issues & discussions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants