@elliemae/pui-cli 7.0.0-beta.9 → 7.2.0

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 (283) hide show
  1. package/README.md +4 -0
  2. package/{lib/babel/babel.config.js → dist/cjs/babel.config.cjs} +3 -7
  3. package/dist/cjs/cli.js +53 -0
  4. package/dist/cjs/commands/build.js +81 -0
  5. package/dist/cjs/commands/codemod.js +55 -0
  6. package/dist/cjs/commands/gendoc.js +53 -0
  7. package/dist/cjs/commands/lint.js +95 -0
  8. package/dist/cjs/commands/pack.js +98 -0
  9. package/dist/cjs/commands/start.js +76 -0
  10. package/dist/cjs/commands/storybook.js +71 -0
  11. package/dist/cjs/commands/test.js +100 -0
  12. package/dist/cjs/commands/tscheck.js +82 -0
  13. package/dist/cjs/commands/utils.js +157 -0
  14. package/dist/cjs/commands/version.js +77 -0
  15. package/dist/cjs/commands/vitest.js +93 -0
  16. package/dist/cjs/dummy.js +1 -0
  17. package/dist/cjs/index.cjs +25 -0
  18. package/dist/cjs/index.js +42 -0
  19. package/dist/cjs/jsdoc.conf.json +17 -0
  20. package/dist/cjs/lint-config/commitlint.config.cjs +1 -0
  21. package/{lib/lint/eslint/common.js → dist/cjs/lint-config/eslint/common.cjs} +5 -5
  22. package/{lib/lint/eslint/non-react.js → dist/cjs/lint-config/eslint/non-react.cjs} +2 -2
  23. package/{lib/lint/eslint/react.js → dist/cjs/lint-config/eslint/react.cjs} +2 -2
  24. package/{lib/lint/eslint/typescript/common.js → dist/cjs/lint-config/eslint/typescript/common.cjs} +1 -1
  25. package/{lib/lint/eslint/typescript/non-react.js → dist/cjs/lint-config/eslint/typescript/non-react.cjs} +2 -2
  26. package/{lib/lint/eslint/typescript/react.js → dist/cjs/lint-config/eslint/typescript/react.cjs} +2 -2
  27. package/dist/cjs/lint-config/lint-staged.config.js +40 -0
  28. package/{lib/lint/prettier.config.js → dist/cjs/lint-config/prettier.config.cjs} +1 -1
  29. package/{lib/lint/stylelint.config.js → dist/cjs/lint-config/stylelint.config.cjs} +2 -2
  30. package/dist/cjs/monorepo/delete-merged-tags.js +58 -0
  31. package/dist/cjs/monorepo/set-registry-version.js +49 -0
  32. package/dist/cjs/monorepo/set-workspace-version.js +56 -0
  33. package/{lib/monorepo/utils.js → dist/cjs/monorepo/utils.cjs} +17 -2
  34. package/dist/cjs/package.json +4 -0
  35. package/dist/cjs/pui-config.js +44 -0
  36. package/{lib/release/release.config.js → dist/cjs/release.config.cjs} +0 -0
  37. package/{lib/server/util/index.js → dist/cjs/server/app-routes.cjs} +5 -15
  38. package/dist/cjs/server/csp.js +94 -0
  39. package/dist/cjs/server/index.js +34 -0
  40. package/dist/cjs/server/logger.js +58 -0
  41. package/dist/cjs/server/middlewares.js +75 -0
  42. package/dist/cjs/server/utils.js +39 -0
  43. package/{lib/testing/jest.config.js → dist/cjs/testing/jest.config.cjs} +10 -10
  44. package/{lib/testing/jest.node.config.js → dist/cjs/testing/jest.node.config.cjs} +1 -1
  45. package/dist/cjs/testing/mocks/axios.js +38 -0
  46. package/dist/cjs/testing/mocks/cssModule.js +24 -0
  47. package/dist/cjs/testing/mocks/html.js +24 -0
  48. package/dist/cjs/testing/mocks/image.js +24 -0
  49. package/dist/cjs/testing/mocks/matchMedia.js +44 -0
  50. package/dist/cjs/testing/mocks/pui-app-loader.js +25 -0
  51. package/dist/cjs/testing/mocks/pui-diagnostics.js +69 -0
  52. package/dist/cjs/testing/mocks/pui-user-monitoring.js +31 -0
  53. package/dist/cjs/testing/mocks/retry-axios.js +28 -0
  54. package/dist/cjs/testing/mocks/svg.js +33 -0
  55. package/dist/cjs/testing/mocks/webpack-hmr.js +25 -0
  56. package/{lib/testing/resolver.js → dist/cjs/testing/resolver.cjs} +0 -0
  57. package/dist/cjs/testing/setup-react-env.js +22 -0
  58. package/dist/cjs/testing/setup-test-env.js +23 -0
  59. package/dist/cjs/testing/setup-tests.js +69 -0
  60. package/dist/cjs/testing/vitest.config.js +52 -0
  61. package/{lib → dist/cjs}/transpile/.swcrc +0 -0
  62. package/dist/cjs/transpile/esbuild.js +134 -0
  63. package/dist/cjs/transpile/react-shim.js +30 -0
  64. package/{lib/transpile/swcrc.config.js → dist/cjs/transpile/swcrc.config.cjs} +1 -1
  65. package/dist/cjs/typedoc.cjs +12 -0
  66. package/{lib → dist/cjs}/typescript/app.tsconfig.json +0 -0
  67. package/{lib → dist/cjs}/typescript/library.tsconfig.json +0 -0
  68. package/dist/cjs/update-notifier.js +37 -0
  69. package/dist/cjs/utils.cjs +23 -0
  70. package/dist/cjs/webpack/helpers.js +237 -0
  71. package/dist/cjs/webpack/webpack.base.babel.js +280 -0
  72. package/dist/cjs/webpack/webpack.dev.babel.js +144 -0
  73. package/dist/cjs/webpack/webpack.lib.base.babel.js +212 -0
  74. package/dist/cjs/webpack/webpack.lib.dev.babel.js +93 -0
  75. package/dist/cjs/webpack/webpack.lib.prod.babel.js +95 -0
  76. package/dist/cjs/webpack/webpack.prod.babel.js +145 -0
  77. package/dist/cjs/webpack/webpack.storybook.js +111 -0
  78. package/dist/esm/babel.config.cjs +97 -0
  79. package/dist/esm/cli.js +33 -0
  80. package/dist/esm/commands/build.js +61 -0
  81. package/dist/esm/commands/codemod.js +29 -0
  82. package/dist/esm/commands/gendoc.js +26 -0
  83. package/dist/esm/commands/lint.js +69 -0
  84. package/dist/esm/commands/pack.js +71 -0
  85. package/dist/esm/commands/start.js +49 -0
  86. package/dist/esm/commands/storybook.js +45 -0
  87. package/dist/esm/commands/test.js +74 -0
  88. package/dist/esm/commands/tscheck.js +56 -0
  89. package/dist/esm/commands/utils.js +143 -0
  90. package/dist/esm/commands/version.js +51 -0
  91. package/dist/esm/commands/vitest.js +66 -0
  92. package/{lib/dummy.ts → dist/esm/dummy.js} +0 -0
  93. package/dist/esm/index.cjs +25 -0
  94. package/dist/esm/index.js +22 -0
  95. package/dist/esm/jsdoc.conf.json +17 -0
  96. package/dist/esm/lint-config/commitlint.config.cjs +1 -0
  97. package/dist/esm/lint-config/eslint/common.cjs +160 -0
  98. package/dist/esm/lint-config/eslint/non-react.cjs +14 -0
  99. package/dist/esm/lint-config/eslint/react.cjs +26 -0
  100. package/dist/esm/lint-config/eslint/typescript/common.cjs +43 -0
  101. package/dist/esm/lint-config/eslint/typescript/non-react.cjs +12 -0
  102. package/dist/esm/lint-config/eslint/typescript/react.cjs +19 -0
  103. package/dist/esm/lint-config/lint-staged.config.js +14 -0
  104. package/dist/esm/lint-config/prettier.config.cjs +8 -0
  105. package/dist/esm/lint-config/stylelint.config.cjs +19 -0
  106. package/dist/esm/monorepo/delete-merged-tags.js +38 -0
  107. package/dist/esm/monorepo/set-registry-version.js +23 -0
  108. package/dist/esm/monorepo/set-workspace-version.js +30 -0
  109. package/dist/esm/monorepo/utils.cjs +30 -0
  110. package/dist/esm/package.json +4 -0
  111. package/dist/esm/pui-config.js +18 -0
  112. package/dist/esm/release.config.cjs +31 -0
  113. package/dist/esm/server/app-routes.cjs +42 -0
  114. package/dist/esm/server/csp.js +68 -0
  115. package/dist/esm/server/index.js +18 -0
  116. package/dist/esm/server/logger.js +32 -0
  117. package/dist/esm/server/middlewares.js +49 -0
  118. package/dist/esm/server/utils.js +13 -0
  119. package/dist/esm/testing/jest.config.cjs +103 -0
  120. package/dist/esm/testing/jest.node.config.cjs +8 -0
  121. package/{lib → dist/esm}/testing/mocks/axios.js +8 -5
  122. package/dist/esm/testing/mocks/cssModule.js +4 -0
  123. package/dist/esm/testing/mocks/html.js +4 -0
  124. package/dist/esm/testing/mocks/image.js +4 -0
  125. package/dist/esm/testing/mocks/matchMedia.js +24 -0
  126. package/dist/esm/testing/mocks/pui-app-loader.js +5 -0
  127. package/dist/esm/testing/mocks/pui-diagnostics.js +49 -0
  128. package/dist/esm/testing/mocks/pui-user-monitoring.js +11 -0
  129. package/dist/esm/testing/mocks/retry-axios.js +8 -0
  130. package/dist/esm/testing/mocks/svg.js +7 -0
  131. package/dist/esm/testing/mocks/webpack-hmr.js +5 -0
  132. package/dist/esm/testing/resolver.cjs +47 -0
  133. package/dist/esm/testing/setup-react-env.js +3 -0
  134. package/dist/esm/testing/setup-test-env.js +4 -0
  135. package/dist/esm/testing/setup-tests.js +50 -0
  136. package/dist/esm/testing/vitest.config.js +25 -0
  137. package/dist/esm/transpile/.swcrc +11 -0
  138. package/{lib → dist/esm}/transpile/esbuild.js +35 -44
  139. package/dist/esm/transpile/react-shim.js +4 -0
  140. package/dist/esm/transpile/swcrc.config.cjs +13 -0
  141. package/dist/esm/typedoc.cjs +12 -0
  142. package/dist/esm/typescript/app.tsconfig.json +23 -0
  143. package/dist/esm/typescript/library.tsconfig.json +23 -0
  144. package/dist/esm/update-notifier.js +11 -0
  145. package/dist/esm/utils.cjs +23 -0
  146. package/dist/esm/webpack/helpers.js +211 -0
  147. package/dist/esm/webpack/webpack.base.babel.js +260 -0
  148. package/dist/esm/webpack/webpack.dev.babel.js +121 -0
  149. package/dist/esm/webpack/webpack.lib.base.babel.js +192 -0
  150. package/dist/esm/webpack/webpack.lib.dev.babel.js +67 -0
  151. package/dist/esm/webpack/webpack.lib.prod.babel.js +69 -0
  152. package/dist/esm/webpack/webpack.prod.babel.js +124 -0
  153. package/dist/esm/webpack/webpack.storybook.js +85 -0
  154. package/dist/types/babel.config.d.cts +59 -0
  155. package/dist/types/cli.d.ts +2 -0
  156. package/dist/types/commands/build.d.ts +14 -0
  157. package/dist/types/commands/codemod.d.ts +6 -0
  158. package/dist/types/commands/gendoc.d.ts +6 -0
  159. package/dist/types/commands/lint.d.ts +29 -0
  160. package/dist/types/commands/pack.d.ts +26 -0
  161. package/dist/types/commands/start.d.ts +13 -0
  162. package/dist/types/commands/storybook.d.ts +19 -0
  163. package/dist/types/commands/test.d.ts +39 -0
  164. package/dist/types/commands/tscheck.d.ts +14 -0
  165. package/dist/types/commands/utils.d.ts +16 -0
  166. package/dist/types/commands/version.d.ts +30 -0
  167. package/dist/types/commands/vitest.d.ts +35 -0
  168. package/{lib/testing/vitest.setup.ts → dist/types/dummy.d.ts} +0 -0
  169. package/dist/types/index.d.cts +10 -0
  170. package/dist/types/index.d.ts +10 -0
  171. package/dist/types/lint-config/commitlint.config.d.cts +4 -0
  172. package/dist/types/lint-config/eslint/common.d.cts +127 -0
  173. package/dist/types/lint-config/eslint/non-react.d.cts +93 -0
  174. package/dist/types/lint-config/eslint/react.d.cts +123 -0
  175. package/dist/types/lint-config/eslint/typescript/common.d.cts +37 -0
  176. package/dist/types/lint-config/eslint/typescript/non-react.d.cts +87 -0
  177. package/dist/types/lint-config/eslint/typescript/react.d.cts +118 -0
  178. package/dist/types/lint-config/lint-staged.config.d.ts +5 -0
  179. package/dist/types/lint-config/prettier.config.d.cts +8 -0
  180. package/dist/types/lint-config/stylelint.config.d.cts +11 -0
  181. package/dist/types/monorepo/delete-merged-tags.d.ts +1 -0
  182. package/dist/types/monorepo/set-registry-version.d.ts +1 -0
  183. package/dist/types/monorepo/set-workspace-version.d.ts +1 -0
  184. package/dist/types/monorepo/utils.d.cts +1 -0
  185. package/dist/types/pui-config.d.ts +1 -0
  186. package/dist/types/release.config.d.cts +9 -0
  187. package/dist/types/server/app-routes.d.cts +1 -0
  188. package/dist/types/server/csp.d.ts +10 -0
  189. package/dist/types/server/index.d.ts +1 -0
  190. package/dist/types/server/logger.d.ts +4 -0
  191. package/dist/types/server/middlewares.d.ts +2 -0
  192. package/dist/types/server/utils.d.ts +3 -0
  193. package/dist/types/testing/jest.config.d.cts +39 -0
  194. package/dist/types/testing/jest.node.config.d.cts +39 -0
  195. package/dist/types/testing/mocks/axios.d.ts +17 -0
  196. package/dist/types/testing/mocks/cssModule.d.ts +2 -0
  197. package/dist/types/testing/mocks/html.d.ts +2 -0
  198. package/dist/types/testing/mocks/image.d.ts +2 -0
  199. package/dist/types/testing/mocks/matchMedia.d.ts +1 -0
  200. package/dist/types/testing/mocks/pui-app-loader.d.ts +1 -0
  201. package/dist/types/testing/mocks/pui-diagnostics.d.ts +28 -0
  202. package/dist/types/testing/mocks/pui-user-monitoring.d.ts +3 -0
  203. package/dist/types/testing/mocks/retry-axios.d.ts +3 -0
  204. package/dist/types/testing/mocks/svg.d.ts +3 -0
  205. package/dist/types/testing/mocks/webpack-hmr.d.ts +1 -0
  206. package/dist/types/testing/resolver.d.cts +2 -0
  207. package/dist/types/testing/setup-react-env.d.ts +1 -0
  208. package/dist/types/testing/setup-test-env.d.ts +2 -0
  209. package/dist/types/testing/setup-tests.d.ts +1 -0
  210. package/dist/types/testing/vitest.config.d.ts +2 -0
  211. package/dist/types/transpile/esbuild.d.ts +13 -0
  212. package/dist/types/transpile/react-shim.d.ts +2 -0
  213. package/dist/types/transpile/swcrc.config.d.cts +1 -0
  214. package/dist/types/typedoc.d.cts +3 -0
  215. package/dist/types/update-notifier.d.ts +1 -0
  216. package/dist/types/utils.d.cts +4 -0
  217. package/dist/types/webpack/helpers.d.ts +28 -0
  218. package/dist/types/webpack/webpack.base.babel.d.ts +90 -0
  219. package/dist/types/webpack/webpack.dev.babel.d.ts +2 -0
  220. package/dist/types/webpack/webpack.lib.base.babel.d.ts +110 -0
  221. package/dist/types/webpack/webpack.lib.dev.babel.d.ts +110 -0
  222. package/dist/types/webpack/webpack.lib.prod.babel.d.ts +110 -0
  223. package/dist/types/webpack/webpack.prod.babel.d.ts +2 -0
  224. package/dist/types/webpack/webpack.storybook.d.ts +4 -0
  225. package/package.json +159 -144
  226. package/lib/cli-commands/build.js +0 -60
  227. package/lib/cli-commands/codemod.js +0 -31
  228. package/lib/cli-commands/gendoc.js +0 -36
  229. package/lib/cli-commands/lint.js +0 -75
  230. package/lib/cli-commands/pack.js +0 -67
  231. package/lib/cli-commands/start.js +0 -49
  232. package/lib/cli-commands/storybook.js +0 -53
  233. package/lib/cli-commands/test.js +0 -63
  234. package/lib/cli-commands/tsc.js +0 -103
  235. package/lib/cli-commands/utils.js +0 -135
  236. package/lib/cli-commands/version.js +0 -53
  237. package/lib/cli-commands/vitest.js +0 -66
  238. package/lib/cli.js +0 -33
  239. package/lib/docgen/jsdoc.config.js +0 -17
  240. package/lib/index.js +0 -25
  241. package/lib/lint/commitlint.config.js +0 -1
  242. package/lib/lint/lint-staged.config.js +0 -16
  243. package/lib/monorepo/delete-merged-tags.js +0 -48
  244. package/lib/monorepo/set-registry-version.js +0 -22
  245. package/lib/monorepo/set-workspace-version.js +0 -29
  246. package/lib/pui-config/index.js +0 -18
  247. package/lib/scripts/helpers/checkmark.js +0 -15
  248. package/lib/scripts/helpers/get-npm-config.js +0 -3
  249. package/lib/scripts/helpers/progress.js +0 -19
  250. package/lib/scripts/helpers/xmark.js +0 -13
  251. package/lib/scripts/npmcheckversion.js +0 -8
  252. package/lib/scripts/update-notifier.js +0 -7
  253. package/lib/server/csp.js +0 -74
  254. package/lib/server/index.js +0 -37
  255. package/lib/server/logger.js +0 -42
  256. package/lib/server/middlewares/addDevMiddlewares.js +0 -39
  257. package/lib/server/middlewares/addProdMiddlewares.js +0 -30
  258. package/lib/server/middlewares/index.js +0 -37
  259. package/lib/testing/mocks/cssModule.js +0 -1
  260. package/lib/testing/mocks/html.js +0 -1
  261. package/lib/testing/mocks/image.js +0 -1
  262. package/lib/testing/mocks/matchMedia.js +0 -24
  263. package/lib/testing/mocks/pui-app-loader.js +0 -1
  264. package/lib/testing/mocks/pui-diagnostics.js +0 -28
  265. package/lib/testing/mocks/pui-user-monitoring.js +0 -3
  266. package/lib/testing/mocks/retry-axios.js +0 -3
  267. package/lib/testing/mocks/svg.js +0 -5
  268. package/lib/testing/mocks/webpack-hmr.js +0 -1
  269. package/lib/testing/setup-react-env.js +0 -3
  270. package/lib/testing/setup-tests.js +0 -58
  271. package/lib/testing/vitest.config.ts +0 -16
  272. package/lib/transpile/react-shim.js +0 -2
  273. package/lib/typescript/tsc-files/index.js +0 -66
  274. package/lib/typescript/tsc-files/utils.js +0 -16
  275. package/lib/typescript/util.js +0 -5
  276. package/lib/webpack/helpers.js +0 -252
  277. package/lib/webpack/webpack.base.babel.js +0 -242
  278. package/lib/webpack/webpack.dev.babel.js +0 -139
  279. package/lib/webpack/webpack.lib.base.babel.js +0 -205
  280. package/lib/webpack/webpack.lib.dev.babel.js +0 -49
  281. package/lib/webpack/webpack.lib.prod.babel.js +0 -77
  282. package/lib/webpack/webpack.prod.babel.js +0 -142
  283. package/lib/webpack/webpack.storybook.js +0 -87
@@ -1,242 +0,0 @@
1
- /* eslint-disable max-lines */
2
- const webpack = require('webpack');
3
- const path = require('path');
4
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
- const PostcssPresetEnv = require('postcss-preset-env');
6
- const CopyWebpackPlugin = require('copy-webpack-plugin');
7
- const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
8
- const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
9
- const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
10
- const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
11
- const { ProvidePlugin, ProgressPlugin } = require('webpack');
12
- const browserslistToEsbuild = require('browserslist-to-esbuild');
13
-
14
- const {
15
- excludeNodeModulesExcept,
16
- modulesToTranspile,
17
- getAlias,
18
- getPaths,
19
- filterByFilePresence,
20
- } = require('./helpers');
21
-
22
- const minicssLoader = {
23
- loader: MiniCssExtractPlugin.loader,
24
- options: {},
25
- };
26
-
27
- const finalCSSLoader = (mode) =>
28
- mode !== 'production' ? { loader: 'style-loader' } : minicssLoader;
29
-
30
- const postcssPlugins = [PostcssPresetEnv({ autoprefixer: { grid: true } })];
31
- const { buildPath } = getPaths();
32
-
33
- const plugins = [
34
- new webpack.EnvironmentPlugin({
35
- NODE_ENV: 'development',
36
- CI: 'false',
37
- }),
38
- new ProvidePlugin({
39
- React: 'react',
40
- }),
41
- new CopyWebpackPlugin({
42
- patterns: filterByFilePresence([
43
- {
44
- from: 'app/app.config.json',
45
- to: './latest/app.config.json',
46
- },
47
- {
48
- from: 'app/robots.txt',
49
- to: 'robots.txt',
50
- noErrorOnMissing: true,
51
- },
52
- {
53
- from: 'app/global*.js',
54
- to: './latest/js/[name][ext]',
55
- },
56
- {
57
- from: 'node_modules/@elliemae/pui-user-monitoring/dist/public/js',
58
- to: './latest/js',
59
- toType: 'dir',
60
- info: { minimized: true },
61
- },
62
- {
63
- from: 'node_modules/@elliemae/pui-app-loader/dist/public/js',
64
- to: './latest/js',
65
- toType: 'dir',
66
- noErrorOnMissing: true,
67
- info: { minimized: true },
68
- },
69
- {
70
- from: 'node_modules/@elliemae/encw-loader/dist/public/js',
71
- to: './latest/js',
72
- toType: 'dir',
73
- noErrorOnMissing: true,
74
- info: { minimized: true },
75
- },
76
- {
77
- from: 'node_modules/@elliemae/pui-diagnostics/dist/public/js',
78
- to: './latest/js',
79
- toType: 'dir',
80
- noErrorOnMissing: true,
81
- info: { minimized: true },
82
- },
83
- {
84
- from: 'public',
85
- to: './latest',
86
- noErrorOnMissing: true,
87
- globOptions: {
88
- ignore: ['readme.md'],
89
- },
90
- },
91
- {
92
- from: 'webroot',
93
- noErrorOnMissing: true,
94
- globOptions: {
95
- ignore: ['readme.md'],
96
- },
97
- },
98
- ]),
99
- }),
100
- new DuplicatePackageCheckerPlugin(),
101
- new MomentLocalesPlugin({ localesToKeep: ['es-us'] }),
102
- new WebpackManifestPlugin({
103
- fileName: './latest/manifest.json',
104
- publicPath: '',
105
- map: (file) => {
106
- file.name = file.name.replace(/^latest\//, '');
107
- return file;
108
- },
109
- }),
110
- new FaviconsWebpackPlugin({
111
- outputPath: './latest/assets',
112
- logo: './app/view/images/favicon.png',
113
- favicons: {
114
- developerName: 'ICE MT',
115
- developerURL: null, // prevent retrieving from the nearest package.json
116
- icons: {
117
- coast: false,
118
- yandex: false,
119
- },
120
- },
121
- }),
122
- new ProgressPlugin(),
123
- ];
124
-
125
- module.exports = (options) => ({
126
- mode: options.mode,
127
- entry: options.entry,
128
- output: {
129
- clean: true,
130
- path: buildPath,
131
- publicPath: 'auto',
132
- ...options.output,
133
- }, // Merge with env dependent settings
134
- optimization: options.optimization,
135
- module: {
136
- rules: [
137
- {
138
- test: /\.jsx?$/,
139
- exclude: excludeNodeModulesExcept(modulesToTranspile),
140
- resolve: {
141
- fullySpecified: false,
142
- },
143
- use: {
144
- loader: 'esbuild-loader',
145
- options: {
146
- loader: 'jsx',
147
- target: browserslistToEsbuild(),
148
- },
149
- },
150
- },
151
- {
152
- test: /\.tsx?$/,
153
- exclude: excludeNodeModulesExcept(modulesToTranspile),
154
- resolve: {
155
- fullySpecified: false,
156
- },
157
- use: {
158
- loader: 'esbuild-loader',
159
- options: {
160
- loader: 'tsx',
161
- target: browserslistToEsbuild(),
162
- },
163
- },
164
- },
165
- {
166
- test: /\.css$/,
167
- exclude: excludeNodeModulesExcept(modulesToTranspile),
168
- use: [
169
- finalCSSLoader(options.mode),
170
- {
171
- loader: 'css-loader',
172
- options: {
173
- importLoaders: 1,
174
- sourceMap: true,
175
- },
176
- },
177
- {
178
- loader: 'postcss-loader',
179
- options: {
180
- postcssOptions: {
181
- plugins: postcssPlugins,
182
- },
183
- sourceMap: true,
184
- },
185
- },
186
- ],
187
- },
188
- {
189
- test: /\.(woff|woff2)$/,
190
- type: 'asset/resource',
191
- exclude: excludeNodeModulesExcept(modulesToTranspile),
192
- },
193
- {
194
- test: /\.svg$/i,
195
- issuer: /\.[jt]sx?$/,
196
- resourceQuery: /^((?!url).)*$/,
197
- exclude: excludeNodeModulesExcept(modulesToTranspile),
198
- use: ['@svgr/webpack'],
199
- },
200
- {
201
- test: /\.(jpe?g|png|gif|ico|mp4|webm)$/i,
202
- exclude: excludeNodeModulesExcept(modulesToTranspile),
203
- type: 'asset',
204
- },
205
- {
206
- resourceQuery: /resource/,
207
- type: 'asset/resource',
208
- exclude: excludeNodeModulesExcept(modulesToTranspile),
209
- },
210
- {
211
- type: 'asset',
212
- resourceQuery: /url/,
213
- exclude: excludeNodeModulesExcept(modulesToTranspile),
214
- },
215
- ],
216
- },
217
- plugins: plugins.concat(options.plugins),
218
- resolve: {
219
- modules: [
220
- 'node_modules',
221
- 'app',
222
- 'lib',
223
- path.resolve(process.cwd(), 'node_modules'),
224
- path.resolve(process.cwd(), 'app'),
225
- path.resolve(process.cwd(), 'lib'),
226
- ],
227
- extensions: ['.js', '.jsx', '.ts', '.tsx', '.json', '.wasm', '.mjs'],
228
- mainFields: ['browser', 'module', 'main'],
229
- alias: {
230
- ...getAlias(),
231
- ...((options.resolve || {}).alias || {}),
232
- },
233
- },
234
- externals: {
235
- '@elliemae/pui-user-monitoring': 'emuiUserMonitoring',
236
- '@elliemae/pui-app-loader': 'emuiAppLoader',
237
- '@elliemae/pui-diagnostics': 'emuiDiagnostics',
238
- },
239
- devtool: options.devtool || 'eval-source-map',
240
- performance: options.performance || {},
241
- devServer: options.devServer || {},
242
- });
@@ -1,139 +0,0 @@
1
- /* eslint-disable max-lines */
2
- const path = require('path');
3
- const HtmlWebpackPlugin = require('html-webpack-plugin');
4
- const CircularDependencyPlugin = require('circular-dependency-plugin');
5
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
6
- const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
7
- const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
8
- const expressStaticGzip = require('express-static-gzip');
9
- const { setupDefaultMiddlewares } = require('../server/middlewares');
10
- const { loadRoutes } = require('../server/util');
11
-
12
- const smp = new SpeedMeasurePlugin({ disable: !process.env.MEASURE });
13
-
14
- const {
15
- isAppLoaderEnabled,
16
- getPaths,
17
- isGoogleTagManagerEnabled,
18
- } = require('./helpers');
19
- const baseConfigFactory = require('./webpack.base.babel');
20
-
21
- const {
22
- appVersion,
23
- buildPath,
24
- userMonScriptPath,
25
- globalScriptPath,
26
- appLoaderScriptPath,
27
- diagnosticsScriptPath,
28
- encwLoaderScriptPath,
29
- } = getPaths();
30
-
31
- const devConfig = {
32
- mode: 'development',
33
-
34
- cache: {
35
- type: 'filesystem',
36
- allowCollectingMemory: true,
37
- buildDependencies: {
38
- config: [__filename],
39
- },
40
- },
41
-
42
- // Add hot reloading in development
43
- entry: {
44
- app: path.join(process.cwd(), 'app/index'),
45
- },
46
-
47
- // Don't use hashes in dev mode for better performance
48
- output: {
49
- path: buildPath,
50
- publicPath: 'auto',
51
- filename: '[name].js',
52
- chunkFilename: '[name].chunk.js',
53
- assetModuleFilename: '[name][ext][query]',
54
- },
55
-
56
- optimization: {
57
- splitChunks: {
58
- chunks: 'all',
59
- cacheGroups: {
60
- emui: {
61
- name: 'emui',
62
- test: /[\\/]node_modules[\\/](@elliemae)[\\/]/,
63
- priority: 1,
64
- },
65
- vendors: {
66
- name: 'vendors',
67
- test: /[\\/]node_modules[\\/]/,
68
- },
69
- },
70
- },
71
- },
72
-
73
- resolve: {
74
- alias: {},
75
- },
76
-
77
- // Add development plugins
78
- plugins: [
79
- new HtmlWebpackPlugin({
80
- inject: !isAppLoaderEnabled(), // Inject all files that are generated by webpack, e.g. bundle.js
81
- template: !isAppLoaderEnabled()
82
- ? 'app/index.html'
83
- : 'app/index-app-loader.html',
84
- emui: {
85
- appVersion,
86
- globalScriptPath,
87
- userMonScriptPath,
88
- appLoaderScriptPath,
89
- diagnosticsScriptPath,
90
- encwLoaderScriptPath,
91
- googleTagManager: isGoogleTagManagerEnabled(),
92
- },
93
- }),
94
- new CircularDependencyPlugin({
95
- exclude: /a\.(js|ts|jsx|tsx)|node_modules/, // exclude node_modules
96
- failOnError: false, // show a warning when there is a circular dependency
97
- }),
98
- new MiniCssExtractPlugin({
99
- filename: '[name].css',
100
- chunkFilename: '[name].chunk.css',
101
- }),
102
- ],
103
-
104
- devtool: 'eval-source-map',
105
-
106
- performance: {
107
- hints: false,
108
- },
109
-
110
- devServer: {
111
- client: {
112
- overlay: {
113
- errors: true,
114
- warnings: false,
115
- },
116
- },
117
- historyApiFallback: true,
118
- hot: true,
119
- open: true,
120
- port: 3000,
121
- setupMiddlewares: (middlewares, devServer) => {
122
- setupDefaultMiddlewares(devServer.app);
123
- devServer.app.use(expressStaticGzip('cdn'));
124
- loadRoutes(devServer.app);
125
- return middlewares;
126
- },
127
- },
128
- };
129
-
130
- const config = smp.wrap(baseConfigFactory(devConfig));
131
- config.plugins = config.plugins.concat([
132
- new ReactRefreshWebpackPlugin({
133
- overlay: {
134
- sockIntegration: 'whm',
135
- },
136
- }),
137
- ]);
138
-
139
- module.exports = config;
@@ -1,205 +0,0 @@
1
- /* eslint-disable max-lines */
2
- const path = require('path');
3
- const { EnvironmentPlugin, DefinePlugin } = require('webpack');
4
- const {
5
- optimize: { LimitChunkCountPlugin },
6
- ProgressPlugin,
7
- } = require('webpack');
8
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
9
- const CopyWebpackPlugin = require('copy-webpack-plugin');
10
- const PostcssPresetEnv = require('postcss-preset-env');
11
- const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
12
- const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
13
- const ResolveTypeScriptPlugin = require('resolve-typescript-plugin');
14
- const browserslistToEsbuild = require('browserslist-to-esbuild');
15
-
16
- const {
17
- excludeNodeModulesExcept,
18
- getLibraryName,
19
- getAppConfig,
20
- modulesToTranspile,
21
- getAssetPath,
22
- getAlias,
23
- filterByFilePresence,
24
- } = require('./helpers');
25
-
26
- const minicssLoader = {
27
- loader: MiniCssExtractPlugin.loader,
28
- options: {},
29
- };
30
-
31
- const finalCSSLoader = (mode) =>
32
- mode !== 'production' ? { loader: 'style-loader' } : minicssLoader;
33
-
34
- const copyPluginPatterns = filterByFilePresence([
35
- {
36
- from: 'lib/app.config.json',
37
- to: 'app.config.json',
38
- noErrorOnMissing: true,
39
- },
40
- {
41
- from: 'public',
42
- noErrorOnMissing: true,
43
- },
44
- ]);
45
-
46
- const plugins = [
47
- new EnvironmentPlugin({
48
- ASSET_PATH: '/',
49
- CI: 'false',
50
- }),
51
- new DefinePlugin({
52
- APP_CONFIG: getAppConfig(true),
53
- }),
54
- /* eslint-disable indent */
55
- ...(copyPluginPatterns.length > 0
56
- ? [
57
- new CopyWebpackPlugin({
58
- patterns: copyPluginPatterns,
59
- }),
60
- ]
61
- : []),
62
- /* eslint-enable indent */
63
- new DuplicatePackageCheckerPlugin(),
64
- new LimitChunkCountPlugin({
65
- maxChunks: 1,
66
- }),
67
- new MomentLocalesPlugin({ localesToKeep: ['es-us'] }),
68
- new ProgressPlugin(),
69
- ];
70
-
71
- module.exports = (options) => ({
72
- mode: options.mode,
73
- entry: [path.join(process.cwd(), 'lib/index')],
74
- output: {
75
- clean: true,
76
- path: path.resolve(process.cwd(), 'dist/public'),
77
- publicPath: getAssetPath(),
78
- library: getLibraryName(),
79
- libraryTarget: 'umd',
80
- ...options.output,
81
- }, // Merge with env dependent settings
82
- optimization: options.optimization,
83
- module: {
84
- rules: [
85
- {
86
- test: /^(?!.*\.exec\.js$).*\.jsx?$/, // Transform all .js and .jsx files with Babel
87
- exclude: excludeNodeModulesExcept(modulesToTranspile),
88
- resolve: {
89
- fullySpecified: false,
90
- },
91
- use: {
92
- loader: 'esbuild-loader',
93
- options: {
94
- loader: 'jsx',
95
- target: browserslistToEsbuild(),
96
- },
97
- },
98
- },
99
- {
100
- test: /^(?!.*\.exec\.js$).*\.tsx?$/, // Transform all .js and .jsx files with Babel
101
- exclude: excludeNodeModulesExcept(modulesToTranspile),
102
- resolve: {
103
- fullySpecified: false,
104
- },
105
- use: {
106
- loader: 'esbuild-loader',
107
- options: {
108
- loader: 'tsx',
109
- target: browserslistToEsbuild(),
110
- },
111
- },
112
- },
113
- {
114
- test: /\.css$/,
115
- exclude: excludeNodeModulesExcept(modulesToTranspile),
116
- use: [
117
- finalCSSLoader(options.mode),
118
- {
119
- loader: 'css-loader',
120
- options: {
121
- importLoaders: 1,
122
- sourceMap: true,
123
- },
124
- },
125
- {
126
- loader: 'postcss-loader',
127
- options: {
128
- postcssOptions: {
129
- plugins: [PostcssPresetEnv({ autoprefixer: { grid: true } })],
130
- },
131
- sourceMap: true,
132
- },
133
- },
134
- ],
135
- },
136
- {
137
- test: /\.pug$/,
138
- exclude: /node_modules/,
139
- use: 'pug-loader',
140
- },
141
- {
142
- test: /\.(woff|woff2)$/,
143
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
144
- type: 'asset/resource',
145
- },
146
- {
147
- test: /\.svg$/i,
148
- issuer: /\.[jt]sx?$/,
149
- resourceQuery: /^((?!url).)*$/,
150
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
151
- use: ['@svgr/webpack'],
152
- },
153
- {
154
- test: /\.(jpe?g|png|gif|ico)$/i,
155
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
156
- type: 'asset',
157
- },
158
- {
159
- test: /(?<!\/iframe)\.html$/,
160
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
161
- use: 'html-loader',
162
- },
163
- {
164
- test: /\.(mp4|webm)$/,
165
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
166
- type: 'asset',
167
- },
168
- {
169
- resourceQuery: /resource/,
170
- type: 'asset/resource',
171
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
172
- },
173
- {
174
- type: 'asset',
175
- resourceQuery: /url/,
176
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
177
- },
178
- ],
179
- },
180
- plugins: plugins.concat(options.plugins || []),
181
- resolve: {
182
- modules: [
183
- 'node_modules',
184
- 'app',
185
- 'lib',
186
- path.resolve(process.cwd(), 'node_modules'),
187
- path.resolve(process.cwd(), 'app'),
188
- path.resolve(process.cwd(), 'lib'),
189
- ],
190
- extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.wasm', '.mjs'],
191
- mainFields: ['browser', 'module', 'main'],
192
- alias: {
193
- ...getAlias(),
194
- ...((options.resolve || {}).alias || {}),
195
- },
196
- plugins: [new ResolveTypeScriptPlugin({})],
197
- },
198
- externals: {
199
- '@elliemae/pui-user-monitoring': 'emuiUserMonitoring',
200
- '@elliemae/pui-app-loader': 'emuiAppLoader',
201
- '@elliemae/pui-diagnostics': 'emuiDiagnostics',
202
- },
203
- devtool: options.devtool || 'eval-source-map',
204
- performance: options.performance || {},
205
- });
@@ -1,49 +0,0 @@
1
- const CircularDependencyPlugin = require('circular-dependency-plugin');
2
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3
- const HtmlWebpackPlugin = require('html-webpack-plugin');
4
- const { getLibraryName } = require('./helpers');
5
-
6
- const libraryName = getLibraryName();
7
-
8
- module.exports = require('./webpack.lib.base.babel')({
9
- mode: 'development',
10
-
11
- output: {
12
- filename: `js/${libraryName}.js`,
13
- chunkFilename: `js/${libraryName}.chunk.js`,
14
- assetModuleFilename: '[name][ext][query]',
15
- },
16
-
17
- optimization: {
18
- splitChunks: {
19
- chunks: 'all',
20
- },
21
- },
22
-
23
- resolve: {
24
- alias: {},
25
- },
26
-
27
- plugins: [
28
- new HtmlWebpackPlugin({
29
- inject: true, // Inject all files that are generated by webpack, e.g. bundle.js
30
- template: 'lib/index.pug',
31
- filename: 'index.html',
32
- libraryName,
33
- }),
34
- new CircularDependencyPlugin({
35
- exclude: /a\.(js|ts|jsx|tsx)|node_modules/, // exclude node_modules
36
- failOnError: false, // show a warning when there is a circular dependency
37
- }),
38
- new MiniCssExtractPlugin({
39
- filename: `css/${libraryName}.css`,
40
- chunkFilename: `css/${libraryName}.chunk.css`,
41
- }),
42
- ],
43
-
44
- devtool: 'eval-source-map',
45
-
46
- performance: {
47
- hints: false,
48
- },
49
- });
@@ -1,77 +0,0 @@
1
- const path = require('path');
2
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3
- const HtmlWebpackPlugin = require('html-webpack-plugin');
4
- const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
5
- const { ESBuildMinifyPlugin } = require('esbuild-loader');
6
- const browserslistToEsbuild = require('browserslist-to-esbuild');
7
- const { getLibraryName, getCompressionPlugins } = require('./helpers');
8
-
9
- const libraryName = getLibraryName();
10
-
11
- module.exports = require('./webpack.lib.base.babel')({
12
- mode: 'production',
13
-
14
- output: {
15
- filename: `js/${libraryName}.[chunkhash].js`,
16
- chunkFilename: `js/${libraryName}.[chunkhash].chunk.js`,
17
- assetModuleFilename: 'assets/[name].[hash][ext][query]',
18
- },
19
-
20
- optimization: {
21
- moduleIds: 'deterministic',
22
- minimize: true,
23
- minimizer: [
24
- new ESBuildMinifyPlugin({
25
- target: browserslistToEsbuild(),
26
- css: true,
27
- }),
28
- ],
29
- nodeEnv: 'production',
30
- sideEffects: true,
31
- concatenateModules: true,
32
- splitChunks: {
33
- chunks: 'all',
34
- },
35
- },
36
-
37
- plugins: [
38
- new HtmlWebpackPlugin({
39
- template: 'lib/index.pug',
40
- filename: 'index.html',
41
- libraryName,
42
- minify: {
43
- removeComments: true,
44
- collapseWhitespace: true,
45
- removeRedundantAttributes: true,
46
- useShortDoctype: true,
47
- removeEmptyAttributes: true,
48
- removeStyleLinkTypeAttributes: true,
49
- keepClosingSlash: true,
50
- minifyJS: true,
51
- minifyCSS: true,
52
- minifyURLs: true,
53
- },
54
- inject: true,
55
- }),
56
-
57
- new MiniCssExtractPlugin({
58
- filename: `css/${libraryName}.[contenthash].css`,
59
- chunkFilename: `css/${libraryName}.[contenthash].chunk.css`,
60
- }),
61
-
62
- ...getCompressionPlugins(true),
63
-
64
- new BundleAnalyzerPlugin({
65
- analyzerMode: 'static',
66
- reportFilename: path.join(process.cwd(), 'reports/bundle-stats.html'),
67
- openAnalyzer: false,
68
- }),
69
- ],
70
-
71
- devtool: 'source-map',
72
-
73
- performance: {
74
- assetFilter: (assetFilename) =>
75
- !/(\.map$)|(^(main\.|favicon\.))/.test(assetFilename),
76
- },
77
- });