@elliemae/pui-cli 6.0.0-beta.25 → 6.0.0-beta.29

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.
@@ -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
 
@@ -21,18 +20,10 @@ async function handler(argv) {
21
20
  if (argv.r) commandOptions += ' --bail --findRelatedTests';
22
21
  if (argv.s) commandOptions += ' --silent';
23
22
  try {
24
- // if (!CI) {
25
- // try {
26
- // await lintJS();
27
- // await lintCSS();
28
- // logSuccess('Linting completed');
29
- // } catch (err) {
30
- // logError('Linting failed');
31
- // exit(-1, err);
32
- // return -1;
33
- // }
34
- // }
35
- await exec('rimraf ./reports');
23
+ if (CI) {
24
+ await exec('rimraf ./reports');
25
+ }
26
+
36
27
  // eslint-disable-next-line jest/valid-title, jest/no-disabled-tests, jest/expect-expect
37
28
  await test(commandOptions);
38
29
  logSuccess('Unit test execution completed');
@@ -1,5 +1,6 @@
1
1
  const path = require('path');
2
2
  const { getAppConfig, getAssetPath } = require('../webpack/helpers');
3
+ const swcrcConfig = require('../transpile/swcrc.config.js');
3
4
 
4
5
  const name = '@elliemae/pui-cli';
5
6
  const rootDir = path.join('<rootDir>', 'node_modules', name);
@@ -66,25 +67,35 @@ const jestConfig = {
66
67
  '@elliemae/pui-user-monitoring': `${getRootDir()}/lib/testing/mocks/pui-user-monitoring.js`,
67
68
  '@elliemae/pui-app-loader': `${getRootDir()}/lib/testing/mocks/pui-app-loader.js`,
68
69
  '@elliemae/pui-diagnostics': `${getRootDir()}/lib/testing/mocks/pui-diagnostics.js`,
70
+ 'react-spring/web': '<rootDir>/node_modules/react-spring/web.cjs.js',
71
+ 'react-spring/renderprops':
72
+ '<rootDir>/node_modules/react-spring/renderprops.cjs.js',
69
73
  'styled-components':
70
74
  '<rootDir>/node_modules/styled-components/dist/styled-components.cjs.js',
71
75
  },
76
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
72
77
  setupFilesAfterEnv: [`${getRootDir()}/lib/testing/setup-tests.js`],
73
78
  setupFiles: ['raf/polyfill', 'whatwg-fetch'],
74
79
  testRegex: '(app|lib).*/tests/.*\\.test\\.[jt]sx?$',
75
80
  snapshotSerializers: [],
76
81
  testResultsProcessor: 'jest-sonar-reporter',
77
- resolver: 'ts-jest-resolver',
82
+ resolver: path.resolve(__dirname, './resolver.js'),
78
83
  transform: {
79
- '^.+\\.[jt]sx?$': [
80
- 'esbuild-jest',
81
- {
82
- target: 'node14',
83
- },
84
- ],
84
+ '^.+\\.[jt]sx?$': ['@swc/jest', swcrcConfig],
85
85
  },
86
+ // transform: {
87
+ // '^.+\\.[jt]sx?$': [
88
+ // 'esbuild-jest',
89
+ // {
90
+ // target: 'es2020',
91
+ // loaders: {
92
+ // '.js': 'jsx',
93
+ // },
94
+ // },
95
+ // ],
96
+ // },
86
97
  transformIgnorePatterns: [
87
- 'node_modules/(?!(@elliemae/pui-cli/lib/testing/*)/)',
98
+ 'node_modules/(?!(@elliemae/pui-cli|lodash-es|react-select|react-dates)/)',
88
99
  ],
89
100
  globals: {
90
101
  APP_CONFIG: getAppConfig(),
@@ -96,6 +107,6 @@ const jestConfig = {
96
107
 
97
108
  if (isReactModule && jestConfig.setupFilesAfterEnv)
98
109
  jestConfig.setupFilesAfterEnv.push(
99
- `${getRootDir()}/lib/testing/setup-styled-components-tests.js`,
110
+ `${getRootDir()}/lib/testing/setup-react-env.js`,
100
111
  );
101
112
  module.exports = jestConfig;
@@ -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,3 @@
1
+ import * as React from 'react';
2
+ import 'jest-styled-components';
3
+ global.React = React;
@@ -8,6 +8,29 @@ import ResizeObserver from 'resize-observer-polyfill';
8
8
  import addMatchMedia from './mocks/matchMedia.js';
9
9
  import { logger } from './mocks/pui-diagnostics.js';
10
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
+ };
33
+
11
34
  if (expect) expect.extend(jestAxe.toHaveNoViolations);
12
35
  jest.setTimeout(60000);
13
36
 
@@ -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
+ }
@@ -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
+ module.exports = merge(localConfig, projectConfig);
@@ -185,16 +185,17 @@ const isGoogleTagManagerEnabled = () => {
185
185
  return !!appConfig?.googleTagManager;
186
186
  };
187
187
 
188
- const getCompressionPlugins = () => {
188
+ const getCompressionPlugins = (isLibrary = false) => {
189
+ const excludeList = [
190
+ /\/adrum-ext/,
191
+ /\/emuiUserMonitoring/,
192
+ /\/emuiDiagnostics/,
193
+ /\/emuiAppLoader/,
194
+ /\/encwLoader/,
195
+ ];
189
196
  const commonConfig = {
190
197
  test: /\.(js|css)$/,
191
- exclude: [
192
- /\/adrum-ext/,
193
- /\/emuiUserMonitoring/,
194
- /\/emuiDiagnostics/,
195
- /\/emuiAppLoader/,
196
- /\/encwLoader/,
197
- ],
198
+ exclude: !isLibrary ? excludeList : [],
198
199
  // 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
199
200
  minRatio: Number.MAX_SAFE_INTEGER,
200
201
  };
@@ -62,7 +62,7 @@ module.exports = require('./webpack.lib.base.babel')({
62
62
  chunkFilename: `css/${libraryName}.[contenthash].chunk.css`,
63
63
  }),
64
64
 
65
- ...getCompressionPlugins(),
65
+ ...getCompressionPlugins(true),
66
66
 
67
67
  new BundleAnalyzerPlugin({
68
68
  analyzerMode: 'static',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "6.0.0-beta.25",
3
+ "version": "6.0.0-beta.29",
4
4
  "private": false,
5
5
  "description": "ICE MT UI Platform CLI",
6
6
  "sideEffects": false,
@@ -48,49 +48,52 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@babel/cli": "~7.16.0",
51
- "@babel/core": "~7.16.0",
52
- "@babel/eslint-parser": "~7.16.3",
53
- "@babel/node": "~7.16.0",
54
- "@babel/plugin-proposal-class-properties": "~7.16.0",
55
- "@babel/plugin-proposal-export-default-from": "~7.16.0",
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.0",
58
- "@babel/plugin-transform-react-constant-elements": "~7.16.0",
59
- "@babel/plugin-transform-react-inline-elements": "~7.16.0",
60
- "@babel/plugin-transform-react-jsx-source": "~7.16.0",
61
- "@babel/plugin-transform-runtime": "~7.16.4",
62
- "@babel/preset-env": "~7.16.4",
63
- "@babel/preset-react": "~7.16.0",
64
- "@babel/preset-typescript": "~7.16.0",
65
- "@babel/runtime": "~7.16.3",
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",
69
- "@pmmmwh/react-refresh-webpack-plugin": "~0.5.3",
69
+ "@pmmmwh/react-refresh-webpack-plugin": "~0.5.4",
70
70
  "@semantic-release/changelog": "~6.0.1",
71
- "@semantic-release/exec": "~6.0.2",
71
+ "@semantic-release/exec": "~6.0.3",
72
72
  "@semantic-release/git": "~10.0.1",
73
- "@storybook/addon-a11y": "~6.4.8",
74
- "@storybook/addon-essentials": "~6.4.8",
73
+ "@storybook/addon-a11y": "~6.4.9",
74
+ "@storybook/addon-essentials": "~6.4.9",
75
75
  "@storybook/addon-events": "~6.2.9",
76
- "@storybook/addon-interactions": "~6.4.8",
77
- "@storybook/addon-links": "~6.4.8",
78
- "@storybook/addon-storysource": "~6.4.8",
79
- "@storybook/builder-webpack5": "~6.4.8",
80
- "@storybook/manager-webpack5": "~6.4.8",
81
- "@storybook/react": "~6.4.8",
82
- "@storybook/theming": "~6.4.8",
76
+ "@storybook/addon-interactions": "~6.4.9",
77
+ "@storybook/addon-links": "~6.4.9",
78
+ "@storybook/addon-storysource": "~6.4.9",
79
+ "@storybook/builder-webpack5": "~6.4.9",
80
+ "@storybook/manager-webpack5": "~6.4.9",
81
+ "@storybook/react": "~6.4.9",
82
+ "@storybook/theming": "~6.4.9",
83
83
  "@stylelint/postcss-css-in-js": "~0.37.2",
84
- "@svgr/webpack": "~6.1.1",
84
+ "@svgr/webpack": "~6.1.2",
85
+ "@swc/cli": "~0.1.55",
86
+ "@swc/core": "~1.2.122",
87
+ "@swc/jest": "~0.2.15",
85
88
  "@testing-library/jest-dom": "~5.16.1",
86
89
  "@testing-library/react": "~12.1.2",
87
90
  "@testing-library/react-hooks": "~7.0.2",
88
91
  "@types/jest": "~27.0.3",
89
- "@types/node": "~16.11.12",
92
+ "@types/node": "~17.0.4",
90
93
  "@types/rimraf": "~3.0.2",
91
94
  "@types/testing-library__jest-dom": "~5.14.2",
92
- "@typescript-eslint/eslint-plugin": "~5.6.0",
93
- "@typescript-eslint/parser": "~5.6.0",
95
+ "@typescript-eslint/eslint-plugin": "~5.8.0",
96
+ "@typescript-eslint/parser": "~5.8.0",
94
97
  "autoprefixer": "~10.4.0",
95
98
  "axe-core": "~4.3.5",
96
99
  "babel-loader": "~8.2.3",
@@ -104,32 +107,33 @@
104
107
  "babel-plugin-styled-components": "~2.0.2",
105
108
  "babel-plugin-transform-react-remove-prop-types": "~0.4.24",
106
109
  "babel-plugin-transform-remove-console": "~6.9.4",
107
- "babel-plugin-transform-strip-block": "~0.0.4",
108
- "body-parser": "~1.19.0",
109
- "browserslist": "~4.18.1",
110
+ "babel-plugin-transform-strip-block": "~0.0.5",
111
+ "body-parser": "~1.19.1",
112
+ "browserslist": "~4.19.1",
110
113
  "bundlesize": "~0.18.1",
111
114
  "case-sensitive-paths-webpack-plugin": "~2.4.0",
112
115
  "chalk": "~4.1.2",
113
116
  "circular-dependency-plugin": "~5.2.2",
114
117
  "classnames": "~2.3.1",
115
- "compare-versions": "~4.1.1",
118
+ "compare-versions": "~4.1.2",
116
119
  "compression": "~1.7.4",
117
- "compression-webpack-plugin": "~9.0.1",
118
- "copy-webpack-plugin": "~10.0.0",
120
+ "compression-webpack-plugin": "~9.2.0",
121
+ "copy-webpack-plugin": "~10.2.0",
119
122
  "cors": "~2.8.5",
120
123
  "cross-env": "~7.0.3",
121
124
  "css-loader": "~6.5.1",
122
- "css-minimizer-webpack-plugin": "~3.2.0",
125
+ "css-minimizer-webpack-plugin": "~3.3.1",
123
126
  "depcheck": "~1.4.2",
124
127
  "docdash": "~1.2.0",
125
128
  "dotenv": "~10.0.0",
126
129
  "dotenv-webpack": "~7.0.3",
127
130
  "duplicate-package-checker-webpack-plugin": "~3.0.0",
128
- "esbuild": "~0.14.2",
131
+ "enhanced-resolve": "~5.8.3",
132
+ "esbuild": "~0.14.8",
129
133
  "esbuild-jest": "~0.5.0",
130
- "esbuild-loader": "~2.16.0",
131
- "esbuild-plugin-svgr": "~0.0.3",
132
- "eslint": "~8.4.1",
134
+ "esbuild-loader": "~2.18.0",
135
+ "esbuild-plugin-svgr": "~1.0.0",
136
+ "eslint": "~8.5.0",
133
137
  "eslint-config-airbnb": "~18.2.1",
134
138
  "eslint-config-airbnb-base": "~15.0.0",
135
139
  "eslint-config-airbnb-typescript": "~15.0.0",
@@ -142,19 +146,19 @@
142
146
  "eslint-plugin-eslint-comments": "~3.2.0",
143
147
  "eslint-plugin-import": "~2.25.3",
144
148
  "eslint-plugin-jest": "~25.3.0",
145
- "eslint-plugin-jsdoc": "~37.1.0",
149
+ "eslint-plugin-jsdoc": "~37.4.0",
146
150
  "eslint-plugin-jsx-a11y": "~6.5.1",
147
151
  "eslint-plugin-mdx": "~1.16.0",
148
152
  "eslint-plugin-prettier": "~4.0.0",
149
- "eslint-plugin-react": "~7.27.1",
153
+ "eslint-plugin-react": "~7.28.0",
150
154
  "eslint-plugin-react-hooks": "~4.3.0",
151
- "eslint-plugin-redux-saga": "~1.2.1",
152
- "eslint-plugin-storybook": "~0.5.3",
155
+ "eslint-plugin-redux-saga": "~1.3.2",
156
+ "eslint-plugin-storybook": "~0.5.5",
153
157
  "eslint-plugin-testing-library": "~5.0.1",
154
158
  "eslint-plugin-wdio": "~7.4.2",
155
159
  "express-static-gzip": "~2.1.1",
156
160
  "execa": "~5.1.1",
157
- "express": "~4.17.1",
161
+ "express": "~4.17.2",
158
162
  "express-pino-logger": "~7.0.0",
159
163
  "favicons": "~6.2.2",
160
164
  "favicons-webpack-plugin": "~5.0.2",
@@ -169,33 +173,33 @@
169
173
  "imports-loader": "~3.1.1",
170
174
  "ip": "~1.1.5",
171
175
  "jest-axe": "~5.0.1",
172
- "jest-cli": "~27.4.3",
176
+ "jest-cli": "~27.4.5",
173
177
  "jest-sonar-reporter": "~2.0.0",
174
178
  "jest-styled-components": "~7.0.8",
175
179
  "jscodeshift": "~0.13.0",
176
180
  "jsdoc": "~3.6.7",
177
- "lint-staged": "~12.1.2",
181
+ "lint-staged": "~12.1.4",
178
182
  "mini-css-extract-plugin": "~2.4.5",
179
183
  "minimist": "~1.2.5",
180
184
  "moment": "~2.29.1",
181
185
  "moment-locales-webpack-plugin": "~1.2.0",
182
- "msw": "~0.36.1",
186
+ "msw": "~0.36.3",
183
187
  "node-gyp": "~8.4.1",
184
188
  "node-plop": "~0.30.0",
185
189
  "nodemon": "~2.0.15",
186
- "npm-check-updates": "12.0.3",
190
+ "npm-check-updates": "12.0.5",
187
191
  "null-loader": "~4.0.1",
188
- "pino": "~7.5.1",
189
- "pino-pretty": "~7.2.0",
192
+ "pino": "~7.6.1",
193
+ "pino-pretty": "~7.3.0",
190
194
  "pinst": "~2.1.6",
191
- "plop": "~3.0.2",
192
- "postcss": "~8.4.4",
195
+ "plop": "~3.0.5",
196
+ "postcss": "~8.4.5",
193
197
  "postcss-jsx": "~0.36.4",
194
198
  "postcss-html": "~1.3.0",
195
199
  "postcss-markdown": "~1.2.0",
196
200
  "postcss-syntax": "~0.36.2",
197
201
  "postcss-loader": "~6.2.1",
198
- "postcss-preset-env": "~7.0.1",
202
+ "postcss-preset-env": "~7.1.0",
199
203
  "prettier": "~2.5.1",
200
204
  "pug": "~3.0.2",
201
205
  "pug-loader": "~2.4.0",
@@ -211,35 +215,35 @@
211
215
  "script-loader": "~0.7.2",
212
216
  "semantic-release": "~18.0.1",
213
217
  "shelljs": "~0.8.4",
214
- "slackify-markdown": "~4.3.0",
215
- "storybook-builder-vite": "~0.1.10",
218
+ "slackify-markdown": "~4.3.1",
219
+ "storybook-builder-vite": "~0.1.12",
216
220
  "storybook-addon-turbo-build": "~1.0.1",
217
221
  "storybook-react-router": "~1.0.8",
218
222
  "style-loader": "~3.3.1",
219
- "stylelint": "~14.1.0",
223
+ "stylelint": "~14.2.0",
220
224
  "stylelint-config-recommended": "~6.0.0",
221
225
  "stylelint-config-styled-components": "~0.1.1",
222
226
  "stylelint-custom-processor-loader": "~0.6.0",
223
227
  "stylelint-processor-styled-components": "~1.10.0",
224
228
  "svg-url-loader": "~7.1.1",
225
229
  "svgo": "~2.8.0",
226
- "terser-webpack-plugin": "~5.2.5",
227
- "ts-jest-resolver": "~2.0.0",
230
+ "swc-loader": "~0.1.15",
231
+ "terser-webpack-plugin": "~5.3.0",
228
232
  "ts-node": "~10.4.0",
229
- "tsc-alias": "~1.4.2",
233
+ "tsc-alias": "~1.5.0",
230
234
  "tsc-files": "~1.1.3",
231
235
  "tsconfig-paths": "~3.12.0",
232
236
  "tsconfig-paths-webpack-plugin": "~3.5.2",
233
237
  "type-fest": "~2.8.0",
234
- "typescript": "~4.5.2",
238
+ "typescript": "~4.5.4",
235
239
  "update-notifier": "~5.1.0",
236
240
  "url-loader": "~4.1.1",
237
241
  "uuid": "~8.3.2",
238
- "vite": "~2.6.14",
242
+ "vite": "~2.7.6",
239
243
  "webpack": "~5.65.0",
240
244
  "webpack-bundle-analyzer": "~4.5.0",
241
245
  "webpack-cli": "~4.9.1",
242
- "webpack-dev-middleware": "~5.2.2",
246
+ "webpack-dev-middleware": "~5.3.0",
243
247
  "webpack-hot-middleware": "~2.25.1",
244
248
  "webpack-manifest-plugin": "~4.0.2",
245
249
  "webpack-merge": "~5.8.0",
@@ -247,7 +251,7 @@
247
251
  "webpack-strip-block": "~0.3.0",
248
252
  "whatwg-fetch": "~3.6.2",
249
253
  "workbox-webpack-plugin": "~6.4.2",
250
- "yargs": "~17.3.0"
254
+ "yargs": "~17.3.1"
251
255
  },
252
256
  "devDependencies": {
253
257
  "redux": "~4.1.2",
@@ -1 +0,0 @@
1
- import 'jest-styled-components';