@elliemae/pui-cli 9.0.0-next.5 → 9.0.0-next.50

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 (204) hide show
  1. package/app.tsconfig.json +1 -1
  2. package/dist/cjs/babel.config.cjs +1 -1
  3. package/dist/cjs/cli.js +2 -2
  4. package/dist/cjs/commands/build.js +4 -6
  5. package/dist/cjs/commands/codemod.js +1 -1
  6. package/dist/cjs/commands/gendoc.js +2 -2
  7. package/dist/cjs/commands/lint.js +28 -11
  8. package/dist/cjs/commands/pack.js +3 -4
  9. package/dist/cjs/commands/start.js +3 -3
  10. package/dist/cjs/commands/storybook.js +1 -1
  11. package/dist/cjs/commands/test.js +46 -23
  12. package/dist/cjs/commands/tscheck.js +3 -3
  13. package/dist/cjs/commands/utils.js +37 -10
  14. package/dist/cjs/commands/version.js +1 -1
  15. package/dist/cjs/commands/vitest.js +6 -11
  16. package/dist/cjs/index.cjs +0 -2
  17. package/dist/cjs/index.js +4 -2
  18. package/dist/cjs/lint-config/eslint/common.cjs +3 -2
  19. package/dist/cjs/lint-config/eslint/typescript/common.cjs +3 -3
  20. package/dist/cjs/lint-config/lint-staged.config.js +2 -2
  21. package/dist/cjs/lint-config/stylelint.config.js +45 -0
  22. package/dist/cjs/monorepo/delete-merged-tags.js +2 -3
  23. package/dist/cjs/monorepo/set-registry-version.js +3 -3
  24. package/dist/cjs/monorepo/set-workspace-version.js +3 -3
  25. package/dist/cjs/monorepo/utils.js +1 -1
  26. package/dist/cjs/pui-config.js +5 -6
  27. package/dist/cjs/release.config.js +46 -0
  28. package/dist/cjs/server/appRoutes.js +5 -8
  29. package/dist/cjs/server/csp.js +6 -5
  30. package/dist/cjs/server/index.js +6 -1
  31. package/dist/cjs/server/logger.js +2 -2
  32. package/dist/cjs/server/middlewares.js +5 -5
  33. package/dist/cjs/server/utils.js +12 -5
  34. package/dist/cjs/server/wsServer.js +125 -0
  35. package/dist/cjs/testing/ExtendedJSDomEnv.cjs +27 -0
  36. package/dist/cjs/testing/extended/axe-core/getMessageAndPass.js +36 -0
  37. package/dist/cjs/testing/extended/axe-core/index.js +24 -0
  38. package/dist/cjs/testing/extended/axe-core/reporter.js +50 -0
  39. package/dist/cjs/testing/extended/axe-core/shouldIgnoreNodeViolation.js +31 -0
  40. package/dist/cjs/testing/extended/axe-core/toHaveNoViolations.js +42 -0
  41. package/dist/cjs/testing/jest.config.cjs +6 -2
  42. package/dist/cjs/testing/jest.polyfills.cjs +30 -0
  43. package/dist/cjs/testing/mocks/svg.js +1 -1
  44. package/dist/cjs/testing/setup-react-env.js +1 -1
  45. package/dist/cjs/testing/setup-test-env.js +0 -2
  46. package/dist/cjs/testing/setup-tests.js +30 -12
  47. package/dist/cjs/testing/vitest.config.js +10 -10
  48. package/dist/cjs/transpile/.swcrc +1 -1
  49. package/dist/cjs/transpile/esbuild.js +48 -15
  50. package/dist/cjs/transpile/react-shim.js +1 -1
  51. package/dist/cjs/update-notifier.js +3 -3
  52. package/dist/cjs/utils.js +4 -5
  53. package/dist/cjs/webpack/helpers.js +29 -23
  54. package/dist/cjs/webpack/webpack.base.babel.js +21 -35
  55. package/dist/cjs/webpack/webpack.dev.babel.js +20 -10
  56. package/dist/cjs/webpack/webpack.lib.base.babel.js +22 -13
  57. package/dist/cjs/webpack/webpack.lib.dev.babel.js +14 -18
  58. package/dist/cjs/webpack/webpack.lib.prod.babel.js +12 -11
  59. package/dist/cjs/webpack/webpack.prod.babel.js +8 -8
  60. package/dist/cjs/webpack/webpack.storybook.js +15 -17
  61. package/dist/esm/babel.config.cjs +1 -1
  62. package/dist/esm/commands/build.js +2 -4
  63. package/dist/esm/commands/lint.js +27 -9
  64. package/dist/esm/commands/pack.js +1 -2
  65. package/dist/esm/commands/start.js +1 -1
  66. package/dist/esm/commands/test.js +45 -22
  67. package/dist/esm/commands/utils.js +33 -6
  68. package/dist/esm/commands/vitest.js +5 -10
  69. package/dist/esm/index.cjs +0 -2
  70. package/dist/esm/index.js +4 -2
  71. package/dist/esm/lint-config/eslint/common.cjs +3 -2
  72. package/dist/esm/lint-config/eslint/typescript/common.cjs +3 -3
  73. package/dist/esm/lint-config/stylelint.config.js +25 -0
  74. package/dist/esm/monorepo/delete-merged-tags.js +2 -3
  75. package/dist/esm/monorepo/set-registry-version.js +1 -1
  76. package/dist/esm/monorepo/set-workspace-version.js +1 -1
  77. package/dist/esm/pui-config.js +2 -3
  78. package/dist/esm/release.config.js +26 -0
  79. package/dist/esm/server/appRoutes.js +3 -6
  80. package/dist/esm/server/csp.js +2 -1
  81. package/dist/esm/server/index.js +6 -1
  82. package/dist/esm/server/utils.js +11 -4
  83. package/dist/esm/server/wsServer.js +95 -0
  84. package/dist/esm/testing/ExtendedJSDomEnv.cjs +27 -0
  85. package/dist/esm/testing/extended/axe-core/getMessageAndPass.js +16 -0
  86. package/dist/esm/testing/extended/axe-core/index.js +4 -0
  87. package/dist/esm/testing/extended/axe-core/reporter.js +30 -0
  88. package/dist/esm/testing/extended/axe-core/shouldIgnoreNodeViolation.js +11 -0
  89. package/dist/esm/testing/extended/axe-core/toHaveNoViolations.js +22 -0
  90. package/dist/esm/testing/jest.config.cjs +6 -2
  91. package/dist/esm/testing/jest.polyfills.cjs +30 -0
  92. package/dist/esm/testing/setup-test-env.js +0 -2
  93. package/dist/esm/testing/setup-tests.js +29 -11
  94. package/dist/esm/testing/vitest.config.js +8 -8
  95. package/dist/esm/transpile/.swcrc +1 -1
  96. package/dist/esm/transpile/esbuild.js +45 -12
  97. package/dist/esm/update-notifier.js +1 -1
  98. package/dist/esm/utils.js +2 -3
  99. package/dist/esm/webpack/helpers.js +25 -19
  100. package/dist/esm/webpack/webpack.base.babel.js +13 -27
  101. package/dist/esm/webpack/webpack.dev.babel.js +13 -3
  102. package/dist/esm/webpack/webpack.lib.base.babel.js +14 -5
  103. package/dist/esm/webpack/webpack.lib.dev.babel.js +9 -13
  104. package/dist/esm/webpack/webpack.lib.prod.babel.js +12 -7
  105. package/dist/esm/webpack/webpack.prod.babel.js +4 -4
  106. package/dist/esm/webpack/webpack.storybook.js +12 -14
  107. package/dist/types/docusaurus.config.d.ts +2 -0
  108. package/dist/types/{babel.config.d.cts → lib/babel.config.d.cts} +7 -7
  109. package/dist/types/{commands → lib/commands}/build.d.ts +2 -2
  110. package/dist/types/{commands → lib/commands}/codemod.d.ts +2 -2
  111. package/dist/types/{commands → lib/commands}/lint.d.ts +3 -2
  112. package/dist/types/{commands → lib/commands}/pack.d.ts +2 -2
  113. package/dist/types/{commands → lib/commands}/start.d.ts +2 -2
  114. package/dist/types/{commands → lib/commands}/storybook.d.ts +2 -2
  115. package/dist/types/{commands → lib/commands}/test.d.ts +4 -2
  116. package/dist/types/{commands → lib/commands}/tscheck.d.ts +2 -2
  117. package/dist/types/lib/commands/utils.d.ts +39 -0
  118. package/dist/types/{commands → lib/commands}/version.d.ts +2 -2
  119. package/dist/types/{commands → lib/commands}/vitest.d.ts +2 -2
  120. package/dist/types/{index.d.cts → lib/index.d.cts} +1 -2
  121. package/dist/types/{index.d.ts → lib/index.d.ts} +3 -1
  122. package/dist/types/{lint-config → lib/lint-config}/commitlint.config.d.cts +1 -1
  123. package/dist/types/{lint-config → lib/lint-config}/eslint/common.d.cts +18 -12
  124. package/dist/types/{lint-config → lib/lint-config}/eslint/non-react.d.cts +8 -1
  125. package/dist/types/{lint-config → lib/lint-config}/eslint/react.d.cts +8 -1
  126. package/dist/types/{lint-config → lib/lint-config}/eslint/typescript/common.d.cts +6 -6
  127. package/dist/types/{lint-config → lib/lint-config}/eslint/typescript/non-react.d.cts +9 -2
  128. package/dist/types/{lint-config → lib/lint-config}/eslint/typescript/react.d.cts +9 -2
  129. package/dist/types/lib/lint-config/lint-staged.config.d.ts +5 -0
  130. package/dist/types/lib/lint-config/prettier.config.d.cts +8 -0
  131. package/dist/types/lib/lint-config/stylelint.config.d.ts +13 -0
  132. package/dist/types/lib/release.config.d.ts +10 -0
  133. package/dist/types/{server → lib/server}/csp.d.ts +2 -2
  134. package/dist/types/{server → lib/server}/utils.d.ts +1 -0
  135. package/dist/types/lib/server/wsServer.d.ts +13 -0
  136. package/dist/types/lib/testing/ExtendedJSDomEnv.d.cts +5 -0
  137. package/dist/types/lib/testing/extended/axe-core/getMessageAndPass.d.ts +8 -0
  138. package/dist/types/lib/testing/extended/axe-core/index.d.ts +1 -0
  139. package/dist/types/lib/testing/extended/axe-core/reporter.d.ts +2 -0
  140. package/dist/types/lib/testing/extended/axe-core/shouldIgnoreNodeViolation.d.ts +2 -0
  141. package/dist/types/lib/testing/extended/axe-core/toHaveNoViolations.d.ts +12 -0
  142. package/dist/types/lib/testing/jest.config.d.cts +45 -0
  143. package/dist/types/{testing → lib/testing}/jest.node.config.d.cts +4 -0
  144. package/dist/types/lib/testing/mocks/axios.d.ts +17 -0
  145. package/dist/types/{testing → lib/testing}/mocks/pui-diagnostics.d.ts +13 -13
  146. package/dist/types/lib/testing/setup-tests.d.ts +1 -0
  147. package/dist/types/lib/testing/vitest.config.d.ts +1 -0
  148. package/dist/types/lib/tests/basic.test.d.ts +0 -0
  149. package/dist/types/{transpile → lib/transpile}/esbuild.d.ts +3 -3
  150. package/dist/types/lib/typedoc.d.cts +3 -0
  151. package/dist/types/{webpack → lib/webpack}/helpers.d.ts +4 -1
  152. package/dist/types/{webpack → lib/webpack}/webpack.storybook.d.ts +0 -1
  153. package/nx.json +97 -0
  154. package/package.json +209 -193
  155. package/dist/cjs/lint-config/stylelint.config.cjs +0 -19
  156. package/dist/cjs/release.config.cjs +0 -24
  157. package/dist/esm/lint-config/stylelint.config.cjs +0 -19
  158. package/dist/esm/release.config.cjs +0 -24
  159. package/dist/types/commands/utils.d.ts +0 -17
  160. package/dist/types/lint-config/lint-staged.config.d.ts +0 -5
  161. package/dist/types/lint-config/prettier.config.d.cts +0 -8
  162. package/dist/types/lint-config/stylelint.config.d.cts +0 -10
  163. package/dist/types/release.config.d.cts +0 -7
  164. package/dist/types/testing/jest.config.d.cts +0 -41
  165. package/dist/types/testing/mocks/axios.d.ts +0 -17
  166. package/dist/types/testing/vitest.config.d.ts +0 -1
  167. package/dist/types/typedoc.d.cts +0 -3
  168. /package/dist/types/{cli.d.ts → lib/cli.d.ts} +0 -0
  169. /package/dist/types/{commands → lib/commands}/gendoc.d.ts +0 -0
  170. /package/dist/types/{dummy.d.ts → lib/dummy.d.ts} +0 -0
  171. /package/dist/types/{monorepo → lib/monorepo}/delete-merged-tags.d.ts +0 -0
  172. /package/dist/types/{monorepo → lib/monorepo}/set-registry-version.d.ts +0 -0
  173. /package/dist/types/{monorepo → lib/monorepo}/set-workspace-version.d.ts +0 -0
  174. /package/dist/types/{monorepo → lib/monorepo}/utils.d.cts +0 -0
  175. /package/dist/types/{monorepo → lib/monorepo}/utils.d.ts +0 -0
  176. /package/dist/types/{pui-config.d.ts → lib/pui-config.d.ts} +0 -0
  177. /package/dist/types/{server → lib/server}/appRoutes.d.ts +0 -0
  178. /package/dist/types/{server → lib/server}/index.d.ts +0 -0
  179. /package/dist/types/{server → lib/server}/logger.d.ts +0 -0
  180. /package/dist/types/{server → lib/server}/middlewares.d.ts +0 -0
  181. /package/dist/types/{testing/setup-react-env.d.ts → lib/testing/jest.polyfills.d.cts} +0 -0
  182. /package/dist/types/{testing → lib/testing}/mocks/cssModule.d.ts +0 -0
  183. /package/dist/types/{testing → lib/testing}/mocks/html.d.ts +0 -0
  184. /package/dist/types/{testing → lib/testing}/mocks/image.d.ts +0 -0
  185. /package/dist/types/{testing → lib/testing}/mocks/matchMedia.d.ts +0 -0
  186. /package/dist/types/{testing → lib/testing}/mocks/pui-app-loader.d.ts +0 -0
  187. /package/dist/types/{testing → lib/testing}/mocks/pui-user-monitoring.d.ts +0 -0
  188. /package/dist/types/{testing → lib/testing}/mocks/retry-axios.d.ts +0 -0
  189. /package/dist/types/{testing → lib/testing}/mocks/svg.d.ts +0 -0
  190. /package/dist/types/{testing → lib/testing}/mocks/webpack-hmr.d.ts +0 -0
  191. /package/dist/types/{testing → lib/testing}/resolver.d.cts +0 -0
  192. /package/dist/types/{testing/setup-test-env.d.ts → lib/testing/setup-react-env.d.ts} +0 -0
  193. /package/dist/types/{testing/setup-tests.d.ts → lib/testing/setup-test-env.d.ts} +0 -0
  194. /package/dist/types/{transpile → lib/transpile}/react-shim.d.ts +0 -0
  195. /package/dist/types/{transpile → lib/transpile}/swcrc.config.d.cts +0 -0
  196. /package/dist/types/{update-notifier.d.ts → lib/update-notifier.d.ts} +0 -0
  197. /package/dist/types/{utils.d.cts → lib/utils.d.cts} +0 -0
  198. /package/dist/types/{utils.d.ts → lib/utils.d.ts} +0 -0
  199. /package/dist/types/{webpack → lib/webpack}/webpack.base.babel.d.ts +0 -0
  200. /package/dist/types/{webpack → lib/webpack}/webpack.dev.babel.d.ts +0 -0
  201. /package/dist/types/{webpack → lib/webpack}/webpack.lib.base.babel.d.ts +0 -0
  202. /package/dist/types/{webpack → lib/webpack}/webpack.lib.dev.babel.d.ts +0 -0
  203. /package/dist/types/{webpack → lib/webpack}/webpack.lib.prod.babel.d.ts +0 -0
  204. /package/dist/types/{webpack → lib/webpack}/webpack.prod.babel.d.ts +0 -0
package/dist/esm/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- const basePath = (process.env.BASE_PATH || "/").replace(/\/?$/, "/");
3
+ const basePath = (process.env.BASE_PATH ?? "/").replace(/\/?$/, "/");
4
4
  const isApp = () => fs.existsSync(path.join(process.cwd(), "app"));
5
5
  const getAppConfig = () => {
6
6
  const appConfigPath = path.join(
@@ -8,8 +8,7 @@ const getAppConfig = () => {
8
8
  isApp() ? "app" : "lib",
9
9
  "app.config.json"
10
10
  );
11
- if (!fs.existsSync(appConfigPath))
12
- return "{}";
11
+ if (!fs.existsSync(appConfigPath)) return "{}";
13
12
  const appConfig = fs.readFileSync(appConfigPath);
14
13
  return appConfig || "{}";
15
14
  };
@@ -1,8 +1,8 @@
1
1
  import path from "node:path";
2
2
  import fs from "node:fs";
3
+ import zlib from "zlib";
3
4
  import _ from "lodash";
4
5
  import CompressionPlugin from "compression-webpack-plugin";
5
- import zlib from "zlib";
6
6
  import { findMonoRepoRoot } from "../monorepo/utils.js";
7
7
  import { basePath, getAppConfig } from "../utils.js";
8
8
  let pathSep = path.sep;
@@ -16,9 +16,8 @@ const excludeNodeModulesExcept = (modules) => {
16
16
  const moduleRegExps = getNodeModulesRegEx(modules);
17
17
  return function(modulePath) {
18
18
  if (/node_modules/.test(modulePath)) {
19
- for (let i = 0; i < moduleRegExps.length; i += 1)
20
- if (moduleRegExps[i].test(modulePath))
21
- return false;
19
+ for (const moduleRegExp of moduleRegExps)
20
+ if (moduleRegExp.test(modulePath)) return false;
22
21
  return true;
23
22
  }
24
23
  return false;
@@ -32,7 +31,7 @@ const getLibraryName = () => {
32
31
  const modifiedLibName = `emui-${libraryName.replace("@elliemae/", "").replace("pui-", "")}`;
33
32
  return _.camelCase(modifiedLibName);
34
33
  };
35
- const getLibraryVariableName = () => (process.env.LIBRARY_VARIABLE_NAME || getLibraryName()).split(".");
34
+ const getLibraryVariableName = () => (process.env.LIBRARY_VARIABLE_NAME ?? getLibraryName()).split(".");
36
35
  const mapToFolder = (dependencies, folder) => dependencies.reduce(
37
36
  (acc, dependency) => ({
38
37
  [dependency]: path.resolve(`${folder}/${dependency.replace("$", "")}`),
@@ -41,7 +40,7 @@ const mapToFolder = (dependencies, folder) => dependencies.reduce(
41
40
  {}
42
41
  );
43
42
  const getAlias = () => {
44
- const monorepoRoot = findMonoRepoRoot(process.cwd()) || "";
43
+ const monorepoRoot = findMonoRepoRoot(process.cwd()) ?? "";
45
44
  return mapToFolder(
46
45
  [
47
46
  "@babel/runtime",
@@ -55,6 +54,8 @@ const getAlias = () => {
55
54
  "styled-components",
56
55
  "immer",
57
56
  "react-dates",
57
+ "react-select",
58
+ "react-spring",
58
59
  "react-transition-group",
59
60
  "@elliemae/pui-cli",
60
61
  "@elliemae/pui-app-sdk$",
@@ -63,6 +64,15 @@ const getAlias = () => {
63
64
  path.join(monorepoRoot, "./node_modules")
64
65
  );
65
66
  };
67
+ const getLibraryAlias = (name, alias) => {
68
+ const monorepoRoot = findMonoRepoRoot(process.cwd()) ?? "";
69
+ const aliasPath = path.resolve(
70
+ `${path.join(monorepoRoot, "./node_modules")}/${alias}`
71
+ );
72
+ return {
73
+ [name]: aliasPath
74
+ };
75
+ };
66
76
  const modulesToTranspile = [
67
77
  "@elliemae/pui-*",
68
78
  "@elliemae/ds-*",
@@ -75,8 +85,7 @@ const getUserMonitoringFileName = () => {
75
85
  process.cwd(),
76
86
  "node_modules/@elliemae/pui-user-monitoring/dist/public/js"
77
87
  );
78
- if (!fs.existsSync(userMonLibPath))
79
- return `${libName}.js`;
88
+ if (!fs.existsSync(userMonLibPath)) return `${libName}.js`;
80
89
  const distJSFiles = fs.readdirSync(userMonLibPath);
81
90
  return distJSFiles.filter(
82
91
  (fName) => fName.match(/emuiUserMonitoring+((?!chunk).)*\.js$/)
@@ -88,8 +97,7 @@ const getAppLoaderFileName = () => {
88
97
  process.cwd(),
89
98
  "node_modules/@elliemae/pui-app-loader/dist/public/js"
90
99
  );
91
- if (!fs.existsSync(appLoaderLibPath))
92
- return `${libName}.js`;
100
+ if (!fs.existsSync(appLoaderLibPath)) return `${libName}.js`;
93
101
  const distJSFiles = fs.readdirSync(appLoaderLibPath);
94
102
  return distJSFiles.filter(
95
103
  (fName) => fName.match(/emuiAppLoader+((?!chunk).)*\.js$/)
@@ -101,8 +109,7 @@ const getDiagnosticsFileName = () => {
101
109
  process.cwd(),
102
110
  "node_modules/@elliemae/pui-diagnostics/dist/public/js"
103
111
  );
104
- if (!fs.existsSync(libPath))
105
- return `${libName}.js`;
112
+ if (!fs.existsSync(libPath)) return `${libName}.js`;
106
113
  const distJSFiles = fs.readdirSync(libPath);
107
114
  return distJSFiles.filter(
108
115
  (fName) => fName.match(/emuiDiagnostics+((?!chunk).)*\.js$/)
@@ -114,18 +121,16 @@ const getENCWLoaderFileName = () => {
114
121
  process.cwd(),
115
122
  "node_modules/@elliemae/encw-loader/dist/public/js"
116
123
  );
117
- if (!fs.existsSync(appLoaderLibPath))
118
- return `${libName}.js`;
124
+ if (!fs.existsSync(appLoaderLibPath)) return `${libName}.js`;
119
125
  const distJSFiles = fs.readdirSync(appLoaderLibPath);
120
126
  return distJSFiles.filter(
121
127
  (fName) => fName.match(/emuiEncwLoader+((?!chunk).)*\.js$/)
122
128
  )[0];
123
129
  };
124
130
  const getAppVersion = () => {
125
- if (!process.env.APP_VERSION)
126
- return LATEST_VERSION;
131
+ if (!process.env.APP_VERSION) return LATEST_VERSION;
127
132
  const match = process.env.APP_VERSION.match(/^v?(\d+\.\d+)\..*$/);
128
- return match && match[1] || LATEST_VERSION;
133
+ return match?.[1] ?? LATEST_VERSION;
129
134
  };
130
135
  const getPaths = (latestVersion = true) => {
131
136
  const version = latestVersion ? LATEST_VERSION : getAppVersion();
@@ -160,9 +165,9 @@ const getCompressionPlugins = (isLibrary = false) => {
160
165
  ];
161
166
  const commonConfig = {
162
167
  test: /\.(js|css)$/,
163
- exclude: !isLibrary ? excludeList : [],
164
168
  // we are compressing all files since in aws cloudfront edge lambda, we don't want to whitelist files that are not compressed due to below limits
165
- minRatio: Infinity
169
+ minRatio: Infinity,
170
+ ...!isLibrary ? { exclude: excludeList } : {}
166
171
  };
167
172
  return [
168
173
  new CompressionPlugin({
@@ -202,6 +207,7 @@ export {
202
207
  getAlias,
203
208
  getAppVersion,
204
209
  getCompressionPlugins,
210
+ getLibraryAlias,
205
211
  getLibraryName,
206
212
  getLibraryVariableName,
207
213
  getMediaPath,
@@ -102,14 +102,16 @@ const plugins = [
102
102
  noErrorOnMissing: true,
103
103
  globOptions: {
104
104
  ignore: ["readme.md"]
105
- }
105
+ },
106
+ info: { minimized: true }
106
107
  },
107
108
  {
108
109
  from: "webroot",
109
110
  noErrorOnMissing: true,
110
111
  globOptions: {
111
112
  ignore: ["readme.md"]
112
- }
113
+ },
114
+ info: { minimized: true }
113
115
  }
114
116
  ])
115
117
  }),
@@ -118,7 +120,7 @@ const plugins = [
118
120
  fileName: "./latest/manifest.json",
119
121
  publicPath: "",
120
122
  map: (file) => {
121
- file.name = file.name.replace(/^latest\//, "");
123
+ file.name = file.name.replace(/^latest(\/|\\)/, "");
122
124
  return file;
123
125
  }
124
126
  }),
@@ -257,36 +259,20 @@ const baseConfig = (options) => ({
257
259
  mainFields: ["browser", "module", "main"],
258
260
  alias: {
259
261
  ...getAlias(),
260
- ...(options.resolve || {}).alias || {}
262
+ ...options.resolve?.alias ?? {}
261
263
  }
262
264
  },
265
+ externalsPresets: {
266
+ web: true
267
+ },
263
268
  externals: {
264
269
  "@elliemae/pui-user-monitoring": "emuiUserMonitoring",
265
270
  "@elliemae/pui-app-loader": "emuiAppLoader",
266
- "@elliemae/pui-diagnostics": "emuiDiagnostics",
267
- react: "emuiAppReactDependencies.react",
268
- "react-dom": "emuiAppReactDependencies.reactDOM",
269
- "@reduxjs/toolkit": "emuiAppReactDependencies.rtk",
270
- axios: "emuiAppReactDependencies.axios.default",
271
- dompurify: "emuiAppReactDependencies.dompurify",
272
- history: "emuiAppReactDependencies.history",
273
- immer: "emuiAppReactDependencies.immer",
274
- invariant: "emuiAppReactDependencies.invariant",
275
- "pubsub-js": "emuiAppReactDependencies.pubsubjs",
276
- "react-aria-live": "emuiAppReactDependencies.reactAriaLive",
277
- "react-helmet": "emuiAppReactDependencies.reactHelmet",
278
- "react-hook-form": "emuiAppReactDependencies.reactHookForm",
279
- "react-redux": "emuiAppReactDependencies.reactRedux",
280
- "react-router-dom": "emuiAppReactDependencies.reactRouterDOM",
281
- reduxInjectors: "emuiAppReactDependencies.reduxInjectors",
282
- reselect: "emuiAppReactDependencies.reselect",
283
- // "styled-components": "emuiAppReactDependencies.styledComponents",
284
- "styled-system": "emuiAppReactDependencies.styledSystem"
285
- // "@xstyled/styled-components": "emuiAppReactDependencies.xstyled",
271
+ "@elliemae/pui-diagnostics": "emuiDiagnostics"
286
272
  },
287
- devtool: options.devtool || "eval-source-map",
288
- performance: options.performance || {},
289
- devServer: options.devServer || {}
273
+ devtool: options.devtool ?? "eval-source-map",
274
+ performance: options.performance ?? {},
275
+ devServer: options.devServer ?? {}
290
276
  });
291
277
  export {
292
278
  baseConfig
@@ -14,6 +14,8 @@ import {
14
14
  isGoogleTagManagerEnabled
15
15
  } from "./helpers.js";
16
16
  import { baseConfig } from "./webpack.base.babel.js";
17
+ import { wsPort } from "../server/utils.js";
18
+ import { createWSServer } from "../server/wsServer.js";
17
19
  const __filename = fileURLToPath(import.meta.url);
18
20
  const {
19
21
  appVersion,
@@ -68,7 +70,7 @@ const devConfig = {
68
70
  // Add development plugins
69
71
  plugins: [
70
72
  new HtmlWebpackPlugin({
71
- inject: !isAppLoaderEnabled(),
73
+ inject: !isAppLoaderEnabled() ? "head" : false,
72
74
  // Inject all files that are generated by webpack, e.g. bundle.js
73
75
  template: !isAppLoaderEnabled() ? "app/index.html" : "app/index-app-loader.html",
74
76
  emui: {
@@ -80,7 +82,8 @@ const devConfig = {
80
82
  diagnosticsScriptPath,
81
83
  encwLoaderScriptPath,
82
84
  googleTagManager: isGoogleTagManagerEnabled()
83
- }
85
+ },
86
+ scriptLoading: "defer"
84
87
  }),
85
88
  new CircularDependencyPlugin({
86
89
  exclude: /a\.(js|ts|jsx|tsx)|node_modules/,
@@ -113,7 +116,7 @@ const devConfig = {
113
116
  },
114
117
  hot: true,
115
118
  open: [basePath],
116
- port: process.env.PORT || "auto",
119
+ port: process.env.PORT ?? "auto",
117
120
  setupMiddlewares: (middlewares, devServer) => {
118
121
  if (devServer.app) {
119
122
  setupDefaultMiddlewares(devServer.app);
@@ -130,6 +133,13 @@ const devConfig = {
130
133
  }
131
134
  next();
132
135
  });
136
+ createWSServer({
137
+ port: wsPort
138
+ }).then(({ wsServer }) => {
139
+ if (devServer.app) devServer.app.locals.wsServer = wsServer;
140
+ }).catch((err) => {
141
+ console.error(err);
142
+ });
133
143
  }
134
144
  return middlewares;
135
145
  }
@@ -57,14 +57,22 @@ const baseConfig = (options) => ({
57
57
  output: {
58
58
  clean: true,
59
59
  path: path.resolve(process.cwd(), "dist/umd"),
60
+ filename: "[name].js",
61
+ chunkFilename: "[name].[chunkhash].chunk.js",
62
+ assetModuleFilename: "assets/[name].[hash][ext][query]",
60
63
  publicPath: "auto",
61
64
  library: {
62
65
  name: getLibraryVariableName(),
63
- type: "umd"
66
+ type: "var"
67
+ // type: 'module',
64
68
  },
69
+ // module: true,
65
70
  ...options.output
66
71
  },
67
72
  // Merge with env dependent settings
73
+ // experiments: {
74
+ // outputModule: true,
75
+ // },
68
76
  optimization: options.optimization,
69
77
  module: {
70
78
  rules: [
@@ -112,6 +120,7 @@ const baseConfig = (options) => ({
112
120
  loader: "postcss-loader",
113
121
  options: {
114
122
  postcssOptions: {
123
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
115
124
  plugins: [PostcssPresetEnv({ autoprefixer: { grid: true } })]
116
125
  },
117
126
  sourceMap: true
@@ -177,7 +186,7 @@ const baseConfig = (options) => ({
177
186
  mainFields: ["browser", "module", "main"],
178
187
  alias: {
179
188
  ...getAlias(),
180
- ...(options.resolve || {}).alias || {}
189
+ ...options.resolve?.alias ?? {}
181
190
  },
182
191
  plugins: [new ResolveTypeScriptPlugin({})]
183
192
  },
@@ -186,9 +195,9 @@ const baseConfig = (options) => ({
186
195
  "@elliemae/pui-app-loader": "emuiAppLoader",
187
196
  "@elliemae/pui-diagnostics": "emuiDiagnostics"
188
197
  },
189
- devtool: options.devtool || "eval-source-map",
190
- performance: options.performance || {},
191
- devServer: options.devServer || {}
198
+ devtool: options.devtool ?? "eval-source-map",
199
+ performance: options.performance ?? {},
200
+ devServer: options.devServer ?? {}
192
201
  });
193
202
  export {
194
203
  baseConfig
@@ -5,26 +5,25 @@ import fg from "fast-glob";
5
5
  import CircularDependencyPlugin from "circular-dependency-plugin";
6
6
  import MiniCssExtractPlugin from "mini-css-extract-plugin";
7
7
  import HtmlWebpackPlugin from "html-webpack-plugin";
8
- import { getPaths } from "./helpers.js";
8
+ import { getPaths, getLibraryVariableName } from "./helpers.js";
9
9
  import { baseConfig } from "./webpack.lib.base.babel.js";
10
10
  const { basePath } = getPaths();
11
11
  const getHtmlWebpackPlugins = () => {
12
- const htmlTemplateFiles = fg.sync([path.join(process.cwd(), "lib/*.html")]);
12
+ const htmlTemplateFiles = fg.sync([
13
+ path.join(process.cwd(), "lib", "*.html").replace(/\\/g, "/")
14
+ ]);
13
15
  return htmlTemplateFiles.map(
14
16
  (htmlTemplateFile) => new HtmlWebpackPlugin({
15
17
  template: htmlTemplateFile,
16
18
  filename: path.basename(htmlTemplateFile),
17
- inject: true
19
+ inject: "head",
20
+ scriptLoading: "defer",
21
+ library: getLibraryVariableName()
18
22
  })
19
23
  );
20
24
  };
21
25
  var webpack_lib_dev_babel_default = baseConfig({
22
26
  mode: "development",
23
- // output: {
24
- // filename: `js/${libraryName}.js`,
25
- // chunkFilename: `js/${libraryName}.chunk.js`,
26
- // assetModuleFilename: '[name][ext][query]',
27
- // },
28
27
  optimization: {
29
28
  splitChunks: {
30
29
  chunks: "all"
@@ -41,10 +40,7 @@ var webpack_lib_dev_babel_default = baseConfig({
41
40
  failOnError: false
42
41
  // show a warning when there is a circular dependency
43
42
  }),
44
- new MiniCssExtractPlugin({
45
- // filename: `css/${libraryName}.css`,
46
- // chunkFilename: `css/${libraryName}.chunk.css`,
47
- }),
43
+ new MiniCssExtractPlugin({}),
48
44
  new webpack.ProgressPlugin()
49
45
  ],
50
46
  devtool: "eval-source-map",
@@ -62,7 +58,7 @@ var webpack_lib_dev_babel_default = baseConfig({
62
58
  historyApiFallback: true,
63
59
  hot: true,
64
60
  open: [basePath],
65
- port: process.env.PORT || "auto",
61
+ port: process.env.PORT ?? "auto",
66
62
  headers: {
67
63
  "Access-Control-Allow-Origin": "*",
68
64
  "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS"
@@ -5,15 +5,23 @@ import HtmlWebpackPlugin from "html-webpack-plugin";
5
5
  import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
6
6
  import { EsbuildPlugin } from "esbuild-loader";
7
7
  import browserslistToEsbuild from "browserslist-to-esbuild";
8
- import { getCompressionPlugins, getLibraryName } from "./helpers.js";
8
+ import {
9
+ getCompressionPlugins,
10
+ getLibraryName,
11
+ getLibraryVariableName
12
+ } from "./helpers.js";
9
13
  import { baseConfig } from "./webpack.lib.base.babel.js";
10
14
  const getHtmlWebpackPlugins = () => {
11
- const htmlTemplateFiles = fg.sync([path.join(process.cwd(), "lib/*.html")]);
15
+ const htmlTemplateFiles = fg.sync([
16
+ path.join(process.cwd(), "lib", "*.html").replace(/\\/g, "/")
17
+ ]);
12
18
  return htmlTemplateFiles.map(
13
19
  (htmlTemplateFile) => new HtmlWebpackPlugin({
14
20
  template: htmlTemplateFile,
15
21
  filename: path.basename(htmlTemplateFile),
16
- inject: true,
22
+ inject: "head",
23
+ scriptLoading: "defer",
24
+ library: getLibraryVariableName(),
17
25
  minify: {
18
26
  removeComments: true,
19
27
  collapseWhitespace: true,
@@ -49,10 +57,7 @@ const prodConfig = {
49
57
  },
50
58
  plugins: [
51
59
  ...getHtmlWebpackPlugins(),
52
- new MiniCssExtractPlugin({
53
- // filename: `css/${libraryName}.[contenthash].css`,
54
- // chunkFilename: `css/${libraryName}.[contenthash].chunk.css`,
55
- }),
60
+ new MiniCssExtractPlugin({}),
56
61
  ...getCompressionPlugins(true),
57
62
  new BundleAnalyzerPlugin({
58
63
  analyzerMode: "static",
@@ -83,7 +83,7 @@ const {
83
83
  basePath
84
84
  } = getPaths();
85
85
  const htmlWebpackPlugin = new HtmlWebpackPlugin({
86
- inject: !isAppLoaderEnabled(),
86
+ inject: !isAppLoaderEnabled() ? "head" : false,
87
87
  template: !isAppLoaderEnabled() ? "app/index.html" : "app/index-app-loader.html",
88
88
  minify: {
89
89
  removeComments: true,
@@ -106,11 +106,11 @@ const htmlWebpackPlugin = new HtmlWebpackPlugin({
106
106
  diagnosticsScriptPath,
107
107
  encwLoaderScriptPath,
108
108
  googleTagManager: isGoogleTagManagerEnabled()
109
- }
109
+ },
110
+ scriptLoading: "defer"
110
111
  });
111
112
  const config = baseConfig(getProdConfig());
112
- if (config.plugins)
113
- config.plugins.push(htmlWebpackPlugin);
113
+ if (config.plugins) config.plugins.push(htmlWebpackPlugin);
114
114
  var webpack_prod_babel_default = config;
115
115
  export {
116
116
  webpack_prod_babel_default as default
@@ -2,7 +2,7 @@ import webpack from "webpack";
2
2
  import MiniCssExtractPlugin from "mini-css-extract-plugin";
3
3
  import CopyWebpackPlugin from "copy-webpack-plugin";
4
4
  import ResolveTypeScriptPlugin from "resolve-typescript-plugin";
5
- import { getAlias, getCompressionPlugins } from "./helpers.js";
5
+ import { getAlias, getLibraryAlias, getCompressionPlugins } from "./helpers.js";
6
6
  import { isApp } from "../utils.js";
7
7
  const IS_APP = isApp();
8
8
  const CWD = process.cwd();
@@ -55,23 +55,29 @@ const webpackFinal = (config, { configType }) => {
55
55
  const fileLoaderRule = config?.module?.rules?.find?.(
56
56
  (rule) => rule.test?.test?.(".svg")
57
57
  );
58
- if (fileLoaderRule)
59
- fileLoaderRule.exclude = /\.svg$/i;
58
+ if (fileLoaderRule) fileLoaderRule.exclude = /\.svg$/i;
60
59
  config?.module?.rules?.unshift(...getModuleRules());
61
60
  config?.plugins?.push(...getAdditionalPlugins());
62
61
  if (isProd) {
63
62
  config.plugins = config?.plugins?.concat(getCompressionPlugins());
64
63
  }
65
64
  if (config.resolve) {
66
- config.resolve.alias = { ...config?.resolve?.alias, ...getAlias() };
65
+ config.resolve.alias = {
66
+ ...config?.resolve?.alias,
67
+ ...getAlias(),
68
+ ...getLibraryAlias(
69
+ "@reduxjs/toolkit/query/react",
70
+ "@reduxjs/toolkit/dist/query/react/rtk-query-react.modern.mjs"
71
+ )
72
+ };
67
73
  config.resolve.fallback = { ...config.resolve.fallback, crypto: false };
68
74
  config.resolve.extensions?.push(".svg");
69
75
  config.resolve.plugins = [
70
- ...config.resolve.plugins || [],
76
+ ...config.resolve.plugins ?? [],
71
77
  new ResolveTypeScriptPlugin({})
72
78
  ];
73
79
  }
74
- config.externals = config.externals || {};
80
+ config.externals = config.externals ?? {};
75
81
  if (config.externals) {
76
82
  config.externals["@elliemae/pui-user-monitoring"] = "emuiUserMonitoring";
77
83
  config.externals["@elliemae/pui-app-loader"] = "emuiAppLoader";
@@ -79,14 +85,6 @@ const webpackFinal = (config, { configType }) => {
79
85
  }
80
86
  return config;
81
87
  };
82
- const managerWebpack = (config) => {
83
- if (config.plugins)
84
- config.plugins = config.plugins.concat(getCompressionPlugins());
85
- if (config.resolve)
86
- config.resolve.alias = { ...config.resolve.alias, ...getAlias() };
87
- return config;
88
- };
89
88
  export {
90
- managerWebpack,
91
89
  webpackFinal
92
90
  };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@docusaurus/types").Config;
2
+ export default _default;
@@ -1,8 +1,8 @@
1
1
  export { config as babelConfig };
2
2
  declare namespace config {
3
- const ignore: RegExp[];
4
- const sourceType: string;
5
- const presets: (string | (string | {
3
+ let ignore: RegExp[];
4
+ let sourceType: string;
5
+ let presets: (string | (string | {
6
6
  modules: string | boolean;
7
7
  targets: {
8
8
  node: string;
@@ -17,7 +17,7 @@ declare namespace config {
17
17
  })[] | (string | {
18
18
  runtime: string;
19
19
  })[])[];
20
- const plugins: (string | (string | {
20
+ let plugins: (string | (string | {
21
21
  alias: {
22
22
  '@': string;
23
23
  };
@@ -29,13 +29,13 @@ declare namespace config {
29
29
  })[])[];
30
30
  namespace env {
31
31
  namespace development {
32
- const plugins_1: (string | (string | {
32
+ let plugins_1: (string | (string | {
33
33
  displayName: boolean;
34
34
  })[])[];
35
35
  export { plugins_1 as plugins };
36
36
  }
37
37
  namespace production {
38
- const plugins_2: (string | (string | {
38
+ let plugins_2: (string | (string | {
39
39
  displayName: boolean;
40
40
  pure: boolean;
41
41
  })[] | (string | {
@@ -44,7 +44,7 @@ declare namespace config {
44
44
  export { plugins_2 as plugins };
45
45
  }
46
46
  namespace test {
47
- const plugins_3: (string | (string | {
47
+ let plugins_3: (string | (string | {
48
48
  displayName: boolean;
49
49
  })[] | (string | {
50
50
  requireDirective: boolean;
@@ -1,6 +1,6 @@
1
1
  import { CommandModule } from 'yargs';
2
- type Arguments = {
2
+ interface Arguments {
3
3
  service: boolean;
4
- };
4
+ }
5
5
  export declare const buildCmd: CommandModule<Record<string, never>, Arguments>;
6
6
  export {};
@@ -1,6 +1,6 @@
1
1
  import { CommandModule } from 'yargs';
2
- type Arguments = {
2
+ interface Arguments {
3
3
  transform: string;
4
- };
4
+ }
5
5
  export declare const codemodCmd: CommandModule<Record<string, never>, Arguments>;
6
6
  export {};
@@ -1,8 +1,9 @@
1
1
  import { CommandModule } from 'yargs';
2
- type Arguments = {
2
+ interface Arguments {
3
3
  css: boolean;
4
4
  js: boolean;
5
5
  fix: boolean;
6
- };
6
+ debug: boolean;
7
+ }
7
8
  export declare const lintCmd: CommandModule<Record<string, never>, Arguments>;
8
9
  export {};
@@ -1,8 +1,8 @@
1
1
  import { CommandModule } from 'yargs';
2
- type Arguments = {
2
+ interface Arguments {
3
3
  production: boolean;
4
4
  target: string;
5
5
  srcPath: string;
6
- };
6
+ }
7
7
  export declare const packCmd: CommandModule<Record<string, never>, Arguments>;
8
8
  export {};
@@ -1,6 +1,6 @@
1
1
  import { CommandModule } from 'yargs';
2
- type Arguments = {
2
+ interface Arguments {
3
3
  prod: boolean;
4
- };
4
+ }
5
5
  export declare const startCmd: CommandModule<Record<string, never>, Arguments>;
6
6
  export {};
@@ -1,8 +1,8 @@
1
1
  import { CommandModule } from 'yargs';
2
- type Arguments = {
2
+ interface Arguments {
3
3
  build: boolean;
4
4
  docs: boolean;
5
5
  output: string;
6
- };
6
+ }
7
7
  export declare const storybookCmd: CommandModule<Record<string, never>, Arguments>;
8
8
  export {};
@@ -1,11 +1,13 @@
1
1
  import { CommandModule } from 'yargs';
2
- type Arguments = {
2
+ interface Arguments {
3
3
  fix: boolean;
4
4
  watch: boolean;
5
5
  debug: boolean;
6
6
  passWithNoTests: boolean;
7
7
  findReleatedTests: boolean;
8
8
  silent: boolean;
9
- };
9
+ coverage: string;
10
+ maxWorkers: string;
11
+ }
10
12
  export declare const testCmd: CommandModule<Record<string, never>, Arguments>;
11
13
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CommandModule } from 'yargs';
2
- export type Arguments = {
2
+ export interface Arguments {
3
3
  files: string[];
4
- };
4
+ }
5
5
  export declare const tscheckCmd: CommandModule<Record<string, never>, Arguments>;