Skip to content

Commit

Permalink
chore(deps): dev dependencies (#996)
Browse files Browse the repository at this point in the history
Upgrades non-breaking dependencies, migrates to Yarn 4
  • Loading branch information
skinread authored Nov 27, 2024
1 parent c973d21 commit 93e0b5a
Show file tree
Hide file tree
Showing 24 changed files with 16,942 additions and 12,169 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildStorybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock')
}}-node-${{ steps.setups.outputs.node_version }}

- run: yarn --frozen-lockfile
- run: yarn --immutable

- name: Build storybook artefacts
run: yarn storybook:build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock')
}}-node-${{ steps.setups.outputs.node_version }}

- run: yarn --frozen-lockfile
- run: yarn --immutable

- name: Lint
run: yarn lint
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock')
}}-node-${{ steps.setups.outputs.node_version }}

- run: yarn --frozen-lockfile
- run: yarn --immutable

- name: Chromatic (main)
if: github.ref == 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock')
}}-node-${{ steps.setups.outputs.node_version }}

- run: yarn --frozen-lockfile
- run: yarn --immutable

- name: Create Release or Publish
uses: changesets/action@v1
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ storybook-static/
/report.*.json

*storybook.log

#Yarn
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.3.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
compressionLevel: mixed

enableGlobalCache: true

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.3.cjs
6 changes: 6 additions & 0 deletions chromatic.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"buildScriptName": "storybook:build",
"onlyChanged": true,
"projectId": "Project:5c80456c1498920020dedf4e",
"zip": true
}
4 changes: 2 additions & 2 deletions lib/components/AutoSuggest/AutoSuggest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ const AutoSuggestInput = forwardRef(function AutoSuggestInput(
? getSuggestionId(
suggestionListId!,
state.highlightIndex,
)
)
: undefined
}
value={state.previewText ?? value?.text}
Expand Down Expand Up @@ -696,7 +696,7 @@ const AutoSuggestInputPrimitive = withEnhancedInput(
);

useEffect(
() => () => focusTimeout ? clearTimeout(focusTimeout) : void 0,
() => () => (focusTimeout ? clearTimeout(focusTimeout) : void 0),
[],
);

Expand Down
2 changes: 1 addition & 1 deletion lib/components/AutoSuggest/useLayoutSuggestionVisible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useLayoutSuggestionVisible = (
highlightItem.offsetParent === suggestionListItem
? highlightItem.offsetTop
: highlightItem.offsetTop -
suggestionListItem.offsetTop;
suggestionListItem.offsetTop;

let { scrollTop } = suggestionListItem;
const { offsetHeight } = suggestionListItem;
Expand Down
10 changes: 5 additions & 5 deletions lib/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const Button = forwardRef<HTMLButtonElement, Props>(
? {
isSingleIconChild: true,
props: maybeProps.props,
}
}
: { isSingleIconChild: false };
}, [children]);

Expand Down Expand Up @@ -169,7 +169,7 @@ export const Button = forwardRef<HTMLButtonElement, Props>(
{isSingleIconChild && maybeIconProps ? (
<Icon
size={
maybeIconProps.size ?? size === 'small'
(maybeIconProps.size ?? size === 'small')
? 'small'
: 'medium'
}
Expand Down Expand Up @@ -237,9 +237,9 @@ export const Button = forwardRef<HTMLButtonElement, Props>(

return isValidElement(Component)
? // @ts-ignore
cloneElement(Component, { ref, ...props }, child)
cloneElement(Component, { ref, ...props }, child)
: // @ts-ignore
createElement(Component, { ref, ...props }, child);
createElement(Component, { ref, ...props }, child);
},
);

Expand All @@ -254,7 +254,7 @@ const getButtonStates: (
return minimal
? clsx(buttonStyles.minimal.defaults, {
[buttonStyles.minimal.noneRounded]: !rounded,
})
})
: '';

if (minimal)
Expand Down
6 changes: 4 additions & 2 deletions lib/components/DropDown/DropDown.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default {
display: 'grid',
gridGap: '12px',
gridAutoFlow: 'row dense',
}}>
}}
>
{story()}
</div>
),
Expand Down Expand Up @@ -68,7 +69,8 @@ const Template: StoryFn<typeof DropDown> = (args) => (
}}
display="flex"
alignItems="center"
justifyContent="center">
justifyContent="center"
>
<DropDown {...args} />
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Meta, StoryFn } from '@storybook/react';
import Rand from 'rand-seed';
import * as React from 'react';
import { ComponentProps } from 'react';

Expand Down Expand Up @@ -31,6 +32,8 @@ export default {
},
} satisfies Meta<typeof HorizontalAutoScroller>;

const randHeight = new Rand('storybook');

const template: StoryFn<typeof HorizontalAutoScroller> = ({
childrenNum,
...args
Expand All @@ -50,7 +53,7 @@ const template: StoryFn<typeof HorizontalAutoScroller> = ({
<Box
style={{
width: '100%',
height: 20 + Math.ceil(Math.random() * 300),
height: 20 + Math.ceil(randHeight.next() * 300),
}}
backgroundColour="gray900"
/>
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const Icon: FunctionComponent<Props> = ({
width: 'full',
height: 'full',
}),
})
})
: '⬤'}
</Box>
);
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Image/Image.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const sizeOptions: Array<ComponentProps<typeof Image>['imageWidth']> =
'14',
'15',
'16',
];
];
const qualityOptions: Array<ComponentProps<typeof Image>['quality']> =
isChromatic() ? ['70'] : [1, 20, 40, 60, 80, 100];
export default {
Expand Down
2 changes: 1 addition & 1 deletion lib/components/Image/ResponsiveImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const ResponsiveImage: FunctionComponent<Props> = ({
: generateSrcSet({
src: incomingSrc,
quality,
}),
}),
[incomingSrc, quality],
);

Expand Down
6 changes: 4 additions & 2 deletions lib/components/SelectInput/SelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export const SelectInput = withEnhancedInput<
flexWrap="nowrap"
alignItems="center"
justifyContent="center"
position="relative">
position="relative"
>
<Box
is="select"
flexGrow={1}
Expand All @@ -49,7 +50,8 @@ export const SelectInput = withEnhancedInput<
marginRight={size === 'medium' ? '4' : '2'}
flexShrink={0}
pointerEvents="none"
position="absolute">
position="absolute"
>
<Icon size="medium" icon={fieldIcon} />
</Box>
)}
Expand Down
6 changes: 3 additions & 3 deletions lib/components/private/InputBase/NotchedBase.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ const calcPlaceholderTranslate = (
prefixed
? `calc(${vars.space['7']} + ${vars.space['3']})`
: vars.typography.size['4'].fontSize
}, calc((${vars.space['8']} - ${
}, calc((${vars.space['8']} - ${
vars.typography.size['4'].fontSize
}) / 2)`
}) / 2)`
: `${
prefixed
? `calc(${vars.space['2']} + ${vars.space['5']} + ${vars.space['2']})`
: vars.space['2']
}, calc(${vars.space['2']} + 2px)`;
}, calc(${vars.space['2']} + 2px)`;
};

export const placeholderPlacement = {
Expand Down
2 changes: 1 addition & 1 deletion lib/components/private/InputBase/withEnhancedInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export const withEnhancedInput = <
suffixed: Boolean(suffixIcon),
isLoading,
'aria-busy': isLoading || void 0,
...(rest as IncomingProps),
...(rest as unknown as IncomingProps),
};

const onMouseOver = useCallback(() => {
Expand Down
2 changes: 1 addition & 1 deletion lib/hooks/useAttachedBoxes/useAttachedBoxes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const useAttachedBoxes = ({
gridColumn: `${colStart}/${
colStart + 1 + extend
}`,
}
}
: void 0
}
{...rest}
Expand Down
2 changes: 1 addition & 1 deletion lib/themes/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const hexToRGB = (hex: string): RGBNumbers => {
r: Number.parseInt(result[1], 16),
g: Number.parseInt(result[2], 16),
b: Number.parseInt(result[3], 16),
}
}
: null;
};

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const alignmentToFlexAlignment = (align: Alignment) =>
center: 'center',
left: 'flexStart',
right: 'flexEnd',
}[align] as 'center' | 'flexStart' | 'flexEnd');
})[align] as 'center' | 'flexStart' | 'flexEnd';

/**
* A function that returns the first item in the array, if the index exceeds its maximum length
Expand Down
41 changes: 22 additions & 19 deletions lib/utils/responsiveProps.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,25 @@ export const makeResponsiveStyle = <Token extends Record<string | number, any>>(
tokens,
property: ((value: any) => CSSProperties) | keyof Properties,
): Record<keyof Token, ResponsiveProp<any>> =>
Object.entries(tokens || {}).reduce((results, [key, value]) => {
const breakpointsKeys = Object.keys(breakpoints);
return {
...results,
[key]: breakpointsKeys.reduce((bpList, bp) => {
return {
...bpList,
[bp]: style(
responsiveStyle({
[bp]:
typeof property === 'string'
? { [property]: value }
: property(value),
}),
),
};
}, {}),
};
}, {} as Record<keyof Token, BreakpointStyleMap>);
Object.entries(tokens || {}).reduce(
(results, [key, value]) => {
const breakpointsKeys = Object.keys(breakpoints);
return {
...results,
[key]: breakpointsKeys.reduce((bpList, bp) => {
return {
...bpList,
[bp]: style(
responsiveStyle({
[bp]:
typeof property === 'string'
? { [property]: value }
: property(value),
}),
),
};
}, {}),
};
},
{} as Record<keyof Token, BreakpointStyleMap>,
);
Loading

0 comments on commit 93e0b5a

Please sign in to comment.