@elliemae/pui-cli 6.0.0-beta.45 → 6.0.0-beta.49

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.
@@ -34,7 +34,10 @@ const baseRules = {
34
34
  'import/no-dynamic-require': 0,
35
35
  'import/no-extraneous-dependencies': 0,
36
36
  'import/no-named-as-default': 0,
37
- 'import/no-unresolved': 0, // ToDo: set this to error once this issue is resolved https://github.com/import-js/eslint-plugin-import/issues/1868
37
+ 'import/no-unresolved': [
38
+ 2,
39
+ { caseSensitive: true, caseSensitiveStrict: true },
40
+ ], // Tip: https://github.com/import-js/eslint-plugin-import/issues/1868
38
41
  'import/no-webpack-loader-syntax': 0,
39
42
  'import/prefer-default-export': 0,
40
43
  'import/extensions': [
@@ -3,12 +3,13 @@ const fg = require('fast-glob');
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
5
  const { getPUIConfig } = require('../pui-config');
6
+ // const browserslistToEsbuild = require('browserslist-to-esbuild');
6
7
 
7
8
  const { esBuild } = getPUIConfig();
8
9
 
9
10
  const commonConfig = {
10
11
  bundle: false,
11
- target: esBuild.target,
12
+ target: esBuild.target, // browserslistToEsbuild(),
12
13
  loader: { '.js': 'jsx' },
13
14
  mainFields: ['module', 'browser', 'main'],
14
15
  inject: [path.resolve(__dirname, './react-shim.js')],
@@ -4,11 +4,11 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4
4
  const PostcssPresetEnv = require('postcss-preset-env');
5
5
  const CopyWebpackPlugin = require('copy-webpack-plugin');
6
6
  const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
7
- const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
8
7
  const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
9
8
  const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
10
9
  const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
11
10
  const { ProvidePlugin } = require('webpack');
11
+ const browserslistToEsbuild = require('browserslist-to-esbuild');
12
12
 
13
13
  const {
14
14
  excludeNodeModulesExcept,
@@ -17,8 +17,6 @@ const {
17
17
  getAlias,
18
18
  getPaths,
19
19
  } = require('./helpers');
20
- const { getPUIConfig } = require('../pui-config');
21
- const { esBuild } = getPUIConfig();
22
20
 
23
21
  const minicssLoader = {
24
22
  loader: MiniCssExtractPlugin.loader,
@@ -41,7 +39,6 @@ const plugins = [
41
39
  new webpack.DefinePlugin({
42
40
  APP_CONFIG: getAppConfig(),
43
41
  }),
44
- new CaseSensitivePathsPlugin(),
45
42
  new ProvidePlugin({
46
43
  React: 'react',
47
44
  }),
@@ -99,7 +96,7 @@ const plugins = [
99
96
  ],
100
97
  }),
101
98
  new DuplicatePackageCheckerPlugin(),
102
- new MomentLocalesPlugin(),
99
+ new MomentLocalesPlugin({ localesToKeep: ['es-us'] }),
103
100
  new WebpackManifestPlugin(),
104
101
  new FaviconsWebpackPlugin({
105
102
  logo: './app/view/images/favicon.png',
@@ -127,24 +124,7 @@ module.exports = (options) => ({
127
124
  module: {
128
125
  rules: [
129
126
  {
130
- test: /\.[jt]sx?$/,
131
- enforce: 'pre',
132
- exclude: /node_modules/,
133
- resolve: {
134
- fullySpecified: false,
135
- },
136
- use: [
137
- {
138
- loader: 'webpack-strip-block',
139
- options: {
140
- start: 'TEST:START',
141
- end: 'TEST:END',
142
- },
143
- },
144
- ],
145
- },
146
- {
147
- test: /\.[j]sx?$/,
127
+ test: /\.jsx?$/,
148
128
  exclude: excludeNodeModulesExcept(modulesToTranspile),
149
129
  resolve: {
150
130
  fullySpecified: false,
@@ -153,12 +133,12 @@ module.exports = (options) => ({
153
133
  loader: 'esbuild-loader',
154
134
  options: {
155
135
  loader: 'jsx',
156
- target: esBuild.target,
136
+ target: browserslistToEsbuild(),
157
137
  },
158
138
  },
159
139
  },
160
140
  {
161
- test: /\.[t]sx?$/,
141
+ test: /\.tsx?$/,
162
142
  exclude: excludeNodeModulesExcept(modulesToTranspile),
163
143
  resolve: {
164
144
  fullySpecified: false,
@@ -167,7 +147,7 @@ module.exports = (options) => ({
167
147
  loader: 'esbuild-loader',
168
148
  options: {
169
149
  loader: 'tsx',
170
- target: esBuild.target,
150
+ target: browserslistToEsbuild(),
171
151
  },
172
152
  },
173
153
  },
@@ -229,7 +209,7 @@ module.exports = (options) => ({
229
209
  plugins: plugins.concat(options.plugins),
230
210
  resolve: {
231
211
  modules: ['node_modules', 'app', 'lib'],
232
- extensions: ['.wasm', '.mjs', '.ts', '.tsx', '.js', '.jsx', '.json'],
212
+ extensions: ['.js', '.jsx', '.ts', '.tsx', '.json', '.wasm', '.mjs'],
233
213
  mainFields: ['browser', 'module', 'main'],
234
214
  alias: {
235
215
  ...getAlias(),
@@ -4,6 +4,9 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
4
4
  const CircularDependencyPlugin = require('circular-dependency-plugin');
5
5
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
6
6
  const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
7
+ const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
8
+
9
+ const smp = new SpeedMeasurePlugin({ disable: !process.env.MEASURE });
7
10
 
8
11
  const {
9
12
  getAssetPath,
@@ -114,4 +117,4 @@ const devConfig = {
114
117
  },
115
118
  };
116
119
 
117
- module.exports = baseConfigFactory(devConfig);
120
+ module.exports = smp.wrap(baseConfigFactory(devConfig));
@@ -8,7 +8,6 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
8
8
  const CopyWebpackPlugin = require('copy-webpack-plugin');
9
9
  const PostcssPresetEnv = require('postcss-preset-env');
10
10
  const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
11
- const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
12
11
  const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
13
12
 
14
13
  const {
@@ -39,7 +38,6 @@ const plugins = [
39
38
  new webpack.DefinePlugin({
40
39
  APP_CONFIG: getAppConfig(true),
41
40
  }),
42
- new CaseSensitivePathsPlugin(),
43
41
  new CopyWebpackPlugin({
44
42
  patterns: [
45
43
  {
@@ -57,7 +55,7 @@ const plugins = [
57
55
  new LimitChunkCountPlugin({
58
56
  maxChunks: 1,
59
57
  }),
60
- new MomentLocalesPlugin(),
58
+ new MomentLocalesPlugin({ localesToKeep: ['es-us'] }),
61
59
  ];
62
60
 
63
61
  module.exports = (options) => ({
@@ -74,23 +72,6 @@ module.exports = (options) => ({
74
72
  optimization: options.optimization,
75
73
  module: {
76
74
  rules: [
77
- {
78
- test: /^(?!.*\.exec\.js$).*\.[jt]sx?$/,
79
- enforce: 'pre',
80
- exclude: /node_modules/,
81
- resolve: {
82
- fullySpecified: false,
83
- },
84
- use: [
85
- {
86
- loader: 'webpack-strip-block',
87
- options: {
88
- start: 'TEST:START',
89
- end: 'TEST:END',
90
- },
91
- },
92
- ],
93
- },
94
75
  {
95
76
  test: /^(?!.*\.exec\.js$).*\.jsx?$/, // Transform all .js and .jsx files with Babel
96
77
  exclude: excludeNodeModulesExcept(modulesToTranspile),
@@ -204,7 +185,7 @@ module.exports = (options) => ({
204
185
  plugins: plugins.concat(options.plugins || []),
205
186
  resolve: {
206
187
  modules: ['node_modules', 'app', 'lib'],
207
- extensions: ['.wasm', '.mjs', '.ts', '.tsx', '.js', '.jsx', '.json'],
188
+ extensions: ['.js', '.jsx', '.ts', '.tsx', '.json', '.wasm', '.mjs'],
208
189
  mainFields: ['browser', 'module', 'main'],
209
190
  alias: {
210
191
  ...getAlias(),
@@ -5,6 +5,7 @@ const { GenerateSW } = require('workbox-webpack-plugin');
5
5
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
6
6
  const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
7
7
  const { ESBuildMinifyPlugin } = require('esbuild-loader');
8
+ const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
8
9
 
9
10
  const baseConfigFactory = require('./webpack.base.babel');
10
11
  const {
@@ -64,10 +65,10 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
64
65
  },
65
66
 
66
67
  plugins: [
67
- new MiniCssExtractPlugin({
68
- filename: 'css/[name].[contenthash].css',
69
- chunkFilename: 'css/[name].[contenthash].chunk.css',
70
- }),
68
+ // new MiniCssExtractPlugin({
69
+ // filename: 'css/[name].[contenthash].css',
70
+ // chunkFilename: 'css/[name].[contenthash].chunk.css',
71
+ // }),
71
72
 
72
73
  ...getCompressionPlugins(),
73
74
 
@@ -144,6 +145,22 @@ const appVersionConfig = baseConfigFactory(
144
145
  getProdConfig({ latestVersion: false }),
145
146
  );
146
147
 
147
- module.exports = isVersionedApp
148
- ? [latestVersionConfig, appVersionConfig]
149
- : latestVersionConfig;
148
+ const addSMPPlugin = (config) => {
149
+ const smpConfig = new SpeedMeasurePlugin({
150
+ disable: !process.env.MEASURE,
151
+ }).wrap(config);
152
+ // mini css extract plugin is not working fine with smp
153
+ smpConfig.plugins.push(
154
+ new MiniCssExtractPlugin({
155
+ filename: 'css/[name].[contenthash].css',
156
+ chunkFilename: 'css/[name].[contenthash].chunk.css',
157
+ }),
158
+ );
159
+ return smpConfig;
160
+ };
161
+
162
+ const config = isVersionedApp
163
+ ? [latestVersionConfig, appVersionConfig].map(addSMPPlugin)
164
+ : addSMPPlugin(latestVersionConfig);
165
+
166
+ module.exports = config;
@@ -45,23 +45,6 @@ const getAdditionalPlugins = () => [
45
45
  ];
46
46
 
47
47
  const getModuleRules = () => [
48
- {
49
- test: /\.[jt]sx?$/,
50
- enforce: 'pre',
51
- exclude: /node_modules/,
52
- resolve: {
53
- fullySpecified: false,
54
- },
55
- use: [
56
- {
57
- loader: 'webpack-strip-block',
58
- options: {
59
- start: 'TEST:START',
60
- end: 'TEST:END',
61
- },
62
- },
63
- ],
64
- },
65
48
  {
66
49
  type: 'asset',
67
50
  resourceQuery: /url/,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "6.0.0-beta.45",
3
+ "version": "6.0.0-beta.49",
4
4
  "private": false,
5
5
  "description": "ICE MT UI Platform CLI",
6
6
  "sideEffects": false,
@@ -20,7 +20,7 @@
20
20
  "url": "https://git.elliemae.io/platform-ui/pui-cli.git"
21
21
  },
22
22
  "engines": {
23
- "npm": ">=8",
23
+ "pnpm": ">=6",
24
24
  "node": ">=16"
25
25
  },
26
26
  "author": "ICE MT",
@@ -38,8 +38,7 @@
38
38
  "storybook:build": "exit 0",
39
39
  "storybook:docs:build": "exit 0",
40
40
  "upgrade": "ncu -u && npm run setup",
41
- "prepare": "[ -n \"$CI\" ] || husky install",
42
- "preinstall": "npx only-allow pnpm"
41
+ "prepare": "[ -n \"$CI\" ] || husky install"
43
42
  },
44
43
  "jestSonar": {
45
44
  "sonar56x": true,
@@ -71,16 +70,16 @@
71
70
  "@semantic-release/changelog": "~6.0.1",
72
71
  "@semantic-release/exec": "~6.0.3",
73
72
  "@semantic-release/git": "~10.0.1",
74
- "@storybook/addon-a11y": "~6.4.12",
75
- "@storybook/addon-essentials": "~6.4.12",
73
+ "@storybook/addon-a11y": "~6.4.13",
74
+ "@storybook/addon-essentials": "~6.4.13",
76
75
  "@storybook/addon-events": "~6.2.9",
77
- "@storybook/addon-interactions": "~6.4.12",
78
- "@storybook/addon-links": "~6.4.12",
79
- "@storybook/addon-storysource": "~6.4.12",
80
- "@storybook/builder-webpack5": "~6.4.12",
81
- "@storybook/manager-webpack5": "~6.4.12",
82
- "@storybook/react": "~6.4.12",
83
- "@storybook/theming": "~6.4.12",
76
+ "@storybook/addon-interactions": "~6.4.13",
77
+ "@storybook/addon-links": "~6.4.13",
78
+ "@storybook/addon-storysource": "~6.4.13",
79
+ "@storybook/builder-webpack5": "~6.4.13",
80
+ "@storybook/manager-webpack5": "~6.4.13",
81
+ "@storybook/react": "~6.4.13",
82
+ "@storybook/theming": "~6.4.13",
84
83
  "@stylelint/postcss-css-in-js": "~0.37.2",
85
84
  "@svgr/webpack": "~6.2.0",
86
85
  "@swc/cli": "~0.1.55",
@@ -111,6 +110,7 @@
111
110
  "babel-plugin-transform-strip-block": "~0.0.5",
112
111
  "body-parser": "~1.19.1",
113
112
  "browserslist": "~4.19.1",
113
+ "browserslist-to-esbuild": "~1.1.1",
114
114
  "bundlesize": "~0.18.1",
115
115
  "case-sensitive-paths-webpack-plugin": "~2.4.0",
116
116
  "chalk": "~4.1.2",
@@ -126,7 +126,7 @@
126
126
  "css-minimizer-webpack-plugin": "~3.3.1",
127
127
  "depcheck": "~1.4.3",
128
128
  "docdash": "~1.2.0",
129
- "dotenv": "~11.0.0",
129
+ "dotenv": "~12.0.4",
130
130
  "dotenv-webpack": "~7.0.3",
131
131
  "duplicate-package-checker-webpack-plugin": "~3.0.0",
132
132
  "enhanced-resolve": "~5.8.3",
@@ -134,7 +134,7 @@
134
134
  "esbuild-jest": "~0.5.0",
135
135
  "esbuild-loader": "~2.18.0",
136
136
  "esbuild-plugin-svgr": "~1.0.0",
137
- "eslint": "~8.6.0",
137
+ "eslint": "~8.7.0",
138
138
  "eslint-config-airbnb": "~19.0.4",
139
139
  "eslint-config-airbnb-base": "~15.0.0",
140
140
  "eslint-config-airbnb-typescript": "~16.1.0",
@@ -146,7 +146,7 @@
146
146
  "eslint-plugin-compat": "~4.0.1",
147
147
  "eslint-plugin-eslint-comments": "~3.2.0",
148
148
  "eslint-plugin-import": "~2.25.4",
149
- "eslint-plugin-jest": "~25.3.4",
149
+ "eslint-plugin-jest": "~25.7.0",
150
150
  "eslint-plugin-jsdoc": "~37.6.1",
151
151
  "eslint-plugin-jsx-a11y": "~6.5.1",
152
152
  "eslint-plugin-mdx": "~1.16.0",
@@ -218,6 +218,7 @@
218
218
  "semantic-release": "~18.0.1",
219
219
  "shelljs": "~0.8.5",
220
220
  "slackify-markdown": "~4.3.1",
221
+ "speed-measure-webpack-plugin": "~1.5.0",
221
222
  "storybook-addon-turbo-build": "~1.0.1",
222
223
  "storybook-builder-vite": "~0.1.13",
223
224
  "storybook-react-router": "~1.0.8",
@@ -240,7 +241,7 @@
240
241
  "url-loader": "~4.1.1",
241
242
  "uuid": "~8.3.2",
242
243
  "vite": "~2.7.12",
243
- "vitest": "~0.1.13",
244
+ "vitest": "~0.1.17",
244
245
  "webpack": "~5.66.0",
245
246
  "webpack-bundle-analyzer": "~4.5.0",
246
247
  "webpack-cli": "~4.9.1",
@@ -255,6 +256,8 @@
255
256
  "yargs": "~17.3.1"
256
257
  },
257
258
  "devDependencies": {
259
+ "react": "~17.0.2",
260
+ "react-dom": "~17.0.2",
258
261
  "redux": "~4.1.2",
259
262
  "redux-saga": "~1.1.3",
260
263
  "styled-components": "~5.3.3"