Skip to content

Commit 7f5ee04

Browse files
committed
Remove a hilarious number of unused dependencies
1 parent 732594a commit 7f5ee04

File tree

11 files changed

+76
-1676
lines changed

11 files changed

+76
-1676
lines changed

package.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"ayu-ace": "^2.0.4",
1010
"brace": "^0.11.1",
1111
"chart.js": "^2.8.0",
12-
"classnames": "^2.2.6",
1312
"date-fns": "^2.14.0",
1413
"easy-peasy": "^3.3.1",
1514
"events": "^3.0.0",
@@ -33,7 +32,6 @@
3332
"sockette": "^2.0.6",
3433
"styled-components": "^5.1.1",
3534
"styled-components-breakpoint": "^3.0.0-preview.20",
36-
"use-react-router": "^1.0.7",
3735
"uuid": "^3.3.2",
3836
"xterm": "^3.14.4",
3937
"xterm-addon-attach": "^0.1.0",
@@ -54,7 +52,6 @@
5452
"@babel/preset-typescript": "^7.7.4",
5553
"@babel/runtime": "^7.7.5",
5654
"@types/chart.js": "^2.8.5",
57-
"@types/classnames": "^2.2.8",
5855
"@types/events": "^3.0.0",
5956
"@types/feather-icons": "^4.7.0",
6057
"@types/lodash": "^4.14.119",
@@ -75,10 +72,8 @@
7572
"@typescript-eslint/parser": "^3.5.0",
7673
"babel-loader": "^8.0.6",
7774
"babel-plugin-styled-components": "^1.10.7",
78-
"babel-plugin-tailwind-components": "^0.5.10",
7975
"cross-env": "^7.0.2",
8076
"css-loader": "^3.2.1",
81-
"cssnano": "^4.1.10",
8277
"eslint": "^7.4.0",
8378
"eslint-config-standard": "^14.1.1",
8479
"eslint-plugin-import": "^2.22.0",
@@ -88,20 +83,11 @@
8883
"eslint-plugin-react-hooks": "^4.0.5",
8984
"eslint-plugin-standard": "^4.0.1",
9085
"fork-ts-checker-webpack-plugin": "^5.0.6",
91-
"html-webpack-plugin": "^3.2.0",
92-
"postcss": "^7.0.24",
93-
"postcss-import": "^12.0.1",
94-
"postcss-loader": "^3.0.0",
95-
"postcss-preset-env": "^6.7.0",
96-
"precss": "^4.0.0",
9786
"redux-devtools-extension": "^2.13.8",
98-
"resolve-url-loader": "^3.0.0",
99-
"source-map-loader": "^1.0.1",
10087
"style-loader": "^1.2.1",
10188
"svg-url-loader": "^6.0.0",
10289
"tailwindcss": "^1.4.6",
10390
"terser-webpack-plugin": "^3.0.6",
104-
"ts-loader": "^6.2.1",
10591
"twin.macro": "^1.4.1",
10692
"typescript": "^3.9.6",
10793
"typescript-plugin-tw-template": "^2.0.1",
@@ -110,7 +96,6 @@
11096
"webpack-bundle-analyzer": "^3.8.0",
11197
"webpack-cli": "^3.3.12",
11298
"webpack-dev-server": "^3.11.0",
113-
"webpack-manifest-plugin": "^2.2.0",
11499
"yarn-deduplicate": "^1.1.1"
115100
},
116101
"scripts": {

resources/scripts/components/auth/LoginCheckpointContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface Values {
1717
recoveryCode: '',
1818
}
1919

20-
type OwnProps = RouteComponentProps<Record<string, unknown>, StaticContext, { token?: string }>
20+
type OwnProps = RouteComponentProps<Record<string, string | undefined>, StaticContext, { token?: string }>
2121

2222
type Props = OwnProps & {
2323
addError: ActionCreator<FlashStore['addError']['payload']>;

resources/scripts/components/auth/ResetPasswordContainer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export default ({ match, location }: RouteComponentProps<{ token: string }>) =>
5656
.min(8, 'Your new password should be at least 8 characters in length.'),
5757
passwordConfirmation: string()
5858
.required('Your new password does not match.')
59+
// @ts-ignore
5960
.oneOf([ ref('password'), null ], 'Your new password does not match.'),
6061
})}
6162
>
@@ -66,7 +67,7 @@ export default ({ match, location }: RouteComponentProps<{ token: string }>) =>
6667
>
6768
<div>
6869
<label>Email</label>
69-
<Input value={email} light disabled/>
70+
<Input value={email} isLight disabled/>
7071
</div>
7172
<div css={tw`mt-6`}>
7273
<Field

resources/scripts/components/elements/FormikFieldWrapper.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import { Field, FieldProps } from 'formik';
3-
import classNames from 'classnames';
43
import InputError from '@/components/elements/InputError';
54
import Label from '@/components/elements/Label';
65

@@ -18,7 +17,7 @@ const FormikFieldWrapper = ({ id, name, label, className, description, validate,
1817
<Field name={name} validate={validate}>
1918
{
2019
({ field, form: { errors, touched } }: FieldProps) => (
21-
<div className={classNames(className, { 'has-error': touched[field.name] && errors[field.name] })}>
20+
<div className={`${className} ${(touched[field.name] && errors[field.name]) ? 'has-error' : undefined}`}>
2221
{label && <Label htmlFor={id}>{label}</Label>}
2322
{children}
2423
<InputError errors={errors} touched={touched} name={field.name}>

resources/scripts/components/screens/ScreenBlock.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import React from 'react';
22
import PageContentBlock from '@/components/elements/PageContentBlock';
33
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
44
import { faArrowLeft, faSyncAlt } from '@fortawesome/free-solid-svg-icons';
5-
import classNames from 'classnames';
65
import styled, { keyframes } from 'styled-components/macro';
76
import tw from 'twin.macro';
7+
import Button from '@/components/elements/Button';
88

99
interface BaseProps {
1010
title: string;
@@ -30,7 +30,7 @@ const spin = keyframes`
3030
to { transform: rotate(360deg) }
3131
`;
3232

33-
const ActionButton = styled.button`
33+
const ActionButton = styled(Button)`
3434
${tw`rounded-full w-8 h-8 flex items-center justify-center`};
3535
3636
&.hover\\:spin:hover {
@@ -46,7 +46,7 @@ export default ({ title, image, message, onBack, onRetry }: Props) => (
4646
<div css={tw`absolute left-0 top-0 ml-4 mt-4`}>
4747
<ActionButton
4848
onClick={() => onRetry ? onRetry() : (onBack ? onBack() : null)}
49-
className={classNames('btn btn-primary', { 'hover:spin': !!onRetry })}
49+
className={onRetry ? 'hover:spin' : undefined}
5050
>
5151
<FontAwesomeIcon icon={onRetry ? faSyncAlt : faArrowLeft}/>
5252
</ActionButton>

resources/scripts/components/server/ServerConsole.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { lazy, useEffect, useState } from 'react';
22
import { ServerContext } from '@/state/server';
33
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
44
import { faCircle, faHdd, faMemory, faMicrochip, faServer } from '@fortawesome/free-solid-svg-icons';
5-
import classNames from 'classnames';
65
import { bytesToHuman } from '@/helpers';
76
import SuspenseSpinner from '@/components/elements/SuspenseSpinner';
87
import TitledGreyBox from '@/components/elements/TitledGreyBox';
@@ -68,11 +67,10 @@ export default () => {
6867
<FontAwesomeIcon
6968
icon={faCircle}
7069
fixedWidth
71-
className={classNames('mr-1', {
72-
'text-red-500': status === 'offline',
73-
'text-yellow-500': [ 'running', 'offline' ].indexOf(status) < 0,
74-
'text-green-500': status === 'running',
75-
})}
70+
css={[
71+
tw`mr-1`,
72+
status === 'offline' ? tw`text-red-500` : (status === 'running' ? tw`text-green-500` : tw`text-yellow-500`),
73+
]}
7674
/>
7775
&nbsp;{status}
7876
</p>

resources/scripts/components/server/files/FileEditContainer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import React, { lazy, useEffect, useState } from 'react';
22
import { ServerContext } from '@/state/server';
33
import getFileContents from '@/api/server/files/getFileContents';
4-
import useRouter from 'use-react-router';
54
import { Actions, useStoreActions } from 'easy-peasy';
65
import { ApplicationStore } from '@/state';
76
import { httpErrorToHuman } from '@/api/http';
87
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
98
import saveFileContents from '@/api/server/files/saveFileContents';
109
import FileManagerBreadcrumbs from '@/components/server/files/FileManagerBreadcrumbs';
11-
import { useParams } from 'react-router';
10+
import { useHistory, useLocation, useParams } from 'react-router';
1211
import FileNameModal from '@/components/server/files/FileNameModal';
1312
import Can from '@/components/elements/Can';
1413
import FlashMessageRender from '@/components/FlashMessageRender';
@@ -22,11 +21,13 @@ const LazyAceEditor = lazy(() => import(/* webpackChunkName: "editor" */'@/compo
2221
export default () => {
2322
const [ error, setError ] = useState('');
2423
const { action } = useParams();
25-
const { history, location: { hash } } = useRouter();
2624
const [ loading, setLoading ] = useState(action === 'edit');
2725
const [ content, setContent ] = useState('');
2826
const [ modalVisible, setModalVisible ] = useState(false);
2927

28+
const history = useHistory();
29+
const { hash } = useLocation();
30+
3031
const { id, uuid } = ServerContext.useStoreState(state => state.server.data!);
3132
const { addError, clearFlashes } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);
3233

resources/scripts/components/server/files/FileObjectRow.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import React from 'react';
66
import { FileObject } from '@/api/server/files/loadDirectory';
77
import FileDropdownMenu from '@/components/server/files/FileDropdownMenu';
88
import { ServerContext } from '@/state/server';
9-
import { NavLink } from 'react-router-dom';
10-
import useRouter from 'use-react-router';
9+
import { NavLink, useHistory, useRouteMatch } from 'react-router-dom';
1110
import tw from 'twin.macro';
1211

1312
export default ({ file }: { file: FileObject }) => {
1413
const directory = ServerContext.useStoreState(state => state.files.directory);
1514
const setDirectory = ServerContext.useStoreActions(actions => actions.files.setDirectory);
16-
const { match, history } = useRouter();
15+
16+
const history = useHistory();
17+
const match = useRouteMatch();
1718

1819
return (
1920
<div

resources/scripts/components/server/users/EditSubuserModal.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { ApplicationStore } from '@/state';
99
import TitledGreyBox from '@/components/elements/TitledGreyBox';
1010
import Checkbox from '@/components/elements/Checkbox';
1111
import styled from 'styled-components/macro';
12-
import classNames from 'classnames';
1312
import createOrUpdateSubuser from '@/api/server/users/createOrUpdateSubuser';
1413
import { ServerContext } from '@/state/server';
1514
import { httpErrorToHuman } from '@/api/http';
@@ -145,10 +144,11 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
145144
<PermissionLabel
146145
key={`permission_${key}_${pkey}`}
147146
htmlFor={`permission_${key}_${pkey}`}
148-
className={classNames('transition-colors duration-75', {
149-
'mt-2': index !== 0,
150-
disabled: !canEditUser || editablePermissions.indexOf(`${key}.${pkey}`) < 0,
151-
})}
147+
css={[
148+
tw`transition-colors duration-75`,
149+
index > 0 ? tw`mt-2` : undefined,
150+
]}
151+
className={(!canEditUser || editablePermissions.indexOf(`${key}.${pkey}`) < 0) ? 'disabled' : undefined}
152152
>
153153
<div css={tw`p-2`}>
154154
<Checkbox

resources/scripts/components/server/users/UserRow.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
44
import { faPencilAlt, faUnlockAlt, faUserLock } from '@fortawesome/free-solid-svg-icons';
55
import RemoveSubuserButton from '@/components/server/users/RemoveSubuserButton';
66
import EditSubuserModal from '@/components/server/users/EditSubuserModal';
7-
import classNames from 'classnames';
87
import Can from '@/components/elements/Can';
98
import { useStoreState } from 'easy-peasy';
109
import tw from 'twin.macro';
@@ -39,9 +38,8 @@ export default ({ subuser }: Props) => {
3938
&nbsp;
4039
<FontAwesomeIcon
4140
icon={subuser.twoFactorEnabled ? faUserLock : faUnlockAlt}
42-
className={classNames('fa-fw', {
43-
'text-red-400': !subuser.twoFactorEnabled,
44-
})}
41+
fixedWidth
42+
css={!subuser.twoFactorEnabled ? tw`text-red-400` : undefined}
4543
/>
4644
&nbsp;
4745
</p>
@@ -56,9 +54,10 @@ export default ({ subuser }: Props) => {
5654
<button
5755
type={'button'}
5856
aria-label={'Edit subuser'}
59-
className={classNames('block text-sm p-2 text-neutral-500 hover:text-neutral-100 transition-colors duration-150 mx-4', {
60-
hidden: subuser.uuid === uuid,
61-
})}
57+
css={[
58+
tw`block text-sm p-2 text-neutral-500 hover:text-neutral-100 transition-colors duration-150 mx-4`,
59+
subuser.uuid === uuid ? tw`hidden` : undefined,
60+
]}
6261
onClick={() => setVisible(true)}
6362
>
6463
<FontAwesomeIcon icon={faPencilAlt}/>

0 commit comments

Comments
 (0)