@xh/hoist-dev-utils 7.0.0 → 7.1.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 © 2023 Extremely Heavy Industries Inc.
129
+ Copyright © 2024 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 © 2023 Extremely Heavy Industries Inc.
5
+ * Copyright © 2024 Extremely Heavy Industries Inc.
6
6
  */
7
7
  'use strict';
8
8
 
@@ -102,12 +102,12 @@ try {
102
102
  * testing on alternate workstations or devices. Will be automatically set to lowercase to comply with
103
103
  * webpack-dev-server's host checking. Dev-mode only.
104
104
  * @param {number} [env.devGrailsPort] - port of local Grails server. Dev-mode only.
105
- * @param {number} [env.devWebpackPort] - port on which to start webpack-dev server. Dev-mode only.
105
+ * @param {number} [env.devWebpackPort] - port on which to start webpack-dev-server. Dev-mode only.
106
106
  * @param {string} [env.devServerOpenPage] - path to auto-open when webpack-dev-server starts. Leave null to disable
107
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.
108
+ * @param {(boolean|Object)} [env.devHttps] - `true` to run webpack-dev-server locally over SSL w/o providing a cert
109
+ * (browser will warn). Or provide an object that will be passed to `devServer.server.options` to enable SSL and
110
+ * while specifying a custom cert/key. Default `false` runs locally over HTTP only. Dev-mode only.
111
111
  */
112
112
  async function configureWebpack(env) {
113
113
  if (!env.appCode) throw 'Missing required "appCode" config - cannot proceed';
@@ -129,15 +129,7 @@ async function configureWebpack(env) {
129
129
  runtimeErrors: false
130
130
  },
131
131
  devHost = env.devHost ? env.devHost.toLowerCase() : 'localhost',
132
- devHttps = prodBuild
133
- ? null
134
- : _.isPlainObject(env.devHttps)
135
- ? {
136
- ca: fs.readFileSync(env.devHttps.ca),
137
- cert: fs.readFileSync(env.devHttps.cert),
138
- key: fs.readFileSync(env.devHttps.key)
139
- }
140
- : !!env.devHttps,
132
+ devHttps = prodBuild ? null : _.isPlainObject(env.devHttps) ? env.devHttps : !!env.devHttps,
141
133
  devGrailsPort = env.devGrailsPort || 8080,
142
134
  devWebpackPort = env.devWebpackPort || 3000,
143
135
  baseUrl = env.baseUrl || (prodBuild ? '/api/' : `http://${devHost}:${devGrailsPort}/`),
@@ -659,7 +651,9 @@ async function configureWebpack(env) {
659
651
  template: path.resolve(hoistPath, `static/index-manifest.html`),
660
652
  filename: `${jsAppName}/index.html`,
661
653
  // Only include chunks that contain the js app name
662
- chunks: chunkNames.filter(it => it.includes(jsAppName)),
654
+ chunks: chunkNames.filter(
655
+ it => it.startsWith(jsAppName) || it.includes('~' + jsAppName)
656
+ ),
663
657
  // No need to minify the HTML itself
664
658
  minify: false,
665
659
  // Flag read within template file to include apple icon.
@@ -726,11 +720,16 @@ async function configureWebpack(env) {
726
720
  devServer: prodBuild
727
721
  ? undefined
728
722
  : {
729
- https: devHttps,
730
723
  host: devHost,
731
724
  port: devWebpackPort,
732
725
  hot: true,
733
726
  client: {overlay: devClientOverlay},
727
+ server:
728
+ devHttps === true
729
+ ? {type: 'https'}
730
+ : _.isPlainObject(devHttps)
731
+ ? {type: 'https', options: {...devHttps}}
732
+ : undefined,
734
733
  open: env.devServerOpenPage ? [env.devServerOpenPage] : false,
735
734
  // Support HTML5 history routes for apps, with /appName/ as the base route for each
736
735
  historyApiFallback: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist-dev-utils",
3
- "version": "7.0.0",
3
+ "version": "7.1.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",
@@ -12,11 +12,11 @@
12
12
  "static/**/*"
13
13
  ],
14
14
  "dependencies": {
15
- "@babel/core": "^7.22.1",
16
- "@babel/plugin-proposal-decorators": "^7.22.3",
17
- "@babel/preset-env": "^7.22.4",
18
- "@babel/preset-react": "^7.22.3",
19
- "@babel/preset-typescript": "^7.22.5",
15
+ "@babel/core": "^7.23.9",
16
+ "@babel/plugin-proposal-decorators": "^7.23.9",
17
+ "@babel/preset-env": "^7.23.9",
18
+ "@babel/preset-react": "^7.23.3",
19
+ "@babel/preset-typescript": "^7.23.3",
20
20
  "@cerner/duplicate-package-checker-webpack-plugin": "~2.3.0",
21
21
  "@types/lodash": "4.x",
22
22
  "@types/react": "18.x",
@@ -27,28 +27,28 @@
27
27
  "case-sensitive-paths-webpack-plugin": "~2.4.0",
28
28
  "changelog-parser": "~3.0.1",
29
29
  "clean-webpack-plugin": "~4.0.0",
30
- "copy-webpack-plugin": "~11.0.0",
31
- "css-loader": "~6.8.1",
30
+ "copy-webpack-plugin": "~12.0.2",
31
+ "css-loader": "~6.10.0",
32
32
  "file-loader": "~6.2.0",
33
- "html-webpack-plugin": "~5.5.0",
33
+ "html-webpack-plugin": "~5.6.0",
34
34
  "html-webpack-tags-plugin": "~3.0.2",
35
35
  "lodash": "~4.17.21",
36
- "mini-css-extract-plugin": "~2.7.5",
37
- "postcss": "~8.4.21",
36
+ "mini-css-extract-plugin": "~2.8.0",
37
+ "postcss": "~8.4.33",
38
38
  "postcss-flexbugs-fixes": "~5.0.2",
39
- "postcss-loader": "~7.3.0",
40
- "rimraf": "~4.4.0",
41
- "sass": "~1.63.4",
42
- "sass-loader": "~13.3.0",
39
+ "postcss-loader": "~8.1.0",
40
+ "rimraf": "~5.0.5",
41
+ "sass": "~1.70.0",
42
+ "sass-loader": "~14.1.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.88.2",
48
- "webpack-bundle-analyzer": "~4.9.0",
47
+ "webpack": "~5.90.1",
48
+ "webpack-bundle-analyzer": "~4.10.1",
49
49
  "webpack-cli": "~5.1.4",
50
50
  "webpack-dev-server": "~4.15.0",
51
- "webpackbar": "~5.0.2"
51
+ "webpackbar": "~6.0.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "prettier": "3.x"