@elliemae/pui-cli 5.22.0 → 5.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli-commands/test.js +1 -12
- package/lib/testing/jest.config.js +2 -3
- package/lib/testing/resolver.js +44 -0
- package/lib/testing/setup-tests.js +25 -2
- package/lib/webpack/helpers.js +9 -8
- package/lib/webpack/webpack.base.babel.js +0 -13
- package/lib/webpack/webpack.lib.base.babel.js +0 -13
- package/lib/webpack/webpack.lib.prod.babel.js +1 -1
- package/package.json +33 -34
- package/lib/testing/jest-resolver.js +0 -16
package/lib/cli-commands/test.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const { exit } = require('yargs');
|
|
2
2
|
const { exec, logError, logSuccess } = require('./utils');
|
|
3
|
-
const { lintCSS, lintJS } = require('./lint');
|
|
4
3
|
|
|
5
4
|
const { CI = false } = process.env;
|
|
6
5
|
|
|
@@ -19,17 +18,7 @@ async function handler(argv) {
|
|
|
19
18
|
if (argv.r) commandOptions += ' --bail --findRelatedTests';
|
|
20
19
|
if (argv.s) commandOptions += ' --silent';
|
|
21
20
|
try {
|
|
22
|
-
if (
|
|
23
|
-
try {
|
|
24
|
-
await lintJS();
|
|
25
|
-
await lintCSS();
|
|
26
|
-
logSuccess('Linting completed');
|
|
27
|
-
} catch (err) {
|
|
28
|
-
logError('Linting failed');
|
|
29
|
-
exit(-1, err);
|
|
30
|
-
return -1;
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
21
|
+
if (CI) {
|
|
33
22
|
await exec('rimraf ./reports');
|
|
34
23
|
}
|
|
35
24
|
|
|
@@ -74,10 +74,9 @@ const jestConfig = {
|
|
|
74
74
|
testRegex: '(app|lib).*/tests/.*\\.test\\.(js|ts|tsx|jsx)$',
|
|
75
75
|
snapshotSerializers: [],
|
|
76
76
|
testResultsProcessor: 'jest-sonar-reporter',
|
|
77
|
-
resolver: '
|
|
77
|
+
resolver: path.resolve(__dirname, './resolver.js'),
|
|
78
78
|
transformIgnorePatterns: [
|
|
79
|
-
'node_modules/(?!(@elliemae
|
|
80
|
-
'node_modules/@elliemae/em-platform-document-viewer',
|
|
79
|
+
'node_modules/(?!(@elliemae/em-platform-document-viewer|@elliemae/pui-cli|@elliemae/pui-app-widgets|lodash-es|react-spring|react-select|react-dates|@babel/runtime)/)',
|
|
81
80
|
],
|
|
82
81
|
globals: {
|
|
83
82
|
APP_CONFIG: getAppConfig(),
|
|
@@ -0,0 +1,44 @@
|
|
|
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 importResolver = require('enhanced-resolve').create.sync({
|
|
17
|
+
conditionNames: ['import', 'node', 'default'],
|
|
18
|
+
extensions: ['.js', '.jsx', '.json', '.node', '.ts', '.tsx'],
|
|
19
|
+
});
|
|
20
|
+
const requireResolver = require('enhanced-resolve').create.sync({
|
|
21
|
+
conditionNames: ['require', 'node', 'default'],
|
|
22
|
+
extensions: ['.js', '.jsx', '.json', '.node', '.ts', '.tsx'],
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
module.exports = (request, options) => {
|
|
26
|
+
let resolver = requireResolver;
|
|
27
|
+
if (options.conditions?.includes('import')) {
|
|
28
|
+
resolver = importResolver;
|
|
29
|
+
}
|
|
30
|
+
const resolution = resolutions.find(({ matcher }) => matcher.test(request));
|
|
31
|
+
if (resolution) {
|
|
32
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
33
|
+
for (const extension of resolution.extensions) {
|
|
34
|
+
try {
|
|
35
|
+
return resolver(
|
|
36
|
+
options.basedir,
|
|
37
|
+
request.replace(resolution.matcher, extension),
|
|
38
|
+
);
|
|
39
|
+
// eslint-disable-next-line no-empty
|
|
40
|
+
} catch {}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return resolver(options.basedir, request);
|
|
44
|
+
};
|
|
@@ -5,8 +5,31 @@ import 'regenerator-runtime/runtime';
|
|
|
5
5
|
import '@testing-library/jest-dom/extend-expect';
|
|
6
6
|
import { toHaveNoViolations } from 'jest-axe';
|
|
7
7
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
8
|
-
import addMatchMedia from '
|
|
9
|
-
import { logger } from '
|
|
8
|
+
import addMatchMedia from '@elliemae/pui-cli/lib/testing/mocks/matchMedia';
|
|
9
|
+
import { logger } from '@elliemae/pui-cli/lib/testing/mocks/pui-diagnostics';
|
|
10
|
+
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
12
|
+
const originalError = console.error;
|
|
13
|
+
// eslint-disable-next-line no-console
|
|
14
|
+
console.error = (...args) => {
|
|
15
|
+
const ignoreList = [
|
|
16
|
+
`Warning: Can't perform a React state update on an unmounted component`,
|
|
17
|
+
`Warning: Function components cannot be given refs`,
|
|
18
|
+
`Warning: Failed %s type:`,
|
|
19
|
+
`Warning: Invalid DOM property`,
|
|
20
|
+
`Warning: Each child in a list should have a unique`,
|
|
21
|
+
'Warning: Received `%s` for a non-boolean attribute',
|
|
22
|
+
'Warning: <%s /> is using incorrect casing.',
|
|
23
|
+
'Warning: The tag <%s> is unrecognized in this browser',
|
|
24
|
+
];
|
|
25
|
+
if (
|
|
26
|
+
ignoreList.find(
|
|
27
|
+
(ignoreMsg) => !!args.find((arg) => arg.includes?.(ignoreMsg)),
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
return false;
|
|
31
|
+
return originalError(...args);
|
|
32
|
+
};
|
|
10
33
|
|
|
11
34
|
if (expect) expect.extend(toHaveNoViolations);
|
|
12
35
|
jest.setTimeout(60000);
|
package/lib/webpack/helpers.js
CHANGED
|
@@ -187,16 +187,17 @@ const isGoogleTagManagerEnabled = () => {
|
|
|
187
187
|
return !!appConfig?.googleTagManager;
|
|
188
188
|
};
|
|
189
189
|
|
|
190
|
-
const getCompressionPlugins = () => {
|
|
190
|
+
const getCompressionPlugins = (isLibrary = false) => {
|
|
191
|
+
const excludeList = [
|
|
192
|
+
/\/adrum-ext/,
|
|
193
|
+
/\/emuiUserMonitoring/,
|
|
194
|
+
/\/emuiDiagnostics/,
|
|
195
|
+
/\/emuiAppLoader/,
|
|
196
|
+
/\/encwLoader/,
|
|
197
|
+
];
|
|
191
198
|
const commonConfig = {
|
|
192
199
|
test: /\.(js|css)$/,
|
|
193
|
-
exclude: [
|
|
194
|
-
/\/adrum-ext/,
|
|
195
|
-
/\/emuiUserMonitoring/,
|
|
196
|
-
/\/emuiDiagnostics/,
|
|
197
|
-
/\/emuiAppLoader/,
|
|
198
|
-
/\/encwLoader/,
|
|
199
|
-
],
|
|
200
|
+
exclude: !isLibrary ? excludeList : [],
|
|
200
201
|
// we are compressing all files since in aws cloudfront edge lambda, we don't want to whitelist files that are not compressed due to below limits
|
|
201
202
|
minRatio: Number.MAX_SAFE_INTEGER,
|
|
202
203
|
};
|
|
@@ -7,7 +7,6 @@ const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack
|
|
|
7
7
|
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
|
8
8
|
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
9
9
|
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
|
|
10
|
-
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
11
10
|
|
|
12
11
|
const {
|
|
13
12
|
excludeNodeModulesExcept,
|
|
@@ -16,7 +15,6 @@ const {
|
|
|
16
15
|
getAlias,
|
|
17
16
|
getPaths,
|
|
18
17
|
} = require('./helpers');
|
|
19
|
-
const { isTypeScriptEnabled } = require('../typescript/util');
|
|
20
18
|
|
|
21
19
|
// get the application configuration
|
|
22
20
|
const devMode = process.env.NODE_ENV !== 'production';
|
|
@@ -103,17 +101,6 @@ const plugins = [
|
|
|
103
101
|
new WebpackManifestPlugin(),
|
|
104
102
|
];
|
|
105
103
|
|
|
106
|
-
if (isTypeScriptEnabled()) {
|
|
107
|
-
plugins.push(
|
|
108
|
-
new ForkTsCheckerWebpackPlugin({
|
|
109
|
-
async: devMode,
|
|
110
|
-
eslint: {
|
|
111
|
-
files: './app/**/*.{ts,js,tsx,jsx}',
|
|
112
|
-
},
|
|
113
|
-
}),
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
104
|
module.exports = (options) => ({
|
|
118
105
|
mode: options.mode,
|
|
119
106
|
entry: options.entry,
|
|
@@ -10,7 +10,6 @@ const PostcssPresetEnv = require('postcss-preset-env');
|
|
|
10
10
|
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
|
|
11
11
|
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
|
12
12
|
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
13
|
-
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
14
13
|
const ResolveTypeScriptPlugin = require('resolve-typescript-plugin').default;
|
|
15
14
|
|
|
16
15
|
const {
|
|
@@ -21,7 +20,6 @@ const {
|
|
|
21
20
|
getAssetPath,
|
|
22
21
|
getAlias,
|
|
23
22
|
} = require('./helpers');
|
|
24
|
-
const { isTypeScriptEnabled } = require('../typescript/util');
|
|
25
23
|
|
|
26
24
|
const devMode = process.env.NODE_ENV !== 'production';
|
|
27
25
|
const minicssLoader = {
|
|
@@ -62,17 +60,6 @@ const plugins = [
|
|
|
62
60
|
new MomentLocalesPlugin(),
|
|
63
61
|
];
|
|
64
62
|
|
|
65
|
-
if (isTypeScriptEnabled()) {
|
|
66
|
-
plugins.push(
|
|
67
|
-
new ForkTsCheckerWebpackPlugin({
|
|
68
|
-
async: devMode,
|
|
69
|
-
eslint: {
|
|
70
|
-
files: './lib/**/*.{ts,js,tsx,jsx}',
|
|
71
|
-
},
|
|
72
|
-
}),
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
63
|
module.exports = (options) => ({
|
|
77
64
|
mode: options.mode,
|
|
78
65
|
entry: [path.join(process.cwd(), 'lib/index')],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "EllieMae Platform UI CLI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -48,21 +48,21 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/cli": "~7.16.0",
|
|
51
|
-
"@babel/core": "~7.16.
|
|
52
|
-
"@babel/eslint-parser": "~7.16.
|
|
53
|
-
"@babel/node": "~7.16.
|
|
54
|
-
"@babel/plugin-proposal-class-properties": "~7.16.
|
|
55
|
-
"@babel/plugin-proposal-export-default-from": "~7.16.
|
|
51
|
+
"@babel/core": "~7.16.5",
|
|
52
|
+
"@babel/eslint-parser": "~7.16.5",
|
|
53
|
+
"@babel/node": "~7.16.5",
|
|
54
|
+
"@babel/plugin-proposal-class-properties": "~7.16.5",
|
|
55
|
+
"@babel/plugin-proposal-export-default-from": "~7.16.5",
|
|
56
56
|
"@babel/plugin-syntax-dynamic-import": "~7.8.3",
|
|
57
|
-
"@babel/plugin-transform-modules-commonjs": "~7.16.
|
|
58
|
-
"@babel/plugin-transform-react-constant-elements": "~7.16.
|
|
59
|
-
"@babel/plugin-transform-react-inline-elements": "~7.16.
|
|
60
|
-
"@babel/plugin-transform-react-jsx-source": "~7.16.
|
|
61
|
-
"@babel/plugin-transform-runtime": "~7.16.
|
|
62
|
-
"@babel/preset-env": "~7.16.
|
|
63
|
-
"@babel/preset-react": "~7.16.
|
|
64
|
-
"@babel/preset-typescript": "~7.16.
|
|
65
|
-
"@babel/runtime": "~7.16.
|
|
57
|
+
"@babel/plugin-transform-modules-commonjs": "~7.16.5",
|
|
58
|
+
"@babel/plugin-transform-react-constant-elements": "~7.16.5",
|
|
59
|
+
"@babel/plugin-transform-react-inline-elements": "~7.16.5",
|
|
60
|
+
"@babel/plugin-transform-react-jsx-source": "~7.16.5",
|
|
61
|
+
"@babel/plugin-transform-runtime": "~7.16.5",
|
|
62
|
+
"@babel/preset-env": "~7.16.5",
|
|
63
|
+
"@babel/preset-react": "~7.16.5",
|
|
64
|
+
"@babel/preset-typescript": "~7.16.5",
|
|
65
|
+
"@babel/runtime": "~7.16.5",
|
|
66
66
|
"@commitlint/cli": "~15.0.0",
|
|
67
67
|
"@commitlint/config-conventional": "~15.0.0",
|
|
68
68
|
"@elliemae/browserslist-config-elliemae": "~1.2.1",
|
|
@@ -88,16 +88,16 @@
|
|
|
88
88
|
"@storybook/react": "~6.3.12",
|
|
89
89
|
"@storybook/theming": "~6.3.12",
|
|
90
90
|
"@stylelint/postcss-css-in-js": "~0.37.2",
|
|
91
|
-
"@svgr/webpack": "~6.1.
|
|
91
|
+
"@svgr/webpack": "~6.1.2",
|
|
92
92
|
"@testing-library/jest-dom": "~5.16.1",
|
|
93
93
|
"@testing-library/react": "~12.1.2",
|
|
94
94
|
"@testing-library/react-hooks": "~7.0.2",
|
|
95
95
|
"@types/jest": "~27.0.3",
|
|
96
|
-
"@types/node": "~16.11.
|
|
96
|
+
"@types/node": "~16.11.13",
|
|
97
97
|
"@types/rimraf": "~3.0.2",
|
|
98
98
|
"@types/testing-library__jest-dom": "~5.14.2",
|
|
99
|
-
"@typescript-eslint/eslint-plugin": "~5.
|
|
100
|
-
"@typescript-eslint/parser": "~5.
|
|
99
|
+
"@typescript-eslint/eslint-plugin": "~5.7.0",
|
|
100
|
+
"@typescript-eslint/parser": "~5.7.0",
|
|
101
101
|
"autoprefixer": "~10.4.0",
|
|
102
102
|
"axe-core": "~4.3.5",
|
|
103
103
|
"babel-loader": "~8.2.3",
|
|
@@ -112,17 +112,17 @@
|
|
|
112
112
|
"babel-plugin-transform-react-remove-prop-types": "~0.4.24",
|
|
113
113
|
"babel-plugin-transform-remove-console": "~6.9.4",
|
|
114
114
|
"babel-plugin-transform-strip-block": "~0.0.4",
|
|
115
|
-
"body-parser": "~1.19.
|
|
116
|
-
"browserslist": "~4.
|
|
115
|
+
"body-parser": "~1.19.1",
|
|
116
|
+
"browserslist": "~4.19.1",
|
|
117
117
|
"bundlesize": "~0.18.1",
|
|
118
118
|
"case-sensitive-paths-webpack-plugin": "~2.4.0",
|
|
119
119
|
"chalk": "~4.1.2",
|
|
120
120
|
"circular-dependency-plugin": "~5.2.2",
|
|
121
121
|
"classnames": "~2.3.1",
|
|
122
|
-
"compare-versions": "~4.1.
|
|
122
|
+
"compare-versions": "~4.1.2",
|
|
123
123
|
"compression": "~1.7.4",
|
|
124
|
-
"compression-webpack-plugin": "~9.
|
|
125
|
-
"copy-webpack-plugin": "~10.
|
|
124
|
+
"compression-webpack-plugin": "~9.1.2",
|
|
125
|
+
"copy-webpack-plugin": "~10.1.0",
|
|
126
126
|
"cors": "~2.8.5",
|
|
127
127
|
"cross-env": "~7.0.3",
|
|
128
128
|
"css-loader": "~6.5.1",
|
|
@@ -146,13 +146,13 @@
|
|
|
146
146
|
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
147
147
|
"eslint-plugin-import": "~2.25.3",
|
|
148
148
|
"eslint-plugin-jest": "~25.3.0",
|
|
149
|
-
"eslint-plugin-jsdoc": "~37.
|
|
149
|
+
"eslint-plugin-jsdoc": "~37.2.2",
|
|
150
150
|
"eslint-plugin-jsx-a11y": "~6.5.1",
|
|
151
151
|
"eslint-plugin-mdx": "~1.16.0",
|
|
152
152
|
"eslint-plugin-prettier": "~4.0.0",
|
|
153
153
|
"eslint-plugin-react": "~7.27.1",
|
|
154
154
|
"eslint-plugin-react-hooks": "~4.3.0",
|
|
155
|
-
"eslint-plugin-redux-saga": "~1.2
|
|
155
|
+
"eslint-plugin-redux-saga": "~1.3.2",
|
|
156
156
|
"eslint-plugin-testing-library": "~5.0.1",
|
|
157
157
|
"eslint-plugin-wdio": "~7.4.2",
|
|
158
158
|
"execa": "~5.1.1",
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"imports-loader": "~3.1.1",
|
|
171
171
|
"ip": "~1.1.5",
|
|
172
172
|
"jest-axe": "~5.0.1",
|
|
173
|
-
"jest-cli": "~27.4.
|
|
173
|
+
"jest-cli": "~27.4.5",
|
|
174
174
|
"jest-sonar-reporter": "~2.0.0",
|
|
175
175
|
"jest-styled-components": "~7.0.8",
|
|
176
176
|
"jscodeshift": "~0.13.0",
|
|
@@ -180,17 +180,17 @@
|
|
|
180
180
|
"minimist": "~1.2.5",
|
|
181
181
|
"moment": "~2.29.1",
|
|
182
182
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
183
|
-
"msw": "~0.36.
|
|
183
|
+
"msw": "~0.36.3",
|
|
184
184
|
"node-gyp": "~8.4.1",
|
|
185
185
|
"node-plop": "~0.30.0",
|
|
186
186
|
"nodemon": "~2.0.15",
|
|
187
187
|
"npm-check-updates": "12.0.3",
|
|
188
188
|
"null-loader": "~4.0.1",
|
|
189
189
|
"pino": "~7.5.1",
|
|
190
|
-
"pino-pretty": "~7.
|
|
190
|
+
"pino-pretty": "~7.3.0",
|
|
191
191
|
"pinst": "~2.1.6",
|
|
192
|
-
"plop": "~3.0.
|
|
193
|
-
"postcss": "~8.4.
|
|
192
|
+
"plop": "~3.0.5",
|
|
193
|
+
"postcss": "~8.4.5",
|
|
194
194
|
"postcss-jsx": "~0.36.4",
|
|
195
195
|
"postcss-html": "~1.3.0",
|
|
196
196
|
"postcss-markdown": "~1.2.0",
|
|
@@ -223,14 +223,13 @@
|
|
|
223
223
|
"svg-url-loader": "~7.1.1",
|
|
224
224
|
"svgo": "~2.8.0",
|
|
225
225
|
"terser-webpack-plugin": "~5.2.5",
|
|
226
|
-
"ts-jest-resolver": "~2.0.0",
|
|
227
226
|
"ts-node": "~10.4.0",
|
|
228
|
-
"tsc-alias": "~1.
|
|
227
|
+
"tsc-alias": "~1.5.0",
|
|
229
228
|
"tsc-files": "~1.1.3",
|
|
230
229
|
"tsconfig-paths": "~3.12.0",
|
|
231
230
|
"tsconfig-paths-webpack-plugin": "~3.5.2",
|
|
232
231
|
"type-fest": "~2.8.0",
|
|
233
|
-
"typescript": "~4.5.
|
|
232
|
+
"typescript": "~4.5.4",
|
|
234
233
|
"update-notifier": "~5.1.0",
|
|
235
234
|
"url-loader": "~4.1.1",
|
|
236
235
|
"uuid": "~8.3.2",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const importResolver = require('enhanced-resolve').create.sync({
|
|
2
|
-
conditionNames: ['import', 'node', 'default'],
|
|
3
|
-
extensions: ['.js', '.json', '.node', '.ts'],
|
|
4
|
-
});
|
|
5
|
-
const requireResolver = require('enhanced-resolve').create.sync({
|
|
6
|
-
conditionNames: ['require', 'node', 'default'],
|
|
7
|
-
extensions: ['.js', '.json', '.node', '.ts'],
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
module.exports = (request, options) => {
|
|
11
|
-
let resolver = requireResolver;
|
|
12
|
-
if (options.conditions?.includes('import')) {
|
|
13
|
-
resolver = importResolver;
|
|
14
|
-
}
|
|
15
|
-
return resolver(options.basedir, request);
|
|
16
|
-
};
|