@adobe/helix-deploy 6.2.0 → 6.2.4

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.4](https://github.com/adobe/helix-deploy/compare/v6.2.3...v6.2.4) (2022-02-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix development server dev params ([#368](https://github.com/adobe/helix-deploy/issues/368)) ([2e91e18](https://github.com/adobe/helix-deploy/commit/2e91e18d24222f936f978410857f1f1a675bc0da))
7
+
8
+ ## [6.2.3](https://github.com/adobe/helix-deploy/compare/v6.2.2...v6.2.3) (2022-02-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update adobe fixes ([478db45](https://github.com/adobe/helix-deploy/commit/478db455cd8313cea648f49b85f0329514fe38a5))
14
+
15
+ ## [6.2.2](https://github.com/adobe/helix-deploy/compare/v6.2.1...v6.2.2) (2022-01-31)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **deps:** update external fixes ([#365](https://github.com/adobe/helix-deploy/issues/365)) ([1c5d845](https://github.com/adobe/helix-deploy/commit/1c5d8450ea20a2605d74b0fd82701bb7f771728b))
21
+
22
+ ## [6.2.1](https://github.com/adobe/helix-deploy/compare/v6.2.0...v6.2.1) (2022-01-28)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * properly export development server ([a3b60d8](https://github.com/adobe/helix-deploy/commit/a3b60d8107285a93ba72ed99ec21112b1ee565ed))
28
+
1
29
  # [6.2.0](https://github.com/adobe/helix-deploy/compare/v6.1.0...v6.2.0) (2022-01-28)
2
30
 
3
31
 
package/index.js CHANGED
@@ -9,16 +9,8 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
- const ActionBuilder = require('./src/ActionBuilder.js');
13
- const Bundler = require('./src/bundler/WebpackBundler.js');
14
- const BaseConfig = require('./src/BaseConfig.js');
15
- const CLI = require('./src/cli.js');
16
- const DevelopmentServer = require('./src/DevelopmentServer.js');
17
-
18
- module.exports = {
19
- ActionBuilder,
20
- Bundler,
21
- BaseConfig,
22
- CLI,
23
- DevelopmentServer,
24
- };
12
+ export { default as ActionBuilder } from './src/ActionBuilder.js';
13
+ export { default as Bundler } from './src/bundler/WebpackBundler.js';
14
+ export { default as BaseConfig } from './src/BaseConfig.js';
15
+ export { default as CLI } from './src/cli.js';
16
+ export { default as DevelopmentServer } from './src/DevelopmentServer.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-deploy",
3
- "version": "6.2.0",
3
+ "version": "6.2.4",
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,7 +144,8 @@ export default class DevelopmentServer {
129
144
  './main.js': {
130
145
  main: this._main,
131
146
  },
132
- './google-package-params.js': () => (config.params),
147
+ './google-package-params.js': () => (config.params), // backward compatible
148
+ './google-secrets.js': () => (config.params),
133
149
  });
134
150
  this.params = config.params;
135
151
  return this;
@@ -154,7 +170,9 @@ export default class DevelopmentServer {
154
170
  }
155
171
  });
156
172
  this.app.use(rawBody());
157
- this.app.use(addRequestHeader('x-forwarded-host', this._xfh.replace('{port}', this._port)));
173
+ if (this._xfh) {
174
+ this.app.use(addRequestHeader('x-forwarded-host', this._xfh.replace('{port}', this._port)));
175
+ }
158
176
  this.app.all('*', this._handler);
159
177
  }
160
178
 
@@ -223,8 +223,8 @@ export default class GoogleDeployer extends BaseDeployer {
223
223
  },
224
224
  });
225
225
  } catch (err) {
226
- this.log.error(chalk`{red error:} bad request: ${err.metadata.internalRepr.get('google.rpc.badrequest-bin').toString()}`);
227
- this.log.error(chalk`{red error:} details: ${err.metadata.internalRepr.get('grpc-status-details-bin').toString()}`);
226
+ this.log.error(chalk`{red error:} bad request: ${err.metadata.internalRepr?.get('google.rpc.badrequest-bin')?.toString()}`);
227
+ this.log.error(chalk`{red error:} details: ${err.metadata.internalRepr?.get('grpc-status-details-bin')?.toString()}`);
228
228
  throw err;
229
229
  }
230
230
 
package/src/index.js CHANGED
@@ -11,7 +11,6 @@
11
11
  * OF ANY KIND, either express or implied. See the License for the specific language
12
12
  * governing permissions and limitations under the License.
13
13
  */
14
-
15
14
  import CLI from './cli.js';
16
15
 
17
16
  new CLI().run(process.argv.slice(2));