Update dependencies (non-breaking)

This change uses the best-effort approach to update dependencies.
Changelogs of each dependency have been manually reviewed and all
dependency that doesn't *actually* have BREAKING changes or have
minimal changes are bumped to their latest versions.

In most cases, the maintainers of those dependencies don't actually
understand semvar and inappropriately bumped major version for trivial,
non-breaking changes. In other cases, the minimum supported Node version
is upgraded, which is indeed breaking but that's not a concern for this
project as a recent Node version is always expected. Or, the dependency
does have certain breaking changes but those changes are not relevant to
functions used by this project.

Also bumped versions of dependencies if only minimal changes are required:

* autoprefixer: transform from "browsers" property to browserslist
* prettier: reformated sources after update

Signed-off-by: Jesse Chan <jc@linux.com>
This commit is contained in:
Jesse Chan
2020-08-03 22:20:19 +08:00
parent e4825da8f3
commit 4ea381049a
136 changed files with 3605 additions and 2206 deletions
+6 -8
View File
@@ -4,11 +4,9 @@ const glob = require('glob');
const path = require('path');
const prettier = require('prettier');
const SOURCE_PATTERN = `{client,scripts,server,shared}${path.sep}!(assets){${path.sep},}{**${
path.sep
}*,*}.{js,jsx,ts,tsx,json,md}`;
const SOURCE_PATTERN = `{client,scripts,server,shared}${path.sep}!(assets){${path.sep},}{**${path.sep}*,*}.{js,jsx,ts,tsx,json,md}`;
const readFile = filePath => {
const readFile = (filePath) => {
return new Promise((resolve, reject) => {
fs.readFile(filePath, 'utf8', (error, fileContent) => {
if (error != null) {
@@ -23,7 +21,7 @@ const readFile = filePath => {
const writeFile = (filePath, fileContent) => {
return new Promise((resolve, reject) => {
fs.writeFile(filePath, fileContent, writeFileError => {
fs.writeFile(filePath, fileContent, (writeFileError) => {
if (writeFileError) {
reject(writeFileError);
return;
@@ -53,7 +51,7 @@ const getSourceFilePaths = () => {
return;
}
resolve(files.map(filePath => path.join(process.cwd(), filePath)));
resolve(files.map((filePath) => path.join(process.cwd(), filePath)));
});
});
};
@@ -63,7 +61,7 @@ const formatSource = async () => {
try {
const sourceFilePaths = await getSourceFilePaths();
const formattedPaths = await Promise.all(sourceFilePaths.map(filePath => formatFile(filePath, filePath)));
const formattedPaths = await Promise.all(sourceFilePaths.map((filePath) => formatFile(filePath, filePath)));
console.log(chalk.green(`Formatted ${formattedPaths.length} files.`));
} catch (error) {
@@ -78,7 +76,7 @@ const check = async () => {
try {
const sourceFilePaths = await getSourceFilePaths();
await Promise.all(
sourceFilePaths.map(async filePath => {
sourceFilePaths.map(async (filePath) => {
const fileContent = await readFile(filePath);
const prettierConfig = await prettier.resolveConfig(filePath);
const isCompliant = prettier.check(fileContent, {...prettierConfig, filepath: filePath});