sku 12.4.2 → 12.4.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # sku
2
2
 
3
+ ## 12.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Remove `node-emoji` dependency ([#902](https://github.com/seek-oss/sku/pull/902))
8
+
9
+ ## 12.4.3
10
+
11
+ ### Patch Changes
12
+
13
+ - Asynchronously import `node-emoji` to fix ESM require issue ([#900](https://github.com/seek-oss/sku/pull/900))
14
+
3
15
  ## 12.4.2
4
16
 
5
17
  ### Patch Changes
@@ -2,14 +2,13 @@ const Validator = require('fastest-validator');
2
2
  const browserslist = require('browserslist');
3
3
  const { yellow, red, bold, underline, white } = require('chalk');
4
4
  const didYouMean = require('didyoumean2').default;
5
- const { emojify } = require('node-emoji');
6
5
 
7
6
  const validator = new Validator();
8
7
 
9
- const exitWithErrors = (errors) => {
8
+ const exitWithErrors = async (errors) => {
10
9
  console.log(bold(underline(red('SkuWebpackPlugin: Invalid options'))));
11
10
  errors.forEach((error) => {
12
- console.log(yellow(emojify(error)));
11
+ console.log(yellow(error));
13
12
  });
14
13
  process.exit(1);
15
14
  };
@@ -84,7 +83,7 @@ module.exports = (options) => {
84
83
  const suggestedMessage = suggestedKey
85
84
  ? ` Did you mean '${bold(suggestedKey)}'?`
86
85
  : '';
87
- errors.push(`:question: ${unknownMessage}${suggestedMessage}`);
86
+ errors.push(`❓ ${unknownMessage}${suggestedMessage}`);
88
87
  });
89
88
 
90
89
  // Validate schema types
@@ -92,8 +91,8 @@ module.exports = (options) => {
92
91
  if (schemaCheckResult !== true) {
93
92
  schemaCheckResult.forEach(({ message, field }) => {
94
93
  const errorMessage = message
95
- ? `:no_entry_sign: ${message.replace(field, `${bold(field)}`)}`
96
- : `:no_entry_sign: '${bold(field)}' is invalid`;
94
+ ? `🚫 ${message.replace(field, `${bold(field)}`)}`
95
+ : `🚫 '${bold(field)}' is invalid`;
97
96
 
98
97
  errors.push(errorMessage);
99
98
  });
@@ -105,7 +104,7 @@ module.exports = (options) => {
105
104
  browserslist(options.browserslist);
106
105
  } catch (e) {
107
106
  errors.push(
108
- `:no_entry_sign: '${bold(
107
+ `🚫 '${bold(
109
108
  'browserslist',
110
109
  )}' must be a valid browserslist query. ${white(e.message)}`,
111
110
  );
@@ -1,7 +1,6 @@
1
1
  const browserslist = require('browserslist');
2
2
  const { yellow, red, bold, underline, white } = require('chalk');
3
3
  const didYouMean = require('didyoumean2').default;
4
- const { emojify } = require('node-emoji');
5
4
 
6
5
  const configSchema = require('./configSchema');
7
6
  const defaultSkuConfig = require('./defaultSkuConfig');
@@ -9,10 +8,10 @@ const defaultClientEntry = require('./defaultClientEntry');
9
8
 
10
9
  const availableConfigKeys = Object.keys(defaultSkuConfig);
11
10
 
12
- const exitWithErrors = (errors) => {
11
+ const exitWithErrors = async (errors) => {
13
12
  console.log(bold(underline(red('Errors in sku config:'))));
14
13
  errors.forEach((error) => {
15
- console.log(yellow(emojify(error)));
14
+ console.log(yellow(error));
16
15
  });
17
16
  process.exit(1);
18
17
  };
@@ -29,7 +28,7 @@ module.exports = (skuConfig) => {
29
28
  const suggestedMessage = suggestedKey
30
29
  ? ` Did you mean '${bold(suggestedKey)}'?`
31
30
  : '';
32
- errors.push(`:question: ${unknownMessage}${suggestedMessage}`);
31
+ errors.push(`❓ ${unknownMessage}${suggestedMessage}`);
33
32
  });
34
33
 
35
34
  // Validate schema types
@@ -37,8 +36,8 @@ module.exports = (skuConfig) => {
37
36
  if (schemaCheckResult !== true) {
38
37
  schemaCheckResult.forEach(({ message, field }) => {
39
38
  const errorMessage = message
40
- ? `:no_entry_sign: ${message.replace(field, `${bold(field)}`)}`
41
- : `:no_entry_sign: '${bold(field)}' is invalid`;
39
+ ? `🚫 ${message.replace(field, `${bold(field)}`)}`
40
+ : `🚫 '${bold(field)}' is invalid`;
42
41
 
43
42
  errors.push(errorMessage);
44
43
  });
@@ -47,9 +46,7 @@ module.exports = (skuConfig) => {
47
46
  // Validate library entry has corresponding libraryName
48
47
  if (skuConfig.libraryEntry && !skuConfig.libraryName) {
49
48
  errors.push(
50
- `:no_entry_sign: '${bold(
51
- 'libraryEntry',
52
- )}' must have a corresponding '${bold(
49
+ `🚫 '${bold('libraryEntry')}' must have a corresponding '${bold(
53
50
  'libraryName',
54
51
  )}' option. More details: ${underline(
55
52
  'https://github.com/seek-oss/sku#building-a-library',
@@ -61,7 +58,7 @@ module.exports = (skuConfig) => {
61
58
  skuConfig.routes.forEach(({ name }) => {
62
59
  if (name === defaultClientEntry) {
63
60
  errors.push(
64
- `:no_entry_sign: Invalid route name: '${bold(
61
+ `🚫 Invalid route name: '${bold(
65
62
  defaultClientEntry,
66
63
  )}', please use a different route name`,
67
64
  );
@@ -73,7 +70,7 @@ module.exports = (skuConfig) => {
73
70
  browserslist(skuConfig.supportedBrowsers);
74
71
  } catch (e) {
75
72
  errors.push(
76
- `:no_entry_sign: '${bold(
73
+ `🚫 '${bold(
77
74
  'supportedBrowsers',
78
75
  )}' must be a valid browserslist query. ${white(e.message)}`,
79
76
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sku",
3
- "version": "12.4.2",
3
+ "version": "12.4.4",
4
4
  "description": "Front-end development toolkit, powered by Webpack, Babel, CSS Modules, Less and Jest",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -99,7 +99,6 @@
99
99
  "lint-staged": "^11.1.1",
100
100
  "memoizee": "^0.4.15",
101
101
  "mini-css-extract-plugin": "^2.6.1",
102
- "node-emoji": "^2.1.0",
103
102
  "node-html-parser": "^6.1.1",
104
103
  "open": "^7.3.1",
105
104
  "path-to-regexp": "^6.2.0",
@@ -140,7 +139,7 @@
140
139
  "react": "^18.2.0",
141
140
  "react-dom": "^18.2.0",
142
141
  "react-helmet": "^6.1.0",
143
- "react-router-dom": "^5.2.0"
142
+ "react-router-dom": "^6.0.0"
144
143
  },
145
144
  "scripts": {
146
145
  "postinstall": "node ./scripts/postinstall.js"