@elliemae/pui-cli 6.0.0-beta.23 → 6.0.0-beta.24

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.
@@ -0,0 +1,18 @@
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+ const { merge } = require('lodash');
4
+
5
+ const baseConfig = {
6
+ esBuild: {
7
+ target: 'es2020',
8
+ },
9
+ };
10
+
11
+ const getPUIConfig = () => {
12
+ const configPath = path.resolve(process.cwd(), './pui.config.js');
13
+ if (!fs.existsSync(configPath)) return baseConfig;
14
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
15
+ return merge(baseConfig, config);
16
+ };
17
+
18
+ exports.getPUIConfig = getPUIConfig;
@@ -2,12 +2,13 @@ const esbuild = require('esbuild');
2
2
  const fg = require('fast-glob');
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
+ const { getPUIConfig } = require('../pui-config');
5
6
 
6
- const ESBUILD_TARGET = 'es2020';
7
+ const { esBuild } = getPUIConfig();
7
8
 
8
9
  const commonConfig = {
9
10
  bundle: false,
10
- target: ESBUILD_TARGET,
11
+ target: esBuild.target,
11
12
  loader: { '.js': 'jsx' },
12
13
  mainFields: ['module', 'browser', 'main'],
13
14
  inject: [path.resolve(__dirname, './react-shim.js')],
@@ -33,30 +34,29 @@ const build = async ({ srcPath, commonJS }) => {
33
34
  `!${srcPath}/**/*.stories.{js,jsx,ts,tsx}`,
34
35
  `!${srcPath}/**/*.endpoint.{js,jsx,ts,tsx}`,
35
36
  ];
36
- if (!commonJS) {
37
- const outdir = `${distFolder}/es`;
38
- const entryPoints = await fg(inputFiles);
37
+ if (commonJS) {
38
+ const outdir = `${distFolder}/cjs`;
39
+ const commonJSEntryPoints = await fg(inputFiles);
39
40
  await esbuild.build({
40
- entryPoints,
41
+ entryPoints: commonJSEntryPoints,
41
42
  ...commonConfig,
42
43
  outdir,
43
- format: 'esm',
44
+ format: 'cjs',
44
45
  });
45
46
  await copyFiles({ srcdir: srcPath, outdir });
46
47
  } else {
47
- const outdir = `${distFolder}/cjs`;
48
- const commonJSEntryPoints = await fg(
49
- inputFiles.concat([`${srcPath}/**/*.cjs`]),
48
+ const outdir = `${distFolder}/es`;
49
+ const entryPoints = await fg(
50
+ inputFiles.concat([`!${srcPath}/**/cjs/**/*.{js,jsx,ts,tsx}`]),
50
51
  );
51
52
  await esbuild.build({
52
- entryPoints: commonJSEntryPoints,
53
+ entryPoints,
53
54
  ...commonConfig,
54
55
  outdir,
55
- format: 'cjs',
56
+ format: 'esm',
56
57
  });
57
58
  await copyFiles({ srcdir: srcPath, outdir });
58
59
  }
59
60
  };
60
61
 
61
62
  exports.esBuild = build;
62
- exports.ESBUILD_TARGET = ESBUILD_TARGET;
@@ -17,7 +17,8 @@ const {
17
17
  getAlias,
18
18
  getPaths,
19
19
  } = require('./helpers');
20
- const { ESBUILD_TARGET } = require('../transpile/esbuild');
20
+ const { getPUIConfig } = require('../pui-config');
21
+ const { esBuild } = getPUIConfig();
21
22
 
22
23
  const minicssLoader = {
23
24
  loader: MiniCssExtractPlugin.loader,
@@ -152,7 +153,7 @@ module.exports = (options) => ({
152
153
  loader: 'esbuild-loader',
153
154
  options: {
154
155
  loader: 'jsx',
155
- target: ESBUILD_TARGET,
156
+ target: esBuild.target,
156
157
  },
157
158
  },
158
159
  },
@@ -166,7 +167,7 @@ module.exports = (options) => ({
166
167
  loader: 'esbuild-loader',
167
168
  options: {
168
169
  loader: 'tsx',
169
- target: ESBUILD_TARGET,
170
+ target: esBuild.target,
170
171
  },
171
172
  },
172
173
  },
@@ -19,7 +19,8 @@ const {
19
19
  getAssetPath,
20
20
  getAlias,
21
21
  } = require('./helpers');
22
- const { ESBUILD_TARGET } = require('../transpile/esbuild');
22
+ const { getPUIConfig } = require('../pui-config');
23
+ const { esBuild } = getPUIConfig();
23
24
 
24
25
  const minicssLoader = {
25
26
  loader: MiniCssExtractPlugin.loader,
@@ -100,7 +101,7 @@ module.exports = (options) => ({
100
101
  loader: 'esbuild-loader',
101
102
  options: {
102
103
  loader: 'jsx',
103
- target: ESBUILD_TARGET,
104
+ target: esBuild.target,
104
105
  },
105
106
  },
106
107
  },
@@ -114,7 +115,7 @@ module.exports = (options) => ({
114
115
  loader: 'esbuild-loader',
115
116
  options: {
116
117
  loader: 'tsx',
117
- target: ESBUILD_TARGET,
118
+ target: esBuild.target,
118
119
  },
119
120
  },
120
121
  },
@@ -4,7 +4,8 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
4
4
  const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
5
5
  const { ESBuildMinifyPlugin } = require('esbuild-loader');
6
6
  const { getLibraryName, getCompressionPlugins } = require('./helpers');
7
- const { ESBUILD_TARGET } = require('../transpile/esbuild');
7
+ const { getPUIConfig } = require('../pui-config');
8
+ const { esBuild } = getPUIConfig();
8
9
 
9
10
  const libraryName = getLibraryName();
10
11
 
@@ -23,7 +24,7 @@ module.exports = require('./webpack.lib.base.babel')({
23
24
  minimize: true,
24
25
  minimizer: [
25
26
  new ESBuildMinifyPlugin({
26
- target: ESBUILD_TARGET,
27
+ target: esBuild.target,
27
28
  css: true,
28
29
  }),
29
30
  ],
@@ -16,7 +16,8 @@ const {
16
16
  isGoogleTagManagerEnabled,
17
17
  getCompressionPlugins,
18
18
  } = require('./helpers');
19
- const { ESBUILD_TARGET } = require('../transpile/esbuild');
19
+ const { getPUIConfig } = require('../pui-config');
20
+ const { esBuild } = getPUIConfig();
20
21
 
21
22
  const getProdConfig = ({ latestVersion = true } = {}) => {
22
23
  const { buildPath, publicPath } = getPaths(latestVersion);
@@ -41,7 +42,7 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
41
42
  moduleIds: 'deterministic',
42
43
  minimizer: [
43
44
  new ESBuildMinifyPlugin({
44
- target: ESBUILD_TARGET,
45
+ target: esBuild.target,
45
46
  css: true,
46
47
  }),
47
48
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "6.0.0-beta.23",
3
+ "version": "6.0.0-beta.24",
4
4
  "private": false,
5
5
  "description": "ICE MT UI Platform CLI",
6
6
  "sideEffects": false,
@@ -70,27 +70,27 @@
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.7",
74
- "@storybook/addon-essentials": "~6.4.7",
73
+ "@storybook/addon-a11y": "~6.4.8",
74
+ "@storybook/addon-essentials": "~6.4.8",
75
75
  "@storybook/addon-events": "~6.2.9",
76
- "@storybook/addon-interactions": "~6.4.7",
77
- "@storybook/addon-links": "~6.4.7",
78
- "@storybook/addon-storysource": "~6.4.7",
79
- "@storybook/builder-webpack5": "~6.4.7",
80
- "@storybook/manager-webpack5": "~6.4.7",
81
- "@storybook/react": "~6.4.7",
82
- "@storybook/theming": "~6.4.7",
76
+ "@storybook/addon-interactions": "~6.4.8",
77
+ "@storybook/addon-links": "~6.4.8",
78
+ "@storybook/addon-storysource": "~6.4.8",
79
+ "@storybook/builder-webpack5": "~6.4.8",
80
+ "@storybook/manager-webpack5": "~6.4.8",
81
+ "@storybook/react": "~6.4.8",
82
+ "@storybook/theming": "~6.4.8",
83
83
  "@stylelint/postcss-css-in-js": "~0.37.2",
84
84
  "@svgr/webpack": "~6.1.1",
85
- "@testing-library/jest-dom": "~5.16.0",
85
+ "@testing-library/jest-dom": "~5.16.1",
86
86
  "@testing-library/react": "~12.1.2",
87
87
  "@testing-library/react-hooks": "~7.0.2",
88
88
  "@types/jest": "~27.0.3",
89
89
  "@types/node": "~16.11.11",
90
90
  "@types/rimraf": "~3.0.2",
91
91
  "@types/testing-library__jest-dom": "~5.14.2",
92
- "@typescript-eslint/eslint-plugin": "~5.5.0",
93
- "@typescript-eslint/parser": "~5.5.0",
92
+ "@typescript-eslint/eslint-plugin": "~5.6.0",
93
+ "@typescript-eslint/parser": "~5.6.0",
94
94
  "autoprefixer": "~10.4.0",
95
95
  "axe-core": "~4.3.5",
96
96
  "babel-loader": "~8.2.3",
@@ -182,7 +182,7 @@
182
182
  "msw": "~0.36.0",
183
183
  "node-plop": "~0.30.0",
184
184
  "nodemon": "~2.0.15",
185
- "npm-check-updates": "12.0.2",
185
+ "npm-check-updates": "12.0.3",
186
186
  "null-loader": "~4.0.1",
187
187
  "pino": "~7.5.1",
188
188
  "pino-pretty": "~7.2.0",
@@ -235,7 +235,7 @@
235
235
  "url-loader": "~4.1.1",
236
236
  "uuid": "~8.3.2",
237
237
  "vite": "~2.6.14",
238
- "webpack": "~5.64.4",
238
+ "webpack": "~5.65.0",
239
239
  "webpack-bundle-analyzer": "~4.5.0",
240
240
  "webpack-cli": "~4.9.1",
241
241
  "webpack-dev-middleware": "~5.2.2",