@elliemae/pui-cli 7.0.0-beta.1 → 7.0.0-beta.12

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.
@@ -2,16 +2,20 @@ const { exit } = require('yargs');
2
2
  const { exec, logError, logSuccess } = require('./utils');
3
3
  const { isTypeScriptEnabled } = require('../typescript/util');
4
4
 
5
+ const { CI = false } = process.env;
6
+
5
7
  async function lintCSS(fix = false) {
6
8
  const fixIssues = fix ? '--fix' : '';
7
9
  await exec(
8
- `stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} --color --allowEmptyInput`,
10
+ `stylelint ./{lib,app}/**/*.{js,jsx,ts,tsx} ${fixIssues} ${
11
+ !CI ? '--color' : ''
12
+ } --allowEmptyInput`,
9
13
  );
10
14
  }
11
15
 
12
16
  async function lintJS(fix = false) {
13
17
  const fixIssues = fix ? '--fix' : '';
14
- await exec(`eslint --color ${fixIssues} .`);
18
+ await exec(`eslint ${!CI ? '--color' : ''} ${fixIssues} .`);
15
19
  }
16
20
 
17
21
  async function handler(argv) {
@@ -4,7 +4,7 @@ const { exec, logError, logSuccess } = require('./utils');
4
4
  const { CI = false } = process.env;
5
5
 
6
6
  async function test(commandOptions) {
7
- await exec(`cross-env FORCE_COLOR=true NODE_ENV=test jest ${commandOptions}`);
7
+ await exec(`cross-env NODE_ENV=test jest ${commandOptions}`);
8
8
  }
9
9
 
10
10
  // eslint-disable-next-line max-statements
@@ -12,7 +12,7 @@ async function handler(argv) {
12
12
  let commandOptions = '--coverage';
13
13
  if (argv.fix) commandOptions = '-u';
14
14
  else if (argv.watch) commandOptions = '--watchAll';
15
- if (CI) commandOptions += ' --ci --runInBand';
15
+ if (CI) commandOptions += ' --ci --runInBand --no-colors';
16
16
  else commandOptions += ' --maxWorkers=50%';
17
17
  if (argv.p) commandOptions += ' --passWithNoTests';
18
18
  if (argv.r) commandOptions += ' --bail --findRelatedTests';
@@ -117,11 +117,19 @@ const copyDir = async (src, dest) => {
117
117
  );
118
118
  };
119
119
 
120
+ const updateManifestWithVersionInfo = async (dest) => {
121
+ const manifestFile = path.join(dest, 'manifest.json');
122
+ let manifestData = await readFile(manifestFile, 'utf8');
123
+ manifestData = manifestData.replace(/latest\//g, `${getAppVersion()}/`);
124
+ await writeFile(manifestFile, manifestData);
125
+ };
126
+
120
127
  exports.copyBuildAssetsToVersionedFolder = async () => {
121
128
  const appVersion = getAppVersion();
122
129
  const isVersionedApp = isAppLoaderEnabled() && appVersion !== LATEST_VERSION;
123
130
  if (!isVersionedApp) return;
124
131
  const src = path.resolve(process.cwd(), 'build/public/latest');
125
132
  const dest = path.resolve(process.cwd(), `build/public/${appVersion}`);
126
- copyDir(src, dest);
133
+ await copyDir(src, dest);
134
+ await updateManifestWithVersionInfo(dest);
127
135
  };
package/lib/server/csp.js CHANGED
@@ -17,13 +17,13 @@ const sources = [
17
17
  ];
18
18
 
19
19
  const sendFileWithCSPNonce = ({
20
- outputPath,
20
+ buildPath,
21
21
  page = 'index.html',
22
22
  nonceRegex = /__CSP_NONCE__/g,
23
23
  res,
24
24
  fileSystem = fs,
25
25
  }) => {
26
- fileSystem.readFile(path.resolve(outputPath, page), 'utf8', (err, html) => {
26
+ fileSystem.readFile(path.resolve(buildPath, page), 'utf8', (err, html) => {
27
27
  if (err) {
28
28
  res.sendStatus(404);
29
29
  } else {
@@ -1,26 +1,11 @@
1
1
  /* eslint consistent-return:0 import/order:0 */
2
-
3
2
  const express = require('express');
4
- const cors = require('cors');
5
- const { resolve } = require('path');
6
- const expressPinoLogger = require('express-pino-logger');
7
- const { csp } = require('./csp');
8
3
  const logger = require('./logger');
9
- const argv = require('./argv');
10
- const port = require('./port');
11
- const setup = require('./middlewares/frontendMiddleware');
12
- const { loadRoutes } = require('./util');
13
- const { getAssetPath } = require('../webpack/helpers');
14
-
15
- const pino = expressPinoLogger({
16
- transport: {
17
- target: 'pino-pretty',
18
- options: {
19
- colorize: true,
20
- },
21
- },
22
- });
23
- pino.logger.level = 'warn';
4
+ const {
5
+ setupDefaultMiddlewares,
6
+ setupAdditionalMiddlewars,
7
+ } = require('./middlewares');
8
+ const { loadRoutes, port, host } = require('./util');
24
9
 
25
10
  // const corsOptions = {
26
11
  // origin: '*',
@@ -37,33 +22,16 @@ pino.logger.level = 'warn';
37
22
  // maxAge: 3600,
38
23
  // };
39
24
  const app = express();
40
- app.use(pino);
41
- app.use(cors());
42
- app.options('*', cors());
43
- csp(app);
44
- app.use(express.urlencoded({ extended: false }));
45
- app.use(express.text({ type: 'text/plain' }));
46
- app.use(express.json({ type: 'application/json' }));
47
- app.use(express.json({ type: 'application/csp-report' }));
48
-
25
+ setupDefaultMiddlewares(app);
49
26
  // load all custom routes from the application
50
27
  loadRoutes(app);
51
-
52
28
  // In production we need to pass these values in instead of relying on webpack
53
- setup(app, {
54
- outputPath: resolve(process.cwd(), 'build/public'),
55
- publicPath: getAssetPath(),
56
- });
57
-
58
- // get the intended host and port number, use localhost and port 3000 if not provided
59
- const customHost = argv.host || process.env.HOST;
60
- const host = customHost || null; // Let http.Server use its default IPv6/4 host
61
- const prettyHost = customHost || 'localhost';
29
+ setupAdditionalMiddlewars(app);
62
30
 
63
31
  // Start your app.
64
32
  app.listen(port, host, async (err) => {
65
33
  if (err) {
66
34
  return logger.error(err.message);
67
35
  }
68
- logger.appStarted(port, prettyHost);
36
+ logger.appStarted(port, host || 'localhost');
69
37
  });
@@ -1,25 +1,24 @@
1
- const path = require('path');
2
1
  const compression = require('compression');
3
2
  const expressStaticGzip = require('express-static-gzip');
4
3
  const { sendFileWithCSPNonce } = require('../csp');
4
+ const { getPaths } = require('../../webpack/helpers');
5
5
 
6
- module.exports = function addProdMiddlewares(app, options) {
7
- const publicPath = options.publicPath || '/';
8
- const outputPath =
9
- options.outputPath || path.resolve(process.cwd(), 'build/public');
6
+ const paths = getPaths();
10
7
 
8
+ module.exports = function addProdMiddlewares(app, options = {}) {
9
+ const { buildPath = paths.buildPath, basePath = paths.basePath } = options;
11
10
  // compression middleware compresses your server responses which makes them
12
11
  // smaller (applies also to assets). You can read more about that technique
13
12
  // and other good practices on official Express.js docs http://mxs.is/googmy
14
13
  app.use(compression());
15
14
 
16
- app.get(publicPath, (req, res) => {
17
- sendFileWithCSPNonce({ outputPath, res });
15
+ app.get(basePath, (req, res) => {
16
+ sendFileWithCSPNonce({ buildPath, res });
18
17
  });
19
18
 
20
19
  app.use(
21
- publicPath,
22
- expressStaticGzip(outputPath, {
20
+ basePath,
21
+ expressStaticGzip(buildPath, {
23
22
  index: false,
24
23
  enableBrotli: true,
25
24
  orderPreference: ['br'],
@@ -27,5 +26,5 @@ module.exports = function addProdMiddlewares(app, options) {
27
26
  );
28
27
  app.use(expressStaticGzip('cdn'));
29
28
 
30
- app.get('*', (req, res) => sendFileWithCSPNonce({ outputPath, res }));
29
+ app.get('*', (req, res) => sendFileWithCSPNonce({ buildPath, res }));
31
30
  };
@@ -0,0 +1,37 @@
1
+ const express = require('express');
2
+ const cors = require('cors');
3
+ const expressPinoLogger = require('express-pino-logger');
4
+ const { csp } = require('../csp');
5
+ const addProdMiddlewares = require('./addProdMiddlewares');
6
+ const addDevMiddlewares = require('./addDevMiddlewares');
7
+ const webpackConfig = require('../../webpack/webpack.dev.babel');
8
+
9
+ exports.setupDefaultMiddlewares = (app) => {
10
+ const pino = expressPinoLogger({
11
+ transport: {
12
+ target: 'pino-pretty',
13
+ options: {
14
+ colorize: true,
15
+ },
16
+ },
17
+ });
18
+ pino.logger.level = 'warn';
19
+ app.use(pino);
20
+ app.use(cors());
21
+ app.options('*', cors());
22
+ csp(app);
23
+ app.use(express.urlencoded({ extended: false }));
24
+ app.use(express.text({ type: 'text/plain' }));
25
+ app.use(express.json({ type: 'application/json' }));
26
+ app.use(express.json({ type: 'application/csp-report' }));
27
+ };
28
+
29
+ exports.setupAdditionalMiddlewars = (app, options) => {
30
+ const isProd = process.env.NODE_ENV === 'production';
31
+ if (isProd) {
32
+ addProdMiddlewares(app, options);
33
+ } else {
34
+ addDevMiddlewares(app, webpackConfig);
35
+ }
36
+ return app;
37
+ };
@@ -1,5 +1,6 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
+ const argv = require('minimist')(process.argv.slice(2));
3
4
 
4
5
  const getCWD = () => process.cwd();
5
6
 
@@ -25,7 +26,7 @@ const getFilesMatching = (filePattern) => {
25
26
  const getServerRouteFiles = getFilesMatching(allJS);
26
27
  const getServiceEndpoints = getFilesMatching(serviceEndpoints);
27
28
 
28
- const loadRoutes = (app) => {
29
+ exports.loadRoutes = (app) => {
29
30
  const routeFiles = getServerRouteFiles(path.join(getCWD(), 'server/routes'));
30
31
  routeFiles.push(...getServiceEndpoints(path.join(getCWD(), 'app')));
31
32
  routeFiles.push(...getServiceEndpoints(path.join(getCWD(), 'lib')));
@@ -41,7 +42,11 @@ const loadRoutes = (app) => {
41
42
  });
42
43
  };
43
44
 
44
- module.exports = {
45
- getCWD,
46
- loadRoutes,
47
- };
45
+ exports.port = parseInt(
46
+ argv.port || process.env.port || process.env.PORT || '3000',
47
+ 10,
48
+ );
49
+
50
+ exports.host = argv.host || process.env.HOST;
51
+
52
+ exports.getCWD = getCWD;
@@ -1,9 +1,11 @@
1
1
  const path = require('path');
2
2
  const normalizePath = require('normalize-path');
3
- const { getAppConfig, getAssetPath } = require('../webpack/helpers');
3
+ const { getAppConfig, getPaths } = require('../webpack/helpers');
4
4
  const swcrcConfig = require('../transpile/swcrc.config.js');
5
5
  const { findMonoRepoRoot } = require('../monorepo/utils');
6
6
 
7
+ const { basePath } = getPaths();
8
+
7
9
  let isReactModule = true;
8
10
  try {
9
11
  /* eslint-disable global-require, import/no-unresolved */
@@ -28,19 +30,21 @@ const getNodeModulesPath = (fileName) => {
28
30
 
29
31
  const jestConfig = {
30
32
  collectCoverageFrom: [
31
- 'app/**/*.{js, ts, jsx, tsx}',
32
- 'lib/**/*.{js, ts, jsx, tsx}',
33
- '!app/**/*.test.{js, ts, jsx, tsx}',
34
- '!lib/**/*.test.{js, ts, jsx, tsx}',
35
- '!app/**/*.stories.{js, ts, jsx, tsx}',
36
- '!lib/**/*.stories.{js, ts, jsx, tsx}',
37
- '!app/**/*.endpoint.{js, ts, jsx, tsx}',
38
- '!lib/**/*.endpoint.{js, ts, jsx, tsx}',
39
- '!app/*/RbGenerated*/*.{js, ts, jsx, tsx}',
40
- '!app/index.{js, ts, jsx, tsx}',
41
- '!app/global-styles.{js, ts, jsx, tsx}',
42
- '!app/**/loadable.{js, ts, jsx, tsx}',
43
- '!lib/**/loadable.{js, ts, jsx, tsx}',
33
+ 'app/**/*.{js,ts,jsx,tsx}',
34
+ 'lib/**/*.{js,ts,jsx,tsx}',
35
+ '!app/**/*.d.ts',
36
+ '!lib/**/*.d.ts',
37
+ '!app/**/*.test.{js,ts,jsx,tsx}',
38
+ '!lib/**/*.test.{js,ts,jsx,tsx}',
39
+ '!app/**/*.stories.{js,ts,jsx,tsx}',
40
+ '!lib/**/*.stories.{js,ts,jsx,tsx}',
41
+ '!app/**/*.endpoint.{js,ts,jsx,tsx}',
42
+ '!lib/**/*.endpoint.{js,ts,jsx,tsx}',
43
+ '!app/*/RbGenerated*/*.{js,ts,jsx,tsx}',
44
+ '!app/index.{js,ts,jsx,tsx}',
45
+ '!app/global-styles.{js,ts,jsx,tsx}',
46
+ '!app/**/loadable.{js,ts,jsx,tsx}',
47
+ '!lib/**/loadable.{js,ts,jsx,tsx}',
44
48
  ],
45
49
  coverageThreshold: {
46
50
  // Todo: enable the coverage threshold later
@@ -61,16 +65,14 @@ const jestConfig = {
61
65
  getMockFilePath('image.js'),
62
66
  '.*\\.svg$': getMockFilePath('svg.js'),
63
67
  '.*\\.(html)$': getMockFilePath('html.js'),
68
+ '.*index.html\\?resource$': getMockFilePath('html.js'),
64
69
  '@elliemae/pui-user-monitoring': getMockFilePath('pui-user-monitoring.js'),
65
- '@elliemae/pui-app-loader': getMockFilePath('webpack-hmr.js'),
66
- '@elliemae/pui-diagnostics': getMockFilePath('pui-app-loader.js'),
70
+ '@elliemae/pui-app-loader': getMockFilePath('pui-app-loader.js'),
71
+ '@elliemae/pui-diagnostics': getMockFilePath('pui-diagnostics.js'),
67
72
  'react-spring/web': getNodeModulesPath('react-spring/web.cjs.js'),
68
73
  'react-spring/renderprops': getNodeModulesPath(
69
74
  'react-spring/renderprops.cjs.js',
70
75
  ),
71
- 'styled-components': getNodeModulesPath(
72
- 'styled-components/dist/styled-components.cjs.js',
73
- ),
74
76
  },
75
77
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
76
78
  setupFilesAfterEnv: [path.resolve(__dirname, './setup-tests.js')],
@@ -89,7 +91,9 @@ const jestConfig = {
89
91
  APP_CONFIG: getAppConfig(),
90
92
  __webpack_public_path__: '/',
91
93
  },
92
- testURL: `http://localhost:3111${getAssetPath()}`,
94
+ testEnvironmentOptions: {
95
+ url: `http://localhost:3111${basePath}`,
96
+ },
93
97
  testEnvironment: 'jsdom',
94
98
  };
95
99
 
@@ -4,7 +4,7 @@ import path from 'path';
4
4
 
5
5
  export default defineConfig({
6
6
  test: {
7
- global: true,
7
+ globals: true,
8
8
  root: process.cwd(),
9
9
  exclude: ['node_modules', 'dist', '.idea', '.git', '.cache', 'e2e'],
10
10
  setupFiles: [path.resolve(__dirname, './vitest.setup.ts')],
@@ -150,8 +150,6 @@ const getENCWLoaderFileName = () => {
150
150
  )[0];
151
151
  };
152
152
 
153
- const getAssetPath = () => (process.env.ASSET_PATH || '/').replace(/\/?$/, '/');
154
-
155
153
  const getAppVersion = () => {
156
154
  if (!process.env.APP_VERSION) return LATEST_VERSION;
157
155
  const match = process.env.APP_VERSION.match(/^v?(\d+\.\d+)\..*$/);
@@ -166,7 +164,7 @@ const getPaths = (latestVersion = true) => {
166
164
  return {
167
165
  appVersion: version,
168
166
  buildPath: path.resolve(process.cwd(), `build/public/`),
169
- // base path for all assets
167
+ basePath: (process.env.BASE_PATH || '/').replace(/\/?$/, '/'),
170
168
  publicPath,
171
169
  userMonScriptPath: `latest/js/${getUserMonitoringFileName()}`,
172
170
  appLoaderScriptPath: `latest/js/${getAppLoaderFileName()}`,
@@ -231,7 +229,6 @@ exports.excludeNodeModulesExcept = excludeNodeModulesExcept;
231
229
  exports.getLibraryName = getLibraryName;
232
230
  exports.getAppConfig = getAppConfig;
233
231
  exports.mapToFolder = mapToFolder;
234
- exports.getAssetPath = getAssetPath;
235
232
  exports.isApp = isApp;
236
233
  exports.getAlias = getAlias;
237
234
  exports.getAppVersion = getAppVersion;
@@ -13,7 +13,6 @@ const browserslistToEsbuild = require('browserslist-to-esbuild');
13
13
 
14
14
  const {
15
15
  excludeNodeModulesExcept,
16
- getAppConfig,
17
16
  modulesToTranspile,
18
17
  getAlias,
19
18
  getPaths,
@@ -34,13 +33,8 @@ const { buildPath } = getPaths();
34
33
  const plugins = [
35
34
  new webpack.EnvironmentPlugin({
36
35
  NODE_ENV: 'development',
37
- ASSET_PATH: '/',
38
- // PUBLIC_PATH: publicPath,
39
36
  CI: 'false',
40
37
  }),
41
- new webpack.DefinePlugin({
42
- APP_CONFIG: getAppConfig(),
43
- }),
44
38
  new ProvidePlugin({
45
39
  React: 'react',
46
40
  }),
@@ -244,4 +238,5 @@ module.exports = (options) => ({
244
238
  },
245
239
  devtool: options.devtool || 'eval-source-map',
246
240
  performance: options.performance || {},
241
+ devServer: options.devServer || {},
247
242
  });
@@ -1,9 +1,13 @@
1
+ /* eslint-disable max-lines */
1
2
  const path = require('path');
2
3
  const HtmlWebpackPlugin = require('html-webpack-plugin');
3
4
  const CircularDependencyPlugin = require('circular-dependency-plugin');
4
5
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
6
  const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
6
7
  const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
8
+ const expressStaticGzip = require('express-static-gzip');
9
+ const { setupDefaultMiddlewares } = require('../server/middlewares');
10
+ const { loadRoutes } = require('../server/util');
7
11
 
8
12
  const smp = new SpeedMeasurePlugin({ disable: !process.env.MEASURE });
9
13
 
@@ -16,6 +20,8 @@ const baseConfigFactory = require('./webpack.base.babel');
16
20
 
17
21
  const {
18
22
  appVersion,
23
+ buildPath,
24
+ basePath,
19
25
  userMonScriptPath,
20
26
  globalScriptPath,
21
27
  appLoaderScriptPath,
@@ -36,14 +42,13 @@ const devConfig = {
36
42
 
37
43
  // Add hot reloading in development
38
44
  entry: {
39
- app: [
40
- 'webpack-hot-middleware/client',
41
- path.join(process.cwd(), 'app/index'),
42
- ],
45
+ app: path.join(process.cwd(), 'app/index'),
43
46
  },
44
47
 
45
48
  // Don't use hashes in dev mode for better performance
46
49
  output: {
50
+ path: buildPath,
51
+ publicPath: 'auto',
47
52
  filename: '[name].js',
48
53
  chunkFilename: '[name].chunk.js',
49
54
  assetModuleFilename: '[name][ext][query]',
@@ -103,7 +108,27 @@ const devConfig = {
103
108
  hints: false,
104
109
  },
105
110
 
106
- devServer: {},
111
+ devServer: {
112
+ client: {
113
+ overlay: {
114
+ errors: true,
115
+ warnings: false,
116
+ },
117
+ },
118
+ devMiddleware: {
119
+ publicPath: basePath,
120
+ },
121
+ historyApiFallback: true,
122
+ hot: true,
123
+ open: [basePath],
124
+ port: 3000,
125
+ setupMiddlewares: (middlewares, devServer) => {
126
+ setupDefaultMiddlewares(devServer.app);
127
+ devServer.app.use(expressStaticGzip('cdn'));
128
+ loadRoutes(devServer.app);
129
+ return middlewares;
130
+ },
131
+ },
107
132
  };
108
133
 
109
134
  const config = smp.wrap(baseConfigFactory(devConfig));
@@ -26,7 +26,6 @@ module.exports = require('./webpack.lib.base.babel')({
26
26
 
27
27
  plugins: [
28
28
  new HtmlWebpackPlugin({
29
- scriptLoading: 'module',
30
29
  inject: true, // Inject all files that are generated by webpack, e.g. bundle.js
31
30
  template: 'lib/index.pug',
32
31
  filename: 'index.html',
@@ -36,7 +36,6 @@ module.exports = require('./webpack.lib.base.babel')({
36
36
 
37
37
  plugins: [
38
38
  new HtmlWebpackPlugin({
39
- scriptLoading: 'module',
40
39
  template: 'lib/index.pug',
41
40
  filename: 'index.html',
42
41
  libraryName,
@@ -91,6 +91,7 @@ const {
91
91
  appLoaderScriptPath,
92
92
  diagnosticsScriptPath,
93
93
  encwLoaderScriptPath,
94
+ basePath,
94
95
  } = getPaths();
95
96
  const htmlWebpackPlugin = new HtmlWebpackPlugin({
96
97
  inject: !isAppLoaderEnabled(),
@@ -111,6 +112,7 @@ const htmlWebpackPlugin = new HtmlWebpackPlugin({
111
112
  },
112
113
  emui: {
113
114
  appVersion: 'latest',
115
+ basePath,
114
116
  globalScriptPath,
115
117
  userMonScriptPath,
116
118
  appLoaderScriptPath,
@@ -1,21 +1,13 @@
1
- const { DefinePlugin, EnvironmentPlugin } = require('webpack');
1
+ const { EnvironmentPlugin } = require('webpack');
2
2
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3
3
  const CopyWebpackPlugin = require('copy-webpack-plugin');
4
4
  const ResolveTypeScriptPlugin = require('resolve-typescript-plugin');
5
- const {
6
- getAppConfig,
7
- isApp,
8
- getAlias,
9
- getCompressionPlugins,
10
- } = require('./helpers');
5
+ const { isApp, getAlias, getCompressionPlugins } = require('./helpers');
11
6
 
12
7
  const IS_APP = isApp();
13
8
  const CWD = process.cwd();
14
9
 
15
10
  const getAdditionalPlugins = () => [
16
- new DefinePlugin({
17
- APP_CONFIG: getAppConfig(),
18
- }),
19
11
  new EnvironmentPlugin({
20
12
  IS_APP,
21
13
  CWD,
@@ -55,6 +47,10 @@ const getModuleRules = () => [
55
47
  resourceQuery: /^((?!url).)*$/,
56
48
  use: ['@svgr/webpack'],
57
49
  },
50
+ {
51
+ resourceQuery: /resource/,
52
+ type: 'asset/resource',
53
+ },
58
54
  ];
59
55
 
60
56
  exports.webpackFinal = async (config, { configType }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "7.0.0-beta.1",
3
+ "version": "7.0.0-beta.12",
4
4
  "private": false,
5
5
  "description": "ICE MT UI Platform CLI",
6
6
  "sideEffects": false,
@@ -47,60 +47,61 @@
47
47
  "indent": 4
48
48
  },
49
49
  "dependencies": {
50
- "@babel/cli": "~7.17.6",
51
- "@babel/core": "~7.17.7",
50
+ "@babel/cli": "~7.17.10",
51
+ "@babel/core": "~7.17.10",
52
52
  "@babel/eslint-parser": "~7.17.0",
53
- "@babel/node": "~7.16.8",
53
+ "@babel/node": "~7.17.10",
54
54
  "@babel/plugin-proposal-class-properties": "~7.16.7",
55
55
  "@babel/plugin-proposal-export-default-from": "~7.16.7",
56
56
  "@babel/plugin-syntax-dynamic-import": "~7.8.3",
57
- "@babel/plugin-transform-modules-commonjs": "~7.17.7",
57
+ "@babel/plugin-transform-modules-commonjs": "~7.17.9",
58
58
  "@babel/plugin-transform-react-constant-elements": "~7.17.6",
59
59
  "@babel/plugin-transform-react-inline-elements": "~7.16.7",
60
60
  "@babel/plugin-transform-react-jsx-source": "~7.16.7",
61
- "@babel/plugin-transform-runtime": "~7.17.0",
62
- "@babel/preset-env": "~7.16.11",
61
+ "@babel/plugin-transform-runtime": "~7.17.10",
62
+ "@babel/preset-env": "~7.17.10",
63
63
  "@babel/preset-react": "~7.16.7",
64
64
  "@babel/preset-typescript": "~7.16.7",
65
- "@babel/runtime": "~7.17.7",
66
- "@commitlint/cli": "~16.2.3",
67
- "@commitlint/config-conventional": "~16.2.1",
68
- "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.3.0",
69
- "@faker-js/faker": "6.0.0",
70
- "@nrwl/cli": "13.9.3",
71
- "@nrwl/tao": "13.9.3",
72
- "@nrwl/workspace": "13.9.3",
73
- "@pmmmwh/react-refresh-webpack-plugin": "~0.5.4",
65
+ "@babel/runtime": "~7.17.9",
66
+ "@commitlint/cli": "~16.2.4",
67
+ "@commitlint/config-conventional": "~16.2.4",
68
+ "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.4.2",
69
+ "@faker-js/faker": "6.2.0",
70
+ "@nrwl/cli": "14.0.5",
71
+ "@nrwl/tao": "14.0.5",
72
+ "@nrwl/workspace": "14.0.5",
73
+ "@pmmmwh/react-refresh-webpack-plugin": "~0.5.5",
74
74
  "@semantic-release/changelog": "~6.0.1",
75
75
  "@semantic-release/exec": "~6.0.3",
76
76
  "@semantic-release/git": "~10.0.1",
77
- "@storybook/addon-a11y": "~6.4.19",
78
- "@storybook/addon-essentials": "~6.4.19",
77
+ "@storybook/addon-a11y": "~6.4.22",
78
+ "@storybook/addon-essentials": "~6.4.22",
79
79
  "@storybook/addon-events": "~6.2.9",
80
- "@storybook/addon-interactions": "~6.4.19",
81
- "@storybook/addon-links": "~6.4.19",
82
- "@storybook/addon-storysource": "~6.4.19",
83
- "@storybook/builder-webpack5": "~6.4.19",
84
- "@storybook/manager-webpack5": "~6.4.19",
85
- "@storybook/react": "~6.4.19",
86
- "@storybook/theming": "~6.4.19",
80
+ "@storybook/addon-interactions": "~6.4.22",
81
+ "@storybook/addon-links": "~6.4.22",
82
+ "@storybook/addon-storysource": "~6.4.22",
83
+ "@storybook/builder-vite": "~0.1.32",
84
+ "@storybook/builder-webpack5": "~6.4.22",
85
+ "@storybook/manager-webpack5": "~6.4.22",
86
+ "@storybook/react": "~6.4.22",
87
+ "@storybook/theming": "~6.4.22",
87
88
  "@stylelint/postcss-css-in-js": "~0.37.2",
88
89
  "@svgr/webpack": "~6.2.1",
89
- "@swc/cli": "~0.1.55",
90
- "@swc/core": "~1.2.158",
90
+ "@swc/cli": "~0.1.57",
91
+ "@swc/core": "~1.2.173",
91
92
  "@swc/jest": "~0.2.20",
92
- "@testing-library/jest-dom": "~5.16.2",
93
- "@testing-library/react": "~12.1.4",
94
- "@testing-library/react-hooks": "~7.0.2",
93
+ "@testing-library/jest-dom": "~5.16.4",
94
+ "@testing-library/react": "~13.1.1",
95
+ "@testing-library/react-hooks": "~8.0.0",
95
96
  "@types/jest": "~27.4.1",
96
- "@types/node": "~17.0.21",
97
+ "@types/node": "~17.0.30",
97
98
  "@types/rimraf": "~3.0.2",
98
99
  "@types/testing-library__jest-dom": "~5.14.3",
99
- "@typescript-eslint/eslint-plugin": "~5.15.0",
100
- "@typescript-eslint/parser": "~5.15.0",
101
- "autoprefixer": "~10.4.4",
100
+ "@typescript-eslint/eslint-plugin": "~5.21.0",
101
+ "@typescript-eslint/parser": "~5.21.0",
102
+ "autoprefixer": "~10.4.5",
102
103
  "axe-core": "~4.4.1",
103
- "babel-loader": "~8.2.3",
104
+ "babel-loader": "~8.2.5",
104
105
  "babel-plugin-add-import-extension": "1.5.1",
105
106
  "babel-plugin-date-fns": "~2.0.0",
106
107
  "babel-plugin-dynamic-import-node": "~2.3.3",
@@ -108,14 +109,14 @@
108
109
  "babel-plugin-lodash": "~3.3.4",
109
110
  "babel-plugin-module-resolver": "~4.1.0",
110
111
  "babel-plugin-source-map-support": "~2.1.3",
111
- "babel-plugin-styled-components": "~2.0.6",
112
+ "babel-plugin-styled-components": "~2.0.7",
112
113
  "babel-plugin-transform-react-remove-prop-types": "~0.4.24",
113
114
  "babel-plugin-transform-remove-console": "~6.9.4",
114
115
  "babel-plugin-transform-strip-block": "~0.0.5",
115
- "body-parser": "~1.19.2",
116
- "browserslist": "~4.20.2",
116
+ "body-parser": "~1.20.0",
117
+ "browserslist": "~4.20.3",
117
118
  "browserslist-to-esbuild": "~1.1.1",
118
- "canvas": "~2.9.0",
119
+ "canvas": "~2.9.1",
119
120
  "chalk": "~4.1.2",
120
121
  "circular-dependency-plugin": "~5.2.2",
121
122
  "compression": "~1.7.4",
@@ -130,42 +131,42 @@
130
131
  "dotenv": "~16.0.0",
131
132
  "dotenv-webpack": "~7.1.0",
132
133
  "duplicate-package-checker-webpack-plugin": "~3.0.0",
133
- "enhanced-resolve": "~5.9.2",
134
- "esbuild": "~0.14.27",
134
+ "enhanced-resolve": "5.9.3",
135
+ "esbuild": "~0.14.38",
135
136
  "esbuild-loader": "~2.18.0",
136
- "esbuild-plugin-svgr": "~1.0.0",
137
- "eslint": "~8.11.0",
137
+ "esbuild-plugin-svgr": "~1.0.1",
138
+ "eslint": "~8.14.0",
138
139
  "eslint-config-airbnb": "~19.0.4",
139
140
  "eslint-config-airbnb-base": "~15.0.0",
140
- "eslint-config-airbnb-typescript": "~16.1.3",
141
+ "eslint-config-airbnb-typescript": "~17.0.0",
141
142
  "eslint-config-prettier": "~8.5.0",
142
- "eslint-config-react-app": "~7.0.0",
143
+ "eslint-config-react-app": "~7.0.1",
143
144
  "eslint-import-resolver-babel-module": "~5.3.1",
144
- "eslint-import-resolver-typescript": "~2.5.0",
145
+ "eslint-import-resolver-typescript": "~2.7.1",
145
146
  "eslint-import-resolver-webpack": "~0.13.2",
146
147
  "eslint-plugin-compat": "~4.0.2",
147
148
  "eslint-plugin-eslint-comments": "~3.2.0",
148
- "eslint-plugin-import": "~2.25.4",
149
- "eslint-plugin-jest": "~26.1.1",
150
- "eslint-plugin-jsdoc": "~38.0.4",
149
+ "eslint-plugin-import": "~2.26.0",
150
+ "eslint-plugin-jest": "~26.1.5",
151
+ "eslint-plugin-jsdoc": "~39.2.9",
151
152
  "eslint-plugin-jsx-a11y": "~6.5.1",
152
- "eslint-plugin-mdx": "~1.16.0",
153
+ "eslint-plugin-mdx": "~1.17.0",
153
154
  "eslint-plugin-prettier": "~4.0.0",
154
155
  "eslint-plugin-react": "~7.29.4",
155
- "eslint-plugin-react-hooks": "~4.3.0",
156
+ "eslint-plugin-react-hooks": "~4.5.0",
156
157
  "eslint-plugin-redux-saga": "~1.3.2",
157
- "eslint-plugin-storybook": "~0.5.7",
158
- "eslint-plugin-testing-library": "~5.1.0",
159
- "eslint-plugin-wdio": "~7.4.2",
158
+ "eslint-plugin-storybook": "~0.5.11",
159
+ "eslint-plugin-testing-library": "~5.3.1",
160
+ "eslint-plugin-wdio": "~7.19.4",
160
161
  "execa": "~5.1.1",
161
- "express": "~4.17.3",
162
+ "express": "~4.18.1",
162
163
  "express-pino-logger": "~7.0.0",
163
164
  "express-static-gzip": "~2.1.5",
164
165
  "favicons": "~6.2.2",
165
166
  "favicons-webpack-plugin": "~5.0.2",
166
167
  "fast-glob": "~3.2.11",
167
168
  "find-up": "~5.0.0",
168
- "happy-dom": "~2.49.0",
169
+ "happy-dom": "~3.1.0",
169
170
  "helmet-csp": "~3.4.0",
170
171
  "html-webpack-plugin": "~5.5.0",
171
172
  "http-server": "~14.1.0",
@@ -174,83 +175,84 @@
174
175
  "imports-loader": "~3.1.1",
175
176
  "ip": "~1.1.5",
176
177
  "jest-axe": "~6.0.0",
177
- "jest-cli": "~27.5.1",
178
+ "jest-cli": "~28.0.3",
179
+ "jest-environment-jsdom": "~28.0.2",
178
180
  "jest-sonar-reporter": "~2.0.0",
179
181
  "jest-styled-components": "~7.0.8",
180
182
  "jscodeshift": "~0.13.1",
181
183
  "jsdoc": "~3.6.10",
182
184
  "lerna": "~4.0.0",
183
- "lint-staged": "~12.3.7",
185
+ "lint-staged": "~12.4.1",
184
186
  "mini-css-extract-plugin": "~2.6.0",
185
- "minimist": "~1.2.5",
186
- "moment": "~2.29.1",
187
+ "minimist": "~1.2.6",
188
+ "moment": "~2.29.3",
187
189
  "moment-locales-webpack-plugin": "~1.2.0",
188
190
  "msw": "~0.39.2",
189
191
  "node-gyp": "~9.0.0",
190
- "node-plop": "~0.30.0",
191
- "nodemon": "~2.0.15",
192
+ "node-plop": "~0.31.0",
193
+ "nodemon": "~2.0.16",
192
194
  "normalize-path": "~3.0.0",
193
- "npm-check-updates": "12.5.4",
195
+ "npm-check-updates": "12.5.10",
194
196
  "null-loader": "~4.0.1",
195
- "pino": "~7.9.1",
196
- "pino-pretty": "~7.5.4",
197
+ "pino": "~7.11.0",
198
+ "pino-pretty": "~7.6.1",
197
199
  "pinst": "~3.0.0",
198
- "plop": "~3.0.5",
199
- "postcss": "~8.4.12",
200
- "postcss-html": "~1.3.0",
200
+ "plop": "~3.1.0",
201
+ "postcss": "~8.4.13",
202
+ "postcss-html": "~1.4.1",
201
203
  "postcss-jsx": "~0.36.4",
202
204
  "postcss-loader": "~6.2.1",
203
205
  "postcss-markdown": "~1.2.0",
204
- "postcss-preset-env": "~7.4.2",
206
+ "postcss-preset-env": "~7.4.4",
205
207
  "postcss-syntax": "~0.36.2",
206
- "prettier": "~2.6.0",
208
+ "prettier": "~2.6.2",
207
209
  "pug": "~3.0.2",
208
210
  "pug-loader": "~2.4.0",
209
211
  "raf": "~3.4.1",
210
212
  "react-axe": "~3.5.4",
211
213
  "react-docgen": "~5.4.0",
212
- "react-refresh": "~0.11.0",
213
- "react-test-renderer": "~17.0.2",
214
+ "react-refresh": "~0.13.0",
215
+ "react-test-renderer": "~18.1.0",
214
216
  "resize-observer-polyfill": "~1.5.1",
215
- "resolve-typescript-plugin": "~1.1.5",
217
+ "resolve-typescript-plugin": "~1.2.0",
216
218
  "rimraf": "~3.0.2",
217
219
  "semantic-release": "~19.0.2",
218
220
  "slackify-markdown": "~4.3.1",
219
221
  "speed-measure-webpack-plugin": "~1.5.0",
220
222
  "storybook-addon-turbo-build": "~1.1.0",
221
- "storybook-builder-vite": "~0.1.21",
223
+ "storybook-builder-vite": "~0.1.23",
222
224
  "storybook-react-router": "~1.0.8",
223
225
  "style-loader": "~3.3.1",
224
- "stylelint": "~14.6.0",
226
+ "stylelint": "~14.8.1",
225
227
  "stylelint-config-recommended": "~7.0.0",
226
228
  "stylelint-config-styled-components": "~0.1.1",
227
- "swc-loader": "~0.1.15",
229
+ "swc-loader": "~0.2.0",
228
230
  "terser-webpack-plugin": "~5.3.1",
229
231
  "ts-node": "~10.7.0",
230
- "tsc-alias": "~1.6.4",
231
- "typescript": "~4.6.2",
232
+ "tsc-alias": "~1.6.7",
233
+ "typescript": "~4.6.4",
232
234
  "update-notifier": "~5.1.0",
233
235
  "url-loader": "~4.1.1",
234
236
  "uuid": "~8.3.2",
235
- "vite": "~2.8.6",
236
- "vitest": "~0.7.4",
237
- "webpack": "~5.70.0",
237
+ "vite": "~2.9.6",
238
+ "vitest": "~0.10.0",
239
+ "webpack": "~5.72.0",
238
240
  "webpack-bundle-analyzer": "~4.5.0",
239
241
  "webpack-cli": "~4.9.2",
240
242
  "webpack-dev-middleware": "~5.3.1",
241
- "webpack-dev-server": "~4.7.4",
243
+ "webpack-dev-server": "~4.8.1",
242
244
  "webpack-hot-middleware": "~2.25.1",
243
245
  "webpack-manifest-plugin": "~5.0.0",
244
246
  "webpack-merge": "~5.8.0",
245
247
  "whatwg-fetch": "~3.6.2",
246
- "workbox-webpack-plugin": "~6.5.1",
247
- "yargs": "~17.3.1"
248
+ "workbox-webpack-plugin": "~6.5.3",
249
+ "yargs": "~17.4.1"
248
250
  },
249
251
  "devDependencies": {
250
- "react": "~17.0.2",
251
- "react-dom": "~17.0.2",
252
- "redux": "~4.1.2",
252
+ "react": "~18.1.0",
253
+ "react-dom": "~18.1.0",
254
+ "redux": "~4.2.0",
253
255
  "redux-saga": "~1.1.3",
254
- "styled-components": "~5.3.3"
256
+ "styled-components": "~5.3.5"
255
257
  }
256
258
  }
@@ -1 +0,0 @@
1
- module.exports = require('minimist')(process.argv.slice(2));
@@ -1,16 +0,0 @@
1
- /* eslint-disable global-require */
2
-
3
- module.exports = (app, options) => {
4
- const isProd = process.env.NODE_ENV === 'production';
5
-
6
- if (isProd) {
7
- const addProdMiddlewares = require('./addProdMiddlewares');
8
- addProdMiddlewares(app, options);
9
- } else {
10
- const webpackConfig = require('../../webpack/webpack.dev.babel');
11
- const addDevMiddlewares = require('./addDevMiddlewares');
12
- addDevMiddlewares(app, webpackConfig);
13
- }
14
-
15
- return app;
16
- };
@@ -1,6 +0,0 @@
1
- const argv = require('./argv');
2
-
3
- module.exports = parseInt(
4
- argv.port || process.env.port || process.env.PORT || '3000',
5
- 10,
6
- );