@adobe/helix-deploy 6.2.1 → 6.2.5

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,31 @@
1
+ ## [6.2.5](https://github.com/adobe/helix-deploy/compare/v6.2.4...v6.2.5) (2022-02-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix more dev-server params ([#370](https://github.com/adobe/helix-deploy/issues/370)) ([300a457](https://github.com/adobe/helix-deploy/commit/300a4579e492da496f5ec2d66eb6bcf5d691438a))
7
+
8
+ ## [6.2.4](https://github.com/adobe/helix-deploy/compare/v6.2.3...v6.2.4) (2022-02-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fix development server dev params ([#368](https://github.com/adobe/helix-deploy/issues/368)) ([2e91e18](https://github.com/adobe/helix-deploy/commit/2e91e18d24222f936f978410857f1f1a675bc0da))
14
+
15
+ ## [6.2.3](https://github.com/adobe/helix-deploy/compare/v6.2.2...v6.2.3) (2022-02-04)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **deps:** update adobe fixes ([478db45](https://github.com/adobe/helix-deploy/commit/478db455cd8313cea648f49b85f0329514fe38a5))
21
+
22
+ ## [6.2.2](https://github.com/adobe/helix-deploy/compare/v6.2.1...v6.2.2) (2022-01-31)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **deps:** update external fixes ([#365](https://github.com/adobe/helix-deploy/issues/365)) ([1c5d845](https://github.com/adobe/helix-deploy/commit/1c5d8450ea20a2605d74b0fd82701bb7f771728b))
28
+
1
29
  ## [6.2.1](https://github.com/adobe/helix-deploy/compare/v6.2.0...v6.2.1) (2022-01-28)
2
30
 
3
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-deploy",
3
- "version": "6.2.1",
3
+ "version": "6.2.5",
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",
@@ -38,16 +38,16 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@adobe/fastly-native-promises": "2.0.0",
41
- "@adobe/helix-fetch": "3.0.0",
42
- "@aws-sdk/client-apigatewayv2": "3.48.0",
43
- "@aws-sdk/client-lambda": "3.48.0",
44
- "@aws-sdk/client-s3": "3.48.0",
45
- "@aws-sdk/client-secrets-manager": "3.48.0",
46
- "@aws-sdk/client-ssm": "3.48.0",
41
+ "@adobe/helix-fetch": "3.0.2",
42
+ "@aws-sdk/client-apigatewayv2": "3.49.0",
43
+ "@aws-sdk/client-lambda": "3.49.0",
44
+ "@aws-sdk/client-s3": "3.49.0",
45
+ "@aws-sdk/client-secrets-manager": "3.49.0",
46
+ "@aws-sdk/client-ssm": "3.49.0",
47
47
  "@fastly/js-compute": "0.2.1",
48
48
  "@google-cloud/functions": "1.2.0",
49
49
  "@google-cloud/secret-manager": "3.10.1",
50
- "@google-cloud/storage": "5.18.0",
50
+ "@google-cloud/storage": "5.18.1",
51
51
  "@rollup/plugin-alias": "3.1.9",
52
52
  "@rollup/plugin-commonjs": "21.0.1",
53
53
  "@rollup/plugin-json": "4.1.0",
@@ -55,15 +55,15 @@
55
55
  "archiver": "5.3.0",
56
56
  "chalk-template": "0.3.1",
57
57
  "constants-browserify": "1.0.0",
58
- "dotenv": "14.2.0",
58
+ "dotenv": "15.0.0",
59
59
  "express": "4.17.2",
60
60
  "form-data": "4.0.0",
61
61
  "fs-extra": "10.0.0",
62
62
  "get-stream": "6.0.1",
63
- "isomorphic-git": "1.10.5",
63
+ "isomorphic-git": "1.11.1",
64
64
  "openwhisk": "3.21.6",
65
65
  "proxyquire": "2.1.3",
66
- "rollup": "2.66.0",
66
+ "rollup": "2.66.1",
67
67
  "rollup-plugin-terser": "7.0.2",
68
68
  "semver": "7.3.5",
69
69
  "tar": "6.1.11",
@@ -72,26 +72,26 @@
72
72
  },
73
73
  "devDependencies": {
74
74
  "@adobe/eslint-config-helix": "1.3.2",
75
- "@adobe/helix-shared-wrap": "1.0.0",
75
+ "@adobe/helix-shared-wrap": "1.0.1",
76
76
  "@adobe/helix-status": "9.2.4",
77
- "@adobe/helix-universal-logger": "2.0.0",
77
+ "@adobe/helix-universal-logger": "2.0.1",
78
78
  "@semantic-release/changelog": "6.0.1",
79
79
  "@semantic-release/git": "10.0.1",
80
80
  "c8": "7.11.0",
81
- "chai": "4.3.4",
81
+ "chai": "4.3.6",
82
82
  "chai-http": "4.3.0",
83
83
  "codecov": "3.8.3",
84
- "eslint": "8.7.0",
84
+ "eslint": "8.8.0",
85
85
  "eslint-plugin-header": "3.1.1",
86
86
  "eslint-plugin-import": "2.25.4",
87
87
  "husky": "7.0.4",
88
- "lint-staged": "12.3.1",
89
- "mocha": "9.1.4",
88
+ "lint-staged": "12.3.2",
89
+ "mocha": "9.2.0",
90
90
  "mocha-junit-reporter": "2.0.2",
91
91
  "mocha-multi-reporters": "1.5.1",
92
92
  "nock": "13.2.2",
93
93
  "semantic-release": "19.0.2",
94
- "sinon": "12.0.1",
94
+ "sinon": "13.0.0",
95
95
  "yauzl": "2.10.0"
96
96
  },
97
97
  "engines": {
@@ -87,6 +87,11 @@ export default class DevelopmentServer {
87
87
  return this;
88
88
  }
89
89
 
90
+ withDirectory(value) {
91
+ this._cwd = value;
92
+ return this;
93
+ }
94
+
90
95
  get port() {
91
96
  return this._port;
92
97
  }
@@ -102,23 +107,33 @@ export default class DevelopmentServer {
102
107
  // load the action params params
103
108
  let pkgJson = {};
104
109
  try {
105
- pkgJson = await fse.readJson(path.resolve('package.json'));
110
+ pkgJson = await fse.readJson(path.resolve(this._cwd, 'package.json'));
106
111
  } catch (e) {
107
112
  // ignore
108
113
  }
109
114
  const config = new BaseConfig();
110
- if (pkgJson.wsk && pkgJson.wsk['params-file']) {
111
- config.withParamsFile(pkgJson.wsk['params-file']);
112
- }
113
- if (pkgJson.wsk && pkgJson.wsk.package && pkgJson.wsk.package['params-file']) {
114
- config.withParamsFile(pkgJson.wsk.package['params-file']);
115
- }
116
- if (pkgJson.wsk && pkgJson.wsk['dev-params-file']) {
117
- const file = pkgJson.wsk['dev-params-file'];
118
- if (await fse.exists(file)) {
119
- config.withParamsFile(file);
120
- }
115
+ if (pkgJson.wsk) {
116
+ const withParamsFile = async (file) => {
117
+ if (!file) {
118
+ return;
119
+ }
120
+ // eslint-disable-next-line no-param-reassign
121
+ const files = (Array.isArray(file) ? file : [file]).map((f) => path.resolve(this._cwd, f));
122
+ await Promise.all(files.map(async (f) => {
123
+ if (await fse.exists(f)) {
124
+ config.withParamsFile(f);
125
+ }
126
+ }));
127
+ };
128
+
129
+ await withParamsFile(pkgJson.wsk?.package?.['params-file']);
130
+ config.withParams(pkgJson.wsk?.package?.params);
131
+ await withParamsFile(pkgJson.wsk?.['params-file']);
132
+ config.withParams(pkgJson.wsk?.params);
133
+ await withParamsFile(pkgJson.wsk?.dev?.['params-file']);
134
+ config.withParams(pkgJson.wsk?.dev?.params);
121
135
  }
136
+
122
137
  const builder = new ActionBuilder().withConfig(config);
123
138
  await builder.validate();
124
139
 
@@ -129,8 +144,7 @@ export default class DevelopmentServer {
129
144
  './main.js': {
130
145
  main: this._main,
131
146
  },
132
- './google-package-params.js': () => (config.params),
133
- });
147
+ }).raw;
134
148
  this.params = config.params;
135
149
  return this;
136
150
  }
@@ -140,6 +154,11 @@ export default class DevelopmentServer {
140
154
  * @returns {Promise<void>}
141
155
  */
142
156
  async start() {
157
+ Object.entries(this.params).forEach(([key, value]) => {
158
+ if (!(key in process.env)) {
159
+ process.env[key] = value;
160
+ }
161
+ });
143
162
  this.app = express();
144
163
  await new Promise((resolve, reject) => {
145
164
  try {
@@ -154,7 +173,9 @@ export default class DevelopmentServer {
154
173
  }
155
174
  });
156
175
  this.app.use(rawBody());
157
- this.app.use(addRequestHeader('x-forwarded-host', this._xfh.replace('{port}', this._port)));
176
+ if (this._xfh) {
177
+ this.app.use(addRequestHeader('x-forwarded-host', this._xfh.replace('{port}', this._port)));
178
+ }
158
179
  this.app.all('*', this._handler);
159
180
  }
160
181