@elliemae/pui-cli 6.12.0 → 6.13.0-beta.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.
|
@@ -1,17 +1,22 @@
|
|
|
1
|
+
const path = require('path');
|
|
1
2
|
const { exit } = require('yargs');
|
|
2
3
|
const { exec, logError, logSuccess } = require('./utils');
|
|
3
4
|
|
|
4
|
-
const { name } = require('../../package.json');
|
|
5
|
-
|
|
6
5
|
async function startProdServer() {
|
|
7
6
|
await exec(
|
|
8
|
-
`cross-env NODE_ENV=production ts-node
|
|
7
|
+
`cross-env NODE_ENV=production ts-node ${path.resolve(
|
|
8
|
+
__dirname,
|
|
9
|
+
'../server',
|
|
10
|
+
)} --color always`,
|
|
9
11
|
);
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
async function startDevServer() {
|
|
13
15
|
await exec(
|
|
14
|
-
`cross-env NODE_ENV=development
|
|
16
|
+
`cross-env NODE_ENV=development webpack serve --config ${path.resolve(
|
|
17
|
+
__dirname,
|
|
18
|
+
'../webpack/webpack.dev.babel.js',
|
|
19
|
+
)}`,
|
|
15
20
|
);
|
|
16
21
|
}
|
|
17
22
|
|
package/lib/webpack/helpers.js
CHANGED
|
@@ -150,7 +150,6 @@ const getENCWLoaderFileName = () => {
|
|
|
150
150
|
)[0];
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
// base path for index page
|
|
154
153
|
const getAssetPath = () => (process.env.ASSET_PATH || '/').replace(/\/?$/, '/');
|
|
155
154
|
|
|
156
155
|
const getAppVersion = () => {
|
|
@@ -161,19 +160,19 @@ const getAppVersion = () => {
|
|
|
161
160
|
|
|
162
161
|
const getPaths = (latestVersion = true) => {
|
|
163
162
|
const version = latestVersion ? LATEST_VERSION : getAppVersion();
|
|
164
|
-
const publicPath = `${
|
|
163
|
+
const publicPath = `${version}/`;
|
|
165
164
|
const timeStampQuery =
|
|
166
165
|
process.env.PUI_PIPELINE !== 'true' ? `?timeStamp=${Date.now()}` : '';
|
|
167
166
|
return {
|
|
168
167
|
appVersion: version,
|
|
169
|
-
buildPath: path.resolve(process.cwd(), `build/public
|
|
168
|
+
buildPath: path.resolve(process.cwd(), `build/public/`),
|
|
170
169
|
// base path for all assets
|
|
171
170
|
publicPath,
|
|
172
|
-
userMonScriptPath:
|
|
173
|
-
appLoaderScriptPath:
|
|
174
|
-
diagnosticsScriptPath:
|
|
175
|
-
globalScriptPath:
|
|
176
|
-
encwLoaderScriptPath:
|
|
171
|
+
userMonScriptPath: `latest/js/${getUserMonitoringFileName()}`,
|
|
172
|
+
appLoaderScriptPath: `latest/js/${getAppLoaderFileName()}`,
|
|
173
|
+
diagnosticsScriptPath: `latest/js/${getDiagnosticsFileName()}`,
|
|
174
|
+
globalScriptPath: `latest/js/global.js${timeStampQuery}`,
|
|
175
|
+
encwLoaderScriptPath: `latest/js/${getENCWLoaderFileName()}`,
|
|
177
176
|
};
|
|
178
177
|
};
|
|
179
178
|
|
|
@@ -29,13 +29,13 @@ const finalCSSLoader = (mode) =>
|
|
|
29
29
|
mode !== 'production' ? { loader: 'style-loader' } : minicssLoader;
|
|
30
30
|
|
|
31
31
|
const postcssPlugins = [PostcssPresetEnv({ autoprefixer: { grid: true } })];
|
|
32
|
-
const { buildPath
|
|
32
|
+
const { buildPath } = getPaths();
|
|
33
33
|
|
|
34
34
|
const plugins = [
|
|
35
35
|
new webpack.EnvironmentPlugin({
|
|
36
36
|
NODE_ENV: 'development',
|
|
37
37
|
ASSET_PATH: '/',
|
|
38
|
-
PUBLIC_PATH: publicPath,
|
|
38
|
+
// PUBLIC_PATH: publicPath,
|
|
39
39
|
CI: 'false',
|
|
40
40
|
}),
|
|
41
41
|
new webpack.DefinePlugin({
|
|
@@ -48,46 +48,47 @@ const plugins = [
|
|
|
48
48
|
patterns: filterByFilePresence([
|
|
49
49
|
{
|
|
50
50
|
from: 'app/app.config.json',
|
|
51
|
-
to: 'app.config.json',
|
|
51
|
+
to: './latest/app.config.json',
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
from: 'app/robots.txt',
|
|
55
|
-
to: '
|
|
55
|
+
to: 'robots.txt',
|
|
56
56
|
noErrorOnMissing: true,
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
from: 'app/global*.js',
|
|
60
|
-
to: 'js/[name][ext]',
|
|
60
|
+
to: './latest/js/[name][ext]',
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
from: 'node_modules/@elliemae/pui-user-monitoring/dist/public/js',
|
|
64
|
-
to: 'js',
|
|
64
|
+
to: './latest/js',
|
|
65
65
|
toType: 'dir',
|
|
66
66
|
info: { minimized: true },
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
from: 'node_modules/@elliemae/pui-app-loader/dist/public/js',
|
|
70
|
-
to: 'js',
|
|
70
|
+
to: './latest/js',
|
|
71
71
|
toType: 'dir',
|
|
72
72
|
noErrorOnMissing: true,
|
|
73
73
|
info: { minimized: true },
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
from: 'node_modules/@elliemae/encw-loader/dist/public/js',
|
|
77
|
-
to: 'js',
|
|
77
|
+
to: './latest/js',
|
|
78
78
|
toType: 'dir',
|
|
79
79
|
noErrorOnMissing: true,
|
|
80
80
|
info: { minimized: true },
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
from: 'node_modules/@elliemae/pui-diagnostics/dist/public/js',
|
|
84
|
-
to: 'js',
|
|
84
|
+
to: './latest/js',
|
|
85
85
|
toType: 'dir',
|
|
86
86
|
noErrorOnMissing: true,
|
|
87
87
|
info: { minimized: true },
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
from: 'public',
|
|
91
|
+
to: './latest',
|
|
91
92
|
noErrorOnMissing: true,
|
|
92
93
|
globOptions: {
|
|
93
94
|
ignore: ['readme.md'],
|
|
@@ -95,7 +96,6 @@ const plugins = [
|
|
|
95
96
|
},
|
|
96
97
|
{
|
|
97
98
|
from: 'webroot',
|
|
98
|
-
to: '../',
|
|
99
99
|
noErrorOnMissing: true,
|
|
100
100
|
globOptions: {
|
|
101
101
|
ignore: ['readme.md'],
|
|
@@ -105,8 +105,16 @@ const plugins = [
|
|
|
105
105
|
}),
|
|
106
106
|
new DuplicatePackageCheckerPlugin(),
|
|
107
107
|
new MomentLocalesPlugin({ localesToKeep: ['es-us'] }),
|
|
108
|
-
new WebpackManifestPlugin(
|
|
108
|
+
new WebpackManifestPlugin({
|
|
109
|
+
fileName: './latest/manifest.json',
|
|
110
|
+
publicPath: '',
|
|
111
|
+
map: (file) => {
|
|
112
|
+
file.name = file.name.replace(/^latest\//, '');
|
|
113
|
+
return file;
|
|
114
|
+
},
|
|
115
|
+
}),
|
|
109
116
|
new FaviconsWebpackPlugin({
|
|
117
|
+
outputPath: './latest/assets',
|
|
110
118
|
logo: './app/view/images/favicon.png',
|
|
111
119
|
favicons: {
|
|
112
120
|
developerName: 'ICE MT',
|
|
@@ -126,7 +134,7 @@ module.exports = (options) => ({
|
|
|
126
134
|
output: {
|
|
127
135
|
clean: true,
|
|
128
136
|
path: buildPath,
|
|
129
|
-
publicPath,
|
|
137
|
+
publicPath: 'auto',
|
|
130
138
|
...options.output,
|
|
131
139
|
}, // Merge with env dependent settings
|
|
132
140
|
optimization: options.optimization,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const { HotModuleReplacementPlugin } = require('webpack');
|
|
3
2
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
3
|
const CircularDependencyPlugin = require('circular-dependency-plugin');
|
|
5
4
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
@@ -9,7 +8,6 @@ const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
|
|
|
9
8
|
const smp = new SpeedMeasurePlugin({ disable: !process.env.MEASURE });
|
|
10
9
|
|
|
11
10
|
const {
|
|
12
|
-
getAssetPath,
|
|
13
11
|
isAppLoaderEnabled,
|
|
14
12
|
getPaths,
|
|
15
13
|
isGoogleTagManagerEnabled,
|
|
@@ -18,7 +16,6 @@ const baseConfigFactory = require('./webpack.base.babel');
|
|
|
18
16
|
|
|
19
17
|
const {
|
|
20
18
|
appVersion,
|
|
21
|
-
publicPath,
|
|
22
19
|
userMonScriptPath,
|
|
23
20
|
globalScriptPath,
|
|
24
21
|
appLoaderScriptPath,
|
|
@@ -76,15 +73,12 @@ const devConfig = {
|
|
|
76
73
|
// Add development plugins
|
|
77
74
|
plugins: [
|
|
78
75
|
new HtmlWebpackPlugin({
|
|
79
|
-
scriptLoading: 'module',
|
|
80
76
|
inject: !isAppLoaderEnabled(), // Inject all files that are generated by webpack, e.g. bundle.js
|
|
81
77
|
template: !isAppLoaderEnabled()
|
|
82
78
|
? 'app/index.html'
|
|
83
79
|
: 'app/index-app-loader.html',
|
|
84
80
|
emui: {
|
|
85
81
|
appVersion,
|
|
86
|
-
assetPath: publicPath,
|
|
87
|
-
basePath: getAssetPath(),
|
|
88
82
|
globalScriptPath,
|
|
89
83
|
userMonScriptPath,
|
|
90
84
|
appLoaderScriptPath,
|
|
@@ -108,11 +102,12 @@ const devConfig = {
|
|
|
108
102
|
performance: {
|
|
109
103
|
hints: false,
|
|
110
104
|
},
|
|
105
|
+
|
|
106
|
+
devServer: {},
|
|
111
107
|
};
|
|
112
108
|
|
|
113
109
|
const config = smp.wrap(baseConfigFactory(devConfig));
|
|
114
110
|
config.plugins = config.plugins.concat([
|
|
115
|
-
new HotModuleReplacementPlugin(),
|
|
116
111
|
new ReactRefreshWebpackPlugin({
|
|
117
112
|
overlay: {
|
|
118
113
|
sockIntegration: 'whm',
|
|
@@ -10,7 +10,6 @@ const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
|
10
10
|
|
|
11
11
|
const baseConfigFactory = require('./webpack.base.babel');
|
|
12
12
|
const {
|
|
13
|
-
getAssetPath,
|
|
14
13
|
isAppLoaderEnabled,
|
|
15
14
|
LATEST_VERSION,
|
|
16
15
|
getPaths,
|
|
@@ -20,7 +19,7 @@ const {
|
|
|
20
19
|
} = require('./helpers');
|
|
21
20
|
|
|
22
21
|
const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
23
|
-
const { buildPath
|
|
22
|
+
const { buildPath } = getPaths(latestVersion);
|
|
24
23
|
|
|
25
24
|
return {
|
|
26
25
|
mode: 'production',
|
|
@@ -32,10 +31,10 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
32
31
|
// Utilize long-term caching by adding content hashes (not compilation hashes) to compiled assets
|
|
33
32
|
output: {
|
|
34
33
|
path: buildPath,
|
|
35
|
-
publicPath,
|
|
36
|
-
filename: 'js/[name].[contenthash].js',
|
|
37
|
-
chunkFilename: 'js/[name].[contenthash].chunk.js',
|
|
38
|
-
assetModuleFilename: 'assets/[name].[hash][ext][query]',
|
|
34
|
+
publicPath: 'auto',
|
|
35
|
+
filename: 'latest/js/[name].[contenthash].js',
|
|
36
|
+
chunkFilename: 'latest/js/[name].[contenthash].chunk.js',
|
|
37
|
+
assetModuleFilename: 'latest/assets/[name].[hash][ext][query]',
|
|
39
38
|
},
|
|
40
39
|
|
|
41
40
|
optimization: {
|
|
@@ -64,11 +63,6 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
64
63
|
},
|
|
65
64
|
|
|
66
65
|
plugins: [
|
|
67
|
-
// new MiniCssExtractPlugin({
|
|
68
|
-
// filename: 'css/[name].[contenthash].css',
|
|
69
|
-
// chunkFilename: 'css/[name].[contenthash].chunk.css',
|
|
70
|
-
// }),
|
|
71
|
-
|
|
72
66
|
...getCompressionPlugins(),
|
|
73
67
|
|
|
74
68
|
new BundleAnalyzerPlugin({
|
|
@@ -78,7 +72,7 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
78
72
|
}),
|
|
79
73
|
|
|
80
74
|
new GenerateSW({
|
|
81
|
-
swDest: '
|
|
75
|
+
swDest: 'sw.js',
|
|
82
76
|
clientsClaim: true,
|
|
83
77
|
skipWaiting: true,
|
|
84
78
|
}),
|
|
@@ -94,7 +88,6 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
94
88
|
};
|
|
95
89
|
|
|
96
90
|
const {
|
|
97
|
-
publicPath,
|
|
98
91
|
userMonScriptPath,
|
|
99
92
|
globalScriptPath,
|
|
100
93
|
appLoaderScriptPath,
|
|
@@ -102,8 +95,6 @@ const {
|
|
|
102
95
|
encwLoaderScriptPath,
|
|
103
96
|
} = getPaths();
|
|
104
97
|
const htmlWebpackPlugin = new HtmlWebpackPlugin({
|
|
105
|
-
scriptLoading: 'module',
|
|
106
|
-
filename: '../index.html',
|
|
107
98
|
inject: !isAppLoaderEnabled(),
|
|
108
99
|
template: !isAppLoaderEnabled()
|
|
109
100
|
? 'app/index.html'
|
|
@@ -122,8 +113,6 @@ const htmlWebpackPlugin = new HtmlWebpackPlugin({
|
|
|
122
113
|
},
|
|
123
114
|
emui: {
|
|
124
115
|
appVersion: 'latest',
|
|
125
|
-
assetPath: publicPath,
|
|
126
|
-
basePath: getAssetPath(),
|
|
127
116
|
globalScriptPath,
|
|
128
117
|
userMonScriptPath,
|
|
129
118
|
appLoaderScriptPath,
|
|
@@ -151,8 +140,8 @@ const addSMPPlugin = (config) => {
|
|
|
151
140
|
// mini css extract plugin is not working fine with smp
|
|
152
141
|
smpConfig.plugins.push(
|
|
153
142
|
new MiniCssExtractPlugin({
|
|
154
|
-
filename: 'css/[name].[contenthash].css',
|
|
155
|
-
chunkFilename: 'css/[name].[contenthash].chunk.css',
|
|
143
|
+
filename: 'latest/css/[name].[contenthash].css',
|
|
144
|
+
chunkFilename: 'latest/css/[name].[contenthash].chunk.css',
|
|
156
145
|
}),
|
|
157
146
|
);
|
|
158
147
|
return smpConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.13.0-beta.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "ICE MT UI Platform CLI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"@commitlint/config-conventional": "~16.2.1",
|
|
68
68
|
"@elliemae/browserslist-config-elliemae-latest-browsers": "~1.3.0",
|
|
69
69
|
"@faker-js/faker": "6.0.0",
|
|
70
|
-
"@nrwl/cli": "13.9.
|
|
71
|
-
"@nrwl/tao": "13.9.
|
|
72
|
-
"@nrwl/workspace": "13.9.
|
|
70
|
+
"@nrwl/cli": "13.9.3",
|
|
71
|
+
"@nrwl/tao": "13.9.3",
|
|
72
|
+
"@nrwl/workspace": "13.9.3",
|
|
73
73
|
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.4",
|
|
74
74
|
"@semantic-release/changelog": "~6.0.1",
|
|
75
75
|
"@semantic-release/exec": "~6.0.3",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@stylelint/postcss-css-in-js": "~0.37.2",
|
|
88
88
|
"@svgr/webpack": "~6.2.1",
|
|
89
89
|
"@swc/cli": "~0.1.55",
|
|
90
|
-
"@swc/core": "~1.2.
|
|
90
|
+
"@swc/core": "~1.2.158",
|
|
91
91
|
"@swc/jest": "~0.2.20",
|
|
92
92
|
"@testing-library/jest-dom": "~5.16.2",
|
|
93
93
|
"@testing-library/react": "~12.1.4",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"eslint": "~8.11.0",
|
|
138
138
|
"eslint-config-airbnb": "~19.0.4",
|
|
139
139
|
"eslint-config-airbnb-base": "~15.0.0",
|
|
140
|
-
"eslint-config-airbnb-typescript": "~16.1.
|
|
140
|
+
"eslint-config-airbnb-typescript": "~16.1.3",
|
|
141
141
|
"eslint-config-prettier": "~8.5.0",
|
|
142
142
|
"eslint-config-react-app": "~7.0.0",
|
|
143
143
|
"eslint-import-resolver-babel-module": "~5.3.1",
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"jscodeshift": "~0.13.1",
|
|
181
181
|
"jsdoc": "~3.6.10",
|
|
182
182
|
"lerna": "~4.0.0",
|
|
183
|
-
"lint-staged": "~12.3.
|
|
183
|
+
"lint-staged": "~12.3.7",
|
|
184
184
|
"mini-css-extract-plugin": "~2.6.0",
|
|
185
185
|
"minimist": "~1.2.5",
|
|
186
186
|
"moment": "~2.29.1",
|
|
@@ -190,10 +190,10 @@
|
|
|
190
190
|
"node-plop": "~0.30.0",
|
|
191
191
|
"nodemon": "~2.0.15",
|
|
192
192
|
"normalize-path": "~3.0.0",
|
|
193
|
-
"npm-check-updates": "12.5.
|
|
193
|
+
"npm-check-updates": "12.5.4",
|
|
194
194
|
"null-loader": "~4.0.1",
|
|
195
|
-
"pino": "~7.
|
|
196
|
-
"pino-pretty": "~7.5.
|
|
195
|
+
"pino": "~7.9.1",
|
|
196
|
+
"pino-pretty": "~7.5.4",
|
|
197
197
|
"pinst": "~3.0.0",
|
|
198
198
|
"plop": "~3.0.5",
|
|
199
199
|
"postcss": "~8.4.12",
|
|
@@ -218,7 +218,7 @@
|
|
|
218
218
|
"slackify-markdown": "~4.3.1",
|
|
219
219
|
"speed-measure-webpack-plugin": "~1.5.0",
|
|
220
220
|
"storybook-addon-turbo-build": "~1.1.0",
|
|
221
|
-
"storybook-builder-vite": "~0.1.
|
|
221
|
+
"storybook-builder-vite": "~0.1.21",
|
|
222
222
|
"storybook-react-router": "~1.0.8",
|
|
223
223
|
"style-loader": "~3.3.1",
|
|
224
224
|
"stylelint": "~14.6.0",
|
|
@@ -233,11 +233,12 @@
|
|
|
233
233
|
"url-loader": "~4.1.1",
|
|
234
234
|
"uuid": "~8.3.2",
|
|
235
235
|
"vite": "~2.8.6",
|
|
236
|
-
"vitest": "~0.
|
|
237
|
-
"webpack": "~5.
|
|
236
|
+
"vitest": "~0.7.4",
|
|
237
|
+
"webpack": "~5.70.0",
|
|
238
238
|
"webpack-bundle-analyzer": "~4.5.0",
|
|
239
239
|
"webpack-cli": "~4.9.2",
|
|
240
240
|
"webpack-dev-middleware": "~5.3.1",
|
|
241
|
+
"webpack-dev-server": "~4.7.4",
|
|
241
242
|
"webpack-hot-middleware": "~2.25.1",
|
|
242
243
|
"webpack-manifest-plugin": "~5.0.0",
|
|
243
244
|
"webpack-merge": "~5.8.0",
|