@elliemae/pui-cli 6.0.0-beta.55 → 6.0.0-beta.59
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/cli-commands/build.js +11 -5
- package/lib/cli-commands/pack.js +17 -77
- package/lib/index.js +2 -0
- package/lib/testing/jest.config.js +0 -11
- package/lib/testing/jest.node.config.js +6 -0
- package/lib/transpile/esbuild.js +86 -39
- package/lib/webpack/webpack.lib.base.babel.js +12 -9
- package/lib/webpack/webpack.lib.dev.babel.js +1 -1
- package/lib/webpack/webpack.lib.prod.babel.js +2 -3
- package/lib/webpack/webpack.prod.babel.js +2 -3
- package/package.json +18 -18
|
@@ -6,11 +6,11 @@ const {
|
|
|
6
6
|
logSuccess,
|
|
7
7
|
writeAppInfo,
|
|
8
8
|
} = require('./utils');
|
|
9
|
+
const { esBuild, TARGETS } = require('../transpile/esbuild');
|
|
9
10
|
|
|
10
11
|
const { name } = require('../../package.json');
|
|
11
12
|
|
|
12
13
|
async function buildWebApp() {
|
|
13
|
-
logInfo('Build in progress...');
|
|
14
14
|
await exec(`rimraf ./build`);
|
|
15
15
|
await exec(
|
|
16
16
|
`cross-env NODE_ENV=production webpack --config node_modules/${name}/lib/webpack/webpack.prod.babel.js --color`,
|
|
@@ -20,13 +20,19 @@ async function buildWebApp() {
|
|
|
20
20
|
|
|
21
21
|
async function buildService() {
|
|
22
22
|
await exec('rimraf ./build');
|
|
23
|
-
await
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
await esBuild({
|
|
24
|
+
srcdir: './app',
|
|
25
|
+
outdir: 'build',
|
|
26
|
+
esmOnly: true,
|
|
27
|
+
target: TARGETS.node,
|
|
28
|
+
injectReactShim: false,
|
|
29
|
+
skipNestedPackageJSON: true,
|
|
30
|
+
});
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
async function handler({ service = false }) {
|
|
29
34
|
try {
|
|
35
|
+
logInfo('Build in progress...');
|
|
30
36
|
if (service) await buildService();
|
|
31
37
|
else await buildWebApp();
|
|
32
38
|
logSuccess('Build completed');
|
|
@@ -38,7 +44,7 @@ async function handler({ service = false }) {
|
|
|
38
44
|
|
|
39
45
|
exports.command = 'build';
|
|
40
46
|
|
|
41
|
-
exports.describe = 'builds application';
|
|
47
|
+
exports.describe = 'builds front end application or NodeJS service';
|
|
42
48
|
|
|
43
49
|
exports.builder = {
|
|
44
50
|
service: {
|
package/lib/cli-commands/pack.js
CHANGED
|
@@ -1,58 +1,24 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
1
|
const { exit } = require('yargs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const { writeFile, readFile } = require('fs/promises');
|
|
5
2
|
const { exec, logInfo, logError, logSuccess } = require('./utils');
|
|
6
3
|
const { isTypeScriptEnabled } = require('../typescript/util');
|
|
7
4
|
const { esBuild } = require('../transpile/esbuild');
|
|
8
|
-
|
|
9
5
|
const { name } = require('../../package.json');
|
|
10
6
|
|
|
11
|
-
async
|
|
12
|
-
logInfo('
|
|
13
|
-
await exec('tsc');
|
|
14
|
-
|
|
15
|
-
}
|
|
7
|
+
const compileTypeScript = async () => {
|
|
8
|
+
logInfo('Generating types...');
|
|
9
|
+
await exec('tsc --emitDeclarationOnly');
|
|
10
|
+
logInfo('Types generation completed...');
|
|
11
|
+
};
|
|
16
12
|
|
|
17
|
-
async
|
|
18
|
-
logInfo('
|
|
13
|
+
const webBuild = async (productionBuild) => {
|
|
14
|
+
logInfo('Building source files for browser environment...');
|
|
19
15
|
const devCmd = `node_modules/${name}/lib/webpack/webpack.lib.dev.babel.js --color`;
|
|
20
16
|
const prodCmd = `node_modules/${name}/lib/webpack/webpack.lib.prod.babel.js --color`;
|
|
21
|
-
await exec(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}`,
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async function getSideEffects() {
|
|
29
|
-
const data = await readFile(path.join(process.cwd(), './package.json'));
|
|
30
|
-
const packageJSON = JSON.parse(data);
|
|
31
|
-
return packageJSON?.sideEffects || false;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async function createPackageJson(file, commonJS, sideEffects) {
|
|
35
|
-
const packageJSON = JSON.stringify({
|
|
36
|
-
type: commonJS ? 'commonjs' : 'module',
|
|
37
|
-
sideEffects,
|
|
38
|
-
});
|
|
39
|
-
await writeFile(file, packageJSON);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async function nodeBuild({ srcPath, commonJS, emitModuleType }) {
|
|
43
|
-
const outDir = `./dist/${commonJS ? 'cjs' : 'es'}`;
|
|
44
|
-
await esBuild({ srcPath, commonJS });
|
|
45
|
-
if (emitModuleType) {
|
|
46
|
-
const sideEffects = await getSideEffects();
|
|
47
|
-
await createPackageJson(
|
|
48
|
-
path.join(process.cwd(), outDir, 'package.json'),
|
|
49
|
-
commonJS,
|
|
50
|
-
sideEffects,
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
17
|
+
await exec(`webpack --config ${productionBuild ? prodCmd : devCmd}`);
|
|
18
|
+
logInfo('Building source files for browser environment completed...');
|
|
19
|
+
};
|
|
54
20
|
|
|
55
|
-
async
|
|
21
|
+
const pack = async ({ production, target, srcPath }) => {
|
|
56
22
|
logInfo('Build in-progress...');
|
|
57
23
|
await exec('rimraf ./dist');
|
|
58
24
|
if (isTypeScriptEnabled()) {
|
|
@@ -60,28 +26,13 @@ async function pack({ production, target, module, srcPath, emitModuleType }) {
|
|
|
60
26
|
}
|
|
61
27
|
if (target !== 'node') await webBuild(production);
|
|
62
28
|
if (target !== 'web') {
|
|
63
|
-
logInfo('
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
await nodeBuild({
|
|
67
|
-
srcPath,
|
|
68
|
-
commonJS: true,
|
|
69
|
-
emitModuleType,
|
|
70
|
-
target,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
if (module !== 'cjs') {
|
|
74
|
-
logInfo('output format: es');
|
|
75
|
-
await nodeBuild({
|
|
76
|
-
srcPath,
|
|
77
|
-
commonJS: false,
|
|
78
|
-
emitModuleType,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
29
|
+
logInfo('Building source files for nodejs environment...');
|
|
30
|
+
await esBuild({ srcdir: srcPath });
|
|
31
|
+
logInfo('Building source files for nodejs environment completed.');
|
|
81
32
|
}
|
|
82
|
-
}
|
|
33
|
+
};
|
|
83
34
|
|
|
84
|
-
async
|
|
35
|
+
const handler = async (argv) => {
|
|
85
36
|
try {
|
|
86
37
|
await pack(argv);
|
|
87
38
|
logSuccess('Build completed');
|
|
@@ -89,7 +40,7 @@ async function handler(argv) {
|
|
|
89
40
|
logError('Build failed', err);
|
|
90
41
|
exit(-1, err);
|
|
91
42
|
}
|
|
92
|
-
}
|
|
43
|
+
};
|
|
93
44
|
|
|
94
45
|
exports.command = 'pack';
|
|
95
46
|
|
|
@@ -107,17 +58,6 @@ exports.builder = {
|
|
|
107
58
|
description:
|
|
108
59
|
'target environment where this library will be used. allowed values are web, node. by default libraries will be compiled for both web and nodejs environments',
|
|
109
60
|
},
|
|
110
|
-
module: {
|
|
111
|
-
type: 'string',
|
|
112
|
-
description:
|
|
113
|
-
'specify the format in which the library to be compiled. es - es module format, cjs - commonjs module format. by default libraries will be compiled in both es and cjs format ',
|
|
114
|
-
},
|
|
115
|
-
emitModuleType: {
|
|
116
|
-
type: 'boolean',
|
|
117
|
-
default: true,
|
|
118
|
-
description:
|
|
119
|
-
'creates type attribute in the package.json and sets its value to commonjs or module based on module cli argument. default: true',
|
|
120
|
-
},
|
|
121
61
|
srcPath: {
|
|
122
62
|
type: 'string',
|
|
123
63
|
default: './lib',
|
package/lib/index.js
CHANGED
|
@@ -5,6 +5,7 @@ const stylelintConfig = require('./lint/stylelint.config');
|
|
|
5
5
|
const prettierConfig = require('./lint/prettier.config');
|
|
6
6
|
const commitlintConfig = require('./lint/commitlint.config');
|
|
7
7
|
const jestConfig = require('./testing/jest.config');
|
|
8
|
+
const { jestNodeConfig } = require('./testing/jest.node.config');
|
|
8
9
|
const jsdocConfig = require('./docgen/jsdoc.config');
|
|
9
10
|
const lintStagedConfig = require('./lint/lint-staged.config');
|
|
10
11
|
const { loadRoutes } = require('./server/util');
|
|
@@ -17,6 +18,7 @@ module.exports = {
|
|
|
17
18
|
prettierConfig,
|
|
18
19
|
commitlintConfig,
|
|
19
20
|
jestConfig,
|
|
21
|
+
jestNodeConfig,
|
|
20
22
|
jsdocConfig,
|
|
21
23
|
lintStagedConfig,
|
|
22
24
|
loadRoutes,
|
|
@@ -84,17 +84,6 @@ const jestConfig = {
|
|
|
84
84
|
transform: {
|
|
85
85
|
'^.+\\.[jt]sx?$': ['@swc/jest', swcrcConfig],
|
|
86
86
|
},
|
|
87
|
-
// transform: {
|
|
88
|
-
// '^.+\\.[jt]sx?$': [
|
|
89
|
-
// 'esbuild-jest',
|
|
90
|
-
// {
|
|
91
|
-
// target: 'es2020',
|
|
92
|
-
// loaders: {
|
|
93
|
-
// '.js': 'jsx',
|
|
94
|
-
// },
|
|
95
|
-
// },
|
|
96
|
-
// ],
|
|
97
|
-
// },
|
|
98
87
|
transformIgnorePatterns: [
|
|
99
88
|
'node_modules/(?!(.*@elliemae/pui-cli|lodash-es|react-select|react-dates)/)',
|
|
100
89
|
],
|
package/lib/transpile/esbuild.js
CHANGED
|
@@ -1,63 +1,110 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { build } = require('esbuild');
|
|
2
2
|
const fg = require('fast-glob');
|
|
3
|
-
const
|
|
3
|
+
const { writeFile, copyFile, readFile } = require('fs/promises');
|
|
4
4
|
const path = require('path');
|
|
5
|
-
const
|
|
6
|
-
// const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
5
|
+
const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
7
6
|
|
|
8
|
-
const
|
|
7
|
+
const TARGETS = {
|
|
8
|
+
browserslist: browserslistToEsbuild(),
|
|
9
|
+
web: 'es2020',
|
|
10
|
+
node: 'node14',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const ESBUILD_FORMAT = {
|
|
14
|
+
CJS: 'cjs',
|
|
15
|
+
ESM: 'esm',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const NODE_MODULE_TYPES = {
|
|
19
|
+
CJS: 'commonjs',
|
|
20
|
+
ESM: 'module',
|
|
21
|
+
};
|
|
9
22
|
|
|
10
|
-
const
|
|
23
|
+
const getCommonConfig = ({ injectReactShim }) => ({
|
|
11
24
|
bundle: false,
|
|
12
|
-
target: esBuild.target, // browserslistToEsbuild(),
|
|
13
25
|
loader: { '.js': 'jsx' },
|
|
14
26
|
mainFields: ['module', 'browser', 'main'],
|
|
15
|
-
inject: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
inject: [
|
|
28
|
+
injectReactShim ? path.resolve(__dirname, './react-shim.js') : '',
|
|
29
|
+
].filter(Boolean),
|
|
30
|
+
});
|
|
19
31
|
|
|
20
32
|
const copyFiles = async ({ srcdir, outdir }) => {
|
|
21
33
|
const files = await fg([
|
|
22
34
|
`${srcdir}/**/*.*`,
|
|
23
35
|
`!${srcdir}/**/*.{js,jsx,ts,tsx,cjs,mjs}`,
|
|
24
36
|
]);
|
|
25
|
-
files.forEach((srcFilePath) => {
|
|
37
|
+
files.forEach(async (srcFilePath) => {
|
|
26
38
|
const destFilePath = srcFilePath.replace(srcdir, outdir);
|
|
27
|
-
|
|
39
|
+
await copyFile(srcFilePath, destFilePath);
|
|
28
40
|
});
|
|
29
41
|
};
|
|
30
42
|
|
|
31
|
-
const
|
|
43
|
+
const getSideEffects = async () => {
|
|
44
|
+
const data = await readFile(path.join(process.cwd(), './package.json'));
|
|
45
|
+
const packageJSON = JSON.parse(data);
|
|
46
|
+
return packageJSON?.sideEffects || false;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const createPackageJson = async ({ outdir, type = NODE_MODULE_TYPES.ESM }) => {
|
|
50
|
+
const filePath = path.join(process.cwd(), outdir, 'package.json');
|
|
51
|
+
const packageJSON = JSON.stringify(
|
|
52
|
+
{
|
|
53
|
+
type,
|
|
54
|
+
sideEffects: await getSideEffects(),
|
|
55
|
+
},
|
|
56
|
+
null,
|
|
57
|
+
2,
|
|
58
|
+
);
|
|
59
|
+
await writeFile(filePath, packageJSON);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
exports.esBuild = async ({
|
|
63
|
+
srcdir,
|
|
64
|
+
outdir = 'dist',
|
|
65
|
+
esmOnly = false,
|
|
66
|
+
target = TARGETS.browserslist,
|
|
67
|
+
injectReactShim = true,
|
|
68
|
+
skipNestedPackageJSON = false,
|
|
69
|
+
}) => {
|
|
32
70
|
const inputFiles = [
|
|
33
|
-
`${
|
|
34
|
-
`!${
|
|
35
|
-
`!${
|
|
36
|
-
`!${
|
|
71
|
+
`${srcdir}/**/*.{js,jsx,ts,tsx}`,
|
|
72
|
+
`!${srcdir}/**/*.test.{js,jsx,ts,tsx}`,
|
|
73
|
+
`!${srcdir}/**/*.stories.{js,jsx,ts,tsx}`,
|
|
74
|
+
`!${srcdir}/**/*.endpoint.{js,jsx,ts,tsx}`,
|
|
37
75
|
];
|
|
38
|
-
|
|
39
|
-
|
|
76
|
+
|
|
77
|
+
// build commonjs
|
|
78
|
+
if (!esmOnly) {
|
|
79
|
+
const cjsOutdir = `${outdir}/cjs`;
|
|
40
80
|
const commonJSEntryPoints = await fg(inputFiles);
|
|
41
|
-
await
|
|
81
|
+
await build({
|
|
42
82
|
entryPoints: commonJSEntryPoints,
|
|
43
|
-
...
|
|
44
|
-
outdir,
|
|
45
|
-
format:
|
|
83
|
+
...getCommonConfig({ injectReactShim }),
|
|
84
|
+
outdir: cjsOutdir,
|
|
85
|
+
format: ESBUILD_FORMAT.CJS,
|
|
86
|
+
target,
|
|
46
87
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const entryPoints = await fg(
|
|
51
|
-
inputFiles.concat([`!${srcPath}/**/cjs/**/*.{js,jsx,ts,tsx}`]),
|
|
52
|
-
);
|
|
53
|
-
await esbuild.build({
|
|
54
|
-
entryPoints,
|
|
55
|
-
...commonConfig,
|
|
56
|
-
outdir,
|
|
57
|
-
format: 'esm',
|
|
58
|
-
});
|
|
59
|
-
await copyFiles({ srcdir: srcPath, outdir });
|
|
88
|
+
// copy files that are not built by esbuild
|
|
89
|
+
await copyFiles({ srcdir, outdir: cjsOutdir });
|
|
90
|
+
await createPackageJson({ outdir: cjsOutdir, type: NODE_MODULE_TYPES.CJS });
|
|
60
91
|
}
|
|
61
|
-
};
|
|
62
92
|
|
|
63
|
-
|
|
93
|
+
// build esm
|
|
94
|
+
const esmOutdir = esmOnly ? outdir : `${outdir}/esm`;
|
|
95
|
+
const entryPoints = await fg(
|
|
96
|
+
inputFiles.concat([`!${srcdir}/**/cjs/**/*.{js,jsx,ts,tsx}`]),
|
|
97
|
+
);
|
|
98
|
+
await build({
|
|
99
|
+
entryPoints,
|
|
100
|
+
...getCommonConfig({ injectReactShim }),
|
|
101
|
+
outdir: esmOutdir,
|
|
102
|
+
format: ESBUILD_FORMAT.ESM,
|
|
103
|
+
target,
|
|
104
|
+
});
|
|
105
|
+
// copy files that are not built by esbuild
|
|
106
|
+
await copyFiles({ srcdir, outdir: esmOutdir });
|
|
107
|
+
if (!skipNestedPackageJSON)
|
|
108
|
+
await createPackageJson({ outdir: esmOutdir, type: NODE_MODULE_TYPES.ESM });
|
|
109
|
+
};
|
|
110
|
+
exports.TARGETS = TARGETS;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const
|
|
3
|
+
const { EnvironmentPlugin, DefinePlugin } = require('webpack');
|
|
4
4
|
const {
|
|
5
5
|
optimize: { LimitChunkCountPlugin },
|
|
6
6
|
ProgressPlugin,
|
|
@@ -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 browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
13
14
|
|
|
14
15
|
const {
|
|
15
16
|
excludeNodeModulesExcept,
|
|
@@ -18,9 +19,8 @@ const {
|
|
|
18
19
|
modulesToTranspile,
|
|
19
20
|
getAssetPath,
|
|
20
21
|
getAlias,
|
|
22
|
+
filterByFilePresence,
|
|
21
23
|
} = require('./helpers');
|
|
22
|
-
const { getPUIConfig } = require('../pui-config');
|
|
23
|
-
const { esBuild } = getPUIConfig();
|
|
24
24
|
|
|
25
25
|
const minicssLoader = {
|
|
26
26
|
loader: MiniCssExtractPlugin.loader,
|
|
@@ -31,16 +31,16 @@ const finalCSSLoader = (mode) =>
|
|
|
31
31
|
mode !== 'production' ? { loader: 'style-loader' } : minicssLoader;
|
|
32
32
|
|
|
33
33
|
const plugins = [
|
|
34
|
-
new
|
|
34
|
+
new EnvironmentPlugin({
|
|
35
35
|
NODE_ENV: 'development',
|
|
36
36
|
ASSET_PATH: '/',
|
|
37
37
|
CI: 'false',
|
|
38
38
|
}),
|
|
39
|
-
new
|
|
39
|
+
new DefinePlugin({
|
|
40
40
|
APP_CONFIG: getAppConfig(true),
|
|
41
41
|
}),
|
|
42
42
|
new CopyWebpackPlugin({
|
|
43
|
-
patterns: [
|
|
43
|
+
patterns: filterByFilePresence([
|
|
44
44
|
{
|
|
45
45
|
from: 'lib/app.config.json',
|
|
46
46
|
to: 'app.config.json',
|
|
@@ -50,7 +50,7 @@ const plugins = [
|
|
|
50
50
|
from: 'lib/public',
|
|
51
51
|
noErrorOnMissing: true,
|
|
52
52
|
},
|
|
53
|
-
],
|
|
53
|
+
]),
|
|
54
54
|
}),
|
|
55
55
|
new DuplicatePackageCheckerPlugin(),
|
|
56
56
|
new LimitChunkCountPlugin({
|
|
@@ -84,7 +84,7 @@ module.exports = (options) => ({
|
|
|
84
84
|
loader: 'esbuild-loader',
|
|
85
85
|
options: {
|
|
86
86
|
loader: 'jsx',
|
|
87
|
-
target:
|
|
87
|
+
target: browserslistToEsbuild(),
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
},
|
|
@@ -98,7 +98,7 @@ module.exports = (options) => ({
|
|
|
98
98
|
loader: 'esbuild-loader',
|
|
99
99
|
options: {
|
|
100
100
|
loader: 'tsx',
|
|
101
|
-
target:
|
|
101
|
+
target: browserslistToEsbuild(),
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
},
|
|
@@ -157,6 +157,7 @@ module.exports = (options) => ({
|
|
|
157
157
|
test: /\.svg$/i,
|
|
158
158
|
issuer: /\.[jt]sx?$/,
|
|
159
159
|
resourceQuery: /^((?!url).)*$/,
|
|
160
|
+
exclude: excludeNodeModulesExcept(['@elliemae/*']),
|
|
160
161
|
use: ['@svgr/webpack'],
|
|
161
162
|
},
|
|
162
163
|
{
|
|
@@ -177,10 +178,12 @@ module.exports = (options) => ({
|
|
|
177
178
|
{
|
|
178
179
|
resourceQuery: /resource/,
|
|
179
180
|
type: 'asset/resource',
|
|
181
|
+
exclude: excludeNodeModulesExcept(['@elliemae/*']),
|
|
180
182
|
},
|
|
181
183
|
{
|
|
182
184
|
type: 'asset',
|
|
183
185
|
resourceQuery: /url/,
|
|
186
|
+
exclude: excludeNodeModulesExcept(['@elliemae/*']),
|
|
184
187
|
},
|
|
185
188
|
],
|
|
186
189
|
},
|
|
@@ -35,7 +35,7 @@ module.exports = require('./webpack.lib.base.babel')({
|
|
|
35
35
|
libraryName,
|
|
36
36
|
}),
|
|
37
37
|
new CircularDependencyPlugin({
|
|
38
|
-
exclude: /a\.js|node_modules/, // exclude node_modules
|
|
38
|
+
exclude: /a\.(js|ts|jsx|tsx)|node_modules/, // exclude node_modules
|
|
39
39
|
failOnError: false, // show a warning when there is a circular dependency
|
|
40
40
|
}),
|
|
41
41
|
new MiniCssExtractPlugin({
|
|
@@ -3,9 +3,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
3
3
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
4
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
5
5
|
const { ESBuildMinifyPlugin } = require('esbuild-loader');
|
|
6
|
+
const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
6
7
|
const { getLibraryName, getCompressionPlugins } = require('./helpers');
|
|
7
|
-
const { getPUIConfig } = require('../pui-config');
|
|
8
|
-
const { esBuild } = getPUIConfig();
|
|
9
8
|
|
|
10
9
|
const libraryName = getLibraryName();
|
|
11
10
|
|
|
@@ -24,7 +23,7 @@ module.exports = require('./webpack.lib.base.babel')({
|
|
|
24
23
|
minimize: true,
|
|
25
24
|
minimizer: [
|
|
26
25
|
new ESBuildMinifyPlugin({
|
|
27
|
-
target:
|
|
26
|
+
target: browserslistToEsbuild(),
|
|
28
27
|
css: true,
|
|
29
28
|
}),
|
|
30
29
|
],
|
|
@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
6
6
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
7
7
|
const { ESBuildMinifyPlugin } = require('esbuild-loader');
|
|
8
8
|
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
|
|
9
|
+
const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
9
10
|
|
|
10
11
|
const baseConfigFactory = require('./webpack.base.babel');
|
|
11
12
|
const {
|
|
@@ -17,8 +18,6 @@ const {
|
|
|
17
18
|
isGoogleTagManagerEnabled,
|
|
18
19
|
getCompressionPlugins,
|
|
19
20
|
} = require('./helpers');
|
|
20
|
-
const { getPUIConfig } = require('../pui-config');
|
|
21
|
-
const { esBuild } = getPUIConfig();
|
|
22
21
|
|
|
23
22
|
const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
24
23
|
const { buildPath, publicPath } = getPaths(latestVersion);
|
|
@@ -43,7 +42,7 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
43
42
|
moduleIds: 'deterministic',
|
|
44
43
|
minimizer: [
|
|
45
44
|
new ESBuildMinifyPlugin({
|
|
46
|
-
target:
|
|
45
|
+
target: browserslistToEsbuild(),
|
|
47
46
|
css: true,
|
|
48
47
|
}),
|
|
49
48
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.59",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "ICE MT UI Platform CLI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/cli": "~7.16.8",
|
|
51
|
-
"@babel/core": "~7.16.
|
|
51
|
+
"@babel/core": "~7.16.10",
|
|
52
52
|
"@babel/eslint-parser": "~7.16.5",
|
|
53
53
|
"@babel/node": "~7.16.8",
|
|
54
54
|
"@babel/plugin-proposal-class-properties": "~7.16.7",
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"@babel/plugin-transform-react-constant-elements": "~7.16.7",
|
|
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.16.
|
|
62
|
-
"@babel/preset-env": "~7.16.
|
|
61
|
+
"@babel/plugin-transform-runtime": "~7.16.10",
|
|
62
|
+
"@babel/preset-env": "~7.16.11",
|
|
63
63
|
"@babel/preset-react": "~7.16.7",
|
|
64
64
|
"@babel/preset-typescript": "~7.16.7",
|
|
65
65
|
"@babel/runtime": "~7.16.7",
|
|
66
|
-
"@commitlint/cli": "~16.0
|
|
66
|
+
"@commitlint/cli": "~16.1.0",
|
|
67
67
|
"@commitlint/config-conventional": "~16.0.0",
|
|
68
|
-
"@elliemae/browserslist-config-elliemae": "~1.
|
|
68
|
+
"@elliemae/browserslist-config-elliemae-latest-browsers": "~1.3.0",
|
|
69
69
|
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.4",
|
|
70
70
|
"@semantic-release/changelog": "~6.0.1",
|
|
71
71
|
"@semantic-release/exec": "~6.0.3",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@stylelint/postcss-css-in-js": "~0.37.2",
|
|
84
84
|
"@svgr/webpack": "~6.2.0",
|
|
85
85
|
"@swc/cli": "~0.1.55",
|
|
86
|
-
"@swc/core": "~1.2.
|
|
86
|
+
"@swc/core": "~1.2.133",
|
|
87
87
|
"@swc/jest": "~0.2.17",
|
|
88
88
|
"@testing-library/jest-dom": "~5.16.1",
|
|
89
89
|
"@testing-library/react": "~12.1.2",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"circular-dependency-plugin": "~5.2.2",
|
|
118
118
|
"compression": "~1.7.4",
|
|
119
119
|
"compression-webpack-plugin": "~9.2.0",
|
|
120
|
-
"copy-webpack-plugin": "~10.2.
|
|
120
|
+
"copy-webpack-plugin": "~10.2.1",
|
|
121
121
|
"cors": "~2.8.5",
|
|
122
122
|
"cross-env": "~7.0.3",
|
|
123
123
|
"css-loader": "~6.5.1",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"dotenv-webpack": "~7.0.3",
|
|
129
129
|
"duplicate-package-checker-webpack-plugin": "~3.0.0",
|
|
130
130
|
"enhanced-resolve": "~5.8.3",
|
|
131
|
-
"esbuild": "~0.14.
|
|
131
|
+
"esbuild": "~0.14.12",
|
|
132
132
|
"esbuild-loader": "~2.18.0",
|
|
133
133
|
"esbuild-plugin-svgr": "~1.0.0",
|
|
134
134
|
"eslint": "~8.7.0",
|
|
@@ -144,14 +144,14 @@
|
|
|
144
144
|
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
145
145
|
"eslint-plugin-import": "~2.25.4",
|
|
146
146
|
"eslint-plugin-jest": "~25.7.0",
|
|
147
|
-
"eslint-plugin-jsdoc": "~37.6.
|
|
147
|
+
"eslint-plugin-jsdoc": "~37.6.2",
|
|
148
148
|
"eslint-plugin-jsx-a11y": "~6.5.1",
|
|
149
149
|
"eslint-plugin-mdx": "~1.16.0",
|
|
150
150
|
"eslint-plugin-prettier": "~4.0.0",
|
|
151
151
|
"eslint-plugin-react": "~7.28.0",
|
|
152
152
|
"eslint-plugin-react-hooks": "~4.3.0",
|
|
153
153
|
"eslint-plugin-redux-saga": "~1.3.2",
|
|
154
|
-
"eslint-plugin-storybook": "~0.5.
|
|
154
|
+
"eslint-plugin-storybook": "~0.5.6",
|
|
155
155
|
"eslint-plugin-testing-library": "~5.0.3",
|
|
156
156
|
"eslint-plugin-wdio": "~7.4.2",
|
|
157
157
|
"execa": "~5.1.1",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"express-static-gzip": "~2.1.1",
|
|
161
161
|
"favicons": "~6.2.2",
|
|
162
162
|
"favicons-webpack-plugin": "~5.0.2",
|
|
163
|
-
"happy-dom": "~2.
|
|
163
|
+
"happy-dom": "~2.28.0",
|
|
164
164
|
"helmet-csp": "~3.4.0",
|
|
165
165
|
"html-webpack-plugin": "~5.5.0",
|
|
166
166
|
"http-server": "~14.1.0",
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"jest-styled-components": "~7.0.8",
|
|
175
175
|
"jscodeshift": "~0.13.1",
|
|
176
176
|
"jsdoc": "~3.6.7",
|
|
177
|
-
"lint-staged": "~12.2.
|
|
177
|
+
"lint-staged": "~12.2.2",
|
|
178
178
|
"mini-css-extract-plugin": "~2.5.2",
|
|
179
179
|
"minimist": "~1.2.5",
|
|
180
180
|
"moment": "~2.29.1",
|
|
@@ -183,10 +183,10 @@
|
|
|
183
183
|
"node-gyp": "~8.4.1",
|
|
184
184
|
"node-plop": "~0.30.0",
|
|
185
185
|
"nodemon": "~2.0.15",
|
|
186
|
-
"npm-check-updates": "12.
|
|
186
|
+
"npm-check-updates": "12.2.0",
|
|
187
187
|
"null-loader": "~4.0.1",
|
|
188
|
-
"pino": "~7.6.
|
|
189
|
-
"pino-pretty": "~7.
|
|
188
|
+
"pino": "~7.6.4",
|
|
189
|
+
"pino-pretty": "~7.5.0",
|
|
190
190
|
"pinst": "~2.1.6",
|
|
191
191
|
"plop": "~3.0.5",
|
|
192
192
|
"postcss": "~8.4.5",
|
|
@@ -221,12 +221,12 @@
|
|
|
221
221
|
"terser-webpack-plugin": "~5.3.0",
|
|
222
222
|
"ts-node": "~10.4.0",
|
|
223
223
|
"tsc-alias": "~1.5.0",
|
|
224
|
-
"typescript": "~4.5.
|
|
224
|
+
"typescript": "~4.5.5",
|
|
225
225
|
"update-notifier": "~5.1.0",
|
|
226
226
|
"url-loader": "~4.1.1",
|
|
227
227
|
"uuid": "~8.3.2",
|
|
228
228
|
"vite": "~2.7.13",
|
|
229
|
-
"vitest": "~0.1.
|
|
229
|
+
"vitest": "~0.1.25",
|
|
230
230
|
"webpack": "~5.65.0",
|
|
231
231
|
"webpack-bundle-analyzer": "~4.5.0",
|
|
232
232
|
"webpack-cli": "~4.9.1",
|