Skip to content

Commit

Permalink
feat: add wildcard imports as exports
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack committed Sep 16, 2024
1 parent 91f7862 commit de542e6
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/react/src/FeatureFlags/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export {FeatureFlags} from './FeatureFlags'
export type {FeatureFlagsProps} from './FeatureFlags'
export {useFeatureFlag} from './useFeatureFlag'
export {DefaultFeatureFlags} from './DefaultFeatureFlags'
2 changes: 2 additions & 0 deletions packages/react/src/Token/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export type {TokenSizeKeys} from './TokenBase'
export {default} from './Token'
export type {TokenProps} from './Token'
export {default as IssueLabelToken} from './IssueLabelToken'
export type {IssueLabelTokenProps} from './IssueLabelToken'
export {default as AvatarToken} from './AvatarToken'
10 changes: 10 additions & 0 deletions packages/react/src/__tests__/__snapshots__/exports.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ exports[`@primer/react should not update exports without a semver change 1`] = `
"AvatarToken",
"BaseStyles",
"type BaseStylesProps",
"type BetterCssProperties",
"type BetterSystemStyleObject",
"Box",
"type BoxProps",
"BranchName",
Expand Down Expand Up @@ -80,7 +82,9 @@ exports[`@primer/react should not update exports without a semver change 1`] = `
"IconButton",
"type IconButtonProps",
"IssueLabelToken",
"type IssueLabelTokenProps",
"Label",
"type LabelColorOptions",
"LabelGroup",
"type LabelGroupProps",
"type LabelProps",
Expand Down Expand Up @@ -198,10 +202,12 @@ exports[`@primer/react should not update exports without a semver change 1`] = `
"useFocusTrap",
"useFocusZone",
"useFormControlForwardedProps",
"useIsomorphicLayoutEffect",
"useOnEscapePress",
"useOnOutsideClick",
"useOpenAndCloseFocus",
"useOverlay",
"useProvidedRefOrCreate",
"useRefObjectAsForwardedRef",
"useResizeObserver",
"useResponsiveValue",
Expand All @@ -213,6 +219,9 @@ exports[`@primer/react should not update exports without a semver change 1`] = `
exports[`@primer/react/deprecated should not update exports without a semver change 1`] = `
[
"ActionList",
"type ActionListGroupedListProps",
"type ActionListGroupProps",
"type ActionListItemProps",
"type ActionListProps",
"ActionMenu",
"type ActionMenuProps",
Expand Down Expand Up @@ -275,6 +284,7 @@ exports[`@primer/react/experimental should not update exports without a semver c
"default",
"default",
"default",
"DefaultFeatureFlags",
"Dialog",
"type DialogButtonProps",
"type DialogHeaderProps",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/deprecated/ActionList/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {List} from './List'
import {Group} from './Group'
import {Item} from './Item'
import {Divider} from './Divider'
export type {ListProps as ActionListProps} from './List'
export type {ListProps as ActionListProps, GroupedListProps} from './List'
export type {GroupProps} from './Group'
export type {ItemProps} from './Item'

Expand Down
7 changes: 6 additions & 1 deletion packages/react/src/deprecated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
// Deprecated in v35.0.0 on March 9, 2022
// TODO: We can remove these 6 months after release: September 10, 2022
export {ActionList} from './ActionList'
export type {ActionListProps} from './ActionList'
export type {
ActionListProps,
ItemProps as ActionListItemProps,
GroupProps as ActionListGroupProps,
GroupedListProps as ActionListGroupedListProps,
} from './ActionList'
export {ActionMenu} from './ActionMenu'
export type {ActionMenuProps} from './ActionMenu'
// (copied over from src/index) not exporting new DropdownMenu types yet due to conflict with Dropdown types above
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/experimental/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export {UnderlinePanels} from './UnderlinePanels'
export type {UnderlinePanelsProps, UnderlinePanelsTabProps, UnderlinePanelsPanelProps} from './UnderlinePanels'

export {SkeletonBox, SkeletonText, SkeletonAvatar} from './Skeleton'
export {FeatureFlags} from '../FeatureFlags'
export {FeatureFlags, DefaultFeatureFlags} from '../FeatureFlags'
export type {FeatureFlagsProps} from '../FeatureFlags'

export {FilteredActionList} from '../FilteredActionList'
Expand Down
8 changes: 5 additions & 3 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export type {FocusZoneHookSettings} from './hooks/useFocusZone'
export {useRefObjectAsForwardedRef} from './hooks/useRefObjectAsForwardedRef'
export {useResizeObserver} from './hooks/useResizeObserver'
export {useResponsiveValue} from './hooks/useResponsiveValue'
export {default as useIsomorphicLayoutEffect} from './utils/useIsomorphicLayoutEffect'
export {useProvidedRefOrCreate} from './hooks/useProvidedRefOrCreate'

// Utils
export {createComponent} from './utils/create-component'
Expand Down Expand Up @@ -104,7 +106,7 @@ export type {HeaderProps, HeaderItemProps, HeaderLinkProps} from './Header'
export {default as Heading} from './Heading'
export type {HeadingProps} from './Heading'
export {default as Label} from './Label'
export type {LabelProps} from './Label'
export type {LabelProps, LabelColorOptions} from './Label'
export {default as LabelGroup} from './LabelGroup'
export type {LabelGroupProps} from './LabelGroup'
export {default as Link} from './Link'
Expand Down Expand Up @@ -169,7 +171,7 @@ export type {
TimelineItemsProps,
} from './Timeline'
export {default as Token, IssueLabelToken, AvatarToken} from './Token'
export type {TokenProps} from './Token'
export type {TokenProps, IssueLabelTokenProps} from './Token'
export {default as Tooltip} from './Tooltip/Tooltip'
export type {TooltipProps} from './Tooltip/Tooltip'
export {default as Truncate} from './Truncate'
Expand Down Expand Up @@ -203,4 +205,4 @@ export {PageHeader} from './PageHeader'
export type {PageHeaderProps} from './PageHeader'

export {default as sx, merge} from './sx'
export type {SxProp} from './sx'
export type {BetterCssProperties, BetterSystemStyleObject, SxProp} from './sx'

0 comments on commit de542e6

Please sign in to comment.