@elliemae/pui-cli 9.0.0-next.4 → 9.0.0-next.40

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 (183) hide show
  1. package/app.tsconfig.json +1 -1
  2. package/dist/cjs/commands/lint.js +27 -8
  3. package/dist/cjs/commands/start.js +1 -1
  4. package/dist/cjs/commands/storybook.js +2 -2
  5. package/dist/cjs/commands/test.js +51 -22
  6. package/dist/cjs/commands/utils.js +33 -2
  7. package/dist/cjs/index.cjs +0 -2
  8. package/dist/cjs/index.js +4 -2
  9. package/dist/cjs/lint-config/eslint/common.cjs +3 -2
  10. package/dist/cjs/lint-config/eslint/typescript/common.cjs +3 -3
  11. package/dist/cjs/lint-config/stylelint.config.js +45 -0
  12. package/dist/cjs/monorepo/delete-merged-tags.js +1 -1
  13. package/dist/cjs/monorepo/set-registry-version.js +1 -1
  14. package/dist/cjs/monorepo/set-workspace-version.js +1 -1
  15. package/dist/cjs/pui-config.js +1 -1
  16. package/dist/cjs/release.config.js +46 -0
  17. package/dist/cjs/server/csp.js +2 -1
  18. package/dist/cjs/server/index.js +5 -0
  19. package/dist/cjs/server/utils.js +11 -4
  20. package/dist/cjs/server/wsServer.js +129 -0
  21. package/dist/cjs/testing/ExtendedJSDomEnv.cjs +27 -0
  22. package/dist/cjs/testing/extended/axe-core/getMessageAndPass.js +37 -0
  23. package/dist/cjs/testing/extended/axe-core/index.js +24 -0
  24. package/dist/cjs/testing/extended/axe-core/reporter.js +51 -0
  25. package/dist/cjs/testing/extended/axe-core/shouldIgnoreNodeViolation.js +31 -0
  26. package/dist/cjs/testing/extended/axe-core/toHaveNoViolations.js +43 -0
  27. package/dist/cjs/testing/jest.config.cjs +5 -2
  28. package/dist/cjs/testing/jest.polyfills.cjs +30 -0
  29. package/dist/cjs/testing/setup-test-env.js +0 -2
  30. package/dist/cjs/testing/setup-tests.js +26 -4
  31. package/dist/cjs/testing/vitest.config.js +8 -8
  32. package/dist/cjs/transpile/.swcrc +1 -1
  33. package/dist/cjs/transpile/esbuild.js +4 -4
  34. package/dist/cjs/update-notifier.js +1 -1
  35. package/dist/cjs/utils.js +1 -1
  36. package/dist/cjs/webpack/helpers.js +20 -8
  37. package/dist/cjs/webpack/webpack.base.babel.js +13 -27
  38. package/dist/cjs/webpack/webpack.dev.babel.js +14 -3
  39. package/dist/cjs/webpack/webpack.lib.base.babel.js +13 -5
  40. package/dist/cjs/webpack/webpack.lib.dev.babel.js +8 -12
  41. package/dist/cjs/webpack/webpack.lib.prod.babel.js +7 -6
  42. package/dist/cjs/webpack/webpack.prod.babel.js +3 -2
  43. package/dist/cjs/webpack/webpack.storybook.js +10 -11
  44. package/dist/esm/commands/lint.js +28 -8
  45. package/dist/esm/commands/start.js +1 -1
  46. package/dist/esm/commands/storybook.js +2 -2
  47. package/dist/esm/commands/test.js +51 -22
  48. package/dist/esm/commands/utils.js +33 -2
  49. package/dist/esm/index.cjs +0 -2
  50. package/dist/esm/index.js +4 -2
  51. package/dist/esm/lint-config/eslint/common.cjs +3 -2
  52. package/dist/esm/lint-config/eslint/typescript/common.cjs +3 -3
  53. package/dist/esm/lint-config/stylelint.config.js +25 -0
  54. package/dist/esm/monorepo/delete-merged-tags.js +1 -1
  55. package/dist/esm/monorepo/set-registry-version.js +1 -1
  56. package/dist/esm/monorepo/set-workspace-version.js +1 -1
  57. package/dist/esm/pui-config.js +1 -1
  58. package/dist/esm/release.config.js +26 -0
  59. package/dist/esm/server/csp.js +2 -1
  60. package/dist/esm/server/index.js +6 -1
  61. package/dist/esm/server/utils.js +11 -4
  62. package/dist/esm/server/wsServer.js +99 -0
  63. package/dist/esm/testing/ExtendedJSDomEnv.cjs +27 -0
  64. package/dist/esm/testing/extended/axe-core/getMessageAndPass.js +17 -0
  65. package/dist/esm/testing/extended/axe-core/index.js +4 -0
  66. package/dist/esm/testing/extended/axe-core/reporter.js +31 -0
  67. package/dist/esm/testing/extended/axe-core/shouldIgnoreNodeViolation.js +11 -0
  68. package/dist/esm/testing/extended/axe-core/toHaveNoViolations.js +23 -0
  69. package/dist/esm/testing/jest.config.cjs +5 -2
  70. package/dist/esm/testing/jest.polyfills.cjs +30 -0
  71. package/dist/esm/testing/setup-test-env.js +0 -2
  72. package/dist/esm/testing/setup-tests.js +26 -4
  73. package/dist/esm/testing/vitest.config.js +8 -8
  74. package/dist/esm/transpile/.swcrc +1 -1
  75. package/dist/esm/transpile/esbuild.js +4 -4
  76. package/dist/esm/update-notifier.js +1 -1
  77. package/dist/esm/utils.js +1 -1
  78. package/dist/esm/webpack/helpers.js +20 -8
  79. package/dist/esm/webpack/webpack.base.babel.js +13 -27
  80. package/dist/esm/webpack/webpack.dev.babel.js +14 -3
  81. package/dist/esm/webpack/webpack.lib.base.babel.js +13 -5
  82. package/dist/esm/webpack/webpack.lib.dev.babel.js +9 -13
  83. package/dist/esm/webpack/webpack.lib.prod.babel.js +12 -7
  84. package/dist/esm/webpack/webpack.prod.babel.js +3 -2
  85. package/dist/esm/webpack/webpack.storybook.js +11 -12
  86. package/dist/types/docusaurus.config.d.ts +2 -0
  87. package/dist/types/{babel.config.d.cts → lib/babel.config.d.cts} +7 -7
  88. package/dist/types/{commands → lib/commands}/build.d.ts +2 -2
  89. package/dist/types/{commands → lib/commands}/codemod.d.ts +2 -2
  90. package/dist/types/{commands → lib/commands}/lint.d.ts +3 -2
  91. package/dist/types/{commands → lib/commands}/pack.d.ts +2 -2
  92. package/dist/types/{commands → lib/commands}/start.d.ts +2 -2
  93. package/dist/types/{commands → lib/commands}/storybook.d.ts +2 -2
  94. package/dist/types/{commands → lib/commands}/test.d.ts +4 -2
  95. package/dist/types/{commands → lib/commands}/tscheck.d.ts +2 -2
  96. package/dist/types/lib/commands/utils.d.ts +39 -0
  97. package/dist/types/{commands → lib/commands}/version.d.ts +2 -2
  98. package/dist/types/{commands → lib/commands}/vitest.d.ts +2 -2
  99. package/dist/types/{index.d.cts → lib/index.d.cts} +1 -2
  100. package/dist/types/{index.d.ts → lib/index.d.ts} +3 -1
  101. package/dist/types/{lint-config → lib/lint-config}/commitlint.config.d.cts +1 -1
  102. package/dist/types/{lint-config → lib/lint-config}/eslint/common.d.cts +18 -12
  103. package/dist/types/{lint-config → lib/lint-config}/eslint/non-react.d.cts +8 -1
  104. package/dist/types/{lint-config → lib/lint-config}/eslint/react.d.cts +8 -1
  105. package/dist/types/{lint-config → lib/lint-config}/eslint/typescript/common.d.cts +6 -6
  106. package/dist/types/{lint-config → lib/lint-config}/eslint/typescript/non-react.d.cts +9 -2
  107. package/dist/types/{lint-config → lib/lint-config}/eslint/typescript/react.d.cts +9 -2
  108. package/dist/types/lib/lint-config/lint-staged.config.d.ts +5 -0
  109. package/dist/types/lib/lint-config/prettier.config.d.cts +8 -0
  110. package/dist/types/lib/lint-config/stylelint.config.d.ts +13 -0
  111. package/dist/types/lib/release.config.d.ts +10 -0
  112. package/dist/types/{server → lib/server}/csp.d.ts +2 -2
  113. package/dist/types/{server → lib/server}/utils.d.ts +1 -0
  114. package/dist/types/lib/server/wsServer.d.ts +13 -0
  115. package/dist/types/lib/testing/ExtendedJSDomEnv.d.cts +5 -0
  116. package/dist/types/lib/testing/extended/axe-core/getMessageAndPass.d.ts +8 -0
  117. package/dist/types/lib/testing/extended/axe-core/index.d.ts +1 -0
  118. package/dist/types/lib/testing/extended/axe-core/reporter.d.ts +2 -0
  119. package/dist/types/lib/testing/extended/axe-core/shouldIgnoreNodeViolation.d.ts +2 -0
  120. package/dist/types/lib/testing/extended/axe-core/toHaveNoViolations.d.ts +12 -0
  121. package/dist/types/lib/testing/jest.config.d.cts +44 -0
  122. package/dist/types/{testing → lib/testing}/jest.node.config.d.cts +3 -0
  123. package/dist/types/lib/testing/mocks/axios.d.ts +17 -0
  124. package/dist/types/{testing → lib/testing}/mocks/pui-diagnostics.d.ts +13 -13
  125. package/dist/types/lib/testing/setup-tests.d.ts +1 -0
  126. package/dist/types/lib/testing/vitest.config.d.ts +1 -0
  127. package/dist/types/lib/tests/basic.test.d.ts +0 -0
  128. package/dist/types/{transpile → lib/transpile}/esbuild.d.ts +3 -3
  129. package/dist/types/lib/typedoc.d.cts +3 -0
  130. package/dist/types/{webpack → lib/webpack}/helpers.d.ts +4 -1
  131. package/dist/types/{webpack → lib/webpack}/webpack.storybook.d.ts +0 -1
  132. package/nx.json +97 -0
  133. package/package.json +188 -177
  134. package/dist/cjs/lint-config/stylelint.config.cjs +0 -19
  135. package/dist/cjs/release.config.cjs +0 -24
  136. package/dist/esm/lint-config/stylelint.config.cjs +0 -19
  137. package/dist/esm/release.config.cjs +0 -24
  138. package/dist/types/commands/utils.d.ts +0 -17
  139. package/dist/types/lint-config/lint-staged.config.d.ts +0 -5
  140. package/dist/types/lint-config/prettier.config.d.cts +0 -8
  141. package/dist/types/lint-config/stylelint.config.d.cts +0 -10
  142. package/dist/types/release.config.d.cts +0 -7
  143. package/dist/types/testing/jest.config.d.cts +0 -41
  144. package/dist/types/testing/mocks/axios.d.ts +0 -17
  145. package/dist/types/testing/vitest.config.d.ts +0 -1
  146. package/dist/types/typedoc.d.cts +0 -3
  147. /package/dist/types/{cli.d.ts → lib/cli.d.ts} +0 -0
  148. /package/dist/types/{commands → lib/commands}/gendoc.d.ts +0 -0
  149. /package/dist/types/{dummy.d.ts → lib/dummy.d.ts} +0 -0
  150. /package/dist/types/{monorepo → lib/monorepo}/delete-merged-tags.d.ts +0 -0
  151. /package/dist/types/{monorepo → lib/monorepo}/set-registry-version.d.ts +0 -0
  152. /package/dist/types/{monorepo → lib/monorepo}/set-workspace-version.d.ts +0 -0
  153. /package/dist/types/{monorepo → lib/monorepo}/utils.d.cts +0 -0
  154. /package/dist/types/{monorepo → lib/monorepo}/utils.d.ts +0 -0
  155. /package/dist/types/{pui-config.d.ts → lib/pui-config.d.ts} +0 -0
  156. /package/dist/types/{server → lib/server}/appRoutes.d.ts +0 -0
  157. /package/dist/types/{server → lib/server}/index.d.ts +0 -0
  158. /package/dist/types/{server → lib/server}/logger.d.ts +0 -0
  159. /package/dist/types/{server → lib/server}/middlewares.d.ts +0 -0
  160. /package/dist/types/{testing/setup-react-env.d.ts → lib/testing/jest.polyfills.d.cts} +0 -0
  161. /package/dist/types/{testing → lib/testing}/mocks/cssModule.d.ts +0 -0
  162. /package/dist/types/{testing → lib/testing}/mocks/html.d.ts +0 -0
  163. /package/dist/types/{testing → lib/testing}/mocks/image.d.ts +0 -0
  164. /package/dist/types/{testing → lib/testing}/mocks/matchMedia.d.ts +0 -0
  165. /package/dist/types/{testing → lib/testing}/mocks/pui-app-loader.d.ts +0 -0
  166. /package/dist/types/{testing → lib/testing}/mocks/pui-user-monitoring.d.ts +0 -0
  167. /package/dist/types/{testing → lib/testing}/mocks/retry-axios.d.ts +0 -0
  168. /package/dist/types/{testing → lib/testing}/mocks/svg.d.ts +0 -0
  169. /package/dist/types/{testing → lib/testing}/mocks/webpack-hmr.d.ts +0 -0
  170. /package/dist/types/{testing → lib/testing}/resolver.d.cts +0 -0
  171. /package/dist/types/{testing/setup-test-env.d.ts → lib/testing/setup-react-env.d.ts} +0 -0
  172. /package/dist/types/{testing/setup-tests.d.ts → lib/testing/setup-test-env.d.ts} +0 -0
  173. /package/dist/types/{transpile → lib/transpile}/react-shim.d.ts +0 -0
  174. /package/dist/types/{transpile → lib/transpile}/swcrc.config.d.cts +0 -0
  175. /package/dist/types/{update-notifier.d.ts → lib/update-notifier.d.ts} +0 -0
  176. /package/dist/types/{utils.d.cts → lib/utils.d.cts} +0 -0
  177. /package/dist/types/{utils.d.ts → lib/utils.d.ts} +0 -0
  178. /package/dist/types/{webpack → lib/webpack}/webpack.base.babel.d.ts +0 -0
  179. /package/dist/types/{webpack → lib/webpack}/webpack.dev.babel.d.ts +0 -0
  180. /package/dist/types/{webpack → lib/webpack}/webpack.lib.base.babel.d.ts +0 -0
  181. /package/dist/types/{webpack → lib/webpack}/webpack.lib.dev.babel.d.ts +0 -0
  182. /package/dist/types/{webpack → lib/webpack}/webpack.lib.prod.babel.d.ts +0 -0
  183. /package/dist/types/{webpack → lib/webpack}/webpack.prod.babel.d.ts +0 -0
@@ -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,14 @@ const devConfig = {
130
133
  }
131
134
  next();
132
135
  });
136
+ createWSServer({
137
+ port: wsPort
138
+ }).then(({ wsServer }) => {
139
+ if (devServer.app)
140
+ devServer.app.locals.wsServer = wsServer;
141
+ }).catch((err) => {
142
+ console.error(err);
143
+ });
133
144
  }
134
145
  return middlewares;
135
146
  }
@@ -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: [
@@ -177,7 +185,7 @@ const baseConfig = (options) => ({
177
185
  mainFields: ["browser", "module", "main"],
178
186
  alias: {
179
187
  ...getAlias(),
180
- ...(options.resolve || {}).alias || {}
188
+ ...options.resolve?.alias ?? {}
181
189
  },
182
190
  plugins: [new ResolveTypeScriptPlugin({})]
183
191
  },
@@ -186,9 +194,9 @@ const baseConfig = (options) => ({
186
194
  "@elliemae/pui-app-loader": "emuiAppLoader",
187
195
  "@elliemae/pui-diagnostics": "emuiDiagnostics"
188
196
  },
189
- devtool: options.devtool || "eval-source-map",
190
- performance: options.performance || {},
191
- devServer: options.devServer || {}
197
+ devtool: options.devtool ?? "eval-source-map",
198
+ performance: options.performance ?? {},
199
+ devServer: options.devServer ?? {}
192
200
  });
193
201
  export {
194
202
  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,7 +106,8 @@ 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
113
  if (config.plugins)
@@ -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();
@@ -63,15 +63,22 @@ const webpackFinal = (config, { configType }) => {
63
63
  config.plugins = config?.plugins?.concat(getCompressionPlugins());
64
64
  }
65
65
  if (config.resolve) {
66
- config.resolve.alias = { ...config?.resolve?.alias, ...getAlias() };
66
+ config.resolve.alias = {
67
+ ...config?.resolve?.alias,
68
+ ...getAlias(),
69
+ ...getLibraryAlias(
70
+ "@reduxjs/toolkit/query/react",
71
+ "@reduxjs/toolkit/dist/query/react/rtk-query-react.modern.mjs"
72
+ )
73
+ };
67
74
  config.resolve.fallback = { ...config.resolve.fallback, crypto: false };
68
75
  config.resolve.extensions?.push(".svg");
69
76
  config.resolve.plugins = [
70
- ...config.resolve.plugins || [],
77
+ ...config.resolve.plugins ?? [],
71
78
  new ResolveTypeScriptPlugin({})
72
79
  ];
73
80
  }
74
- config.externals = config.externals || {};
81
+ config.externals = config.externals ?? {};
75
82
  if (config.externals) {
76
83
  config.externals["@elliemae/pui-user-monitoring"] = "emuiUserMonitoring";
77
84
  config.externals["@elliemae/pui-app-loader"] = "emuiAppLoader";
@@ -79,14 +86,6 @@ const webpackFinal = (config, { configType }) => {
79
86
  }
80
87
  return config;
81
88
  };
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
89
  export {
90
- managerWebpack,
91
90
  webpackFinal
92
91
  };
@@ -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>;
@@ -0,0 +1,39 @@
1
+ /// <reference types="node" />
2
+ export declare const exec: (command: string, options?: import("execa").Options<import("execa").BufferEncodingOption> | undefined) => Promise<import("execa").ExecaReturnValue<Buffer>>;
3
+ export declare const logInfo: {
4
+ (...data: any[]): void;
5
+ (message?: any, ...optionalParams: any[]): void;
6
+ };
7
+ export declare const logWarning: (...args: string[]) => void;
8
+ export declare const logSuccess: (...args: string[]) => void;
9
+ export declare const logError: {
10
+ (...data: any[]): void;
11
+ (message?: any, ...optionalParams: any[]): void;
12
+ };
13
+ export declare const writeAppInfo: () => Promise<void>;
14
+ export declare const copyBuildAssetsToVersionedFolder: () => Promise<void>;
15
+ export declare const isPathExist: (pathToCheck: string) => Promise<boolean>;
16
+ export declare const isApp: () => Promise<boolean>;
17
+ export declare const getCIEnv: () => boolean;
18
+ export declare const isTypeScriptEnabled: () => boolean;
19
+ /**
20
+ * argv will generate an object with many assumptions based on the library own functionality.
21
+ * some of those assumptions make it hard to use the ...rest operator to get the options,
22
+ * this function is meant to get the options that are not specificially expected.
23
+ * @param {object} options - the options the command is specifically expecting
24
+ * @param {string} command - the raw command (without the prefix nor tag)
25
+ * @returns {object} - options that were not specifically expected by the command, key are camelCase, values are forced to be strings
26
+ * @example
27
+ * // options {
28
+ * // someOption: { alias: 'my-test', string: true, default:'foo' },
29
+ * // 'hello-world': { boolean: true, default:'bar' },
30
+ * // }
31
+ * // command "test"
32
+ * // user's args string
33
+ * // "test --hello-world -my-test='is-working' --orMaybe=\"it isn't\" is_it='? '--a"
34
+ * // ^ command ^ expected option ^ expected option(alias) | unspecified options...
35
+ * // returns { orMaybe: "it isn't", is_it: '? ', a: true }
36
+ * // note that the unspecified options are forced to be strings, unless boolean (without '=')
37
+ * @see {@link https://stackblitz.com/edit/node-gqcdb4?file=package.json stackblitz test}
38
+ */
39
+ export declare const getUnspecifiedOptions: (options: Record<string, Record<string, unknown>>, command: string) => Record<string, string | boolean>;
@@ -1,9 +1,9 @@
1
1
  import { CommandModule } from 'yargs';
2
- type Arguments = {
2
+ interface Arguments {
3
3
  deleteTags: boolean;
4
4
  useRegistry: boolean;
5
5
  useWorkspace: boolean;
6
6
  lernaOptions?: string;
7
- };
7
+ }
8
8
  export declare const versionCmd: CommandModule<Record<string, never>, Arguments>;
9
9
  export {};
@@ -1,10 +1,10 @@
1
1
  import { CommandModule } from 'yargs';
2
- type Arguments = {
2
+ interface Arguments {
3
3
  fix?: boolean;
4
4
  watch?: boolean;
5
5
  passWithNoTests?: boolean;
6
6
  findReleatedTests?: boolean;
7
7
  silent?: boolean;
8
- };
8
+ }
9
9
  export declare const vitestCmd: CommandModule<Record<string, never>, Arguments>;
10
10
  export {};
@@ -1,9 +1,8 @@
1
1
  import { babelConfig } from "./babel.config.cjs";
2
2
  import { esConfig as eslintBaseConfig } from "./lint-config/eslint/non-react.cjs";
3
3
  import { esReactConfig as eslintConfig } from "./lint-config/eslint/react.cjs";
4
- import { stylelintConfig } from "./lint-config/stylelint.config.cjs";
5
4
  import { prettierConfig } from "./lint-config/prettier.config.cjs";
6
5
  import { commitlintConfig } from "./lint-config/commitlint.config.cjs";
7
6
  import { jestConfig } from "./testing/jest.config.cjs";
8
7
  import { jestNodeConfig } from "./testing/jest.node.config.cjs";
9
- export { babelConfig, eslintBaseConfig, eslintConfig, stylelintConfig, prettierConfig, commitlintConfig, jestConfig, jestNodeConfig };
8
+ export { babelConfig, eslintBaseConfig, eslintConfig, prettierConfig, commitlintConfig, jestConfig, jestNodeConfig };
@@ -1,7 +1,8 @@
1
+ export type LIB_NAME = 'pui-cli';
1
2
  export { babelConfig } from './babel.config.cjs';
2
3
  export { esConfig as eslintBaseConfig } from './lint-config/eslint/non-react.cjs';
3
4
  export { esReactConfig as eslintConfig } from './lint-config/eslint/react.cjs';
4
- export { stylelintConfig } from './lint-config/stylelint.config.cjs';
5
+ export { stylelintConfig } from './lint-config/stylelint.config.js';
5
6
  export { prettierConfig } from './lint-config/prettier.config.cjs';
6
7
  export { commitlintConfig } from './lint-config/commitlint.config.cjs';
7
8
  export { jestConfig } from './testing/jest.config.cjs';
@@ -9,3 +10,4 @@ export { vitestConfig } from './testing/vitest.config.js';
9
10
  export { jestNodeConfig } from './testing/jest.node.config.cjs';
10
11
  export { lintStagedConfig } from './lint-config/lint-staged.config.js';
11
12
  export { loadRoutes } from './server/appRoutes.js';
13
+ export { webpackFinal } from './webpack/webpack.storybook.js';
@@ -1,4 +1,4 @@
1
1
  export namespace commitlintConfig {
2
- const _extends: string[];
2
+ let _extends: string[];
3
3
  export { _extends as extends };
4
4
  }
@@ -6,24 +6,24 @@ export const baseOverrides: {
6
6
  };
7
7
  }[];
8
8
  export namespace baseConfig {
9
- export const parser: string;
9
+ export let parser: string;
10
10
  export { basePlugins as plugins };
11
11
  export namespace env {
12
- const jest: boolean;
13
- const browser: boolean;
14
- const node: boolean;
15
- const es2021: boolean;
12
+ let jest: boolean;
13
+ let browser: boolean;
14
+ let node: boolean;
15
+ let es2021: boolean;
16
16
  }
17
17
  export namespace parserOptions {
18
- const sourceType: string;
18
+ let sourceType: string;
19
19
  namespace ecmaFeatures {
20
- const jsx: boolean;
20
+ let jsx: boolean;
21
21
  }
22
22
  namespace babelOptions {
23
- const plugins: string[];
23
+ let plugins: string[];
24
24
  }
25
25
  }
26
- export const settings: {
26
+ export let settings: {
27
27
  react: {
28
28
  version: string;
29
29
  };
@@ -36,11 +36,18 @@ export namespace baseConfig {
36
36
  };
37
37
  };
38
38
  };
39
- export const ignorePatterns: string[];
39
+ export let ignorePatterns: string[];
40
40
  }
41
41
  export const basePlugins: string[];
42
42
  export const baseRules: {
43
- "prettier/prettier": (string | typeof prettierOptions)[];
43
+ "prettier/prettier": (string | {
44
+ printWidth: number;
45
+ tabWidth: number;
46
+ useTabs: boolean;
47
+ semi: boolean;
48
+ singleQuote: boolean;
49
+ trailingComma: string;
50
+ })[];
44
51
  "arrow-body-style": (string | number)[];
45
52
  "class-methods-use-this": number;
46
53
  "import/imports-first": number;
@@ -127,4 +134,3 @@ export const reactRules: {
127
134
  "redux-saga/no-yield-in-race": number;
128
135
  "redux-saga/yield-effects": number;
129
136
  };
130
- import prettierOptions = require("../prettier.config.cjs");
@@ -1,7 +1,14 @@
1
1
  export const esConfig: {
2
2
  extends: string[];
3
3
  rules: {
4
- "prettier/prettier": (string | typeof import("../prettier.config.cjs"))[];
4
+ "prettier/prettier": (string | {
5
+ printWidth: number;
6
+ tabWidth: number;
7
+ useTabs: boolean;
8
+ semi: boolean;
9
+ singleQuote: boolean;
10
+ trailingComma: string;
11
+ })[];
5
12
  "arrow-body-style": (string | number)[];
6
13
  "class-methods-use-this": number;
7
14
  "import/imports-first": number;