workers-sdk
workers-sdk copied to clipboard
feat: cloudflare workers repl
Introduces a repl style interface for cloudflare workers, running locally through miniflare. I think it is important that we let people know that this is running through miniflare; in this I have printed out Interactive REPL session started though Miniflare at the start of the session. Other suggestions on how to best inform people would be appreciated.
Closes https://github.com/cloudflare/wrangler2/issues/1263
🦋 Changeset detected
Latest commit: 8ff9775ae5b7776a6cb3e7c32f38b0de0c6a2839
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| wrangler | 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
@mrbbot - your eyes would be appreciated :)
A wrangler prerelease is available for testing. You can install this latest build in your project with:
npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2803436801/npm-package-wrangler-1620
You can reference the automatically updated head of this PR with:
npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1620/npm-package-wrangler-1620
Or you can use npx with this latest build directly:
npx https://prerelease-registry.developers.workers.dev/runs/2803436801/npm-package-wrangler-1620 dev path/to/script.js
Codecov Report
Merging #1620 (8ff9775) into main (7ae059b) will decrease coverage by
0.12%. The diff coverage is25.00%.
@@ Coverage Diff @@
## main #1620 +/- ##
==========================================
- Coverage 82.02% 81.90% -0.13%
==========================================
Files 87 90 +3
Lines 5815 5896 +81
Branches 1491 1509 +18
==========================================
+ Hits 4770 4829 +59
- Misses 1045 1067 +22
| Impacted Files | Coverage Δ | |
|---|---|---|
| packages/wrangler/src/repl.ts | 16.66% <16.66%> (ø) |
|
| packages/wrangler/src/index.tsx | 88.57% <33.33%> (-0.54%) |
:arrow_down: |
| packages/wrangler/src/pages/build.tsx | 53.84% <0.00%> (-10.44%) |
:arrow_down: |
| packages/wrangler/src/pages/projects.tsx | 81.15% <0.00%> (-2.43%) |
:arrow_down: |
| packages/wrangler/src/dev.tsx | 82.19% <0.00%> (-0.45%) |
:arrow_down: |
| packages/wrangler/src/bundle.ts | 69.36% <0.00%> (ø) |
|
| packages/wrangler/src/api/dev.ts | 15.38% <0.00%> (ø) |
|
| packages/wrangler/src/pages/upload.tsx | 84.76% <0.00%> (ø) |
|
| packages/wrangler/src/pages/constants.ts | 100.00% <0.00%> (ø) |
|
| ...angler/src/pages/functions/routes-consolidation.ts | 100.00% <0.00%> (ø) |
|
| ... and 4 more |
I think it would be nice to land this with config support (reading bindings etc)
@cameron-robey Let me know if you are going to land this, with the config support, otherwise I will pick it up.
Decided this is blocked until we know the exact specifics of implementation with the open source runtime.
Until then, users can use this feature directly from miniflare - documentation here: https://miniflare.dev/get-started/cli#repl
Closing this as the repl story with the open source runtime is very unclear.