@elliemae/pui-cli 6.4.0 → 6.5.3
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/lint/lint-staged.config.js +1 -1
- package/lib/monorepo/utils.js +15 -0
- package/lib/webpack/helpers.js +6 -3
- package/lib/webpack/webpack.lib.base.babel.js +24 -34
- package/lib/webpack/webpack.lib.dev.babel.js +0 -2
- package/lib/webpack/webpack.lib.prod.babel.js +0 -2
- package/lib/webpack/webpack.storybook.js +6 -6
- package/package.json +6 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
+
'*.{js,ts,jsx,tsx,md,mdx,html,css,json}': ['prettier --write'],
|
|
4
5
|
'*.{ts,tsx}': [
|
|
5
6
|
`node ${path.resolve(
|
|
6
7
|
__dirname,
|
|
@@ -12,5 +13,4 @@ module.exports = {
|
|
|
12
13
|
'npm run test:staged',
|
|
13
14
|
'npm run gendoc',
|
|
14
15
|
],
|
|
15
|
-
'*.{js,ts,jsx,tsx,md,mdx,html,css,json}': ['prettier --write'],
|
|
16
16
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { sync: findUp } = require('find-up');
|
|
3
|
+
|
|
4
|
+
const WORKSPACE_DIR_ENV_VAR = 'NPM_CONFIG_WORKSPACE_DIR';
|
|
5
|
+
const WORKSPACE_MANIFEST_FILENAME = 'pnpm-workspace.yaml';
|
|
6
|
+
|
|
7
|
+
exports.findPnpmWorkspaceDir = (cwd) => {
|
|
8
|
+
const workspaceManifestDirEnvVar =
|
|
9
|
+
process.env[WORKSPACE_DIR_ENV_VAR] ??
|
|
10
|
+
process.env[WORKSPACE_DIR_ENV_VAR.toLowerCase()];
|
|
11
|
+
const workspaceManifestLocation = workspaceManifestDirEnvVar
|
|
12
|
+
? path.join(workspaceManifestDirEnvVar, 'pnpm-workspace.yaml')
|
|
13
|
+
: findUp([WORKSPACE_MANIFEST_FILENAME, 'pnpm-workspace.yml'], { cwd });
|
|
14
|
+
return workspaceManifestLocation && path.dirname(workspaceManifestLocation);
|
|
15
|
+
};
|
package/lib/webpack/helpers.js
CHANGED
|
@@ -4,6 +4,7 @@ const fs = require('fs');
|
|
|
4
4
|
const _ = require('lodash');
|
|
5
5
|
const CompressionPlugin = require('compression-webpack-plugin');
|
|
6
6
|
const zlib = require('zlib');
|
|
7
|
+
const { findPnpmWorkspaceDir } = require('../monorepo/utils');
|
|
7
8
|
|
|
8
9
|
let pathSep = path.sep;
|
|
9
10
|
if (pathSep === '\\')
|
|
@@ -66,8 +67,9 @@ const mapToFolder = (dependencies, folder) =>
|
|
|
66
67
|
{},
|
|
67
68
|
);
|
|
68
69
|
|
|
69
|
-
const getAlias = () =>
|
|
70
|
-
|
|
70
|
+
const getAlias = () => {
|
|
71
|
+
const monorepoRoot = findPnpmWorkspaceDir(process.cwd()) || '';
|
|
72
|
+
return mapToFolder(
|
|
71
73
|
[
|
|
72
74
|
'@babel/runtime',
|
|
73
75
|
'react',
|
|
@@ -85,8 +87,9 @@ const getAlias = () =>
|
|
|
85
87
|
'@elliemae/pui-app-sdk$',
|
|
86
88
|
'@elliemae/pui-theme$',
|
|
87
89
|
],
|
|
88
|
-
'./node_modules',
|
|
90
|
+
path.join(monorepoRoot, './node_modules'),
|
|
89
91
|
);
|
|
92
|
+
};
|
|
90
93
|
|
|
91
94
|
const modulesToTranspile = [
|
|
92
95
|
'@elliemae/pui-*',
|
|
@@ -10,6 +10,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
10
10
|
const PostcssPresetEnv = require('postcss-preset-env');
|
|
11
11
|
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
|
|
12
12
|
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
13
|
+
const ResolveTypeScriptPlugin = require('resolve-typescript-plugin');
|
|
13
14
|
const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
14
15
|
|
|
15
16
|
const {
|
|
@@ -30,28 +31,35 @@ const minicssLoader = {
|
|
|
30
31
|
const finalCSSLoader = (mode) =>
|
|
31
32
|
mode !== 'production' ? { loader: 'style-loader' } : minicssLoader;
|
|
32
33
|
|
|
34
|
+
const copyPluginPatterns = filterByFilePresence([
|
|
35
|
+
{
|
|
36
|
+
from: 'lib/app.config.json',
|
|
37
|
+
to: 'app.config.json',
|
|
38
|
+
noErrorOnMissing: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
from: 'public',
|
|
42
|
+
noErrorOnMissing: true,
|
|
43
|
+
},
|
|
44
|
+
]);
|
|
45
|
+
|
|
33
46
|
const plugins = [
|
|
34
47
|
new EnvironmentPlugin({
|
|
35
|
-
NODE_ENV: 'development',
|
|
36
48
|
ASSET_PATH: '/',
|
|
37
49
|
CI: 'false',
|
|
38
50
|
}),
|
|
39
51
|
new DefinePlugin({
|
|
40
52
|
APP_CONFIG: getAppConfig(true),
|
|
41
53
|
}),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
noErrorOnMissing: true,
|
|
52
|
-
},
|
|
53
|
-
]),
|
|
54
|
-
}),
|
|
54
|
+
/* eslint-disable indent */
|
|
55
|
+
...(copyPluginPatterns.length > 0
|
|
56
|
+
? [
|
|
57
|
+
new CopyWebpackPlugin({
|
|
58
|
+
patterns: copyPluginPatterns,
|
|
59
|
+
}),
|
|
60
|
+
]
|
|
61
|
+
: []),
|
|
62
|
+
/* eslint-enable indent */
|
|
55
63
|
new DuplicatePackageCheckerPlugin(),
|
|
56
64
|
new LimitChunkCountPlugin({
|
|
57
65
|
maxChunks: 1,
|
|
@@ -102,25 +110,6 @@ module.exports = (options) => ({
|
|
|
102
110
|
},
|
|
103
111
|
},
|
|
104
112
|
},
|
|
105
|
-
{
|
|
106
|
-
test: /\.exec\.js$/,
|
|
107
|
-
exclude: /node_modules/,
|
|
108
|
-
use: [
|
|
109
|
-
{
|
|
110
|
-
loader: 'imports-loader',
|
|
111
|
-
options: {
|
|
112
|
-
wrapper: {
|
|
113
|
-
thisArg: 'window',
|
|
114
|
-
args: {
|
|
115
|
-
module: false,
|
|
116
|
-
exports: false,
|
|
117
|
-
define: false,
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
},
|
|
124
113
|
{
|
|
125
114
|
test: /\.css$/,
|
|
126
115
|
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
@@ -191,12 +180,13 @@ module.exports = (options) => ({
|
|
|
191
180
|
plugins: plugins.concat(options.plugins || []),
|
|
192
181
|
resolve: {
|
|
193
182
|
modules: ['node_modules', 'app', 'lib'],
|
|
194
|
-
extensions: ['.
|
|
183
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '.wasm', '.mjs'],
|
|
195
184
|
mainFields: ['browser', 'module', 'main'],
|
|
196
185
|
alias: {
|
|
197
186
|
...getAlias(),
|
|
198
187
|
...((options.resolve || {}).alias || {}),
|
|
199
188
|
},
|
|
189
|
+
plugins: [new ResolveTypeScriptPlugin({})],
|
|
200
190
|
},
|
|
201
191
|
externals: {
|
|
202
192
|
'@elliemae/pui-user-monitoring': 'emuiUserMonitoring',
|
|
@@ -8,7 +8,6 @@ const libraryName = getLibraryName();
|
|
|
8
8
|
module.exports = require('./webpack.lib.base.babel')({
|
|
9
9
|
mode: 'development',
|
|
10
10
|
|
|
11
|
-
// Don't use hashes in dev mode for better performance
|
|
12
11
|
output: {
|
|
13
12
|
filename: `js/${libraryName}.js`,
|
|
14
13
|
chunkFilename: `js/${libraryName}.chunk.js`,
|
|
@@ -25,7 +24,6 @@ module.exports = require('./webpack.lib.base.babel')({
|
|
|
25
24
|
alias: {},
|
|
26
25
|
},
|
|
27
26
|
|
|
28
|
-
// Add development plugins
|
|
29
27
|
plugins: [
|
|
30
28
|
new HtmlWebpackPlugin({
|
|
31
29
|
scriptLoading: 'module',
|
|
@@ -11,7 +11,6 @@ const libraryName = getLibraryName();
|
|
|
11
11
|
module.exports = require('./webpack.lib.base.babel')({
|
|
12
12
|
mode: 'production',
|
|
13
13
|
|
|
14
|
-
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
|
|
15
14
|
output: {
|
|
16
15
|
filename: `js/${libraryName}.[chunkhash].js`,
|
|
17
16
|
chunkFilename: `js/${libraryName}.[chunkhash].chunk.js`,
|
|
@@ -36,7 +35,6 @@ module.exports = require('./webpack.lib.base.babel')({
|
|
|
36
35
|
},
|
|
37
36
|
|
|
38
37
|
plugins: [
|
|
39
|
-
// Minify and optimize the index.html
|
|
40
38
|
new HtmlWebpackPlugin({
|
|
41
39
|
scriptLoading: 'module',
|
|
42
40
|
template: 'lib/index.pug',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { DefinePlugin, EnvironmentPlugin } = require('webpack');
|
|
2
2
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
3
3
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
4
|
-
const ResolveTypeScriptPlugin = require('resolve-typescript-plugin')
|
|
4
|
+
const ResolveTypeScriptPlugin = require('resolve-typescript-plugin');
|
|
5
5
|
const {
|
|
6
6
|
getAppConfig,
|
|
7
7
|
isApp,
|
|
@@ -13,10 +13,10 @@ const IS_APP = isApp();
|
|
|
13
13
|
const CWD = process.cwd();
|
|
14
14
|
|
|
15
15
|
const getAdditionalPlugins = () => [
|
|
16
|
-
new
|
|
16
|
+
new DefinePlugin({
|
|
17
17
|
APP_CONFIG: getAppConfig(),
|
|
18
18
|
}),
|
|
19
|
-
new
|
|
19
|
+
new EnvironmentPlugin({
|
|
20
20
|
IS_APP,
|
|
21
21
|
CWD,
|
|
22
22
|
}),
|
|
@@ -37,7 +37,7 @@ const getAdditionalPlugins = () => [
|
|
|
37
37
|
noErrorOnMissing: true,
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
from: '
|
|
40
|
+
from: 'public',
|
|
41
41
|
noErrorOnMissing: true,
|
|
42
42
|
},
|
|
43
43
|
],
|
|
@@ -74,7 +74,7 @@ exports.webpackFinal = async (config, { configType }) => {
|
|
|
74
74
|
config.resolve.extensions.push('.svg');
|
|
75
75
|
config.resolve.plugins = [
|
|
76
76
|
...(config.resolve.plugins || []),
|
|
77
|
-
new ResolveTypeScriptPlugin(),
|
|
77
|
+
new ResolveTypeScriptPlugin({}),
|
|
78
78
|
];
|
|
79
79
|
config.externals = config.externals || {};
|
|
80
80
|
config.externals['@elliemae/pui-user-monitoring'] = 'emuiUserMonitoring';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "ICE MT UI Platform CLI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
146
146
|
"eslint-plugin-import": "~2.25.4",
|
|
147
147
|
"eslint-plugin-jest": "~26.1.0",
|
|
148
|
-
"eslint-plugin-jsdoc": "~37.
|
|
148
|
+
"eslint-plugin-jsdoc": "~37.9.0",
|
|
149
149
|
"eslint-plugin-jsx-a11y": "~6.5.1",
|
|
150
150
|
"eslint-plugin-mdx": "~1.16.0",
|
|
151
151
|
"eslint-plugin-prettier": "~4.0.0",
|
|
@@ -158,9 +158,10 @@
|
|
|
158
158
|
"execa": "~5.1.1",
|
|
159
159
|
"express": "~4.17.2",
|
|
160
160
|
"express-pino-logger": "~7.0.0",
|
|
161
|
-
"express-static-gzip": "~2.1.
|
|
161
|
+
"express-static-gzip": "~2.1.4",
|
|
162
162
|
"favicons": "~6.2.2",
|
|
163
163
|
"favicons-webpack-plugin": "~5.0.2",
|
|
164
|
+
"find-up": "~5.0.0",
|
|
164
165
|
"happy-dom": "~2.31.1",
|
|
165
166
|
"helmet-csp": "~3.4.0",
|
|
166
167
|
"html-webpack-plugin": "~5.5.0",
|
|
@@ -221,12 +222,12 @@
|
|
|
221
222
|
"swc-loader": "~0.1.15",
|
|
222
223
|
"terser-webpack-plugin": "~5.3.1",
|
|
223
224
|
"ts-node": "~10.5.0",
|
|
224
|
-
"tsc-alias": "~1.
|
|
225
|
+
"tsc-alias": "~1.6.0",
|
|
225
226
|
"typescript": "~4.5.5",
|
|
226
227
|
"update-notifier": "~5.1.0",
|
|
227
228
|
"url-loader": "~4.1.1",
|
|
228
229
|
"uuid": "~8.3.2",
|
|
229
|
-
"vite": "~2.8.
|
|
230
|
+
"vite": "~2.8.1",
|
|
230
231
|
"vitest": "~0.3.2",
|
|
231
232
|
"webpack": "~5.65.0",
|
|
232
233
|
"webpack-bundle-analyzer": "~4.5.0",
|