@elliemae/pui-cli 6.0.0-beta.13 → 6.0.0-beta.14
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/esbuild.js +19 -3
- package/package.json +11 -11
package/lib/esbuild.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const esbuild = require('esbuild');
|
|
2
2
|
const fg = require('fast-glob');
|
|
3
|
+
const fs = require('fs');
|
|
3
4
|
|
|
4
5
|
const ESBUILD_TARGET = 'es2020';
|
|
5
6
|
|
|
@@ -10,7 +11,18 @@ const commonConfig = {
|
|
|
10
11
|
mainFields: ['module', 'browser', 'main'],
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
const
|
|
14
|
+
const distFolder = 'dist';
|
|
15
|
+
|
|
16
|
+
const copyFiles = async ({ srcdir, outdir }) => {
|
|
17
|
+
const files = await fg([
|
|
18
|
+
`${srcdir}/**/*.*`,
|
|
19
|
+
`!${srcdir}/**/*.{js,jsx,ts,tsx,cjs,mjs}`,
|
|
20
|
+
]);
|
|
21
|
+
files.forEach((srcFilePath) => {
|
|
22
|
+
const destFilePath = srcFilePath.replace(srcdir, outdir);
|
|
23
|
+
fs.copyFileSync(srcFilePath, destFilePath);
|
|
24
|
+
});
|
|
25
|
+
};
|
|
14
26
|
|
|
15
27
|
const build = async ({ srcPath, commonJS }) => {
|
|
16
28
|
const inputFiles = [
|
|
@@ -20,23 +32,27 @@ const build = async ({ srcPath, commonJS }) => {
|
|
|
20
32
|
`!${srcPath}/**/*.endpoint.{js,jsx,ts,tsx}`,
|
|
21
33
|
];
|
|
22
34
|
if (!commonJS) {
|
|
35
|
+
const outdir = `${distFolder}/es`;
|
|
23
36
|
const entryPoints = await fg(inputFiles);
|
|
24
37
|
await esbuild.build({
|
|
25
38
|
entryPoints,
|
|
26
39
|
...commonConfig,
|
|
27
|
-
outdir
|
|
40
|
+
outdir,
|
|
28
41
|
format: 'esm',
|
|
29
42
|
});
|
|
43
|
+
await copyFiles({ srcdir: srcPath, outdir });
|
|
30
44
|
} else {
|
|
45
|
+
const outdir = `${distFolder}/cjs`;
|
|
31
46
|
const commonJSEntryPoints = await fg(
|
|
32
47
|
inputFiles.concat([`${srcPath}/**/*.cjs`]),
|
|
33
48
|
);
|
|
34
49
|
await esbuild.build({
|
|
35
50
|
entryPoints: commonJSEntryPoints,
|
|
36
51
|
...commonConfig,
|
|
37
|
-
outdir
|
|
52
|
+
outdir,
|
|
38
53
|
format: 'cjs',
|
|
39
54
|
});
|
|
55
|
+
await copyFiles({ srcdir: srcPath, outdir });
|
|
40
56
|
}
|
|
41
57
|
};
|
|
42
58
|
|
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.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "EllieMae Platform UI CLI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -70,18 +70,18 @@
|
|
|
70
70
|
"@semantic-release/changelog": "~6.0.1",
|
|
71
71
|
"@semantic-release/exec": "~6.0.2",
|
|
72
72
|
"@semantic-release/git": "~10.0.1",
|
|
73
|
-
"@storybook/addon-a11y": "~6.4.
|
|
74
|
-
"@storybook/addon-essentials": "~6.4.
|
|
73
|
+
"@storybook/addon-a11y": "~6.4.4",
|
|
74
|
+
"@storybook/addon-essentials": "~6.4.4",
|
|
75
75
|
"@storybook/addon-events": "~6.2.9",
|
|
76
|
-
"@storybook/addon-interactions": "~6.4.
|
|
77
|
-
"@storybook/addon-links": "~6.4.
|
|
78
|
-
"@storybook/addon-storysource": "~6.4.
|
|
79
|
-
"@storybook/builder-webpack5": "~6.4.
|
|
80
|
-
"@storybook/manager-webpack5": "~6.4.
|
|
81
|
-
"@storybook/react": "~6.4.
|
|
82
|
-
"@storybook/theming": "~6.4.
|
|
76
|
+
"@storybook/addon-interactions": "~6.4.4",
|
|
77
|
+
"@storybook/addon-links": "~6.4.4",
|
|
78
|
+
"@storybook/addon-storysource": "~6.4.4",
|
|
79
|
+
"@storybook/builder-webpack5": "~6.4.4",
|
|
80
|
+
"@storybook/manager-webpack5": "~6.4.4",
|
|
81
|
+
"@storybook/react": "~6.4.4",
|
|
82
|
+
"@storybook/theming": "~6.4.4",
|
|
83
83
|
"@stylelint/postcss-css-in-js": "~0.37.2",
|
|
84
|
-
"@svgr/webpack": "~6.
|
|
84
|
+
"@svgr/webpack": "~6.1.0",
|
|
85
85
|
"@testing-library/jest-dom": "~5.15.1",
|
|
86
86
|
"@testing-library/react": "~12.1.2",
|
|
87
87
|
"@testing-library/react-hooks": "~7.0.2",
|