Skip to content

chore: Remove orphan modules - #2167

Merged
tassoevan merged 3 commits into
mainfrom
refactor/orphans
Aug 25, 2026
Merged

chore: Remove orphan modules#2167
tassoevan merged 3 commits into
mainfrom
refactor/orphans

Conversation

@tassoevan

Copy link
Copy Markdown
Member

Proposed changes

Removes modules under packages/*/src that nothing imports, found by a reachability analysis over the whole monorepo.

For each package I built an import graph and computed reachability from its real entry points — the bundler/tsc entry, plus every story, spec, .mdx, and ambient declaration — rather than relying on inbound-import counts, so barrel re-exports and story-only fixtures are handled correctly.

fuselage (96dfea6)

  • components/Card/CardDivider.tsx — never re-exported by Card/index.ts, which exports the other seven Card parts.
  • components/PaletteStyleTag/helpers/isHexColor.ts
  • components/PaletteStyleTag/helpers/isLightColor.ts

Both PaletteStyleTag helpers were unused from the moment they were added in a40d471; the sibling helpers in that folder (convertToCss.ts, getPalette.ts) are wired up.

layout (7a6c429)

  • src/Types/index.ts
  • src/Types/FormPageLayoutStyleProps.ts

These are byte-identical duplicates of packages/onboarding-ui/src/Types, untouched since fc1efc0 added the package. Every consumer of FormPageLayoutStyleProps resolves to the onboarding-ui copy through paths internal to that package. This one had no importers at all — not even layout's own components/FormPageLayout, which takes no styleProps.

Worth noting: because this package builds with tsc over the whole of src rather than bundling from index.ts, these files were being compiled and published as dist/esm/Types.

onboarding-ui (42d8946)

  • Dropped a commented-out ./OnboardingLogo import from common/FormPageLayout.tsx. That module does not exist anywhere in the repo and the comment was its only mention; the component takes a logo prop instead.
  • Dropped src/emails/.gitignore, which ignored its own directory (*, !.gitignore). Nothing generates into or imports from src/emails.

Why no changeset

None of the removed symbols appear in any package's .api.md report, so this changes no public API.

Verification

  • Re-ran the analysis after each removal: nothing became newly orphaned, and no dead links remain in any package.
  • tsc -p tsconfig.esm.json --noEmit clean for layout.
  • Swept all 16 packages afterwards; every one reports zero orphans.

Two items found along the way that are not addressed here, both outside src:

  • packages/icons/glyphsMapping.json has 11 keys with no corresponding SVG (directory, filter, intermediate, mute, new-chat, snippet, threads, transfer, volume-disable, volume-mute, new-channel). Deliberately left alone — the registry is append-only and reserves retired codepoints, so pruning it risks reassigning a codepoint that cached fonts still render as the old glyph.
  • src/legacy/sort-up.other.svg and sort-down.other.svg use a .other filename type that nextCharactersFor handles in neither of its branches, so it returns undefined for them. Neither name has ever been in glyphsMapping.json, and neither appears in the current font. Left for a separate change.

🤖 Generated with Claude Code

@tassoevan
tassoevan requested a review from a team August 18, 2026 18:37
@changeset-bot

changeset-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fc5f24e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mergify

mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@tassoevan
tassoevan force-pushed the refactor/orphans branch 2 times, most recently from 710c738 to 6dab406 Compare August 24, 2026 14:51
tassoevan and others added 3 commits August 25, 2026 09:24
Delete three modules under `packages/fuselage/src` that nothing imports:

- `components/Card/CardDivider.tsx`, never re-exported by `Card/index.ts`
- `components/PaletteStyleTag/helpers/isHexColor.ts`
- `components/PaletteStyleTag/helpers/isLightColor.ts`

The two `PaletteStyleTag` helpers were unused from the moment they were
added in a40d471. None of the three appear in `fuselage.api.md`, so
this is not a public API change and needs no changeset.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Delete `src/Types`, which nothing imports:

- `src/Types/index.ts`
- `src/Types/FormPageLayoutStyleProps.ts`

Both are byte-identical duplicates of `packages/onboarding-ui/src/Types`,
untouched since fc1efc0 added this package. Every consumer of
`FormPageLayoutStyleProps` resolves to the `onboarding-ui` copy through
paths internal to that package; this one had no importers at all, not even
this package's own `components/FormPageLayout`, which takes no
`styleProps`.

Since the package builds with `tsc` over the whole of `src` rather than
bundling from `index.ts`, these were being compiled and published as
`dist/esm/Types`. `FormPageLayoutStyleProps` is absent from
`layout.api.md`, so removing them is not a public API change and needs no
changeset.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Drop the commented-out `./OnboardingLogo` import from
  `common/FormPageLayout.tsx`. That module does not exist anywhere in the
  repo and the comment was its only mention; the component takes a `logo`
  prop instead.
- Drop `src/emails/.gitignore`, which ignored its own directory (`*`,
  `!.gitignore`). Nothing generates into or imports from `src/emails`, so
  the directory was vestigial.

No module graph change: every module under `src` remains reachable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tassoevan
tassoevan merged commit 5e597b6 into main Aug 25, 2026
7 checks passed
@tassoevan
tassoevan deleted the refactor/orphans branch August 25, 2026 16:09
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.

2 participants