@lipemat/js-boilerplate 8.6.0-beta.7 → 8.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,8 +37,7 @@ if ( getDefaultBrowsersList() ) {
37
37
  const config = {
38
38
  plugins: [
39
39
  require( 'postcss-import' ),
40
- // Use until https://github.com/postcss/postcss-custom-media/pull/59 is merged.
41
- require( 'postcss-custom-media-with-spaces' ),
40
+ require( 'postcss-custom-media' ),
42
41
  require( 'postcss-nested' ),
43
42
  postcssPresetEnv( presetEnv ),
44
43
  require( 'postcss-color-mod-function' ),
@@ -8,6 +8,7 @@ const config = require( '../helpers/package-config' );
8
8
  const postcssOptions = getConfig( 'postcss.config.js' );
9
9
  const babelOptions = getConfig( 'babel.config.js' );
10
10
  const cssLoaderOptions = getConfig( 'css-loader.config.js' );
11
+ const devServerOptions = getConfig( 'dev-server.config.js' );
11
12
 
12
13
  // To allow line numbers to show up in console errors. @see React Error Boundaries.
13
14
  babelOptions.plugins.unshift( '@babel/plugin-transform-react-jsx-source' );
@@ -56,7 +57,7 @@ module.exports = {
56
57
  output: {
57
58
  path: path.resolve( config.workingDirectory, 'dist' ),
58
59
  filename: '[name].js',
59
- publicPath: config.url + ':3000/js/dist/',
60
+ publicPath: config.url + ':' + devServerOptions.port + '/js/dist/',
60
61
  chunkFilename: '[name].js',
61
62
  },
62
63
  resolve: {
package/helpers/config.js CHANGED
@@ -53,14 +53,15 @@ function hasLocalOverride( fileName, inWorkingDirectory = false ) {
53
53
  * }
54
54
  * ```
55
55
  *
56
- * @param {string} $fileName
56
+ * @param {string} fileName
57
57
  *
58
58
  * @return {Object}
59
59
  */
60
- function getConfig( $fileName ) {
61
- let config = {...require( '../config/' + $fileName ), ...getExtensionsConfig( $fileName )};
60
+ function getConfig( fileName ) {
61
+ let config = require( '../config/' + fileName );
62
+ config = {...config, ...getExtensionsConfig( fileName, config )};
62
63
  try {
63
- const localConfig = require( path.resolve( packageConfig.packageDirectory + '/config', $fileName ) );
64
+ const localConfig = require( path.resolve( packageConfig.packageDirectory + '/config', fileName ) );
64
65
  if ( 'function' === typeof localConfig ) {
65
66
  config = {...config, ...localConfig( config )};
66
67
  } else {
@@ -75,19 +76,21 @@ function getConfig( $fileName ) {
75
76
  * Get a config from any existing extension's /config directories
76
77
  * merged into one.
77
78
  *
78
- * @see getConfig
79
+ * @param {string} fileName
80
+ * @param {Object} defaultConfig - Default config from this package.
81
+ * Used for passing to an extension callback.
79
82
  *
80
- * @param {string} $fileName
83
+ * @see getConfig
81
84
  *
82
85
  * @return {Object}
83
86
  */
84
- function getExtensionsConfig( $fileName ) {
87
+ function getExtensionsConfig( fileName, defaultConfig ) {
85
88
  let config = {};
86
89
  extensions.forEach( extension => {
87
90
  try {
88
- const extensionConfig = require( extension + '/config/' + $fileName );
91
+ const extensionConfig = require( extension + '/config/' + fileName );
89
92
  if ( 'function' === typeof extensionConfig ) {
90
- config = {...config, ...extensionConfig( config )};
93
+ config = {...config, ...extensionConfig( {...defaultConfig, ...config} )};
91
94
  } else {
92
95
  config = {...config, ...extensionConfig};
93
96
  }
@@ -29,8 +29,8 @@ module.exports = ( opts = {} ) => {
29
29
  return reject( new Error( err.join( '\n' ) ) );
30
30
  }
31
31
 
32
- for ( const w of min.warnings ) {
33
- result.warn( w );
32
+ if ( min.warnings.length > 0 ) {
33
+ return reject( new Error( 'postcss-clean minify failed! \n' + min.warnings.join( '\n' ) ) );
34
34
  }
35
35
 
36
36
  result.root = postcss.parse( min.styles );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lipemat/js-boilerplate",
3
- "version": "8.6.0-beta.7",
3
+ "version": "8.6.2",
4
4
  "description": "Dependencies and scripts for a no config JavaScript app",
5
5
  "author": "Mat Lipe",
6
6
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  "@lipemat/webpack-cleanup-plugin": "^1.0.0",
49
49
  "@types/lipemat__js-boilerplate": "lipemat/types-js-boilerplate#semver:^1.3.0",
50
50
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
51
- "@wordpress/browserslist-config": "^4.1.3",
51
+ "@wordpress/browserslist-config": "^4.1.0",
52
52
  "are-you-es5": "^2.1.1",
53
53
  "babel-jest": "^24.7.1",
54
54
  "babel-loader": "^8.2.2",
@@ -68,7 +68,7 @@
68
68
  "mini-css-extract-plugin": "^1.3.3",
69
69
  "postcss": "^8.4.13",
70
70
  "postcss-color-mod-function": "^3.0.3",
71
- "postcss-custom-media-with-spaces": "^8.0.0",
71
+ "postcss-custom-media": "^8.0.1",
72
72
  "postcss-import": "^14.1.0",
73
73
  "postcss-loader": "^6.2.1",
74
74
  "postcss-nested": "^5.0.6",