Skip to content

GMT-1740: promote deep-import types to public API - #3412

Open
dreamwasp wants to merge 19 commits into
mainfrom
cass-gmt-1740
Open

GMT-1740: promote deep-import types to public API#3412
dreamwasp wants to merge 19 commits into
mainfrom
cass-gmt-1740

Conversation

@dreamwasp

@dreamwasp dreamwasp commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Overview

Promotes deep-import-only paths (@codecademy/gamut/dist/...) to public exports, closing the gap between what mono/platform were actually reaching for and what the barrel exposes. Every export here traces to real, counted deep-import sites (74 across mono/platform), found by grepping consumer repos rather than guessing — full rationale in gmt-1740-dist-exports-rfc.md.

New public exports (@codecademy/gamut)

  • InteractiveSelectorsButtonBase/ButtonBase's shared interactive-state selector enum, renamed from ButtonSelectors to match its real usage (Button, Anchor, Tag, Tip, Pagination), exported in place of the ButtonBase component itself (kept internal on purpose — see JSDoc in ButtonBase.tsx).
  • buttonProps — the variance prop-group backing ButtonProps, from Button/shared.
  • Tip/shared/types (all 14 names) — shared prop/placement types for InfoTip/PreviewTip/ToolTip.
  • Form/types — switched from a single hand-picked export to export *, picking up FormValues/BaseInputProps and restoring CheckboxPaddingProps (a regression from an earlier pass that broke GridForm/types.ts).
  • PopoverContainer/types (all 7 names) — PopoverContainerProps/TargetRef/etc., the single most depended-on internal type in the inventory (29 platform sites).
  • Markdown override factories — createCodeBlockOverride, createInputOverride, createTagOverride, createVideoOverride, standardOverrides.
  • Form/SelectDropdown — full export * from ./types (SelectDropdownProps, MultiSelectDropdownProps, etc.). The IconOption component itself stays internal-only for now (see "Moved to a separate PR" below).
  • IconStyleProps (type) — from @codecademy/gamut-icons, the style-prop group behind GamutIconProps.

Rename (not yet public, so no compatibility surface to protect)

  • ButtonBase: ButtonSelectorsInteractiveSelectors (renamed for clarity — it's shared by Button, Anchor, Tag, Tip, and Pagination, not button-specific).

Docs

  • Added an "Interactive state selectors" section to Foundations/Utilities/Utilities.mdx in Storybook, alongside the other style-utility helpers (boxShadow, fontSmoothing, noSelect, screen-reader helpers), documenting InteractiveSelectors.

PR Checklist

  • Related to designs: N/A
  • Related to JIRA ticket: GMT-1740
  • Version plan added/updated
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions for the code change

Testing Instructions

  1. Run yarn nx build gamut and yarn nx build gamut-icons — both should compile clean with no TS errors.
  2. Confirm the new exports resolve from the package root (not a deep /dist path):
    import {
      InteractiveSelectors,
      buttonProps,
      SelectDropdownProps,
    } from '@codecademy/gamut';
    import { IconStyleProps } from '@codecademy/gamut-icons';
  3. In Storybook, open Foundations → Utilities and confirm the new "Interactive state selectors" section renders with the InteractiveSelectors code sample.
  4. Exercise the InteractiveSelectors rename's call sites to confirm nothing regressed visually: Button, Anchor, Tag, Tip (InfoTip/PreviewTip), and Pagination, in both light and dark mode.

PR Links and Envs

Repository PR Link
Monolith Codecademy PR #41190
Mono Mono PR #13654

…o public API

Part of the GMT-1740 exports-map migration. Promotes types from
packages/gamut/src/PopoverContainer/types.ts and
Form/SelectDropdown/types/* to the package root so consumers can stop
reaching into internal dist/ paths.
@nx-cloud

nx-cloud Bot commented Aug 17, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 3f89af8


☁️ Nx Cloud last updated this comment at 2026-08-28 16:21:25 UTC

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.97%. Comparing base (86734ca) to head (3f89af8).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3412      +/-   ##
==========================================
- Coverage   91.33%   90.97%   -0.36%     
==========================================
  Files         407      277     -130     
  Lines        6841     5909     -932     
  Branches     2230     2004     -226     
==========================================
- Hits         6248     5376     -872     
+ Misses        584      524      -60     
  Partials        9        9              
Flag Coverage Δ
main ?
pull-request 90.97% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Dropped during the export-* switch, breaking GridForm/types.ts's import.
…ublic API

Renamed to match real usage (Anchor, Tag, Tip, Pagination — not just
Button/ButtonBase), then exported from the root barrel. Documented
alongside the other style utility helpers in Storybook.
# Conflicts:
#	packages/gamut/src/Anchor/index.tsx
#	packages/gamut/src/ButtonBase/ButtonBase.tsx
#	packages/gamut/src/Menu/MenuItem.tsx
#	packages/gamut/src/PopoverContainer/PopoverContainer.tsx
#	packages/gamut/src/PopoverContainer/types.ts
gamut and gamut-icons minor bumps for the new public exports.
…ate PR

Menu/elements' List->MenuList rename and Form/SelectDropdown's
IconOption->IconOptionComponent rename are breaking changes layered on
top of new exports; splitting them out for independent review. Only
InteractiveSelectors (not yet public, so no compat surface) stays here.

- Menu/elements: MenuList*/reverted to List*, and Menu/index.tsx no
  longer exports './elements' (would collide with the public List
  component).
- Form/SelectDropdown: IconOptionComponent reverted to IconOption and
  no longer exported from the barrel; the ./types export (Rule 2,
  non-breaking) is untouched.
7e79633 correctly un-exported the ButtonBase component but also deleted
the ButtonBaseElements type export, which predates this branch and is a
real public dependency (7 mono call sites use it for ref typing). Restore
just the type export; ButtonBase itself stays unexported.
Babel compiles each file independently and can't see across files
that these re-exported names are type-only, so it emitted a runtime
import for bindings that don't exist in the compiled output — breaking
consumer webpack builds with "export 'X' was not found in './Y'".
@codecademydev

Copy link
Copy Markdown
Collaborator

📬 Published Alpha Packages:

Package Version npm Diff
@codecademy/gamut 73.3.1-alpha.1d5baf.0 npm diff
@codecademy/gamut-icons 10.1.1-alpha.1d5baf.0 npm diff
@codecademy/gamut-illustrations 1.1.1-alpha.1d5baf.0 npm diff
@codecademy/gamut-kit 3.0.21-alpha.1d5baf.0 npm diff
@codecademy/gamut-patterns 1.1.1-alpha.1d5baf.0 npm diff
@codecademy/gamut-styles 21.2.1-alpha.1d5baf.0 npm diff
@codecademy/gamut-tests 7.1.1-alpha.1d5baf.0 npm diff
@codecademy/variance 1.1.1-alpha.1d5baf.0 npm diff
eslint-plugin-gamut 3.1.1-alpha.1d5baf.0 npm diff

@github-actions

Copy link
Copy Markdown
Contributor

@dreamwasp
dreamwasp marked this pull request as ready for review August 28, 2026 16:26
@dreamwasp
dreamwasp requested a review from a team as a code owner August 28, 2026 16:26
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