@elliemae/pui-cli 7.0.0-alpha.6 → 7.0.0-alpha.7

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 (78) hide show
  1. package/dist/cjs/server/index.js +1 -1
  2. package/dist/cjs/server/{middlewares/index.js → middlewares.js} +18 -7
  3. package/dist/cjs/testing/jest.config.cjs +8 -8
  4. package/dist/cjs/testing/mocks/axios.js +37 -0
  5. package/dist/cjs/testing/mocks/cssModule.js +23 -0
  6. package/dist/cjs/testing/mocks/html.js +23 -0
  7. package/dist/cjs/testing/mocks/image.js +23 -0
  8. package/dist/cjs/testing/mocks/matchMedia.js +43 -0
  9. package/dist/cjs/testing/mocks/pui-app-loader.js +24 -0
  10. package/dist/cjs/testing/mocks/pui-diagnostics.js +68 -0
  11. package/dist/cjs/testing/mocks/pui-user-monitoring.js +30 -0
  12. package/dist/cjs/testing/mocks/retry-axios.js +27 -0
  13. package/dist/cjs/{server/middlewares/addProdMiddlewares.js → testing/mocks/svg.js} +8 -23
  14. package/dist/cjs/testing/mocks/webpack-hmr.js +24 -0
  15. package/dist/cjs/testing/setup-tests.js +3 -3
  16. package/dist/cjs/webpack/webpack.dev.babel.js +1 -1
  17. package/dist/cjs/webpack/webpack.prod.babel.js +2 -2
  18. package/dist/esm/server/index.js +1 -1
  19. package/dist/esm/server/middlewares.js +46 -0
  20. package/dist/esm/testing/jest.config.cjs +8 -8
  21. package/dist/esm/testing/mocks/{axios.cjs → axios.js} +8 -5
  22. package/dist/esm/testing/mocks/cssModule.js +4 -0
  23. package/dist/esm/testing/mocks/html.js +4 -0
  24. package/dist/esm/testing/mocks/image.js +4 -0
  25. package/dist/esm/testing/mocks/matchMedia.js +24 -0
  26. package/dist/esm/testing/mocks/pui-app-loader.js +5 -0
  27. package/dist/esm/testing/mocks/pui-diagnostics.js +49 -0
  28. package/dist/esm/testing/mocks/pui-user-monitoring.js +11 -0
  29. package/dist/esm/testing/mocks/retry-axios.js +8 -0
  30. package/dist/esm/testing/mocks/svg.js +7 -0
  31. package/dist/esm/testing/mocks/webpack-hmr.js +5 -0
  32. package/dist/esm/testing/setup-tests.js +2 -2
  33. package/dist/esm/webpack/webpack.dev.babel.js +1 -1
  34. package/dist/esm/webpack/webpack.prod.babel.js +2 -2
  35. package/dist/types/server/{middlewares/index.d.ts → middlewares.d.ts} +1 -1
  36. package/dist/types/testing/jest.config.d.cts +1 -1
  37. package/dist/types/testing/jest.node.config.d.cts +1 -1
  38. package/dist/types/testing/mocks/axios.d.ts +17 -0
  39. package/dist/types/testing/mocks/cssModule.d.ts +2 -0
  40. package/dist/types/testing/mocks/html.d.ts +2 -0
  41. package/dist/types/testing/mocks/image.d.ts +2 -0
  42. package/dist/types/testing/mocks/matchMedia.d.ts +1 -0
  43. package/dist/types/testing/mocks/{pui-app-loader.d.cts → pui-app-loader.d.ts} +0 -0
  44. package/dist/types/testing/mocks/{pui-diagnostics.d.cts → pui-diagnostics.d.ts} +0 -0
  45. package/dist/types/testing/mocks/{pui-user-monitoring.d.cts → pui-user-monitoring.d.ts} +0 -0
  46. package/dist/types/testing/mocks/{retry-axios.d.cts → retry-axios.d.ts} +0 -0
  47. package/dist/types/testing/mocks/{svg.d.cts → svg.d.ts} +0 -0
  48. package/dist/types/testing/mocks/{webpack-hmr.d.cts → webpack-hmr.d.ts} +0 -0
  49. package/package.json +4 -4
  50. package/dist/cjs/testing/mocks/axios.cjs +0 -15
  51. package/dist/cjs/testing/mocks/cssModule.cjs +0 -1
  52. package/dist/cjs/testing/mocks/html.cjs +0 -1
  53. package/dist/cjs/testing/mocks/image.cjs +0 -1
  54. package/dist/cjs/testing/mocks/matchMedia.cjs +0 -24
  55. package/dist/cjs/testing/mocks/pui-app-loader.cjs +0 -1
  56. package/dist/cjs/testing/mocks/pui-diagnostics.cjs +0 -28
  57. package/dist/cjs/testing/mocks/pui-user-monitoring.cjs +0 -3
  58. package/dist/cjs/testing/mocks/retry-axios.cjs +0 -3
  59. package/dist/cjs/testing/mocks/svg.cjs +0 -5
  60. package/dist/cjs/testing/mocks/webpack-hmr.cjs +0 -1
  61. package/dist/esm/server/middlewares/addProdMiddlewares.js +0 -22
  62. package/dist/esm/server/middlewares/index.js +0 -35
  63. package/dist/esm/testing/mocks/cssModule.cjs +0 -1
  64. package/dist/esm/testing/mocks/html.cjs +0 -1
  65. package/dist/esm/testing/mocks/image.cjs +0 -1
  66. package/dist/esm/testing/mocks/matchMedia.cjs +0 -24
  67. package/dist/esm/testing/mocks/pui-app-loader.cjs +0 -1
  68. package/dist/esm/testing/mocks/pui-diagnostics.cjs +0 -28
  69. package/dist/esm/testing/mocks/pui-user-monitoring.cjs +0 -3
  70. package/dist/esm/testing/mocks/retry-axios.cjs +0 -3
  71. package/dist/esm/testing/mocks/svg.cjs +0 -5
  72. package/dist/esm/testing/mocks/webpack-hmr.cjs +0 -1
  73. package/dist/types/server/middlewares/addProdMiddlewares.d.ts +0 -1
  74. package/dist/types/testing/mocks/axios.d.cts +0 -14
  75. package/dist/types/testing/mocks/cssModule.d.cts +0 -2
  76. package/dist/types/testing/mocks/html.d.cts +0 -2
  77. package/dist/types/testing/mocks/image.d.cts +0 -2
  78. package/dist/types/testing/mocks/matchMedia.d.cts +0 -2
@@ -15,7 +15,7 @@ var __copyProps = (to, from, except, desc) => {
15
15
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
16
16
  var import_express = __toESM(require("express"), 1);
17
17
  var import_logger = require("./logger.js");
18
- var import_middlewares = require("./middlewares/index.js");
18
+ var import_middlewares = require("./middlewares.js");
19
19
  var import_util = require("./util/index.js");
20
20
  const app = (0, import_express.default)();
21
21
  (0, import_middlewares.setupDefaultMiddlewares)(app);
@@ -26,9 +26,12 @@ __export(middlewares_exports, {
26
26
  module.exports = __toCommonJS(middlewares_exports);
27
27
  var import_express = __toESM(require("express"), 1);
28
28
  var import_cors = __toESM(require("cors"), 1);
29
+ var import_compression = __toESM(require("compression"), 1);
30
+ var import_express_static_gzip = __toESM(require("express-static-gzip"), 1);
29
31
  var import_express_pino_logger = __toESM(require("express-pino-logger"), 1);
30
- var import_csp = require("../csp.js");
31
- var import_addProdMiddlewares = require("./addProdMiddlewares.js");
32
+ var import_csp = require("./csp.js");
33
+ var import_helpers = require("../webpack/helpers.js");
34
+ const paths = (0, import_helpers.getPaths)();
32
35
  const setupDefaultMiddlewares = (app) => {
33
36
  const pino = (0, import_express_pino_logger.default)({
34
37
  transport: {
@@ -48,10 +51,18 @@ const setupDefaultMiddlewares = (app) => {
48
51
  app.use(import_express.default.json({ type: "application/json" }));
49
52
  app.use(import_express.default.json({ type: "application/csp-report" }));
50
53
  };
51
- const setupAdditionalMiddlewars = (app, options) => {
52
- const isProd = false;
53
- if (isProd) {
54
- (0, import_addProdMiddlewares.addProdMiddlewares)(app, options);
55
- }
54
+ const setupAdditionalMiddlewars = (app, options = {}) => {
55
+ const { buildPath = paths.buildPath, basePath = paths.basePath } = options;
56
+ app.use((0, import_compression.default)());
57
+ app.get(basePath, (req, res) => {
58
+ (0, import_csp.sendFileWithCSPNonce)({ buildPath, res });
59
+ });
60
+ app.use(basePath, (0, import_express_static_gzip.default)(buildPath, {
61
+ index: false,
62
+ enableBrotli: true,
63
+ orderPreference: ["br"]
64
+ }));
65
+ app.use((0, import_express_static_gzip.default)("cdn"));
66
+ app.get("*", (req, res) => (0, import_csp.sendFileWithCSPNonce)({ buildPath, res }));
56
67
  return app;
57
68
  };
@@ -57,15 +57,15 @@ const jestConfig = {
57
57
  coverageReporters: ['lcov', 'html', 'text-summary'],
58
58
  moduleDirectories: ['node_modules', 'app', 'lib'],
59
59
  moduleNameMapper: {
60
- '.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.cjs'),
61
- '.*\\.(css|scss)$': getMockFilePath('cssModule.cjs'),
60
+ '.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.js'),
61
+ '.*\\.(css|scss)$': getMockFilePath('cssModule.js'),
62
62
  '.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
63
- getMockFilePath('image.cjs'),
64
- '.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.cjs'),
65
- '.*\\.html$(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.cjs'),
66
- '@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.cjs'),
67
- '@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.cjs'),
68
- '@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.cjs'),
63
+ getMockFilePath('image.js'),
64
+ '.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.js'),
65
+ '.*\\.html(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.js'),
66
+ '@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.js'),
67
+ '@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.js'),
68
+ '@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.js'),
69
69
  'react-spring/web': getNodeModulesPath('react-spring/web.cjs.js'),
70
70
  'react-spring/renderprops': getNodeModulesPath(
71
71
  'react-spring/renderprops.cjs.js',
@@ -0,0 +1,37 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var axios_exports = {};
19
+ __export(axios_exports, {
20
+ default: () => axios_default
21
+ });
22
+ module.exports = __toCommonJS(axios_exports);
23
+ var axios_default = {
24
+ defaults: {},
25
+ interceptors: {
26
+ request: {
27
+ use: jest.fn()
28
+ },
29
+ response: {
30
+ use: jest.fn()
31
+ }
32
+ },
33
+ create: jest.fn().mockReturnThis(),
34
+ get: jest.fn().mockResolvedValue({ data: {} }),
35
+ post: jest.fn().mockResolvedValue({ data: {} }),
36
+ put: jest.fn().mockResolvedValue({ data: {} })
37
+ };
@@ -0,0 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var cssModule_exports = {};
19
+ __export(cssModule_exports, {
20
+ default: () => cssModule_default
21
+ });
22
+ module.exports = __toCommonJS(cssModule_exports);
23
+ var cssModule_default = "CSS_MODULE";
@@ -0,0 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var html_exports = {};
19
+ __export(html_exports, {
20
+ default: () => html_default
21
+ });
22
+ module.exports = __toCommonJS(html_exports);
23
+ var html_default = "HTML_MODULE";
@@ -0,0 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var image_exports = {};
19
+ __export(image_exports, {
20
+ default: () => image_default
21
+ });
22
+ module.exports = __toCommonJS(image_exports);
23
+ var image_default = "IMAGE_MOCK";
@@ -0,0 +1,43 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var matchMedia_exports = {};
19
+ __export(matchMedia_exports, {
20
+ addMatchMedia: () => addMatchMedia
21
+ });
22
+ module.exports = __toCommonJS(matchMedia_exports);
23
+ const addMatchMedia = () => {
24
+ Object.defineProperty(window, "matchMedia", {
25
+ writable: true,
26
+ value: jest.fn().mockImplementation((query) => ({
27
+ matches: false,
28
+ media: query,
29
+ onchange: null,
30
+ addListener: jest.fn(),
31
+ removeListener: jest.fn(),
32
+ addEventListener: jest.fn(),
33
+ removeEventListener: jest.fn(),
34
+ dispatchEvent: jest.fn()
35
+ }))
36
+ });
37
+ Object.defineProperty(window, "getComputedStyle", {
38
+ value: () => ({
39
+ getPropertyValue: () => {
40
+ }
41
+ })
42
+ });
43
+ };
@@ -0,0 +1,24 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var pui_app_loader_exports = {};
19
+ __export(pui_app_loader_exports, {
20
+ load: () => load
21
+ });
22
+ module.exports = __toCommonJS(pui_app_loader_exports);
23
+ const load = () => {
24
+ };
@@ -0,0 +1,68 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var pui_diagnostics_exports = {};
19
+ __export(pui_diagnostics_exports, {
20
+ Console: () => Console,
21
+ LogLevel: () => LogLevel,
22
+ http: () => http,
23
+ logUnhandledErrors: () => logUnhandledErrors,
24
+ logger: () => logger,
25
+ webvitals: () => webvitals
26
+ });
27
+ module.exports = __toCommonJS(pui_diagnostics_exports);
28
+ const logger = () => ({
29
+ setLogLevel() {
30
+ },
31
+ setOptions() {
32
+ },
33
+ info() {
34
+ },
35
+ warn() {
36
+ },
37
+ error() {
38
+ },
39
+ trace() {
40
+ },
41
+ debug() {
42
+ },
43
+ audit() {
44
+ },
45
+ fatal() {
46
+ }
47
+ });
48
+ const LogLevel = {
49
+ info: "info",
50
+ debug: "debug",
51
+ trace: "trace",
52
+ warn: "warn",
53
+ error: "error",
54
+ audit: "audit",
55
+ fatal: "fatal"
56
+ };
57
+ const Console = () => ({
58
+ log: () => {
59
+ }
60
+ });
61
+ const http = () => ({
62
+ log() {
63
+ }
64
+ });
65
+ const webvitals = () => {
66
+ };
67
+ const logUnhandledErrors = () => {
68
+ };
@@ -0,0 +1,30 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var pui_user_monitoring_exports = {};
19
+ __export(pui_user_monitoring_exports, {
20
+ setCustomUserData: () => setCustomUserData,
21
+ setCustomVirtualPageName: () => setCustomVirtualPageName,
22
+ startVirtualPageMonitoringWithAutoEnd: () => startVirtualPageMonitoringWithAutoEnd
23
+ });
24
+ module.exports = __toCommonJS(pui_user_monitoring_exports);
25
+ const setCustomUserData = () => {
26
+ };
27
+ const setCustomVirtualPageName = () => {
28
+ };
29
+ const startVirtualPageMonitoringWithAutoEnd = () => {
30
+ };
@@ -0,0 +1,27 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var retry_axios_exports = {};
19
+ __export(retry_axios_exports, {
20
+ attach: () => attach,
21
+ detach: () => detach,
22
+ getConfig: () => getConfig
23
+ });
24
+ module.exports = __toCommonJS(retry_axios_exports);
25
+ const attach = jest.fn();
26
+ const detach = jest.fn();
27
+ const getConfig = jest.fn();
@@ -18,27 +18,12 @@ var __copyProps = (to, from, except, desc) => {
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
- var addProdMiddlewares_exports = {};
22
- __export(addProdMiddlewares_exports, {
23
- addProdMiddlewares: () => addProdMiddlewares
21
+ var svg_exports = {};
22
+ __export(svg_exports, {
23
+ ReactComponent: () => ReactComponent,
24
+ default: () => svg_default
24
25
  });
25
- module.exports = __toCommonJS(addProdMiddlewares_exports);
26
- var import_compression = __toESM(require("compression"), 1);
27
- var import_express_static_gzip = __toESM(require("express-static-gzip"), 1);
28
- var import_csp = require("../csp.js");
29
- var import_helpers = require("../../webpack/helpers.js");
30
- const paths = (0, import_helpers.getPaths)();
31
- const addProdMiddlewares = (app, options = {}) => {
32
- const { buildPath = paths.buildPath, basePath = paths.basePath } = options;
33
- app.use((0, import_compression.default)());
34
- app.get(basePath, (req, res) => {
35
- (0, import_csp.sendFileWithCSPNonce)({ buildPath, res });
36
- });
37
- app.use(basePath, (0, import_express_static_gzip.default)(buildPath, {
38
- index: false,
39
- enableBrotli: true,
40
- orderPreference: ["br"]
41
- }));
42
- app.use((0, import_express_static_gzip.default)("cdn"));
43
- app.get("*", (req, res) => (0, import_csp.sendFileWithCSPNonce)({ buildPath, res }));
44
- };
26
+ module.exports = __toCommonJS(svg_exports);
27
+ var React = __toESM(require("react"), 1);
28
+ var svg_default = "SvgrURL";
29
+ const ReactComponent = "div";
@@ -0,0 +1,24 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var webpack_hmr_exports = {};
19
+ __export(webpack_hmr_exports, {
20
+ enableHotReloading: () => enableHotReloading
21
+ });
22
+ module.exports = __toCommonJS(webpack_hmr_exports);
23
+ const enableHotReloading = () => {
24
+ };
@@ -18,8 +18,8 @@ var import_runtime = require("regenerator-runtime/runtime");
18
18
  var import_extend_expect = require("@testing-library/jest-dom/extend-expect");
19
19
  var import_jest_axe = __toESM(require("jest-axe"), 1);
20
20
  var import_resize_observer_polyfill = __toESM(require("resize-observer-polyfill"), 1);
21
- var import_matchMedia = __toESM(require("./mocks/matchMedia.cjs"), 1);
22
- var import_pui_diagnostics = require("./mocks/pui-diagnostics.cjs");
21
+ var import_matchMedia = require("./mocks/matchMedia.js");
22
+ var import_pui_diagnostics = require("./mocks/pui-diagnostics.js");
23
23
  const originalError = console.error;
24
24
  console.error = (...args) => {
25
25
  const ignoreList = [
@@ -57,7 +57,7 @@ const addRootElement = (id) => {
57
57
  rootEle.id = id;
58
58
  };
59
59
  addRootElement("root");
60
- (0, import_matchMedia.default)();
60
+ (0, import_matchMedia.addMatchMedia)();
61
61
  window.ResizeObserver = import_resize_observer_polyfill.default;
62
62
  window.emui = {};
63
63
  window.emui.logger = (0, import_pui_diagnostics.logger)();
@@ -31,7 +31,7 @@ var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"),
31
31
  var import_react_refresh_webpack_plugin = __toESM(require("@pmmmwh/react-refresh-webpack-plugin"), 1);
32
32
  var import_speed_measure_webpack_plugin = __toESM(require("speed-measure-webpack-plugin"), 1);
33
33
  var import_express_static_gzip = __toESM(require("express-static-gzip"), 1);
34
- var import_middlewares = require("../server/middlewares/index.js");
34
+ var import_middlewares = require("../server/middlewares.js");
35
35
  var import_util = require("../server/util/index.js");
36
36
  var import_helpers = require("./helpers.js");
37
37
  var import_webpack_base_babel = require("./webpack.base.babel.js");
@@ -31,7 +31,7 @@ var import_webpack_bundle_analyzer = require("webpack-bundle-analyzer");
31
31
  var import_esbuild_loader = require("esbuild-loader");
32
32
  var import_speed_measure_webpack_plugin = __toESM(require("speed-measure-webpack-plugin"), 1);
33
33
  var import_browserslist_to_esbuild = __toESM(require("browserslist-to-esbuild"), 1);
34
- var import_webpack_base_babel = __toESM(require("./webpack.base.babel.js"), 1);
34
+ var import_webpack_base_babel = require("./webpack.base.babel.js");
35
35
  var import_helpers = require("./helpers.js");
36
36
  const getProdConfig = ({ latestVersion = true } = {}) => {
37
37
  const { buildPath } = (0, import_helpers.getPaths)(latestVersion);
@@ -124,7 +124,7 @@ const htmlWebpackPlugin = new import_html_webpack_plugin.default({
124
124
  googleTagManager: (0, import_helpers.isGoogleTagManagerEnabled)()
125
125
  }
126
126
  });
127
- const config = (0, import_webpack_base_babel.default)(getProdConfig());
127
+ const config = (0, import_webpack_base_babel.baseConfig)(getProdConfig());
128
128
  config.plugins.push(htmlWebpackPlugin);
129
129
  const addSMPPlugin = (webpackConfig) => {
130
130
  const smpConfig = new import_speed_measure_webpack_plugin.default({
@@ -3,7 +3,7 @@ import { logger } from "./logger.js";
3
3
  import {
4
4
  setupDefaultMiddlewares,
5
5
  setupAdditionalMiddlewars
6
- } from "./middlewares/index.js";
6
+ } from "./middlewares.js";
7
7
  import { loadRoutes, port, host } from "./util/index.js";
8
8
  const app = express();
9
9
  setupDefaultMiddlewares(app);
@@ -0,0 +1,46 @@
1
+ import express from "express";
2
+ import cors from "cors";
3
+ import compression from "compression";
4
+ import expressStaticGzip from "express-static-gzip";
5
+ import expressPinoLogger from "express-pino-logger";
6
+ import { csp, sendFileWithCSPNonce } from "./csp.js";
7
+ import { getPaths } from "../webpack/helpers.js";
8
+ const paths = getPaths();
9
+ const setupDefaultMiddlewares = (app) => {
10
+ const pino = expressPinoLogger({
11
+ transport: {
12
+ target: "pino-pretty",
13
+ options: {
14
+ colorize: true
15
+ }
16
+ }
17
+ });
18
+ pino.logger.level = "warn";
19
+ app.use(pino);
20
+ app.use(cors());
21
+ app.options("*", cors());
22
+ csp(app);
23
+ app.use(express.urlencoded({ extended: false }));
24
+ app.use(express.text({ type: "text/plain" }));
25
+ app.use(express.json({ type: "application/json" }));
26
+ app.use(express.json({ type: "application/csp-report" }));
27
+ };
28
+ const setupAdditionalMiddlewars = (app, options = {}) => {
29
+ const { buildPath = paths.buildPath, basePath = paths.basePath } = options;
30
+ app.use(compression());
31
+ app.get(basePath, (req, res) => {
32
+ sendFileWithCSPNonce({ buildPath, res });
33
+ });
34
+ app.use(basePath, expressStaticGzip(buildPath, {
35
+ index: false,
36
+ enableBrotli: true,
37
+ orderPreference: ["br"]
38
+ }));
39
+ app.use(expressStaticGzip("cdn"));
40
+ app.get("*", (req, res) => sendFileWithCSPNonce({ buildPath, res }));
41
+ return app;
42
+ };
43
+ export {
44
+ setupAdditionalMiddlewars,
45
+ setupDefaultMiddlewares
46
+ };
@@ -57,15 +57,15 @@ const jestConfig = {
57
57
  coverageReporters: ['lcov', 'html', 'text-summary'],
58
58
  moduleDirectories: ['node_modules', 'app', 'lib'],
59
59
  moduleNameMapper: {
60
- '.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.cjs'),
61
- '.*\\.(css|scss)$': getMockFilePath('cssModule.cjs'),
60
+ '.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.js'),
61
+ '.*\\.(css|scss)$': getMockFilePath('cssModule.js'),
62
62
  '.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
63
- getMockFilePath('image.cjs'),
64
- '.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.cjs'),
65
- '.*\\.html$(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.cjs'),
66
- '@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.cjs'),
67
- '@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.cjs'),
68
- '@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.cjs'),
63
+ getMockFilePath('image.js'),
64
+ '.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.js'),
65
+ '.*\\.html(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.js'),
66
+ '@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.js'),
67
+ '@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.js'),
68
+ '@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.js'),
69
69
  'react-spring/web': getNodeModulesPath('react-spring/web.cjs.js'),
70
70
  'react-spring/renderprops': getNodeModulesPath(
71
71
  'react-spring/renderprops.cjs.js',
@@ -1,15 +1,18 @@
1
- module.exports = {
1
+ var axios_default = {
2
2
  defaults: {},
3
3
  interceptors: {
4
4
  request: {
5
- use: jest.fn(),
5
+ use: jest.fn()
6
6
  },
7
7
  response: {
8
- use: jest.fn(),
9
- },
8
+ use: jest.fn()
9
+ }
10
10
  },
11
11
  create: jest.fn().mockReturnThis(),
12
12
  get: jest.fn().mockResolvedValue({ data: {} }),
13
13
  post: jest.fn().mockResolvedValue({ data: {} }),
14
- put: jest.fn().mockResolvedValue({ data: {} }),
14
+ put: jest.fn().mockResolvedValue({ data: {} })
15
+ };
16
+ export {
17
+ axios_default as default
15
18
  };
@@ -0,0 +1,4 @@
1
+ var cssModule_default = "CSS_MODULE";
2
+ export {
3
+ cssModule_default as default
4
+ };
@@ -0,0 +1,4 @@
1
+ var html_default = "HTML_MODULE";
2
+ export {
3
+ html_default as default
4
+ };
@@ -0,0 +1,4 @@
1
+ var image_default = "IMAGE_MOCK";
2
+ export {
3
+ image_default as default
4
+ };
@@ -0,0 +1,24 @@
1
+ const addMatchMedia = () => {
2
+ Object.defineProperty(window, "matchMedia", {
3
+ writable: true,
4
+ value: jest.fn().mockImplementation((query) => ({
5
+ matches: false,
6
+ media: query,
7
+ onchange: null,
8
+ addListener: jest.fn(),
9
+ removeListener: jest.fn(),
10
+ addEventListener: jest.fn(),
11
+ removeEventListener: jest.fn(),
12
+ dispatchEvent: jest.fn()
13
+ }))
14
+ });
15
+ Object.defineProperty(window, "getComputedStyle", {
16
+ value: () => ({
17
+ getPropertyValue: () => {
18
+ }
19
+ })
20
+ });
21
+ };
22
+ export {
23
+ addMatchMedia
24
+ };
@@ -0,0 +1,5 @@
1
+ const load = () => {
2
+ };
3
+ export {
4
+ load
5
+ };
@@ -0,0 +1,49 @@
1
+ const logger = () => ({
2
+ setLogLevel() {
3
+ },
4
+ setOptions() {
5
+ },
6
+ info() {
7
+ },
8
+ warn() {
9
+ },
10
+ error() {
11
+ },
12
+ trace() {
13
+ },
14
+ debug() {
15
+ },
16
+ audit() {
17
+ },
18
+ fatal() {
19
+ }
20
+ });
21
+ const LogLevel = {
22
+ info: "info",
23
+ debug: "debug",
24
+ trace: "trace",
25
+ warn: "warn",
26
+ error: "error",
27
+ audit: "audit",
28
+ fatal: "fatal"
29
+ };
30
+ const Console = () => ({
31
+ log: () => {
32
+ }
33
+ });
34
+ const http = () => ({
35
+ log() {
36
+ }
37
+ });
38
+ const webvitals = () => {
39
+ };
40
+ const logUnhandledErrors = () => {
41
+ };
42
+ export {
43
+ Console,
44
+ LogLevel,
45
+ http,
46
+ logUnhandledErrors,
47
+ logger,
48
+ webvitals
49
+ };
@@ -0,0 +1,11 @@
1
+ const setCustomUserData = () => {
2
+ };
3
+ const setCustomVirtualPageName = () => {
4
+ };
5
+ const startVirtualPageMonitoringWithAutoEnd = () => {
6
+ };
7
+ export {
8
+ setCustomUserData,
9
+ setCustomVirtualPageName,
10
+ startVirtualPageMonitoringWithAutoEnd
11
+ };
@@ -0,0 +1,8 @@
1
+ const attach = jest.fn();
2
+ const detach = jest.fn();
3
+ const getConfig = jest.fn();
4
+ export {
5
+ attach,
6
+ detach,
7
+ getConfig
8
+ };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ var svg_default = "SvgrURL";
3
+ const ReactComponent = "div";
4
+ export {
5
+ ReactComponent,
6
+ svg_default as default
7
+ };
@@ -0,0 +1,5 @@
1
+ const enableHotReloading = () => {
2
+ };
3
+ export {
4
+ enableHotReloading
5
+ };
@@ -3,8 +3,8 @@ import "regenerator-runtime/runtime";
3
3
  import "@testing-library/jest-dom/extend-expect";
4
4
  import jestAxe from "jest-axe";
5
5
  import ResizeObserver from "resize-observer-polyfill";
6
- import addMatchMedia from "./mocks/matchMedia.cjs";
7
- import { logger } from "./mocks/pui-diagnostics.cjs";
6
+ import { addMatchMedia } from "./mocks/matchMedia.js";
7
+ import { logger } from "./mocks/pui-diagnostics.js";
8
8
  const originalError = console.error;
9
9
  console.error = (...args) => {
10
10
  const ignoreList = [
@@ -6,7 +6,7 @@ import MiniCssExtractPlugin from "mini-css-extract-plugin";
6
6
  import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
7
7
  import SpeedMeasurePlugin from "speed-measure-webpack-plugin";
8
8
  import expressStaticGzip from "express-static-gzip";
9
- import { setupDefaultMiddlewares } from "../server/middlewares/index.js";
9
+ import { setupDefaultMiddlewares } from "../server/middlewares.js";
10
10
  import { loadRoutes } from "../server/util/index.js";
11
11
  import {
12
12
  isAppLoaderEnabled,
@@ -6,7 +6,7 @@ import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
6
6
  import { ESBuildMinifyPlugin } from "esbuild-loader";
7
7
  import SpeedMeasurePlugin from "speed-measure-webpack-plugin";
8
8
  import browserslistToEsbuild from "browserslist-to-esbuild";
9
- import baseConfigFactory from "./webpack.base.babel.js";
9
+ import { baseConfig } from "./webpack.base.babel.js";
10
10
  import {
11
11
  isAppLoaderEnabled,
12
12
  getPaths,
@@ -104,7 +104,7 @@ const htmlWebpackPlugin = new HtmlWebpackPlugin({
104
104
  googleTagManager: isGoogleTagManagerEnabled()
105
105
  }
106
106
  });
107
- const config = baseConfigFactory(getProdConfig());
107
+ const config = baseConfig(getProdConfig());
108
108
  config.plugins.push(htmlWebpackPlugin);
109
109
  const addSMPPlugin = (webpackConfig) => {
110
110
  const smpConfig = new SpeedMeasurePlugin({
@@ -1,2 +1,2 @@
1
1
  export function setupDefaultMiddlewares(app: any): void;
2
- export function setupAdditionalMiddlewars(app: any, options: any): any;
2
+ export function setupAdditionalMiddlewars(app: any, options?: {}): any;
@@ -9,7 +9,7 @@ export namespace jestConfig {
9
9
  '.*\\.(css|scss)$': any;
10
10
  '.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$': any;
11
11
  '.*\\.svg(?:\\?[a-zA-Z]+)?$': any;
12
- '.*\\.html$(?:\\?[a-zA-Z]+)?$': any;
12
+ '.*\\.html(?:\\?[a-zA-Z]+)?$': any;
13
13
  '@elliemae/pui-user-monitoring': any;
14
14
  '@elliemae/pui-app-loader': any;
15
15
  '@elliemae/pui-diagnostics': any;
@@ -13,7 +13,7 @@ export var jestNodeConfig: {
13
13
  '.*\\.(css|scss)$': any;
14
14
  '.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$': any;
15
15
  '.*\\.svg(?:\\?[a-zA-Z]+)?$': any;
16
- '.*\\.html$(?:\\?[a-zA-Z]+)?$': any;
16
+ '.*\\.html(?:\\?[a-zA-Z]+)?$': any;
17
17
  '@elliemae/pui-user-monitoring': any;
18
18
  '@elliemae/pui-app-loader': any;
19
19
  '@elliemae/pui-diagnostics': any;
@@ -0,0 +1,17 @@
1
+ declare namespace _default {
2
+ const defaults: {};
3
+ namespace interceptors {
4
+ namespace request {
5
+ const use: jest.Mock<any, any>;
6
+ }
7
+ namespace response {
8
+ const use_1: jest.Mock<any, any>;
9
+ export { use_1 as use };
10
+ }
11
+ }
12
+ const create: jest.Mock<any, any>;
13
+ const get: jest.Mock<any, any>;
14
+ const post: jest.Mock<any, any>;
15
+ const put: jest.Mock<any, any>;
16
+ }
17
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare var _default: "CSS_MODULE";
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare var _default: "HTML_MODULE";
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare var _default: "IMAGE_MOCK";
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export function addMatchMedia(): void;
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "7.0.0-alpha.6",
3
+ "version": "7.0.0-alpha.7",
4
4
  "description": "ICE MT UI Platform CLI",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -75,9 +75,9 @@
75
75
  "@commitlint/config-conventional": "~16.2.4",
76
76
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.4.2",
77
77
  "@faker-js/faker": "6.3.1",
78
- "@nrwl/cli": "14.1.1",
79
- "@nrwl/tao": "14.1.1",
80
- "@nrwl/workspace": "14.1.1",
78
+ "@nrwl/cli": "14.1.2",
79
+ "@nrwl/tao": "14.1.2",
80
+ "@nrwl/workspace": "14.1.2",
81
81
  "@pmmmwh/react-refresh-webpack-plugin": "~0.5.5",
82
82
  "@semantic-release/changelog": "~6.0.1",
83
83
  "@semantic-release/exec": "~6.0.3",
@@ -1,15 +0,0 @@
1
- module.exports = {
2
- defaults: {},
3
- interceptors: {
4
- request: {
5
- use: jest.fn(),
6
- },
7
- response: {
8
- use: jest.fn(),
9
- },
10
- },
11
- create: jest.fn().mockReturnThis(),
12
- get: jest.fn().mockResolvedValue({ data: {} }),
13
- post: jest.fn().mockResolvedValue({ data: {} }),
14
- put: jest.fn().mockResolvedValue({ data: {} }),
15
- };
@@ -1 +0,0 @@
1
- module.exports = 'CSS_MODULE';
@@ -1 +0,0 @@
1
- module.exports = 'HTML_MODULE';
@@ -1 +0,0 @@
1
- module.exports = 'IMAGE_MOCK';
@@ -1,24 +0,0 @@
1
- /**
2
- *
3
- */
4
- export default () => {
5
- Object.defineProperty(window, 'matchMedia', {
6
- writable: true,
7
- value: jest.fn().mockImplementation((query) => ({
8
- matches: false,
9
- media: query,
10
- onchange: null,
11
- addListener: jest.fn(), // Deprecated
12
- removeListener: jest.fn(), // Deprecated
13
- addEventListener: jest.fn(),
14
- removeEventListener: jest.fn(),
15
- dispatchEvent: jest.fn(),
16
- })),
17
- });
18
-
19
- Object.defineProperty(window, 'getComputedStyle', {
20
- value: () => ({
21
- getPropertyValue: () => {},
22
- }),
23
- });
24
- };
@@ -1 +0,0 @@
1
- export const load = () => {};
@@ -1,28 +0,0 @@
1
- export const logger = () => ({
2
- setLogLevel() {},
3
- setOptions() {},
4
- info() {},
5
- warn() {},
6
- error() {},
7
- trace() {},
8
- debug() {},
9
- audit() {},
10
- fatal() {},
11
- });
12
- export const LogLevel = {
13
- info: 'info',
14
- debug: 'debug',
15
- trace: 'trace',
16
- warn: 'warn',
17
- error: 'error',
18
- audit: 'audit',
19
- fatal: 'fatal',
20
- };
21
- export const Console = () => ({
22
- log: () => {},
23
- });
24
- export const http = () => ({
25
- log() {},
26
- });
27
- export const webvitals = () => {};
28
- export const logUnhandledErrors = () => {};
@@ -1,3 +0,0 @@
1
- export const setCustomUserData = () => {};
2
- export const setCustomVirtualPageName = () => {};
3
- export const startVirtualPageMonitoringWithAutoEnd = () => {};
@@ -1,3 +0,0 @@
1
- export const attach = jest.fn();
2
- export const detach = jest.fn();
3
- export const getConfig = jest.fn();
@@ -1,5 +0,0 @@
1
- // eslint-disable-next-line no-unused-vars
2
- import * as React from 'react';
3
-
4
- export default 'SvgrURL';
5
- export const ReactComponent = 'div';
@@ -1 +0,0 @@
1
- exports.enableHotReloading = () => {};
@@ -1,22 +0,0 @@
1
- import compression from "compression";
2
- import expressStaticGzip from "express-static-gzip";
3
- import { sendFileWithCSPNonce } from "../csp.js";
4
- import { getPaths } from "../../webpack/helpers.js";
5
- const paths = getPaths();
6
- const addProdMiddlewares = (app, options = {}) => {
7
- const { buildPath = paths.buildPath, basePath = paths.basePath } = options;
8
- app.use(compression());
9
- app.get(basePath, (req, res) => {
10
- sendFileWithCSPNonce({ buildPath, res });
11
- });
12
- app.use(basePath, expressStaticGzip(buildPath, {
13
- index: false,
14
- enableBrotli: true,
15
- orderPreference: ["br"]
16
- }));
17
- app.use(expressStaticGzip("cdn"));
18
- app.get("*", (req, res) => sendFileWithCSPNonce({ buildPath, res }));
19
- };
20
- export {
21
- addProdMiddlewares
22
- };
@@ -1,35 +0,0 @@
1
- import express from "express";
2
- import cors from "cors";
3
- import expressPinoLogger from "express-pino-logger";
4
- import { csp } from "../csp.js";
5
- import { addProdMiddlewares } from "./addProdMiddlewares.js";
6
- const setupDefaultMiddlewares = (app) => {
7
- const pino = expressPinoLogger({
8
- transport: {
9
- target: "pino-pretty",
10
- options: {
11
- colorize: true
12
- }
13
- }
14
- });
15
- pino.logger.level = "warn";
16
- app.use(pino);
17
- app.use(cors());
18
- app.options("*", cors());
19
- csp(app);
20
- app.use(express.urlencoded({ extended: false }));
21
- app.use(express.text({ type: "text/plain" }));
22
- app.use(express.json({ type: "application/json" }));
23
- app.use(express.json({ type: "application/csp-report" }));
24
- };
25
- const setupAdditionalMiddlewars = (app, options) => {
26
- const isProd = false;
27
- if (isProd) {
28
- addProdMiddlewares(app, options);
29
- }
30
- return app;
31
- };
32
- export {
33
- setupAdditionalMiddlewars,
34
- setupDefaultMiddlewares
35
- };
@@ -1 +0,0 @@
1
- module.exports = 'CSS_MODULE';
@@ -1 +0,0 @@
1
- module.exports = 'HTML_MODULE';
@@ -1 +0,0 @@
1
- module.exports = 'IMAGE_MOCK';
@@ -1,24 +0,0 @@
1
- /**
2
- *
3
- */
4
- export default () => {
5
- Object.defineProperty(window, 'matchMedia', {
6
- writable: true,
7
- value: jest.fn().mockImplementation((query) => ({
8
- matches: false,
9
- media: query,
10
- onchange: null,
11
- addListener: jest.fn(), // Deprecated
12
- removeListener: jest.fn(), // Deprecated
13
- addEventListener: jest.fn(),
14
- removeEventListener: jest.fn(),
15
- dispatchEvent: jest.fn(),
16
- })),
17
- });
18
-
19
- Object.defineProperty(window, 'getComputedStyle', {
20
- value: () => ({
21
- getPropertyValue: () => {},
22
- }),
23
- });
24
- };
@@ -1 +0,0 @@
1
- export const load = () => {};
@@ -1,28 +0,0 @@
1
- export const logger = () => ({
2
- setLogLevel() {},
3
- setOptions() {},
4
- info() {},
5
- warn() {},
6
- error() {},
7
- trace() {},
8
- debug() {},
9
- audit() {},
10
- fatal() {},
11
- });
12
- export const LogLevel = {
13
- info: 'info',
14
- debug: 'debug',
15
- trace: 'trace',
16
- warn: 'warn',
17
- error: 'error',
18
- audit: 'audit',
19
- fatal: 'fatal',
20
- };
21
- export const Console = () => ({
22
- log: () => {},
23
- });
24
- export const http = () => ({
25
- log() {},
26
- });
27
- export const webvitals = () => {};
28
- export const logUnhandledErrors = () => {};
@@ -1,3 +0,0 @@
1
- export const setCustomUserData = () => {};
2
- export const setCustomVirtualPageName = () => {};
3
- export const startVirtualPageMonitoringWithAutoEnd = () => {};
@@ -1,3 +0,0 @@
1
- export const attach = jest.fn();
2
- export const detach = jest.fn();
3
- export const getConfig = jest.fn();
@@ -1,5 +0,0 @@
1
- // eslint-disable-next-line no-unused-vars
2
- import * as React from 'react';
3
-
4
- export default 'SvgrURL';
5
- export const ReactComponent = 'div';
@@ -1 +0,0 @@
1
- exports.enableHotReloading = () => {};
@@ -1 +0,0 @@
1
- export function addProdMiddlewares(app: any, options?: {}): void;
@@ -1,14 +0,0 @@
1
- export const defaults: {};
2
- export namespace interceptors {
3
- namespace request {
4
- const use: jest.Mock<any, any>;
5
- }
6
- namespace response {
7
- const use_1: jest.Mock<any, any>;
8
- export { use_1 as use };
9
- }
10
- }
11
- export const create: jest.Mock<any, any>;
12
- export const get: jest.Mock<any, any>;
13
- export const post: jest.Mock<any, any>;
14
- export const put: jest.Mock<any, any>;
@@ -1,2 +0,0 @@
1
- declare const _exports: string;
2
- export = _exports;
@@ -1,2 +0,0 @@
1
- declare const _exports: string;
2
- export = _exports;
@@ -1,2 +0,0 @@
1
- declare const _exports: string;
2
- export = _exports;
@@ -1,2 +0,0 @@
1
- declare function _default(): void;
2
- export default _default;