Skip to content

Commit b03a082

Browse files
committed
Merge branch 'main' into claude-3
2 parents d473203 + a865f76 commit b03a082

File tree

6 files changed

+46
-8
lines changed

6 files changed

+46
-8
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- run: npm run integration-ci
3434
env:
3535
HLX_FASTLY_AUTH: ${{ secrets.HLX_FASTLY_AUTH }}
36+
CLOUDFLARE_AUTH: ${{ secrets.CLOUDFLARE_AUTH }}
3637

3738
- name: Semantic Release (Dry Run)
3839
run: npm run semantic-release-dry

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## [1.2.1](https://github.com/adobe/helix-deploy-plugin-edge/compare/v1.2.0...v1.2.1) (2025-11-24)
2+
3+
4+
### Bug Fixes
5+
6+
* enable workers.dev subdomain after deployment ([b7a7cd2](https://github.com/adobe/helix-deploy-plugin-edge/commit/b7a7cd2e21cfb4f361977d842faf883b7934c2d1))
7+
8+
# [1.2.0](https://github.com/adobe/helix-deploy-plugin-edge/compare/v1.1.17...v1.2.0) (2025-11-19)
9+
10+
11+
### Features
12+
13+
* add concurrency control to deployment workflow ([4041224](https://github.com/adobe/helix-deploy-plugin-edge/commit/4041224a18bd8338156377e3b4592c725d9eec62))
14+
115
## [1.1.17](https://github.com/adobe/helix-deploy-plugin-edge/compare/v1.1.16...v1.1.17) (2025-10-31)
216

317

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adobe/helix-deploy-plugin-edge",
3-
"version": "1.1.17",
3+
"version": "1.2.1",
44
"description": "Helix Deploy - Plugin for Edge Compute",
55
"main": "src/index.js",
66
"type": "module",

src/CloudflareDeployer.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ export default class CloudflareDeployer extends BaseDeployer {
8989
await this.updatePackageParams(id, this.cfg.packageParams);
9090

9191
await this.restoreSettings(settings);
92+
93+
await this.enableSubdomain();
9294
}
9395

9496
async getSettings() {
@@ -120,6 +122,22 @@ export default class CloudflareDeployer extends BaseDeployer {
120122
return res.ok;
121123
}
122124

125+
async enableSubdomain() {
126+
const res = await this.fetch(`https://api.cloudflare.com/client/v4/accounts/${this._cfg.accountID}/workers/scripts/${this.fullFunctionName}/subdomain`, {
127+
method: 'POST',
128+
headers: {
129+
Authorization: `Bearer ${this._cfg.auth}`,
130+
'content-type': 'application/json',
131+
},
132+
body: JSON.stringify({ enabled: true }),
133+
});
134+
if (!res.ok) {
135+
const { errors } = await res.json();
136+
this.log.warn(`Unable to enable workers.dev subdomain: ${errors[0]?.message || 'unknown error'}`);
137+
}
138+
return res.ok;
139+
}
140+
123141
async updatePackageParams(id, params) {
124142
const kvlist = Object.entries(params).map(([key, value]) => ({
125143
key, value,
@@ -169,7 +187,7 @@ export default class CloudflareDeployer extends BaseDeployer {
169187
? this.testRequest({
170188
url: `https://${this.fullFunctionName}.${this._cfg.testDomain}.workers.dev`,
171189
idHeader: 'CF-RAY',
172-
retry404: 0,
190+
retry404: 5,
173191
})
174192
: undefined;
175193
}

test/cloudflare.integration.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Cloudflare Integration Test', () => {
3535
await fse.remove(testRoot);
3636
});
3737

38-
it.skip('Deploy a pure action to Cloudflare', async () => {
38+
it('Deploy a pure action to Cloudflare', async () => {
3939
await fse.copy(path.resolve(__rootdir, 'test', 'fixtures', 'edge-action'), testRoot);
4040
process.chdir(testRoot); // need to change .cwd() for yargs to pickup `wsk` in package.json
4141
const builder = await new CLI()
@@ -47,8 +47,9 @@ describe('Cloudflare Integration Test', () => {
4747
'--plugin', path.resolve(__rootdir, 'src', 'index.js'),
4848
'--arch', 'edge',
4949
'--cloudflare-email', 'lars@trieloff.net',
50-
'--cloudflare-account-id', 'b4adf6cfdac0918eb6aa5ad033da0747',
51-
'--cloudflare-test-domain', 'rockerduck',
50+
'--cloudflare-account-id', '155ec15a52a18a14801e04b019da5e5a',
51+
'--cloudflare-test-domain', 'minivelos',
52+
'--cloudflare-auth', process.env.CLOUDFLARE_AUTH,
5253
'--package.params', 'HEY=ho',
5354
'--package.params', 'ZIP=zap',
5455
'--update-package', 'true',
@@ -64,7 +65,7 @@ describe('Cloudflare Integration Test', () => {
6465
const res = await builder.run();
6566
assert.ok(res);
6667
const out = builder.cfg._logger.output;
67-
assert.ok(out.indexOf('https://simple-package--simple-project.rockerduck.workers.dev') > 0, out);
68+
assert.ok(out.indexOf('https://simple-package--simple-project.minivelos.workers.dev') > 0, out);
6869
}).timeout(10000000);
6970

7071
it.skip('Deploy logging example to Cloudflare', async () => {

test/deploy.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ describe('Deploy Test', () => {
5656
})
5757
.reply(200, JSON.stringify({ result: { id: 'test-namespace' } }))
5858
.put('/client/v4/accounts/123/workers/scripts/default--test-worker')
59-
.reply(200);
59+
.reply(200)
60+
.post('/client/v4/accounts/123/workers/scripts/default--test-worker/subdomain')
61+
.reply(200, JSON.stringify({ result: { enabled: true, previews_enabled: true } }));
6062

6163
process.chdir(testRoot); // need to change .cwd() for yargs to pickup `wsk` in package.json
6264
const builder = await new CLI()
@@ -120,7 +122,9 @@ describe('Deploy Test', () => {
120122
bodies.settings = b;
121123
return true;
122124
})
123-
.reply(200);
125+
.reply(200)
126+
.post('/client/v4/accounts/123/workers/scripts/default--test-worker/subdomain')
127+
.reply(200, JSON.stringify({ result: { enabled: true, previews_enabled: true } }));
124128

125129
process.chdir(testRoot); // need to change .cwd() for yargs to pickup `wsk` in package.json
126130
const builder = await new CLI()

0 commit comments

Comments
 (0)