Skip to content

(janitor/dependencies) Remove unused clsx and tailwind-merge from @kilocode/storybook - #8932

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/dependencies/remove-unused-storybook-deps
Open

kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/dependencies/remove-unused-storybook-deps

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes two unused dependencies from apps/storybook (@kilocode/storybook), a private, non-published workspace package.

Dependencies removed

Package Declared section Version
clsx dependencies 2.1.1
tailwind-merge dependencies 3.5.0

Evidence each was unused

Both packages are the canonical cn() utility pair, but Storybook's own code never defines or uses cn, and neither package appears anywhere in the Storybook workspace outside of package.json.

  • grep -rn "clsx\|tailwind-merge\|cn\b\|twMerge" apps/storybook/src apps/storybook/stories apps/storybook/.storybook apps/storybook/scripts → zero matches.
  • grep -rn "emotion\|framer-motion\|from 'motion'" in the same scope → zero matches (confirms there is no motion/framer-motion consumer that would indirectly need @emotion/is-prop-valid, which I intentionally left in place).
  • knip (the repository's existing dependency-analysis tool, configured via apps/web/knip.ts for the ../storybook workspace) reported both as Unused dependencies:
    • clsx ../storybook/package.json:18:6
    • tailwind-merge ../storybook/package.json:24:6
  • pnpm why clsx / pnpm why tailwind-merge confirm both remain resolvable in the tree through apps/web (and class-variance-authority/recharts/kilo-app for clsx), so no transitive availability is lost.

Dynamic, configuration, and tooling references checked

  • Source imports / requires / dynamic imports: none in apps/storybook/{src,stories,.storybook,scripts} (.ts, .tsx, .js, .mjs).
  • Package scripts (apps/storybook/package.json#scripts): none reference either package.
  • Configuration files: checked tailwind.config.js (plugins: []), postcss.config.mjs, .storybook/main.ts, .storybook/preview.ts, .storybook/storybook.css, tsconfig.json — no references.
  • Framework plugins / loaders / presets: neither is a plugin. @tailwindcss/typography (a real Tailwind plugin referenced by apps/web/src/app/globals.css via @plugin, which Storybook imports through @import '../../web/src/app/globals.css') was not removed precisely because it has a configuration-level consumer.
  • Side effects / naming-convention discovery: not applicable — neither is a side-effect-only import and Storybook has no convention-based loader for them.
  • Codegen / CLI: the Storybook scripts (component-inventory.js, generate-playwright-screenshot-stories.js, serve-storybook-static.mjs) and .storybook/main.ts do not reference either package. @storybook/test-runner (also knip-flagged, but a standalone dev tool) was left in place out of caution since it can be invoked manually by developers.

Package publication and peer-dependency considerations

  • @kilocode/storybook is "private": true and is never published, so there is no package contract or peer/optional-dependency surface to preserve.
  • Neither clsx nor tailwind-merge is a peer dependency of any Storybook addon in use; they are runtime utilities. Storybook's rendered components are imported via webpack alias to apps/web/src, which declares and resolves its own copies (clsx@2.1.1, tailwind-merge@3.5.0) from apps/web/node_modules, so the Storybook build does not depend on Storybook's own declarations.

Validation performed

  • pnpm install (clean install) — updated only the @kilocode/storybook importer section of pnpm-lock.yaml.
  • Lockfile diff inspected: only the two intended removals remain; an unrelated @sentry/react-native→metro-config peer-context change that pnpm install also produced was reverted so the diff stays scoped.
  • pnpm --filter @kilocode/storybook typecheck (tsgo --noEmit) — passed.
  • pnpm -w exec oxlint --config .oxlintrc.json apps/storybook/src apps/storybook/stories apps/storybook/.storybook — passed (no findings).
  • pnpm --filter @kilocode/storybook run build-storybook — completed successfully (only pre-existing asset-size and critical-dependency warnings).
  • Script/config load checks: node --check on all three scripts/* files passed.

Uncertainty

  • @storybook/test-runner and @emotion/is-prop-valid were also flagged by knip but were deliberately not removed: the former is a standalone dev tool that developers may invoke outside of a package script, and the latter is a transitive dependency of motion that I judged lower-confidence than the two zero-reference utilities removed here. They can be revisited separately.
  • The repository's test/typecheck/build gates that require Postgres/Redis could not be exercised in this environment (resource-constrained sandbox); validation above is limited to Storybook's own gates, which do not need those services.

Neither package is imported by any Storybook source, story, config, or
script. Storybook components are aliased to apps/web, which declares its
own copies of both, so removal exposes no undeclared transitive usage.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Oct 27, 2026
@kilo-code-bot

kilo-code-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The PR removes clsx and tailwind-merge from the private @kilocode/storybook workspace package; I confirmed no source, story, config, or script in apps/storybook references either package, and both remain declared and resolved elsewhere (apps/web), so the lockfile pruning is consistent.

Assumptions: [INFERENCE] I could not run pnpm install or the Storybook build in this read-only review; the removal's safety rests on static verification that no importer in apps/storybook resolves these packages and that Storybook components resolve @/lib/utils through the webpack alias to apps/storybook/src/mocks/utils.ts rather than the removed packages.

Files Reviewed (2 files)
  • apps/storybook/package.json
  • pnpm-lock.yaml (only the apps/storybook importer section; clsx@2.1.1 and tailwind-merge@3.5.0 package entries and other importers remain intact)

Reviewed by deepseek-flash-latest · Input: 27.7K · Output: 3.6K · Cached: 191.9K

Review guidance: REVIEW.md from base branch main

This branch has not been deployed

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

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants