Commit graph

661 commits

Author SHA1 Message Date
emily-shen
ade0aed524
fix host/origin header validation in local explorer (#12869)
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-13 17:30:07 +00:00
Edmund Hung
22b51cd10d
Revert "[Workflows] Implement Workflows instance methods" (#12872) 2026-03-13 08:05:24 +00:00
Olga Silva
8d4ef788ef
[Workflows] Implement Workflows instance methods (#12814) 2026-03-12 15:15:34 +00:00
Pete Bacon Darwin
a31ee0b0c7
[workers-playground] Migrate from Cloudflare Pages to Cloudflare Workers (#12655)
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-11 13:11:10 +00:00
Somhairle MacLeòid
a6ddbdb2b6
Support Vitest 4 in @cloudflare/vitest-pool-workers (#11632)
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-10 17:26:47 -04:00
emily-shen
e4d9510c34
Add cross-process support to local explorer (#12754) 2026-03-09 16:13:59 +00:00
Pete Bacon Darwin
1beea21776
Replace public EBI Postgres database with local mock server in tests (#12784) 2026-03-06 14:29:55 +00:00
Ben
4c7633fe2e
fix: Node.js hybrid fixture PostgreSQL CI test (#12782) 2026-03-06 09:51:23 +00:00
Matt Lewis
5f7aaf2a94
Add support for hosted images api operations in the Images Binding (#10153)
Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com>
2026-03-02 16:08:38 +00:00
Pete Bacon Darwin
603fe181be
fix: add maxRetries to recursive directory removal for Windows EBUSY (#12629) 2026-02-24 14:10:45 +00:00
Somhairle MacLeòid
b7841dbbdb
Migrate tests from unstable_dev() to unstable_startWorker() (#12053) 2026-02-18 16:54:33 +00:00
Victor Berchet
e438f50cb2
test: use vitest assert (#12557) 2026-02-13 18:03:11 +01:00
Victor Berchet
6570ded5e5
Use vitest#expect from the local context (#12510) 2026-02-11 18:51:31 +01:00
Pete Bacon Darwin
b900c5adc1
[wrangler] Add CF_PAGES environment variables to pages dev (#12473) 2026-02-11 11:45:41 +00:00
emily-shen
7aaa2a5aa9
[explorer] add KV prefix search (#12431)
Co-authored-by: Ben Dixon <ben@nuro.dev>
2026-02-10 14:33:52 +00:00
Pete Bacon Darwin
1d58f06255
[local-explorer-ui] Generate API files on-the-fly instead of checking them in (#12451)
Co-authored-by: Victor Berchet <victor@suumit.com>
2026-02-09 14:59:21 +00:00
Victor Berchet
ace0e50839
refactor: export explorer paths from miniflare (#12441) 2026-02-06 16:28:01 +01:00
Victor Berchet
312b5ebd38
Drop node:process polyfill when v2 is available (#12377)
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
2026-02-05 22:40:46 +01:00
Victor Berchet
af236393e9
refactor: minor update for the local explorer (#12430) 2026-02-05 16:50:31 +01:00
emily-shen
ce9dc01a46
Serve explorer ui from miniflare (#12391) 2026-02-05 14:34:41 +00:00
Ben
447daa3b0b
feat(wrangler): Add hotkey to open local explorer (#12386)
Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
2026-02-04 17:07:23 +00:00
James Garbutt
22c40ba97c
chore: remove rimraf (#11913)
Co-authored-by: Pete Bacon Darwin <pbacondarwin@cloudflare.com>
2026-02-04 15:06:50 +00:00
Victor Berchet
f1fa88ea4a
test: add missing vitest configs to fixtures (#12405) 2026-02-04 14:27:51 +01:00
Pete Bacon Darwin
c47c16a5a3
chore: update version of undici in import-npm fixture (#12410) 2026-02-04 12:07:33 +00:00
emily-shen
60eaf16da4
[explorer] add the UI for the dev resource explorer (#12288) 2026-02-04 11:27:14 +00:00
Dario Piotrowicz
ee9b81fb0c
fix: improve error message when the entrypoint is incorrect (#11350)
Co-authored-by: Pete Bacon Darwin <pbacondarwin@cloudflare.com>
2026-02-03 22:10:30 +00:00
Victor Berchet
00a40adb32
refactor: minor updates to fixture tests (#12397) 2026-02-03 22:09:57 +01:00
Ben
83adb2cb7f
feat(miniflare): Add implementation for local explorer D1 API (#12267) 2026-02-03 17:44:43 +00:00
Victor Berchet
ead6246a01
Use vitest#expect from the local context (#12385) 2026-02-03 16:31:14 +00:00
Victor Berchet
a053aad188
refactor: use the shared UserError for containers (#12298) 2026-01-30 14:33:16 +01:00
Pete Bacon Darwin
dfcd4e7da7
Fix flaky workflow-multiple fixture test (#12297) 2026-01-30 10:46:35 +00:00
emily-shen
8a210afbfe
[explorer] add implementation for local KV API (take 2) (#12152)
* rename getLocalExplorerFromEnv() to getLocalExplorerEnabledFromEnv()

* Add resource ID to binding name map

Uses a JSON binding in the Local Explorer worker that maps binding names to namespace IDs

* Add script to filter openapi spec down

* add implementation for KV API

* changeset

* PR feedback, mroe tests and other fixups

* fix pnpm lock

* fixup

* pr feedback
2026-01-28 15:11:51 +00:00
Karim Sawaneh
7b40ceb8a5
[vitest-pool-workers] Fix JSON require() in module fallback (#11917)
Co-authored-by: Samuel Macleod <smacleod@cloudflare.com>
2026-01-26 09:09:22 +01:00
James Garbutt
014e7aa207
chore: use native stripVTControlCharacters (#11853)
* chore: use native stripVTControlCharacters

Since Node 16.x, there is a built-in function,
`stripVTControlCharacters`. This does the same job as the `strip-ansi`
package and makes it redundant going forward.

The minimum node version in these projects is at least 16, so we should
be good to switch.

* chore: remove unnecessary package-lock.json from import-npm fixture

* chore: remove private package from changeset

* chore: fix formatting

---------

Co-authored-by: Edmund Hung <edmund@cloudflare.com>
2026-01-23 18:36:50 +00:00
Edmund Hung
6d5f69fa0c
fix(vitest-pool-workers): allow Vite query parameters like ?raw on module imports (#12056) 2026-01-22 21:37:52 +00:00
emily-shen
05714f8710
Add initial plumbing for a local explorer worker (#12034)
* create fixture with many bindings

* Add resource api worker to miniflare

* gate behind experimental flag

* add tests

* changeset

* fixups

* rename to local explorer and more fixups
2026-01-22 17:34:40 +00:00
Somhairle MacLeòid
133bf95783
Add MessageBuilder support for Email Sending API in local mode (#11942)
* [miniflare] Add MessageBuilder support for Email Sending API in local mode

Implements support for the simplified MessageBuilder interface in Miniflare's
Email Sending API binding. This provides a developer-friendly alternative to
manually constructing MIME messages with the EmailMessage API.

Key changes:
- Add TypeScript types for MessageBuilder API (types.ts)
- Implement send() overload accepting MessageBuilder alongside EmailMessage
- Store email content (text, HTML, attachments) to viewable temp files
- Extract common storeTempFile() helper to reduce duplication
- Add comprehensive test coverage (12 new tests)

In local mode, content is saved to files that developers can open in their
editor/browser for inspection, with file paths logged to the console.

* Address PR review comments

- Simplify changeset description
- Shorten example subject to 'Hello'
- Remove trailing newline in changeset
- Remove extra blank line in send_email.worker.ts

* Add MessageBuilder examples to email-worker fixture

Adds comprehensive manual testing examples for the MessageBuilder API:
- /send-simple: Basic text-only email
- /send-html: Email with text and HTML content
- /send-attachment: Single text attachment
- /send-multi-attachment: Multiple attachment types (text, JSON, binary)
- /send-complex: Multiple recipients (to/cc/bcc)
- /test-bindings: Test all three binding types

Also includes:
- README with complete usage instructions
- Documentation of expected console output
- Notes about type assertions (types not yet in @cloudflare/workers-types)

Tested locally - all routes work correctly.

* Fix MessageBuilder validation to extract email from EmailAddress objects

The validateMessageBuilder function was passing EmailAddress objects
(with { name, email } structure) directly to validateRecipients, which
expected strings. This caused the error 'email to [object Object] not allowed'.

Fix: Extract email addresses from EmailAddress objects before validation
using the existing extractEmailAddress helper.

Tested with fixture routes that use EmailAddress objects:
- /send-simple (named sender)
- /send-complex (multiple recipients with names)

All tests pass.

* Fix snapshot test to handle Windows file paths

The MessageBuilder snapshot test was failing on Windows because the regex
only matched Unix-style paths (/...). Updated the regex to also match
Windows paths (C:\...) while still normalizing both to the same format.

Regex now matches:
- Unix: /var/folders/.../email-text/uuid.txt
- Windows: C:\Users\...\email-text\uuid.txt

Both normalize to: /email-text/[FILE].txt

* Add MessageBuilder support for remote mode email bindings

The proxy server previously only handled EmailMessage objects by
reconstructing them from the serialized 'EmailMessage::raw' property.
This fix adds detection for MessageBuilder objects and passes them
through directly since they're already plain serializable objects.

Changes:
- Check if the argument has 'EmailMessage::raw' property to distinguish
  EmailMessage from MessageBuilder
- EmailMessage: Reconstruct with EmailMessage constructor (existing behavior)
- MessageBuilder: Pass through directly as plain object (new behavior)

Both APIs now work correctly in remote mode via wrangler dev --remote.

* chore(deps): bump the workerd-and-workers-types group with 2 updates

Bumps the workerd-and-workers-types group with 2 updates: [workerd](https://github.com/cloudflare/workerd) and [@cloudflare/workers-types](https://github.com/cloudflare/workerd).


Updates `workerd` from 1.20260115.0 to 1.20260116.0
- [Release notes](https://github.com/cloudflare/workerd/releases)
- [Changelog](https://github.com/cloudflare/workerd/blob/main/RELEASE.md)
- [Commits](https://github.com/cloudflare/workerd/compare/v1.20260115.0...v1.20260116.0)

Updates `@cloudflare/workers-types` from 4.20260115.0 to 4.20260116.0
- [Release notes](https://github.com/cloudflare/workerd/releases)
- [Changelog](https://github.com/cloudflare/workerd/blob/main/RELEASE.md)
- [Commits](https://github.com/cloudflare/workerd/commits)

---
updated-dependencies:
- dependency-name: workerd
  dependency-version: 1.20260116.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: workerd-and-workers-types
- dependency-name: "@cloudflare/workers-types"
  dependency-version: 4.20260116.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: workerd-and-workers-types
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: update dependencies of "miniflare", "wrangler"

The following dependency versions have been updated:

| Dependency | From         | To           |
| ---------- | ------------ | ------------ |
| workerd    | 1.20260115.0 | 1.20260116.0 |

* Add dummy message ID

* add comments

* Update packages/miniflare/src/workers/email/send_email.worker.ts

Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Wrangler automated PR updater <wrangler@cloudflare.com>
Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com>
2026-01-19 17:10:03 +00:00
Pete Bacon Darwin
0eb973deb5
Do not warn user when using a redirected config that came from a config with multiple environments (#11848)
* do not warn user when using a redirected config that came from a config with multiple environments

This reverts these lines https://github.com/cloudflare/workers-sdk/pull/10706/files#diff-c5b22ef21f285ccf53ba4a990d6fba5e40050aee0dbe5a0b6737852164771d06L174-L182 which were added as a refactor but cause the warning to be emitted incorrectly.

* add changeset

* refactor vitest helpers to be imports

* remove check that is not really needed and fails on windows

* fix up for Windows
2026-01-10 17:53:14 +00:00
Victor Berchet
5e89bd1662
refactor: consistenly import expect from vitest (#11851)
* refactor: consistenly import expect from vitest

* fixup!
2026-01-09 15:15:40 +00:00
Victor Berchet
be5ef57244
refactor: consistenly import expect from vitest (#11795) 2026-01-05 14:54:25 +01:00
Somhairle MacLeòid
42b2216e6f
Reduce node_modules size (#11464)
* Bump vitest-pool-workers & fix failing workflows-shared test

* fewer vitest versions

* Update Vite react plugin

* Fix Wrangler build after chokidar update

* pin react
2025-12-23 16:12:07 +00:00
Olga Silva
eac5cf74db
[Workflows/vitest-pool-workers] Add a test handler to get the result of a workflow instance (#11648)
* [Workflows/vitest-pool-workers] Add Workflows result testing utils

* [Workflows/vitest-pool-workers] Add a test handler to get the result of a workflow instance
2025-12-23 12:22:10 +00:00
James Opstad
c54f8da0ec
Add default Text module rule for .sql files (#11738)
* Add failing fixture

* Add default SQL rule to Wrangler

* Add failing Vite playground test

* Add default SQL rule to Vite plugin

* Add changeset

* Update snapshot
2025-12-22 19:15:45 +00:00
Pete Bacon Darwin
8d9003e144
support ctx.exports in vitest-pool-workers (#11533)
* fix comment - we also export non-DOs now

* decrease the teardown timeout since the Pages vitest examples fixture will never teardown and always times out

* support ctx.exports in vitest

* Add JSDOC comments

* Improve warning text

* Rename `RunnerObject` class to `__VITEST_POOL_WORKERS_RUNNER_DURABLE_OBJECT__` in order to reduce chance of collision with user code.

This is the approach used in the Vite plugin and reduces the complexity of our code since we can stop "prefixing" user exports.

* improve changeset
2025-12-12 12:16:14 +00:00
Victor Berchet
3e9098705c
cleanup npm patches (#11598) 2025-12-11 11:55:41 +01:00
emily-shen
c15e99e840
support using containers with ctx.exports (#11512)
* update containers fixture to use ctx.exports

* support containers with DOs using ctx.exports

* changeset

* print containers

* Fix capitalisation in snapshots

* PR feedback

* fix windows ci

* don't rely on migrations only for validation
2025-12-10 11:43:55 +00:00
Pete Bacon Darwin
911c72a83b
fix failing basic-worker test and quarantine Redwood C3 test (#11564) 2025-12-09 10:44:01 +01:00
Dario Piotrowicz
1d685cbae8
Ensure that wrangler dev and vite dev/preview crash when we fail to create a remote proxy session (#11383)
* Fix: ensure that when a remote proxy session (for remote bindings) cannot be established an appropriate error is surfaced to the user

* Ensure that also the vite plugin crashes

* Apply suggestions from code review

Co-authored-by: Victor Berchet <victor@suumit.com>

* update changesets

* remote unnecessary R2 in test

* update tests and functionality

* update `get-platform-proxy-remote-bindings` fixture tests

* Update .changeset/proud-socks-slide.md

Co-authored-by: Victor Berchet <victor@suumit.com>

* fix snapshot not working on Windows

* update comment

* remove duplicated changeset line

---------

Co-authored-by: Victor Berchet <victor@suumit.com>
2025-11-28 13:48:46 +00:00
Pete Bacon Darwin
ed5186e9c4
add tests for vitest-pool-workers context exports (#11441)
* Add type parameter to `listDurableObjectIds()`

This add support for when the DurableObject namespace has been typed.

* add tests for vitest-pool-workers context exports

* test with isolated storage and non-single worker setups

* add durable object test cases

* Update fixtures/vitest-pool-workers-examples/context-exports/src/worker-configuration.d.ts

Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>

---------

Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
2025-11-27 17:59:16 +00:00
James Opstad
2ca70b1cba
Register named entrypoints with the dev registry (#11417)
* Add failing tests

* Refactor getDevMiniflareOptions and remove unknown tails logging

* Add named entrypoints to unsafeDirectSockets

* Add changeset
2025-11-26 16:28:19 +00:00