Skip to content

feat(inspector): add exclude dev dependencies filter option#181

Merged
antfu merged 1 commit into
antfu:mainfrom
antfubot:fair-bats-admire
Jul 21, 2026
Merged

feat(inspector): add exclude dev dependencies filter option#181
antfu merged 1 commit into
antfu:mainfrom
antfubot:fair-bats-admire

Conversation

@antfubot

Copy link
Copy Markdown
Contributor

Summary

Adds an "Exclude Dev Dependencies" toggle to the Excludes filter panel, alongside the existing exclude options (Types, Optional, Private, Workspace Roots).

When enabled, packages introduced only as dev dependencies are hidden — a package is excluded when its flatClusters contains dep:dev but not dep:prod, and it is not a workspace root. Because exclusion propagates to the exclusive dependency subtree, this also hides any packages such dev deps exclusively introduced, while packages reachable through both prod and dev remain visible.

Changes

  • shared/filters.ts — add excludeDev to FilterOptions and FILTERS_SCHEMA (category: 'exclude', default false). This auto-wires it into URL query serialization, the Excludes reset button, and the activated-filter count.
  • app/state/filters.ts — add the excludeDev check to filtersExcludePredicate; also removes a pre-existing duplicated excludeDts line.
  • app/components/panel/FiltersOptionExcludes.vue — add the checkbox to the Excludes panel.

Typecheck (vue-tsc --noEmit) and lint pass.

This PR was created with the help of an agent.

@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/node-modules-inspector@181
npm i https://pkg.pr.new/node-modules-tools@181

commit: 733a8b1

@antfu
antfu merged commit 153a0ee into antfu:main Jul 21, 2026
9 of 10 checks passed
antfubot added a commit to antfubot/node-modules-inspector that referenced this pull request Jul 21, 2026
Merge origin/main (antfu#181 exclude dev dependencies filter, antfu#182 e2e OTP fix,
another own-repo module-type test fix) into this branch.

- FiltersOptionExcludes.vue: the new "Exclude Dev Dependencies" OptionItem
  applies the same FormCheckbox treatment (`:div="true"` on OptionItem) as
  its siblings.
- module-type.test.ts: main independently hit and fixed the same h3-became-
  ESM-only issue (swapping the "dual" fixture to `vue`) — take their fixture
  choice for consistency with upstream, keep this branch's more robust
  deterministic (file-relative, not hoist-order-dependent) resolution. `vue`
  resolves consistently regardless of which installed patch gets hoisted
  (same dual exports shape across 3.5.x), so no pinned devDependency needed;
  drop the now-unused tinyglobby one.

Verified: vue-tsc --noEmit, eslint, vitest (87/87) and pnpm build all pass;
live-checked the new Exclude Dev Dependencies checkbox renders and is
positioned correctly.

Created with the help of an agent.
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