Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit c404b55

Browse files
committed
Update packages
All packages that could be updated without tests or the build failing were updated to the last versions. Updating eslint-plugin-react required a few fixes where code was violating the linting rules. Updating to the latest version of Storybook is not trivial. Currently @dump247/storybook-state is used, but this package does not work with the next major version of Storybook. This, in addition to some typing issues, is the biggest hurdle to upgrade to the latest version of Storybook.
1 parent 8f95780 commit c404b55

12 files changed

Lines changed: 7370 additions & 4743 deletions

File tree

.storybook/webpack.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ module.exports = {
1919
test: /\.tsx?$/,
2020
loaders: [
2121
'awesome-typescript-loader',
22-
// 'react-docgen-typescript-loader',
2322
],
24-
include: path.resolve(__dirname, '../src'),
25-
exclude: /node_modules/,
2623
},
2724
{
2825
test: /\.scss$/,

package-lock.json

Lines changed: 7286 additions & 4650 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -42,72 +42,71 @@
4242
"gettext-parser": "^3.1.0",
4343
"lodash.debounce": "^4.0.8",
4444
"node-gettext": "^2.0.0",
45-
"react": "^16.4.2",
4645
"react-alice-carousel": "^1.14.0",
4746
"react-avatar-editor": "^11.0.4",
4847
"react-date-picker": "6.13.0",
49-
"react-dom": "^16.4.2",
5048
"react-dropzone": "^8.1.0",
5149
"react-player": "^1.7.0",
5250
"react-router-dom": "^4.1.1",
5351
"react-spring": "7.2.0",
5452
"react-tag-autocomplete": "^5.8.0",
5553
"react-textarea-autosize": "^7.0.4",
56-
"uuid": "^3.3.3"
54+
"uuid": "^3.4.0"
5755
},
5856
"devDependencies": {
59-
"@babel/core": "^7.2.2",
60-
"@dump247/storybook-state": "^1.5.0",
57+
"@babel/core": "^7.8.4",
58+
"@dump247/storybook-state": "^1.6.1",
6159
"@sambego/storybook-styles": "^1.0.0",
62-
"@storybook/addon-actions": "^4.0.12",
63-
"@storybook/addon-info": "^4.1.11",
64-
"@storybook/addon-knobs": "^4.1.11",
65-
"@storybook/addon-viewport": "^4.1.11",
66-
"@storybook/addons": "^4.1.11",
67-
"@storybook/react": "^4.1.11",
60+
"@storybook/addon-actions": "^4.1.18",
61+
"@storybook/addon-info": "^4.1.18",
62+
"@storybook/addon-knobs": "^4.1.18",
63+
"@storybook/addon-viewport": "^4.1.18",
64+
"@storybook/addons": "^4.1.18",
65+
"@storybook/react": "^4.1.18",
6866
"@types/classnames": "^2.2.9",
69-
"@types/enzyme": "^3.10.3",
67+
"@types/enzyme": "^3.10.4",
7068
"@types/enzyme-adapter-react-16": "^1.0.5",
71-
"@types/history": "^4.7.0",
7269
"@types/jest": "^23.3.14",
7370
"@types/lodash.debounce": "^4.0.6",
74-
"@types/node": "^11.9.3",
71+
"@types/node": "^12.12.26",
7572
"@types/react-avatar-editor": "^10.3.5",
76-
"@types/react-dom": "^16.0.7",
73+
"@types/react-dom": "^16.9.5",
7774
"@types/react-router": "^4.0.30",
7875
"@types/react-router-dom": "^4.3.0",
79-
"@types/storybook__addon-actions": "^3.0.3",
80-
"@types/storybook__addon-links": "^3.3.1",
81-
"@types/storybook__react": "^4.0.0",
82-
"@types/uuid": "^3.4.6",
83-
"@typescript-eslint/parser": "^2.3.0",
76+
"@types/storybook__addon-actions": "^3.4.3",
77+
"@types/storybook__react": "^4.0.2",
78+
"@types/uuid": "^3.4.7",
79+
"@typescript-eslint/parser": "^2.19.0",
8480
"@ultimaker/eslint-config": "^1.1.1",
85-
"@ultimaker/stylelint-config": "^1.0.0",
81+
"@ultimaker/stylelint-config": "^1.1.3",
8682
"awesome-typescript-loader": "^5.2.1",
87-
"babel-loader": "^8.0.5",
88-
"copyfiles": "^2.1.0",
89-
"css-loader": "^3.2.0",
90-
"enzyme": "^3.10.0",
91-
"enzyme-adapter-react-16": "^1.15.1",
92-
"enzyme-to-json": "^3.3.4",
93-
"eslint": "^6.4.0",
83+
"babel-loader": "^8.0.6",
84+
"copyfiles": "^2.2.0",
85+
"css-loader": "^3.4.2",
86+
"enzyme": "^3.11.0",
87+
"enzyme-adapter-react-16": "^1.15.2",
88+
"enzyme-to-json": "^3.4.4",
89+
"eslint": "^6.8.0",
9490
"eslint-config-airbnb": "^18.0.1",
9591
"eslint-plugin-import": "^2.18.2",
9692
"eslint-plugin-jsx-a11y": "^6.2.3",
97-
"eslint-plugin-react": "^7.14.3",
93+
"eslint-plugin-react": "^7.18.3",
9894
"eslint-plugin-react-hooks": "^1.7.0",
99-
"file-loader": "^3.0.1",
95+
"file-loader": "^5.0.2",
10096
"gettext-extractor": "^3.4.0",
10197
"jest": "^24.9.0",
102-
"react-docgen-typescript-loader": "^3.0.1",
103-
"react-docgen-typescript-webpack-plugin": "^1.1.0",
104-
"rimraf": "^2.6.3",
105-
"sass": "^1.22.12",
106-
"sass-loader": "^7.0.3",
107-
"storybook-addon-jsx": "^7.0.0",
108-
"stylelint": "^11.0.0",
98+
"react": "^16.12.0",
99+
"react-dom": "^16.12.0",
100+
"rimraf": "^3.0.1",
101+
"sass": "^1.25.0",
102+
"sass-loader": "^8.0.2",
103+
"stylelint": "^13.0.0",
109104
"ts-jest": "^24.2.0",
110-
"typescript": "^3.7.2",
111-
"webpack": "4.29.3"
105+
"typescript": "^3.7.5",
106+
"webpack": "^4.41.5"
107+
},
108+
"peerDependencies": {
109+
"react": "^16.12.0",
110+
"react-dom": "^16.12.0"
112111
}
113112
}

src/components/context_menu.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ const triggerWidth = 45;
3434
const windowMargin = 12;
3535

3636
export class ContextMenu extends React.Component<ContextMenuProps, ContextMenuState> {
37-
public static defaultProps: Partial<ContextMenuProps> = {
38-
menuOffsetDirection: 'left',
39-
menuDirection: 'south',
40-
};
41-
4237
static _getMenuStyle(
4338
menuOffset: number,
4439
menuOffsetDirection: MenuOffsetDirection,
@@ -63,6 +58,11 @@ export class ContextMenu extends React.Component<ContextMenuProps, ContextMenuSt
6358

6459
private _menuRef;
6560

61+
public static defaultProps: Partial<ContextMenuProps> = {
62+
menuOffsetDirection: 'left',
63+
menuDirection: 'south',
64+
};
65+
6666
constructor(props: ContextMenuProps) {
6767
super(props);
6868
this.state = {

src/components/drop_down_menu_base.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ export interface DropDownMenuBaseProps {
2626
}
2727

2828
export class DropDownMenuBase extends React.Component<DropDownMenuBaseProps, {}> {
29-
public static defaultProps: Partial<DropDownMenuBaseProps> = {
30-
menuDirection: 'south',
31-
};
32-
3329
static _stopPropagation(e): void {
3430
e.stopPropagation();
3531
}
3632

3733
private _menuRef;
3834

35+
public static defaultProps: Partial<DropDownMenuBaseProps> = {
36+
menuDirection: 'south',
37+
};
38+
3939
constructor(props: DropDownMenuBaseProps) {
4040
super(props);
4141
this._menuRef = React.createRef();

src/components/image_cropper.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ export class ImageCropper extends React.Component<ImageCropperProps, ImageCroppe
5555
return parseFloat(size) * sizeScale - borderSize * 2;
5656
}
5757

58-
static defaultProps: ImageCropperProps = {
59-
shape: 'square',
60-
size: '200px',
61-
minScale: 0.5,
62-
maxScale: 2.5,
63-
scaleStep: 0.05,
64-
borderSize: 0,
65-
imageURL: null,
66-
onImageChanged: null,
67-
};
68-
6958
/**
7059
* Handles the image changed event. This is debounced because the image data
7160
* can be pretty large and change very often during zooming / scaling.
@@ -92,6 +81,17 @@ export class ImageCropper extends React.Component<ImageCropperProps, ImageCroppe
9281
}
9382
};
9483

84+
static defaultProps: ImageCropperProps = {
85+
shape: 'square',
86+
size: '200px',
87+
minScale: 0.5,
88+
maxScale: 2.5,
89+
scaleStep: 0.05,
90+
borderSize: 0,
91+
imageURL: null,
92+
onImageChanged: null,
93+
};
94+
9595
constructor(props) {
9696
super(props);
9797
this.state = {

src/components/input_field.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ export interface OldInputFieldProps extends InputFieldProps {
6161
* However this component is still available to be backwards compatible.
6262
*/
6363
export class InputField extends React.Component<OldInputFieldProps, {}> {
64-
static defaultProps = {
65-
type: 'text',
66-
labelLayoutWidth: '1/1',
67-
labelWidthBreakpoint: 'sm',
68-
staticField: false,
69-
};
70-
7164
private readonly inputFields = {
7265
number: NumberField,
7366
textarea: TextareaField,
@@ -86,6 +79,13 @@ export class InputField extends React.Component<OldInputFieldProps, {}> {
8679
search: SearchField,
8780
};
8881

82+
static defaultProps = {
83+
type: 'text',
84+
labelLayoutWidth: '1/1',
85+
labelWidthBreakpoint: 'sm',
86+
staticField: false,
87+
};
88+
8989
render() {
9090
const { children, ...wrapperProps } = this.props;
9191
const Component = this.inputFields[wrapperProps.type];

src/components/input_fields/code_field.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,18 @@ export interface CodeFieldState {
4242
* The code field is a text field that includes {maxLength} single-letter password inputs.
4343
*/
4444
export class CodeField extends React.Component<CodeFieldProps, CodeFieldState> {
45-
/**
46-
* if the user wrote one of the later characters but not earlier ones,
47-
* we add this character as filler
48-
*/
49-
private static readonly _emptyChar: string = '\t';
50-
5145
/**
5246
* References to the input fields to focus on them.
5347
* Note that we don't use React.CreateRef because that would require some extra code
5448
* for re-initializing the array whenever {maxLength} changes.
5549
*/
50+
private readonly _inputRefs: HTMLInputElement[] = [];
5651

57-
/** The default props */
5852
static defaultProps = {
5953
type: 'number',
6054
};
6155

62-
private readonly _inputRefs: HTMLInputElement[] = [];
63-
64-
constructor(props) {
56+
constructor(props: Readonly<CodeFieldProps>) {
6557
super(props);
6658

6759
this.state = {
@@ -110,6 +102,11 @@ export class CodeField extends React.Component<CodeFieldProps, CodeFieldState> {
110102
};
111103
}
112104

105+
/**
106+
* if the user wrote one of the later characters but not earlier ones,
107+
* we add this character as filler
108+
*/
109+
private static readonly _emptyChar: string = '\t';
113110

114111
/**
115112
* Handles changes to the text selection in the document.

src/components/search_bar/search_bar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ interface SearchBarState {
1616
}
1717

1818
class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
19-
static defaultProps = {
20-
emitDelay: 0,
21-
query: '',
22-
}
23-
2419
id = uuidv4();
2520

2621
debouncedEmit = (({ onChange, emitDelay }) => debounce(
2722
onChange, emitDelay,
2823
))(this.props);
2924

25+
static defaultProps = {
26+
emitDelay: 0,
27+
query: '',
28+
}
29+
3030
constructor(props: Readonly<SearchBarProps>) {
3131
super(props);
3232
const { query } = props;

src/components/tooltip.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ export interface TooltipState {
2222
const windowMargin = 10;
2323

2424
export class Tooltip extends React.Component<TooltipProps, TooltipState> {
25-
static defaultProps = {
26-
direction: 'north',
27-
};
28-
2925
private static _getElementDetails(el: any): any {
3026
// get global positions of a html element
3127
const element = el.getBoundingClientRect();
@@ -39,6 +35,10 @@ export class Tooltip extends React.Component<TooltipProps, TooltipState> {
3935

4036
private _tooltipRef;
4137

38+
static defaultProps = {
39+
direction: 'north',
40+
};
41+
4242
constructor(props) {
4343
super(props);
4444
this.state = {

0 commit comments

Comments
 (0)