@patternslib/dev 3.4.1 → 3.5.1

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.
package/CHANGES.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
 
4
4
 
5
+ ## [3.5.1](https://github.com/patternslib/dev/compare/3.5.0...3.5.1) (2023-09-23)
6
+
7
+
8
+ ### Maintenance
9
+
10
+
11
+ * Upgrade dependencies. ([b1ffc64](https://github.com/patternslib/dev/commit/b1ffc6453551b7312e4643f4f6aa679286baa379))
12
+
13
+ ## [3.5.0](https://github.com/patternslib/dev/compare/3.4.1...3.5.0) (2023-08-30)
14
+
15
+
16
+ ### Features
17
+
18
+
19
+ * **Tests:** Add helper for conditional test skipping and node version parsing. ([611b77b](https://github.com/patternslib/dev/commit/611b77b2b4469226ebcf942e5b68851e7927c630))
20
+
21
+
22
+
23
+ ### Maintenance
24
+
25
+
26
+ * Upgrade dependencies. ([1e146a9](https://github.com/patternslib/dev/commit/1e146a99047786ffbf69cc0da97763885af3736f))
27
+
5
28
  ## [3.4.1](https://github.com/patternslib/dev/compare/3.4.0...3.4.1) (2023-08-11)
6
29
 
7
30
 
@@ -1,6 +1,44 @@
1
1
  // need this for async/await in tests
2
2
  import "regenerator-runtime/runtime";
3
3
 
4
+ /**
5
+ * Return the node version.
6
+ *
7
+ * See: https://stackoverflow.com/a/20798760/1337474
8
+ *
9
+ * @returns {object} - The node version. { version, major, minor, patch }
10
+ *
11
+ * @example
12
+ * global.node_version().major >= 19 // true if node version is >= 19
13
+ * global.node_version().version // "v14.17.0"
14
+ */
15
+ global.node_version = () => {
16
+ const parsed_version = process.version.match(/^v(\d+)\.(\d+)\.(\d+)/);
17
+ console.log(parsed_version);
18
+ return {
19
+ version: parsed_version[0],
20
+ major: parseInt(parsed_version[1]),
21
+ minor: parseInt(parsed_version[2]),
22
+ patch: parseInt(parsed_version[3]),
23
+ };
24
+ };
25
+
26
+ /**
27
+ * Conditional Jest tests
28
+ *
29
+ * See: https://stackoverflow.com/a/60438234/1337474
30
+ *
31
+ * @param {boolean} condition - The condition to test.
32
+ * @returns {function} - it or it.skip
33
+ *
34
+ * @example
35
+ *
36
+ * global.itif(global.node_version().major >= 19)("should do something", () => {
37
+ * // test code
38
+ * });
39
+ */
40
+ global.itif = (condition) => (condition ? it : it.skip);
41
+
4
42
  // pat-fullscreen
5
43
  document.requestFullscreen = jest.fn();
6
44
  document.exitFullscreen = jest.fn();
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
1
  {
2
2
  "name": "@patternslib/dev",
3
- "version": "3.4.1",
3
+ "version": "3.5.1",
4
4
  "description": "Development base files for working with Patternslib and add-ons.",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
- "@babel/core": "^7.22.10",
8
- "@babel/eslint-parser": "^7.22.10",
9
- "@babel/preset-env": "^7.22.10",
7
+ "@babel/core": "^7.22.20",
8
+ "@babel/eslint-parser": "^7.22.15",
9
+ "@babel/preset-env": "^7.22.20",
10
10
  "@commitlint/cli": "^17.7.1",
11
11
  "@commitlint/config-conventional": "^17.7.0",
12
- "@release-it/conventional-changelog": "^7.0.0",
12
+ "@release-it/conventional-changelog": "^7.0.2",
13
13
  "babel-loader": "^9.1.3",
14
14
  "css-loader": "^6.8.1",
15
- "eslint": "^8.47.0",
15
+ "eslint": "^8.50.0",
16
16
  "eslint-config-prettier": "^9.0.0",
17
17
  "husky": "^8.0.3",
18
18
  "identity-obj-proxy": "^3.0.0",
19
- "jest": "^29.6.2",
20
- "jest-environment-jsdom": "^29.6.2",
19
+ "jest": "^29.7.0",
20
+ "jest-environment-jsdom": "^29.7.0",
21
21
  "jest-watch-typeahead": "^2.2.2",
22
- "prettier": "^3.0.1",
22
+ "prettier": "^3.0.3",
23
23
  "regenerator-runtime": "^0.14.0",
24
- "release-it": "^16.1.4",
25
- "sass": "^1.65.1",
24
+ "release-it": "^16.2.0",
25
+ "sass": "^1.68.0",
26
26
  "sass-loader": "^13.3.2",
27
27
  "style-loader": "^3.3.3",
28
28
  "terser-webpack-plugin": "^5.3.9",
29
29
  "timezone-mock": "^1.3.6",
30
30
  "webpack": "^5.88.2",
31
- "webpack-bundle-analyzer": "^4.9.0",
31
+ "webpack-bundle-analyzer": "^4.9.1",
32
32
  "webpack-cli": "^5.1.4",
33
33
  "webpack-dev-server": "^4.15.1",
34
34
  "whybundled": "^2.0.0",