@adobe/helix-deploy 10.0.1 → 10.2.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [10.2.0](https://github.com/adobe/helix-deploy/compare/v10.1.0...v10.2.0) (2024-01-18)
2
+
3
+
4
+ ### Features
5
+
6
+ * allow addition of webpack plugins. ([95eb9bb](https://github.com/adobe/helix-deploy/commit/95eb9bb8019dc969e5b7630a32a4c95efbf4b371)), closes [#641](https://github.com/adobe/helix-deploy/issues/641) [#642](https://github.com/adobe/helix-deploy/issues/642)
7
+
8
+ # [10.1.0](https://github.com/adobe/helix-deploy/compare/v10.0.1...v10.1.0) (2024-01-18)
9
+
10
+
11
+ ### Features
12
+
13
+ * add support for custom headers ([#640](https://github.com/adobe/helix-deploy/issues/640)) ([a726f7a](https://github.com/adobe/helix-deploy/commit/a726f7a994b9e6c764a107c7f5dde8975adda48f))
14
+
1
15
  ## [10.0.1](https://github.com/adobe/helix-deploy/compare/v10.0.0...v10.0.1) (2024-01-13)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-deploy",
3
- "version": "10.0.1",
3
+ "version": "10.2.0",
4
4
  "description": "Library and Commandline Tools to build and deploy OpenWhisk Actions",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/adobe/helix-deploy#readme",
@@ -71,7 +71,7 @@ export default class DevelopmentServer {
71
71
  this._main = main;
72
72
  this._cwd = process.cwd();
73
73
  this._port = process.env.WEBSERVER_PORT || 3000;
74
- this._xfh = 'helix-pages.anywhere.run';
74
+ this._headers = {};
75
75
  }
76
76
 
77
77
  withPort(value) {
@@ -80,7 +80,13 @@ export default class DevelopmentServer {
80
80
  }
81
81
 
82
82
  withXFH(value) {
83
- this._xfh = value;
83
+ process.emitWarning('DevelopmentServer.withXFH is deprecated. Use withHeader(\'x-forwarded-host\') instead.', 'DeprecationWarning');
84
+ this._headers['x-forwarded-host'] = value;
85
+ return this;
86
+ }
87
+
88
+ withHeader(name, value) {
89
+ this._headers[name] = value;
84
90
  return this;
85
91
  }
86
92
 
@@ -206,9 +212,9 @@ export default class DevelopmentServer {
206
212
  }
207
213
  });
208
214
  this.app.use(rawBody());
209
- if (this._xfh) {
210
- this.app.use(addRequestHeader('x-forwarded-host', this._xfh.replace('{port}', this._port)));
211
- }
215
+ Object.entries(this._headers).forEach(([name, value]) => {
216
+ this.app.use(addRequestHeader(name, value.replace('{port}', this._port)));
217
+ });
212
218
  this.app.all('*', this._handler);
213
219
  }
214
220
 
@@ -100,6 +100,15 @@ export default class WebpackBundler extends BaseBundler {
100
100
  if (cfg.progressHandler) {
101
101
  opts.plugins.push(new webpack.ProgressPlugin(cfg.progressHandler));
102
102
  }
103
+
104
+ const customizePath = path.join(cfg.cwd, 'hlx.webpack.customize.js');
105
+ if (await fse.pathExists(customizePath)) {
106
+ cfg.log.info(`--: Using custom webpack config from ${customizePath}`);
107
+ const customize = await import(customizePath);
108
+ if (customize.extraPlugins && typeof customize.extraPlugins === 'function') {
109
+ opts.plugins.push(...customize.extraPlugins(cfg, opts));
110
+ }
111
+ }
103
112
  return opts;
104
113
  }
105
114