Skip to content

Support settings export in new config#14724

Merged
jamesopstad merged 2 commits into
mainfrom
james/new-config-settings
Jul 20, 2026
Merged

Support settings export in new config#14724
jamesopstad merged 2 commits into
mainfrom
james/new-config-settings

Conversation

@jamesopstad

@jamesopstad jamesopstad commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Add a settings export to the experimental cloudflare.config.ts config

Account-level settings (accountId, complianceRegion) now live in a dedicated, named settings export authored via defineSettings, rather than on the Worker config. A cloudflare.config.ts can export at most one settings object; the Worker itself is the default export.

// cloudflare.config.ts
import { defineSettings, defineWorker } from "wrangler/experimental-config";
import * as entrypoint from "./src/index.ts" with { type: "cf-worker" };

export const settings = defineSettings({
	accountId: "<your-account-id>",
});

export default defineWorker({
	name: "my-worker",
	entrypoint,
	compatibilityDate: "2026-05-18",
});

This is only used behind the experimental new-config path (wrangler --experimental-new-config and the @cloudflare/vite-plugin experimental.newConfig option).


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: experimental feature

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cbd348a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@cloudflare/config Minor
@cloudflare/vite-plugin Minor
wrangler Minor
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ask-bonk

ask-bonk Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

UnknownError: ProviderInitError

github run

@ask-bonk

ask-bonk Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@jamesopstad Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@github-actions

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14724

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@14724

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14724

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14724

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14724

miniflare

npm i https://pkg.pr.new/miniflare@14724

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14724

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14724

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14724

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14724

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14724

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14724

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14724

wrangler

npm i https://pkg.pr.new/wrangler@14724

commit: cbd348a

@jamesopstad
jamesopstad force-pushed the james/new-config-settings branch 2 times, most recently from 793788c to 3b5ac0f Compare July 17, 2026 13:21
@jamesopstad
jamesopstad marked this pull request as ready for review July 17, 2026 13:53
@workers-devprod
workers-devprod requested review from a team and penalosa and removed request for a team July 17, 2026 13:54
@workers-devprod

workers-devprod commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Comment thread packages/config/src/types.ts
Comment thread packages/config/src/settings-definition.ts

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jul 17, 2026
@jamesopstad
jamesopstad force-pushed the james/new-config-settings branch from 3b5ac0f to cbd348a Compare July 20, 2026 15:36
@jamesopstad
jamesopstad merged commit a50f73a into main Jul 20, 2026
64 of 66 checks passed
@jamesopstad
jamesopstad deleted the james/new-config-settings branch July 20, 2026 18:37
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants