@xh/hoist-dev-utils 6.2.0 → 6.3.0

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/README.md CHANGED
@@ -126,4 +126,4 @@ that uses Hoist-React, like [Toolbox](https://github.com/xh/toolbox). Then foll
126
126
 
127
127
  ☎️ info@xh.io | <https://xh.io>
128
128
 
129
- Copyright © 2022 Extremely Heavy Industries Inc.
129
+ Copyright © 2023 Extremely Heavy Industries Inc.
@@ -2,7 +2,7 @@
2
2
  * This file belongs to Hoist, an application development toolkit
3
3
  * developed by Extremely Heavy Industries (www.xh.io | info@xh.io)
4
4
  *
5
- * Copyright © 2022 Extremely Heavy Industries Inc.
5
+ * Copyright © 2023 Extremely Heavy Industries Inc.
6
6
  */
7
7
  'use strict';
8
8
 
@@ -48,16 +48,13 @@ try {
48
48
  * `webpack-dev-server --env inlineHoist` to run dev server w/hoist-react in inline mode
49
49
  *
50
50
  * @param {Object} env - config passed in from app webpack config or the CLI via --env flags.
51
- * @param {string} env.appCode - short, internal code for the application - baked into client as
52
- * XH.appCode. Should be lowercase, dash-separated, and should match the Gradle project name
53
- * (e.g. portfolio-manager).
54
- * @param {string} [env.appName] - user-facing display name for the application - baked into client
55
- * as XH.appName. Should be title cased and space-separated. If null, will be defaulted based
56
- * on appCode (e.g. portfolio-manager -> Portfolio Manager).
51
+ * @param {string} env.appCode - short, internal code for the application - baked into client as XH.appCode. Should be
52
+ * lowercase, dash-separated, and should match the Gradle project name (e.g. portfolio-manager).
53
+ * @param {string} [env.appName] - user-facing display name for the application - baked into client as XH.appName.
54
+ * Title cased and space-separated. If null, defaulted from appCode (portfolio-manager -> Portfolio Manager).
57
55
  * @param {string} [env.appVersion] - client version - baked into client as XH.appVersion
58
56
  * @param {string} [env.appBuild] - build/git tag - baked into client as XH.appBuild
59
- * @param {boolean} [env.prodBuild=false] - true to indicate this is a build (as opposed to run of
60
- * webpack-dev-server)
57
+ * @param {boolean} [env.prodBuild=false] - true to indicate this is a build (as opposed to run of webpack-dev-server)
61
58
  * @param {boolean} [env.inlineHoist=false] - true to use a locally checked-out copy of hoist-react
62
59
  * when running the dev server, as opposed to using the downloaded dependency. This allows
63
60
  * hoist-react developers to test plugin changes. Dev-mode only.
@@ -65,61 +62,52 @@ try {
65
62
  * when running the dev server.
66
63
  * @param {Object} [env.resolveAliases] - object mapping for custom webpack module resolution.
67
64
  * When inlineHoist=true, a mapping between @xh/hoist and the local path will be added.
68
- * @param {boolean} [env.analyzeBundles] - true to launch an interactive bundle analyzer to
69
- * review output bundles, contents, and sizes.
70
- * @param {boolean} [env.checkForDupePackages] - true (default) to run build through
71
- * DuplicatePackageCheckerPlugin and output a build-time console warning if duplicate packages
72
- * have been resolved due to non-overlapping dependencies. Set to false to disable if dupe
73
- * warnings are not desired / distracting.
74
- * @param {string[]} [env.dupePackageCheckExcludes] - optional list of string package names to
75
- * exclude from dupe package checking. Defaults to ['tslib'].
76
- * @param {string} [env.baseUrl] - root path prepended to all relative URLs called via FetchService.
77
- * Defaults to `/api/` in production mode to work with proxy-based deployments and to
78
- * `$devHost:$devGrailsPort` in dev mode.
79
- * @param {string[]} [env.babelIncludePaths] - additional paths to pass Babel for transpiling via
80
- * settings shared with app-level and @xh/hoist code. Intended for custom packages.
81
- * @param {string[]} [env.babelExcludePaths] - paths to exclude from Babel transpilation. An
82
- * example use would be a local package with a nested node_modules folder.
83
- * @param {string} [env.contextRoot] - root path for where the app will be served, used as the base
84
- * path for static files.
85
- * @param {boolean} [env.copyPublicAssets] - true (default) to copy the /client-app/public
86
- * contents into the root of the build. Note that files within this directory will not be
87
- * processed, named with a hash, etc. Use for static assets you wish to link to without using
88
- * an import to run through the url or file-loader. Required for favicons.
89
- * @param {boolean} [env.parseChangelog] - true (default) to parse a `CHANGELOG.md` file in the
90
- * project root directory into JSON and make available for import by `XH.changelogService`.
65
+ * @param {boolean} [env.checkForDupePackages=true] - true to run build throughDuplicatePackageCheckerPlugin and output
66
+ * a build-time warning if duplicate packages have been resolved due to non-overlapping dependencies.
67
+ * @param {string[]} [env.dupePackageCheckExcludes] - optional list of string package names to exclude from dupe package
68
+ * checking. Defaults to ['tslib'].
69
+ * @param {string} [env.baseUrl] - root path prepended to all relative URLs called via FetchService. Defaults to
70
+ * `/api/` in production mode to work with proxy-based deployments and to `$devHost:$devGrailsPort` in dev mode.
71
+ * @param {string[]} [env.babelIncludePaths] - additional paths to pass Babel for transpiling via settings shared with
72
+ * app-level and @xh/hoist code. Intended for custom packages.
73
+ * @param {string[]} [env.babelExcludePaths] - paths to exclude from Babel transpiling. An example use would be a local
74
+ * package with a nested node_modules folder.
75
+ * @param {string} [env.contextRoot] - root path from which app will be served, used as the base path for static files.
76
+ * @param {boolean} [env.copyPublicAssets=true] - true to copy the /client-app/public contents into the root of the
77
+ * build. Note that files within this directory will not be processed, named with a hash, etc. Use for static
78
+ * assets you wish to link to without using an import to run through the url or file-loader. Required for favicons.
79
+ * @param {boolean} [env.parseChangelog=true] - true to parse a `CHANGELOG.md` file in the project root directory into
80
+ * JSON and make available for import by `XH.changelogService`.
91
81
  * @param {string} [env.favicon] - relative path to a primary favicon source image.
92
- * @param {Object} [env.manifestConfig] - override values for manifest.json file. This controls
93
- * certain options related to adding a mobile app to a device home screen, as well as
94
- * "installing" an app via Chrome's "create shortcut" option. See
95
- * https://developer.mozilla.org/en-US/docs/Web/Manifest for options.
82
+ * @param {Object} [env.manifestConfig] - override values for manifest.json file. This controls options related to
83
+ * adding a mobile app to a device home screen, as well as "installing" an app via Chrome's "create shortcut"
84
+ * option. See https://developer.mozilla.org/en-US/docs/Web/Manifest for options.
85
+ * @param {string[]} [env.targetBrowsers] - array of browserslist queries specifying target browsers for Babel and CSS
86
+ * transpiling and processing.
87
+ * @param {Object} [env.babelPresetEnvOptions] - options to spread onto / override defaults passed here to the Babel
88
+ * loader preset-env preset config.
89
+ * @param {Object} [env.terserOptions] - options to spread onto / override defaults passed here to the Terser
90
+ * minification plugin for production builds.
91
+ * @param {(boolean|string)} [env.sourceMaps=true] - control sourceMap generation. Set to `true` to enable defaults
92
+ * specific to dev vs. prod builds, `false` to disable source maps entirely, special string `'devOnly'` to enable
93
+ * default for dev and disable in prod, or any other valid Webpack `devtool` string to specify a mode directly.
94
+ * @param {boolean} [env.loadAllBlueprintJsIcons=false] - false to only load the BlueprintJs icons required by Hoist
95
+ * React, resulting in a much smaller bundle size. Set to true if your app wishes to access all the BP icons.
96
96
  * @param {string} [env.stats] - stats output - see https://webpack.js.org/configuration/stats/.
97
- * @param {string} [env.infrastructureLoggingLevel] - default 'error' to quiet chatty devServer.
98
- * @param {string} [env.devHost] - hostname for both local Grails and Webpack dev servers.
99
- * Defaults to localhost, but may be overridden to a proper hostname for testing on alternate
100
- * workstations or devices. Will be automatically set to lowercase to comply with
97
+ * @param {boolean} [env.analyzeBundles] - true to launch an interactive bundle analyzer to review output bundle sizes.
98
+ * @param {string} [env.infrastructureLoggingLevel=error] - logging level for devServer.
99
+ * @param {boolean|Object} [env.devClientOverlay] - customize devServer overlay behavior. Set to show only compilation
100
+ * errors by default. See https://webpack.js.org/configuration/dev-server/#overlay. Dev-mode only.
101
+ * @param {string} [env.devHost=localhost] - hostname for both local Grails and Webpack dev servers. Override for
102
+ * testing on alternate workstations or devices. Will be automatically set to lowercase to comply with
101
103
  * webpack-dev-server's host checking. Dev-mode only.
102
104
  * @param {number} [env.devGrailsPort] - port of local Grails server. Dev-mode only.
103
105
  * @param {number} [env.devWebpackPort] - port on which to start webpack-dev server. Dev-mode only.
104
- * @param {string} [env.devServerOpenPage] - path to auto-open when webpack-dev-server starts.
105
- * Leave null to disable automatic page open on startup.
106
- * @param {string[]} [env.targetBrowsers] - array of browserslist queries specifying target
107
- * browsers for Babel and CSS transpilation and processing.
108
- * @param {Object} [env.babelPresetEnvOptions] - options to spread onto / override defaults passed
109
- * here to the Babel loader preset-env preset config.
110
- * @param {Object} [env.terserOptions] - options to spread onto / override defaults passed here to
111
- * the Terser minification plugin for production builds.
112
- * @param {(boolean|string)} [env.sourceMaps] - control sourceMap generation. Set to `true`
113
- * (default) to enable defaults specific to dev vs. prod builds, `false` to disable source
114
- * maps entirely, special string `'devOnly'` to enable default for dev and disable in prod, or
115
- * any other valid Webpack `devtool` string to specify a mode directly.
116
- * @param {boolean} [env.loadAllBlueprintJsIcons] - false (default) to only load the BlueprintJs
117
- * icons required by Hoist React components, resulting in a much smaller bundle size. Set to
118
- * true if your app wishes to access all the BP icons (but consider FontAwesome instead!).
119
- * @param {(Object|boolean)} [env.devHttps] - Object of the form `{ca, cert, key}`, with each
120
- * key pointing to the required resource for a full SSL config. Pass `true` to serve locally
121
- * over SSL w/o providing a cert (browser will warn). Applies to local dev only, no effect on
122
- * production builds.
106
+ * @param {string} [env.devServerOpenPage] - path to auto-open when webpack-dev-server starts. Leave null to disable
107
+ * automatic page open on startup. Dev-mode only.
108
+ * @param {(Object|boolean)} [env.devHttps] - Object of the form `{ca, cert, key}`, with each key pointing to the
109
+ * required resource for a full SSL config. Pass `true` to serve locally over SSL w/o providing a cert (browser
110
+ * will warn). Dev-mode only.
123
111
  */
124
112
  async function configureWebpack(env) {
125
113
  if (!env.appCode) throw 'Missing required "appCode" config - cannot proceed';
@@ -135,6 +123,11 @@ async function configureWebpack(env) {
135
123
  analyzeBundles = env.analyzeBundles === true,
136
124
  checkForDupePackages = env.checkForDupePackages !== false,
137
125
  dupePackageCheckExcludes = env.dupePackageCheckExcludes || ['tslib'],
126
+ devClientOverlay = env.devClientOverlay ?? {
127
+ errors: true,
128
+ warnings: false,
129
+ runtimeErrors: false
130
+ },
138
131
  devHost = env.devHost ? env.devHost.toLowerCase() : 'localhost',
139
132
  devHttps = prodBuild
140
133
  ? null
@@ -737,7 +730,7 @@ async function configureWebpack(env) {
737
730
  host: devHost,
738
731
  port: devWebpackPort,
739
732
  hot: true,
740
- client: {overlay: true},
733
+ client: {overlay: devClientOverlay},
741
734
  open: env.devServerOpenPage ? [env.devServerOpenPage] : false,
742
735
  // Support HTML5 history routes for apps, with /appName/ as the base route for each
743
736
  historyApiFallback: {
@@ -839,6 +832,7 @@ function getChunkCombinations(appNames) {
839
832
  function logSep() {
840
833
  console.log(':------------------------------------');
841
834
  }
835
+
842
836
  function logMsg(msg) {
843
837
  console.log(`: ${msg}`);
844
838
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist-dev-utils",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "description": "Utilities for configuring builds of Hoist-React client applications.",
5
5
  "repository": "github:xh/hoist-dev-utils",
6
6
  "homepage": "https://github.com/xh/hoist-dev-utils",
@@ -16,7 +16,7 @@
16
16
  "@babel/plugin-proposal-decorators": "^7.22.3",
17
17
  "@babel/preset-env": "^7.22.4",
18
18
  "@babel/preset-react": "^7.22.3",
19
- "@babel/preset-typescript": "^7.21.5",
19
+ "@babel/preset-typescript": "^7.22.5",
20
20
  "@cerner/duplicate-package-checker-webpack-plugin": "~2.3.0",
21
21
  "@types/lodash": "4.x",
22
22
  "@types/react": "18.x",
@@ -38,15 +38,15 @@
38
38
  "postcss-flexbugs-fixes": "~5.0.2",
39
39
  "postcss-loader": "~7.3.0",
40
40
  "rimraf": "~4.4.0",
41
- "sass": "~1.62.1",
41
+ "sass": "~1.63.4",
42
42
  "sass-loader": "~13.3.0",
43
43
  "sass-material-colors": "~0.0.5",
44
44
  "style-loader": "~3.3.2",
45
45
  "terser-webpack-plugin": "~5.3.7",
46
46
  "url-loader": "~4.1.1",
47
- "webpack": "~5.84.1",
48
- "webpack-bundle-analyzer": "~4.8.0",
49
- "webpack-cli": "~5.1.1",
47
+ "webpack": "~5.87.0",
48
+ "webpack-bundle-analyzer": "~4.9.0",
49
+ "webpack-cli": "~5.1.4",
50
50
  "webpack-dev-server": "~4.15.0",
51
51
  "webpackbar": "~5.0.2"
52
52
  },