@elliemae/pui-cli 9.0.0-next.14 → 9.0.0-next.16

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 (73) hide show
  1. package/dist/cjs/commands/lint.js +26 -7
  2. package/dist/cjs/commands/start.js +1 -1
  3. package/dist/cjs/commands/test.js +2 -2
  4. package/dist/cjs/commands/utils.js +3 -1
  5. package/dist/cjs/lint-config/eslint/common.cjs +3 -2
  6. package/dist/cjs/lint-config/eslint/typescript/common.cjs +3 -3
  7. package/dist/cjs/lint-config/stylelint.config.cjs +14 -13
  8. package/dist/cjs/monorepo/delete-merged-tags.js +1 -1
  9. package/dist/cjs/monorepo/set-registry-version.js +1 -1
  10. package/dist/cjs/monorepo/set-workspace-version.js +1 -1
  11. package/dist/cjs/server/csp.js +1 -1
  12. package/dist/cjs/server/utils.js +2 -2
  13. package/dist/cjs/testing/jest.config.cjs +2 -0
  14. package/dist/cjs/testing/setup-test-env.js +1 -1
  15. package/dist/cjs/testing/setup-tests.js +23 -2
  16. package/dist/cjs/transpile/esbuild.js +1 -1
  17. package/dist/cjs/update-notifier.js +1 -1
  18. package/dist/cjs/utils.js +1 -1
  19. package/dist/cjs/webpack/helpers.js +8 -6
  20. package/dist/cjs/webpack/webpack.base.babel.js +4 -4
  21. package/dist/cjs/webpack/webpack.dev.babel.js +1 -1
  22. package/dist/cjs/webpack/webpack.lib.base.babel.js +4 -4
  23. package/dist/cjs/webpack/webpack.lib.dev.babel.js +1 -1
  24. package/dist/cjs/webpack/webpack.storybook.js +2 -2
  25. package/dist/esm/commands/lint.js +27 -7
  26. package/dist/esm/commands/start.js +1 -1
  27. package/dist/esm/commands/test.js +2 -2
  28. package/dist/esm/commands/utils.js +3 -1
  29. package/dist/esm/lint-config/eslint/common.cjs +3 -2
  30. package/dist/esm/lint-config/eslint/typescript/common.cjs +3 -3
  31. package/dist/esm/lint-config/stylelint.config.cjs +14 -13
  32. package/dist/esm/monorepo/delete-merged-tags.js +1 -1
  33. package/dist/esm/monorepo/set-registry-version.js +1 -1
  34. package/dist/esm/monorepo/set-workspace-version.js +1 -1
  35. package/dist/esm/server/csp.js +1 -1
  36. package/dist/esm/server/utils.js +2 -2
  37. package/dist/esm/testing/jest.config.cjs +2 -0
  38. package/dist/esm/testing/setup-test-env.js +1 -1
  39. package/dist/esm/testing/setup-tests.js +23 -2
  40. package/dist/esm/transpile/esbuild.js +1 -1
  41. package/dist/esm/update-notifier.js +1 -1
  42. package/dist/esm/utils.js +1 -1
  43. package/dist/esm/webpack/helpers.js +8 -6
  44. package/dist/esm/webpack/webpack.base.babel.js +4 -4
  45. package/dist/esm/webpack/webpack.dev.babel.js +1 -1
  46. package/dist/esm/webpack/webpack.lib.base.babel.js +4 -4
  47. package/dist/esm/webpack/webpack.lib.dev.babel.js +1 -1
  48. package/dist/esm/webpack/webpack.storybook.js +2 -2
  49. package/dist/types/commands/build.d.ts +2 -2
  50. package/dist/types/commands/codemod.d.ts +2 -2
  51. package/dist/types/commands/lint.d.ts +3 -2
  52. package/dist/types/commands/pack.d.ts +2 -2
  53. package/dist/types/commands/start.d.ts +2 -2
  54. package/dist/types/commands/storybook.d.ts +2 -2
  55. package/dist/types/commands/test.d.ts +2 -2
  56. package/dist/types/commands/tscheck.d.ts +2 -2
  57. package/dist/types/commands/utils.d.ts +2 -1
  58. package/dist/types/commands/version.d.ts +2 -2
  59. package/dist/types/commands/vitest.d.ts +2 -2
  60. package/dist/types/lint-config/eslint/common.d.cts +8 -2
  61. package/dist/types/lint-config/eslint/non-react.d.cts +8 -1
  62. package/dist/types/lint-config/eslint/react.d.cts +8 -1
  63. package/dist/types/lint-config/eslint/typescript/common.d.cts +1 -1
  64. package/dist/types/lint-config/eslint/typescript/non-react.d.cts +9 -2
  65. package/dist/types/lint-config/eslint/typescript/react.d.cts +9 -2
  66. package/dist/types/lint-config/lint-staged.config.d.ts +3 -3
  67. package/dist/types/lint-config/stylelint.config.d.cts +2 -2
  68. package/dist/types/server/csp.d.ts +2 -2
  69. package/dist/types/testing/jest.config.d.cts +2 -0
  70. package/dist/types/testing/jest.node.config.d.cts +2 -0
  71. package/dist/types/testing/vitest.config.d.ts +1 -1
  72. package/dist/types/webpack/helpers.d.ts +1 -1
  73. package/package.json +113 -112
@@ -32,10 +32,19 @@ __export(lint_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(lint_exports);
34
34
  var import_node_path = __toESM(require("node:path"), 1);
35
+ var import_node_util = require("node:util");
35
36
  var import_yargs = __toESM(require("yargs"), 1);
36
37
  var import_utils = require("./utils.js");
37
- const lintCSS = async (fix = false) => {
38
- const fixIssues = fix ? "--fix" : "";
38
+ const lintCSS = async (args) => {
39
+ const fixIssues = args.fix ? "--fix" : "";
40
+ if (args.debug) {
41
+ const configPath = import_node_path.default.join(process.cwd(), "stylelint.config.cjs");
42
+ const config = await import(configPath);
43
+ (0, import_utils.logInfo)("stylelint version:");
44
+ await (0, import_utils.exec)(`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} --version`);
45
+ (0, import_utils.logInfo)("stylelint config:");
46
+ (0, import_utils.logInfo)((0, import_node_util.inspect)(config, { depth: null }));
47
+ }
39
48
  await (0, import_utils.exec)(
40
49
  `stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} ${!(0, import_utils.getCIEnv)() ? "--color" : "--no-color"} --allow-empty-input --config ${import_node_path.default.join(
41
50
  process.cwd(),
@@ -43,10 +52,11 @@ const lintCSS = async (fix = false) => {
43
52
  )}`
44
53
  );
45
54
  };
46
- const lintJS = async (fix = false) => {
47
- const fixIssues = fix ? "--fix" : "";
55
+ const lintJS = async (args) => {
56
+ const fixIssues = args.fix ? "--fix" : "";
57
+ const debugFlags = args.debug ? "--env-info --debug" : "";
48
58
  await (0, import_utils.exec)(
49
- `eslint ${!(0, import_utils.getCIEnv)() ? "--color" : "--no-color"} ${fixIssues} .`
59
+ `eslint ${!(0, import_utils.getCIEnv)() ? "--color" : "--no-color"} ${fixIssues} ${debugFlags} .`
50
60
  );
51
61
  };
52
62
  const cmdArgs = {
@@ -64,6 +74,11 @@ const cmdArgs = {
64
74
  boolean: true,
65
75
  alias: "fix",
66
76
  default: false
77
+ },
78
+ debug: {
79
+ boolean: true,
80
+ alias: "debug",
81
+ default: false
67
82
  }
68
83
  };
69
84
  const lintCmd = {
@@ -73,10 +88,12 @@ const lintCmd = {
73
88
  await (0, import_utils.exec)("tsc --noEmit --emitDeclarationOnly false");
74
89
  try {
75
90
  await (0, import_utils.exec)("rimraf ./reports/eslint.json");
76
- await lintJS(argv.fix);
91
+ await lintJS({ ...argv });
77
92
  (0, import_utils.logSuccess)("JS linting completed");
78
93
  } catch (err) {
79
94
  (0, import_utils.logError)("JS linting failed");
95
+ if (argv.debug)
96
+ (0, import_utils.logError)(err);
80
97
  (0, import_yargs.default)().exit(-1, err);
81
98
  return;
82
99
  }
@@ -84,10 +101,12 @@ const lintCmd = {
84
101
  if (argv.css) {
85
102
  try {
86
103
  await (0, import_utils.exec)("rimraf ./reports/stylelint.json");
87
- await lintCSS(argv.fix);
104
+ await lintCSS({ ...argv });
88
105
  (0, import_utils.logSuccess)("CSS linting completed");
89
106
  } catch (err) {
90
107
  (0, import_utils.logError)("CSS linting failed");
108
+ if (argv.debug)
109
+ (0, import_utils.logError)(err);
91
110
  (0, import_yargs.default)().exit(-1, err);
92
111
  }
93
112
  }
@@ -39,7 +39,7 @@ const import_meta = {};
39
39
  const __dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
40
40
  const startProdServer = async () => {
41
41
  await (0, import_utils.exec)(
42
- `cross-env NODE_ENV=production node --no-warnings=ExperimentalWarning --loader ts-node/esm ${import_node_path.default.resolve(
42
+ `cross-env NODE_ENV=production tsx ${import_node_path.default.resolve(
43
43
  __dirname,
44
44
  "../server/index.js"
45
45
  )} --color always`
@@ -78,9 +78,9 @@ const testCmd = {
78
78
  handler: async (argv) => {
79
79
  let commandOptions = "--coverage --maxWorkers=50%";
80
80
  if (argv.fix)
81
- commandOptions = "-u";
81
+ commandOptions += " -u";
82
82
  else if (argv.watch)
83
- commandOptions = "--watchAll";
83
+ commandOptions += " --watchAll";
84
84
  if ((0, import_utils.getCIEnv)())
85
85
  commandOptions += " --ci --no-colors";
86
86
  if (argv.passWithNoTests)
@@ -37,6 +37,7 @@ __export(utils_exports, {
37
37
  logError: () => logError,
38
38
  logInfo: () => logInfo,
39
39
  logSuccess: () => logSuccess,
40
+ logWarning: () => logWarning,
40
41
  writeAppInfo: () => writeAppInfo
41
42
  });
42
43
  module.exports = __toCommonJS(utils_exports);
@@ -61,6 +62,7 @@ const browsersMapping = {
61
62
  };
62
63
  const exec = async (command, options = { stdio: "inherit" }) => (0, import_execa.execaCommand)(command, options);
63
64
  const logInfo = console.log;
65
+ const logWarning = (...args) => console.log(import_chalk.default.yellow(...args));
64
66
  const logSuccess = (...args) => console.log(import_chalk.default.green(...args));
65
67
  const logError = console.error;
66
68
  const readPackageLock = async () => {
@@ -82,7 +84,7 @@ const getSupportedBrowsers = async () => {
82
84
  return browserVersions.reduce((acc, nameVersion) => {
83
85
  const [name, version] = nameVersion.split(" ");
84
86
  const versionRange = version.split("-");
85
- acc[browsersMapping[name]] = versionRange && versionRange[0] || version;
87
+ acc[browsersMapping[name]] = versionRange?.[0] ?? version;
86
88
  return acc;
87
89
  }, {});
88
90
  };
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable max-lines */
2
- const prettierOptions = require("../prettier.config.cjs");
2
+ const { prettierConfig } = require("../prettier.config.cjs");
3
3
  // const webpackConfig = require('../../webpack/webpack.prod.babel');
4
4
 
5
5
  exports.baseExtends = [
@@ -26,7 +26,7 @@ exports.baseOverrides = [
26
26
  ];
27
27
 
28
28
  const baseRules = {
29
- "prettier/prettier": ["error", prettierOptions],
29
+ "prettier/prettier": ["error", prettierConfig],
30
30
  "arrow-body-style": [2, "as-needed"],
31
31
  "class-methods-use-this": 0,
32
32
  "import/imports-first": 0,
@@ -152,6 +152,7 @@ exports.baseConfig = {
152
152
  },
153
153
  ignorePatterns: [
154
154
  "/build/**/*",
155
+ "/node_modules/**/*",
155
156
  "/dist/**/*",
156
157
  "/reports/**/*",
157
158
  "/coverage/**/*",
@@ -1,9 +1,9 @@
1
1
  const { baseExtends, basePlugins } = require('../common.cjs');
2
2
 
3
3
  exports.tsBaseExtends = [
4
- 'plugin:@typescript-eslint/recommended',
5
4
  'plugin:import/typescript',
6
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
5
+ 'plugin:@typescript-eslint/recommended-type-checked',
6
+ 'plugin:@typescript-eslint/stylistic-type-checked',
7
7
  ].concat(baseExtends);
8
8
 
9
9
  exports.tsBaseRules = {
@@ -34,7 +34,7 @@ exports.tsBaseConfig = {
34
34
  plugins: ['@typescript-eslint'].concat(basePlugins),
35
35
  parserOptions: {
36
36
  tsconfigRootDir: process.cwd(),
37
- project: 'tsconfig.json',
37
+ project: true,
38
38
  },
39
39
  settings: {
40
40
  'import/resolver': {
@@ -1,19 +1,20 @@
1
1
  exports.stylelintConfig = {
2
2
  ignoreFiles: [
3
- '/dist/**/*',
4
- '/coverage/**/*',
5
- '/build/**/*',
6
- '/reports/**/*',
7
- '/temp/**/*',
8
- '/docs/**/*',
9
- '/demo/**/*',
10
- '/node_modules/**/*',
11
- '/vendor/**/*',
3
+ "/dist/**/*",
4
+ "/coverage/**/*",
5
+ "/build/**/*",
6
+ "/reports/**/*",
7
+ "/temp/**/*",
8
+ "/docs/**/*",
9
+ "/demo/**/*",
10
+ "/node_modules/**/*",
11
+ "/vendor/**/*",
12
12
  ],
13
- customSyntax: '@stylelint/postcss-css-in-js',
13
+ customSyntax: "@stylelint/postcss-css-in-js",
14
+ // customSyntax: "postcss-styled-components", // '@stylelint/postcss-css-in-js' is deprecated, this may be a replacement?
14
15
  extends: [
15
- 'stylelint-config-recommended',
16
- 'stylelint-config-styled-components',
16
+ "stylelint-config-recommended",
17
+ "stylelint-config-styled-components",
17
18
  ],
18
- rules: { 'selector-type-no-unknown': null, 'function-no-unknown': null },
19
+ rules: { "selector-type-no-unknown": null, "function-no-unknown": null },
19
20
  };
@@ -26,7 +26,7 @@ const cwd = process.cwd();
26
26
  const execaOptions = { cwd, stdio: "inherit" };
27
27
  const semVerRegEx = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
28
28
  const isSemVersion = (tagName) => semVerRegEx.test(tagName);
29
- const branchName = (process.env.BRANCH_NAME || "master").toLowerCase();
29
+ const branchName = (process.env.BRANCH_NAME ?? "master").toLowerCase();
30
30
  const branchTags = {
31
31
  master: /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/,
32
32
  next: /^v.*-next\.(0|[1-9]\d*)/,
@@ -35,7 +35,7 @@ var import_promises = require("node:fs/promises");
35
35
  var import_fast_glob = __toESM(require("fast-glob"), 1);
36
36
  var import_normalize_path = __toESM(require("normalize-path"), 1);
37
37
  var import_utils = require("./utils.js");
38
- const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)() || "");
38
+ const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)() ?? "");
39
39
  const setRegistryVersion = async () => {
40
40
  const files = await (0, import_fast_glob.default)([
41
41
  `${monorepoRoot}/libs/*/package.json`,
@@ -35,7 +35,7 @@ var import_promises = require("node:fs/promises");
35
35
  var import_fast_glob = __toESM(require("fast-glob"), 1);
36
36
  var import_normalize_path = __toESM(require("normalize-path"), 1);
37
37
  var import_utils = require("./utils.js");
38
- const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)() || "");
38
+ const monorepoRoot = (0, import_normalize_path.default)((0, import_utils.findMonoRepoRoot)() ?? "");
39
39
  const setWorkspaceVersion = async () => {
40
40
  const files = await (0, import_fast_glob.default)([
41
41
  `${monorepoRoot}/libs/*/package.json`,
@@ -34,9 +34,9 @@ __export(csp_exports, {
34
34
  module.exports = __toCommonJS(csp_exports);
35
35
  var import_node_fs = __toESM(require("node:fs"), 1);
36
36
  var import_node_path = __toESM(require("node:path"), 1);
37
+ var import_crypto = __toESM(require("crypto"), 1);
37
38
  var import_express = __toESM(require("express"), 1);
38
39
  var import_helmet_csp = __toESM(require("helmet-csp"), 1);
39
- var import_crypto = __toESM(require("crypto"), 1);
40
40
  const CSP_REPORT_URI = "/diagnostics/v1/csp";
41
41
  const sources = [
42
42
  "'self'",
@@ -37,7 +37,7 @@ var import_minimist = __toESM(require("minimist"), 1);
37
37
  const argv = (0, import_minimist.default)(process.argv.slice(2));
38
38
  const getCWD = () => process.cwd();
39
39
  const port = parseInt(
40
- argv.port || process.env.port || process.env.PORT || "3000",
40
+ argv.port ?? process.env.port ?? process.env.PORT ?? "3000",
41
41
  10
42
42
  );
43
- const host = argv.host || process.env.HOST || "localhost";
43
+ const host = argv.host ?? process.env.HOST ?? "localhost";
@@ -57,6 +57,8 @@ const jestConfig = {
57
57
  coverageReporters: ['lcov', 'html', 'text-summary'],
58
58
  moduleDirectories: ['node_modules', 'app', 'lib'],
59
59
  moduleNameMapper: {
60
+ d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
61
+ '^d3-(.*)$': '<rootDir>/node_modules/d3-$1/dist/d3-$1.min.js',
60
62
  '.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.js'),
61
63
  '.*\\.(css|scss)$': getMockFilePath('cssModule.js'),
62
64
  '.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
@@ -2,7 +2,7 @@
2
2
  var import_vitest = require("vitest");
3
3
  var import_jest_styled_components = require("jest-styled-components");
4
4
  var import_react = require("@testing-library/react");
5
- var import_extend_expect = require("@testing-library/jest-dom/extend-expect");
5
+ var import_jest_globals = require("@testing-library/jest-dom/jest-globals");
6
6
  (0, import_vitest.afterEach)(() => {
7
7
  (0, import_react.cleanup)();
8
8
  });
@@ -21,9 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
22
  mod
23
23
  ));
24
- var import_stable = require("core-js/stable");
25
24
  var import_runtime = require("regenerator-runtime/runtime");
26
- var import_extend_expect = require("@testing-library/jest-dom/extend-expect");
25
+ var import_jest_globals = require("@testing-library/jest-dom/jest-globals");
27
26
  var import_jest_axe = __toESM(require("jest-axe"), 1);
28
27
  var import_resize_observer_polyfill = __toESM(require("resize-observer-polyfill"), 1);
29
28
  var import_matchMedia = require("./mocks/matchMedia.js");
@@ -72,3 +71,25 @@ window.emui = {
72
71
  logger: (0, import_pui_diagnostics.logger)(),
73
72
  _BASE_PATH: new URL(document.baseURI).pathname
74
73
  };
74
+ let showCorejsWarn = false;
75
+ afterAll(() => {
76
+ if (showCorejsWarn) {
77
+ console.warn(
78
+ `IMPORTANT: Try importing core-js/stable in your failed test files and retrying.
79
+ Some tests might have failed because of it`
80
+ );
81
+ }
82
+ });
83
+ const originalTest = global.test;
84
+ global.it = (name, fn, timeout = void 0) => {
85
+ const fnWrapper = async () => {
86
+ try {
87
+ await fn();
88
+ } catch (error) {
89
+ showCorejsWarn = true;
90
+ throw error;
91
+ }
92
+ };
93
+ originalTest(name, fnWrapper, timeout);
94
+ };
95
+ global.it.skip = originalTest.skip;
@@ -34,9 +34,9 @@ __export(esbuild_exports, {
34
34
  module.exports = __toCommonJS(esbuild_exports);
35
35
  var import_node_path = __toESM(require("node:path"), 1);
36
36
  var import_node_url = require("node:url");
37
+ var import_promises = require("node:fs/promises");
37
38
  var import_fast_glob = __toESM(require("fast-glob"), 1);
38
39
  var import_esbuild = require("esbuild");
39
- var import_promises = require("node:fs/promises");
40
40
  var import_browserslist_to_esbuild = __toESM(require("browserslist-to-esbuild"), 1);
41
41
  var import_esbuild_plugin_lodash = __toESM(require("esbuild-plugin-lodash"), 1);
42
42
  const import_meta = {};
@@ -31,9 +31,9 @@ __export(update_notifier_exports, {
31
31
  notifyUpdates: () => notifyUpdates
32
32
  });
33
33
  module.exports = __toCommonJS(update_notifier_exports);
34
- var import_update_notifier = __toESM(require("update-notifier"), 1);
35
34
  var import_node_path = __toESM(require("node:path"), 1);
36
35
  var import_promises = __toESM(require("node:fs/promises"), 1);
36
+ var import_update_notifier = __toESM(require("update-notifier"), 1);
37
37
  const notifyUpdates = async () => {
38
38
  const pkgFile = await import_promises.default.readFile(import_node_path.default.join(process.cwd(), "./package.json"));
39
39
  const pkg = JSON.parse(pkgFile);
package/dist/cjs/utils.js CHANGED
@@ -35,7 +35,7 @@ __export(utils_exports, {
35
35
  module.exports = __toCommonJS(utils_exports);
36
36
  var import_node_fs = __toESM(require("node:fs"), 1);
37
37
  var import_node_path = __toESM(require("node:path"), 1);
38
- const basePath = (process.env.BASE_PATH || "/").replace(/\/?$/, "/");
38
+ const basePath = (process.env.BASE_PATH ?? "/").replace(/\/?$/, "/");
39
39
  const isApp = () => import_node_fs.default.existsSync(import_node_path.default.join(process.cwd(), "app"));
40
40
  const getAppConfig = () => {
41
41
  const appConfigPath = import_node_path.default.join(
@@ -48,9 +48,9 @@ __export(helpers_exports, {
48
48
  module.exports = __toCommonJS(helpers_exports);
49
49
  var import_node_path = __toESM(require("node:path"), 1);
50
50
  var import_node_fs = __toESM(require("node:fs"), 1);
51
+ var import_zlib = __toESM(require("zlib"), 1);
51
52
  var import_lodash = __toESM(require("lodash"), 1);
52
53
  var import_compression_webpack_plugin = __toESM(require("compression-webpack-plugin"), 1);
53
- var import_zlib = __toESM(require("zlib"), 1);
54
54
  var import_utils = require("../monorepo/utils.js");
55
55
  var import_utils2 = require("../utils.js");
56
56
  let pathSep = import_node_path.default.sep;
@@ -64,8 +64,8 @@ const excludeNodeModulesExcept = (modules) => {
64
64
  const moduleRegExps = getNodeModulesRegEx(modules);
65
65
  return function(modulePath) {
66
66
  if (/node_modules/.test(modulePath)) {
67
- for (let i = 0; i < moduleRegExps.length; i += 1)
68
- if (moduleRegExps[i].test(modulePath))
67
+ for (const moduleRegExp of moduleRegExps)
68
+ if (moduleRegExp.test(modulePath))
69
69
  return false;
70
70
  return true;
71
71
  }
@@ -80,7 +80,7 @@ const getLibraryName = () => {
80
80
  const modifiedLibName = `emui-${libraryName.replace("@elliemae/", "").replace("pui-", "")}`;
81
81
  return import_lodash.default.camelCase(modifiedLibName);
82
82
  };
83
- const getLibraryVariableName = () => (process.env.LIBRARY_VARIABLE_NAME || getLibraryName()).split(".");
83
+ const getLibraryVariableName = () => (process.env.LIBRARY_VARIABLE_NAME ?? getLibraryName()).split(".");
84
84
  const mapToFolder = (dependencies, folder) => dependencies.reduce(
85
85
  (acc, dependency) => ({
86
86
  [dependency]: import_node_path.default.resolve(`${folder}/${dependency.replace("$", "")}`),
@@ -89,7 +89,7 @@ const mapToFolder = (dependencies, folder) => dependencies.reduce(
89
89
  {}
90
90
  );
91
91
  const getAlias = () => {
92
- const monorepoRoot = (0, import_utils.findMonoRepoRoot)(process.cwd()) || "";
92
+ const monorepoRoot = (0, import_utils.findMonoRepoRoot)(process.cwd()) ?? "";
93
93
  return mapToFolder(
94
94
  [
95
95
  "@babel/runtime",
@@ -103,6 +103,8 @@ const getAlias = () => {
103
103
  "styled-components",
104
104
  "immer",
105
105
  "react-dates",
106
+ "react-select",
107
+ "react-spring",
106
108
  "react-transition-group",
107
109
  "@elliemae/pui-cli",
108
110
  "@elliemae/pui-app-sdk$",
@@ -173,7 +175,7 @@ const getAppVersion = () => {
173
175
  if (!process.env.APP_VERSION)
174
176
  return LATEST_VERSION;
175
177
  const match = process.env.APP_VERSION.match(/^v?(\d+\.\d+)\..*$/);
176
- return match && match[1] || LATEST_VERSION;
178
+ return match?.[1] ?? LATEST_VERSION;
177
179
  };
178
180
  const getPaths = (latestVersion = true) => {
179
181
  const version = latestVersion ? LATEST_VERSION : getAppVersion();
@@ -284,7 +284,7 @@ const baseConfig = (options) => ({
284
284
  mainFields: ["browser", "module", "main"],
285
285
  alias: {
286
286
  ...(0, import_helpers.getAlias)(),
287
- ...(options.resolve || {}).alias || {}
287
+ ...options.resolve?.alias ?? {}
288
288
  }
289
289
  },
290
290
  externalsPresets: {
@@ -314,7 +314,7 @@ const baseConfig = (options) => ({
314
314
  "styled-system": "emuiAppReactDependencies.styledSystem"
315
315
  // "@xstyled/styled-components": "emuiAppReactDependencies.xstyled",
316
316
  },
317
- devtool: options.devtool || "eval-source-map",
318
- performance: options.performance || {},
319
- devServer: options.devServer || {}
317
+ devtool: options.devtool ?? "eval-source-map",
318
+ performance: options.performance ?? {},
319
+ devServer: options.devServer ?? {}
320
320
  });
@@ -144,7 +144,7 @@ const devConfig = {
144
144
  },
145
145
  hot: true,
146
146
  open: [basePath],
147
- port: process.env.PORT || "auto",
147
+ port: process.env.PORT ?? "auto",
148
148
  setupMiddlewares: (middlewares, devServer) => {
149
149
  if (devServer.app) {
150
150
  (0, import_middlewares.setupDefaultMiddlewares)(devServer.app);
@@ -212,7 +212,7 @@ const baseConfig = (options) => ({
212
212
  mainFields: ["browser", "module", "main"],
213
213
  alias: {
214
214
  ...(0, import_helpers.getAlias)(),
215
- ...(options.resolve || {}).alias || {}
215
+ ...options.resolve?.alias ?? {}
216
216
  },
217
217
  plugins: [new import_resolve_typescript_plugin.default({})]
218
218
  },
@@ -221,7 +221,7 @@ const baseConfig = (options) => ({
221
221
  "@elliemae/pui-app-loader": "emuiAppLoader",
222
222
  "@elliemae/pui-diagnostics": "emuiDiagnostics"
223
223
  },
224
- devtool: options.devtool || "eval-source-map",
225
- performance: options.performance || {},
226
- devServer: options.devServer || {}
224
+ devtool: options.devtool ?? "eval-source-map",
225
+ performance: options.performance ?? {},
226
+ devServer: options.devServer ?? {}
227
227
  });
@@ -89,7 +89,7 @@ var webpack_lib_dev_babel_default = (0, import_webpack_lib_base_babel.baseConfig
89
89
  historyApiFallback: true,
90
90
  hot: true,
91
91
  open: [basePath],
92
- port: process.env.PORT || "auto",
92
+ port: process.env.PORT ?? "auto",
93
93
  headers: {
94
94
  "Access-Control-Allow-Origin": "*",
95
95
  "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS"
@@ -100,11 +100,11 @@ const webpackFinal = (config, { configType }) => {
100
100
  config.resolve.fallback = { ...config.resolve.fallback, crypto: false };
101
101
  config.resolve.extensions?.push(".svg");
102
102
  config.resolve.plugins = [
103
- ...config.resolve.plugins || [],
103
+ ...config.resolve.plugins ?? [],
104
104
  new import_resolve_typescript_plugin.default({})
105
105
  ];
106
106
  }
107
- config.externals = config.externals || {};
107
+ config.externals = config.externals ?? {};
108
108
  if (config.externals) {
109
109
  config.externals["@elliemae/pui-user-monitoring"] = "emuiUserMonitoring";
110
110
  config.externals["@elliemae/pui-app-loader"] = "emuiAppLoader";
@@ -1,14 +1,24 @@
1
1
  import path from "node:path";
2
+ import { inspect } from "node:util";
2
3
  import yargs from "yargs";
3
4
  import {
4
5
  exec,
6
+ logInfo,
5
7
  logError,
6
8
  logSuccess,
7
9
  getCIEnv,
8
10
  isTypeScriptEnabled
9
11
  } from "./utils.js";
10
- const lintCSS = async (fix = false) => {
11
- const fixIssues = fix ? "--fix" : "";
12
+ const lintCSS = async (args) => {
13
+ const fixIssues = args.fix ? "--fix" : "";
14
+ if (args.debug) {
15
+ const configPath = path.join(process.cwd(), "stylelint.config.cjs");
16
+ const config = await import(configPath);
17
+ logInfo("stylelint version:");
18
+ await exec(`stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} --version`);
19
+ logInfo("stylelint config:");
20
+ logInfo(inspect(config, { depth: null }));
21
+ }
12
22
  await exec(
13
23
  `stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} ${!getCIEnv() ? "--color" : "--no-color"} --allow-empty-input --config ${path.join(
14
24
  process.cwd(),
@@ -16,10 +26,11 @@ const lintCSS = async (fix = false) => {
16
26
  )}`
17
27
  );
18
28
  };
19
- const lintJS = async (fix = false) => {
20
- const fixIssues = fix ? "--fix" : "";
29
+ const lintJS = async (args) => {
30
+ const fixIssues = args.fix ? "--fix" : "";
31
+ const debugFlags = args.debug ? "--env-info --debug" : "";
21
32
  await exec(
22
- `eslint ${!getCIEnv() ? "--color" : "--no-color"} ${fixIssues} .`
33
+ `eslint ${!getCIEnv() ? "--color" : "--no-color"} ${fixIssues} ${debugFlags} .`
23
34
  );
24
35
  };
25
36
  const cmdArgs = {
@@ -37,6 +48,11 @@ const cmdArgs = {
37
48
  boolean: true,
38
49
  alias: "fix",
39
50
  default: false
51
+ },
52
+ debug: {
53
+ boolean: true,
54
+ alias: "debug",
55
+ default: false
40
56
  }
41
57
  };
42
58
  const lintCmd = {
@@ -46,10 +62,12 @@ const lintCmd = {
46
62
  await exec("tsc --noEmit --emitDeclarationOnly false");
47
63
  try {
48
64
  await exec("rimraf ./reports/eslint.json");
49
- await lintJS(argv.fix);
65
+ await lintJS({ ...argv });
50
66
  logSuccess("JS linting completed");
51
67
  } catch (err) {
52
68
  logError("JS linting failed");
69
+ if (argv.debug)
70
+ logError(err);
53
71
  yargs().exit(-1, err);
54
72
  return;
55
73
  }
@@ -57,10 +75,12 @@ const lintCmd = {
57
75
  if (argv.css) {
58
76
  try {
59
77
  await exec("rimraf ./reports/stylelint.json");
60
- await lintCSS(argv.fix);
78
+ await lintCSS({ ...argv });
61
79
  logSuccess("CSS linting completed");
62
80
  } catch (err) {
63
81
  logError("CSS linting failed");
82
+ if (argv.debug)
83
+ logError(err);
64
84
  yargs().exit(-1, err);
65
85
  }
66
86
  }
@@ -5,7 +5,7 @@ import { exec, logError, logSuccess, isApp } from "./utils.js";
5
5
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
6
  const startProdServer = async () => {
7
7
  await exec(
8
- `cross-env NODE_ENV=production node --no-warnings=ExperimentalWarning --loader ts-node/esm ${path.resolve(
8
+ `cross-env NODE_ENV=production tsx ${path.resolve(
9
9
  __dirname,
10
10
  "../server/index.js"
11
11
  )} --color always`
@@ -45,9 +45,9 @@ const testCmd = {
45
45
  handler: async (argv) => {
46
46
  let commandOptions = "--coverage --maxWorkers=50%";
47
47
  if (argv.fix)
48
- commandOptions = "-u";
48
+ commandOptions += " -u";
49
49
  else if (argv.watch)
50
- commandOptions = "--watchAll";
50
+ commandOptions += " --watchAll";
51
51
  if (getCIEnv())
52
52
  commandOptions += " --ci --no-colors";
53
53
  if (argv.passWithNoTests)
@@ -31,6 +31,7 @@ const browsersMapping = {
31
31
  };
32
32
  const exec = async (command, options = { stdio: "inherit" }) => execaCommand(command, options);
33
33
  const logInfo = console.log;
34
+ const logWarning = (...args) => console.log(chalk.yellow(...args));
34
35
  const logSuccess = (...args) => console.log(chalk.green(...args));
35
36
  const logError = console.error;
36
37
  const readPackageLock = async () => {
@@ -52,7 +53,7 @@ const getSupportedBrowsers = async () => {
52
53
  return browserVersions.reduce((acc, nameVersion) => {
53
54
  const [name, version] = nameVersion.split(" ");
54
55
  const versionRange = version.split("-");
55
- acc[browsersMapping[name]] = versionRange && versionRange[0] || version;
56
+ acc[browsersMapping[name]] = versionRange?.[0] ?? version;
56
57
  return acc;
57
58
  }, {});
58
59
  };
@@ -186,5 +187,6 @@ export {
186
187
  logError,
187
188
  logInfo,
188
189
  logSuccess,
190
+ logWarning,
189
191
  writeAppInfo
190
192
  };
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable max-lines */
2
- const prettierOptions = require("../prettier.config.cjs");
2
+ const { prettierConfig } = require("../prettier.config.cjs");
3
3
  // const webpackConfig = require('../../webpack/webpack.prod.babel');
4
4
 
5
5
  exports.baseExtends = [
@@ -26,7 +26,7 @@ exports.baseOverrides = [
26
26
  ];
27
27
 
28
28
  const baseRules = {
29
- "prettier/prettier": ["error", prettierOptions],
29
+ "prettier/prettier": ["error", prettierConfig],
30
30
  "arrow-body-style": [2, "as-needed"],
31
31
  "class-methods-use-this": 0,
32
32
  "import/imports-first": 0,
@@ -152,6 +152,7 @@ exports.baseConfig = {
152
152
  },
153
153
  ignorePatterns: [
154
154
  "/build/**/*",
155
+ "/node_modules/**/*",
155
156
  "/dist/**/*",
156
157
  "/reports/**/*",
157
158
  "/coverage/**/*",