@lipemat/js-boilerplate 8.6.1 → 9.0.0-beta.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.
@@ -13,22 +13,24 @@ let jestConfig = {
13
13
  },
14
14
  moduleNameMapper: {
15
15
  '\\.(pcss|less|css)$': 'identity-obj-proxy',
16
+ 'is-plain-obj': 'identity-obj-proxy',
16
17
  },
17
18
  roots: [
18
19
  './tests',
19
20
  ],
20
- testURL: packageConfig.url,
21
+ testEnvironmentOptions: {
22
+ url: packageConfig.url,
23
+ },
21
24
  transform: {
22
25
  '^.+\\.[tj]sx?$': [ 'babel-jest', babelConfig ],
23
26
  },
24
27
  setupFilesAfterEnv: [ path.resolve( packageConfig.workingDirectory, 'tests/setup.js' ) ],
25
- snapshotSerializers: [ 'enzyme-to-json/serializer' ],
26
28
  };
27
29
 
28
30
  /**
29
31
  * Allows overriding configurations in the project `/config/jest.config.js` file.
30
32
  * We don't actually need to do this because `jest.config.js` in the project root
31
- * is already an override of this file but we support it anyway to keep things consistent.
33
+ * is already an override of this file, but we support it anyway to keep things consistent.
32
34
  */
33
35
  try {
34
36
  const localConfig = require( path.resolve( packageConfig.workingDirectory + '/config', 'jest.config.js' ) );
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lipemat/js-boilerplate",
3
- "version": "8.6.1",
3
+ "version": "9.0.0-beta.2",
4
4
  "description": "Dependencies and scripts for a no config JavaScript app",
5
5
  "author": "Mat Lipe",
6
6
  "license": "MIT",
@@ -43,27 +43,24 @@
43
43
  "@babel/preset-react": "^7.12.10",
44
44
  "@babel/preset-typescript": "^7.12.7",
45
45
  "@hot-loader/react-dom": "^17.0.1",
46
- "@lipemat/css-mqpacker": "^9.0.0-beta.2",
46
+ "@lipemat/css-mqpacker": "^9.0.0",
47
47
  "@lipemat/eslint-config": "^2.0.1",
48
48
  "@lipemat/webpack-cleanup-plugin": "^1.0.0",
49
49
  "@types/lipemat__js-boilerplate": "lipemat/types-js-boilerplate#semver:^1.3.0",
50
- "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
51
50
  "@wordpress/browserslist-config": "^4.1.0",
52
51
  "are-you-es5": "^2.1.1",
53
- "babel-jest": "^24.7.1",
52
+ "babel-jest": "^29.0.0",
54
53
  "babel-loader": "^8.2.2",
55
54
  "browserslist": "^4.17.0",
56
55
  "clean-css": "^5.3.0",
57
56
  "core-js": "^3.8.3",
58
57
  "cross-spawn": "^6.0.5",
59
58
  "css-loader": "6.7.1",
60
- "enzyme": "^3.11.0",
61
- "enzyme-to-json": "^3.5.0",
62
- "fork-ts-checker-webpack-plugin": "^6.0.7",
59
+ "fork-ts-checker-webpack-plugin": "^7.2.13",
63
60
  "html-webpack-plugin": "^4.5.0",
64
61
  "identity-obj-proxy": "^3.0.0",
65
- "jest": "^26.6.3",
66
- "jest-cli": "^26.6.3",
62
+ "jest": "^29.0.0",
63
+ "jest-cli": "^29.0.0",
67
64
  "lodash": "^4.17.19",
68
65
  "mini-css-extract-plugin": "^1.3.3",
69
66
  "postcss": "^8.4.13",
@@ -77,8 +74,6 @@
77
74
  "react": "^17.0.1",
78
75
  "react-dom": "^17.0.1",
79
76
  "react-hot-loader": "^4.8.3",
80
- "react-test-renderer": "^17.0.2",
81
- "react-transition-group": "^4.4.1",
82
77
  "style-loader": "^3.3.1",
83
78
  "typescript": "^4.2.4",
84
79
  "update-notifier": "^4.1.3",
@@ -88,5 +83,5 @@
88
83
  "webpack-dev-server": "^4.7.2",
89
84
  "webpack-subresource-integrity": "^1.5.2"
90
85
  },
91
- "packageManager": "yarn@3.2.1"
86
+ "packageManager": "yarn@3.2.3"
92
87
  }