@elliemae/pui-cli 5.19.0 → 5.21.1

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.
@@ -42,7 +42,7 @@ async function nodeBuild({ srcPath, commonJS, emitModuleType, target }) {
42
42
  const targetEnv = target === 'node' ? 'TARGET_ENV=node' : '';
43
43
  const babelEnv = commonJS ? ' ES_MODULES=false' : '';
44
44
  await exec(
45
- `cross-env NODE_ENV=production MODULE_EXTENSIONS=true ${targetEnv}${babelEnv} babel --extensions ".ts,.tsx,.js,.jsx" ${srcPath} --out-dir ${outDir} --copy-files --no-copy-ignored --ignore **/*.test.js --ignore **/*.test.ts --ignore **/*.spec.js --ignore **/*.spec.ts --ignore **/*.test.jsx --ignore **/*.test.tsx --ignore **/*.spec.jsx --ignore **/*.spec.tsx`,
45
+ `cross-env NODE_ENV=production MODULE_EXTENSIONS=true ${targetEnv}${babelEnv} babel --extensions ".ts,.tsx,.js,.jsx" ${srcPath} --out-dir ${outDir} --copy-files --no-copy-ignored --ignore **/*.d.ts --ignore **/*.test.js --ignore **/*.test.ts --ignore **/*.spec.js --ignore **/*.spec.ts --ignore **/*.test.jsx --ignore **/*.test.tsx --ignore **/*.spec.jsx --ignore **/*.spec.tsx`,
46
46
  { shell: true, stdio: 'inherit' },
47
47
  );
48
48
  if (emitModuleType) {
@@ -74,6 +74,7 @@ const jestConfig = {
74
74
  testRegex: '(app|lib).*/tests/.*\\.test\\.(js|ts)$',
75
75
  snapshotSerializers: [],
76
76
  testResultsProcessor: 'jest-sonar-reporter',
77
+ resolver: 'ts-jest-resolver',
77
78
  transformIgnorePatterns: [
78
79
  'node_modules/(?!(@elliemae/*|lodash-es/*)/)',
79
80
  'node_modules/@elliemae/em-platform-document-viewer',
@@ -1,6 +1,9 @@
1
+ /* eslint-disable max-lines */
1
2
  const path = require('path');
2
3
  const fs = require('fs');
3
4
  const _ = require('lodash');
5
+ const CompressionPlugin = require('compression-webpack-plugin');
6
+ const zlib = require('zlib');
4
7
 
5
8
  let pathSep = path.sep;
6
9
  if (pathSep === '\\')
@@ -122,7 +125,6 @@ const getAppLoaderFileName = () => {
122
125
 
123
126
  const getDiagnosticsFileName = () => {
124
127
  const libName = 'emuiDiagnostics';
125
- // eslint-disable-next-line max-lines
126
128
  const libPath = path.join(
127
129
  process.cwd(),
128
130
  'node_modules/@elliemae/pui-diagnostics/dist/public/js',
@@ -185,6 +187,38 @@ const isGoogleTagManagerEnabled = () => {
185
187
  return !!appConfig?.googleTagManager;
186
188
  };
187
189
 
190
+ const getCompressionPlugins = () => {
191
+ const commonConfig = {
192
+ test: /\.(js|css)$/,
193
+ exclude: [
194
+ /\/adrum-ext/,
195
+ /\/emuiUserMonitoring/,
196
+ /\/emuiDiagnostics/,
197
+ /\/emuiAppLoader/,
198
+ /\/encwLoader/,
199
+ ],
200
+ // 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
+ minRatio: Number.MAX_SAFE_INTEGER,
202
+ };
203
+ return [
204
+ new CompressionPlugin({
205
+ filename: '[path][base].gz',
206
+ algorithm: 'gzip',
207
+ ...commonConfig,
208
+ }),
209
+ new CompressionPlugin({
210
+ filename: '[path][base].br',
211
+ algorithm: 'brotliCompress',
212
+ ...commonConfig,
213
+ compressionOptions: {
214
+ params: {
215
+ [zlib.constants.BROTLI_PARAM_QUALITY]: 11,
216
+ },
217
+ },
218
+ }),
219
+ ];
220
+ };
221
+
188
222
  exports.excludeNodeModulesExcept = excludeNodeModulesExcept;
189
223
  exports.getLibraryName = getLibraryName;
190
224
  exports.getAppConfig = getAppConfig;
@@ -209,3 +243,4 @@ exports.resolveExtensions = [
209
243
  ];
210
244
  exports.mainFields = ['browser', 'module', 'main'];
211
245
  exports.isGoogleTagManagerEnabled = isGoogleTagManagerEnabled;
246
+ exports.getCompressionPlugins = getCompressionPlugins;
@@ -15,7 +15,6 @@ const {
15
15
  modulesToTranspile,
16
16
  getAlias,
17
17
  getPaths,
18
- getMediaPath,
19
18
  } = require('./helpers');
20
19
  const { isTypeScriptEnabled } = require('../typescript/util');
21
20
 
@@ -64,21 +63,29 @@ const plugins = [
64
63
  {
65
64
  from: 'node_modules/@elliemae/pui-user-monitoring/dist/public/js',
66
65
  to: 'js',
66
+ toType: 'dir',
67
+ info: { minimized: true },
67
68
  },
68
69
  {
69
- from: 'node_modules/@elliemae/pui-app-loader/dist/public/js/emuiAppLoader*.js',
70
- to: 'js/[name][ext]',
70
+ from: 'node_modules/@elliemae/pui-app-loader/dist/public/js',
71
+ to: 'js',
72
+ toType: 'dir',
71
73
  noErrorOnMissing: true,
74
+ info: { minimized: true },
72
75
  },
73
76
  {
74
- from: 'node_modules/@elliemae/encw-loader/dist/public/js/emuiEncwLoader*.js',
75
- to: 'js/[name][ext]',
77
+ from: 'node_modules/@elliemae/encw-loader/dist/public/js',
78
+ to: 'js',
79
+ toType: 'dir',
76
80
  noErrorOnMissing: true,
81
+ info: { minimized: true },
77
82
  },
78
83
  {
79
- from: 'node_modules/@elliemae/pui-diagnostics/dist/public/js/emuiDiagnostics*.js',
80
- to: 'js/[name][ext]',
84
+ from: 'node_modules/@elliemae/pui-diagnostics/dist/public/js',
85
+ to: 'js',
86
+ toType: 'dir',
81
87
  noErrorOnMissing: true,
88
+ info: { minimized: true },
82
89
  },
83
90
  {
84
91
  from: 'public',
@@ -120,21 +127,6 @@ module.exports = (options) => ({
120
127
  optimization: options.optimization,
121
128
  module: {
122
129
  rules: [
123
- {
124
- test: /\.(jpe?g|png|gif|svg|ico)$/,
125
- use: [
126
- 'file-loader',
127
- {
128
- loader: 'image-webpack-loader',
129
- options: {
130
- gifsicle: {
131
- enabled: false,
132
- },
133
- },
134
- },
135
- ],
136
- enforce: 'pre',
137
- },
138
130
  {
139
131
  test: /\.(js|ts|jsx|tsx)$/,
140
132
  enforce: 'pre',
@@ -195,22 +187,12 @@ module.exports = (options) => ({
195
187
  type: 'asset/resource',
196
188
  },
197
189
  {
198
- test: /\.svg$/,
199
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
200
- use: [
201
- {
202
- loader: '@svgr/webpack',
203
- },
204
- {
205
- loader: 'file-loader',
206
- options: {
207
- name: getMediaPath(),
208
- },
209
- },
210
- ],
190
+ test: /\.svg$/i,
191
+ issuer: /\.[jt]sx?$/,
192
+ use: ['@svgr/webpack'],
211
193
  },
212
194
  {
213
- test: /\.(jpe?g|png|gif)$/i,
195
+ test: /\.(jpe?g|png|gif|ico)$/i,
214
196
  exclude: excludeNodeModulesExcept(['@elliemae/*']),
215
197
  type: 'asset',
216
198
  },
@@ -223,6 +205,10 @@ module.exports = (options) => ({
223
205
  resourceQuery: /resource/,
224
206
  type: 'asset/resource',
225
207
  },
208
+ {
209
+ type: 'asset',
210
+ resourceQuery: /url/,
211
+ },
226
212
  ],
227
213
  },
228
214
  plugins: plugins.concat(options.plugins),
@@ -20,7 +20,6 @@ const {
20
20
  modulesToTranspile,
21
21
  getAssetPath,
22
22
  getAlias,
23
- getMediaPath,
24
23
  } = require('./helpers');
25
24
  const { isTypeScriptEnabled } = require('../typescript/util');
26
25
 
@@ -88,21 +87,6 @@ module.exports = (options) => ({
88
87
  optimization: options.optimization,
89
88
  module: {
90
89
  rules: [
91
- {
92
- test: /\.(jpe?g|png|gif|svg|ico)$/,
93
- use: [
94
- 'file-loader',
95
- {
96
- loader: 'image-webpack-loader',
97
- options: {
98
- gifsicle: {
99
- enabled: false,
100
- },
101
- },
102
- },
103
- ],
104
- enforce: 'pre',
105
- },
106
90
  {
107
91
  test: /^(?!.*\.exec\.js$).*\.(js|ts|jsx|tsx)$/,
108
92
  enforce: 'pre',
@@ -187,22 +171,12 @@ module.exports = (options) => ({
187
171
  type: 'asset/resource',
188
172
  },
189
173
  {
190
- test: /\.svg$/,
191
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
192
- use: [
193
- {
194
- loader: '@svgr/webpack',
195
- },
196
- {
197
- loader: 'file-loader',
198
- options: {
199
- name: getMediaPath(),
200
- },
201
- },
202
- ],
174
+ test: /\.svg$/i,
175
+ issuer: /\.[jt]sx?$/,
176
+ use: ['@svgr/webpack'],
203
177
  },
204
178
  {
205
- test: /\.(jpe?g|png|gif)$/i,
179
+ test: /\.(jpe?g|png|gif|ico)$/i,
206
180
  exclude: excludeNodeModulesExcept(['@elliemae/*']),
207
181
  type: 'asset',
208
182
  },
@@ -220,6 +194,10 @@ module.exports = (options) => ({
220
194
  resourceQuery: /resource/,
221
195
  type: 'asset/resource',
222
196
  },
197
+ {
198
+ type: 'asset',
199
+ resourceQuery: /url/,
200
+ },
223
201
  ],
224
202
  },
225
203
  plugins: plugins.concat(options.plugins || []),
@@ -1,11 +1,10 @@
1
1
  const path = require('path');
2
2
  const TerserPlugin = require('terser-webpack-plugin');
3
- const CompressionPlugin = require('compression-webpack-plugin');
4
3
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
4
  const HtmlWebpackPlugin = require('html-webpack-plugin');
6
5
  const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
7
6
  const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
8
- const { getLibraryName } = require('./helpers');
7
+ const { getLibraryName, getCompressionPlugins } = require('./helpers');
9
8
 
10
9
  const libraryName = getLibraryName();
11
10
 
@@ -69,13 +68,7 @@ module.exports = require('./webpack.lib.base.babel')({
69
68
  chunkFilename: `css/${libraryName}.[contenthash].chunk.css`,
70
69
  }),
71
70
 
72
- new CompressionPlugin({
73
- filename: '[path][base].gz',
74
- algorithm: 'gzip',
75
- test: /\.js$|\.css$$/,
76
- // 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
77
- minRatio: Number.MAX_SAFE_INTEGER,
78
- }),
71
+ ...getCompressionPlugins(),
79
72
 
80
73
  new BundleAnalyzerPlugin({
81
74
  analyzerMode: 'static',
@@ -1,8 +1,8 @@
1
+ /* eslint-disable max-lines */
1
2
  const path = require('path');
2
3
  const HtmlWebpackPlugin = require('html-webpack-plugin');
3
4
  const { GenerateSW } = require('workbox-webpack-plugin');
4
5
  const TerserPlugin = require('terser-webpack-plugin');
5
- const CompressionPlugin = require('compression-webpack-plugin');
6
6
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
7
7
  const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
8
8
  const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
@@ -15,6 +15,7 @@ const {
15
15
  getPaths,
16
16
  getAppVersion,
17
17
  isGoogleTagManagerEnabled,
18
+ getCompressionPlugins,
18
19
  } = require('./helpers');
19
20
 
20
21
  const getProdConfig = ({ latestVersion = true } = {}) => {
@@ -74,14 +75,7 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
74
75
  chunkFilename: 'css/[name].[contenthash].chunk.css',
75
76
  }),
76
77
 
77
- new CompressionPlugin({
78
- filename: '[path][base].gz',
79
- algorithm: 'gzip',
80
- test: /\.js$|\.css$$/,
81
- exclude: [/\/adrum-ext/, /\/emuiUserMonitoring/],
82
- // 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
83
- minRatio: Number.MAX_SAFE_INTEGER,
84
- }),
78
+ ...getCompressionPlugins(),
85
79
 
86
80
  new BundleAnalyzerPlugin({
87
81
  analyzerMode: 'static',
@@ -120,7 +114,6 @@ const htmlWebpackPlugin = new HtmlWebpackPlugin({
120
114
  ? 'app/index.html'
121
115
  : 'app/index-app-loader.html',
122
116
  minify: {
123
- // eslint-disable-next-line max-lines
124
117
  removeComments: true,
125
118
  collapseWhitespace: true,
126
119
  removeRedundantAttributes: true,
@@ -2,7 +2,6 @@
2
2
  const webpack = require('webpack');
3
3
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4
4
  const CopyWebpackPlugin = require('copy-webpack-plugin');
5
- const CompressionPlugin = require('compression-webpack-plugin');
6
5
  const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
7
6
  const {
8
7
  getAppConfig,
@@ -12,7 +11,7 @@ const {
12
11
  modulesToTranspile,
13
12
  resolveExtensions,
14
13
  mainFields,
15
- getMediaPath,
14
+ getCompressionPlugins,
16
15
  } = require('./helpers');
17
16
 
18
17
  const IS_APP = isApp();
@@ -50,30 +49,7 @@ const getAdditionalPlugins = () => [
50
49
  }),
51
50
  ];
52
51
 
53
- const compressionPlugin = new CompressionPlugin({
54
- filename: '[path][base].gz',
55
- algorithm: 'gzip',
56
- test: /\.js$|\.css$$/,
57
- // 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
58
- minRatio: Number.MAX_SAFE_INTEGER,
59
- });
60
-
61
52
  const getModulePreRules = () => [
62
- {
63
- test: /\.(jpe?g|png|gif|svg|ico)$/,
64
- use: [
65
- 'file-loader',
66
- {
67
- loader: 'image-webpack-loader',
68
- options: {
69
- gifsicle: {
70
- enabled: false,
71
- },
72
- },
73
- },
74
- ],
75
- enforce: 'pre',
76
- },
77
53
  {
78
54
  test: /\.(js|ts|jsx|tsx)$/,
79
55
  enforce: 'pre',
@@ -113,22 +89,16 @@ const getModuleRules = () => [
113
89
  type: 'asset/resource',
114
90
  },
115
91
  {
116
- test: /\.svg$/,
117
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
118
- use: [
119
- {
120
- loader: '@svgr/webpack',
121
- },
122
- {
123
- loader: 'file-loader',
124
- options: {
125
- name: getMediaPath(),
126
- },
127
- },
128
- ],
92
+ type: 'asset',
93
+ resourceQuery: /url/,
94
+ },
95
+ {
96
+ test: /\.svg$/i,
97
+ issuer: /\.[jt]sx?$/,
98
+ use: ['@svgr/webpack'],
129
99
  },
130
100
  {
131
- test: /\.(jpe?g|png|gif)$/i,
101
+ test: /\.(jpe?g|png|gif|ico)$/i,
132
102
  exclude: excludeNodeModulesExcept(['@elliemae/*']),
133
103
  type: 'asset',
134
104
  },
@@ -150,7 +120,7 @@ exports.webpackFinal = async (config, { configType }) => {
150
120
 
151
121
  config.plugins.push(...getAdditionalPlugins());
152
122
  if (isProd) {
153
- config.plugins.push(compressionPlugin);
123
+ config.plugins = config.plugins.concat(getCompressionPlugins());
154
124
  }
155
125
 
156
126
  config.resolve.alias = { ...config.resolve.alias, ...getAlias() };
@@ -168,7 +138,7 @@ exports.webpackFinal = async (config, { configType }) => {
168
138
 
169
139
  // storybook manager webpack
170
140
  exports.managerWebpack = async (config) => {
171
- config.plugins.push(compressionPlugin);
141
+ config.plugins = config.plugins.concat(getCompressionPlugins());
172
142
  config.resolve.alias = { ...config.resolve.alias, ...getAlias() };
173
143
  return config;
174
144
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "5.19.0",
3
+ "version": "5.21.1",
4
4
  "private": false,
5
5
  "description": "EllieMae Platform UI CLI",
6
6
  "sideEffects": false,
@@ -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": "~5.5.0",
92
- "@testing-library/jest-dom": "~5.16.0",
91
+ "@svgr/webpack": "~6.1.1",
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
96
  "@types/node": "~16.11.11",
97
97
  "@types/rimraf": "~3.0.2",
98
98
  "@types/testing-library__jest-dom": "~5.14.2",
99
- "@typescript-eslint/eslint-plugin": "~5.5.0",
100
- "@typescript-eslint/parser": "~5.5.0",
99
+ "@typescript-eslint/eslint-plugin": "~5.6.0",
100
+ "@typescript-eslint/parser": "~5.6.0",
101
101
  "autoprefixer": "~10.4.0",
102
102
  "axe-core": "~4.3.5",
103
103
  "babel-loader": "~8.2.3",
@@ -180,9 +180,10 @@
180
180
  "moment": "~2.29.1",
181
181
  "moment-locales-webpack-plugin": "~1.2.0",
182
182
  "msw": "~0.36.0",
183
+ "node-gyp": "~8.4.1",
183
184
  "node-plop": "~0.30.0",
184
185
  "nodemon": "~2.0.15",
185
- "npm-check-updates": "12.0.2",
186
+ "npm-check-updates": "12.0.3",
186
187
  "null-loader": "~4.0.1",
187
188
  "pino": "~7.5.1",
188
189
  "pino-pretty": "~7.2.0",
@@ -221,6 +222,7 @@
221
222
  "svg-url-loader": "~7.1.1",
222
223
  "svgo": "~2.8.0",
223
224
  "terser-webpack-plugin": "~5.2.5",
225
+ "ts-jest-resolver": "~2.0.0",
224
226
  "ts-node": "~10.4.0",
225
227
  "tsc-alias": "~1.4.2",
226
228
  "tsc-files": "~1.1.3",
@@ -231,7 +233,7 @@
231
233
  "update-notifier": "~5.1.0",
232
234
  "url-loader": "~4.1.1",
233
235
  "uuid": "~8.3.2",
234
- "webpack": "~5.64.4",
236
+ "webpack": "~5.65.0",
235
237
  "webpack-bundle-analyzer": "~4.5.0",
236
238
  "webpack-cli": "~4.9.1",
237
239
  "webpack-dev-middleware": "~5.2.2",