Skip to content

Commit

Permalink
Upgrade dependencies (#324)
Browse files Browse the repository at this point in the history
* Upgrade @webpack-blocks/assets dependencies

* Upgrade @webpack-blocks/dev-server dependencies

* Upgrade @webpack-blocks/sass dependencies

* Add breaking changes from css-loader

* Upgrade minor dependencies

* Upgrade @webpack-blocks/babel and @webpack-blocks/eslint

* Upgrade travis node versions
  • Loading branch information
marcofugaro authored Apr 27, 2020
1 parent 1741e27 commit f808db6
Show file tree
Hide file tree
Showing 21 changed files with 887 additions and 178 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ language: node_js

node_js:
- 12
- 8
- 10

cache:
yarn: true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
"**/**/js-yaml": "^3.13.1",
"**/node-sass/node-gyp/tar": "^2.2.2"
}
}
}
8 changes: 5 additions & 3 deletions packages/assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ module.exports = createConfig([
['*.css', '!*node_modules*'],
[
css.modules({
localIdentName: '[name]--[local]--[hash:base64:5]'
modules: {
localIdentName: '[name]--[local]--[hash:base64:5]'
}
})
]
)
Expand All @@ -63,9 +65,9 @@ Will match `*.css` by default if not used with `match()`. You can pass all

The difference to `css()` is that it sets the following `css-loader` options by default:

- `modules: true`
- `modules` option is enabled
- `importLoaders` defaults to `1`
- `localIdentName` defaults to `'[name]--[local]--[hash:base64:5]'` in development and
- `modules.localIdentName` defaults to `'[name]--[local]--[hash:base64:5]'` in development and
`'[hash:base64:10]'` in production

### file(options: ?object)
Expand Down
34 changes: 19 additions & 15 deletions packages/assets/__tests__/css-modules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ test('css.modules() works', t => {
{
loader: 'css-loader',
options: {
importLoaders: 1,
localIdentName: '[name]--[local]--[hash:base64:5]',
modules: true
modules: {
localIdentName: '[name]--[local]--[hash:base64:5]'
},
importLoaders: 1
}
}
]
Expand All @@ -30,7 +31,7 @@ test('css.modules() works with options and match()', t => {
const config = createConfig({}, [
match('*.pcss', { exclude: /node_modules/ }, [
css.modules({
minimize: true
sourceMap: true
})
])
])
Expand All @@ -47,10 +48,11 @@ test('css.modules() works with options and match()', t => {
{
loader: 'css-loader',
options: {
modules: {
localIdentName: '[name]--[local]--[hash:base64:5]'
},
importLoaders: 1,
localIdentName: '[name]--[local]--[hash:base64:5]',
modules: true,
minimize: true
sourceMap: true
}
}
]
Expand All @@ -62,7 +64,7 @@ test('style-loader can take options', t => {
const config = createConfig({}, [
css.modules({
styleLoader: {
hmr: true
esModule: true
}
})
])
Expand All @@ -74,15 +76,16 @@ test('style-loader can take options', t => {
{
loader: 'style-loader',
options: {
hmr: true
esModule: true
}
},
{
loader: 'css-loader',
options: {
importLoaders: 1,
localIdentName: '[name]--[local]--[hash:base64:5]',
modules: true
modules: {
localIdentName: '[name]--[local]--[hash:base64:5]'
},
importLoaders: 1
}
}
]
Expand All @@ -104,9 +107,10 @@ test('style-loader can be disabled', t => {
{
loader: 'css-loader',
options: {
importLoaders: 1,
localIdentName: '[name]--[local]--[hash:base64:5]',
modules: true
modules: {
localIdentName: '[name]--[local]--[hash:base64:5]'
},
importLoaders: 1
}
}
]
Expand Down
8 changes: 4 additions & 4 deletions packages/assets/__tests__/css.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('css() works with options and match()', t => {
const config = createConfig({}, [
match('*.pcss', { exclude: /node_modules/ }, [
css({
minimize: true
sourceMaps: true
})
])
])
Expand All @@ -43,7 +43,7 @@ test('css() works with options and match()', t => {
{
loader: 'css-loader',
options: {
minimize: true
sourceMaps: true
}
}
]
Expand All @@ -55,7 +55,7 @@ test('style-loader can take options', t => {
const config = createConfig({}, [
css({
styleLoader: {
hmr: true
esModule: true
}
})
])
Expand All @@ -67,7 +67,7 @@ test('style-loader can take options', t => {
{
loader: 'style-loader',
options: {
hmr: true
esModule: true
}
},
{
Expand Down
17 changes: 9 additions & 8 deletions packages/assets/lib/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,22 @@ function css(options = {}) {
/**
* @param {object} [options] You can pass all css-loader options.
* @param {number} [options.importLoaders] Defaults to 1.
* @param {string} [options.localIdentName] Defaults to '[hash:base64:10]' in production, '[name]--[local]--[hash:base64:5]' in development.
* @param {string} [options.modules.localIdentName] Defaults to '[hash:base64:10]' in production, '[name]--[local]--[hash:base64:5]' in development.
* @param {object} [options.styleLoader] style-loader options. If set to 'false' the 'style-loader' won't be added.
* @return {Function}
* @see https://github.com/webpack-contrib/css-loader
*/
function cssModules(options = {}) {
const defaultCssOptions = {
modules: true,
importLoaders: 1,
localIdentName:
String(process.env.NODE_ENV) === 'production'
? '[hash:base64:10]'
: '[name]--[local]--[hash:base64:5]'
modules: {
localIdentName:
String(process.env.NODE_ENV) === 'production'
? '[hash:base64:10]'
: '[name]--[local]--[hash:base64:5]'
},
importLoaders: 1
}
const cssOptions = Object.assign(
const cssOptions = _.merge(
defaultCssOptions,
_.omit(options, ['exclude', 'include', 'styleLoader'])
)
Expand Down
12 changes: 6 additions & 6 deletions packages/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"author": "Andy Wermke <[email protected]>",
"engines": {
"node": ">= 6.0"
"node": ">= 10.13.0"
},
"keywords": [
"webpack",
Expand All @@ -15,11 +15,11 @@
"repository": "andywer/webpack-blocks",
"bugs": "https://github.com/andywer/webpack-blocks/issues",
"dependencies": {
"css-loader": "^1.0.0",
"file-loader": "^2.0.0",
"lodash": "^4.17.11",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2"
"css-loader": "^3.5.2",
"file-loader": "^6.0.0",
"lodash": "^4.17.15",
"style-loader": "^1.1.4",
"url-loader": "^4.1.0"
},
"devDependencies": {
"@webpack-blocks/core": "^2.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"repository": "andywer/webpack-blocks",
"bugs": "https://github.com/andywer/webpack-blocks/issues",
"dependencies": {
"babel-loader": "^8.0.4"
"babel-loader": "^8.1.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@webpack-blocks/core": "^2.0.0",
"webpack": "^4.20.2"
},
"peerDependencies": {
"@webpack-blocks/core": "^2.0.0",
"@babel/core": "^7.0.0"
"@babel/core": "^7.0.0",
"@webpack-blocks/core": "^2.0.0"
}
}
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"repository": "andywer/webpack-blocks",
"bugs": "https://github.com/andywer/webpack-blocks/issues",
"dependencies": {
"glob-to-regexp": "^0.4.0",
"lodash": "^4.17.11",
"webpack-merge": "^4.1.4"
"glob-to-regexp": "^0.4.1",
"lodash": "^4.17.15",
"webpack-merge": "^4.2.2"
},
"devDependencies": {
"sinon": "^6.3.5",
Expand Down
8 changes: 4 additions & 4 deletions packages/dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"author": "Andy Wermke <[email protected]>",
"engines": {
"node": ">= 6.0"
"node": ">= 6.11.5"
},
"keywords": [
"webpack",
Expand All @@ -15,10 +15,10 @@
"repository": "andywer/webpack-blocks",
"bugs": "https://github.com/andywer/webpack-blocks/issues",
"dependencies": {
"webpack": "^4.20.2",
"webpack-dev-server": "^3.7.1"
"webpack": "^4.42.1",
"webpack-dev-server": "^3.10.3"
},
"peerDependencies": {
"@webpack-blocks/core": "^2.0.0"
}
}
}
4 changes: 2 additions & 2 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"author": "Dmytro Meleshko <[email protected]>",
"engines": {
"node": ">= 6.0"
"node": ">= 10.13.0"
},
"keywords": [
"webpack",
Expand All @@ -15,7 +15,7 @@
"repository": "andywer/webpack-blocks",
"bugs": "https://github.com/andywer/webpack-blocks/issues",
"dependencies": {
"eslint-loader": "^2.1.1"
"eslint-loader": "^4.0.0"
},
"devDependencies": {
"@webpack-blocks/core": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"repository": "andywer/webpack-blocks",
"bugs": "https://github.com/andywer/webpack-blocks/issues",
"dependencies": {
"lodash": "^4.17.11",
"lodash": "^4.17.15",
"postcss-loader": "^3.0.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ Generated by [AVA](https://ava.li).
loader: 'css-loader',
options: {
importLoaders: 1,
localIdentName: '[name]--[local]--[hash:base64:5]',
modules: true,
modules: {
localIdentName: '[name]--[local]--[hash:base64:5]',
},
},
},
],
Expand Down Expand Up @@ -153,8 +154,9 @@ Generated by [AVA](https://ava.li).
loader: 'css-loader',
options: {
importLoaders: 1,
localIdentName: '[hash:base64:10]',
modules: true,
modules: {
localIdentName: '[hash:base64:10]',
},
},
},
{
Expand Down
Binary file not shown.
7 changes: 4 additions & 3 deletions packages/sass/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const sass = require('@webpack-blocks/sass')
module.exports = createConfig([
match(['*.scss', '!*node_modules*'], [
css(),
sass(/* node-sass options */)
sass({ sassOptions: {/* node-sass options */} })
])
])
```
Expand All @@ -26,8 +26,9 @@ module.exports = createConfig([

## Options

You can pass any [sass-loader / node-sass options](https://github.com/sass/node-sass#options) as an
object to the `sass` block.
You can pass any [sass-loader](https://github.com/webpack-contrib/sass-loader) as an object to the
`sass` block. For example you can pass
[node-sass options](https://github.com/sass/node-sass#options) in the `sassOptions` property.

## Examples

Expand Down
6 changes: 3 additions & 3 deletions packages/sass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ module.exports = sass

/**
* @param {object} [options] See https://github.com/sass/node-sass#options
* @param {string[]} [options.includePaths]
* @param {bool} [options.indentedSyntax]
* @param {string} [options.outputStyle]
* @param {string[]} [options.sassOptions.includePaths]
* @param {bool} [options.sassOptions.indentedSyntax]
* @param {string} [options.sassOptions.outputStyle]
* @param {bool} [options.sourceMap]
* @return {Function}
*/
Expand Down
12 changes: 6 additions & 6 deletions packages/sass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"author": "Andy Wermke <[email protected]>",
"engines": {
"node": ">= 6.0"
"node": ">= 8.9.0"
},
"keywords": [
"webpack",
Expand All @@ -15,11 +15,11 @@
"repository": "andywer/webpack-blocks",
"bugs": "https://github.com/andywer/webpack-blocks/issues",
"dependencies": {
"css-loader": "^1.0.0",
"lodash": "^4.17.11",
"node-sass": "^4.12.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1"
"css-loader": "^3.5.2",
"lodash": "^4.17.15",
"node-sass": "^4.13.1",
"sass-loader": "^8.0.2",
"style-loader": "^1.1.4"
},
"devDependencies": {
"@webpack-blocks/assets": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/uglify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"bugs": "https://github.com/andywer/webpack-blocks/issues",
"dependencies": {
"uglifyjs-webpack-plugin": "^1.3.0",
"webpack-merge": "^4.1.4"
"webpack-merge": "^4.2.2"
},
"devDependencies": {
"@webpack-blocks/core": "^2.0.0",
Expand Down
Loading

0 comments on commit f808db6

Please sign in to comment.