Skip to content

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

Draft
dreamwasp wants to merge 13 commits into
mainfrom
cass-gmt-1740
Draft

GMT-1740: promote deep-import types to public API#3412
dreamwasp wants to merge 13 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).

Moved to a separate PR

  • Menu/elements: List/ListItem/ListLink/ListButtonMenuList/MenuListItem/MenuListLink/MenuListButton (collided with the already-public List component) — pulled out for independent review since it's a breaking rename on top of the promotion.
  • Form/SelectDropdown: IconOption component → IconOptionComponent (collided with the IconOption type on export *) — same reasoning, pulled out.

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.

Versioning

  • Added a version plan bumping gamut and gamut-icons minor — all changes here are additive exports from gamut's already-published API; the renames only affect paths that were never previously public.

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.
  5. Run npx nx release plan:check — should report all touched projects (gamut, gamut-icons) as covered by the version plan.

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 0af0581


☁️ Nx Cloud last updated this comment at 2026-08-26 14:15:34 UTC

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1246 1 1245 0
View the top 1 failed test(s) by shortest run time
 Gamut Exported Keys
Stack Traces | 0.005s run time
Error: expect(received).toMatchSnapshot()

Snapshot name: `Gamut Exported Keys 1`

- Snapshot  -  0
+ Received  + 32

@@ -3,13 +3,15 @@
    "Anchor",
    "AnchorBase",
    "AppWrapper",
    "Badge",
    "BarChart",
+   "BaseOnChangeProps",
    "BodyPortal",
    "Box",
    "Breadcrumbs",
+   "buttonProps",
    "Card",
    "Checkbox",
    "Coachmark",
    "Column",
    "ConnectedCheckbox",
@@ -21,12 +23,18 @@
    "ConnectedRadioGroup",
    "ConnectedRadioGroupInput",
    "ConnectedSelect",
    "ConnectedTextArea",
    "ContentContainer",
+   "ControlState",
+   "createCodeBlockOverride",
+   "createInputOverride",
    "createPromise",
+   "createTagOverride",
+   "createVideoOverride",
    "CTAButton",
+   "CustomSelectComponentProps",
    "DataList",
    "DataTable",
    "DatePicker",
    "DatePickerCalendar",
    "DatePickerInput",
@@ -35,10 +43,11 @@
    "Dialog",
    "Disclosure",
    "Drawer",
    "ExpandControl",
    "ExpandInCollapseOut",
+   "ExtendedOption",
    "FadeInSlideOut",
    "FeatureShimmer",
    "FillButton",
    "FlexBox",
    "Flyout",
@@ -55,25 +64,36 @@
    "getFocusableElements",
    "GridBox",
    "GridForm",
    "GridFormContent",
    "IconButton",
+   "IconOption",
+   "IconOptionComponent",
    "iFrameWrapper",
    "InfoTip",
    "Input",
+   "InteractiveSelectors",
    "isClickableCrumb",
    "LayoutGrid",
    "List",
    "ListCol",
    "ListRow",
    "Markdown",
    "matchDisabledDates",
    "Menu",
    "MenuItem",
+   "MenuList",
+   "MenuListButton",
+   "MenuListItem",
+   "MenuListLink",
    "MenuSeparator",
+   "MenuToolTipWrapper",
    "Modal",
+   "MultiSelectDropdownProps",
    "omitProps",
+   "OptionState",
+   "OptionStrict",
    "Overlay",
    "Pagination",
    "Popover",
    "PopoverContainer",
    "PreviewTip",
@@ -84,14 +104,22 @@
    "reactRecurlyFormFieldFocusStyles",
    "reactRecurlyFormFieldPaddingStyles",
    "Rotation",
    "Select",
    "SelectDropdown",
+   "SelectDropdownContextValueTypes",
+   "SelectDropdownGroup",
+   "SelectDropdownOptions",
+   "SelectDropdownProps",
+   "SelectDropdownSizes",
    "Shimmer",
+   "SingleSelectDropdownProps",
+   "SizedIndicatorProps",
    "SkipToContent",
    "SkipToContentTarget",
    "Spinner",
+   "standardOverrides",
    "StrokeButton",
    "SubmitButton",
    "submitSuccessStatus",
    "Tab",
    "TableHeader",
@@ -103,14 +131,18 @@
    "Tabs",
    "Tag",
    "Text",
    "TextArea",
    "TextButton",
+   "tipAlignmentArray",
+   "tipBaseAlignmentArray",
+   "tipDefaultProps",
    "Toast",
    "Toaster",
    "Toggle",
    "ToolTip",
+   "TypedReactSelectProps",
    "USE_DEBOUNCED_FIELD_DIRTY_KEY",
    "useConnectedForm",
    "useDatePicker",
    "useDebouncedField",
    "useField",
    at Object.<anonymous> (.../gamut/__tests__/gamut.test.ts:7:25)
    at Promise.finally.completed (.../jest-circus/build/jestAdapterInit.js:1561:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../jest-circus/build/jestAdapterInit.js:1501:10)
    at _callCircusTest (.../jest-circus/build/jestAdapterInit.js:1011:40)
    at async _runTest (.../jest-circus/build/jestAdapterInit.js:951:3)
    at async .../jest-circus/build/jestAdapterInit.js:853:7
    at async _runTestsForDescribeBlock (.../jest-circus/build/jestAdapterInit.js:866:11)
    at async run (.../jest-circus/build/jestAdapterInit.js:765:3)
    at async runAndTransformResultsToJestFormat (.../jest-circus/build/jestAdapterInit.js:1993:21)
    at async jestAdapter (.../jest-circus/build/runner.js:111:19)
    at async runTestInternal (.../jest-runner/build/index.js:276:16)
    at async runTest (.../jest-runner/build/index.js:344:7)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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.
@codecademydev

Copy link
Copy Markdown
Collaborator

📬 Published Alpha Packages:

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

…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.
@github-actions

Copy link
Copy Markdown
Contributor

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