@adobe/helix-deploy 11.1.10 → 11.1.12
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
|
+
## [11.1.12](https://github.com/adobe/helix-deploy/compare/v11.1.11...v11.1.12) (2024-06-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* restore worker settings ([#712](https://github.com/adobe/helix-deploy/issues/712)) ([8ba9ca1](https://github.com/adobe/helix-deploy/commit/8ba9ca1414c3e2ea10258bef64e509e53d4cd72a))
|
|
7
|
+
|
|
8
|
+
## [11.1.11](https://github.com/adobe/helix-deploy/compare/v11.1.10...v11.1.11) (2024-06-08)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update external fixes ([#713](https://github.com/adobe/helix-deploy/issues/713)) ([2a74389](https://github.com/adobe/helix-deploy/commit/2a7438900244dab1c2923cb823d94644ca00fbcc))
|
|
14
|
+
|
|
1
15
|
## [11.1.10](https://github.com/adobe/helix-deploy/compare/v11.1.9...v11.1.10) (2024-06-07)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-deploy",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.12",
|
|
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",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"@adobe/fastly-native-promises": "3.0.10",
|
|
41
41
|
"@adobe/fetch": "4.1.8",
|
|
42
42
|
"@adobe/helix-shared-process-queue": "3.0.4",
|
|
43
|
-
"@aws-sdk/client-apigatewayv2": "3.
|
|
44
|
-
"@aws-sdk/client-lambda": "3.
|
|
45
|
-
"@aws-sdk/client-s3": "3.
|
|
46
|
-
"@aws-sdk/client-secrets-manager": "3.
|
|
47
|
-
"@aws-sdk/client-ssm": "3.
|
|
48
|
-
"@aws-sdk/client-sts": "3.
|
|
49
|
-
"@fastly/js-compute": "3.
|
|
43
|
+
"@aws-sdk/client-apigatewayv2": "3.592.0",
|
|
44
|
+
"@aws-sdk/client-lambda": "3.592.0",
|
|
45
|
+
"@aws-sdk/client-s3": "3.592.0",
|
|
46
|
+
"@aws-sdk/client-secrets-manager": "3.592.0",
|
|
47
|
+
"@aws-sdk/client-ssm": "3.592.0",
|
|
48
|
+
"@aws-sdk/client-sts": "3.592.0",
|
|
49
|
+
"@fastly/js-compute": "3.15.0",
|
|
50
50
|
"@google-cloud/functions": "3.4.0",
|
|
51
51
|
"@google-cloud/secret-manager": "5.6.0",
|
|
52
|
-
"@google-cloud/storage": "7.11.
|
|
52
|
+
"@google-cloud/storage": "7.11.2",
|
|
53
53
|
"@rollup/plugin-alias": "5.1.0",
|
|
54
54
|
"@rollup/plugin-commonjs": "25.0.8",
|
|
55
55
|
"@rollup/plugin-json": "6.1.0",
|
|
@@ -155,7 +155,10 @@ export default class BaseBundler {
|
|
|
155
155
|
|
|
156
156
|
async updateArchive(archive, packageJson) {
|
|
157
157
|
const { cfg } = this;
|
|
158
|
-
|
|
158
|
+
if (cfg.archs.includes('node')) {
|
|
159
|
+
archive.file(cfg.bundle, { name: 'index.js' });
|
|
160
|
+
}
|
|
161
|
+
|
|
159
162
|
cfg.statics.forEach(([src, name]) => {
|
|
160
163
|
try {
|
|
161
164
|
if (fse.lstatSync(src)
|
|
@@ -168,6 +171,7 @@ export default class BaseBundler {
|
|
|
168
171
|
throw Error(`error with static file: ${e.message}`);
|
|
169
172
|
}
|
|
170
173
|
});
|
|
174
|
+
|
|
171
175
|
cfg.modules.forEach((mod) => {
|
|
172
176
|
archive.directory(path.resolve(cfg.cwd, `node_modules/${mod}`), `node_modules/${mod}`);
|
|
173
177
|
});
|
|
@@ -124,4 +124,9 @@ export default class EdgeBundler extends WebpackBundler {
|
|
|
124
124
|
}
|
|
125
125
|
return this.createWebpackBundle('edge');
|
|
126
126
|
}
|
|
127
|
+
|
|
128
|
+
// eslint-disable-next-line class-methods-use-this
|
|
129
|
+
validateBundle() {
|
|
130
|
+
// TODO: validate edge bundle, skipped since we're on node
|
|
131
|
+
}
|
|
127
132
|
}
|
|
@@ -44,7 +44,12 @@ export default class CloudflareConfig {
|
|
|
44
44
|
|
|
45
45
|
static yarg(yargs) {
|
|
46
46
|
return yargs
|
|
47
|
-
.group([
|
|
47
|
+
.group([
|
|
48
|
+
'cloudflare-account-id',
|
|
49
|
+
'cloudflare-auth',
|
|
50
|
+
'cloudflare-email',
|
|
51
|
+
'cloudflare-test-domain',
|
|
52
|
+
], 'Cloudflare Workers Deployment Options')
|
|
48
53
|
.option('cloudflare-account-id', {
|
|
49
54
|
description: 'the Cloudflare account ID to deploy to',
|
|
50
55
|
type: 'string',
|
|
@@ -43,6 +43,7 @@ export default class CloudflareDeployer extends BaseDeployer {
|
|
|
43
43
|
|
|
44
44
|
async deploy() {
|
|
45
45
|
const body = fs.readFileSync(this.cfg.edgeBundle);
|
|
46
|
+
const settings = await this.getSettings();
|
|
46
47
|
const { id } = await this.createKVNamespace(`${this.cfg.packageName}--secrets`);
|
|
47
48
|
|
|
48
49
|
const metadata = {
|
|
@@ -86,12 +87,46 @@ export default class CloudflareDeployer extends BaseDeployer {
|
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
await this.updatePackageParams(id, this.cfg.packageParams);
|
|
90
|
+
|
|
91
|
+
await this.restoreSettings(settings);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async getSettings() {
|
|
95
|
+
const res = await this.fetch(`https://api.cloudflare.com/client/v4/accounts/${this._cfg.accountID}/workers/scripts/${this.fullFunctionName}/script-settings`, {
|
|
96
|
+
method: 'GET',
|
|
97
|
+
headers: {
|
|
98
|
+
Authorization: `Bearer ${this._cfg.auth}`,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
if (!res.ok) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
const { result } = await res.json();
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async restoreSettings(existing) {
|
|
109
|
+
if (!existing) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
const res = await this.fetch(`https://api.cloudflare.com/client/v4/accounts/${this._cfg.accountID}/workers/scripts/${this.fullFunctionName}/script-settings`, {
|
|
113
|
+
method: 'PATCH',
|
|
114
|
+
headers: {
|
|
115
|
+
Authorization: `Bearer ${this._cfg.auth}`,
|
|
116
|
+
'content-type': 'application/json',
|
|
117
|
+
},
|
|
118
|
+
body: JSON.stringify(existing),
|
|
119
|
+
});
|
|
120
|
+
return res.ok;
|
|
89
121
|
}
|
|
90
122
|
|
|
91
123
|
async updatePackageParams(id, params) {
|
|
92
124
|
const kvlist = Object.entries(params).map(([key, value]) => ({
|
|
93
125
|
key, value,
|
|
94
126
|
}));
|
|
127
|
+
if (!kvlist.length) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
95
130
|
|
|
96
131
|
const res = await this.fetch(`https://api.cloudflare.com/client/v4/accounts/${this._cfg.accountID}/storage/kv/namespaces/${id}/bulk`, {
|
|
97
132
|
method: 'PUT',
|
|
@@ -35,7 +35,6 @@ async function run(bundlePath, cfg) {
|
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
|
-
|
|
39
38
|
const testUrl = String(test).startsWith('/') ? test : cfg.testUrl;
|
|
40
39
|
if (testUrl) {
|
|
41
40
|
const url = new URL(testUrl, 'https://localhost/');
|
|
@@ -43,6 +42,7 @@ async function run(bundlePath, cfg) {
|
|
|
43
42
|
event.rawPath += url.pathname;
|
|
44
43
|
event.rawQueryString = url.searchParams.toString();
|
|
45
44
|
}
|
|
45
|
+
|
|
46
46
|
const fn = typeof lambda.raw === 'function' ? lambda.raw : lambda;
|
|
47
47
|
result.response = await fn(event, {
|
|
48
48
|
invokedFunctionArn: `arn:aws:lambda:us-east-1:118435662149:function:${cfg.packageName}--${cfg.baseName}:${cfg.version}`,
|