Skip to content

Commit

Permalink
chore: remove usage of "export *"
Browse files Browse the repository at this point in the history
  • Loading branch information
layershifter committed Dec 17, 2024
1 parent 0eeccf1 commit c384b14
Show file tree
Hide file tree
Showing 27 changed files with 241 additions and 65 deletions.
12 changes: 9 additions & 3 deletions apps/vr-tests-react-components/src/utilities/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
export * from './TestWrapperDecorator';
export * from './getStoryVariant';
export * from './withStoryWrightSteps';
export {
TestWrapperDecorator,
TestWrapperDecoratorFixedWidth,
TestWrapperDecoratorFullWidth,
TestWrapperDecoratorTall,
TestWrapperDecoratorTallFixedWidth,
} from './TestWrapperDecorator';
export { DARK_MODE, HIGH_CONTRAST, RTL, getStoryVariant } from './getStoryVariant';
export { withStoryWrightSteps } from './withStoryWrightSteps';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: remove usage of \"export *\"",
"packageName": "@fluentui/codemods",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: remove usage of \"export *\"",
"packageName": "@fluentui/eslint-plugin",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: remove usage of \"export *\"",
"packageName": "@fluentui/react-conformance",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: remove usage of \"export *\"",
"packageName": "@fluentui/react-icon-provider",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: remove usage of \"export *\"",
"packageName": "@fluentui/theme",
"email": "[email protected]",
"dependentChangeType": "patch"
}
37 changes: 25 additions & 12 deletions packages/a11y-testing/src/definitions/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
export * from './Button/buttonBehaviorDefinition';
export * from './Button/buttonGroupBehaviorDefinition';
export * from './Button/toggleButtonBehaviorDefinition';
export * from './Link/linkBehaviorDefinition';
export * from './MenuButton/menuButtonBehaviorDefinition';
export * from './Pill/pillActionBehaviorDefinition';
export * from './Pill/pillBehaviorDefinition';
export * from './Pill/pillOptionBehaviorDefinition';
export * from './Pill/pillGroupBehaviorDefinition';
export * from './Popup/popupBehaviorDefinition';

export * from './react-button/buttonAccessibilityBehaviorDefinition';
export { buttonBehaviorDefinition } from './Button/buttonBehaviorDefinition';
export { buttonGroupBehaviorDefinition } from './Button/buttonGroupBehaviorDefinition';
export { toggleButtonBehaviorDefinition } from './Button/toggleButtonBehaviorDefinition';
export { linkBehaviorDefinition } from './Link/linkBehaviorDefinition';
export {
menuButtonBehaviorDefinition,
menuButtonBehaviorDefinitionMenuSlot,
menuButtonBehaviorDefinitionMenuSlotWithoutID,
menuButtonBehaviorDefinitionTriggerSlotNotTabbable,
menuButtonBehaviorDefinitionTriggerSlotTabbable,
menuButtonBehaviorDefinitionTriggerSlotWithoutID,
menuButtonBehaviorDefinitionTriggerWithTabIndex,
} from './MenuButton/menuButtonBehaviorDefinition';
export { pillActionBehaviorDefinition } from './Pill/pillActionBehaviorDefinition';
export { pillBehaviorDefinition } from './Pill/pillBehaviorDefinition';
export { pillOptionBehaviorDefinition } from './Pill/pillOptionBehaviorDefinition';
export { pillGroupBehaviorDefinition } from './Pill/pillGroupBehaviorDefinition';
export {
popupBehaviorDefinition,
popupBehaviorDefinitionPopupSlot,
popupBehaviorDefinitionTriggerSlotNotTabbable,
popupBehaviorDefinitionTriggerSlotTabbable,
popupBehaviorDefinitionTriggerSlotWithTabIndex,
} from './Popup/popupBehaviorDefinition';
export { buttonAccessibilityBehaviorDefinition } from './react-button/buttonAccessibilityBehaviorDefinition';
2 changes: 1 addition & 1 deletion packages/a11y-testing/src/facades/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './ComponentTestFacade';
export { ComponentTestFacade } from './ComponentTestFacade';
32 changes: 27 additions & 5 deletions packages/a11y-testing/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
export * from './types';
export * from './validators/index';
export * from './facades/index';
export * from './rules/index';
export * from './definitions/index';
export type { AccessibilityBehavior, PropValue, Props, Rule, Slot, TestFacade } from './types';
export { validateBehavior, validateSlot } from './validators/index';
export { ComponentTestFacade } from './facades/index';
export { BehaviorRule, SlotRule } from './rules/index';
export {
buttonAccessibilityBehaviorDefinition,
buttonBehaviorDefinition,
buttonGroupBehaviorDefinition,
linkBehaviorDefinition,
menuButtonBehaviorDefinition,
menuButtonBehaviorDefinitionMenuSlot,
menuButtonBehaviorDefinitionMenuSlotWithoutID,
menuButtonBehaviorDefinitionTriggerSlotNotTabbable,
menuButtonBehaviorDefinitionTriggerSlotTabbable,
menuButtonBehaviorDefinitionTriggerSlotWithoutID,
menuButtonBehaviorDefinitionTriggerWithTabIndex,
pillActionBehaviorDefinition,
pillBehaviorDefinition,
pillGroupBehaviorDefinition,
pillOptionBehaviorDefinition,
popupBehaviorDefinition,
popupBehaviorDefinitionPopupSlot,
popupBehaviorDefinitionTriggerSlotNotTabbable,
popupBehaviorDefinitionTriggerSlotTabbable,
popupBehaviorDefinitionTriggerSlotWithTabIndex,
toggleButtonBehaviorDefinition,
} from './definitions/index';
2 changes: 1 addition & 1 deletion packages/a11y-testing/src/rules/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './rules';
export { BehaviorRule, SlotRule } from './rules';
2 changes: 1 addition & 1 deletion packages/a11y-testing/src/validators/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './validate';
export { validateBehavior, validateSlot } from './validate';
4 changes: 2 additions & 2 deletions packages/codemods/src/codeMods/tests/mock/compat/mockIndex.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './Button';
export * from './DefaultButton';
export { Button, OtherButton } from './Button';
export { DefaultButton } from './DefaultButton';
8 changes: 4 additions & 4 deletions packages/codemods/src/codeMods/utilities/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './jsx';
export * from './imports';
export * from './props';
export * from './transforms';
export { findJsxTag } from './jsx';
export { appendOrCreateNamedImport, getImportsByPath, renameImport, repathImport } from './imports';
export { renameProp } from './props';
export { boolTransform, enumTransform, numberTransform, stringTransform } from './transforms';
5 changes: 2 additions & 3 deletions packages/eslint-plugin/src/configs/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ module.exports = {
},
overrides: [
{
files: '**/src/index.{ts,tsx,js}',
files: '**/src/**/*.{ts,tsx,js}',
rules: {
// TODO: propagate to `error` once all packages barrel files have been fixed
'@rnx-kit/no-export-all': ['warn', { expand: 'all' }],
'@rnx-kit/no-export-all': ['error', { expand: 'all' }],
},
},
],
Expand Down
79 changes: 74 additions & 5 deletions packages/react-components/theme-designer/src/colors/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,74 @@
export * from './csswg';
export * from './geometry';
export * from './palettes';
export * from './templates';
export * from './types';
export {
D50_to_D65,
D65_to_D50,
LAB_to_sRGB,
LCH_to_Lab,
LCH_to_P3,
LCH_to_r2020,
LCH_to_sRGB,
Lab_to_LCH,
Lab_to_XYZ,
P3_to_LCH,
XYZ_to_Lab,
XYZ_to_lin_2020,
XYZ_to_lin_P3,
XYZ_to_lin_ProPhoto,
XYZ_to_lin_a98rgb,
XYZ_to_lin_sRGB,
XYZ_to_uv,
XYZ_to_xy,
contrast,
gam_2020,
gam_P3,
gam_ProPhoto,
gam_a98rgb,
gam_sRGB,
hslToRgb,
hueToChannel,
lin_2020,
lin_2020_to_XYZ,
lin_P3,
lin_P3_to_XYZ,
lin_ProPhoto,
lin_ProPhoto_to_XYZ,
lin_a98rgb,
lin_a98rgb_to_XYZ,
lin_sRGB,
lin_sRGB_to_XYZ,
naive_CMYK_to_sRGB,
naive_sRGB_to_CMYK,
r2020_to_LCH,
rgbToHsv,
sRGB_to_LAB,
sRGB_to_LCH,
sRGB_to_luminance,
snap_into_gamut,
xy_to_uv,
} from './csswg';
export { getPointOnCurvePath, getPointsOnCurvePath } from './geometry';
export {
Lab_to_hex,
curvePathFromPalette,
hexColorsFromPalette,
hex_to_LCH,
hex_to_sRGB,
paletteShadesFromCurve,
sRGB_to_hex,
} from './palettes';
export { paletteTemplate, themeTemplate } from './templates';
export type {
Curve,
CurvePath,
CurvedHelixPath,
NamedPalette,
NamedTheme,
Palette,
PaletteConfig,
Theme,
ThemeCollectionInclude,
TokenPackageConfig,
TokenPackageType,
Vec2,
Vec3,
Vec4,
} from './types';
6 changes: 3 additions & 3 deletions packages/react-conformance/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './errorMessages';
export * from './getCallbackArguments';
export { errorMessageColors, getErrorMessage, formatErrors, formatArray } from './errorMessages';
export { type ArgumentName, getCallbackArguments } from './getCallbackArguments';
export { getPackagePath } from './getPackagePath';
export * from './validateCallbackArguments';
export { validateCallbackArguments } from './validateCallbackArguments';
9 changes: 7 additions & 2 deletions packages/react-icon-provider/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import './version';

export * from './IconProvider';
export * from './IconProvider.types';
export {
// eslint-disable-next-line @fluentui/ban-context-export
IconContext,
IconProvider,
useIconSubset,
} from './IconProvider';
export type { IconProviderProps } from './IconProvider.types';
4 changes: 2 additions & 2 deletions packages/storybook/src/decorators/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './withKeytipLayer';
export * from './withStrictMode';
export { KeytipLayerWrapper, withKeytipLayer } from './withKeytipLayer';
export { withStrictMode } from './withStrictMode';
2 changes: 1 addition & 1 deletion packages/theme/src/colors/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './FluentColors';
export { CommunicationColors, NeutralColors, SharedColors } from './FluentColors';
export { DefaultPalette } from './DefaultPalette';
4 changes: 2 additions & 2 deletions packages/theme/src/createTheme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('createTheme', () => {

it('applies defaultFontStyle to fonts and retains all other default values', () => {
const defaultFontStyle: IRawStyle = { fontFamily: 'Segoe UI' };
const userTheme = { defaultFontStyle: defaultFontStyle };
const userTheme = { defaultFontStyle };
const newTheme = createTheme(userTheme);

expect(newTheme.fonts.tiny.fontFamily).toEqual('Segoe UI');
Expand All @@ -38,7 +38,7 @@ describe('createTheme', () => {

it('applies defaultFontStyle and fonts to theme and retains all other default values', () => {
const defaultFontStyle: IRawStyle = { fontFamily: 'Foo', fontSize: '10px' };
const userTheme = { defaultFontStyle: defaultFontStyle, fonts: { small: { fontSize: '20px' } } };
const userTheme = { defaultFontStyle, fonts: { small: { fontSize: '20px' } } };
const newTheme = createTheme(userTheme);

expect(newTheme.fonts.tiny.fontFamily).toEqual('Foo');
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/fonts/createFontStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function _getLocalizedFontFamily(language: string | null): string {

function _createFont(size: string, weight: IFontWeight, fontFamily: string): IRawStyle {
return {
fontFamily: fontFamily,
fontFamily,
MozOsxFontSmoothing: 'grayscale',
WebkitFontSmoothing: 'antialiased',
fontSize: size,
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/fonts/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './FluentFonts';
export { FontSizes, FontWeights, IconFontSizes, LocalizedFontFamilies, LocalizedFontNames } from './FluentFonts';
export { createFontStyles } from './createFontStyles';
export { DefaultFontStyles, registerDefaultFontFaces } from './DefaultFontStyles';
42 changes: 34 additions & 8 deletions packages/theme/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
export * from './mergeThemes';
export * from './types/index';
export * from './colors/index';
export * from './effects/index';
export * from './spacing/index';
export * from './motion/index';
export * from './fonts/index';
export * from './createTheme';
export { mergeThemes } from './mergeThemes';
export type {
ComponentStyles,
ComponentsStyles,
IAnimationStyles,
IAnimationVariables,
IEffects,
IFontStyles,
IPalette,
IPartialTheme,
IScheme,
ISchemeNames,
ISemanticColors,
ISemanticTextColors,
ISpacing,
ITheme,
PartialTheme,
Theme,
} from './types/index';
export { CommunicationColors, DefaultPalette, NeutralColors, SharedColors } from './colors/index';
export { DefaultEffects, Depths } from './effects/index';
export { DefaultSpacing } from './spacing/index';
export { AnimationStyles, AnimationVariables, MotionAnimations, MotionDurations, MotionTimings } from './motion/index';
export {
DefaultFontStyles,
FontSizes,
FontWeights,
IconFontSizes,
LocalizedFontFamilies,
LocalizedFontNames,
createFontStyles,
registerDefaultFontFaces,
} from './fonts/index';
export { createTheme } from './createTheme';
export { FluentTheme } from './FluentTheme';

import './version';
4 changes: 2 additions & 2 deletions packages/theme/src/motion/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './FluentMotion';
export * from './AnimationStyles';
export { MotionAnimations, MotionDurations, MotionTimings } from './FluentMotion';
export { AnimationStyles, AnimationVariables } from './AnimationStyles';
2 changes: 1 addition & 1 deletion packages/theme/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './Theme';
export type { ComponentStyles, ComponentsStyles, PartialTheme, Theme } from './Theme';
export type { IEffects } from './IEffects';
export type { IFontStyles } from './IFontStyles';
export type { IPalette } from './IPalette';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { default as getVersionConstraints } from './getVersionConstraints';
export { default as getRuntimeDependencies } from './getRuntimeDependencies';
export { default as getFailedPackageVersionConstraints } from './getFailedPackageVersionConstraints';
export * from './getFailedPackageVersionConstraints';
export * from './packageNameUtils';
export type { FailedConstraintsExplanation } from './getFailedPackageVersionConstraints';
export { getPackageName, getPackageVersion } from './packageNameUtils';
7 changes: 4 additions & 3 deletions scripts/github/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './constants';
export * from './pullRequests';
export * from './types';
export { fluentRepoDetails } from './constants';
export type { IGetPullRequestFromCommitParams } from './pullRequests';
export { getPullRequestForCommit, processPullRequestApiResponse } from './pullRequests';
export type { IPullRequest, IRepoDetails, IUser } from './types';

0 comments on commit c384b14

Please sign in to comment.