Back to Motion

Plan 010: Remove dead devDependencies from the root manifest

plans/010-root-manifest-hygiene.md

12.41.06.9 KB
Original Source

Plan 010: Remove dead devDependencies from the root manifest

Executor instructions: Follow this plan step by step. Run every verification command and confirm the expected result before moving to the next step. If anything in the "STOP conditions" section occurs, stop and report — do not improvise. When done, update the status row for this plan in plans/README.md — unless a reviewer dispatched you and told you they maintain the index.

Drift check (run first): git diff --stat 42bfbe3ed..HEAD -- package.json yarn.lock If package.json changed since this plan was written, re-verify each dependency below is still present and still unused before proceeding.

Status

  • Priority: P3
  • Effort: S
  • Risk: LOW (removals verified unused; full build+test gate)
  • Depends on: 007 should land first if both are executed (007 decides lint wiring; this plan removes lint-staged, which 007 does not use)
  • Category: tech-debt
  • Planned at: commit 42bfbe3ed, 2026-06-10

Why this matters

The root package.json carries devDependencies that nothing uses. They add install weight, npm audit noise, and — worse — imply tooling that doesn't exist: lint-staged@^8 (released 2019) suggests pre-commit linting, but there is no husky setup, no .lintstagedrc, no lint-staged config block, and no active git hook in .git/hooks — it has been dead weight for years. zlib@^1.0.5 is an abandoned 2010s npm package that is always shadowed by Node's built-in zlib module (the only zlib import, in dev/inc/bundlesize.mjs, resolves to the builtin). @types/styled-components has no corresponding styled-components dependency and no imports anywhere in the repo.

Current state

Root /Users/matt/Sites/motion/package.json devDependencies (verified at planned-at commit):

json
"@types/styled-components": "^5.1.25",   // line ~45 — no styled-components dep, no imports found
"lint-staged": "^8.0.4",                  // line ~67 — no husky, no config, no hooks; dead
"zlib": "^1.0.5",                         // line ~86 — shadowed by Node builtin everywhere

Verification already performed by the advisor (re-run yourself):

  • grep -rn "styled-components" packages dev --include="*.tsx" --include="*.ts" → no source imports.
  • No .husky/ directory; .git/hooks/ contains only .sample files; no lint-staged key in any package.json.
  • The only zlib usage is in dev/inc/bundlesize.mjs, where bare "zlib" resolves to the Node builtin regardless of the npm package's presence.

Package manager: Yarn 3.6.4 ("packageManager": "[email protected]"). Build: yarn build (turbo). Bundle-size check: yarn measure runs dev/inc/bundlesize.mjs — this is the one script touching zlib, so it is the critical post-removal gate.

Commands you will need

PurposeCommandExpected on success
Re-verify unusedgrep -rn "from [\"']zlib|require([\"']zlib|styled-components|lint-staged" packages dev scripts --include="*.ts" --include="*.tsx" --include="*.js" --include="*.mjs"only dev/inc/bundlesize.mjs zlib hit (builtin)
Installyarn installexit 0, lockfile updated
Buildyarn buildexit 0
Bundle-size scriptyarn measureexit 0 (this exercises bundlesize.mjs and its zlib import)
Unit testsyarn testpasses (ignore documented pre-existing flakes: framer-motion SSR "TextEncoder not defined", use-velocity)

Scope

In scope (the only files you should modify):

  • package.json (root) — remove the three lines
  • yarn.lock — regenerated by yarn install
  • plans/README.md — status update

Out of scope (do NOT touch):

  • Any other dependency in the manifest — in particular do NOT bump lerna, turbo, cypress, typescript, prettier, or eslint here. Toolchain upgrades are large, release-pipeline-risky migrations and are deliberately separate decisions (see plans/README.md, "considered and rejected" notes).
  • dev/inc/bundlesize.mjs — its import("zlib") correctly hits the Node builtin; no change needed.
  • Workspace package.json files.

Git workflow

  • Branch: advisor/010-manifest-hygiene
  • Single commit, e.g. "Remove unused devDependencies (zlib, @types/styled-components, lint-staged)"
  • Do NOT push or open a PR unless the operator instructed it.

Steps

Step 1: Re-verify each candidate is unused

Run the re-verify grep from the table. Expected: the only match is the zlib import in dev/inc/bundlesize.mjs (Node builtin). If lint-staged or styled-components shows up anywhere outside package.json/yarn.lock, STOP.

Verify: grep output matches expectation.

Step 2: Remove the three entries

Edit root package.json: delete the "@types/styled-components", "lint-staged", and "zlib" lines from devDependencies. Run yarn install to update yarn.lock.

Verify: yarn install → exit 0. grep -c "styled-components\|lint-staged\|\"zlib\"" package.json0.

Step 3: Full gates

Verify: yarn build → exit 0. Then yarn measure → exit 0 (proves bundlesize.mjs still resolves zlib via the builtin). Then yarn test → no new failures beyond the documented pre-existing ones.

Test plan

No new tests — removal of unused entries. Gates: install, build, yarn measure (the only zlib consumer), full unit suite.

Done criteria

  • grep -c "styled-components\|lint-staged\|\"zlib\"" package.json0
  • yarn install exit 0; yarn.lock no longer contains top-level resolutions for these three packages (grep -c "^\"zlib@\|^\"lint-staged@\|^\"@types/styled-components@" yarn.lock0)
  • yarn build exit 0
  • yarn measure exit 0
  • yarn test — no failures beyond documented pre-existing ones
  • Only package.json, yarn.lock, plans/README.md modified (git status)
  • plans/README.md status row updated

STOP conditions

Stop and report back (do not improvise) if:

  • Step 1's grep finds a real usage of any candidate.
  • yarn install fails or wants to make unrelated lockfile changes beyond removing these packages' subtrees.
  • yarn measure fails after removal (would mean the environment's Node resolves bare zlib to the npm package — contrary to expectation; restore the entry and report).

Maintenance notes

  • If the maintainer later wants pre-commit linting, add lint-staged current (v15+) together with husky and a config in one PR — don't resurrect v8.
  • The toolchain-lag cluster (lerna 4 → 8, turbo 1 → 2 [has an advisory: GHSA-3qcw-2rhx-2726, low severity], cypress 4 → current, prettier 2 → 3, eslint 8 → 9, TS 5.4 → 5.8, @types/node 18 → 20 + missing engines fields in published packages) was audited and deliberately not planned here: each touches the release pipeline (lerna publish, turbo cache, CI images) and needs the maintainer's go-ahead. They're recorded in plans/README.md under rejected/deferred findings.