Commit graph

47 commits

Author SHA1 Message Date
Somhairle MacLeòid
b5ac54baa4
Hard fail on Node.js < 22 (#13726) 2026-04-29 16:21:21 +01:00
Pete Bacon Darwin
4f6ed93846
[wrangler] Fix flaky container-rebuild-while-building test (#13674)
Co-authored-by: Victor Berchet <victor@suumit.com>
2026-04-27 10:26:39 +01:00
Pete Bacon Darwin
a68f1ce2fd
[wrangler] Fix flaky container-rebuild test on Linux CI (#13660) 2026-04-24 11:14:15 +01:00
emily-shen
1313275313
[explorer] add local explorer hotkey to the vite plugin (#13137)
Co-authored-by: Ben Dixon <ben@nuro.dev>
Co-authored-by: Ben <4991309+NuroDev@users.noreply.github.com>
2026-04-13 08:54:57 +01:00
Somhairle MacLeòid
aa26784ce1
Convert from ESLint to oxlint, Prettier to oxfmt (#12930) 2026-03-18 16:03:35 +00:00
emily-shen
ce48b77c4e
Ungate local explorer (#12848)
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Ben <4991309+NuroDev@users.noreply.github.com>
2026-03-18 10:47:29 +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
Victor Berchet
e438f50cb2
test: use vitest assert (#12557) 2026-02-13 18:03:11 +01: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
Victor Berchet
ead6246a01
Use vitest#expect from the local context (#12385) 2026-02-03 16:31:14 +00: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
Pete Bacon Darwin
4d61faed1c
modernize kv-asset-handler so that we can test is in Node 22+ (#11348)
* modernize kv-asset-handler so that we can test is in Node 22+

* suggestion from Vic

* fix exports on the kv-asset-handler package.json

* move kv-asset-handler tests back into main test run

* only test on Node 22

Node 20 has been in Maintenance for over a year and will become end of life in April 2026.
Node 22 entered Maintenance in October and is arguably the most stable and supported version right now.

* also test packages on Node 20 and 24

* really don't run interactive-dev tests on Windows

* remove redundant service-worker-mock

* wait for the old port to be closed

* Add resilience to reading and writing the dev registry files

* give prisma tests a bit longer to run
2025-11-22 11:40:45 +00:00
emily-shen
43503c764f
cleanup containers directly instead of using process.exit hook (#10986)
* also cleanup containers directly in the teardown hook

* remove unnecessary call in multiworker runtime controller
2025-10-15 15:41:07 +01:00
Dario Piotrowicz
83bb334a66
skip container tests locally if docker is not running (#10853)
* vite-plugin: skip containers tests locally if docker is not running

* fixtures/interactive-dev-tests: skip containers tests locally if docker is not running

* wrangler: skip containers e2e tests locally if docker is not running

* add message for tests skipping in wrangler e2es and interactive-dev-tests fixture

* run prettier

* move containers skipping logic to vite-plugin vitest global setup and add console warn
2025-10-15 11:09:03 +01:00
emily-shen
a5a1426a9e
cleanup some container images during local dev (#10289)
* cleanup duplicate tags

* also delete old tag after hotkey

* changeset

* pr feedback
2025-08-14 15:10:52 +02:00
Pete Bacon Darwin
43fdd13dfa
test: further efforts to reduce flakes (#10346)
* test: further efforts to reduce flakes on email bindings

* wait for container count in interactive-dev tests to avoid flakes

* upload turbo summaries

* don't show dry-run

* fixup turbo artifacts
2025-08-13 12:27:52 +02:00
emily-shen
360004d4d9
Clean up containers started by local dev during process exit hook instead (#10099)
* make cleanup container calls sync and call in process.on("exit")

* fix tests

* changeset

* PR feedback

* cleanup
2025-07-31 18:09:35 +01:00
Dario Piotrowicz
7245101d5a
[wrangler] make sure that the ready-on message is printed after the appropriate runtime controller is ready (#9910) 2025-07-23 17:10:27 +01:00
Dario Piotrowicz
154acf72c6
add support for containers in wrangler multiworker dev (#10032)
---------

Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com>
2025-07-23 12:23:38 +01:00
Pete Bacon Darwin
0a6ad911e2
reduce flakes on interactive-dev fixture tests (#10010)
* reduce flakes on interactive-dev fixture tests

* fixup! reduce flakes on interactive-dev fixture tests
2025-07-18 10:56:18 +01:00
Dario Piotrowicz
c7de92e870
Add some basic smoke tests to check that workers with multiple containers work as expected (#9960)
* add multi-containers tests in interactive-dev-tests

* add multi-containers wrangler deploy tests
2025-07-17 14:43:18 +01:00
Dario Piotrowicz
3743896120
ensure that container builds don't disrupt dev hotkey handling (#9833) 2025-07-10 16:04:29 +01:00
emily-shen
8e3ce64122
add container rebuild hotkey + dev cleanup tests (#9728)
* patch containerBuildId from hotkeys correctly

* add interactivity tests

* pr feedback
2025-07-08 13:30:40 +00:00
Somhairle MacLeòid
6fb8f50844
Run more tests, more of the time (#9737)
* run more tests, more of the time

* Checks can be single-os

* syntax

* syntax

* add more labels

* fix group

* fix group

* skip node 24

* skip test

* Simplify PR validation

* fix tool tests

* re-skip 24

* address review comments

* match existing test names
2025-06-26 10:39:38 +00:00
emily-shen
0e64c3515f
allow printing hotkeys conditionally (#9695)
* move hotkey registration later

* changeset

* fixups
2025-06-22 14:07:22 +00:00
emily-shen
0c615fba59
delete out-of-date test (#9470) 2025-06-04 14:10:34 +00:00
Pete Bacon Darwin
1f76f30bb3
Ensure consistent fixture package naming (#9378)
* tighten up turbo dependencies to avoid having to manually build

* test: ensure that fixture packages always start with `fixture-`

* refactor: consolidate fixture package names with consistent `fixture-` prefix

Updates all 63 fixture package names to use a consistent naming scheme with logical categorization:
- Core workers: fixture-worker-basic, fixture-worker-ai, fixture-worker-typescript, etc.
- Pages functions: fixture-pages-functions, fixture-pages-workerjs, etc.
- Database/storage: fixture-d1-basic, fixture-secrets-store, etc.
- Module handling: fixture-import-wasm, fixture-no-bundle-import, etc.
- Development tools: fixture-interactive-dev, fixture-local-mode, etc.

Also updates test files that reference specific fixture package names to maintain compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* add CI_OS env var to the check run to ensure correct turbo remote caching

* fixup! refactor: consolidate fixture package names with consistent `fixture-` prefix

* fixup! test: ensure that fixture packages always start with `fixture-`

* revert unnecessary change

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-05-28 12:08:48 +00:00
Somhairle MacLeòid
6479fc5228
Redesign wrangler dev (#9335)
* Better underscore + less linebreaking in Wrangler banner

* Remove local/remote hotkey, improve hotkey styling, and pin to top rather than bottom

* Improve print-bindings

* more redesign

* more redesign

* fix lint

* fix interactive tests

* fix pages-dev snapshots

* Create kind-dots-argue.md

* Address comments

* Address comments

* fix tests

* cleanup tests

* fix pages-dev test

* fix e2e snapshot

* add unsupported wording
2025-05-22 19:53:31 +00:00
Dario Piotrowicz
2c501151d3
chore: replace most wrangler.toml files in monorepo with wrangler.jsonc ones (#9033)
* chore: replace all existing `wrangler.toml` files to `wrangler.jsonc`

* run prettify

* update asset workers paths

* update dist asset worker file

* update `configPath`s

* remote trailing commas from wrangler.jsonc files

* revert pyproject.toml incorrectly converted

* add back trailing commas

* bump versions of vitest-pool-workers deps

this is needed so that users of vitest-pool-workers get an
up to date version of wrangler that supports wrangler.jsonc
files with trailing commas

* downgrade the workers-shared vitest-pool-workers dep

* update toml path reference

* fix additional-modules fixture

* adjust various paths

* fix paths

* fix get-platform-proxy tests

* fix interactive-dev-tests fixture

* update configPath

* fix vitest-pool-workers-examples

* revert toml->jsonc change to remix c3 template

* remove skip committed by mistake

* Update fixtures/d1-read-replication-app/wrangler.jsonc

Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>

* Update packages/workers-shared/router-worker/wrangler.jsonc

Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>

* revert c3 allowTrailingComma option change

* revert unintentional changelog change

* add changesets

* run pnpm prettify

---------

Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>
2025-04-24 21:07:27 +02:00
Victor Berchet
5ccad7d6b9
cleanup(fixtures): add missing dependencies to package.json (#7580) 2024-12-19 10:53:03 +01:00
Somhairle MacLeòid
80a83bb470
Support multiple workers in a single Miniflare instance (#7251) 2024-11-28 14:28:56 +00:00
Somhairle MacLeòid
b499b743e2
No more React in wrangler dev (--x-dev-env only) (#7069)
* No more React in dev

* fix e2e

* remove more dead code

* fix

* fix fixtures

* fix prettier

* fix lockfile

* more dead code elimination

* lockfile

* fix regression

* Create late-guests-end.md

* fix lockfile

* fix merge

* fix snapshots

* remove stray log

* windows?

* add e2e retries

* fail at the right bit of e2e c3 test

* skip on windows

* remove retries

* Update messaging
2024-11-11 10:10:50 -05:00
Somhairle MacLeòid
0a38bbade6
Update & consolidate some repo dependencies (#7090)
* undici -> catalog

* TS -> catalog

* upgrade ws

* absolutely pin @types/node

* fix types

* fix warnings

* fix some tests

* pin msw

* fix some tests
2024-10-25 17:56:31 +01:00
Somhairle MacLeòid
82180a7a76
Fix dev-env logging (#6909) 2024-10-07 17:54:29 +01:00
Rahul Sethi
35689ead46
React-free hotkeys implementation (#6149)
* initial implementation

* implement higher-level interface for hotkeys
automatically compute instructions

* extract onKeyPress to own module
for mocking

* add tests

* add changeset

* add --x-dev-env flagged run of fixtures/interactive-dev-tests

* add test for handlers throwing errors

* chore: cleanup teardown

* fix: onKeyPress keeps the process alive after unregistering

Listening for events on process.stdin (eg .on('keypress')) causes it to go into 'old mode'
which keeps this nodejs process alive even after calling .off('keypress')

WORKAROUND: piping stdin via a transform stream allows us to call stream.destroy()
which then allows this nodejs process to close cleanly

* hotkeys integration

* implement Logger bottom float

* use registerGlobalBottomFloat for floating hotkeys instructions

* move registerGlobalBottomFloat calls into hotkeys implementation

* add test steps for unregistered hotkeys

+ update mock to return unregisterHotKeys mock

* fix lints

* setIsTTY(true) in tests

* add docs link to comment

* unregisterHotKeys before devEnv.teardown

* enable modifier key detection in hotkeys api

* fix: store previousBottomFloatLineCount in case the line count changes
+ ensures no existing logs (from before registerGlobalBottomFloat was called) are cleared

* fix: usages of console.dir/table -> logger.dir/table
+ use static methods of miniflare Log which are now stateful -- rather than reimplement in Wrangler's Logger not sharing state

* mark methods with unsafe_

* fixup

* use setIsTTY inside beforeEach

* use readline.moveCursor(stdout,...) instead of stdout.moveCursor(...)

* abstract knowledge of bototm float from logger implementations

* fix lints

* use readline.clearScreenDown

* handle forceLocal (disabled hotkey options)

* refactor

* update changeset type to refactor

* implement logger.console

* unregister hotkeys during auth prompt

* update AbortError checks

* fix logger.console types

* change getAccountId to requireAuth

* check isTTY in unregister keypress

* fix RemoteRuntimeController shutdown log

* use isNonInteractiveOrCI util

* hookify the hotkeys disabled option

* use isInteractive() instead of !isNonIteractiveOrCI()
2024-07-02 17:26:05 +01:00
Pete Bacon Darwin
68fac09dbd
chore: change vitest config to be ESM (for sure) to avoid warnings (#6055)
Without this we often see:

```
 The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
```
2024-06-18 12:32:03 +01:00
Sunil Pai
f5ad1d3e56
Normalize some dependencies in workers-sdk (#6029)
This is the first of a few expected patches that normalize dependency versions, This normalizes `undici`, `concurrently`, `@types/node`, `react`, `react-dom`, `@types/react`, `@types/react-dom`, `eslint`, `typescript`. There are no functional code changes (but there are a couple of typecheck fixes).
2024-06-14 18:59:32 +01:00
Pete Bacon Darwin
b7b1d65003
chore: use root volta config in all fixtures/packages (#5973)
Co-authored-by: bcoll <bcoll@cloudflare.com>
2024-06-05 11:32:08 +01:00
MrBBot
82415b55b8
Implement additional E2E tests for wrangler dev (--remote) (#4486)
* Implement additional E2E tests for `wrangler dev (--remote)`

* Rebase + rework e2e to use readUntil

* Kill Wrangler

* Use prebuilt node-pty to speedup CI installation

---------

Co-authored-by: Samuel Macleod <smacleod@cloudflare.com>
2024-05-15 20:16:19 +01:00
Somhairle MacLeòid
086e10da87
Turborepo fixups (#5710)
* fix c3 beta

* Update deps
2024-04-26 08:10:41 +01:00
Somhairle MacLeòid
2ec4b930ba
Enable test caching (#5521)
* Enable test caching

* more cach plz

* fix lockfile

* Run all tests in CI

* fix test

* lockfile
2024-04-18 19:19:05 +01:00
Pete Bacon Darwin
d70f44a171
ci: remove fixture from changeset releases (#5173)
* ci: remove fixture from changeset releases

* ci: ensure that fixtures are not deployable

* ci: actually run the deploy script not the deploy command for deploying Workers and Pages

* fixup! ci: ensure that fixtures are not deployable
2024-03-06 10:36:36 +00:00
dependabot[bot]
96b79b3f83
chore(deps): bump undici from 5.28.2 to 5.28.3 (#5041)
Bumps [undici](https://github.com/nodejs/undici) from 5.28.2 to 5.28.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.2...v5.28.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-19 09:48:26 +00:00
Pete Bacon Darwin
7ad8ddd732
chore: bump vite and vitest to latest versions (#4899) 2024-02-12 15:44:16 +00:00
James Culveyhouse
0123eef14a
[C3] Fix next dev command and remove shell-quote (#4834)
* Changing devCommand and deployCommand to string. Fixing next dev command

* Update TemplateConfig docs and remote unused  field

* Remove shell-quote

* changeset

* Renaming devCommand to devScript. Responding to PR feedback

* Skip yarn + remix e2e tests
2024-01-26 11:07:11 +00:00
Pete Bacon Darwin
e4011b1481
chore: inherit vitest settings from the root (#4800) 2024-01-22 17:04:46 +00:00
MrBBot
93e88c433f
[wrangler] fix: ensure wrangler (pages) dev exits cleanly (#4693)
* fix: ensure `wrangler dev` exits with code `0` on clean exit

We were previously calling `process.disconnect()` twice: once in `dev`
specific code, and once in the CLI `main()` function. The 2nd call was
throwing with an already disconnected error causing `wrangler dev` to
exit with code `1`. This exception was being swallowed as `cli.ts`'s
`catch()` assumes the error has already been logged.

This change makes sure we only call `process.disconnect()` once, and
also logs errors in this `finally` block.

* fix: ensure `wrangler pages dev` exits cleanly

This change ensures the `onReady` function passed as a prop to
`InteractiveDevSession` is called when the hostname/port match the
initial values (the case for `wrangler pages dev` without flags).

This prevented the `Promise` returned by `unstable_dev()` in non-test
mode from resolving. This in turn prevented Pages' cleanup callbacks
being registered and `run pages dev` metrics being sent.

* test: add tests for interactive dev sessions and clean exits

This adds a new fixture test that runs `wrangler (pages) dev` in a
pseudo-TTY to test `InteractiveDevSession`. This allows us to test
`CTRL+C`/`x` clean exits without zombie `workerd` processes.
2024-01-04 16:50:38 +00:00