Skip to content

Commit b14784c

Browse files
authored
Merge pull request #441 from mashmatrix/update-libs
Update lib version (babel, typescript, storybook, ...)
2 parents fa860dc + 5e207e0 commit b14784c

18 files changed

+4856
-5529
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defaults: &defaults
66
working_directory: ~/project
77

88
orbs:
9-
browser-tools: circleci/browser-tools@1.1.0
9+
browser-tools: circleci/browser-tools@1.4.6
1010

1111
jobs:
1212
install:

.storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
const path = require('path');
22

33
module.exports = {
4+
typescript: {
5+
reactDocgen: "react-docgen-typescript-plugin"
6+
},
47
stories: ['../stories/**/*.stories.tsx'],
58
addons: [
69
'@storybook/addon-docs',

package.json

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
"test:visual": "reg-suit -v run",
2929
"type-check": "tsc --noEmit",
3030
"type-check:watch": "npm run type-check -- --watch",
31-
"format": "npm run lint:src -- --fix && npm run lint:stories -- --fix && npm run lint:test -- --fix",
32-
"lint": "npm run lint:src && npm run lint:stories",
31+
"format": "run-p format:src format:stories",
32+
"format:src": "npm run lint:src -- --fix",
33+
"format:stories": "npm run lint:stories -- --fix",
34+
"lint": "run-p lint:src lint:stories",
3335
"lint:src": "eslint --ext .ts,.tsx src/scripts/**",
3436
"lint:stories": "eslint --ext .ts,.tsx stories/**",
3537
"build": "run-p build:lib build:module build:types",
@@ -59,49 +61,51 @@
5961
"svg4everybody": "^2.1.9"
6062
},
6163
"devDependencies": {
62-
"@babel/cli": "^7.17.6",
63-
"@babel/core": "^7.17.9",
64-
"@babel/plugin-transform-runtime": "^7.17.0",
65-
"@babel/preset-env": "^7.16.11",
66-
"@babel/preset-react": "^7.16.7",
67-
"@babel/preset-typescript": "^7.16.7",
64+
"@babel/cli": "^7.23.0",
65+
"@babel/core": "^7.23.3",
66+
"@babel/plugin-transform-runtime": "^7.23.3",
67+
"@babel/preset-env": "^7.23.3",
68+
"@babel/preset-react": "^7.23.3",
69+
"@babel/preset-typescript": "^7.23.3",
6870
"@salesforce-ux/design-system": "^2.12.2",
69-
"@storybook/addon-actions": "^6.4.22",
70-
"@storybook/addon-docs": "^6.4.22",
71+
"@storybook/addon-actions": "^6.5.16",
72+
"@storybook/addon-docs": "^6.5.16",
7173
"@storybook/addon-knobs": "^6.4.0",
72-
"@storybook/addon-storyshots": "^6.4.22",
73-
"@storybook/react": "^6.4.22",
74-
"@storybook/theming": "^6.4.22",
74+
"@storybook/addon-storyshots": "^6.5.16",
75+
"@storybook/react": "^6.5.16",
76+
"@storybook/theming": "^6.5.16",
7577
"@types/classnames": "^2.2.7",
76-
"@types/react": "^17",
77-
"@types/react-dom": "^17",
78+
"@types/react": "^18.2.37",
79+
"@types/react-dom": "^18.2.15",
7880
"@types/svg4everybody": "^2.1.1",
79-
"@typescript-eslint/eslint-plugin": "^5.20.0",
80-
"@typescript-eslint/parser": "^5.20.0",
81-
"babel-loader": "^8.1.0",
82-
"eslint": "^8.14.0",
83-
"eslint-config-prettier": "^8.5.0",
84-
"eslint-plugin-jsx-a11y": "^6.5.1",
85-
"eslint-plugin-prettier": "^4.0.0",
86-
"eslint-plugin-react": "^7.29.4",
87-
"eslint-plugin-react-hooks": "^4.5.0",
81+
"@typescript-eslint/eslint-plugin": "^6.10.0",
82+
"@typescript-eslint/parser": "^6.10.0",
83+
"babel-loader": "^9.1.3",
84+
"eslint": "^8.53.0",
85+
"eslint-config-prettier": "^9.0.0",
86+
"eslint-plugin-jsx-a11y": "^6.8.0",
87+
"eslint-plugin-prettier": "^5.0.1",
88+
"eslint-plugin-react": "^7.33.2",
89+
"eslint-plugin-react-hooks": "^4.6.0",
8890
"gh-pages": "^0.12.0",
8991
"npm-run-all": "^4.0.1",
90-
"prettier": "^2.6.2",
91-
"react": "^17.0.2",
92-
"react-dom": "^17.0.2",
92+
"prettier": "^3.0.3",
93+
"react": "^18.2.0",
94+
"react-docgen-typescript-plugin": "^1.0.5",
95+
"react-dom": "^18.2.0",
9396
"reg-keygen-git-hash-plugin": "^0.11.1",
9497
"reg-notify-github-plugin": "^0.11.1",
9598
"reg-publish-s3-plugin": "^0.11.0",
9699
"reg-suit": "^0.11.1",
97100
"storycap": "^3.1.7",
98-
"typescript": "^4.6.3"
101+
"typescript": "^5.2.2"
99102
},
100103
"peerDependencies": {
101-
"react": "^17.0.2",
102-
"react-dom": "^17.0.2"
104+
"@types/react": "^17.0.0 || ^18.0.0",
105+
"react": "^17.0.0 || ^18.0.0",
106+
"react-dom": "^17.0.0 || ^18.0.0"
103107
},
104108
"resolutions": {
105-
"@types/react": "^16.8.12"
109+
"@types/react": "^18.2.37"
106110
}
107111
}

src/scripts/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const ICON_SIZES = ['x-small', 'small', 'medium', 'large'] as const;
2222
const ICON_ALIGNS = ['left', 'right'] as const;
2323

2424
export type ButtonSize = 'x-small' | 'small' | 'medium' | 'large';
25-
export type ButtonIconSize = typeof ICON_SIZES[number];
26-
export type ButtonIconAlign = typeof ICON_ALIGNS[number];
25+
export type ButtonIconSize = (typeof ICON_SIZES)[number];
26+
export type ButtonIconAlign = (typeof ICON_ALIGNS)[number];
2727
export type ButtonIconMoreSize = 'x-small' | 'small' | 'medium' | 'large';
2828

2929
/**

src/scripts/Input.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const InputIcon = ({
5959
}) => {
6060
return React.isValidElement(icon) ? (
6161
icon
62-
) : (
62+
) : typeof icon === 'string' ? (
6363
<Icon
6464
icon={icon}
6565
className={classnames(
@@ -68,6 +68,8 @@ const InputIcon = ({
6868
'slds-icon-text-default'
6969
)}
7070
/>
71+
) : (
72+
<></>
7173
);
7274
};
7375

src/scripts/Notification.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const NOTIFICATION_TYPES = ['alert', 'toast'] as const;
77

88
const NOTIFICATION_LEVELS = ['info', 'success', 'warning', 'error'] as const;
99

10-
export type NotificationType = typeof NOTIFICATION_TYPES[number];
11-
export type NotificationLevel = typeof NOTIFICATION_LEVELS[number];
10+
export type NotificationType = (typeof NOTIFICATION_TYPES)[number];
11+
export type NotificationLevel = (typeof NOTIFICATION_LEVELS)[number];
1212

1313
export type NotificationProps = {
1414
type?: NotificationType;

src/scripts/Tabs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,14 @@ const TabNav: FC<{ children?: ReactNode }> = (props) => {
221221
/**
222222
*
223223
*/
224-
export type TabProps<RendererProps> = {
224+
export type TabProps<RendererProps extends TabItemRendererProps> = {
225225
className?: string;
226226
eventKey?: TabKey;
227227
children?: ReactNode;
228228
} & TabItemProps<RendererProps>;
229229

230230
export const Tab = <
231-
RendererProps extends TabItemRendererProps = TabItemRendererProps
231+
RendererProps extends TabItemRendererProps = TabItemRendererProps,
232232
>(
233233
props: TabProps<RendererProps>
234234
) => {

src/scripts/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function useControlledValue<T>(value: T | undefined, defaultValue: T) {
1919
const [stateValue, setStateValue] = useState<T>(initValue);
2020
return [typeof value !== 'undefined' ? value : stateValue, setStateValue] as [
2121
T,
22-
typeof setStateValue
22+
typeof setStateValue,
2323
];
2424
}
2525

stories/ButtonGroup.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type StoryProps = ComponentProps<typeof ButtonGroup> & {
1616
/**
1717
*
1818
*/
19-
const darkBgDecorator = containerDecorator<StoryProps>({
19+
const darkBgDecorator = containerDecorator({
2020
backgroundColor: '#16325c',
2121
padding: 4,
2222
});

stories/Datepicker.stories.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ComponentProps, useCallback } from 'react';
1+
import React, { useCallback } from 'react';
22
import dayjs from 'dayjs';
33
import { Datepicker, Button } from '../src/scripts';
44
import { ComponentMeta, ComponentStoryObj } from '@storybook/react';
@@ -29,9 +29,7 @@ const TodayButtonExtensionRenderer = (props: {
2929
);
3030
};
3131

32-
const datepickerDecorator = containerDecorator<
33-
ComponentProps<typeof Datepicker>
34-
>({
32+
const datepickerDecorator = containerDecorator({
3533
padding: 8,
3634
width: 350,
3735
borderRadius: 4,

0 commit comments

Comments
 (0)