Skip to content

Commit

Permalink
Update frontend and site dependencies (#4126)
Browse files Browse the repository at this point in the history
Modifications:

- Updated most frontend and site dependencies to their latest versions,
  except those that need non-trivial migration:
  - MUI
  - Gatsby (Updated from v2 to v3, but not to v4)
- Fixed all newly reported ESLint violations, except those that don't
  make much sense.
  - Updated the `eslintrc.js` accordingly.
- Merged `steps.module.less` into `antd-overrides.less` because it
  doesn't contain any component-specific styles.
- Worked around the problem where the CSS class names of Table of
  Contents contain a plus (+) sign, preventing `tocbot` from working
  correctly.
- Updated `gatsby-remark-draw-patched.js` so it embeds the SVG images
  rather than writing to external files, because Gatsby doesn't handle
  them correcly anymore.
- Forked the SVGBob rendering code from `skyrta` because `svgbob` command
  has been renamed to `svgbob_cli` some time ago.
- Disabled `license-webpack-plugin` on Windows due to a known issue.

Result:

- 0 vulnerability in `docs-client`
- Less vulnerabilities in `site`
- A contributor can build `site` from macOS on aarch64 (M1)
  • Loading branch information
trustin authored Mar 7, 2022
1 parent 1ce508f commit b7d3c1d
Show file tree
Hide file tree
Showing 48 changed files with 43,175 additions and 34,878 deletions.
16,424 changes: 2,802 additions & 13,622 deletions docs-client/package-lock.json

Large diffs are not rendered by default.

93 changes: 46 additions & 47 deletions docs-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,65 +12,64 @@
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.11.3-deprecations.1",
"core-js": "^3.12.1",
"dayjs": "^1.10.4",
"core-js": "^3.21.1",
"dayjs": "^1.10.7",
"json-bigint": "^1.0.0",
"jsonminify": "^0.4.1",
"jsonminify": "^0.4.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-hot-loader": "^4.13.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-syntax-highlighter": "^15.4.3",
"regenerator-runtime": "^0.13.8"
"react-router": "^5.2.1",
"react-router-dom": "^5.3.0",
"react-syntax-highlighter": "^15.4.5",
"regenerator-runtime": "^0.13.9"
},
"devDependencies": {
"@babel/core": "^7.14.2",
"@babel/preset-env": "^7.14.2",
"@babel/preset-react": "^7.13.13",
"@babel/core": "^7.17.5",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@types/favicons-webpack-plugin": "^1.0.0",
"@types/html-webpack-plugin": "^3.2.5",
"@types/json-bigint": "^1.0.0",
"@types/html-webpack-plugin": "^3.2.6",
"@types/json-bigint": "^1.0.1",
"@types/jsonminify": "^0.4.1",
"@types/material-ui": "^0.21.8",
"@types/node": "^14.14.37",
"@types/react": "^17.0.5",
"@types/react-dom": "^17.0.5",
"@types/react-helmet": "^6.1.1",
"@types/react-router-dom": "^5.1.7",
"@types/react-syntax-highlighter": "^13.5.0",
"@types/webpack": "^4.41.27",
"@types/webpack-dev-server": "^3.11.4",
"@typescript-eslint/eslint-plugin": "^4.23.0",
"@typescript-eslint/parser": "^4.23.0",
"babel-loader": "^8.2.2",
"@types/material-ui": "^0.21.12",
"@types/node": "^17.0.21",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@types/react-helmet": "^6.1.5",
"@types/react-router-dom": "^5.3.3",
"@types/react-syntax-highlighter": "^13.5.2",
"@types/webpack": "^5.28.0",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"babel-loader": "^8.2.3",
"cross-env": "^7.0.3",
"css-loader": "^5.2.0",
"eslint": "^7.23.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-prettier": "^7.2.0",
"css-loader": "^6.6.0",
"eslint": "^8.10.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.4.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4.2.0",
"favicons-webpack-plugin": "^4.2.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.2",
"eslint-plugin-react-hooks": "^4.3.0",
"favicons-webpack-plugin": "^5.0.2",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^4.5.2",
"license-webpack-plugin": "^2.3.18",
"prettier": "^2.2.1",
"html-webpack-plugin": "^5.5.0",
"license-webpack-plugin": "^4.0.2",
"prettier": "^2.5.1",
"sharp": "^0.30.1",
"style-loader": "^2.0.0",
"ts-loader": "^8.1.0",
"ts-node": "^9.1.1",
"tsconfig-paths": "^3.9.0",
"typescript": "^4.2.3",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.2"
"style-loader": "^3.3.1",
"ts-loader": "^9.2.6",
"ts-node": "^10.5.0",
"tsconfig-paths": "^3.12.0",
"typescript": "^4.5.5",
"webpack": "^5.69.1",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
}
}
1 change: 1 addition & 0 deletions docs-client/src/components/VariableList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ const FieldInfos: React.FunctionComponent<FieldInfosProps> = (props) => {
colSpanLength += 1;
}
return (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{!isEmpty ? (
props.variables.map((variable, index) => (
Expand Down
34 changes: 15 additions & 19 deletions docs-client/src/containers/MethodPage/DebugPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const toggle = (prev: boolean, override: unknown) => {
}
return !prev;
};
const escapeSingleQuote = (text: string) => text.replace(/'/g, `'\\''`);
const escapeSingleQuote = (text: string) => text.replace(/'/g, "'\\''");

const DebugPage: React.FunctionComponent<Props> = ({
exactPathMapping,
Expand Down Expand Up @@ -544,16 +544,14 @@ const DebugPage: React.FunctionComponent<Props> = ({
onSelectedPathChange={onSelectedPathChange}
/>
{isAnnotatedService && (
<>
<HttpQueryString
exampleQueries={exampleQueries}
additionalQueriesOpen={additionalQueriesOpen}
additionalQueries={additionalQueries}
onEditHttpQueriesClick={toggleAdditionalQueriesOpen}
onQueriesFormChange={onQueriesFormChange}
onSelectedQueriesChange={onSelectedQueriesChange}
/>
</>
<HttpQueryString
exampleQueries={exampleQueries}
additionalQueriesOpen={additionalQueriesOpen}
additionalQueries={additionalQueries}
onEditHttpQueriesClick={toggleAdditionalQueriesOpen}
onQueriesFormChange={onQueriesFormChange}
onSelectedQueriesChange={onSelectedQueriesChange}
/>
)}
<HttpHeaders
exampleHeaders={exampleHeaders}
Expand All @@ -566,14 +564,12 @@ const DebugPage: React.FunctionComponent<Props> = ({
onStickyHeadersChange={toggleStickyHeaders}
/>
{useRequestBody && (
<>
<RequestBody
requestBodyOpen={requestBodyOpen}
requestBody={requestBody}
onEditRequestBodyClick={toggleRequestBodyOpen}
onDebugFormChange={onDebugFormChange}
/>
</>
<RequestBody
requestBodyOpen={requestBodyOpen}
requestBody={requestBody}
onEditRequestBodyClick={toggleRequestBodyOpen}
onDebugFormChange={onDebugFormChange}
/>
)}
<Typography variant="body2" paragraph />
<Button variant="contained" color="primary" onClick={onSubmit}>
Expand Down
1 change: 1 addition & 0 deletions docs-client/src/containers/MethodPage/EndpointPath.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const EndpointPath: React.FunctionComponent<Props> = (props) => (
</Button>
<Typography variant="body2" paragraph />
{props.endpointPathOpen && (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>
{props.isAnnotatedService ? (
<>
Expand Down
2 changes: 1 addition & 1 deletion docs-client/src/lib/transports/annotated-http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class AnnotatedHttpTransport extends Transport {
const regexPathPrefix = endpoint.regexPathPrefix;
const originalPath = endpoint.pathMapping;

if (originalPath.startsWith(`exact:`)) {
if (originalPath.startsWith('exact:')) {
const exact = originalPath.substring('exact:'.length);
if (path !== exact) {
return {
Expand Down
67 changes: 42 additions & 25 deletions docs-client/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ import FaviconsWebpackPlugin from 'favicons-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { LicenseWebpackPlugin } from 'license-webpack-plugin';
import { Configuration, DefinePlugin } from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
declare module 'webpack' {
interface Configuration {
devServer?: WebpackDevServer.Configuration;
}
}

import { docServiceDebug } from './src/lib/header-provider';

const armeriaPort = process.env.ARMERIA_PORT || '8080';

const isDev = !!process.env.WEBPACK_DEV;
const isWindows = process.platform === 'win32';

const config: Configuration = {
mode: isDev ? 'development' : 'production',
Expand Down Expand Up @@ -76,34 +83,11 @@ const config: Configuration = {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
mainFields: ['browser', 'module', 'jsnext:main', 'main'],
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
hash: true,
}),
new FaviconsWebpackPlugin({
logo: './src/images/logo.png',
// We don't need the many different icon versions of webapp mode and use light mode
// to keep JAR size down.
mode: 'light',
devMode: 'light',
}),
new LicenseWebpackPlugin({
stats: {
warnings: true,
errors: true,
},
outputFilename: '../../../licenses/web-licenses.txt',
}) as any,
new DefinePlugin({
'process.env.WEBPACK_DEV': JSON.stringify(process.env.WEBPACK_DEV),
}),
],
plugins: [],
devServer: {
historyApiFallback: true,
hot: true,
open: true,
openPage: 'docs/',
open: 'docs/',
port: 3000,
proxy: [
{
Expand All @@ -117,7 +101,40 @@ const config: Configuration = {
changeOrigin: true,
},
],
client: {
overlay: {
warnings: false,
errors: true,
},
},
},
};

// Configure plugins.
const plugins = config.plugins as any[];
plugins.push(new HtmlWebpackPlugin({
template: './src/index.html',
hash: true,
}));
plugins.push(new FaviconsWebpackPlugin({
logo: './src/images/logo.png',
// We don't need the many different icon versions of webapp mode and use light mode
// to keep JAR size down.
mode: 'light',
devMode: 'light',
}));
// Do not add LicenseWebpackPlugin on Windows, because otherwise it will fail with a known issue.
if (!isWindows) {
plugins.push(new LicenseWebpackPlugin({
stats: {
warnings: true,
errors: true,
},
outputFilename: '../../../licenses/web-licenses.txt',
}) as any);
}
plugins.push(new DefinePlugin({
'process.env.WEBPACK_DEV': JSON.stringify(process.env.WEBPACK_DEV),
}));

export default config;
72 changes: 0 additions & 72 deletions licenses/web-licenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1048,75 +1048,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

tiny-warning
MIT
MIT License

Copyright (c) 2019 Alexander Reardon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

value-equal
MIT
MIT License

Copyright (c) Michael Jackson 2016-2018

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


webpack
MIT
Copyright JS Foundation and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit b7d3c1d

Please sign in to comment.