Skip to content

[Breaking changes] Bump several major dependencies #2041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions application-templates/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@commercetools-uikit/spacings": "^11.2.0",
"@commercetools-uikit/text": "^11.2.0",
"prop-types": "15.7.2",
"react": "16.14.0",
"react-dom": "16.14.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-intl": "5.15.7",
"react-redux": "7.2.3",
"react-router-dom": "5.2.0",
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"private": true,
"scripts": {
"prepare": "husky install",
"postinstall": "manypkg check && preconstruct dev && yarn compile-css-modules && yarn --cwd website && yarn --cwd website-components-playground",
"postinstall": "manypkg check && preconstruct dev && yarn compile-css-modules",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

"auth": "npm_config_registry=https://registry.npmjs.org npm whoami",
"clean": "manypkg exec rm -rf build dist test-utils/dist experimental/dist task/dist add-commands/dist",
"extract-intl": "formatjs extract --format=$(pwd)/packages/i18n/transifex-transformer.js --out-file=$(pwd)/packages/i18n/data/core.json 'packages/**/*messages.ts'",
Expand Down Expand Up @@ -65,7 +65,9 @@
"packages-backend/*",
"application-templates/*",
"playground",
"visual-testing-app"
"visual-testing-app",
"website",
"website-components-playground"
]
},
"preconstruct": {
Expand Down Expand Up @@ -127,13 +129,12 @@
"@types/jquery": "3.5.5",
"@types/node": "14.14.37",
"@types/puppeteer": "5.4.3",
"@types/react": "16.14.5",
"@types/react-dom": "16.9.12",
"@types/react": "17.0.3",
"@types/react-dom": "17.0.2",
"@types/react-redux": "7.1.16",
"@types/react-router": "5.1.13",
"@types/react-router-dom": "5.1.7",
"@types/uuid": "8.3.0",
"@types/webpack": "5.28.0",
"@types/webpack-env": "1.16.0",
"apollo-server-errors": "2.4.2",
"autoprefixer": "10.2.5",
Expand Down Expand Up @@ -178,9 +179,10 @@
"vfile-message": "2.0.4"
},
"resolutions": {
"@types/react": "16.14.5",
"@types/react-router": "5.1.13",
"graphql": "14.7.0",
"@babel/core": "7.13.10",
"@types/react": "17.0.3",
"@types/react-router": "5.1.12",
"graphql": "15.5.0",
"pretty-format": "26.6.2",
"intl-messageformat-parser": "6.4.4",
"**/intl-messageformat-parser": "6.4.4",
Expand Down
8 changes: 4 additions & 4 deletions packages/actions-global/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
"redux-thunk": "2.3.0"
},
"devDependencies": {
"@types/react": "16.14.5",
"@types/react": "17.0.3",
"@types/react-redux": "7.1.16",
"react": "16.14.0",
"react": "17.0.2",
"react-redux": "7.2.3",
"redux": "4.0.5"
},
"peerDependencies": {
"@types/react": "16.x",
"@types/react": "17.x",
"@types/react-redux": "7.x",
"react": ">=16.8.0",
"react": ">=17.0.0",
"react-redux": "7.x",
"redux": "4.x"
}
Expand Down
16 changes: 8 additions & 8 deletions packages/application-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@
},
"devDependencies": {
"@commercetools-frontend/ui-kit": "11.3.0",
"@types/react": "16.14.5",
"@types/react-dom": "16.9.12",
"react": "16.14.0",
"react-dom": "16.14.0",
"@types/react": "17.0.3",
"@types/react-dom": "17.0.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-intl": "5.15.7"
},
"peerDependencies": {
"@commercetools-frontend/ui-kit": "11.x",
"@types/react": "16.x",
"@types/react-dom": "16.x",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
"@types/react": "17.x",
"@types/react-dom": "17.x",
"react": ">=17.0.0",
"react-dom": ">=17.0.0",
"react-intl": "3.x || 4.x || 5.x"
}
}
10 changes: 5 additions & 5 deletions packages/application-shell-connectors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@
"@emotion/react": "11.1.5",
"@types/lodash": "^4.14.167",
"@types/prop-types": "^15.7.3",
"graphql": "14.7.0",
"graphql": "15.5.0",
"lodash": "4.17.21",
"moment-timezone": "^0.5.32",
"prop-types": "15.7.2"
},
"devDependencies": {
"@apollo/client": "3.3.13",
"@testing-library/react": "11.2.6",
"@types/react": "16.14.5",
"react": "16.14.0"
"@types/react": "17.0.3",
"react": "17.0.2"
},
"peerDependencies": {
"@apollo/client": "3.x",
"@types/react": "16.x",
"react": ">=16.8.0"
"@types/react": "17.x",
"react": ">=17.0.0"
},
"engines": {
"node": ">=8",
Expand Down
18 changes: 9 additions & 9 deletions packages/application-shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"debounce-async": "0.0.2",
"downshift": "6.1.2",
"fuse.js": "6.4.6",
"graphql": "14.7.0",
"graphql": "15.5.0",
"history": "4.10.1",
"is-retina": "1.0.3",
"jwt-decode": "3.1.2",
Expand All @@ -97,14 +97,14 @@
"@commercetools-frontend/ui-kit": "11.3.0",
"@testing-library/react": "11.2.6",
"@types/prop-types": "^15.7.3",
"@types/react": "16.14.5",
"@types/react-dom": "16.9.12",
"@types/react": "17.0.3",
"@types/react-dom": "17.0.2",
"@types/react-redux": "7.1.16",
"@types/react-router": "5.1.13",
"@types/react-router-dom": "5.1.7",
"msw": "0.28.1",
"react": "16.14.0",
"react-dom": "16.14.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-intl": "5.15.7",
"react-redux": "7.2.3",
"react-router-dom": "5.2.0",
Expand All @@ -116,13 +116,13 @@
"@commercetools-frontend/ui-kit": "11.x",
"@testing-library/react": "9.x || 10.x || 11.x",
"@types/prop-types": "15.x",
"@types/react": "16.x",
"@types/react-dom": "16.x",
"@types/react": "17.x",
"@types/react-dom": "17.x",
"@types/react-redux": "7.x",
"@types/react-router": "5.x",
"@types/react-router-dom": "5.x",
"react": ">=16.8.0",
"react-dom": ">=16.8.0",
"react": ">=17.0.0",
"react-dom": ">=17.0.0",
"react-intl": "3.x || 4.x || 5.x",
"react-redux": "7.x",
"react-router-dom": "5.x",
Expand Down
8 changes: 4 additions & 4 deletions packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
"prop-types": "15.7.2"
},
"devDependencies": {
"@types/react": "16.14.5",
"@types/react": "17.0.3",
"intl-messageformat-parser": "6.4.4",
"react": "16.14.0",
"react": "17.0.2",
"react-intl": "5.15.7"
},
"peerDependencies": {
"@types/react": "16.x",
"react": ">=16.8.0",
"@types/react": "17.x",
"react": ">=17.0.0",
"react-intl": "3.x || 4.x || 5.x"
}
}
8 changes: 4 additions & 4 deletions packages/l10n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@
},
"devDependencies": {
"@testing-library/react-hooks": "5.1.1",
"@types/react": "16.14.5",
"@types/react": "17.0.3",
"chalk": "4.1.0",
"cldr": "6.0.0",
"deep-diff": "1.0.2",
"moment-timezone": "^0.5.32",
"node-fetch": "2.6.1",
"react": "16.14.0",
"react": "17.0.2",
"rimraf": "3.0.2",
"shelljs": "0.8.4"
},
"peerDependencies": {
"@types/react": "16.x",
"react": ">=16.8.0"
"@types/react": "17.x",
"react": ">=17.0.0"
}
}
3 changes: 1 addition & 2 deletions packages/mc-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"autoprefixer": "10.2.5",
"babel-loader": "8.2.2",
"browserslist": "4.16.3",
"clean-webpack-plugin": "3.0.0",
"core-js": "3.10.0",
"css-loader": "5.2.0",
"cssnano": "4.1.10",
Expand Down Expand Up @@ -74,7 +73,7 @@
"webpack": "5.28.0",
"webpack-bundle-analyzer": "4.4.0",
"webpack-dev-server": "4.0.0-beta.1",
"webpackbar": "4.0.0"
"webpackbar": "5.0.0-3"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "7.13.10",
Expand Down
4 changes: 3 additions & 1 deletion packages/mc-scripts/src/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ const fs = require('fs-extra');
const webpack = require('webpack');
const chalk = require('react-dev-utils/chalk');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
// FIXME: reuse normal import after CRA supports Webpack v5.
// const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError');
const formatWebpackMessages = require('./patches/react-dev-utils/formatWebpackMessages');
const paths = require('./config/paths');
const createWebpackConfigForProduction = require('./config/create-webpack-config-for-production');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const safeParser = require('postcss-safe-parser');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
// const { CleanWebpackPlugin } = require('clean-webpack-plugin');
// as "aliasing v1.0.0 as webpack.optimize.UglifyJsPlugin is scheduled for
// webpack v4.0.0" (https://webpack.js.org/plugins/uglifyjs-webpack-plugin/)
// we need to explicitly use the library to be using the newest version
Expand Down Expand Up @@ -187,11 +187,11 @@ module.exports = function createWebpackConfigForProduction(options = {}) {
},

plugins: [
new CleanWebpackPlugin({
dangerouslyAllowCleanPatternsOutsideProject: true,
dry: true,
cleanOnceBeforeBuildPatterns: [mergedOptions.distPath],
}),
// new CleanWebpackPlugin({
// dangerouslyAllowCleanPatternsOutsideProject: true,
// dry: true,
// cleanOnceBeforeBuildPatterns: [mergedOptions.distPath],
// }),
// Allows to "assign" custom options to the `webpack` object.
// At the moment, this is used to share some props with `postcss.config`.
new webpack.LoaderOptionsPlugin({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

const friendlySyntaxErrorLabel = 'Syntax error:';

function isLikelyASyntaxError(message) {
return message.indexOf(friendlySyntaxErrorLabel) !== -1;
}

// Cleans up webpack error messages.
function formatMessage(message) {
let lines = message.split('\n');

// Strip webpack-added headers off errors/warnings
// https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
lines = lines.filter((line) => !/Module [A-z ]+\(from/.test(line));

// Transform parsing error into syntax error
// TODO: move this to our ESLint formatter?
lines = lines.map((line) => {
const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(
line
);
if (!parsingError) {
return line;
}
const [, errorLine, errorColumn, errorMessage] = parsingError;
return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;
});

message = lines.join('\n');
// Smoosh syntax errors (commonly found in CSS)
message = message.replace(
/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g,
`${friendlySyntaxErrorLabel} $3 ($1:$2)\n`
);
// Clean up export errors
message = message.replace(
/^.*export '(.+?)' was not found in '(.+?)'.*$/gm,
`Attempted import error: '$1' is not exported from '$2'.`
);
message = message.replace(
/^.*export 'default' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
`Attempted import error: '$2' does not contain a default export (imported as '$1').`
);
message = message.replace(
/^.*export '(.+?)' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
`Attempted import error: '$1' is not exported from '$3' (imported as '$2').`
);
lines = message.split('\n');

// Remove leading newline
if (lines.length > 2 && lines[1].trim() === '') {
lines.splice(1, 1);
}
// Clean up file name
lines[0] = lines[0].replace(/^(.*) \d+:\d+-\d+$/, '$1');

// Cleans up verbose "module not found" messages for files and packages.
if (lines[1] && lines[1].indexOf('Module not found: ') === 0) {
lines = [
lines[0],
lines[1]
.replace('Error: ', '')
.replace('Module not found: Cannot find file:', 'Cannot find file:'),
];
}

// Add helpful message for users trying to use Sass for the first time
if (lines[1] && lines[1].match(/Cannot find module.+node-sass/)) {
lines[1] = 'To import Sass files, you first need to install node-sass.\n';
lines[1] +=
'Run `npm install node-sass` or `yarn add node-sass` inside your workspace.';
}

message = lines.join('\n');
// Internal stacks are generally useless so we strip them... with the
// exception of stacks containing `webpack:` because they're normally
// from user code generated by webpack. For more information see
// https://github.com/facebook/create-react-app/pull/1050
message = message.replace(
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm,
''
); // at ... ...:x:y
message = message.replace(/^\s*at\s<anonymous>(\n|$)/gm, ''); // at <anonymous>
lines = message.split('\n');

// Remove duplicated newlines
lines = lines.filter(
(line, index, arr) =>
index === 0 || line.trim() !== '' || line.trim() !== arr[index - 1].trim()
);

// Reassemble the message
message = lines.join('\n');
return message.trim();
}

function formatWebpackMessages(json) {
const formattedErrors = json.errors.map(formatMessage);
const formattedWarnings = json.warnings.map(formatMessage);
const result = { errors: formattedErrors, warnings: formattedWarnings };
if (result.errors.some(isLikelyASyntaxError)) {
// If there are any syntax errors, show just them.
result.errors = result.errors.filter(isLikelyASyntaxError);
}
return result;

This comment was marked as outdated.

}

module.exports = formatWebpackMessages;
Loading