@dr.pogodin/react-utils 1.30.2 → 1.31.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.
Files changed (140) hide show
  1. package/bin/build.js +5 -0
  2. package/build/development/client/index.js +1 -1
  3. package/build/development/client/index.js.map +1 -1
  4. package/build/development/index.js +8 -1
  5. package/build/development/index.js.map +1 -1
  6. package/build/development/server/index.js +1 -1
  7. package/build/development/server/index.js.map +1 -1
  8. package/build/development/server/utils/index.js +1 -1
  9. package/build/development/shared/components/Checkbox/index.js +2 -2
  10. package/build/development/shared/components/Checkbox/index.js.map +1 -1
  11. package/build/development/shared/components/Input/index.js +2 -2
  12. package/build/development/shared/components/Input/index.js.map +1 -1
  13. package/build/development/shared/components/Modal/index.js +40 -5
  14. package/build/development/shared/components/Modal/index.js.map +1 -1
  15. package/build/development/shared/components/TextArea/index.js +5 -0
  16. package/build/development/shared/components/TextArea/index.js.map +1 -1
  17. package/build/development/shared/components/WithTooltip/index.js +1 -1
  18. package/build/development/shared/components/WithTooltip/index.js.map +1 -1
  19. package/build/development/shared/components/YouTubeVideo/index.js +1 -3
  20. package/build/development/shared/components/YouTubeVideo/index.js.map +1 -1
  21. package/build/development/shared/components/index.js +28 -15
  22. package/build/development/shared/components/index.js.map +1 -1
  23. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js +85 -0
  24. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -0
  25. package/build/development/shared/components/selectors/CustomDropdown/index.js +105 -0
  26. package/build/development/shared/components/selectors/CustomDropdown/index.js.map +1 -0
  27. package/build/development/shared/components/{Dropdown → selectors/NativeDropdown}/index.js +25 -34
  28. package/build/development/shared/components/selectors/NativeDropdown/index.js.map +1 -0
  29. package/build/development/shared/components/selectors/Switch/index.js +76 -0
  30. package/build/development/shared/components/selectors/Switch/index.js.map +1 -0
  31. package/build/development/shared/components/selectors/common.js +24 -0
  32. package/build/development/shared/components/selectors/common.js.map +1 -0
  33. package/build/development/shared/components/selectors/index.js +28 -0
  34. package/build/development/shared/components/selectors/index.js.map +1 -0
  35. package/build/development/shared/utils/index.js +1 -1
  36. package/build/development/shared/utils/index.js.map +1 -1
  37. package/build/development/shared/utils/jest/E2eSsrEnv.js +3 -0
  38. package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  39. package/build/development/shared/utils/jest/index.js +1 -1
  40. package/build/development/shared/utils/jest/index.js.map +1 -1
  41. package/build/development/style.css +387 -225
  42. package/build/development/web.bundle.js +113 -53
  43. package/build/production/client/index.js +1 -1
  44. package/build/production/client/index.js.map +1 -1
  45. package/build/production/index.js +1 -1
  46. package/build/production/index.js.map +1 -1
  47. package/build/production/server/index.js +1 -1
  48. package/build/production/server/index.js.map +1 -1
  49. package/build/production/server/utils/index.js +1 -1
  50. package/build/production/shared/components/Checkbox/index.js +2 -2
  51. package/build/production/shared/components/Checkbox/index.js.map +1 -1
  52. package/build/production/shared/components/Input/index.js +1 -1
  53. package/build/production/shared/components/Input/index.js.map +1 -1
  54. package/build/production/shared/components/Modal/index.js +4 -2
  55. package/build/production/shared/components/Modal/index.js.map +1 -1
  56. package/build/production/shared/components/TextArea/index.js +3 -3
  57. package/build/production/shared/components/TextArea/index.js.map +1 -1
  58. package/build/production/shared/components/WithTooltip/index.js +1 -1
  59. package/build/production/shared/components/WithTooltip/index.js.map +1 -1
  60. package/build/production/shared/components/YouTubeVideo/index.js +2 -2
  61. package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
  62. package/build/production/shared/components/index.js +1 -1
  63. package/build/production/shared/components/index.js.map +1 -1
  64. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js +7 -0
  65. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -0
  66. package/build/production/shared/components/selectors/CustomDropdown/index.js +4 -0
  67. package/build/production/shared/components/selectors/CustomDropdown/index.js.map +1 -0
  68. package/build/production/shared/components/selectors/NativeDropdown/index.js +25 -0
  69. package/build/production/shared/components/selectors/NativeDropdown/index.js.map +1 -0
  70. package/build/production/shared/components/selectors/Switch/index.js +2 -0
  71. package/build/production/shared/components/selectors/Switch/index.js.map +1 -0
  72. package/build/production/shared/components/selectors/common.js +3 -0
  73. package/build/production/shared/components/selectors/common.js.map +1 -0
  74. package/build/production/shared/components/selectors/index.js +2 -0
  75. package/build/production/shared/components/selectors/index.js.map +1 -0
  76. package/build/production/shared/utils/index.js +1 -1
  77. package/build/production/shared/utils/index.js.map +1 -1
  78. package/build/production/shared/utils/jest/E2eSsrEnv.js +3 -1
  79. package/build/production/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  80. package/build/production/shared/utils/jest/index.js +1 -1
  81. package/build/production/shared/utils/jest/index.js.map +1 -1
  82. package/build/production/style.css +1 -1
  83. package/build/production/style.css.map +1 -1
  84. package/build/production/web.bundle.js +1 -1
  85. package/build/production/web.bundle.js.map +1 -1
  86. package/build/types-code/client/index.d.ts +1 -0
  87. package/build/types-code/index.d.ts +1 -1
  88. package/build/types-code/shared/components/Checkbox/index.d.ts +1 -1
  89. package/build/types-code/shared/components/Input/index.d.ts +1 -1
  90. package/build/types-code/shared/components/Modal/index.d.ts +3 -1
  91. package/build/types-code/shared/components/TextArea/index.d.ts +1 -0
  92. package/build/types-code/shared/components/index.d.ts +1 -2
  93. package/build/types-code/shared/components/selectors/CustomDropdown/Options/index.d.ts +17 -0
  94. package/build/types-code/shared/components/selectors/CustomDropdown/index.d.ts +4 -0
  95. package/build/types-code/shared/components/selectors/NativeDropdown/index.d.ts +3 -0
  96. package/build/types-code/shared/components/selectors/Switch/index.d.ts +13 -0
  97. package/build/types-code/shared/components/selectors/common.d.ts +27 -0
  98. package/build/types-code/shared/components/selectors/index.d.ts +3 -0
  99. package/build/types-scss/src/shared/components/Modal/styles.scss.d.ts +1 -0
  100. package/build/types-scss/src/shared/components/selectors/CustomDropdown/Options/style.scss.d.ts +1 -0
  101. package/build/types-scss/src/shared/components/selectors/CustomDropdown/theme.scss.d.ts +10 -0
  102. package/build/types-scss/src/shared/components/{Dropdown → selectors/NativeDropdown}/theme.scss.d.ts +1 -0
  103. package/build/types-scss/src/shared/components/selectors/Switch/theme.scss.d.ts +6 -0
  104. package/package.json +30 -30
  105. package/src/client/index.tsx +2 -1
  106. package/src/index.ts +1 -0
  107. package/src/shared/components/Button/style.scss +1 -0
  108. package/src/shared/components/Checkbox/index.tsx +3 -3
  109. package/src/shared/components/Input/index.tsx +3 -3
  110. package/src/shared/components/Modal/base-theme.scss +1 -1
  111. package/src/shared/components/Modal/index.tsx +40 -5
  112. package/src/shared/components/Modal/styles.scss +2 -4
  113. package/src/shared/components/TextArea/index.tsx +5 -0
  114. package/src/shared/components/TextArea/style.scss +8 -0
  115. package/src/shared/components/YouTubeVideo/base.scss +3 -1
  116. package/src/shared/components/YouTubeVideo/index.tsx +2 -3
  117. package/src/shared/components/index.ts +2 -2
  118. package/src/shared/components/selectors/CustomDropdown/Options/index.tsx +107 -0
  119. package/src/shared/components/selectors/CustomDropdown/Options/style.scss +6 -0
  120. package/src/shared/components/selectors/CustomDropdown/index.tsx +115 -0
  121. package/src/shared/components/selectors/CustomDropdown/theme.scss +90 -0
  122. package/src/shared/components/{Dropdown → selectors/NativeDropdown}/index.tsx +21 -50
  123. package/src/shared/components/{Dropdown → selectors/NativeDropdown}/theme.scss +5 -0
  124. package/src/shared/components/selectors/Switch/index.tsx +94 -0
  125. package/src/shared/components/selectors/Switch/theme.scss +39 -0
  126. package/src/shared/components/selectors/common.ts +54 -0
  127. package/src/shared/components/selectors/index.ts +3 -0
  128. package/src/shared/utils/jest/E2eSsrEnv.ts +5 -1
  129. package/build/development/shared/components/Dropdown/index.js.map +0 -1
  130. package/build/development/shared/components/ScalableRect/index.js +0 -80
  131. package/build/development/shared/components/ScalableRect/index.js.map +0 -1
  132. package/build/production/shared/components/Dropdown/index.js +0 -24
  133. package/build/production/shared/components/Dropdown/index.js.map +0 -1
  134. package/build/production/shared/components/ScalableRect/index.js +0 -21
  135. package/build/production/shared/components/ScalableRect/index.js.map +0 -1
  136. package/build/types-code/shared/components/Dropdown/index.d.ts +0 -17
  137. package/build/types-code/shared/components/ScalableRect/index.d.ts +0 -19
  138. package/build/types-scss/src/shared/components/ScalableRect/style.scss.d.ts +0 -2
  139. package/src/shared/components/ScalableRect/index.tsx +0 -84
  140. package/src/shared/components/ScalableRect/style.scss +0 -10
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "CustomDropdown", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _CustomDropdown.default;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "Dropdown", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _NativeDropdown.default;
17
+ }
18
+ });
19
+ Object.defineProperty(exports, "Switch", {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _Switch.default;
23
+ }
24
+ });
25
+ var _CustomDropdown = _interopRequireDefault(require("./CustomDropdown"));
26
+ var _NativeDropdown = _interopRequireDefault(require("./NativeDropdown"));
27
+ var _Switch = _interopRequireDefault(require("./Switch"));
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_CustomDropdown","_interopRequireDefault","require","_NativeDropdown","_Switch"],"sources":["../../../../../src/shared/components/selectors/index.ts"],"sourcesContent":["export { default as CustomDropdown } from './CustomDropdown';\nexport { default as Dropdown } from './NativeDropdown';\nexport { default as Switch } from './Switch';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA","ignoreList":[]}
@@ -73,7 +73,7 @@ var _jsUtils = require("@dr.pogodin/js-utils");
73
73
  var _globalState = require("./globalState");
74
74
  var _splitComponent = _interopRequireDefault(require("./splitComponent"));
75
75
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
76
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
76
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
77
77
  const themed = exports.themed = _reactThemes.default;
78
78
  themed.COMPOSE = _reactThemes.COMPOSE;
79
79
  themed.PRIORITY = _reactThemes.PRIORITY;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_reactThemes","_interopRequireWildcard","require","_config","_interopRequireDefault","isomorphy","exports","_time","webpack","_jsUtils","_globalState","_splitComponent","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","themed","themedImpl","COMPOSE","PRIORITY","NODE_CONFIG_ENV","process","env","NODE_ENV","JU","requireWeak","__dirname"],"sources":["../../../../src/shared/utils/index.ts"],"sourcesContent":["import themedImpl, {\n type Theme,\n COMPOSE,\n PRIORITY,\n ThemeProvider,\n} from '@dr.pogodin/react-themes';\n\nimport config from './config';\nimport * as isomorphy from './isomorphy';\nimport time from './time';\nimport * as webpack from './webpack';\n\nimport type * as JuT from './jest';\n\nexport {\n Barrier,\n Emitter,\n Semaphore,\n withRetries,\n} from '@dr.pogodin/js-utils';\n\nexport { getSsrContext } from './globalState';\nexport { default as splitComponent } from './splitComponent';\n\ntype ThemedT = typeof themedImpl & {\n COMPOSE: typeof COMPOSE;\n PRIORITY: typeof PRIORITY;\n};\n\nconst themed: ThemedT = themedImpl as ThemedT;\n\nthemed.COMPOSE = COMPOSE;\nthemed.PRIORITY = PRIORITY;\n\n// Note: it should be done this way, as in some environments\n// \"process\" might not exist, and process.env.NODE_CONFIG_ENV\n// not injected by Webpack.\nlet NODE_CONFIG_ENV;\ntry {\n NODE_CONFIG_ENV = process.env.NODE_CONFIG_ENV;\n} catch { /* noop */ }\n\nconst env = NODE_CONFIG_ENV || process.env.NODE_ENV;\n\nconst JU: typeof JuT | null = env !== 'production'\n ? webpack.requireWeak('./jest', __dirname) as typeof JuT | null\n : null;\n\nexport {\n type Theme,\n config,\n isomorphy,\n JU,\n themed,\n ThemeProvider,\n time,\n webpack,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAAyCI,OAAA,CAAAD,SAAA,GAAAA,SAAA;AACzC,IAAAE,KAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,OAAA,GAAAP,uBAAA,CAAAC,OAAA;AAAqCI,OAAA,CAAAE,OAAA,GAAAA,OAAA;AAIrC,IAAAC,QAA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A,CAAA2B,MAAA,GAAGC,oBAAqB;AAE7CD,MAAM,CAACE,OAAO,GAAGA,oBAAO;AACxBF,MAAM,CAACG,QAAQ,GAAGA,qBAAQ;;AAE1B;AACA;AACA;AACA,IAAIC,eAAe;AACnB,IAAI;EACFA,eAAe,GAAGC,OAAO,CAACC,GAAG,CAACF,eAAe;AAC/C,CAAC,CAAC,MAAM,CAAE;AAEV,MAAME,GAAG,GAAGF,eAAe,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ;AAEnD,MAAMC,EAAqB,GAAAnC,OAAA,CAAAmC,EAAA,GAAGF,GAAG,KAAK,YAAY,GAC9C/B,OAAO,CAACkC,WAAW,WAAWC,SAAS,CAAC,GACxC,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_reactThemes","_interopRequireWildcard","require","_config","_interopRequireDefault","isomorphy","exports","_time","webpack","_jsUtils","_globalState","_splitComponent","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","themed","themedImpl","COMPOSE","PRIORITY","NODE_CONFIG_ENV","process","env","NODE_ENV","JU","requireWeak","__dirname"],"sources":["../../../../src/shared/utils/index.ts"],"sourcesContent":["import themedImpl, {\n type Theme,\n COMPOSE,\n PRIORITY,\n ThemeProvider,\n} from '@dr.pogodin/react-themes';\n\nimport config from './config';\nimport * as isomorphy from './isomorphy';\nimport time from './time';\nimport * as webpack from './webpack';\n\nimport type * as JuT from './jest';\n\nexport {\n Barrier,\n Emitter,\n Semaphore,\n withRetries,\n} from '@dr.pogodin/js-utils';\n\nexport { getSsrContext } from './globalState';\nexport { default as splitComponent } from './splitComponent';\n\ntype ThemedT = typeof themedImpl & {\n COMPOSE: typeof COMPOSE;\n PRIORITY: typeof PRIORITY;\n};\n\nconst themed: ThemedT = themedImpl as ThemedT;\n\nthemed.COMPOSE = COMPOSE;\nthemed.PRIORITY = PRIORITY;\n\n// Note: it should be done this way, as in some environments\n// \"process\" might not exist, and process.env.NODE_CONFIG_ENV\n// not injected by Webpack.\nlet NODE_CONFIG_ENV;\ntry {\n NODE_CONFIG_ENV = process.env.NODE_CONFIG_ENV;\n} catch { /* noop */ }\n\nconst env = NODE_CONFIG_ENV || process.env.NODE_ENV;\n\nconst JU: typeof JuT | null = env !== 'production'\n ? webpack.requireWeak('./jest', __dirname) as typeof JuT | null\n : null;\n\nexport {\n type Theme,\n config,\n isomorphy,\n JU,\n themed,\n ThemeProvider,\n time,\n webpack,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAAyCI,OAAA,CAAAD,SAAA,GAAAA,SAAA;AACzC,IAAAE,KAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,OAAA,GAAAP,uBAAA,CAAAC,OAAA;AAAqCI,OAAA,CAAAE,OAAA,GAAAA,OAAA;AAIrC,IAAAC,QAAA,GAAAP,OAAA;AAOA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAP,sBAAA,CAAAF,OAAA;AAA6D,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAZ,wBAAAY,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAA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mentJsdom.default {
66
66
  async runWebpack() {
67
67
  this.loadWebpackConfig();
68
68
  const compiler = (0, _webpack.default)(this.global.webpackConfig);
69
+
70
+ // TODO: The "as typeof compiler.outputFileSystem" piece below is a workaround
71
+ // for the Webpack regression: https://github.com/webpack/webpack/issues/18242
69
72
  compiler.outputFileSystem = this.global.webpackOutputFs;
70
73
  return new Promise((done, fail) => {
71
74
  compiler.run((err, stats) => {
@@ -1 +1 @@
1
- {"version":3,"file":"E2eSsrEnv.js","names":["_path","_interopRequireDefault","require","_lodash","_experimentalWorker","_jestEnvironmentJsdom","_memfs","_webpack","_renderer","E2eSsrEnv","JsdomEnv","loadWebpackConfig","optionsString","pragmas","options","JSON","parse","defaults","context","testFolder","fs","global","webpackOutputFs","factoryPath","factory","path","resolve","rootDir","default","webpackConfig","buildInfo","existsSync","readFileSync","runWebpack","compiler","webpack","outputFileSystem","Promise","done","fail","run","err","stats","hasErrors","console","error","toJson","errors","Error","webpackStats","runSsr","logger","undefined","debug","noop","info","log","warn","cleanup","entry","p","module","Application","entryExportName","renderer","ssrFactory","status","markup","ssrRequest","cookie","send","set","value","locals","devMiddleware","ssrMarkup","ssrOptions","ssrStatus","constructor","config","docblockPragmas","requestString","request","url","csrfToken","projectConfig","dom","createFsFromVolume","Volume","dirname","testPath","withSsr","root","process","cwd","register","envName","babelEnv","extensions","setup","REACT_UTILS_FORCE_CLIENT_SIDE","teardown","Object","keys","cache","forEach","key","revert","exports"],"sources":["../../../../../src/shared/utils/jest/E2eSsrEnv.ts"],"sourcesContent":["/**\n * Jest environment for end-to-end SSR and client-side testing. It relies on\n * the standard react-utils mechanics to execute SSR of given scene, and also\n * Webpack build of the code for client-side execution, it further exposes\n * Jsdom environment for the client-side testing of the outcomes.\n */\n/* eslint-disable global-require, import/no-dynamic-require */\n\n// BEWARE: The module is not imported into the JU module / the main assembly of\n// the library, because doing so easily breaks stuff:\n// 1) This module depends on Node-specific modules, which would make JU\n// incompatible with JsDom if included into JU.\n// 2) If this module is weakly imported from somewhere else in the lib,\n// it seems to randomly break tests using it for a different reason,\n// probably some sort of a require-loop, or some issues with weak\n// require in that scenario.\n\nimport path from 'path';\n\nimport type { Request, Response } from 'express';\nimport { defaults, noop, set } from 'lodash';\n\n// As this environment is a part of the Jest testing utils,\n// we assume development dependencies are available when it is used.\n/* eslint-disable import/no-extraneous-dependencies */\nimport register from '@babel/register/experimental-worker';\n\nimport JsdomEnv from 'jest-environment-jsdom';\nimport { type IFs, createFsFromVolume, Volume } from 'memfs';\nimport webpack from 'webpack';\n/* eslint-enable import/no-extraneous-dependencies */\n\nimport ssrFactory from 'server/renderer';\n\nimport type {\n EnvironmentContext,\n JestEnvironmentConfig,\n} from '@jest/environment';\n\nexport default class E2eSsrEnv extends JsdomEnv {\n pragmas: Record<string, string | string[]>;\n\n ssrRequest: object;\n\n rootDir: string;\n\n testFolder: string;\n\n withSsr: boolean;\n\n webpackStats?: webpack.StatsCompilation;\n\n /**\n * Loads Webpack config, and exposes it to the environment via global\n * webpackConfig object.\n */\n loadWebpackConfig() {\n const optionsString = this.pragmas['webpack-config-options'] as string;\n\n const options = (optionsString\n ? JSON.parse(optionsString) : {}) as webpack.Configuration;\n\n defaults(options, {\n context: this.testFolder,\n fs: this.global.webpackOutputFs,\n });\n\n const factoryPath = this.pragmas['webpack-config-factory'] as string;\n let factory = require(path.resolve(this.rootDir, factoryPath));\n factory = 'default' in factory ? factory.default : factory;\n\n this.global.webpackConfig = factory(options);\n\n const fs = this.global.webpackOutputFs as IFs;\n let buildInfo = `${options.context}/.build-info`;\n if (fs.existsSync(buildInfo)) {\n buildInfo = fs.readFileSync(buildInfo, 'utf8') as string;\n this.global.buildInfo = JSON.parse(buildInfo);\n }\n }\n\n /**\n * Executes Webpack build.\n * @return {Promise}\n */\n async runWebpack() {\n this.loadWebpackConfig();\n\n const compiler = webpack(this.global.webpackConfig as webpack.Configuration);\n compiler.outputFileSystem = this.global.webpackOutputFs;\n return new Promise<void>((done, fail) => {\n compiler.run((err, stats) => {\n if (err) fail(err);\n if (stats?.hasErrors()) {\n // eslint-disable-next-line no-console\n console.error(stats.toJson().errors);\n fail(Error('Webpack compilation failed'));\n }\n\n this.global.webpackStats = stats?.toJson();\n\n // Keeps reference to the raw Webpack stats object, which should be\n // explicitly passed to the server-side renderer alongside the request,\n // so that it can to pick up asset paths for different named chunks.\n this.webpackStats = stats;\n\n done();\n });\n });\n }\n\n async runSsr() {\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString ? JSON.parse(optionsString) : {};\n\n // TODO: This is temporary to shortcut the logging added to SSR.\n if (options.logger === undefined) {\n options.logger = {\n debug: noop,\n info: noop,\n log: noop,\n warn: noop,\n };\n }\n\n if (!options.buildInfo) options.buildInfo = this.global.buildInfo;\n\n let cleanup: (() => void) | undefined;\n\n if (options.entry) {\n const p = path.resolve(this.testFolder, options.entry);\n const module = require(p);\n cleanup = module.cleanup;\n options.Application = module[options.entryExportName || 'default'];\n }\n\n const renderer = ssrFactory(this.global.webpackConfig!, options);\n let status = 200; // OK\n const markup = await new Promise<string>((done, fail) => {\n renderer(\n this.ssrRequest as Request,\n\n // TODO: This will do for now, with the current implementation of\n // the renderer, but it will require a rework once the renderer is\n // updated to do streaming.\n ({\n cookie: noop,\n send: done,\n set: noop,\n status: (value: number) => {\n status = value;\n },\n\n // This is how up-to-date Webpack stats are passed to the server in\n // development mode, and we use this here always, instead of having\n // to pass some information via filesystem.\n locals: {\n webpack: {\n devMiddleware: {\n stats: this.webpackStats,\n },\n },\n },\n } as unknown) as Response,\n\n (error) => {\n if (error) fail(error);\n else done('');\n },\n );\n });\n\n this.global.ssrMarkup = markup;\n this.global.ssrOptions = options;\n this.global.ssrStatus = status;\n\n if (cleanup) cleanup();\n }\n\n constructor(\n config: JestEnvironmentConfig,\n context: EnvironmentContext,\n ) {\n const pragmas = context.docblockPragmas;\n\n const requestString = pragmas['ssr-request'] as string;\n const request = requestString ? JSON.parse(requestString) : {};\n\n if (!request.url) request.url = '/';\n request.csrfToken = noop;\n\n // This ensures the initial JsDom URL matches the value we use for SSR.\n set(\n config.projectConfig,\n 'testEnvironmentOptions.url',\n `http://localhost${request.url}`,\n );\n\n super(config, context);\n\n this.global.dom = this.dom;\n this.global.webpackOutputFs = createFsFromVolume(new Volume());\n\n // Extracts necessary settings from config and context.\n const { projectConfig } = config;\n this.rootDir = projectConfig.rootDir;\n this.testFolder = path.dirname(context.testPath);\n this.withSsr = !pragmas['no-ssr'];\n this.ssrRequest = request;\n this.pragmas = pragmas;\n\n // The usual \"babel-jest\" transformation setup does not apply to\n // the environment code and imports from it, this workaround enables it.\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString ? JSON.parse(optionsString) : {};\n let root;\n switch (options.root) {\n case 'TEST': root = this.testFolder; break;\n default: root = process.cwd();\n }\n register({\n envName: options.babelEnv,\n extensions: ['.js', '.jsx', '.ts', '.tsx', '.svg'],\n root,\n });\n }\n\n async setup() {\n await super.setup();\n await this.runWebpack();\n if (this.withSsr) await this.runSsr();\n this.global.REACT_UTILS_FORCE_CLIENT_SIDE = true;\n }\n\n async teardown() {\n delete this.global.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n // Resets module cache and @babel/register. Effectively this ensures that\n // the next time an instance of this environment is set up, all modules are\n // transformed by Babel from scratch, thus taking into account the latest\n // Babel config (which may change between different environment instances,\n // which does not seem to be taken into account by Babel / Node caches\n // automatically).\n Object.keys(require.cache).forEach((key) => {\n delete require.cache[key];\n });\n register.revert();\n super.teardown();\n }\n}\n"],"mappings":";;;;;;;AAiBA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,qBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAGA,IAAAM,SAAA,GAAA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;IAC9D,IAAIgF,IAAI;IACR,QAAQ9E,OAAO,CAAC8E,IAAI;MAClB,KAAK,MAAM;QAAEA,IAAI,GAAG,IAAI,CAACzE,UAAU;QAAE;MACrC;QAASyE,IAAI,GAAGC,OAAO,CAACC,GAAG,CAAC,CAAC;IAC/B;IACA,IAAAC,2BAAQ,EAAC;MACPC,OAAO,EAAElF,OAAO,CAACmF,QAAQ;MACzBC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;MAClDN;IACF,CAAC,CAAC;EACJ;EAEA,MAAMO,KAAKA,CAAA,EAAG;IACZ,MAAM,KAAK,CAACA,KAAK,CAAC,CAAC;IACnB,MAAM,IAAI,CAAClE,UAAU,CAAC,CAAC;IACvB,IAAI,IAAI,CAAC0D,OAAO,EAAE,MAAM,IAAI,CAACzC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC7B,MAAM,CAAC+E,6BAA6B,GAAG,IAAI;EAClD;EAEA,MAAMC,QAAQA,CAAA,EAAG;IACf,OAAO,IAAI,CAAChF,MAAM,CAAC+E,6BAA6B;;IAEhD;IACA;IACA;IACA;IACA;IACA;IACAE,MAAM,CAACC,IAAI,CAACrG,OAAO,CAACsG,KAAK,CAAC,CAACC,OAAO,CAAEC,GAAG,IAAK;MAC1C,OAAOxG,OAAO,CAACsG,KAAK,CAACE,GAAG,CAAC;IAC3B,CAAC,CAAC;IACFX,2BAAQ,CAACY,MAAM,CAAC,CAAC;IACjB,KAAK,CAACN,QAAQ,CAAC,CAAC;EAClB;AACF;AAACO,OAAA,CAAAhF,OAAA,GAAAnB,SAAA","ignoreList":[]}
1
+ {"version":3,"file":"E2eSsrEnv.js","names":["_path","_interopRequireDefault","require","_lodash","_experimentalWorker","_jestEnvironmentJsdom","_memfs","_webpack","_renderer","E2eSsrEnv","JsdomEnv","loadWebpackConfig","optionsString","pragmas","options","JSON","parse","defaults","context","testFolder","fs","global","webpackOutputFs","factoryPath","factory","path","resolve","rootDir","default","webpackConfig","buildInfo","existsSync","readFileSync","runWebpack","compiler","webpack","outputFileSystem","Promise","done","fail","run","err","stats","hasErrors","console","error","toJson","errors","Error","webpackStats","runSsr","logger","undefined","debug","noop","info","log","warn","cleanup","entry","p","module","Application","entryExportName","renderer","ssrFactory","status","markup","ssrRequest","cookie","send","set","value","locals","devMiddleware","ssrMarkup","ssrOptions","ssrStatus","constructor","config","docblockPragmas","requestString","request","url","csrfToken","projectConfig","dom","createFsFromVolume","Volume","dirname","testPath","withSsr","root","process","cwd","register","envName","babelEnv","extensions","setup","REACT_UTILS_FORCE_CLIENT_SIDE","teardown","Object","keys","cache","forEach","key","revert","exports"],"sources":["../../../../../src/shared/utils/jest/E2eSsrEnv.ts"],"sourcesContent":["/**\n * Jest environment for end-to-end SSR and client-side testing. It relies on\n * the standard react-utils mechanics to execute SSR of given scene, and also\n * Webpack build of the code for client-side execution, it further exposes\n * Jsdom environment for the client-side testing of the outcomes.\n */\n/* eslint-disable global-require, import/no-dynamic-require */\n\n// BEWARE: The module is not imported into the JU module / the main assembly of\n// the library, because doing so easily breaks stuff:\n// 1) This module depends on Node-specific modules, which would make JU\n// incompatible with JsDom if included into JU.\n// 2) If this module is weakly imported from somewhere else in the lib,\n// it seems to randomly break tests using it for a different reason,\n// probably some sort of a require-loop, or some issues with weak\n// require in that scenario.\n\nimport path from 'path';\n\nimport type { Request, Response } from 'express';\nimport { defaults, noop, set } from 'lodash';\n\n// As this environment is a part of the Jest testing utils,\n// we assume development dependencies are available when it is used.\n/* eslint-disable import/no-extraneous-dependencies */\nimport register from '@babel/register/experimental-worker';\n\nimport JsdomEnv from 'jest-environment-jsdom';\nimport { type IFs, createFsFromVolume, Volume } from 'memfs';\nimport webpack from 'webpack';\n/* eslint-enable import/no-extraneous-dependencies */\n\nimport ssrFactory from 'server/renderer';\n\nimport type {\n EnvironmentContext,\n JestEnvironmentConfig,\n} from '@jest/environment';\n\nexport default class E2eSsrEnv extends JsdomEnv {\n pragmas: Record<string, string | string[]>;\n\n ssrRequest: object;\n\n rootDir: string;\n\n testFolder: string;\n\n withSsr: boolean;\n\n webpackStats?: webpack.StatsCompilation;\n\n /**\n * Loads Webpack config, and exposes it to the environment via global\n * webpackConfig object.\n */\n loadWebpackConfig() {\n const optionsString = this.pragmas['webpack-config-options'] as string;\n\n const options = (optionsString\n ? JSON.parse(optionsString) : {}) as webpack.Configuration;\n\n defaults(options, {\n context: this.testFolder,\n fs: this.global.webpackOutputFs,\n });\n\n const factoryPath = this.pragmas['webpack-config-factory'] as string;\n let factory = require(path.resolve(this.rootDir, factoryPath));\n factory = 'default' in factory ? factory.default : factory;\n\n this.global.webpackConfig = factory(options);\n\n const fs = this.global.webpackOutputFs as IFs;\n let buildInfo = `${options.context}/.build-info`;\n if (fs.existsSync(buildInfo)) {\n buildInfo = fs.readFileSync(buildInfo, 'utf8') as string;\n this.global.buildInfo = JSON.parse(buildInfo);\n }\n }\n\n /**\n * Executes Webpack build.\n * @return {Promise}\n */\n async runWebpack() {\n this.loadWebpackConfig();\n\n const compiler = webpack(this.global.webpackConfig as webpack.Configuration);\n\n // TODO: The \"as typeof compiler.outputFileSystem\" piece below is a workaround\n // for the Webpack regression: https://github.com/webpack/webpack/issues/18242\n compiler.outputFileSystem = this.global.webpackOutputFs as typeof compiler.outputFileSystem;\n\n return new Promise<void>((done, fail) => {\n compiler.run((err, stats) => {\n if (err) fail(err);\n if (stats?.hasErrors()) {\n // eslint-disable-next-line no-console\n console.error(stats.toJson().errors);\n fail(Error('Webpack compilation failed'));\n }\n\n this.global.webpackStats = stats?.toJson();\n\n // Keeps reference to the raw Webpack stats object, which should be\n // explicitly passed to the server-side renderer alongside the request,\n // so that it can to pick up asset paths for different named chunks.\n this.webpackStats = stats;\n\n done();\n });\n });\n }\n\n async runSsr() {\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString ? JSON.parse(optionsString) : {};\n\n // TODO: This is temporary to shortcut the logging added to SSR.\n if (options.logger === undefined) {\n options.logger = {\n debug: noop,\n info: noop,\n log: noop,\n warn: noop,\n };\n }\n\n if (!options.buildInfo) options.buildInfo = this.global.buildInfo;\n\n let cleanup: (() => void) | undefined;\n\n if (options.entry) {\n const p = path.resolve(this.testFolder, options.entry);\n const module = require(p);\n cleanup = module.cleanup;\n options.Application = module[options.entryExportName || 'default'];\n }\n\n const renderer = ssrFactory(this.global.webpackConfig!, options);\n let status = 200; // OK\n const markup = await new Promise<string>((done, fail) => {\n renderer(\n this.ssrRequest as Request,\n\n // TODO: This will do for now, with the current implementation of\n // the renderer, but it will require a rework once the renderer is\n // updated to do streaming.\n ({\n cookie: noop,\n send: done,\n set: noop,\n status: (value: number) => {\n status = value;\n },\n\n // This is how up-to-date Webpack stats are passed to the server in\n // development mode, and we use this here always, instead of having\n // to pass some information via filesystem.\n locals: {\n webpack: {\n devMiddleware: {\n stats: this.webpackStats,\n },\n },\n },\n } as unknown) as Response,\n\n (error) => {\n if (error) fail(error);\n else done('');\n },\n );\n });\n\n this.global.ssrMarkup = markup;\n this.global.ssrOptions = options;\n this.global.ssrStatus = status;\n\n if (cleanup) cleanup();\n }\n\n constructor(\n config: JestEnvironmentConfig,\n context: EnvironmentContext,\n ) {\n const pragmas = context.docblockPragmas;\n\n const requestString = pragmas['ssr-request'] as string;\n const request = requestString ? JSON.parse(requestString) : {};\n\n if (!request.url) request.url = '/';\n request.csrfToken = noop;\n\n // This ensures the initial JsDom URL matches the value we use for SSR.\n set(\n config.projectConfig,\n 'testEnvironmentOptions.url',\n `http://localhost${request.url}`,\n );\n\n super(config, context);\n\n this.global.dom = this.dom;\n this.global.webpackOutputFs = createFsFromVolume(new Volume());\n\n // Extracts necessary settings from config and context.\n const { projectConfig } = config;\n this.rootDir = projectConfig.rootDir;\n this.testFolder = path.dirname(context.testPath);\n this.withSsr = !pragmas['no-ssr'];\n this.ssrRequest = request;\n this.pragmas = pragmas;\n\n // The usual \"babel-jest\" transformation setup does not apply to\n // the environment code and imports from it, this workaround enables it.\n const optionsString = this.pragmas['ssr-options'] as string;\n const options = optionsString ? JSON.parse(optionsString) : {};\n let root;\n switch (options.root) {\n case 'TEST': root = this.testFolder; break;\n default: root = process.cwd();\n }\n register({\n envName: options.babelEnv,\n extensions: ['.js', '.jsx', '.ts', '.tsx', '.svg'],\n root,\n });\n }\n\n async setup() {\n await super.setup();\n await this.runWebpack();\n if (this.withSsr) await this.runSsr();\n this.global.REACT_UTILS_FORCE_CLIENT_SIDE = true;\n }\n\n async teardown() {\n delete this.global.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n // Resets module cache and @babel/register. Effectively this ensures that\n // the next time an instance of this environment is set up, all modules are\n // transformed by Babel from scratch, thus taking into account the latest\n // Babel config (which may change between different environment instances,\n // which does not seem to be taken into account by Babel / Node caches\n // automatically).\n Object.keys(require.cache).forEach((key) => {\n delete require.cache[key];\n });\n register.revert();\n super.teardown();\n }\n}\n"],"mappings":";;;;;;;AAiBA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,qBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAGA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AAhCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;;AAMA;;AASe,MAAMO,SAAS,SAASC,6BAAQ,CAAC;EAa9C;AACF;AACA;AACA;EACEC,iBAAiBA,CAAA,EAAG;IAClB,MAAMC,aAAa,GAAG,IAAI,CAACC,OAAO,CAAC,wBAAwB,CAAW;IAEtE,MAAMC,OAAO,GAAIF,aAAa,GAC1BG,IAAI,CAACC,KAAK,CAACJ,aAAa,CAAC,GAAG,CAAC,CAA2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EACJ;EAEA,MAAMO,KAAKA,CAAA,EAAG;IACZ,MAAM,KAAK,CAACA,KAAK,CAAC,CAAC;IACnB,MAAM,IAAI,CAAClE,UAAU,CAAC,CAAC;IACvB,IAAI,IAAI,CAAC0D,OAAO,EAAE,MAAM,IAAI,CAACzC,MAAM,CAAC,CAAC;IACrC,IAAI,CAAC7B,MAAM,CAAC+E,6BAA6B,GAAG,IAAI;EAClD;EAEA,MAAMC,QAAQA,CAAA,EAAG;IACf,OAAO,IAAI,CAAChF,MAAM,CAAC+E,6BAA6B;;IAEhD;IACA;IACA;IACA;IACA;IACA;IACAE,MAAM,CAACC,IAAI,CAACrG,OAAO,CAACsG,KAAK,CAAC,CAACC,OAAO,CAAEC,GAAG,IAAK;MAC1C,OAAOxG,OAAO,CAACsG,KAAK,CAACE,GAAG,CAAC;IAC3B,CAAC,CAAC;IACFX,2BAAQ,CAACY,MAAM,CAAC,CAAC;IACjB,KAAK,CAACN,QAAQ,CAAC,CAAC;EAClB;AACF;AAACO,OAAA,CAAAhF,OAAA,GAAAnB,SAAA","ignoreList":[]}
@@ -34,7 +34,7 @@ var _reactTestRenderer = _interopRequireDefault(require("react-test-renderer"));
34
34
  var _shallow = require("react-test-renderer/shallow");
35
35
  var _global = _interopRequireDefault(require("./global"));
36
36
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
37
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
37
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
38
38
  /* global expect, jest, document */
39
39
  /* eslint-disable import/no-extraneous-dependencies */
40
40
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_mockdate","_interopRequireDefault","require","_client","_testUtils","_interopRequireWildcard","_reactTestRenderer","_shallow","_global","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","global","IS_REACT_ACT_ENVIRONMENT","originalProcessVersions","process","versions","mockClientSide","value","unmockClientSide","writable","getMockUuid","seed","x","toString","padStart","slice","mockTimer","time","mockdate","Date","now","jest","advanceTimersByTime","mount","scene","root","element","document","createElement","body","appendChild","res","destroy","act","unmount","remove","createRoot","render","component","Renderer","create","toJSON","shallowRender","renderer","createRenderer","getRenderOutput","shallowSnapshot","expect","toMatchSnapshot","snapshot","simulate","exports","TU","Simulate"],"sources":["../../../../../src/shared/utils/jest/index.tsx"],"sourcesContent":["/* global expect, jest, document */\n/* eslint-disable import/no-extraneous-dependencies */\n\nimport mockdate from 'mockdate';\nimport { type ReactElement, type ReactNode } from 'react';\nimport { type Root, createRoot } from 'react-dom/client';\nimport TU, { act } from 'react-dom/test-utils';\n\n/* eslint-disable import/no-extraneous-dependencies */\nimport Renderer from 'react-test-renderer';\nimport { type ShallowRenderer, createRenderer } from 'react-test-renderer/shallow';\n/* eslint-enable import/no-extraneous-dependencies */\n\n/**\n * An alias for [act(..)](https://reactjs.org/docs/test-utils.html#act)\n * from `react-dom/test-utils`.\n * @param {function} action\n */\nexport { act };\n\nexport { default as getGlobal } from './global';\n\ndeclare global {\n // eslint-disable-next-line no-var, vars-on-top\n var IS_REACT_ACT_ENVIRONMENT: boolean | undefined;\n}\n\nglobal.IS_REACT_ACT_ENVIRONMENT = true;\n\nconst originalProcessVersions = process.versions;\n\n/**\n * Tricks **react-utils** into thinking the test is running within client-side\n * (browser) environment.\n */\nexport function mockClientSide() {\n Object.defineProperty(process, 'versions', { value: null });\n}\n\n/**\n * Reverts the effect of {@link module:JU.mockClientSide mockClientSide(..)}.\n */\nexport function unmockClientSide() {\n Object.defineProperty(process, 'versions', {\n value: originalProcessVersions,\n writable: false,\n });\n}\n\n/**\n * Generates a mock UUID, or better said it determenistically transforms given\n * `seed` number into a UUID-formatted string.\n * @param {number} seed\n * @return {string}\n */\nexport function getMockUuid(seed = 0) {\n const x = seed.toString(16).padStart(32, '0');\n return `${x.slice(0, 8)}-${x.slice(8, 12)}-${x.slice(12, 16)}-${x.slice(16, 20)}-${x.slice(20)}`;\n}\n\n/**\n * Advances mock timers, and mock date by the specified time.\n * @param {number} time Time step [ms].\n * @returns {Promise} Wait for this to \"jump after\" any async code which should\n * be executed because of the mock time movement.\n */\nexport async function mockTimer(time: number) {\n mockdate.set(time + Date.now());\n jest.advanceTimersByTime(time);\n}\n\nexport type MountedSceneT = HTMLElement & {\n destroy: () => void;\n};\n\n/**\n * Mounts `scene` to the DOM, and returns the root scene element.\n * @param scene\n * @return Created container DOM element with destroy() function\n * attached.\n */\nexport function mount(scene: ReactNode): MountedSceneT {\n let root: Root;\n const element = document.createElement('div');\n document.body.appendChild(element);\n\n const res: MountedSceneT = (element as unknown) as MountedSceneT;\n res.destroy = () => {\n act(() => root.unmount());\n res.remove();\n };\n\n act(() => {\n root = createRoot(res);\n root.render(scene);\n });\n return res;\n}\n\n/* OLD STUFF BELOW THIS MARK */\n\n/**\n * Renders provided ReactJS component into JSON representation of the component\n * tree, using [`react-test-renderer`](https://www.npmjs.com/package/react-test-renderer).\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of the rendered tree.\n * @example\n * import { JU } from '@dr.pogodin/react-utils';\n * console.log(JU.render(<div>Example</div>));\n */\nexport function render(component: ReactElement) {\n return Renderer.create(component).toJSON();\n}\n\n/**\n * Generates a shallow render of given ReactJS component, using\n * [react-test-renderer/shallow](https://reactjs.org/docs/shallow-renderer.html)\n * and returns the result.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of the shallow component's render tree.\n */\nexport function shallowRender(component: ReactElement) {\n const renderer: ShallowRenderer = createRenderer();\n renderer.render(component);\n return renderer.getRenderOutput();\n}\n\n/**\n * Makes a shallow snapshot test of the given ReactJS component, and also\n * returns JSON representation of the rendered component tree. Under the hood\n * it uses {@link module:JU.shallowRender shallowRender(..)} to generate\n * the render, then executes `expect(RENDER_RESULT).toMatchSnapshot()`,\n * and finally returns the `RENDER_RESULT` to the caller.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of shallow render.\n */\nexport function shallowSnapshot(component: ReactElement) {\n const res = shallowRender(component);\n expect(res).toMatchSnapshot();\n return res;\n}\n\n/**\n * Makes snapshot test of the given ReactJS component, and also returns JSON\n * representation of the rendered component tree. Under the hood, it uses\n * {@link module:JU.render render(..)} to render it, then executes\n * `expect(RENDER_RESULT).toMatchSnapshot()`, and then returns `RENDER_RESULT`.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON render of the component.\n */\nexport function snapshot(component: ReactElement) {\n const res = render(component);\n expect(res).toMatchSnapshot();\n return res;\n}\n\nexport const simulate = TU.Simulate;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACAA,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,uBAAA,CAAAH,OAAA;AAGA,IAAAI,kBAAA,GAAAL,sBAAA,CAAAC,O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CAACiB,eAAe,CAAC,CAAC;EAC7B,OAAOjB,GAAG;AACZ;AAEO,MAAMmB,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,kBAAE,CAACC,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_mockdate","_interopRequireDefault","require","_client","_testUtils","_interopRequireWildcard","_reactTestRenderer","_shallow","_global","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","global","IS_REACT_ACT_ENVIRONMENT","originalProcessVersions","process","versions","mockClientSide","value","unmockClientSide","writable","getMockUuid","seed","x","toString","padStart","slice","mockTimer","time","mockdate","Date","now","jest","advanceTimersByTime","mount","scene","root","element","document","createElement","body","appendChild","res","destroy","act","unmount","remove","createRoot","render","component","Renderer","create","toJSON","shallowRender","renderer","createRenderer","getRenderOutput","shallowSnapshot","expect","toMatchSnapshot","snapshot","simulate","exports","TU","Simulate"],"sources":["../../../../../src/shared/utils/jest/index.tsx"],"sourcesContent":["/* global expect, jest, document */\n/* eslint-disable import/no-extraneous-dependencies */\n\nimport mockdate from 'mockdate';\nimport { type ReactElement, type ReactNode } from 'react';\nimport { type Root, createRoot } from 'react-dom/client';\nimport TU, { act } from 'react-dom/test-utils';\n\n/* eslint-disable import/no-extraneous-dependencies */\nimport Renderer from 'react-test-renderer';\nimport { type ShallowRenderer, createRenderer } from 'react-test-renderer/shallow';\n/* eslint-enable import/no-extraneous-dependencies */\n\n/**\n * An alias for [act(..)](https://reactjs.org/docs/test-utils.html#act)\n * from `react-dom/test-utils`.\n * @param {function} action\n */\nexport { act };\n\nexport { default as getGlobal } from './global';\n\ndeclare global {\n // eslint-disable-next-line no-var, vars-on-top\n var IS_REACT_ACT_ENVIRONMENT: boolean | undefined;\n}\n\nglobal.IS_REACT_ACT_ENVIRONMENT = true;\n\nconst originalProcessVersions = process.versions;\n\n/**\n * Tricks **react-utils** into thinking the test is running within client-side\n * (browser) environment.\n */\nexport function mockClientSide() {\n Object.defineProperty(process, 'versions', { value: null });\n}\n\n/**\n * Reverts the effect of {@link module:JU.mockClientSide mockClientSide(..)}.\n */\nexport function unmockClientSide() {\n Object.defineProperty(process, 'versions', {\n value: originalProcessVersions,\n writable: false,\n });\n}\n\n/**\n * Generates a mock UUID, or better said it determenistically transforms given\n * `seed` number into a UUID-formatted string.\n * @param {number} seed\n * @return {string}\n */\nexport function getMockUuid(seed = 0) {\n const x = seed.toString(16).padStart(32, '0');\n return `${x.slice(0, 8)}-${x.slice(8, 12)}-${x.slice(12, 16)}-${x.slice(16, 20)}-${x.slice(20)}`;\n}\n\n/**\n * Advances mock timers, and mock date by the specified time.\n * @param {number} time Time step [ms].\n * @returns {Promise} Wait for this to \"jump after\" any async code which should\n * be executed because of the mock time movement.\n */\nexport async function mockTimer(time: number) {\n mockdate.set(time + Date.now());\n jest.advanceTimersByTime(time);\n}\n\nexport type MountedSceneT = HTMLElement & {\n destroy: () => void;\n};\n\n/**\n * Mounts `scene` to the DOM, and returns the root scene element.\n * @param scene\n * @return Created container DOM element with destroy() function\n * attached.\n */\nexport function mount(scene: ReactNode): MountedSceneT {\n let root: Root;\n const element = document.createElement('div');\n document.body.appendChild(element);\n\n const res: MountedSceneT = (element as unknown) as MountedSceneT;\n res.destroy = () => {\n act(() => root.unmount());\n res.remove();\n };\n\n act(() => {\n root = createRoot(res);\n root.render(scene);\n });\n return res;\n}\n\n/* OLD STUFF BELOW THIS MARK */\n\n/**\n * Renders provided ReactJS component into JSON representation of the component\n * tree, using [`react-test-renderer`](https://www.npmjs.com/package/react-test-renderer).\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of the rendered tree.\n * @example\n * import { JU } from '@dr.pogodin/react-utils';\n * console.log(JU.render(<div>Example</div>));\n */\nexport function render(component: ReactElement) {\n return Renderer.create(component).toJSON();\n}\n\n/**\n * Generates a shallow render of given ReactJS component, using\n * [react-test-renderer/shallow](https://reactjs.org/docs/shallow-renderer.html)\n * and returns the result.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of the shallow component's render tree.\n */\nexport function shallowRender(component: ReactElement) {\n const renderer: ShallowRenderer = createRenderer();\n renderer.render(component);\n return renderer.getRenderOutput();\n}\n\n/**\n * Makes a shallow snapshot test of the given ReactJS component, and also\n * returns JSON representation of the rendered component tree. Under the hood\n * it uses {@link module:JU.shallowRender shallowRender(..)} to generate\n * the render, then executes `expect(RENDER_RESULT).toMatchSnapshot()`,\n * and finally returns the `RENDER_RESULT` to the caller.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON representation of shallow render.\n */\nexport function shallowSnapshot(component: ReactElement) {\n const res = shallowRender(component);\n expect(res).toMatchSnapshot();\n return res;\n}\n\n/**\n * Makes snapshot test of the given ReactJS component, and also returns JSON\n * representation of the rendered component tree. Under the hood, it uses\n * {@link module:JU.render render(..)} to render it, then executes\n * `expect(RENDER_RESULT).toMatchSnapshot()`, and then returns `RENDER_RESULT`.\n * @param {object} component ReactJS component to render.\n * @return {object} JSON render of the component.\n */\nexport function snapshot(component: ReactElement) {\n const res = render(component);\n expect(res).toMatchSnapshot();\n return res;\n}\n\nexport const simulate = TU.Simulate;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACAA,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,uBAAA,CAAAH,OAAA;AAGA,IAAAI,kBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAUA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAgD,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;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