Skip to content

Commit 3a11043

Browse files
chore: update dependencies (#1465)
1 parent a5fc80b commit 3a11043

15 files changed

+5333
-4936
lines changed

.changeset/chilly-tables-cheer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"preact-cli": minor
3+
---
4+
5+
chore: update dependencies

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install lint-staged

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
**/tests/output
33
**/package.json
44
**/*.ejs
5+
.changeset/*.md

package.json

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,26 @@
99
"prettier": "prettier --write **/*.{js,ts,tsx,json,css,scss,md,yml}",
1010
"lint": "eslint .",
1111
"changeset": "changeset",
12-
"release": "ncp README.md packages/cli/README.md && changeset publish && rimraf packages/cli/README.md"
12+
"release": "ncp README.md packages/cli/README.md && changeset publish && rimraf packages/cli/README.md",
13+
"prepare": "husky install"
1314
},
15+
"dependencies": {},
1416
"devDependencies": {
15-
"@changesets/changelog-github": "^0.2.7",
16-
"@changesets/cli": "^2.10.2",
17+
"@changesets/changelog-github": "^0.4.0",
18+
"@changesets/cli": "^2.16.0",
1719
"babel-eslint": "^10.0.1",
18-
"eslint": "^7.12.1",
19-
"eslint-config-prettier": "^6.15.0",
20+
"eslint": "^7.24.0",
21+
"eslint-config-prettier": "^8.2.0",
2022
"eslint-plugin-babel": "^5.3.0",
21-
"eslint-plugin-prettier": "^3.1.0",
22-
"eslint-plugin-react": "^7.21.5",
23-
"husky": "^4.3.0",
24-
"lerna": "^3.16.4",
25-
"lint-staged": "^10.5.0",
23+
"eslint-plugin-prettier": "^3.4.0",
24+
"eslint-plugin-react": "^7.23.2",
25+
"husky": "^6.0.0",
26+
"lerna": "^4.0.0",
27+
"lint-staged": "^11.0.0",
2628
"ncp": "^2.0.0",
27-
"prettier": "^2.1.2",
29+
"prettier": "^2.2.1",
2830
"rimraf": "^3.0.2"
2931
},
30-
"husky": {
31-
"hooks": {
32-
"pre-commit": "lint-staged"
33-
}
34-
},
3532
"lint-staged": {
3633
"*.js": [
3734
"eslint --fix",

packages/async-loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"node": ">=8"
1414
},
1515
"dependencies": {
16-
"kleur": "^4.0.2",
16+
"kleur": "^4.1.4",
1717
"loader-utils": "^2.0.0"
1818
},
1919
"peerDependencies": {

packages/cli/jest.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* For a detailed explanation regarding each configuration property, visit:
3+
* https://jestjs.io/docs/configuration
4+
*/
5+
6+
module.exports = {
7+
// All imported modules in your tests should be mocked automatically
8+
automock: false,
9+
10+
// Stop running tests after `n` failures
11+
bail: 0,
12+
13+
// Automatically clear mock calls and instances between every test
14+
clearMocks: true,
15+
16+
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
17+
modulePathIgnorePatterns: [
18+
'<rootDir>/tests/output',
19+
'<rootDir>/tests/subjects',
20+
],
21+
22+
// A list of paths to modules that run some code to configure or set up the testing framework before each test
23+
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
24+
25+
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
26+
testPathIgnorePatterns: [
27+
'\\\\node_modules\\\\',
28+
'<rootDir>/tests/output',
29+
'<rootDir>/tests/subjects',
30+
],
31+
32+
// This option allows use of a custom test runner
33+
// testRunner: "jest-circus/runner",
34+
};

packages/cli/lib/lib/webpack/webpack-base-config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function getSassConfiguration(...includePaths) {
7070
return config;
7171
}
7272

73-
module.exports = function (env) {
73+
module.exports = function createBaseConfig(env) {
7474
const { cwd, isProd, isWatch, src, source } = env;
7575
const babelConfigFile = env.babelConfig || '.babelrc';
7676
const IS_SOURCE_PREACT_X_OR_ABOVE = isInstalledVersionPreactXOrAbove(cwd);
@@ -260,9 +260,10 @@ module.exports = function (env) {
260260
{
261261
loader: require.resolve('postcss-loader'),
262262
options: {
263-
ident: 'postcss',
264263
sourceMap: true,
265-
plugins: postcssPlugins,
264+
postcssOptions: {
265+
plugins: postcssPlugins,
266+
},
266267
},
267268
},
268269
],
@@ -284,9 +285,10 @@ module.exports = function (env) {
284285
{
285286
loader: require.resolve('postcss-loader'),
286287
options: {
287-
ident: 'postcss',
288288
sourceMap: true,
289-
plugins: postcssPlugins,
289+
postcssOptions: {
290+
plugins: postcssPlugins,
291+
},
290292
},
291293
},
292294
],

packages/cli/lib/lib/webpack/webpack-client-config.js

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const webpack = require('webpack');
22
const { resolve, join } = require('path');
33
const { existsSync } = require('fs');
44
const { isInstalledVersionPreactXOrAbove } = require('./utils');
5-
const merge = require('webpack-merge');
5+
const { merge } = require('webpack-merge');
66
const { filter } = require('minimatch');
77
const SizePlugin = require('size-plugin');
88
const CopyWebpackPlugin = require('copy-webpack-plugin');
@@ -78,6 +78,22 @@ async function clientConfig(env) {
7878
];
7979
}
8080

81+
let copyPatterns = [
82+
existsSync(source('manifest.json')) && { from: 'manifest.json' },
83+
// copy any static files
84+
existsSync(source('assets')) && { from: 'assets', to: 'assets' },
85+
// copy sw-debug
86+
!isProd && {
87+
from: resolve(__dirname, '../../resources/sw-debug.js'),
88+
to: 'sw-debug.js',
89+
},
90+
// copy files from static to build directory
91+
existsSync(source('static')) && {
92+
from: resolve(source('static')),
93+
to: '.',
94+
},
95+
].filter(Boolean);
96+
8197
return {
8298
entry: entry,
8399
output: {
@@ -130,25 +146,12 @@ async function clientConfig(env) {
130146
new PushManifestPlugin(env),
131147
...(await renderHTMLPlugin(env)),
132148
...getBabelEsmPlugin(env),
133-
new CopyWebpackPlugin(
134-
[
135-
existsSync(source('manifest.json')) && { from: 'manifest.json' },
136-
// copy any static files
137-
existsSync(source('assets')) && { from: 'assets', to: 'assets' },
138-
// copy sw-debug
139-
!isProd && {
140-
from: resolve(__dirname, '../../resources/sw-debug.js'),
141-
to: 'sw-debug.js',
142-
},
143-
// copy files from static to build directory
144-
existsSync(source('static')) && {
145-
from: resolve(source('static')),
146-
to: '.',
147-
},
148-
].filter(Boolean)
149-
),
149+
copyPatterns.length !== 0 &&
150+
new CopyWebpackPlugin({
151+
patterns: copyPatterns,
152+
}),
150153
...swInjectManifest,
151-
],
154+
].filter(Boolean),
152155
};
153156
}
154157

@@ -165,13 +168,7 @@ function getBabelEsmPlugin(config) {
165168
beforeStartExecution: (plugins, newConfig) => {
166169
const babelPlugins = newConfig.plugins;
167170
newConfig.plugins = babelPlugins.filter(plugin => {
168-
if (
169-
Array.isArray(plugin) &&
170-
plugin[0].indexOf('fast-async') !== -1
171-
) {
172-
return false;
173-
}
174-
return true;
171+
return !(Array.isArray(plugin) && plugin[0].includes('fast-async'));
175172
});
176173
plugins.forEach(plugin => {
177174
if (
@@ -319,7 +316,7 @@ function isDev(config) {
319316
};
320317
}
321318

322-
module.exports = async function (env) {
319+
module.exports = async function createClientConfig(env) {
323320
return merge(
324321
baseConfig(env),
325322
await clientConfig(env),

packages/cli/lib/lib/webpack/webpack-server-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { resolve } = require('path');
2-
const merge = require('webpack-merge');
2+
const { merge } = require('webpack-merge');
33
const baseConfig = require('./webpack-base-config');
44

55
function serverConfig(env) {
@@ -26,6 +26,6 @@ function serverConfig(env) {
2626
};
2727
}
2828

29-
module.exports = function (env) {
29+
module.exports = function createServerConfig(env) {
3030
return merge(baseConfig(env), serverConfig(env));
3131
};

0 commit comments

Comments
 (0)