@elliemae/pui-cli 7.0.0-alpha.30 → 7.0.0-alpha.31

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.
@@ -42,10 +42,11 @@ const startProdServer = async () => {
42
42
  );
43
43
  };
44
44
  const startDevServer = async () => {
45
+ const configFile = `../webpack/${(0, import_utils.isApp)() ? "webpack.dev.babel.js" : "webpack.lib.dev.babel.js"}`;
45
46
  await (0, import_utils.exec)(
46
47
  `cross-env NODE_ENV=development webpack serve --config ${import_node_path.default.resolve(
47
48
  __dirname,
48
- "../webpack/webpack.dev.babel.js"
49
+ configFile
49
50
  )}`
50
51
  );
51
52
  };
@@ -26,6 +26,8 @@ var utils_exports = {};
26
26
  __export(utils_exports, {
27
27
  copyBuildAssetsToVersionedFolder: () => copyBuildAssetsToVersionedFolder,
28
28
  exec: () => exec,
29
+ isApp: () => isApp,
30
+ isPathExist: () => isPathExist,
29
31
  logError: () => logError,
30
32
  logInfo: () => logInfo,
31
33
  logSuccess: () => logSuccess,
@@ -33,6 +35,7 @@ __export(utils_exports, {
33
35
  });
34
36
  module.exports = __toCommonJS(utils_exports);
35
37
  var import_node_path = __toESM(require("node:path"), 1);
38
+ var import_fs = require("fs");
36
39
  var import_promises = require("fs/promises");
37
40
  var import_execa = require("execa");
38
41
  var import_chalk = __toESM(require("chalk"), 1);
@@ -143,3 +146,11 @@ const copyBuildAssetsToVersionedFolder = async () => {
143
146
  await copyDir(src, dest);
144
147
  await updateManifestWithVersionInfo(dest);
145
148
  };
149
+ const isPathExist = async (pathToCheck) => {
150
+ try {
151
+ return await (0, import_promises.access)(pathToCheck, import_fs.constants.F_OK);
152
+ } catch (err) {
153
+ return false;
154
+ }
155
+ };
156
+ const isApp = () => isPathExist(import_node_path.default.join(process.cwd(), "app"));
@@ -130,7 +130,7 @@ const devConfig = {
130
130
  historyApiFallback: true,
131
131
  hot: true,
132
132
  open: [basePath],
133
- port: 3e3,
133
+ port: process.env.PORT || "auto",
134
134
  setupMiddlewares: (middlewares, devServer) => {
135
135
  (0, import_middlewares.setupDefaultMiddlewares)(devServer.app);
136
136
  devServer.app.use((0, import_express_static_gzip.default)("cdn"));
@@ -207,5 +207,6 @@ const baseConfig = (options) => ({
207
207
  "@elliemae/pui-diagnostics": "emuiDiagnostics"
208
208
  },
209
209
  devtool: options.devtool || "eval-source-map",
210
- performance: options.performance || {}
210
+ performance: options.performance || {},
211
+ devServer: options.devServer || {}
211
212
  });
@@ -33,8 +33,9 @@ var import_circular_dependency_plugin = __toESM(require("circular-dependency-plu
33
33
  var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"), 1);
34
34
  var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"), 1);
35
35
  var import_helpers = require("./helpers.js");
36
- var import_webpack_base_babel = require("./webpack.base.babel.js");
36
+ var import_webpack_lib_base_babel = require("./webpack.lib.base.babel.js");
37
37
  const libraryName = (0, import_helpers.getLibraryName)();
38
+ const { basePath } = (0, import_helpers.getPaths)();
38
39
  const getHtmlWebpackPlugins = () => {
39
40
  const htmlTemplateFiles = import_fast_glob.default.sync([import_node_path.default.join(process.cwd(), "lib/*.html")]);
40
41
  return htmlTemplateFiles.map(
@@ -46,7 +47,7 @@ const getHtmlWebpackPlugins = () => {
46
47
  })
47
48
  );
48
49
  };
49
- var webpack_lib_dev_babel_default = (0, import_webpack_base_babel.baseConfig)({
50
+ var webpack_lib_dev_babel_default = (0, import_webpack_lib_base_babel.baseConfig)({
50
51
  mode: "development",
51
52
  output: {
52
53
  filename: `js/${libraryName}.js`,
@@ -75,5 +76,17 @@ var webpack_lib_dev_babel_default = (0, import_webpack_base_babel.baseConfig)({
75
76
  devtool: "eval-source-map",
76
77
  performance: {
77
78
  hints: false
79
+ },
80
+ devServer: {
81
+ client: {
82
+ overlay: {
83
+ errors: true,
84
+ warnings: false
85
+ }
86
+ },
87
+ historyApiFallback: true,
88
+ hot: true,
89
+ open: [basePath],
90
+ port: process.env.PORT || "auto"
78
91
  }
79
92
  });
@@ -1,7 +1,7 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
3
  import yargs from "yargs";
4
- import { exec, logError, logSuccess } from "./utils.js";
4
+ import { exec, logError, logSuccess, isApp } from "./utils.js";
5
5
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
6
  const startProdServer = async () => {
7
7
  await exec(
@@ -12,10 +12,11 @@ const startProdServer = async () => {
12
12
  );
13
13
  };
14
14
  const startDevServer = async () => {
15
+ const configFile = `../webpack/${isApp() ? "webpack.dev.babel.js" : "webpack.lib.dev.babel.js"}`;
15
16
  await exec(
16
17
  `cross-env NODE_ENV=development webpack serve --config ${path.resolve(
17
18
  __dirname,
18
- "../webpack/webpack.dev.babel.js"
19
+ configFile
19
20
  )}`
20
21
  );
21
22
  };
@@ -1,5 +1,13 @@
1
1
  import path from "node:path";
2
- import { readFile, writeFile, mkdir, readdir, copyFile } from "fs/promises";
2
+ import { constants } from "fs";
3
+ import {
4
+ readFile,
5
+ writeFile,
6
+ mkdir,
7
+ readdir,
8
+ copyFile,
9
+ access
10
+ } from "fs/promises";
3
11
  import { execaCommand } from "execa";
4
12
  import chalk from "chalk";
5
13
  import {
@@ -114,9 +122,19 @@ const copyBuildAssetsToVersionedFolder = async () => {
114
122
  await copyDir(src, dest);
115
123
  await updateManifestWithVersionInfo(dest);
116
124
  };
125
+ const isPathExist = async (pathToCheck) => {
126
+ try {
127
+ return await access(pathToCheck, constants.F_OK);
128
+ } catch (err) {
129
+ return false;
130
+ }
131
+ };
132
+ const isApp = () => isPathExist(path.join(process.cwd(), "app"));
117
133
  export {
118
134
  copyBuildAssetsToVersionedFolder,
119
135
  exec,
136
+ isApp,
137
+ isPathExist,
120
138
  logError,
121
139
  logInfo,
122
140
  logSuccess,
@@ -104,7 +104,7 @@ const devConfig = {
104
104
  historyApiFallback: true,
105
105
  hot: true,
106
106
  open: [basePath],
107
- port: 3e3,
107
+ port: process.env.PORT || "auto",
108
108
  setupMiddlewares: (middlewares, devServer) => {
109
109
  setupDefaultMiddlewares(devServer.app);
110
110
  devServer.app.use(expressStaticGzip("cdn"));
@@ -184,7 +184,8 @@ const baseConfig = (options) => ({
184
184
  "@elliemae/pui-diagnostics": "emuiDiagnostics"
185
185
  },
186
186
  devtool: options.devtool || "eval-source-map",
187
- performance: options.performance || {}
187
+ performance: options.performance || {},
188
+ devServer: options.devServer || {}
188
189
  });
189
190
  export {
190
191
  baseConfig
@@ -3,9 +3,10 @@ import fg from "fast-glob";
3
3
  import CircularDependencyPlugin from "circular-dependency-plugin";
4
4
  import MiniCssExtractPlugin from "mini-css-extract-plugin";
5
5
  import HtmlWebpackPlugin from "html-webpack-plugin";
6
- import { getLibraryName } from "./helpers.js";
7
- import { baseConfig } from "./webpack.base.babel.js";
6
+ import { getLibraryName, getPaths } from "./helpers.js";
7
+ import { baseConfig } from "./webpack.lib.base.babel.js";
8
8
  const libraryName = getLibraryName();
9
+ const { basePath } = getPaths();
9
10
  const getHtmlWebpackPlugins = () => {
10
11
  const htmlTemplateFiles = fg.sync([path.join(process.cwd(), "lib/*.html")]);
11
12
  return htmlTemplateFiles.map(
@@ -46,6 +47,18 @@ var webpack_lib_dev_babel_default = baseConfig({
46
47
  devtool: "eval-source-map",
47
48
  performance: {
48
49
  hints: false
50
+ },
51
+ devServer: {
52
+ client: {
53
+ overlay: {
54
+ errors: true,
55
+ warnings: false
56
+ }
57
+ },
58
+ historyApiFallback: true,
59
+ hot: true,
60
+ open: [basePath],
61
+ port: process.env.PORT || "auto"
49
62
  }
50
63
  });
51
64
  export {
@@ -12,3 +12,5 @@ export const logError: {
12
12
  };
13
13
  export function writeAppInfo(): Promise<void>;
14
14
  export function copyBuildAssetsToVersionedFolder(): Promise<void>;
15
+ export function isPathExist(pathToCheck: any): Promise<false | void>;
16
+ export function isApp(): Promise<false | void>;
@@ -103,5 +103,6 @@ export function baseConfig(options: any): {
103
103
  };
104
104
  devtool: any;
105
105
  performance: any;
106
+ devServer: any;
106
107
  };
107
108
  import ResolveTypeScriptPlugin from "resolve-typescript-plugin";
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  mode: any;
3
- entry: any;
3
+ entry: string[];
4
4
  output: any;
5
5
  optimization: any;
6
6
  module: {
@@ -48,8 +48,16 @@ declare const _default: {
48
48
  resourceQuery?: undefined;
49
49
  } | {
50
50
  test: RegExp;
51
- type: string;
51
+ exclude: RegExp;
52
+ use: string;
53
+ resolve?: undefined;
54
+ type?: undefined;
55
+ issuer?: undefined;
56
+ resourceQuery?: undefined;
57
+ } | {
58
+ test: RegExp;
52
59
  exclude: (modulePath: any) => boolean;
60
+ type: string;
53
61
  resolve?: undefined;
54
62
  use?: undefined;
55
63
  issuer?: undefined;
@@ -62,6 +70,14 @@ declare const _default: {
62
70
  use: string[];
63
71
  resolve?: undefined;
64
72
  type?: undefined;
73
+ } | {
74
+ test: RegExp;
75
+ exclude: (modulePath: any) => boolean;
76
+ use: string;
77
+ resolve?: undefined;
78
+ type?: undefined;
79
+ issuer?: undefined;
80
+ resourceQuery?: undefined;
65
81
  } | {
66
82
  resourceQuery: RegExp;
67
83
  type: string;
@@ -78,6 +94,7 @@ declare const _default: {
78
94
  extensions: string[];
79
95
  mainFields: string[];
80
96
  alias: any;
97
+ plugins: import("resolve-typescript-plugin")[];
81
98
  };
82
99
  externals: {
83
100
  '@elliemae/pui-user-monitoring': string;
@@ -103,5 +103,6 @@ declare const _default: {
103
103
  };
104
104
  devtool: any;
105
105
  performance: any;
106
+ devServer: any;
106
107
  };
107
108
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "7.0.0-alpha.30",
3
+ "version": "7.0.0-alpha.31",
4
4
  "description": "ICE MT UI Platform CLI",
5
5
  "sideEffects": false,
6
6
  "type": "module",
@@ -117,7 +117,7 @@
117
117
  "@typescript-eslint/eslint-plugin": "~5.31.0",
118
118
  "@typescript-eslint/parser": "~5.31.0",
119
119
  "@vitejs/plugin-react": "~2.0.0",
120
- "autoprefixer": "~10.4.7",
120
+ "autoprefixer": "~10.4.8",
121
121
  "axe-core": "~4.4.3",
122
122
  "babel-plugin-date-fns": "~2.0.0",
123
123
  "babel-plugin-dynamic-import-node": "~2.3.3",
@@ -163,7 +163,7 @@
163
163
  "eslint-plugin-eslint-comments": "~3.2.0",
164
164
  "eslint-plugin-import": "~2.26.0",
165
165
  "eslint-plugin-jest": "~26.6.0",
166
- "eslint-plugin-jsdoc": "~39.3.3",
166
+ "eslint-plugin-jsdoc": "~39.3.4",
167
167
  "eslint-plugin-jsx-a11y": "~6.6.1",
168
168
  "eslint-plugin-mdx": "~2.0.2",
169
169
  "eslint-plugin-prettier": "~4.2.1",
@@ -210,7 +210,7 @@
210
210
  "node-plop": "~0.31.0",
211
211
  "nodemon": "~2.0.19",
212
212
  "normalize-path": "~3.0.0",
213
- "npm-check-updates": "16.0.1",
213
+ "npm-check-updates": "16.0.3",
214
214
  "pino": "~8.3.1",
215
215
  "pino-pretty": "~8.1.0",
216
216
  "plop": "~3.1.1",
@@ -249,7 +249,7 @@
249
249
  "update-notifier": "~6.0.2",
250
250
  "url-loader": "~4.1.1",
251
251
  "uuid": "~8.3.2",
252
- "vite": "~3.0.3",
252
+ "vite": "~3.0.4",
253
253
  "vitest": "~0.19.1",
254
254
  "vite-tsconfig-paths": "~3.5.0",
255
255
  "webpack": "~5.74.0",