Skip to content

Conversation

@petebacondarwin
Copy link
Contributor

@petebacondarwin petebacondarwin commented Nov 13, 2024

Fixes #DEVDASH-330

This feature is described in an internal doc: MINI-SPEC:Allow 3rd party build tools to generate Worker code and configuration

The main goal here is to enable tools to generate a partial configuration file that is merged into the user configuration when Wrangler commands are run.

The file must be written to ./.wrangler/config/extra.json, where the path is relative to the project path, which is the directory containing the wrangler.toml or the current working directory if there is no wrangler.toml.

The format of the file is a JSON object whose properties are the inheritable and non-inheritable options described in the Wrangler configuration documentation. Notably it cannot contain the "top level" configuration properties.

The contents of the file will be merged into the configuration of the currently selected environment before being used in all Wrangler commands.

The user does not need to manually specify that this merging should happen. It is done automatically when the file is found.


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because:
  • Public documentation

@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2024

🦋 Changeset detected

Latest commit: c1022d6

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

This PR includes changesets to release 2 packages
Name Type
wrangler Patch
@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

@petebacondarwin petebacondarwin changed the title feat: allow 3rd party build tools to generate Worker code and configuration feat: support extending the user configuration Nov 13, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2024

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-wrangler-7250

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7250/npm-package-wrangler-7250

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-wrangler-7250 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-create-cloudflare-7250 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-cloudflare-kv-asset-handler-7250
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-miniflare-7250
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-cloudflare-pages-shared-7250
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-cloudflare-vitest-pool-workers-7250
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-cloudflare-workers-editor-shared-7250
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-cloudflare-workers-shared-7250
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11826008691/npm-package-cloudflare-workflows-shared-7250

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20241106.0
workerd 1.20241106.1 1.20241106.1
workerd --version 1.20241106.1 2024-11-06

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@petebacondarwin petebacondarwin added the e2e Run wrangler + vite-plugin e2e tests on a PR label Nov 13, 2024
@petebacondarwin petebacondarwin marked this pull request as ready for review November 13, 2024 15:34
@petebacondarwin petebacondarwin requested a review from a team as a code owner November 13, 2024 15:34
@petebacondarwin petebacondarwin marked this pull request as draft November 15, 2024 10:34
@petebacondarwin
Copy link
Contributor Author

Closing as we are not taking this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run wrangler + vite-plugin e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant