@elliemae/pui-cli 7.0.0-alpha.3 → 7.0.0-alpha.32

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 (279) hide show
  1. package/dist/cjs/{babel/babel.config.cjs → babel.config.cjs} +2 -6
  2. package/dist/cjs/cli.js +19 -13
  3. package/dist/cjs/{cli-commands → commands}/build.js +11 -2
  4. package/dist/cjs/{cli-commands → commands}/codemod.js +5 -1
  5. package/dist/cjs/{cli-commands → commands}/gendoc.js +7 -6
  6. package/dist/cjs/{cli-commands → commands}/lint.js +13 -4
  7. package/dist/cjs/{cli-commands → commands}/pack.js +15 -5
  8. package/dist/cjs/{cli-commands → commands}/start.js +18 -3
  9. package/dist/cjs/{cli-commands → commands}/storybook.js +11 -3
  10. package/dist/cjs/{cli-commands → commands}/test.js +20 -6
  11. package/dist/cjs/commands/tscheck.js +82 -0
  12. package/dist/cjs/{cli-commands → commands}/utils.js +29 -10
  13. package/dist/cjs/{cli-commands → commands}/version.js +8 -2
  14. package/dist/cjs/{cli-commands → commands}/vitest.js +12 -3
  15. package/dist/cjs/docs/assets/highlight.css +78 -0
  16. package/dist/cjs/docs/assets/icons.css +1043 -0
  17. package/dist/cjs/docs/assets/icons.png +0 -0
  18. package/dist/cjs/docs/assets/icons@2x.png +0 -0
  19. package/dist/cjs/docs/assets/main.js +1304 -0
  20. package/dist/cjs/docs/assets/search.js +2 -0
  21. package/dist/cjs/docs/assets/style.css +1414 -0
  22. package/dist/cjs/docs/assets/widgets.png +0 -0
  23. package/dist/cjs/docs/assets/widgets@2x.png +0 -0
  24. package/dist/cjs/docs/index.html +94 -0
  25. package/dist/cjs/docs/modules.html +1 -0
  26. package/dist/cjs/dummy.js +1 -0
  27. package/dist/cjs/index.cjs +25 -0
  28. package/dist/cjs/index.js +10 -9
  29. package/dist/cjs/{docgen/jsdoc.conf.json → jsdoc.conf.json} +0 -0
  30. package/dist/cjs/{lint → lint-config}/commitlint.config.cjs +0 -0
  31. package/dist/cjs/{lint → lint-config}/eslint/common.cjs +5 -5
  32. package/dist/cjs/{lint → lint-config}/eslint/non-react.cjs +0 -0
  33. package/dist/cjs/{lint → lint-config}/eslint/react.cjs +0 -0
  34. package/dist/cjs/{lint → lint-config}/eslint/typescript/common.cjs +0 -0
  35. package/dist/cjs/{lint → lint-config}/eslint/typescript/non-react.cjs +0 -0
  36. package/dist/cjs/{lint → lint-config}/eslint/typescript/react.cjs +0 -0
  37. package/dist/cjs/{lint → lint-config}/lint-staged.config.js +6 -7
  38. package/dist/cjs/{lint → lint-config}/prettier.config.cjs +0 -0
  39. package/dist/{esm/lint → cjs/lint-config}/stylelint.config.cjs +1 -1
  40. package/dist/cjs/monorepo/delete-merged-tags.js +1 -0
  41. package/dist/cjs/monorepo/set-registry-version.js +14 -8
  42. package/dist/cjs/monorepo/set-workspace-version.js +21 -9
  43. package/dist/cjs/monorepo/utils.cjs +30 -0
  44. package/dist/cjs/{pui-config/index.js → pui-config.js} +5 -1
  45. package/dist/cjs/{release/release.config.cjs → release.config.cjs} +0 -0
  46. package/dist/cjs/server/app-routes.cjs +42 -0
  47. package/dist/cjs/server/csp.js +25 -19
  48. package/dist/cjs/server/index.js +11 -6
  49. package/dist/cjs/server/logger.js +12 -4
  50. package/dist/cjs/server/{middlewares/index.js → middlewares.js} +26 -8
  51. package/dist/cjs/{typescript/util.js → server/utils.js} +19 -8
  52. package/dist/cjs/testing/jest.config.cjs +11 -14
  53. package/dist/cjs/{scripts/helpers/get-npm-config.js → testing/mocks/axios.js} +20 -9
  54. package/dist/cjs/{scripts/helpers/checkmark.js → testing/mocks/cssModule.js} +6 -14
  55. package/dist/cjs/testing/mocks/html.js +24 -0
  56. package/dist/cjs/testing/mocks/image.js +24 -0
  57. package/dist/cjs/testing/mocks/matchMedia.js +44 -0
  58. package/dist/cjs/{typescript/tsc-files/utils.js → testing/mocks/pui-app-loader.js} +6 -12
  59. package/dist/cjs/testing/mocks/pui-diagnostics.js +69 -0
  60. package/dist/cjs/testing/mocks/pui-user-monitoring.js +31 -0
  61. package/dist/cjs/testing/mocks/retry-axios.js +28 -0
  62. package/dist/cjs/{scripts/helpers/xmark.js → testing/mocks/svg.js} +13 -11
  63. package/dist/cjs/testing/mocks/webpack-hmr.js +25 -0
  64. package/dist/cjs/testing/setup-react-env.js +5 -1
  65. package/dist/cjs/testing/setup-test-env.js +23 -0
  66. package/dist/cjs/testing/setup-tests.js +11 -5
  67. package/dist/cjs/testing/vitest.config.js +20 -7
  68. package/dist/cjs/transpile/.swcrc +11 -0
  69. package/dist/cjs/transpile/esbuild.js +33 -37
  70. package/dist/cjs/transpile/react-shim.js +5 -1
  71. package/dist/cjs/typedoc.cjs +12 -0
  72. package/dist/cjs/{scripts/update-notifier.js → update-notifier.js} +7 -3
  73. package/dist/cjs/utils.cjs +3 -0
  74. package/dist/cjs/webpack/helpers.js +78 -57
  75. package/dist/cjs/webpack/webpack.base.babel.js +15 -21
  76. package/dist/cjs/webpack/webpack.dev.babel.js +16 -8
  77. package/dist/cjs/webpack/webpack.lib.base.babel.js +22 -27
  78. package/dist/cjs/webpack/webpack.lib.dev.babel.js +34 -9
  79. package/dist/cjs/webpack/webpack.lib.prod.babel.js +33 -22
  80. package/dist/cjs/webpack/webpack.prod.babel.js +13 -7
  81. package/dist/cjs/webpack/webpack.storybook.js +111 -0
  82. package/dist/esm/{babel/babel.config.cjs → babel.config.cjs} +2 -6
  83. package/dist/esm/cli.js +13 -11
  84. package/dist/esm/{cli-commands → commands}/build.js +6 -1
  85. package/dist/esm/{cli-commands → commands}/codemod.js +0 -0
  86. package/dist/esm/{cli-commands → commands}/gendoc.js +2 -5
  87. package/dist/esm/{cli-commands → commands}/lint.js +7 -2
  88. package/dist/esm/{cli-commands → commands}/pack.js +9 -3
  89. package/dist/esm/{cli-commands → commands}/start.js +14 -3
  90. package/dist/esm/{cli-commands → commands}/storybook.js +6 -2
  91. package/dist/esm/{cli-commands → commands}/test.js +15 -5
  92. package/dist/esm/commands/tscheck.js +56 -0
  93. package/dist/esm/{cli-commands → commands}/utils.js +32 -10
  94. package/dist/esm/{cli-commands → commands}/version.js +3 -1
  95. package/dist/esm/{cli-commands → commands}/vitest.js +7 -2
  96. package/dist/esm/docs/assets/highlight.css +78 -0
  97. package/dist/esm/docs/assets/icons.css +1043 -0
  98. package/dist/esm/docs/assets/icons.png +0 -0
  99. package/dist/esm/docs/assets/icons@2x.png +0 -0
  100. package/dist/esm/docs/assets/main.js +1303 -0
  101. package/dist/esm/docs/assets/search.js +1 -0
  102. package/dist/esm/docs/assets/style.css +1414 -0
  103. package/dist/esm/docs/assets/widgets.png +0 -0
  104. package/dist/esm/docs/assets/widgets@2x.png +0 -0
  105. package/dist/esm/docs/index.html +94 -0
  106. package/dist/esm/docs/modules.html +1 -0
  107. package/dist/esm/index.cjs +25 -0
  108. package/dist/esm/index.js +8 -8
  109. package/dist/esm/{docgen/jsdoc.conf.json → jsdoc.conf.json} +0 -0
  110. package/dist/esm/{lint → lint-config}/commitlint.config.cjs +0 -0
  111. package/dist/esm/{lint → lint-config}/eslint/common.cjs +5 -5
  112. package/dist/esm/{lint → lint-config}/eslint/non-react.cjs +0 -0
  113. package/dist/esm/{lint → lint-config}/eslint/react.cjs +0 -0
  114. package/dist/esm/{lint → lint-config}/eslint/typescript/common.cjs +0 -0
  115. package/dist/esm/{lint → lint-config}/eslint/typescript/non-react.cjs +0 -0
  116. package/dist/esm/{lint → lint-config}/eslint/typescript/react.cjs +0 -0
  117. package/dist/esm/{lint → lint-config}/lint-staged.config.js +1 -5
  118. package/dist/esm/{lint → lint-config}/prettier.config.cjs +0 -0
  119. package/dist/{cjs/lint → esm/lint-config}/stylelint.config.cjs +1 -1
  120. package/dist/esm/monorepo/set-registry-version.js +9 -7
  121. package/dist/esm/monorepo/set-workspace-version.js +16 -8
  122. package/dist/esm/monorepo/utils.cjs +30 -0
  123. package/dist/esm/{pui-config/index.js → pui-config.js} +0 -0
  124. package/dist/esm/{release/release.config.cjs → release.config.cjs} +0 -0
  125. package/dist/esm/server/app-routes.cjs +42 -0
  126. package/dist/esm/server/csp.js +20 -18
  127. package/dist/esm/server/index.js +3 -2
  128. package/dist/esm/server/logger.js +7 -3
  129. package/dist/esm/server/middlewares.js +49 -0
  130. package/dist/esm/server/utils.js +13 -0
  131. package/dist/esm/testing/jest.config.cjs +11 -14
  132. package/dist/{cjs/testing/mocks/axios.cjs → esm/testing/mocks/axios.js} +8 -5
  133. package/dist/esm/testing/mocks/cssModule.js +4 -0
  134. package/dist/esm/testing/mocks/html.js +4 -0
  135. package/dist/esm/testing/mocks/image.js +4 -0
  136. package/dist/esm/testing/mocks/matchMedia.js +24 -0
  137. package/dist/esm/testing/mocks/pui-app-loader.js +5 -0
  138. package/dist/esm/testing/mocks/pui-diagnostics.js +49 -0
  139. package/dist/esm/testing/mocks/pui-user-monitoring.js +11 -0
  140. package/dist/esm/testing/mocks/retry-axios.js +8 -0
  141. package/dist/esm/testing/mocks/svg.js +7 -0
  142. package/dist/esm/testing/mocks/webpack-hmr.js +5 -0
  143. package/dist/esm/testing/setup-test-env.js +4 -0
  144. package/dist/esm/testing/setup-tests.js +5 -3
  145. package/dist/esm/testing/vitest.config.js +13 -5
  146. package/dist/esm/transpile/.swcrc +11 -0
  147. package/dist/esm/transpile/esbuild.js +28 -38
  148. package/dist/esm/typedoc.cjs +12 -0
  149. package/dist/esm/{scripts/update-notifier.js → update-notifier.js} +2 -2
  150. package/dist/esm/utils.cjs +3 -0
  151. package/dist/esm/webpack/helpers.js +73 -58
  152. package/dist/esm/webpack/webpack.base.babel.js +11 -23
  153. package/dist/esm/webpack/webpack.dev.babel.js +9 -6
  154. package/dist/esm/webpack/webpack.lib.base.babel.js +17 -33
  155. package/dist/esm/webpack/webpack.lib.dev.babel.js +29 -8
  156. package/dist/esm/webpack/webpack.lib.prod.babel.js +27 -20
  157. package/dist/esm/webpack/webpack.prod.babel.js +8 -6
  158. package/dist/esm/webpack/webpack.storybook.js +85 -0
  159. package/dist/types/{babel/babel.config.d.cts → babel.config.d.cts} +0 -0
  160. package/dist/types/{cli-commands → commands}/build.d.ts +0 -0
  161. package/dist/types/{cli-commands → commands}/codemod.d.ts +0 -0
  162. package/dist/types/{cli-commands → commands}/gendoc.d.ts +0 -0
  163. package/dist/types/{cli-commands → commands}/lint.d.ts +0 -0
  164. package/dist/types/{cli-commands → commands}/pack.d.ts +0 -0
  165. package/dist/types/{cli-commands → commands}/start.d.ts +0 -0
  166. package/dist/types/{cli-commands → commands}/storybook.d.ts +0 -0
  167. package/dist/types/{cli-commands → commands}/test.d.ts +10 -6
  168. package/dist/types/commands/tscheck.d.ts +14 -0
  169. package/dist/types/{cli-commands → commands}/utils.d.ts +2 -0
  170. package/dist/types/{cli-commands → commands}/version.d.ts +0 -0
  171. package/dist/types/{cli-commands → commands}/vitest.d.ts +0 -0
  172. package/dist/{cjs/testing/vitest.setup.js → types/docs/assets/main.d.ts} +0 -0
  173. package/dist/{esm/testing/vitest.setup.js → types/docs/assets/search.d.ts} +0 -0
  174. package/dist/types/index.d.cts +10 -0
  175. package/dist/types/index.d.ts +8 -8
  176. package/dist/types/{lint → lint-config}/commitlint.config.d.cts +0 -0
  177. package/dist/types/{lint → lint-config}/eslint/common.d.cts +15 -12
  178. package/dist/types/{lint → lint-config}/eslint/non-react.d.cts +6 -1
  179. package/dist/types/{lint → lint-config}/eslint/react.d.cts +6 -1
  180. package/dist/types/{lint → lint-config}/eslint/typescript/common.d.cts +2 -2
  181. package/dist/types/{lint → lint-config}/eslint/typescript/non-react.d.cts +1 -1
  182. package/dist/types/{lint → lint-config}/eslint/typescript/react.d.cts +1 -1
  183. package/dist/types/{lint → lint-config}/lint-staged.config.d.ts +0 -0
  184. package/dist/types/{lint → lint-config}/prettier.config.d.cts +0 -0
  185. package/dist/types/{lint → lint-config}/stylelint.config.d.cts +1 -0
  186. package/dist/types/monorepo/utils.d.cts +1 -0
  187. package/dist/types/{pui-config/index.d.ts → pui-config.d.ts} +0 -0
  188. package/dist/types/{release/release.config.d.cts → release.config.d.cts} +0 -0
  189. package/dist/types/server/app-routes.d.cts +1 -0
  190. package/dist/types/server/{middlewares/index.d.ts → middlewares.d.ts} +1 -1
  191. package/dist/types/server/{util/index.d.ts → utils.d.ts} +0 -1
  192. package/dist/types/testing/jest.config.d.cts +3 -3
  193. package/dist/types/testing/jest.node.config.d.cts +4 -4
  194. package/dist/types/testing/mocks/axios.d.ts +17 -0
  195. package/dist/types/testing/mocks/cssModule.d.ts +2 -0
  196. package/dist/types/testing/mocks/html.d.ts +2 -0
  197. package/dist/types/testing/mocks/image.d.ts +2 -0
  198. package/dist/types/testing/mocks/matchMedia.d.ts +1 -0
  199. package/dist/types/testing/mocks/{pui-app-loader.d.cts → pui-app-loader.d.ts} +0 -0
  200. package/dist/types/testing/mocks/{pui-diagnostics.d.cts → pui-diagnostics.d.ts} +0 -0
  201. package/dist/types/testing/mocks/{pui-user-monitoring.d.cts → pui-user-monitoring.d.ts} +0 -0
  202. package/dist/types/testing/mocks/{retry-axios.d.cts → retry-axios.d.ts} +0 -0
  203. package/dist/types/testing/mocks/{svg.d.cts → svg.d.ts} +1 -1
  204. package/dist/types/testing/mocks/{webpack-hmr.d.cts → webpack-hmr.d.ts} +0 -0
  205. package/dist/types/testing/setup-test-env.d.ts +2 -0
  206. package/dist/types/testing/vitest.config.d.ts +1 -1
  207. package/dist/types/transpile/swcrc.config.d.cts +1 -1
  208. package/dist/types/typedoc.d.cts +3 -0
  209. package/dist/types/update-notifier.d.ts +1 -0
  210. package/dist/types/utils.d.cts +2 -1
  211. package/dist/types/webpack/helpers.d.ts +1 -1
  212. package/dist/types/webpack/webpack.dev.babel.d.ts +2 -1
  213. package/dist/types/webpack/webpack.lib.base.babel.d.ts +1 -0
  214. package/dist/types/webpack/webpack.lib.dev.babel.d.ts +20 -3
  215. package/dist/types/webpack/webpack.lib.prod.babel.d.ts +20 -3
  216. package/dist/types/webpack/webpack.prod.babel.d.ts +1 -1
  217. package/dist/types/webpack/{webpack.storybook.d.cts → webpack.storybook.d.ts} +0 -0
  218. package/package.json +130 -124
  219. package/dist/cjs/cli-commands/tsc.js +0 -103
  220. package/dist/cjs/monorepo/utils.js +0 -34
  221. package/dist/cjs/scripts/helpers/progress.js +0 -35
  222. package/dist/cjs/scripts/npmcheckversion.js +0 -8
  223. package/dist/cjs/server/middlewares/addProdMiddlewares.js +0 -44
  224. package/dist/cjs/server/util/index.js +0 -68
  225. package/dist/cjs/testing/mocks/cssModule.cjs +0 -1
  226. package/dist/cjs/testing/mocks/html.cjs +0 -1
  227. package/dist/cjs/testing/mocks/image.cjs +0 -1
  228. package/dist/cjs/testing/mocks/matchMedia.cjs +0 -24
  229. package/dist/cjs/testing/mocks/pui-app-loader.cjs +0 -1
  230. package/dist/cjs/testing/mocks/pui-diagnostics.cjs +0 -28
  231. package/dist/cjs/testing/mocks/pui-user-monitoring.cjs +0 -3
  232. package/dist/cjs/testing/mocks/retry-axios.cjs +0 -3
  233. package/dist/cjs/testing/mocks/svg.cjs +0 -5
  234. package/dist/cjs/testing/mocks/webpack-hmr.cjs +0 -1
  235. package/dist/cjs/typescript/tsc-files/index.js +0 -68
  236. package/dist/cjs/webpack/webpack.storybook.cjs +0 -87
  237. package/dist/esm/cli-commands/tsc.js +0 -83
  238. package/dist/esm/monorepo/utils.js +0 -12
  239. package/dist/esm/scripts/helpers/checkmark.js +0 -10
  240. package/dist/esm/scripts/helpers/get-npm-config.js +0 -5
  241. package/dist/esm/scripts/helpers/progress.js +0 -13
  242. package/dist/esm/scripts/helpers/xmark.js +0 -9
  243. package/dist/esm/scripts/npmcheckversion.js +0 -8
  244. package/dist/esm/server/middlewares/addProdMiddlewares.js +0 -22
  245. package/dist/esm/server/middlewares/index.js +0 -35
  246. package/dist/esm/server/util/index.js +0 -46
  247. package/dist/esm/testing/mocks/axios.cjs +0 -15
  248. package/dist/esm/testing/mocks/cssModule.cjs +0 -1
  249. package/dist/esm/testing/mocks/html.cjs +0 -1
  250. package/dist/esm/testing/mocks/image.cjs +0 -1
  251. package/dist/esm/testing/mocks/matchMedia.cjs +0 -24
  252. package/dist/esm/testing/mocks/pui-app-loader.cjs +0 -1
  253. package/dist/esm/testing/mocks/pui-diagnostics.cjs +0 -28
  254. package/dist/esm/testing/mocks/pui-user-monitoring.cjs +0 -3
  255. package/dist/esm/testing/mocks/retry-axios.cjs +0 -3
  256. package/dist/esm/testing/mocks/svg.cjs +0 -5
  257. package/dist/esm/testing/mocks/webpack-hmr.cjs +0 -1
  258. package/dist/esm/typescript/tsc-files/index.js +0 -55
  259. package/dist/esm/typescript/tsc-files/utils.js +0 -12
  260. package/dist/esm/typescript/util.js +0 -6
  261. package/dist/esm/webpack/webpack.storybook.cjs +0 -87
  262. package/dist/types/cli-commands/tsc.d.ts +0 -20
  263. package/dist/types/monorepo/utils.d.ts +0 -1
  264. package/dist/types/scripts/helpers/checkmark.d.ts +0 -7
  265. package/dist/types/scripts/helpers/get-npm-config.d.ts +0 -2
  266. package/dist/types/scripts/helpers/progress.d.ts +0 -7
  267. package/dist/types/scripts/helpers/xmark.d.ts +0 -6
  268. package/dist/types/scripts/npmcheckversion.d.ts +0 -1
  269. package/dist/types/scripts/update-notifier.d.ts +0 -2
  270. package/dist/types/server/middlewares/addProdMiddlewares.d.ts +0 -1
  271. package/dist/types/testing/mocks/axios.d.cts +0 -14
  272. package/dist/types/testing/mocks/cssModule.d.cts +0 -2
  273. package/dist/types/testing/mocks/html.d.cts +0 -2
  274. package/dist/types/testing/mocks/image.d.cts +0 -2
  275. package/dist/types/testing/mocks/matchMedia.d.cts +0 -2
  276. package/dist/types/testing/vitest.setup.d.ts +0 -0
  277. package/dist/types/typescript/tsc-files/index.d.ts +0 -1
  278. package/dist/types/typescript/tsc-files/utils.d.ts +0 -3
  279. package/dist/types/typescript/util.d.ts +0 -1
@@ -0,0 +1,25 @@
1
+ const { babelConfig } = require('./babel.config.cjs');
2
+ const {
3
+ esConfig: eslintBaseConfig,
4
+ } = require('./lint-config/eslint/non-react.cjs');
5
+ const {
6
+ esReactConfig: eslintConfig,
7
+ } = require('./lint-config/eslint/react.cjs');
8
+ const { stylelintConfig } = require('./lint-config/stylelint.config.cjs');
9
+ const { prettierConfig } = require('./lint-config/prettier.config.cjs');
10
+ const { commitlintConfig } = require('./lint-config/commitlint.config.cjs');
11
+ const { jestConfig } = require('./testing/jest.config.cjs');
12
+ const { jestNodeConfig } = require('./testing/jest.node.config.cjs');
13
+ const { loadRoutes } = require('./server/app-routes.cjs');
14
+
15
+ module.exports = {
16
+ babelConfig,
17
+ eslintBaseConfig,
18
+ eslintConfig,
19
+ stylelintConfig,
20
+ prettierConfig,
21
+ commitlintConfig,
22
+ jestConfig,
23
+ jestNodeConfig,
24
+ loadRoutes,
25
+ };
package/dist/esm/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { babelConfig } from "./babel/babel.config.cjs";
2
- import { esConfig } from "./lint/eslint/non-react.cjs";
3
- import { esReactConfig } 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";
1
+ import { babelConfig } from "./babel.config.cjs";
2
+ import { esConfig } from "./lint-config/eslint/non-react.cjs";
3
+ import { esReactConfig } from "./lint-config/eslint/react.cjs";
4
+ import { stylelintConfig } from "./lint-config/stylelint.config.cjs";
5
+ import { prettierConfig } from "./lint-config/prettier.config.cjs";
6
+ import { commitlintConfig } from "./lint-config/commitlint.config.cjs";
7
7
  import { jestConfig } from "./testing/jest.config.cjs";
8
8
  import { jestNodeConfig } from "./testing/jest.node.config.cjs";
9
- import { lintStagedConfig } from "./lint/lint-staged.config.js";
10
- import { loadRoutes } from "./server/util/index.js";
9
+ import { lintStagedConfig } from "./lint-config/lint-staged.config.js";
10
+ import { loadRoutes } from "./server/app-routes.cjs";
11
11
  export {
12
12
  babelConfig,
13
13
  commitlintConfig,
@@ -141,11 +141,11 @@ exports.baseConfig = {
141
141
  jest: {
142
142
  version: 28,
143
143
  },
144
- // 'import/resolver': {
145
- // webpack: {
146
- // config: webpackConfig,
147
- // },
148
- // },
144
+ 'import/resolver': {
145
+ node: {
146
+ extensions: ['.js', '.jsx', '.ts', '.tsx']
147
+ },
148
+ },
149
149
  },
150
150
  ignorePatterns: [
151
151
  '/build/**/*',
File without changes
@@ -1,13 +1,9 @@
1
1
  import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
2
  import fs from "node:fs";
4
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
3
  const npmClient = fs.existsSync(path.join(process.cwd(), "pnpm-lock.yaml")) ? "pnpm" : "npm";
6
4
  const lintStagedConfig = {
7
5
  "*.{js,ts,jsx,tsx,md,mdx,html,css,json}": ["prettier --write"],
8
- "*.{ts,tsx}": [
9
- `node ${path.resolve(__dirname, "../typescript/tsc-files/index.js")} --noEmit --emitDeclarationOnly false`
10
- ],
6
+ "*.{ts,tsx}": [`${npmClient} run tscheck`],
11
7
  "*.{js,ts,jsx,tsx}": [
12
8
  `${npmClient} run lint:fix`,
13
9
  `${npmClient} run test:staged`,
@@ -15,5 +15,5 @@ exports.stylelintConfig = {
15
15
  'stylelint-config-recommended',
16
16
  'stylelint-config-styled-components',
17
17
  ],
18
- rules: { 'selector-type-no-unknown': null, 'no-extra-semicolons': null },
18
+ rules: { 'selector-type-no-unknown': null, 'no-extra-semicolons': null, 'function-no-unknown': null },
19
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([
@@ -9,12 +9,14 @@ const setRegistryVersion = async () => {
9
9
  `${monorepoRoot}/apps/*/package.json`,
10
10
  `${monorepoRoot}/package.json`
11
11
  ]);
12
- Promise.all(files.map(async (file) => {
13
- let pkgJSONData = await readFile(file, "utf8");
14
- const pkgVersion = JSON.parse(pkgJSONData).version;
15
- pkgJSONData = pkgJSONData.replace(/workspace:\*/g, pkgVersion);
16
- await writeFile(file, pkgJSONData);
17
- }));
12
+ Promise.all(
13
+ files.map(async (file) => {
14
+ let pkgJSONData = await readFile(file, "utf8");
15
+ const pkgVersion = JSON.parse(pkgJSONData).version;
16
+ pkgJSONData = pkgJSONData.replace(/workspace:\*/g, pkgVersion);
17
+ await writeFile(file, pkgJSONData);
18
+ })
19
+ );
18
20
  };
19
21
  export {
20
22
  setRegistryVersion
@@ -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([
@@ -9,13 +9,21 @@ const setWorkspaceVersion = async () => {
9
9
  `${monorepoRoot}/apps/*/package.json`,
10
10
  `${monorepoRoot}/package.json`
11
11
  ]);
12
- Promise.all(files.map(async (file) => {
13
- let pkgJSONData = await readFile(file, "utf8");
14
- const pkgVersion = JSON.parse(pkgJSONData).version;
15
- pkgJSONData = pkgJSONData.replace(new RegExp(pkgVersion, "g"), "workspace:*");
16
- pkgJSONData = pkgJSONData.replace(/"version": "workspace:\*"/g, `"version": "${pkgVersion}"`);
17
- await writeFile(file, pkgJSONData);
18
- }));
12
+ Promise.all(
13
+ files.map(async (file) => {
14
+ let pkgJSONData = await readFile(file, "utf8");
15
+ const pkgVersion = JSON.parse(pkgJSONData).version;
16
+ pkgJSONData = pkgJSONData.replace(
17
+ new RegExp(pkgVersion, "g"),
18
+ "workspace:*"
19
+ );
20
+ pkgJSONData = pkgJSONData.replace(
21
+ /"version": "workspace:\*"/g,
22
+ `"version": "${pkgVersion}"`
23
+ );
24
+ await writeFile(file, pkgJSONData);
25
+ })
26
+ );
19
27
  };
20
28
  export {
21
29
  setWorkspaceVersion
@@ -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
+ // eslint-disable-next-line no-restricted-syntax
10
+ for (const fileName of [WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml']) {
11
+ try {
12
+ const result = execSync(`npx find-up ${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
+ };
File without changes
@@ -0,0 +1,42 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const allJS = /\.js$/;
5
+
6
+ const serviceEndpoints = /\.endpoint\.js$/;
7
+
8
+ const getFilesMatching = (filePattern) => {
9
+ const getFiles = (dir) => {
10
+ let routeFiles = [];
11
+ if (!fs.existsSync(dir)) return routeFiles;
12
+ fs.readdirSync(dir).forEach((file) => {
13
+ const fullPath = path.join(dir, file);
14
+ if (fs.lstatSync(fullPath).isDirectory()) {
15
+ routeFiles = routeFiles.concat(getFiles(fullPath));
16
+ } else if (filePattern.test(fullPath)) routeFiles.push(fullPath);
17
+ });
18
+ return routeFiles;
19
+ };
20
+ return getFiles;
21
+ };
22
+
23
+ const getServerRouteFiles = getFilesMatching(allJS);
24
+ const getServiceEndpoints = getFilesMatching(serviceEndpoints);
25
+
26
+ exports.loadRoutes = (app) => {
27
+ const routeFiles = getServerRouteFiles(
28
+ path.join(process.cwd(), 'server/routes'),
29
+ );
30
+ routeFiles.push(...getServiceEndpoints(path.join(process.cwd(), 'app')));
31
+ routeFiles.push(...getServiceEndpoints(path.join(process.cwd(), 'lib')));
32
+ routeFiles.forEach((routeFile) => {
33
+ // eslint-disable-next-line global-require
34
+ const init = require(routeFile);
35
+ try {
36
+ init(app);
37
+ } catch (err) {
38
+ // eslint-disable-next-line no-console
39
+ console.error(`unable to load routes from ${routeFile}. ${err.message}`);
40
+ }
41
+ });
42
+ };
@@ -41,24 +41,26 @@ const csp = (app) => {
41
41
  res.locals.cspNonce = crypto.randomBytes(16).toString("hex");
42
42
  next();
43
43
  });
44
- app.use(cspPolicy({
45
- directives: {
46
- defaultSrc: ["'self'"],
47
- baseUri: ["'self'"],
48
- blockAllMixedContent: [],
49
- connectSrc: sources,
50
- fontSrc: sources.concat(["data:"]),
51
- frameAncestors: sources,
52
- imgSrc: sources.concat(["data:"]),
53
- objectSrc: ["'none'"],
54
- scriptSrc: getScriptSrc(),
55
- scriptSrcAttr: ["'none'"],
56
- styleSrc: sources.concat(["'unsafe-inline'"]),
57
- upgradeInsecureRequests: [],
58
- reportUri: "/v1/csp"
59
- },
60
- reportOnly: true
61
- }));
44
+ app.use(
45
+ cspPolicy({
46
+ directives: {
47
+ defaultSrc: ["'self'"],
48
+ baseUri: ["'self'"],
49
+ blockAllMixedContent: [],
50
+ connectSrc: sources,
51
+ fontSrc: sources.concat(["data:"]),
52
+ frameAncestors: sources,
53
+ imgSrc: sources.concat(["data:"]),
54
+ objectSrc: ["'none'"],
55
+ scriptSrc: getScriptSrc(),
56
+ scriptSrcAttr: ["'none'"],
57
+ styleSrc: sources.concat(["'unsafe-inline'"]),
58
+ upgradeInsecureRequests: [],
59
+ reportUri: "/v1/csp"
60
+ },
61
+ reportOnly: true
62
+ })
63
+ );
62
64
  };
63
65
  export {
64
66
  csp,
@@ -3,8 +3,9 @@ import { logger } from "./logger.js";
3
3
  import {
4
4
  setupDefaultMiddlewares,
5
5
  setupAdditionalMiddlewars
6
- } from "./middlewares/index.js";
7
- import { loadRoutes, port, host } from "./util/index.js";
6
+ } from "./middlewares.js";
7
+ import { port, host } from "./utils.js";
8
+ import { loadRoutes } from "./app-routes.cjs";
8
9
  const app = express();
9
10
  setupDefaultMiddlewares(app);
10
11
  loadRoutes(app);
@@ -12,14 +12,18 @@ const logger = {
12
12
  }
13
13
  const accessUrls = `${chalk.bold("Access URLs:")}${divider}
14
14
  `;
15
- const localHostUrl = `Localhost: ${chalk.magenta(`http://${host}:${port}`)}
15
+ const localHostUrl = `Localhost: ${chalk.magenta(
16
+ `http://${host}:${port}`
17
+ )}
16
18
  `;
17
19
  const lanUrl = `LAN: ${chalk.magenta(`http://${ip.address()}:${port}`)}
18
20
  `;
19
21
  const proxy = tunnelStarted ? `
20
22
  Proxy: ${chalk.magenta(tunnelStarted)}` : "";
21
- console.log(`${accessUrls}${localHostUrl}${lanUrl}${proxy}${divider}${chalk.blue(`
22
- Press ${chalk.italic("CTRL-C")} to stop`)}
23
+ console.log(`${accessUrls}${localHostUrl}${lanUrl}${proxy}${divider}${chalk.blue(
24
+ `
25
+ Press ${chalk.italic("CTRL-C")} to stop`
26
+ )}
23
27
  `);
24
28
  }
25
29
  };
@@ -0,0 +1,49 @@
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(
35
+ basePath,
36
+ expressStaticGzip(buildPath, {
37
+ index: false,
38
+ enableBrotli: true,
39
+ orderPreference: ["br"]
40
+ })
41
+ );
42
+ app.use(expressStaticGzip("cdn"));
43
+ app.get("*", (req, res) => sendFileWithCSPNonce({ buildPath, res }));
44
+ return app;
45
+ };
46
+ export {
47
+ setupAdditionalMiddlewars,
48
+ setupDefaultMiddlewares
49
+ };
@@ -0,0 +1,13 @@
1
+ import minimist from "minimist";
2
+ const argv = minimist(process.argv.slice(2));
3
+ const getCWD = () => process.cwd();
4
+ const port = parseInt(
5
+ argv.port || process.env.port || process.env.PORT || "3000",
6
+ 10
7
+ );
8
+ const host = argv.host || process.env.HOST;
9
+ export {
10
+ getCWD,
11
+ host,
12
+ port
13
+ };
@@ -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,16 +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$': getMockFilePath('svg.cjs'),
68
- '.*\\.(html)$': getMockFilePath('html.cjs'),
69
- '.*index.html\\?resource$': getMockFilePath('html.cjs'),
70
- '@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.cjs'),
71
- '@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.cjs'),
72
- '@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'),
73
69
  'react-spring/web': getNodeModulesPath('react-spring/web.cjs.js'),
74
70
  'react-spring/renderprops': getNodeModulesPath(
75
71
  'react-spring/renderprops.cjs.js',
@@ -96,6 +92,7 @@ const jestConfig = {
96
92
  url: `http://localhost:3111${basePath}`,
97
93
  },
98
94
  testEnvironment: 'jsdom',
95
+ watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
99
96
  };
100
97
 
101
98
  if (isReactModule && jestConfig.setupFilesAfterEnv)
@@ -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
+ };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import "jest-styled-components";
3
+ import "@testing-library/jest-dom/extend-expect";
4
+ global.React = React;
@@ -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 = [
@@ -18,7 +18,9 @@ console.error = (...args) => {
18
18
  "Warning: The tag <%s> is unrecognized in this browser",
19
19
  "Warning: Invalid arguments supplied to oneOf"
20
20
  ];
21
- if (ignoreList.find((ignoreMsg) => !!args.find((arg) => arg?.includes?.(ignoreMsg))))
21
+ if (ignoreList.find(
22
+ (ignoreMsg) => !!args.find((arg) => arg?.includes?.(ignoreMsg))
23
+ ))
22
24
  return false;
23
25
  return originalError(...args);
24
26
  };