Skip to content

chore(FR-2698): remove deprecated @types/uuid stub#6961

Merged
yomybaby merged 1 commit into
mainfrom
04-24-chore_fr-2698_remove_deprecated_types_uuid_stub
Apr 24, 2026
Merged

chore(FR-2698): remove deprecated @types/uuid stub#6961
yomybaby merged 1 commit into
mainfrom
04-24-chore_fr-2698_remove_deprecated_types_uuid_stub

Conversation

@yomybaby
Copy link
Copy Markdown
Member

@yomybaby yomybaby commented Apr 24, 2026

Resolves FR-2698

Summary

Running pnpm run build at the repo root fails at the root tsc step with:

error TS2688: Cannot find type definition file for 'uuid'.
  The file is in the program because:
    Entry point for implicit type library 'uuid'

Root cause

react/package.json pinned @types/uuid@^11.0.0, which is a deprecated stub:

{ "name": "@types/uuid", "version": "11.0.0", "main": "",
  "deprecated": "This is a stub types definition. uuid provides its own type definitions, so you do not need this installed." }

The uuid package itself has shipped its own declarations since uuid@10, so the stub has no index.d.ts. Because the root tsconfig.json has typeRoots: ["./src/types", "./node_modules/@types"], pnpm's hoisted node_modules/@types/uuid/ directory is discovered as an implicit type library during the root tsc pass — and fails to resolve its entry file.

Fix

Drop @types/uuid from react/package.json dev dependencies and refresh pnpm-lock.yaml. The single consumer — react/src/hooks/useBAINotification.tsx (import { v4 as uuidv4 } from 'uuid') — picks up its types straight from the runtime uuid package.

Verification

  • After the change, pnpm install no longer hoists @types/uuid into node_modules/@types/.
  • Root tsc no longer emits TS2688 for uuid.
  • bash scripts/verify.sh=== ALL PASS === (Relay / Lint / Format / TypeScript all green).

Not in scope

  • The root tsc pass has other pre-existing unrelated errors (e.g. @types/d3-dispatch/index.d.ts parse errors) that reproduce on main. Those belong to a separate cleanup of the root typeRoots configuration and are out of scope here.

Checklist:

  • Documentation — not applicable
  • Minimum required manager version — not applicable
  • Specific setting for review — none
  • Minimum requirements to check during review — run pnpm install fresh, confirm no node_modules/@types/uuid/ hoisted
  • Test case(s) — see Verification above

The `@types/uuid@11.0.0` package in `react/package.json` is a deprecated
stub with `main: ""` and no bundled `index.d.ts` — `uuid` itself ships
its own TypeScript declarations since uuid@10.

Because the root `tsconfig.json` has `typeRoots: ["./src/types",
"./node_modules/@types"]`, pnpm's hoisted `node_modules/@types/uuid/`
directory is picked up as an implicit type library during root `tsc` and
fails with:

    error TS2688: Cannot find type definition file for 'uuid'.
      The file is in the program because:
        Entry point for implicit type library 'uuid'

Dropping the dev dependency eliminates the stub and lets `tsc` resolve
the types straight from the `uuid` package. `useBAINotification.tsx` is
the only consumer and works without the stub.
Copilot AI review requested due to automatic review settings April 24, 2026 03:47
@github-actions github-actions Bot added the size:S 10~30 LoC label Apr 24, 2026
Copy link
Copy Markdown
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the deprecated @types/uuid stub from the React workspace, relying on uuid’s built-in TypeScript types instead.

Changes:

  • Dropped @types/uuid from react/package.json devDependencies.
  • Removed @types/uuid entries from pnpm-lock.yaml (importer/package/snapshot sections).

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
react/package.json Removes deprecated @types/uuid devDependency from the React app workspace.
pnpm-lock.yaml Cleans lockfile entries related to @types/uuid to match dependency removal.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread react/package.json
@github-actions
Copy link
Copy Markdown
Contributor

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 8.92% 1831/20519
🔴 Branches 8.07% 1165/14429
🔴 Functions 5.28% 294/5567
🔴 Lines 8.65% 1723/19908

Test suite run success

865 tests passing in 40 suites.

Report generated by 🧪jest coverage report action from 182fd29

@yomybaby yomybaby merged commit e9724ec into main Apr 24, 2026
19 checks passed
@yomybaby yomybaby deleted the 04-24-chore_fr-2698_remove_deprecated_types_uuid_stub branch April 24, 2026 03:55
@rapsealk
Copy link
Copy Markdown
Member

rapsealk commented Apr 24, 2026

Small factual correction:

The uuid package itself has shipped its own declarations since uuid@10, so the stub has no index.d.ts.

The "own declarations" actually landed in uuid@11, not uuid@10. Verified against the published packages:

$ npm view uuid@10.0.0 types
(undefined)

$ npm view uuid@11.0.0 types
./dist/cjs/index.d.ts

uuid@10 has no types / typings field and no .d.ts under dist/. Declarations were introduced in uuid@11.0.0 alongside the ESM-first repackage.

This matched the change here because the repo is already on uuid@11 — the runtime ships its own types, so dropping @types/uuid was purely cosmetic. Sibling repos still pinned to uuid@^10.0.0 can't simply mirror this one-liner: removing @types/uuid without bumping the runtime produces new TS7016 errors at every v4 as uuidv4 call site. Those repos need a uuid ^10 → ^11 bump bundled with the @types/uuid removal.

Not blocking anything — just flagging for anyone who reads this later and wonders why the same fix doesn't port cleanly to repos still on uuid@10.

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

Labels

size:S 10~30 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants