Skip to content

Remove unused devDependencies (lint-staged, zlib); fix turbo.json for turbo 2.x#3764

Open
mattgperry wants to merge 1 commit into
mainfrom
advisor/010-manifest-hygiene
Open

Remove unused devDependencies (lint-staged, zlib); fix turbo.json for turbo 2.x#3764
mattgperry wants to merge 1 commit into
mainfrom
advisor/010-manifest-hygiene

Conversation

@mattgperry

Copy link
Copy Markdown
Collaborator

Implements plan 010 (root manifest hygiene), with one correction and one necessary unblock.

What changed

  • Removed lint-staged@8 — no husky, no .lintstagedrc, no lint-staged config block, no active git hook. Dead since 2019.
  • Removed zlib@1 — its only consumer, dev/inc/bundlesize.mjs (await import("zlib")), resolves the Node builtin, which shadows the npm package. Verified directly (zlib.gzip is a function with the npm package absent) and via a green yarn measure.
  • Kept @types/styled-components (plan said to remove it — see below).
  • Fixed turbo.json: renamed "pipeline""tasks" (see below).

Correction to the plan: @types/styled-components is NOT dead weight

The plan listed @types/styled-components as safely removable (no styled-components dep, no imports). It has no source imports, but its presence in node_modules is load-bearing for the type build: removing it makes rollup-plugin-dts inject /// <reference types="react" /> into dist/dom.d.ts, which packages/framer-motion/scripts/check-bundle.js rejects — the vanilla DOM bundle must be React-free. That fails framer-motion#build.

Reproduced cleanly:

  • Pristine depsdom.d.ts line 1 is a plain motion-dom import; check-bundle passes.
  • @types/styled-components removed → the React triple-slash reference appears; build fails.

lint-staged/zlib are non-@types packages and cannot affect .d.ts output, so they remain safe to remove.

Necessary unblock: turbo.json pipelinetasks

main HEAD had already bumped turbo to 2.x (package.json and committed yarn.lock resolve 2.9.14) but left turbo.json using the old "pipeline" key, which turbo 2.x rejects — so yarn build was already broken on main before this work. This branch renames the key to unblock the gates. This is outside the plan's original scope (which said don't touch turbo); flagged here for review. The broader turbo 1→2 migration (cache behavior, CI images) remains a separate deferred decision.

Gates (all green)

  • yarn install — clean, only lint-staged/zlib subtrees removed from the lockfile
  • yarn build — 8/8 turbo tasks, including framer-motion check-bundle
  • yarn measure — exit 0 (the ❌ bundle-size overages are the pre-existing plan-035 items; the script reports, doesn't fail)
  • yarn test — 7/7 turbo tasks, 799 passed / 7 skipped

Deviations from the plan

  1. @types/styled-components retained (load-bearing — see above), so 2 of 3 removals.
  2. turbo.json modified (pre-existing turbo-2.x breakage), per operator approval.

Follow-up for the maintainer

The DOM bundle's React-free guarantee currently depends on a stray, unused @types/styled-components being installed — fragile. The real fix is to stop rollup-plugin-dts leaking the React reference (or pin the dts toolchain), after which @types/styled-components can be dropped too.

🤖 Generated with Claude Code

… turbo 2.x

Implements plan 010 (manifest hygiene), with one correction.

- Remove lint-staged@8 (no husky/config/hooks) and zlib@1 (its only
  consumer, dev/inc/bundlesize.mjs, imports the Node builtin which
  shadows the npm package). Verified: zlib.gzip resolves with the npm
  package absent; yarn measure is green.

- KEEP @types/styled-components. The plan listed it as dead, but its
  presence in node_modules suppresses a rollup-plugin-dts leak that
  injects `/// <reference types="react" />` into dist/dom.d.ts. That
  trips framer-motion's check-bundle guard (the vanilla DOM bundle must
  be React-free), breaking the build. lint-staged/zlib are non-@types
  packages and cannot affect .d.ts output, so they stay safe to remove.

- Fix turbo.json: rename "pipeline" -> "tasks". main already bumped
  turbo to 2.x (package.json + lockfile resolve 2.9.14) but left the
  old key, so `yarn build` was already broken on main. This rename
  unblocks the gates (outside the plan's original scope; flagged).

Gates: yarn install clean; yarn build 8/8; yarn measure exit 0
(pre-existing plan-035 budget overages only); yarn test 7/7, 799 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR removes two genuinely dead devDependencies (lint-staged@8, zlib@1) from the root manifest and fixes a pre-existing turbo 2.x breakage ("pipeline""tasks" in turbo.json). @types/styled-components was correctly kept after discovering it is load-bearing for the rollup-plugin-dts type build despite having no source imports.

  • package.json: lint-staged@8 (no husky/hooks since ~2019) and zlib@1 (always shadowed by the Node builtin) removed; the yarn.lock subtree for lint-staged and its old deps is cleanly pruned.
  • turbo.json: Single key rename pipelinetasks required by turbo 2.x, unblocking yarn build which was already broken on main after the earlier turbo 2.x bump landed without this config update.
  • Plans docs: Execution notes and status update appended; deviations (partial removal, turbo.json touch) are clearly explained with a follow-up item to fix the rollup-plugin-dts / @types/styled-components fragility properly.

Confidence Score: 5/5

Safe to merge — removes only verified-unused packages and fixes a config key that was already causing build failures on main.

All changes are narrow and well-verified: the two removed packages have no consumers in the codebase, the turbo.json rename is the single required key change for turbo 2.x and all gates passed, and the decision to retain @types/styled-components is backed by a reproducible build failure. The yarn.lock diff contains no unrelated churn beyond the lint-staged subtree.

No files require special attention. The @types/styled-components fragility (implicit dependency for the React-free type build) is already flagged as a follow-up item and does not need to be resolved in this PR.

Important Files Changed

Filename Overview
package.json Removes lint-staged@8 and zlib@1 from devDependencies; both are verified unused. @types/styled-components correctly retained as load-bearing for the type build.
turbo.json Renames "pipeline" key to "tasks" — the required fix for turbo 2.x compatibility. All task definitions remain unchanged and are compatible with turbo 2.x semantics.
yarn.lock Cleanly removes lint-staged@8 subtree (arr-diff, arr-flatten, braces@2, base, etc.) and drops the ^7.0.0 alias from @babel/runtime that was only needed by lint-staged. No unrelated lockfile churn.
plans/010-root-manifest-hygiene.md Appends execution notes documenting the partial execution (2 of 3 removals), the @types/styled-components discovery, and the turbo.json unblock. Well-documented deviation from the plan.
plans/README.md Status row for plan 010 updated from TODO to DONE with a brief inline note about the partial execution.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[yarn build / yarn test] --> B{turbo.json key}
    B -->|old pipeline key| C[turbo 2.x rejects config\nbroken on main before PR]
    B -->|new tasks key| D[turbo 2.x accepts config\n8 of 8 tasks run]
    D --> E[framer-motion build]
    E --> F{types/styled-components\nin node_modules?}
    F -->|removed| G[rollup-plugin-dts injects\nReact reference\ncheck-bundle fails]
    F -->|retained| H[dom.d.ts is React-free\ncheck-bundle passes]
    D --> I[yarn measure]
    I --> J{zlib import resolution}
    J -->|npm package present| K[npm package shadows builtin]
    J -->|npm package removed| L[Node builtin resolves\nzlib.gzip is a function]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[yarn build / yarn test] --> B{turbo.json key}
    B -->|old pipeline key| C[turbo 2.x rejects config\nbroken on main before PR]
    B -->|new tasks key| D[turbo 2.x accepts config\n8 of 8 tasks run]
    D --> E[framer-motion build]
    E --> F{types/styled-components\nin node_modules?}
    F -->|removed| G[rollup-plugin-dts injects\nReact reference\ncheck-bundle fails]
    F -->|retained| H[dom.d.ts is React-free\ncheck-bundle passes]
    D --> I[yarn measure]
    I --> J{zlib import resolution}
    J -->|npm package present| K[npm package shadows builtin]
    J -->|npm package removed| L[Node builtin resolves\nzlib.gzip is a function]
Loading

Reviews (1): Last reviewed commit: "Remove unused devDependencies (lint-stag..." | Re-trigger Greptile

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.

1 participant