@ubnt/store.core 9.37.0-beta.0 → 9.37.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/lib/assets/ucgMax.jpg +0 -0
  3. package/lib/assets/ucgMax2.jpg +0 -0
  4. package/lib/assets/ucgUltra.jpg +0 -0
  5. package/lib/assets/ucgUltra2.jpg +0 -0
  6. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
  7. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
  8. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
  9. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
  10. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.js +1 -1
  11. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.mjs +2 -2
  12. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
  13. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
  14. package/lib/components/ModelCompareV3/data/CloudGateways.js +6 -6
  15. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +4 -4
  16. package/lib/components/ModelCompareV3/data/products/ucgMax.js +1 -1
  17. package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +1 -1
  18. package/lib/components/ModelCompareV3/data/products/ucgUltra.js +1 -1
  19. package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +1 -1
  20. package/lib/constants/icons/options/colors/black.svg.js +5 -5
  21. package/lib/constants/icons/options/colors/index.js +3 -3
  22. package/lib/constants/icons/options/styles/black.svg.js +5 -5
  23. package/lib/constants/icons/options/styles/index.js +3 -3
  24. package/lib/constants/optionIcons.js +6 -6
  25. package/lib/constants/optionIcons.mjs +4 -4
  26. package/lib/utils/nextjs/patch.js +2 -2
  27. package/lib/utils/nextjs/patch.js.map +1 -1
  28. package/lib/utils/nextjs/patch.mjs +2 -2
  29. package/lib/utils/nextjs/patch.mjs.map +1 -1
  30. package/lib/utils/nextjs/plugin.d.ts +7 -1
  31. package/lib/utils/nextjs/plugin.js +8 -5
  32. package/lib/utils/nextjs/plugin.js.map +1 -1
  33. package/lib/utils/nextjs/plugin.mjs +8 -5
  34. package/lib/utils/nextjs/plugin.mjs.map +1 -1
  35. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,9 +6,17 @@
6
6
 
7
7
  ## Releases
8
8
 
9
+ ### 9.37.0-beta.2
10
+
11
+ - [fix] Fix `@ubnt/ui-components` module path resolving
12
+
13
+ ### 9.37.0-beta.1
14
+
15
+ - [fix] Fix `withUbntLibraries` issues
16
+
9
17
  ### 9.37.0-beta.0
10
18
 
11
- - Add SSR next-patch
19
+ - [Feat] Add `withUbntLibraries` and enable SSR support for `ui-components`
12
20
 
13
21
  > Upstream master
14
22
 
Binary file
Binary file
Binary file
Binary file
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_ReJhRoVe = require("../../../../../assets/ucgMax2.jpg");
6
+ var _externalAssets_DfjB$I0W = require("../../../../../assets/ucgMax.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_ReJhRoVe__default = /*#__PURE__*/_interopDefault(_externalAssets_ReJhRoVe);
12
+ var _externalAssets_DfjB$I0W__default = /*#__PURE__*/_interopDefault(_externalAssets_DfjB$I0W);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_ReJhRoVe__default["default"];
16
+ return _externalAssets_DfjB$I0W__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_ReJhRoVe).forEach(function (k) {
19
+ Object.keys(_externalAssets_DfjB$I0W).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_ReJhRoVe[k];
23
+ return _externalAssets_DfjB$I0W[k];
24
24
  }
25
25
  });
26
26
  });
@@ -1,3 +1,3 @@
1
- export * from "../../../../../assets/ucgMax2.jpg";
2
- export { default } from "../../../../../assets/ucgMax2.jpg";
1
+ export * from "../../../../../assets/ucgMax.jpg";
2
+ export { default } from "../../../../../assets/ucgMax.jpg";
3
3
  //# sourceMappingURL=ucgMax.jpg.mjs.map
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_sWF40Ihh = require("../../../../../assets/ucgUltra2.jpg");
6
+ var _externalAssets_BGAVPUHK = require("../../../../../assets/ucgUltra.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_sWF40Ihh__default = /*#__PURE__*/_interopDefault(_externalAssets_sWF40Ihh);
12
+ var _externalAssets_BGAVPUHK__default = /*#__PURE__*/_interopDefault(_externalAssets_BGAVPUHK);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_sWF40Ihh__default["default"];
16
+ return _externalAssets_BGAVPUHK__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_sWF40Ihh).forEach(function (k) {
19
+ Object.keys(_externalAssets_BGAVPUHK).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_sWF40Ihh[k];
23
+ return _externalAssets_BGAVPUHK[k];
24
24
  }
25
25
  });
26
26
  });
@@ -1,3 +1,3 @@
1
- export * from "../../../../../assets/ucgUltra2.jpg";
2
- export { default } from "../../../../../assets/ucgUltra2.jpg";
1
+ export * from "../../../../../assets/ucgUltra.jpg";
2
+ export { default } from "../../../../../assets/ucgUltra.jpg";
3
3
  //# sourceMappingURL=ucgUltra.jpg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var image = require("../../../../assets/ucgMax.jpg");
6
+ var image = require("../../../../assets/ucgMax2.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../assets/ucgMax.jpg";
2
- export { default } from "../../../../assets/ucgMax.jpg";
1
+ export * from "../../../../assets/ucgMax2.jpg";
2
+ export { default } from "../../../../assets/ucgMax2.jpg";
3
3
  //# sourceMappingURL=ucgMax.jpg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var image = require("../../../../assets/ucgUltra.jpg");
6
+ var image = require("../../../../assets/ucgUltra2.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../assets/ucgUltra.jpg";
2
- export { default } from "../../../../assets/ucgUltra.jpg";
1
+ export * from "../../../../assets/ucgUltra2.jpg";
2
+ export { default } from "../../../../assets/ucgUltra2.jpg";
3
3
  //# sourceMappingURL=ucgUltra.jpg.mjs.map
@@ -26,8 +26,8 @@ var _externalAssets_CmLfPohF = require("../../../assets/udmProMax.jpg");
26
26
  var _externalAssets_pESvYnSE = require("../../../assets/udmPro.jpg");
27
27
  var _externalAssets_BUotdZNw = require("../../../assets/udmProSpecial.jpg");
28
28
  var image = require("../../../assets/udw2.jpg");
29
- var _externalAssets_ReJhRoVe = require("../../../assets/ucgMax2.jpg");
30
- var _externalAssets_sWF40Ihh = require("../../../assets/ucgUltra2.jpg");
29
+ var _externalAssets_DfjB$I0W = require("../../../assets/ucgMax.jpg");
30
+ var _externalAssets_BGAVPUHK = require("../../../assets/ucgUltra.jpg");
31
31
  var image$1 = require("../../../assets/udr2.jpg");
32
32
  var image$2 = require("../../../assets/express.jpg");
33
33
  var nextAiInspection = require('./properties/nextAiInspection.js');
@@ -40,8 +40,8 @@ var _externalAssets_CmLfPohF__default = /*#__PURE__*/_interopDefault(_externalAs
40
40
  var _externalAssets_pESvYnSE__default = /*#__PURE__*/_interopDefault(_externalAssets_pESvYnSE);
41
41
  var _externalAssets_BUotdZNw__default = /*#__PURE__*/_interopDefault(_externalAssets_BUotdZNw);
42
42
  var image__default = /*#__PURE__*/_interopDefault(image);
43
- var _externalAssets_ReJhRoVe__default = /*#__PURE__*/_interopDefault(_externalAssets_ReJhRoVe);
44
- var _externalAssets_sWF40Ihh__default = /*#__PURE__*/_interopDefault(_externalAssets_sWF40Ihh);
43
+ var _externalAssets_DfjB$I0W__default = /*#__PURE__*/_interopDefault(_externalAssets_DfjB$I0W);
44
+ var _externalAssets_BGAVPUHK__default = /*#__PURE__*/_interopDefault(_externalAssets_BGAVPUHK);
45
45
  var image__default$1 = /*#__PURE__*/_interopDefault(image$1);
46
46
  var image__default$2 = /*#__PURE__*/_interopDefault(image$2);
47
47
  "use strict";
@@ -75,12 +75,12 @@ const udw = {
75
75
  };
76
76
  const ucgMax = {
77
77
  ...ucgMax$1.ucgMax,
78
- image: getImage(_externalAssets_ReJhRoVe__default["default"]),
78
+ image: getImage(_externalAssets_DfjB$I0W__default["default"]),
79
79
  notes: ["ucgMax.note.accessory"]
80
80
  };
81
81
  const ucgUltra = {
82
82
  ...ucgUltra$1.ucgUltra,
83
- image: getImage(_externalAssets_sWF40Ihh__default["default"])
83
+ image: getImage(_externalAssets_BGAVPUHK__default["default"])
84
84
  };
85
85
  const udr = {
86
86
  ...udr$1.udr,
@@ -24,8 +24,8 @@ import _externalAssets_CmLfPohF__default from "../../../assets/udmProMax.jpg";
24
24
  import _externalAssets_pESvYnSE__default from "../../../assets/udmPro.jpg";
25
25
  import _externalAssets_BUotdZNw__default from "../../../assets/udmProSpecial.jpg";
26
26
  import image__default from "../../../assets/udw2.jpg";
27
- import _externalAssets_ReJhRoVe__default from "../../../assets/ucgMax2.jpg";
28
- import _externalAssets_sWF40Ihh__default from "../../../assets/ucgUltra2.jpg";
27
+ import _externalAssets_DfjB$I0W__default from "../../../assets/ucgMax.jpg";
28
+ import _externalAssets_BGAVPUHK__default from "../../../assets/ucgUltra.jpg";
29
29
  import image__default$1 from "../../../assets/udr2.jpg";
30
30
  import image__default$2 from "../../../assets/express.jpg";
31
31
  import { nextAiInspection } from './properties/nextAiInspection.mjs';
@@ -60,12 +60,12 @@ const udw = {
60
60
  };
61
61
  const ucgMax = {
62
62
  ...ucgMax$1,
63
- image: getImage(_externalAssets_ReJhRoVe__default),
63
+ image: getImage(_externalAssets_DfjB$I0W__default),
64
64
  notes: ["ucgMax.note.accessory"]
65
65
  };
66
66
  const ucgUltra = {
67
67
  ...ucgUltra$1,
68
- image: getImage(_externalAssets_sWF40Ihh__default)
68
+ image: getImage(_externalAssets_BGAVPUHK__default)
69
69
  };
70
70
  const udr = {
71
71
  ...udr$1,
@@ -9,7 +9,7 @@ require('../../assets/applications.svg.js');
9
9
  require('../../assets/Consoles/ucgMax.jpg.js');
10
10
  require('../properties/index.js');
11
11
  var integratedWiFi6 = require('../properties/integratedWiFi6.js');
12
- var image = require("../../../../assets/ucgMax.jpg");
12
+ var image = require("../../../../assets/ucgMax2.jpg");
13
13
  var unifiAppSuite = require('../properties/unifiAppSuite.js');
14
14
  var StyleableSvgImage = require('../../../StyleableSvgImage/StyleableSvgImage.js');
15
15
  var applications = require("../../../../assets/applications.svg");
@@ -7,7 +7,7 @@ import '../../assets/applications.svg.mjs';
7
7
  import '../../assets/Consoles/ucgMax.jpg.mjs';
8
8
  import '../properties/index.mjs';
9
9
  import { integratedWiFi6 } from '../properties/integratedWiFi6.mjs';
10
- import image__default from "../../../../assets/ucgMax.jpg";
10
+ import image__default from "../../../../assets/ucgMax2.jpg";
11
11
  import { unifiAppSuite } from '../properties/unifiAppSuite.mjs';
12
12
  import { StyleableSvgImage } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
13
13
  import applications__default from "../../../../assets/applications.svg";
@@ -21,7 +21,7 @@ var unifiAppSuite = require('../properties/unifiAppSuite.js');
21
21
  var unifiDevices = require('../properties/unifiDevices.js');
22
22
  var wanPorts = require('../properties/wanPorts.js');
23
23
  var StyleableSvgImage$1 = require('../../../StyleableSvgImage/StyleableSvgImage.js');
24
- var image = require("../../../../assets/ucgUltra.jpg");
24
+ var image = require("../../../../assets/ucgUltra2.jpg");
25
25
  var applications = require("../../../../assets/wifi-device.svg");
26
26
  var nextAiInspection = require('../properties/nextAiInspection.js');
27
27
  function _interopDefault(e) {
@@ -19,7 +19,7 @@ import { unifiAppSuite } from '../properties/unifiAppSuite.mjs';
19
19
  import { unifiDevices } from '../properties/unifiDevices.mjs';
20
20
  import { wanPorts } from '../properties/wanPorts.mjs';
21
21
  import { StyleableSvgImage as StyleableSvgImage$1 } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
22
- import image__default from "../../../../assets/ucgUltra.jpg";
22
+ import image__default from "../../../../assets/ucgUltra2.jpg";
23
23
  import applications__default from "../../../../assets/wifi-device.svg";
24
24
  import { nextAiInspection } from '../properties/nextAiInspection.mjs';
25
25
  "use strict";
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_NxsKXHyJ = require("../../../../assets/black.svg");
6
+ var _externalAssets_WKvVtlSv = require("../../../../assets/black.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_NxsKXHyJ__default = /*#__PURE__*/_interopDefault(_externalAssets_NxsKXHyJ);
12
+ var _externalAssets_WKvVtlSv__default = /*#__PURE__*/_interopDefault(_externalAssets_WKvVtlSv);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_NxsKXHyJ__default["default"];
16
+ return _externalAssets_WKvVtlSv__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_NxsKXHyJ).forEach(function (k) {
19
+ Object.keys(_externalAssets_WKvVtlSv).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_NxsKXHyJ[k];
23
+ return _externalAssets_WKvVtlSv[k];
24
24
  }
25
25
  });
26
26
  });
@@ -6,7 +6,7 @@ require('./darkGrey.svg.js');
6
6
  require('./grey.svg.js');
7
7
  require('./lightGrey.svg.js');
8
8
  require('./white.svg.js');
9
- var _externalAssets_NxsKXHyJ = require("../../../../assets/black.svg");
9
+ var _externalAssets_WKvVtlSv = require("../../../../assets/black.svg");
10
10
  var _externalAssets_DTFMFQ51 = require("../../../../assets/blue.svg");
11
11
  var _externalAssets_B1Gj17va = require("../../../../assets/darkGrey.svg");
12
12
  var _externalAssets_So87DWAv = require("../../../../assets/grey.svg");
@@ -17,7 +17,7 @@ function _interopDefault(e) {
17
17
  default: e
18
18
  };
19
19
  }
20
- var _externalAssets_NxsKXHyJ__default = /*#__PURE__*/_interopDefault(_externalAssets_NxsKXHyJ);
20
+ var _externalAssets_WKvVtlSv__default = /*#__PURE__*/_interopDefault(_externalAssets_WKvVtlSv);
21
21
  var _externalAssets_DTFMFQ51__default = /*#__PURE__*/_interopDefault(_externalAssets_DTFMFQ51);
22
22
  var _externalAssets_B1Gj17va__default = /*#__PURE__*/_interopDefault(_externalAssets_B1Gj17va);
23
23
  var _externalAssets_So87DWAv__default = /*#__PURE__*/_interopDefault(_externalAssets_So87DWAv);
@@ -27,7 +27,7 @@ var _externalAssets_Dh1AHi98__default = /*#__PURE__*/_interopDefault(_externalAs
27
27
  Object.defineProperty(exports, "black", {
28
28
  enumerable: true,
29
29
  get: function () {
30
- return _externalAssets_NxsKXHyJ__default["default"];
30
+ return _externalAssets_WKvVtlSv__default["default"];
31
31
  }
32
32
  });
33
33
  Object.defineProperty(exports, "blue", {
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_WKvVtlSv = require("../../../../assets/black.svg");
6
+ var _externalAssets_NxsKXHyJ = require("../../../../assets/black.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_WKvVtlSv__default = /*#__PURE__*/_interopDefault(_externalAssets_WKvVtlSv);
12
+ var _externalAssets_NxsKXHyJ__default = /*#__PURE__*/_interopDefault(_externalAssets_NxsKXHyJ);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_WKvVtlSv__default["default"];
16
+ return _externalAssets_NxsKXHyJ__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_WKvVtlSv).forEach(function (k) {
19
+ Object.keys(_externalAssets_NxsKXHyJ).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_WKvVtlSv[k];
23
+ return _externalAssets_NxsKXHyJ[k];
24
24
  }
25
25
  });
26
26
  });
@@ -6,7 +6,7 @@ require('./camo.png.js');
6
6
  require('./concrete.png.js');
7
7
  require('./marble.png.js');
8
8
  require('./wood.png.js');
9
- var _externalAssets_WKvVtlSv = require("../../../../assets/black.svg");
9
+ var _externalAssets_NxsKXHyJ = require("../../../../assets/black.svg");
10
10
  var _externalAssets_DxR_vr6$ = require("../../../../assets/blackFabric.png");
11
11
  var _externalAssets_D_2KPJKL = require("../../../../assets/camo.png");
12
12
  var _externalAssets_AeQRmq$G = require("../../../../assets/concrete.png");
@@ -17,7 +17,7 @@ function _interopDefault(e) {
17
17
  default: e
18
18
  };
19
19
  }
20
- var _externalAssets_WKvVtlSv__default = /*#__PURE__*/_interopDefault(_externalAssets_WKvVtlSv);
20
+ var _externalAssets_NxsKXHyJ__default = /*#__PURE__*/_interopDefault(_externalAssets_NxsKXHyJ);
21
21
  var _externalAssets_DxR_vr6$__default = /*#__PURE__*/_interopDefault(_externalAssets_DxR_vr6$);
22
22
  var _externalAssets_D_2KPJKL__default = /*#__PURE__*/_interopDefault(_externalAssets_D_2KPJKL);
23
23
  var _externalAssets_AeQRmq$G__default = /*#__PURE__*/_interopDefault(_externalAssets_AeQRmq$G);
@@ -27,7 +27,7 @@ var _externalAssets_kQL$tT0V__default = /*#__PURE__*/_interopDefault(_externalAs
27
27
  Object.defineProperty(exports, "black", {
28
28
  enumerable: true,
29
29
  get: function () {
30
- return _externalAssets_WKvVtlSv__default["default"];
30
+ return _externalAssets_NxsKXHyJ__default["default"];
31
31
  }
32
32
  });
33
33
  Object.defineProperty(exports, "blackFabric", {
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  require('./icons/index.js');
4
- var _externalAssets_WKvVtlSv = require("../assets/black.svg");
4
+ var _externalAssets_NxsKXHyJ = require("../assets/black.svg");
5
5
  var _externalAssets_DxR_vr6$ = require("../assets/blackFabric.png");
6
6
  var _externalAssets_D_2KPJKL = require("../assets/camo.png");
7
7
  var _externalAssets_AeQRmq$G = require("../assets/concrete.png");
8
8
  var _externalAssets_CoJwwvt7 = require("../assets/marble.png");
9
9
  var _externalAssets_kQL$tT0V = require("../assets/wood.png");
10
- var _externalAssets_NxsKXHyJ = require("../assets/black.svg");
10
+ var _externalAssets_WKvVtlSv = require("../assets/black.svg");
11
11
  var _externalAssets_DTFMFQ51 = require("../assets/blue.svg");
12
12
  var _externalAssets_Dh1AHi98 = require("../assets/white.svg");
13
13
  var _externalAssets_B1Gj17va = require("../assets/darkGrey.svg");
@@ -18,13 +18,13 @@ function _interopDefault(e) {
18
18
  default: e
19
19
  };
20
20
  }
21
- var _externalAssets_WKvVtlSv__default = /*#__PURE__*/_interopDefault(_externalAssets_WKvVtlSv);
21
+ var _externalAssets_NxsKXHyJ__default = /*#__PURE__*/_interopDefault(_externalAssets_NxsKXHyJ);
22
22
  var _externalAssets_DxR_vr6$__default = /*#__PURE__*/_interopDefault(_externalAssets_DxR_vr6$);
23
23
  var _externalAssets_D_2KPJKL__default = /*#__PURE__*/_interopDefault(_externalAssets_D_2KPJKL);
24
24
  var _externalAssets_AeQRmq$G__default = /*#__PURE__*/_interopDefault(_externalAssets_AeQRmq$G);
25
25
  var _externalAssets_CoJwwvt7__default = /*#__PURE__*/_interopDefault(_externalAssets_CoJwwvt7);
26
26
  var _externalAssets_kQL$tT0V__default = /*#__PURE__*/_interopDefault(_externalAssets_kQL$tT0V);
27
- var _externalAssets_NxsKXHyJ__default = /*#__PURE__*/_interopDefault(_externalAssets_NxsKXHyJ);
27
+ var _externalAssets_WKvVtlSv__default = /*#__PURE__*/_interopDefault(_externalAssets_WKvVtlSv);
28
28
  var _externalAssets_DTFMFQ51__default = /*#__PURE__*/_interopDefault(_externalAssets_DTFMFQ51);
29
29
  var _externalAssets_Dh1AHi98__default = /*#__PURE__*/_interopDefault(_externalAssets_Dh1AHi98);
30
30
  var _externalAssets_B1Gj17va__default = /*#__PURE__*/_interopDefault(_externalAssets_B1Gj17va);
@@ -53,7 +53,7 @@ var OptionColors = /* @__PURE__ */(OptionColors2 => {
53
53
  return OptionColors2;
54
54
  })(OptionColors || {});
55
55
  const optionStyle = {
56
- ["black" /* black */]: _externalAssets_WKvVtlSv__default["default"],
56
+ ["black" /* black */]: _externalAssets_NxsKXHyJ__default["default"],
57
57
  ["black-fabric" /* blackFabric */]: _externalAssets_DxR_vr6$__default["default"],
58
58
  ["camo" /* camo */]: _externalAssets_D_2KPJKL__default["default"],
59
59
  ["concrete" /* concrete */]: _externalAssets_AeQRmq$G__default["default"],
@@ -62,7 +62,7 @@ const optionStyle = {
62
62
  };
63
63
  const optionColors = {
64
64
  // Common
65
- ["black" /* black */]: _externalAssets_NxsKXHyJ__default["default"],
65
+ ["black" /* black */]: _externalAssets_WKvVtlSv__default["default"],
66
66
  ["blue" /* blue */]: _externalAssets_DTFMFQ51__default["default"],
67
67
  ["white" /* white */]: _externalAssets_Dh1AHi98__default["default"],
68
68
  // US English
@@ -1,11 +1,11 @@
1
1
  import './icons/index.mjs';
2
- import _externalAssets_WKvVtlSv__default from "../assets/black.svg";
2
+ import _externalAssets_NxsKXHyJ__default from "../assets/black.svg";
3
3
  import _externalAssets_DxR_vr6$__default from "../assets/blackFabric.png";
4
4
  import _externalAssets_D_2KPJKL__default from "../assets/camo.png";
5
5
  import _externalAssets_AeQRmq$G__default from "../assets/concrete.png";
6
6
  import _externalAssets_CoJwwvt7__default from "../assets/marble.png";
7
7
  import _externalAssets_kQL$tT0V__default from "../assets/wood.png";
8
- import _externalAssets_NxsKXHyJ__default from "../assets/black.svg";
8
+ import _externalAssets_WKvVtlSv__default from "../assets/black.svg";
9
9
  import _externalAssets_DTFMFQ51__default from "../assets/blue.svg";
10
10
  import _externalAssets_Dh1AHi98__default from "../assets/white.svg";
11
11
  import _externalAssets_B1Gj17va__default from "../assets/darkGrey.svg";
@@ -34,7 +34,7 @@ var OptionColors = /* @__PURE__ */(OptionColors2 => {
34
34
  return OptionColors2;
35
35
  })(OptionColors || {});
36
36
  const optionStyle = {
37
- ["black" /* black */]: _externalAssets_WKvVtlSv__default,
37
+ ["black" /* black */]: _externalAssets_NxsKXHyJ__default,
38
38
  ["black-fabric" /* blackFabric */]: _externalAssets_DxR_vr6$__default,
39
39
  ["camo" /* camo */]: _externalAssets_D_2KPJKL__default,
40
40
  ["concrete" /* concrete */]: _externalAssets_AeQRmq$G__default,
@@ -43,7 +43,7 @@ const optionStyle = {
43
43
  };
44
44
  const optionColors = {
45
45
  // Common
46
- ["black" /* black */]: _externalAssets_NxsKXHyJ__default,
46
+ ["black" /* black */]: _externalAssets_WKvVtlSv__default,
47
47
  ["blue" /* blue */]: _externalAssets_DTFMFQ51__default,
48
48
  ["white" /* white */]: _externalAssets_Dh1AHi98__default,
49
49
  // US English
@@ -17,8 +17,8 @@ var fs__default = /*#__PURE__*/_interopDefault(fs);
17
17
  var path__default = /*#__PURE__*/_interopDefault(path);
18
18
  "use strict";
19
19
  function patchUiComponentsAndIcons() {
20
- const uiComponentsPath = path__default["default"].resolve(__dirname, "../node_modules/@ubnt/ui-components");
21
- const ourStyleInjectPath = path__default["default"].resolve(__dirname, "./src/style-inject.mjs");
20
+ const uiComponentsPath = path__default["default"].dirname(require.resolve("@ubnt/ui-components"));
21
+ const ourStyleInjectPath = path__default["default"].resolve(__dirname, "./ssr/style-inject.mjs");
22
22
  const originalStyleInjectPath = path__default["default"].resolve(uiComponentsPath, "./docs/helpers/style-inject.es.js");
23
23
  fs__default["default"].copyFileSync(ourStyleInjectPath, originalStyleInjectPath);
24
24
  const files = glob.sync("**/*.module.css.js", {
@@ -1 +1 @@
1
- {"version":3,"file":"patch.js","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.resolve(__dirname, \"../node_modules/@ubnt/icons\");\n const uiComponentsPath = path.resolve(\n __dirname,\n \"../node_modules/@ubnt/ui-components\",\n );\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./src/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","resolve","__dirname","ourStyleInjectPath","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,aAAAA,CAAAA,SAAAA,CAAK,CAAAC,OAAA,CAC5BC,SAAA,EACA,qCAAA,CACF;EAwFA,MAAMC,kBAAqB,GAAAH,aAAA,CAAA,SAAA,CAAA,CAAKC,OAAQ,CAAAC,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAME,0BAA0BJ,aAAAA,CAAAA,SAAAA,CAAK,CAAAC,OAAA,CACnCF,gBAAA,EACA,mCAAA,CACF;EAEGM,WAAAA,CAAAA,SAAAA,CAAA,CAAAC,YAAA,CAAaH,oBAAoBC,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,UAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAV,gBAAA;IACLW,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,WAAAA,CAAAA,SAAAA,CAAG,CAAAQ,YAAA,CAAab,wBAAK,CAAAC,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,mBAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAAA,CAAAA,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,WAAA,CAAA,SAAA,CAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
1
+ {"version":3,"file":"patch.js","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.dirname(require.resolve(\"@ubnt/icons\"));\n const uiComponentsPath = path.dirname(require.resolve(\"@ubnt/ui-components\"));\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./ssr/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","dirname","require","resolve","ourStyleInjectPath","__dirname","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,aAAAA,CAAAA,SAAAA,CAAK,CAAAC,OAAA,CAAQC,OAAQ,CAAAC,OAAA,CAAQ,qBAAqB,CAAC,CAAA;EAwF5E,MAAMC,kBAAqB,GAAAJ,aAAA,CAAA,SAAA,CAAA,CAAKG,OAAQ,CAAAE,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAMC,0BAA0BN,aAAAA,CAAAA,SAAAA,CAAK,CAAAG,OAAA,CACnCJ,gBAAA,EACA,mCAAA,CACF;EAEGQ,WAAAA,CAAAA,SAAAA,CAAA,CAAAC,YAAA,CAAaJ,oBAAoBE,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,UAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAZ,gBAAA;IACLa,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,WAAAA,CAAAA,SAAAA,CAAG,CAAAQ,YAAA,CAAaf,wBAAK,CAAAG,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,mBAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAAA,CAAAA,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,WAAA,CAAA,SAAA,CAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
@@ -5,8 +5,8 @@ import path from 'node:path';
5
5
  import { transformCssModule } from './ssr/transform-css-module.mjs';
6
6
  "use strict";
7
7
  function patchUiComponentsAndIcons() {
8
- const uiComponentsPath = path.resolve(__dirname, "../node_modules/@ubnt/ui-components");
9
- const ourStyleInjectPath = path.resolve(__dirname, "./src/style-inject.mjs");
8
+ const uiComponentsPath = path.dirname(require.resolve("@ubnt/ui-components"));
9
+ const ourStyleInjectPath = path.resolve(__dirname, "./ssr/style-inject.mjs");
10
10
  const originalStyleInjectPath = path.resolve(uiComponentsPath, "./docs/helpers/style-inject.es.js");
11
11
  fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);
12
12
  const files = sync("**/*.module.css.js", {
@@ -1 +1 @@
1
- {"version":3,"file":"patch.mjs","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.resolve(__dirname, \"../node_modules/@ubnt/icons\");\n const uiComponentsPath = path.resolve(\n __dirname,\n \"../node_modules/@ubnt/ui-components\",\n );\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./src/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","resolve","__dirname","ourStyleInjectPath","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,IAAK,CAAAC,OAAA,CAC5BC,SAAA,EACA,qCAAA,CACF;EAwFA,MAAMC,kBAAqB,GAAAH,IAAA,CAAKC,OAAQ,CAAAC,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAME,0BAA0BJ,IAAK,CAAAC,OAAA,CACnCF,gBAAA,EACA,mCAAA,CACF;EAEGM,EAAA,CAAAC,YAAA,CAAaH,oBAAoBC,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,KAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAV,gBAAA;IACLW,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,EAAG,CAAAQ,YAAA,CAAab,IAAK,CAAAC,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,cAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,EAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
1
+ {"version":3,"file":"patch.mjs","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.dirname(require.resolve(\"@ubnt/icons\"));\n const uiComponentsPath = path.dirname(require.resolve(\"@ubnt/ui-components\"));\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./ssr/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","dirname","require","resolve","ourStyleInjectPath","__dirname","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,IAAK,CAAAC,OAAA,CAAQC,OAAQ,CAAAC,OAAA,CAAQ,qBAAqB,CAAC,CAAA;EAwF5E,MAAMC,kBAAqB,GAAAJ,IAAA,CAAKG,OAAQ,CAAAE,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAMC,0BAA0BN,IAAK,CAAAG,OAAA,CACnCJ,gBAAA,EACA,mCAAA,CACF;EAEGQ,EAAA,CAAAC,YAAA,CAAaJ,oBAAoBE,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,KAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAZ,gBAAA;IACLa,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,EAAG,CAAAQ,YAAA,CAAaf,IAAK,CAAAG,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,cAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,EAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
@@ -1,8 +1,14 @@
1
1
  import type { NextConfig } from "next";
2
+ export type WithUbntLibrariesConfig = {
3
+ /**
4
+ * ESM Modules to transpile
5
+ */
6
+ transpilePackages?: string[];
7
+ };
2
8
  /**
3
9
  * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common
4
10
  * patterns for next.js projects
5
11
  *
6
12
  * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!
7
13
  */
8
- export declare function withUbntLibraries(): (nextConfig: NextConfig) => NextConfig;
14
+ export declare function withUbntLibraries(options?: WithUbntLibrariesConfig): (nextConfig: NextConfig) => NextConfig;
@@ -1,10 +1,13 @@
1
1
  'use strict';
2
2
 
3
+ var array = require('../array.js');
3
4
  var patch = require('./patch.js');
4
5
  "use strict";
5
- function withUbntLibraries() {
6
+ function withUbntLibraries(options) {
6
7
  patch["default"]();
7
8
  const transpilePackages = [
9
+ // Extra libs
10
+ ...(options?.transpilePackages ?? []),
8
11
  // Core repos
9
12
  "@ubnt/ui-components", "@ubnt/icons", "@ubnt/store.core",
10
13
  // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...
@@ -13,13 +16,13 @@ function withUbntLibraries() {
13
16
  if (!nextConfig.experimental) {
14
17
  nextConfig.experimental = {};
15
18
  }
16
- nextConfig.experimental.optimizePackageImports = [...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages];
17
- nextConfig.transpilePackages = [...(nextConfig.transpilePackages ?? []), ...transpilePackages];
19
+ nextConfig.experimental.optimizePackageImports = array.dedupe([...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages]);
20
+ nextConfig.transpilePackages = array.dedupe([...(nextConfig.transpilePackages ?? []), ...transpilePackages]);
18
21
  nextConfig.experimental.esmExternals = "loose";
19
22
  const oldWebpackFn = nextConfig.webpack;
20
- nextConfig.webpack = (webpackConfig, options) => {
23
+ nextConfig.webpack = (webpackConfig, options2) => {
21
24
  if (oldWebpackFn) {
22
- webpackConfig = oldWebpackFn(webpackConfig, options);
25
+ webpackConfig = oldWebpackFn(webpackConfig, options2);
23
26
  }
24
27
  const jsExtIndex = webpackConfig.resolve.extensions.indexOf(".js");
25
28
  const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(".mjs");
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport patchUiComponentsAndIcons from \"./patch\";\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(/* placeholder for future, options */) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = [\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ];\n nextConfig.transpilePackages = [\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ];\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","esmExternals","oldWebpackFn","webpack","webpackConfig","options","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;;AAUO,SAASA,iBAAyDA,CAAA,EAAA;EAI7CC,KAAAA,CAAAA,SAAAA,CAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACAD,UAAA,CAAWC,aAAaC,sBAAyB,GAAA,CAC/C,IAAIF,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACL;IACAC,UAAA,CAAWD,iBAAoB,GAAA,CAC7B,IAAIC,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACL;IAWAC,UAAA,CAAWC,aAAaE,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeJ,UAAW,CAAAK,OAAA;IACrBL,UAAA,CAAAK,OAAA,GAAU,CAACC,aAAA,EAAeC,OAAY,KAAA;MAC/C,IAAIH,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeC,OAAO,CAAA;MACrD;MAEA,MAAMC,UAAa,GAAAF,aAAA,CAAcG,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAN,aAAA,CAAcG,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDF,aAAA,CAAAG,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCF,aAAA,CAAAG,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAN,aAAA;IAAA,CACT;IAEO,OAAAN,UAAA;EAAA,CACT;AACF;"}
1
+ {"version":3,"file":"plugin.js","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport { dedupe } from \"../array\";\nimport patchUiComponentsAndIcons from \"./patch\";\n\nexport type WithUbntLibrariesConfig = {\n /**\n * ESM Modules to transpile\n */\n transpilePackages?: string[];\n};\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(options?: WithUbntLibrariesConfig) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Extra libs\n ...(options?.transpilePackages ?? []),\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = dedupe([\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ]);\n nextConfig.transpilePackages = dedupe([\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ]);\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","options","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","dedupe","esmExternals","oldWebpackFn","webpack","webpackConfig","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;;;AAkBO,SAASA,kBAAkBC,OAAmC,EAAA;EAIzCC,KAAAA,CAAAA,SAAAA,CAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,IAAIF,OAAS,EAAAE,iBAAA,IAAqB,EAAC;EAAA;EAEnC,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACWD,UAAA,CAAAC,YAAA,CAAaC,yBAAyBC,YAAO,CAAA,CACtD,IAAIH,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACJ,CAAA;IACDC,UAAA,CAAWD,oBAAoBI,YAAO,CAAA,CACpC,IAAIH,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACJ,CAAA;IAWDC,UAAA,CAAWC,aAAaG,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeL,UAAW,CAAAM,OAAA;IACrBN,UAAA,CAAAM,OAAA,GAAU,CAACC,aAAA,EAAeV,QAAY,KAAA;MAC/C,IAAIQ,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeV,QAAO,CAAA;MACrD;MAEA,MAAMW,UAAa,GAAAD,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAL,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAL,aAAA;IAAA,CACT;IAEO,OAAAP,UAAA;EAAA,CACT;AACF;"}
@@ -1,8 +1,11 @@
1
+ import { dedupe } from '../array.mjs';
1
2
  import patchUiComponentsAndIcons from './patch.mjs';
2
3
  "use strict";
3
- function withUbntLibraries() {
4
+ function withUbntLibraries(options) {
4
5
  patchUiComponentsAndIcons();
5
6
  const transpilePackages = [
7
+ // Extra libs
8
+ ...(options?.transpilePackages ?? []),
6
9
  // Core repos
7
10
  "@ubnt/ui-components", "@ubnt/icons", "@ubnt/store.core",
8
11
  // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...
@@ -11,13 +14,13 @@ function withUbntLibraries() {
11
14
  if (!nextConfig.experimental) {
12
15
  nextConfig.experimental = {};
13
16
  }
14
- nextConfig.experimental.optimizePackageImports = [...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages];
15
- nextConfig.transpilePackages = [...(nextConfig.transpilePackages ?? []), ...transpilePackages];
17
+ nextConfig.experimental.optimizePackageImports = dedupe([...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages]);
18
+ nextConfig.transpilePackages = dedupe([...(nextConfig.transpilePackages ?? []), ...transpilePackages]);
16
19
  nextConfig.experimental.esmExternals = "loose";
17
20
  const oldWebpackFn = nextConfig.webpack;
18
- nextConfig.webpack = (webpackConfig, options) => {
21
+ nextConfig.webpack = (webpackConfig, options2) => {
19
22
  if (oldWebpackFn) {
20
- webpackConfig = oldWebpackFn(webpackConfig, options);
23
+ webpackConfig = oldWebpackFn(webpackConfig, options2);
21
24
  }
22
25
  const jsExtIndex = webpackConfig.resolve.extensions.indexOf(".js");
23
26
  const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(".mjs");
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport patchUiComponentsAndIcons from \"./patch\";\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(/* placeholder for future, options */) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = [\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ];\n nextConfig.transpilePackages = [\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ];\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","esmExternals","oldWebpackFn","webpack","webpackConfig","options","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;AAUO,SAASA,iBAAyDA,CAAA,EAAA;EAI7CC,yBAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACAD,UAAA,CAAWC,aAAaC,sBAAyB,GAAA,CAC/C,IAAIF,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACL;IACAC,UAAA,CAAWD,iBAAoB,GAAA,CAC7B,IAAIC,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACL;IAWAC,UAAA,CAAWC,aAAaE,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeJ,UAAW,CAAAK,OAAA;IACrBL,UAAA,CAAAK,OAAA,GAAU,CAACC,aAAA,EAAeC,OAAY,KAAA;MAC/C,IAAIH,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeC,OAAO,CAAA;MACrD;MAEA,MAAMC,UAAa,GAAAF,aAAA,CAAcG,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAN,aAAA,CAAcG,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDF,aAAA,CAAAG,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCF,aAAA,CAAAG,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAN,aAAA;IAAA,CACT;IAEO,OAAAN,UAAA;EAAA,CACT;AACF;"}
1
+ {"version":3,"file":"plugin.mjs","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport { dedupe } from \"../array\";\nimport patchUiComponentsAndIcons from \"./patch\";\n\nexport type WithUbntLibrariesConfig = {\n /**\n * ESM Modules to transpile\n */\n transpilePackages?: string[];\n};\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(options?: WithUbntLibrariesConfig) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Extra libs\n ...(options?.transpilePackages ?? []),\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = dedupe([\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ]);\n nextConfig.transpilePackages = dedupe([\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ]);\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","options","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","dedupe","esmExternals","oldWebpackFn","webpack","webpackConfig","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;AAkBO,SAASA,kBAAkBC,OAAmC,EAAA;EAIzCC,yBAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,IAAIF,OAAS,EAAAE,iBAAA,IAAqB,EAAC;EAAA;EAEnC,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACWD,UAAA,CAAAC,YAAA,CAAaC,yBAAyBC,MAAO,CAAA,CACtD,IAAIH,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACJ,CAAA;IACDC,UAAA,CAAWD,oBAAoBI,MAAO,CAAA,CACpC,IAAIH,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACJ,CAAA;IAWDC,UAAA,CAAWC,aAAaG,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeL,UAAW,CAAAM,OAAA;IACrBN,UAAA,CAAAM,OAAA,GAAU,CAACC,aAAA,EAAeV,QAAY,KAAA;MAC/C,IAAIQ,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeV,QAAO,CAAA;MACrD;MAEA,MAAMW,UAAa,GAAAD,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAL,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAL,aAAA;IAAA,CACT;IAEO,OAAAP,UAAA;EAAA,CACT;AACF;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubnt/store.core",
3
- "version": "9.37.0-beta.0",
3
+ "version": "9.37.0-beta.2",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "scripts": {