@elliemae/pui-cli 8.29.1 → 8.29.2

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 (49) hide show
  1. package/dist/cjs/babel.config.cjs +97 -0
  2. package/dist/cjs/index.cjs +23 -0
  3. package/dist/cjs/jsdoc.conf.json +17 -0
  4. package/dist/cjs/lint-config/commitlint.config.cjs +1 -0
  5. package/dist/cjs/lint-config/eslint/common.cjs +164 -0
  6. package/dist/cjs/lint-config/eslint/non-react.cjs +14 -0
  7. package/dist/cjs/lint-config/eslint/react.cjs +26 -0
  8. package/dist/cjs/lint-config/eslint/typescript/common.cjs +49 -0
  9. package/dist/cjs/lint-config/eslint/typescript/non-react.cjs +12 -0
  10. package/dist/cjs/lint-config/eslint/typescript/react.cjs +19 -0
  11. package/dist/cjs/lint-config/prettier.config.cjs +8 -0
  12. package/dist/cjs/lint-config/stylelint.config.cjs +20 -0
  13. package/dist/cjs/monorepo/set-registry-version.js +3 -3
  14. package/dist/cjs/monorepo/set-workspace-version.js +3 -3
  15. package/dist/cjs/monorepo/utils.cjs +30 -0
  16. package/dist/cjs/release.config.cjs +24 -0
  17. package/dist/cjs/testing/jest.config.cjs +110 -0
  18. package/dist/cjs/testing/jest.node.config.cjs +8 -0
  19. package/dist/cjs/testing/resolver.cjs +47 -0
  20. package/dist/cjs/transpile/.swcrc +11 -0
  21. package/dist/cjs/transpile/esbuild.js +3 -3
  22. package/dist/cjs/transpile/swcrc.config.cjs +13 -0
  23. package/dist/cjs/typedoc.cjs +12 -0
  24. package/dist/cjs/utils.cjs +23 -0
  25. package/dist/esm/babel.config.cjs +97 -0
  26. package/dist/esm/index.cjs +23 -0
  27. package/dist/esm/jsdoc.conf.json +17 -0
  28. package/dist/esm/lint-config/commitlint.config.cjs +1 -0
  29. package/dist/esm/lint-config/eslint/common.cjs +164 -0
  30. package/dist/esm/lint-config/eslint/non-react.cjs +14 -0
  31. package/dist/esm/lint-config/eslint/react.cjs +26 -0
  32. package/dist/esm/lint-config/eslint/typescript/common.cjs +49 -0
  33. package/dist/esm/lint-config/eslint/typescript/non-react.cjs +12 -0
  34. package/dist/esm/lint-config/eslint/typescript/react.cjs +19 -0
  35. package/dist/esm/lint-config/prettier.config.cjs +8 -0
  36. package/dist/esm/lint-config/stylelint.config.cjs +20 -0
  37. package/dist/esm/monorepo/set-registry-version.js +3 -3
  38. package/dist/esm/monorepo/set-workspace-version.js +3 -3
  39. package/dist/esm/monorepo/utils.cjs +30 -0
  40. package/dist/esm/release.config.cjs +24 -0
  41. package/dist/esm/testing/jest.config.cjs +110 -0
  42. package/dist/esm/testing/jest.node.config.cjs +8 -0
  43. package/dist/esm/testing/resolver.cjs +47 -0
  44. package/dist/esm/transpile/.swcrc +11 -0
  45. package/dist/esm/transpile/esbuild.js +3 -3
  46. package/dist/esm/transpile/swcrc.config.cjs +13 -0
  47. package/dist/esm/typedoc.cjs +12 -0
  48. package/dist/esm/utils.cjs +23 -0
  49. package/package.json +1 -1
@@ -0,0 +1,110 @@
1
+ const path = require('path');
2
+ const normalizePath = require('normalize-path');
3
+ const { getAppConfig, basePath } = require('../utils.cjs');
4
+ const { swcrcConfig } = require('../transpile/swcrc.config.cjs');
5
+ const { findMonoRepoRoot } = require('../monorepo/utils.cjs');
6
+
7
+ let isReactModule = true;
8
+ try {
9
+ /* eslint-disable global-require, import/no-unresolved */
10
+ require('react');
11
+ require('styled-components');
12
+ /* eslint-enable global-require, import/no-unresolved */
13
+ } catch (err) {
14
+ isReactModule = false;
15
+ }
16
+
17
+ const getMockFilePath = (fileName) =>
18
+ normalizePath(path.resolve(__dirname, './mocks', fileName));
19
+
20
+ const getNodeModulesPath = (fileName) => {
21
+ const monorepoRoot = findMonoRepoRoot(process.cwd());
22
+ return normalizePath(
23
+ monorepoRoot
24
+ ? path.join(monorepoRoot, 'node_modules', fileName)
25
+ : `<rootDir>/node_modules/${fileName}`,
26
+ );
27
+ };
28
+
29
+ const jestConfig = {
30
+ collectCoverageFrom: [
31
+ 'app/**/*.{js,ts,jsx,tsx}',
32
+ 'lib/**/*.{js,ts,jsx,tsx}',
33
+ '!app/**/*.d.ts',
34
+ '!lib/**/*.d.ts',
35
+ '!app/**/*.test.{js,ts,jsx,tsx}',
36
+ '!lib/**/*.test.{js,ts,jsx,tsx}',
37
+ '!app/**/*.stories.{js,ts,jsx,tsx}',
38
+ '!lib/**/*.stories.{js,ts,jsx,tsx}',
39
+ '!app/**/*.endpoint.{js,ts,jsx,tsx}',
40
+ '!lib/**/*.endpoint.{js,ts,jsx,tsx}',
41
+ '!app/*/RbGenerated*/*.{js,ts,jsx,tsx}',
42
+ '!app/index.{js,ts,jsx,tsx}',
43
+ '!app/global-styles.{js,ts,jsx,tsx}',
44
+ '!app/**/loadable.{js,ts,jsx,tsx}',
45
+ '!lib/**/loadable.{js,ts,jsx,tsx}',
46
+ ],
47
+ coverageThreshold: {
48
+ // Todo: enable the coverage threshold later
49
+ // global: {
50
+ // statements: 95,
51
+ // branches: 90,
52
+ // functions: 95,
53
+ // lines: 95,
54
+ // },
55
+ },
56
+ coverageDirectory: 'reports',
57
+ coverageReporters: ['lcov', 'html', 'text-summary'],
58
+ moduleDirectories: ['node_modules', 'app', 'lib'],
59
+ moduleNameMapper: {
60
+ d3: '<rootDir>/node_modules/d3/dist/d3.min.js',
61
+ '^d3-(.*)$': '<rootDir>/node_modules/d3-$1/dist/d3-$1.min.js',
62
+ '.*\\webpack-hmr(.[t|j]s)?$': getMockFilePath('webpack-hmr.js'),
63
+ '.*\\.(css|scss)$': getMockFilePath('cssModule.js'),
64
+ '.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico)$':
65
+ getMockFilePath('image.js'),
66
+ '.*\\.svg(?:\\?[a-zA-Z]+)?$': getMockFilePath('svg.js'),
67
+ '.*\\.html(?:\\?[a-zA-Z]+)?$': getMockFilePath('html.js'),
68
+ '@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.js'),
69
+ '@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.js'),
70
+ '@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.js'),
71
+ 'react-spring/web': getNodeModulesPath('react-spring/web.cjs.js'),
72
+ 'react-spring/renderprops': getNodeModulesPath(
73
+ 'react-spring/renderprops.cjs.js',
74
+ ),
75
+ },
76
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
77
+ setupFilesAfterEnv: [path.resolve(__dirname, './setup-tests.js')],
78
+ setupFiles: ['raf/polyfill', 'whatwg-fetch'],
79
+ testRegex: '(app|lib).*/tests/.*\\.test\\.[jt]sx?$',
80
+ snapshotSerializers: [],
81
+ testResultsProcessor: 'jest-sonar-reporter',
82
+ resolver: path.resolve(__dirname, './resolver.cjs'),
83
+ transform: {
84
+ '^.+\\.[jt]sx?$': ['@swc/jest', swcrcConfig],
85
+ },
86
+ transformIgnorePatterns: [
87
+ 'node_modules/(?!(.*@elliemae/pui-cli|lodash-es|react-select|react-dates|d3|internmap|delaunator|robust-predicates)/)',
88
+ ],
89
+ globals: {
90
+ APP_CONFIG: getAppConfig(),
91
+ __webpack_public_path__: '/',
92
+ },
93
+ testEnvironmentOptions: {
94
+ url: `http://localhost:3111${basePath}`,
95
+ resources: 'usable',
96
+ },
97
+ testEnvironment: 'jsdom',
98
+ watchPlugins: [
99
+ 'jest-watch-typeahead/filename',
100
+ 'jest-watch-typeahead/testname',
101
+ ],
102
+ testTimeout: 5000,
103
+ };
104
+
105
+ if (isReactModule && jestConfig.setupFilesAfterEnv)
106
+ jestConfig.setupFilesAfterEnv.push(
107
+ path.resolve(__dirname, './setup-react-env.js'),
108
+ );
109
+
110
+ exports.jestConfig = jestConfig;
@@ -0,0 +1,8 @@
1
+ const { jestConfig } = require('./jest.config.cjs');
2
+ exports.jestNodeConfig = {
3
+ ...jestConfig,
4
+ testEnvironment: 'node',
5
+ transformIgnorePatterns: [],
6
+ setupFiles: [],
7
+ setupFilesAfterEnv: [],
8
+ };
@@ -0,0 +1,47 @@
1
+ const resolutions = [
2
+ {
3
+ matcher: /\.jsx?$/i,
4
+ extensions: ['.tsx', '.ts'],
5
+ },
6
+ {
7
+ matcher: /\.mjs$/i,
8
+ extensions: ['.mts'],
9
+ },
10
+ {
11
+ matcher: /\.cjs$/i,
12
+ extensions: ['.cts'],
13
+ },
14
+ ];
15
+
16
+ const resolveConfig = {
17
+ conditionNames: ['import', 'node', 'default'],
18
+ extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.node'],
19
+ modules: ['node_modules', 'app', 'lib'],
20
+ };
21
+
22
+ const importResolver = require('enhanced-resolve').create.sync(resolveConfig);
23
+ const requireResolver = require('enhanced-resolve').create.sync({
24
+ ...resolveConfig,
25
+ conditionNames: ['require', 'node', 'default'],
26
+ });
27
+
28
+ module.exports = (request, options) => {
29
+ let resolver = requireResolver;
30
+ if (options.conditions?.includes('import')) {
31
+ resolver = importResolver;
32
+ }
33
+ const resolution = resolutions.find(({ matcher }) => matcher.test(request));
34
+ if (resolution) {
35
+ // eslint-disable-next-line no-restricted-syntax
36
+ for (const extension of resolution.extensions) {
37
+ try {
38
+ return resolver(
39
+ options.basedir,
40
+ request.replace(resolution.matcher, extension),
41
+ );
42
+ // eslint-disable-next-line no-empty
43
+ } catch {}
44
+ }
45
+ }
46
+ return resolver(options.basedir, request);
47
+ };
@@ -0,0 +1,11 @@
1
+ {
2
+ "jsc": {
3
+ "parser": {
4
+ "syntax": "typescript",
5
+ "jsx": true,
6
+ "tsx": true,
7
+ "dynamicImport": true
8
+ },
9
+ "target": "es2020"
10
+ }
11
+ }
@@ -28,9 +28,9 @@ const getCommonConfig = ({ injectReactShim }) => ({
28
28
  });
29
29
  const copyFiles = async ({ srcdir, outdir }) => {
30
30
  const files = await fg([
31
- fg.convertPathToPattern(`${srcdir}/**/*.*`),
32
- fg.convertPathToPattern(`${srcdir}/**/.swcrc`),
33
- fg.convertPathToPattern(`!${srcdir}/**/*.{js,jsx,ts,tsx,mjs}`)
31
+ `${srcdir}/**/*.*`,
32
+ `${srcdir}/**/.swcrc`,
33
+ `!${srcdir}/**/*.{js,jsx,ts,tsx,mjs}`
34
34
  ]);
35
35
  await Promise.all(
36
36
  files.map(async (srcFilePath) => {
@@ -0,0 +1,13 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const { merge } = require('lodash');
4
+
5
+ let projectConfig = {};
6
+ const projectPath = path.join(process.cwd(), '.swcrc');
7
+ if (fs.existsSync(projectPath)) {
8
+ projectConfig = JSON.parse(fs.readFileSync(projectPath, 'utf-8'));
9
+ }
10
+ const localConfig = JSON.parse(
11
+ fs.readFileSync(path.join(__dirname, '.swcrc'), 'utf-8'),
12
+ );
13
+ exports.swcrcConfig = merge(localConfig, projectConfig);
@@ -0,0 +1,12 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+
4
+ const isApp = () => fs.existsSync(path.join(process.cwd(), 'app'));
5
+
6
+ const srcPath = path.join(process.cwd(), isApp() ? 'app' : 'lib');
7
+
8
+ module.exports = {
9
+ entryPoints: [srcPath],
10
+ exclude: ['**/*+(.spec|.e2e|.test).ts'],
11
+ out: path.join(process.cwd(), 'docs'),
12
+ };
@@ -0,0 +1,23 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+
4
+ exports.basePath = (process.env.BASE_PATH || '/').replace(/\/?$/, '/');
5
+
6
+ const isApp = () => fs.existsSync(path.join(process.cwd(), 'app'));
7
+
8
+ exports.getAppConfig = () => {
9
+ const appConfigPath = path.join(
10
+ process.cwd(),
11
+ isApp() ? 'app' : 'lib',
12
+ 'app.config.json',
13
+ );
14
+
15
+ if (!fs.existsSync(appConfigPath)) return '{}';
16
+ const appConfig = fs.readFileSync(appConfigPath);
17
+ return appConfig || '{}';
18
+ };
19
+
20
+ exports.isApp = isApp;
21
+
22
+ exports.isTypeScriptEnabled = () =>
23
+ fs.existsSync(path.join(process.cwd(), 'tsconfig.json'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "8.29.1",
3
+ "version": "8.29.2",
4
4
  "description": "ICE MT UI Platform CLI",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/cjs/index.cjs",