Skip to content

chore: update dependencies #1465

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 8 commits into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/chilly-tables-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"preact-cli": minor
---

chore: update dependencies
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
**/tests/output
**/package.json
**/*.ejs
.changeset/*.md
29 changes: 13 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,26 @@
"prettier": "prettier --write **/*.{js,ts,tsx,json,css,scss,md,yml}",
"lint": "eslint .",
"changeset": "changeset",
"release": "ncp README.md packages/cli/README.md && changeset publish && rimraf packages/cli/README.md"
"release": "ncp README.md packages/cli/README.md && changeset publish && rimraf packages/cli/README.md",
"prepare": "husky install"
},
"dependencies": {},
"devDependencies": {
"@changesets/changelog-github": "^0.2.7",
"@changesets/cli": "^2.10.2",
"@changesets/changelog-github": "^0.4.0",
"@changesets/cli": "^2.16.0",
"babel-eslint": "^10.0.1",
"eslint": "^7.12.1",
"eslint-config-prettier": "^6.15.0",
"eslint": "^7.24.0",
"eslint-config-prettier": "^8.2.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.21.5",
"husky": "^4.3.0",
"lerna": "^3.16.4",
"lint-staged": "^10.5.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.23.2",
"husky": "^6.0.0",
"lerna": "^4.0.0",
"lint-staged": "^11.0.0",
"ncp": "^2.0.0",
"prettier": "^2.1.2",
"prettier": "^2.2.1",
"rimraf": "^3.0.2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"eslint --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/async-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"node": ">=8"
},
"dependencies": {
"kleur": "^4.0.2",
"kleur": "^4.1.4",
"loader-utils": "^2.0.0"
},
"peerDependencies": {
Expand Down
34 changes: 34 additions & 0 deletions packages/cli/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/

module.exports = {
// All imported modules in your tests should be mocked automatically
automock: false,

// Stop running tests after `n` failures
bail: 0,

// Automatically clear mock calls and instances between every test
clearMocks: true,

// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
modulePathIgnorePatterns: [
'<rootDir>/tests/output',
'<rootDir>/tests/subjects',
],

// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: [
'\\\\node_modules\\\\',
'<rootDir>/tests/output',
'<rootDir>/tests/subjects',
],

// This option allows use of a custom test runner
// testRunner: "jest-circus/runner",
};
12 changes: 7 additions & 5 deletions packages/cli/lib/lib/webpack/webpack-base-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function getSassConfiguration(...includePaths) {
return config;
}

module.exports = function (env) {
module.exports = function createBaseConfig(env) {
const { cwd, isProd, isWatch, src, source } = env;
const babelConfigFile = env.babelConfig || '.babelrc';
const IS_SOURCE_PREACT_X_OR_ABOVE = isInstalledVersionPreactXOrAbove(cwd);
Expand Down Expand Up @@ -260,9 +260,10 @@ module.exports = function (env) {
{
loader: require.resolve('postcss-loader'),
options: {
ident: 'postcss',
sourceMap: true,
plugins: postcssPlugins,
postcssOptions: {
plugins: postcssPlugins,
},
},
},
],
Expand All @@ -284,9 +285,10 @@ module.exports = function (env) {
{
loader: require.resolve('postcss-loader'),
options: {
ident: 'postcss',
sourceMap: true,
plugins: postcssPlugins,
postcssOptions: {
plugins: postcssPlugins,
},
},
},
],
Expand Down
51 changes: 24 additions & 27 deletions packages/cli/lib/lib/webpack/webpack-client-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const webpack = require('webpack');
const { resolve, join } = require('path');
const { existsSync } = require('fs');
const { isInstalledVersionPreactXOrAbove } = require('./utils');
const merge = require('webpack-merge');
const { merge } = require('webpack-merge');
const { filter } = require('minimatch');
const SizePlugin = require('size-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
Expand Down Expand Up @@ -78,6 +78,22 @@ async function clientConfig(env) {
];
}

let copyPatterns = [
existsSync(source('manifest.json')) && { from: 'manifest.json' },
// copy any static files
existsSync(source('assets')) && { from: 'assets', to: 'assets' },
// copy sw-debug
!isProd && {
from: resolve(__dirname, '../../resources/sw-debug.js'),
to: 'sw-debug.js',
},
// copy files from static to build directory
existsSync(source('static')) && {
from: resolve(source('static')),
to: '.',
},
].filter(Boolean);

return {
entry: entry,
output: {
Expand Down Expand Up @@ -130,25 +146,12 @@ async function clientConfig(env) {
new PushManifestPlugin(env),
...(await renderHTMLPlugin(env)),
...getBabelEsmPlugin(env),
new CopyWebpackPlugin(
[
existsSync(source('manifest.json')) && { from: 'manifest.json' },
// copy any static files
existsSync(source('assets')) && { from: 'assets', to: 'assets' },
// copy sw-debug
!isProd && {
from: resolve(__dirname, '../../resources/sw-debug.js'),
to: 'sw-debug.js',
},
// copy files from static to build directory
existsSync(source('static')) && {
from: resolve(source('static')),
to: '.',
},
].filter(Boolean)
),
copyPatterns.length !== 0 &&
new CopyWebpackPlugin({
patterns: copyPatterns,
}),
...swInjectManifest,
],
].filter(Boolean),
};
}

Expand All @@ -165,13 +168,7 @@ function getBabelEsmPlugin(config) {
beforeStartExecution: (plugins, newConfig) => {
const babelPlugins = newConfig.plugins;
newConfig.plugins = babelPlugins.filter(plugin => {
if (
Array.isArray(plugin) &&
plugin[0].indexOf('fast-async') !== -1
) {
return false;
}
return true;
return !(Array.isArray(plugin) && plugin[0].includes('fast-async'));
});
plugins.forEach(plugin => {
if (
Expand Down Expand Up @@ -319,7 +316,7 @@ function isDev(config) {
};
}

module.exports = async function (env) {
module.exports = async function createClientConfig(env) {
return merge(
baseConfig(env),
await clientConfig(env),
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/lib/lib/webpack/webpack-server-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { resolve } = require('path');
const merge = require('webpack-merge');
const { merge } = require('webpack-merge');
const baseConfig = require('./webpack-base-config');

function serverConfig(env) {
Expand All @@ -26,6 +26,6 @@ function serverConfig(env) {
};
}

module.exports = function (env) {
module.exports = function createServerConfig(env) {
return merge(baseConfig(env), serverConfig(env));
};
Loading