@elliemae/pui-cli 7.0.0-alpha.4 → 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 (105) hide show
  1. package/dist/cjs/index.cjs +19 -0
  2. package/dist/cjs/monorepo/set-registry-version.js +1 -1
  3. package/dist/cjs/monorepo/set-workspace-version.js +1 -1
  4. package/dist/cjs/monorepo/utils.cjs +30 -0
  5. package/dist/cjs/server/index.js +1 -1
  6. package/dist/cjs/server/{middlewares/index.js → middlewares.js} +18 -7
  7. package/dist/cjs/server/util/app-routes.cjs +10 -0
  8. package/dist/cjs/server/util/index.js +2 -8
  9. package/dist/cjs/testing/jest.config.cjs +10 -13
  10. package/dist/cjs/testing/mocks/axios.js +37 -0
  11. package/dist/cjs/testing/mocks/cssModule.js +23 -0
  12. package/dist/cjs/testing/mocks/html.js +23 -0
  13. package/dist/cjs/testing/mocks/image.js +23 -0
  14. package/dist/cjs/testing/mocks/matchMedia.js +43 -0
  15. package/dist/cjs/testing/mocks/pui-app-loader.js +24 -0
  16. package/dist/cjs/testing/mocks/pui-diagnostics.js +68 -0
  17. package/dist/cjs/testing/mocks/pui-user-monitoring.js +30 -0
  18. package/dist/cjs/testing/mocks/retry-axios.js +27 -0
  19. package/dist/cjs/{monorepo/utils.js → testing/mocks/svg.js} +8 -13
  20. package/dist/cjs/testing/mocks/webpack-hmr.js +24 -0
  21. package/dist/cjs/testing/setup-tests.js +3 -3
  22. package/dist/cjs/transpile/.swcrc +11 -0
  23. package/dist/cjs/transpile/esbuild.js +1 -0
  24. package/dist/cjs/webpack/helpers.js +1 -1
  25. package/dist/cjs/webpack/webpack.base.babel.js +2 -2
  26. package/dist/cjs/webpack/webpack.dev.babel.js +8 -4
  27. package/dist/cjs/webpack/webpack.prod.babel.js +2 -2
  28. package/dist/esm/index.cjs +19 -0
  29. package/dist/esm/monorepo/set-registry-version.js +1 -1
  30. package/dist/esm/monorepo/set-workspace-version.js +1 -1
  31. package/dist/esm/monorepo/utils.cjs +30 -0
  32. package/dist/esm/server/index.js +1 -1
  33. package/dist/esm/server/middlewares.js +46 -0
  34. package/dist/esm/server/util/app-routes.cjs +10 -0
  35. package/dist/esm/server/util/index.js +2 -8
  36. package/dist/esm/testing/jest.config.cjs +10 -13
  37. package/dist/esm/testing/mocks/{axios.cjs → axios.js} +8 -5
  38. package/dist/esm/testing/mocks/cssModule.js +4 -0
  39. package/dist/esm/testing/mocks/html.js +4 -0
  40. package/dist/esm/testing/mocks/image.js +4 -0
  41. package/dist/esm/testing/mocks/matchMedia.js +24 -0
  42. package/dist/esm/testing/mocks/pui-app-loader.js +5 -0
  43. package/dist/esm/testing/mocks/pui-diagnostics.js +49 -0
  44. package/dist/esm/testing/mocks/pui-user-monitoring.js +11 -0
  45. package/dist/esm/testing/mocks/retry-axios.js +8 -0
  46. package/dist/esm/testing/mocks/svg.js +7 -0
  47. package/dist/esm/testing/mocks/webpack-hmr.js +5 -0
  48. package/dist/esm/testing/setup-tests.js +2 -2
  49. package/dist/esm/transpile/.swcrc +11 -0
  50. package/dist/esm/transpile/esbuild.js +1 -0
  51. package/dist/esm/webpack/helpers.js +1 -1
  52. package/dist/esm/webpack/webpack.base.babel.js +3 -3
  53. package/dist/esm/webpack/webpack.dev.babel.js +7 -4
  54. package/dist/esm/webpack/webpack.prod.babel.js +2 -2
  55. package/dist/types/index.d.cts +9 -0
  56. package/dist/types/monorepo/utils.d.cts +1 -0
  57. package/dist/types/server/{middlewares/index.d.ts → middlewares.d.ts} +1 -1
  58. package/dist/types/server/util/app-routes.d.cts +1 -0
  59. package/dist/types/testing/jest.config.d.cts +1 -1
  60. package/dist/types/testing/jest.node.config.d.cts +1 -1
  61. package/dist/types/testing/mocks/axios.d.ts +17 -0
  62. package/dist/types/testing/mocks/cssModule.d.ts +2 -0
  63. package/dist/types/testing/mocks/html.d.ts +2 -0
  64. package/dist/types/testing/mocks/image.d.ts +2 -0
  65. package/dist/types/testing/mocks/matchMedia.d.ts +1 -0
  66. package/dist/types/testing/mocks/{pui-app-loader.d.cts → pui-app-loader.d.ts} +0 -0
  67. package/dist/types/testing/mocks/{pui-diagnostics.d.cts → pui-diagnostics.d.ts} +0 -0
  68. package/dist/types/testing/mocks/{pui-user-monitoring.d.cts → pui-user-monitoring.d.ts} +0 -0
  69. package/dist/types/testing/mocks/{retry-axios.d.cts → retry-axios.d.ts} +0 -0
  70. package/dist/types/testing/mocks/{svg.d.cts → svg.d.ts} +0 -0
  71. package/dist/types/testing/mocks/{webpack-hmr.d.cts → webpack-hmr.d.ts} +0 -0
  72. package/dist/types/webpack/webpack.dev.babel.d.ts +2 -1
  73. package/package.json +9 -8
  74. package/dist/cjs/server/middlewares/addProdMiddlewares.js +0 -44
  75. package/dist/cjs/testing/mocks/axios.cjs +0 -15
  76. package/dist/cjs/testing/mocks/cssModule.cjs +0 -1
  77. package/dist/cjs/testing/mocks/html.cjs +0 -1
  78. package/dist/cjs/testing/mocks/image.cjs +0 -1
  79. package/dist/cjs/testing/mocks/matchMedia.cjs +0 -24
  80. package/dist/cjs/testing/mocks/pui-app-loader.cjs +0 -1
  81. package/dist/cjs/testing/mocks/pui-diagnostics.cjs +0 -28
  82. package/dist/cjs/testing/mocks/pui-user-monitoring.cjs +0 -3
  83. package/dist/cjs/testing/mocks/retry-axios.cjs +0 -3
  84. package/dist/cjs/testing/mocks/svg.cjs +0 -5
  85. package/dist/cjs/testing/mocks/webpack-hmr.cjs +0 -1
  86. package/dist/esm/monorepo/utils.js +0 -12
  87. package/dist/esm/server/middlewares/addProdMiddlewares.js +0 -22
  88. package/dist/esm/server/middlewares/index.js +0 -35
  89. package/dist/esm/testing/mocks/cssModule.cjs +0 -1
  90. package/dist/esm/testing/mocks/html.cjs +0 -1
  91. package/dist/esm/testing/mocks/image.cjs +0 -1
  92. package/dist/esm/testing/mocks/matchMedia.cjs +0 -24
  93. package/dist/esm/testing/mocks/pui-app-loader.cjs +0 -1
  94. package/dist/esm/testing/mocks/pui-diagnostics.cjs +0 -28
  95. package/dist/esm/testing/mocks/pui-user-monitoring.cjs +0 -3
  96. package/dist/esm/testing/mocks/retry-axios.cjs +0 -3
  97. package/dist/esm/testing/mocks/svg.cjs +0 -5
  98. package/dist/esm/testing/mocks/webpack-hmr.cjs +0 -1
  99. package/dist/types/monorepo/utils.d.ts +0 -1
  100. package/dist/types/server/middlewares/addProdMiddlewares.d.ts +0 -1
  101. package/dist/types/testing/mocks/axios.d.cts +0 -14
  102. package/dist/types/testing/mocks/cssModule.d.cts +0 -2
  103. package/dist/types/testing/mocks/html.d.cts +0 -2
  104. package/dist/types/testing/mocks/image.d.cts +0 -2
  105. package/dist/types/testing/mocks/matchMedia.d.cts +0 -2
@@ -20,20 +20,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
21
  var webpack_dev_babel_exports = {};
22
22
  __export(webpack_dev_babel_exports, {
23
- config: () => config
23
+ default: () => webpack_dev_babel_default
24
24
  });
25
25
  module.exports = __toCommonJS(webpack_dev_babel_exports);
26
26
  var import_node_path = __toESM(require("node:path"), 1);
27
+ var import_node_url = require("node:url");
27
28
  var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"), 1);
28
29
  var import_circular_dependency_plugin = __toESM(require("circular-dependency-plugin"), 1);
29
30
  var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"), 1);
30
31
  var import_react_refresh_webpack_plugin = __toESM(require("@pmmmwh/react-refresh-webpack-plugin"), 1);
31
32
  var import_speed_measure_webpack_plugin = __toESM(require("speed-measure-webpack-plugin"), 1);
32
33
  var import_express_static_gzip = __toESM(require("express-static-gzip"), 1);
33
- var import_middlewares = require("../server/middlewares/index.js");
34
+ var import_middlewares = require("../server/middlewares.js");
34
35
  var import_util = require("../server/util/index.js");
35
36
  var import_helpers = require("./helpers.js");
36
- var import_webpack_base_babel = __toESM(require("./webpack.base.babel.js"), 1);
37
+ var import_webpack_base_babel = require("./webpack.base.babel.js");
38
+ const import_meta = {};
39
+ const __filename = (0, import_node_url.fileURLToPath)(import_meta.url);
37
40
  const smp = new import_speed_measure_webpack_plugin.default({ disable: !process.env.MEASURE });
38
41
  const {
39
42
  appVersion,
@@ -132,5 +135,6 @@ const devConfig = {
132
135
  }
133
136
  }
134
137
  };
135
- const config = smp.wrap((0, import_webpack_base_babel.default)(devConfig));
138
+ const config = smp.wrap((0, import_webpack_base_babel.baseConfig)(devConfig));
136
139
  config.plugins = config.plugins.concat([new import_react_refresh_webpack_plugin.default({})]);
140
+ var webpack_dev_babel_default = config;
@@ -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({
@@ -0,0 +1,19 @@
1
+ const { babelConfig } = require('./babel/babel.config.cjs');
2
+ const { esConfig: eslintBaseConfig } = require('./lint/eslint/non-react.cjs');
3
+ const { esReactConfig: eslintConfig } = require('./lint/eslint/react.cjs');
4
+ const { stylelintConfig } = require('./lint/stylelint.config.cjs');
5
+ const { prettierConfig } = require('./lint/prettier.config.cjs');
6
+ const { commitlintConfig } = require('./lint/commitlint.config.cjs');
7
+ const { jestConfig } = require('./testing/jest.config.cjs');
8
+ const { jestNodeConfig } = require('./testing/jest.node.config.cjs');
9
+
10
+ module.exports = {
11
+ babelConfig,
12
+ eslintBaseConfig,
13
+ eslintConfig,
14
+ stylelintConfig,
15
+ prettierConfig,
16
+ commitlintConfig,
17
+ jestConfig,
18
+ jestNodeConfig,
19
+ };
@@ -1,7 +1,7 @@
1
1
  import { readFile, writeFile } from "node:fs/promises";
2
2
  import fg from "fast-glob";
3
3
  import normalizePath from "normalize-path";
4
- import { findMonoRepoRoot } from "./utils.js";
4
+ import { findMonoRepoRoot } from "./utils.cjs";
5
5
  const monorepoRoot = normalizePath(findMonoRepoRoot() || "");
6
6
  const setRegistryVersion = async () => {
7
7
  const files = await fg([
@@ -1,7 +1,7 @@
1
1
  import { readFile, writeFile } from "node:fs/promises";
2
2
  import fg from "fast-glob";
3
3
  import normalizePath from "normalize-path";
4
- import { findMonoRepoRoot } from "./utils.js";
4
+ import { findMonoRepoRoot } from "./utils.cjs";
5
5
  const monorepoRoot = normalizePath(findMonoRepoRoot() || "");
6
6
  const setWorkspaceVersion = async () => {
7
7
  const files = await fg([
@@ -0,0 +1,30 @@
1
+ const path = require('path');
2
+ const { execSync } = require('child_process');
3
+
4
+ const WORKSPACE_DIR_ENV_VAR = 'NPM_CONFIG_WORKSPACE_DIR';
5
+ const WORKSPACE_MANIFEST_FILENAME = 'pnpm-workspace.yaml';
6
+
7
+ const getPNPMWorkspaceLocation = (cwd) => {
8
+ let location = null;
9
+ const findUpExec = path.resolve(process.cwd(), path.join('node_modules', '.bin', `find-up${process.platform === 'win32' ? '.cmd' : ''}`));
10
+ for (const fileName of [WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml']){
11
+ try {
12
+ const result = execSync(`${findUpExec} ${fileName}`, { cwd });
13
+ location = result.toString().trim();
14
+ break;
15
+ } catch (err) {
16
+ // ignore
17
+ }
18
+ };
19
+ return location;
20
+ };
21
+
22
+ exports.findMonoRepoRoot = (cwd = process.cwd()) => {
23
+ const workspaceManifestDirEnvVar =
24
+ process.env[WORKSPACE_DIR_ENV_VAR] ??
25
+ process.env[WORKSPACE_DIR_ENV_VAR.toLowerCase()];
26
+ const workspaceManifestLocation = workspaceManifestDirEnvVar
27
+ ? path.join(workspaceManifestDirEnvVar, 'pnpm-workspace.yaml')
28
+ : getPNPMWorkspaceLocation(cwd);
29
+ return workspaceManifestLocation && path.dirname(workspaceManifestLocation);
30
+ };
@@ -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
+ };
@@ -0,0 +1,10 @@
1
+ exports.initRoute = (routeFile, app) => {
2
+ // eslint-disable-next-line global-require
3
+ const init = require(routeFile);
4
+ try {
5
+ init(app);
6
+ } catch (err) {
7
+ // eslint-disable-next-line no-console
8
+ console.error(`unable to load routes from ${routeFile}. ${err.message}`);
9
+ }
10
+ }
@@ -1,6 +1,7 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
3
  import minimist from "minimist";
4
+ import { initRoute } from "./app-routes.cjs";
4
5
  const argv = minimist(process.argv.slice(2));
5
6
  const getCWD = () => process.cwd();
6
7
  const allJS = /\.js$/;
@@ -27,14 +28,7 @@ const loadRoutes = (app) => {
27
28
  const routeFiles = getServerRouteFiles(path.join(getCWD(), "server/routes"));
28
29
  routeFiles.push(...getServiceEndpoints(path.join(getCWD(), "app")));
29
30
  routeFiles.push(...getServiceEndpoints(path.join(getCWD(), "lib")));
30
- routeFiles.forEach(async (routeFile) => {
31
- const init = await import(routeFile);
32
- try {
33
- init(app);
34
- } catch (err) {
35
- console.error(`unable to load routes from ${routeFile}. ${err.message}`);
36
- }
37
- });
31
+ routeFiles.forEach((routeFile) => initRoute(routeFile, app));
38
32
  };
39
33
  const port = parseInt(argv.port || process.env.port || process.env.PORT || "3000", 10);
40
34
  const host = argv.host || process.env.HOST;
@@ -2,11 +2,7 @@ const path = require('path');
2
2
  const normalizePath = require('normalize-path');
3
3
  const { getAppConfig, basePath } = require('../utils.cjs');
4
4
  const { swcrcConfig } = require('../transpile/swcrc.config.cjs');
5
-
6
- let monorepoRoot = null;
7
- import('../monorepo/utils.js').then(({ findMonoRepoRoot }) => {
8
- monorepoRoot = findMonoRepoRoot(process.cwd());
9
- }).catch((ex) => console.error('Error loading monorepo utils:', ex));
5
+ const { findMonoRepoRoot } = require('../monorepo/utils.cjs');
10
6
 
11
7
  let isReactModule = true;
12
8
  try {
@@ -22,6 +18,7 @@ const getMockFilePath = (fileName) =>
22
18
  normalizePath(path.resolve(__dirname, './mocks', fileName));
23
19
 
24
20
  const getNodeModulesPath = (fileName) => {
21
+ const monorepoRoot = findMonoRepoRoot(process.cwd());
25
22
  return normalizePath(
26
23
  monorepoRoot
27
24
  ? path.join(monorepoRoot, 'node_modules', fileName)
@@ -60,15 +57,15 @@ const jestConfig = {
60
57
  coverageReporters: ['lcov', 'html', 'text-summary'],
61
58
  moduleDirectories: ['node_modules', 'app', 'lib'],
62
59
  moduleNameMapper: {
63
- '.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.cjs'),
64
- '.*\\.(css|scss)$': getMockFilePath('cssModule.cjs'),
60
+ '.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.js'),
61
+ '.*\\.(css|scss)$': getMockFilePath('cssModule.js'),
65
62
  '.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
66
- getMockFilePath('image.cjs'),
67
- '.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.cjs'),
68
- '.*\\.html$(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.cjs'),
69
- '@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.cjs'),
70
- '@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.cjs'),
71
- '@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'),
72
69
  'react-spring/web': getNodeModulesPath('react-spring/web.cjs.js'),
73
70
  'react-spring/renderprops': getNodeModulesPath(
74
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 = [
@@ -0,0 +1,11 @@
1
+ {
2
+ "jsc": {
3
+ "parser": {
4
+ "syntax": "typescript",
5
+ "jsx": true,
6
+ "tsx": true,
7
+ "dynamicImport": true
8
+ },
9
+ "target": "es2020"
10
+ }
11
+ }
@@ -48,6 +48,7 @@ const getCommonConfig = ({ injectReactShim }) => ({
48
48
  const copyFiles = async ({ srcdir, outdir }) => {
49
49
  const files = await fg([
50
50
  `${srcdir}/**/*.*`,
51
+ `${srcdir}/**/.swcrc`,
51
52
  `!${srcdir}/**/*.{js,jsx,ts,tsx,mjs}`
52
53
  ]);
53
54
  await Promise.all(files.map(async (srcFilePath) => {
@@ -22,7 +22,7 @@ import fs from "node:fs";
22
22
  import _ from "lodash";
23
23
  import CompressionPlugin from "compression-webpack-plugin";
24
24
  import zlib from "zlib";
25
- import { findMonoRepoRoot } from "../monorepo/utils.js";
25
+ import { findMonoRepoRoot } from "../monorepo/utils.cjs";
26
26
  import { basePath, getAppConfig } from "../utils.cjs";
27
27
  let pathSep = path.sep;
28
28
  if (pathSep === "\\")
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  import path from "node:path";
18
- import webpack, { ProvidePlugin, ProgressPlugin } from "webpack";
18
+ import webpack from "webpack";
19
19
  import MiniCssExtractPlugin from "mini-css-extract-plugin";
20
20
  import PostcssPresetEnv from "postcss-preset-env";
21
21
  import CopyWebpackPlugin from "copy-webpack-plugin";
@@ -43,7 +43,7 @@ const plugins = [
43
43
  NODE_ENV: "development",
44
44
  CI: "false"
45
45
  }),
46
- new ProvidePlugin({
46
+ new webpack.ProvidePlugin({
47
47
  React: "react"
48
48
  }),
49
49
  new CopyWebpackPlugin({
@@ -127,7 +127,7 @@ const plugins = [
127
127
  }
128
128
  }
129
129
  }),
130
- new ProgressPlugin()
130
+ new webpack.ProgressPlugin()
131
131
  ];
132
132
  const baseConfig = (options) => ({
133
133
  mode: options.mode,
@@ -1,18 +1,20 @@
1
1
  import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
2
3
  import HtmlWebpackPlugin from "html-webpack-plugin";
3
4
  import CircularDependencyPlugin from "circular-dependency-plugin";
4
5
  import MiniCssExtractPlugin from "mini-css-extract-plugin";
5
6
  import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
6
7
  import SpeedMeasurePlugin from "speed-measure-webpack-plugin";
7
8
  import expressStaticGzip from "express-static-gzip";
8
- import { setupDefaultMiddlewares } from "../server/middlewares/index.js";
9
+ import { setupDefaultMiddlewares } from "../server/middlewares.js";
9
10
  import { loadRoutes } from "../server/util/index.js";
10
11
  import {
11
12
  isAppLoaderEnabled,
12
13
  getPaths,
13
14
  isGoogleTagManagerEnabled
14
15
  } from "./helpers.js";
15
- import baseConfigFactory from "./webpack.base.babel.js";
16
+ import { baseConfig } from "./webpack.base.babel.js";
17
+ const __filename = fileURLToPath(import.meta.url);
16
18
  const smp = new SpeedMeasurePlugin({ disable: !process.env.MEASURE });
17
19
  const {
18
20
  appVersion,
@@ -111,8 +113,9 @@ const devConfig = {
111
113
  }
112
114
  }
113
115
  };
114
- const config = smp.wrap(baseConfigFactory(devConfig));
116
+ const config = smp.wrap(baseConfig(devConfig));
115
117
  config.plugins = config.plugins.concat([new ReactRefreshWebpackPlugin({})]);
118
+ var webpack_dev_babel_default = config;
116
119
  export {
117
- config
120
+ webpack_dev_babel_default as default
118
121
  };
@@ -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({
@@ -0,0 +1,9 @@
1
+ import { babelConfig } from "./babel/babel.config.cjs";
2
+ import { esConfig as eslintBaseConfig } from "./lint/eslint/non-react.cjs";
3
+ import { esReactConfig as eslintConfig } from "./lint/eslint/react.cjs";
4
+ import { stylelintConfig } from "./lint/stylelint.config.cjs";
5
+ import { prettierConfig } from "./lint/prettier.config.cjs";
6
+ import { commitlintConfig } from "./lint/commitlint.config.cjs";
7
+ import { jestConfig } from "./testing/jest.config.cjs";
8
+ import { jestNodeConfig } from "./testing/jest.node.config.cjs";
9
+ export { babelConfig, eslintBaseConfig, eslintConfig, stylelintConfig, prettierConfig, commitlintConfig, jestConfig, jestNodeConfig };
@@ -0,0 +1 @@
1
+ export function findMonoRepoRoot(cwd?: string): string | null;
@@ -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;
@@ -0,0 +1 @@
1
+ export function initRoute(routeFile: any, app: any): void;
@@ -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