Repository navigation
(janitor/dependencies) Remove unused clsx and tailwind-merge from @kilocode/storybook - #8932
kilo-code-bot[bot] wants to merge 1 commit into
Conversation
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.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe PR removes Assumptions: Files Reviewed (2 files)
Reviewed by deepseek-flash-latest · Input: 27.7K · Output: 3.6K · Cached: 191.9K Review guidance: REVIEW.md from base branch |
Summary
Removes two unused dependencies from
apps/storybook(@kilocode/storybook), a private, non-published workspace package.Dependencies removed
clsxdependencies2.1.1tailwind-mergedependencies3.5.0Evidence each was unused
Both packages are the canonical
cn()utility pair, but Storybook's own code never defines or usescn, and neither package appears anywhere in the Storybook workspace outside ofpackage.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 nomotion/framer-motionconsumer that would indirectly need@emotion/is-prop-valid, which I intentionally left in place).knip(the repository's existing dependency-analysis tool, configured viaapps/web/knip.tsfor the../storybookworkspace) reported both asUnused dependencies:clsx ../storybook/package.json:18:6tailwind-merge ../storybook/package.json:24:6pnpm why clsx/pnpm why tailwind-mergeconfirm both remain resolvable in the tree throughapps/web(andclass-variance-authority/recharts/kilo-appforclsx), so no transitive availability is lost.Dynamic, configuration, and tooling references checked
apps/storybook/{src,stories,.storybook,scripts}(.ts,.tsx,.js,.mjs).apps/storybook/package.json#scripts): none reference either package.tailwind.config.js(plugins: []),postcss.config.mjs,.storybook/main.ts,.storybook/preview.ts,.storybook/storybook.css,tsconfig.json— no references.@tailwindcss/typography(a real Tailwind plugin referenced byapps/web/src/app/globals.cssvia@plugin, which Storybook imports through@import '../../web/src/app/globals.css') was not removed precisely because it has a configuration-level consumer.component-inventory.js,generate-playwright-screenshot-stories.js,serve-storybook-static.mjs) and.storybook/main.tsdo 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/storybookis"private": trueand is never published, so there is no package contract or peer/optional-dependency surface to preserve.clsxnortailwind-mergeis a peer dependency of any Storybook addon in use; they are runtime utilities. Storybook's rendered components are imported via webpackaliastoapps/web/src, which declares and resolves its own copies (clsx@2.1.1,tailwind-merge@3.5.0) fromapps/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/storybookimporter section ofpnpm-lock.yaml.@sentry/react-native→metro-configpeer-context change thatpnpm installalso 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).node --checkon all threescripts/*files passed.Uncertainty
@storybook/test-runnerand@emotion/is-prop-validwere 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 ofmotionthat I judged lower-confidence than the two zero-reference utilities removed here. They can be revisited separately.