mirror of
https://github.com/zoriya/flood.git
synced 2026-06-02 19:11:14 +00:00
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:
+6
-8
@@ -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});
|
||||
|
||||
Reference in New Issue
Block a user