Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cloudflare/workers-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: wrangler@4.7.2
Choose a base ref
...
head repository: cloudflare/workers-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: wrangler@4.8.0
Choose a head ref
  • 13 commits
  • 173 files changed
  • 17 contributors

Commits on Apr 5, 2025

  1. Add GH issue types (#8793)

    penalosa authored Apr 5, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a236115 View commit details
  2. fix: make vitest-pool-workers not crash with scripts that have Workfl…

    …ows (#8208)
    
    * fix: make vitest-pool-workers not crash with scripts that have Workflows
    
    Because `vitest-pool-workers` uses its runner worker as the entrypoint
    and not the user provided worker. The user provided worker is loaded
    AFAICT though eval (`vitest-pool-workers` enables eval) so we need, at
    startup time, to add the required entrypoints and make them dynamically
    call the user one.
    
    Not only that, if you try to create a workflow instance it would throw a
    `isolated storage` error - I suspect that is this caused by engine still
    being active at the end of the test (since workflows are async, not in
    the request path, and might take undefinite time to complete).
    
    In order to fix this, I've bypassed the isolated storage check for
    workflows internal DOs. I wonder if there might be collisions between
    test files if there are any concurrency regarding test files (aka
    `singleWorker` is false) - I think that this is fine to do, the point of
    this PR is not to make workflows really testable yet but to at least
    to make `vitest-pool-workers` **not** crash if a user includes a
    workflow in the worker definition.
    
    * chore: add proper readme
    
    * chore: remove isolatedStorage bypass and error out early if isolated storage is used
    
    * chore: add suggestions
    
    * chore: moar test
    
    * Apply suggestions from code review
    
    Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
    
    * Apply suggestions from code review
    
    Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
    
    * stream logs
    
    * no more hanging
    
    * Revert "stream logs"
    
    This reverts commit dfecf63.
    
    ---------
    
    Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
    Co-authored-by: Samuel Macleod <smacleod@cloudflare.com>
    3 people authored Apr 5, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9a3d43c View commit details
  3. remove BETA label from Workers+Assets templates and hide Pages templa…

    …tes (#8698)
    
    * remove BETA label from Workers+Assets templates and hide Pages templates
    
    * Skip the platform question if there is only one option
    
    * include hiding of next-on-pages
    
    * update snapshots
    petebacondarwin authored Apr 5, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    1ba9e97 View commit details
  4. Unhide 'wrangler pages functions build' (#8795)

    * Unhide 'wrangler pages functions build'
    
    * Accept live docs URLs
    GregBrimble authored Apr 5, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d4c1171 View commit details

Commits on Apr 7, 2025

  1. Pipelines CLI Improvements (#8780)

    * Rename `wrangler pipelines show` to `wrangler pipelines get`
    
    * Remove `--enable-http|worker-binding` in favor of `--source <sources...>` format
    
    Replace `--enable-worker-binding` and `--enable-http` with `--source worker`
    and `--source http` (or `--source http worker` for both).
    
    This also refactors how these bindings get added to the pipeline
    configuration, opting for a handler pattern instead of multiple if
    statements.
    
    * Remove `--file-template` and `--partition-template` flags from `wrangler pipelines create|update`
    
    * Prettify `wrangler pipelines get <pipeline>` output ✨
    
    * Clarify defaults, minimums, and maximums for pipelines commands
    
    We specifically do not use yargs `default` field as these values are
    purely informational and the API is the ultimate decider of what the
    default value will be at a given time.
    
    * Show pipelines command in wrangler help
    
    * update snapshots
    
    * Fix updating CORS origins for pipelines
    
    * Fix upper limit on batch-max-rows
    
    ---------
    
    Co-authored-by: Peter Bacon Darwin <pbacondarwin@cloudflare.com>
    cmackenzie1 and petebacondarwin authored Apr 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4e69fb6 View commit details
  2. Fix fromVitest conditional (#7260)

    * Fix `fromVitest` conditional
    
    Checking for `/node_modules/vitest/` does not work with Yarn's pnpm linker, where the path is something like `node_modules/.store/vitest-virtual-ee893ec3ea/`
    
    * Use regex instead
    
    * Create lemon-deers-speak.md
    
    * fixup! Create lemon-deers-speak.md
    
    ---------
    
    Co-authored-by: Somhairle MacLeòid <samuel@macleod.space>
    Co-authored-by: Peter Bacon Darwin <pbacondarwin@cloudflare.com>
    3 people authored Apr 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    30f7317 View commit details
  3. [wrangler] add validation to redirected configs in regards to environ…

    …ments (#8596)
    
    * [wrangler] add validation to redirected configs in regards to environments
    
    * error instead of warning on specified environments
    
    * Update packages/wrangler/src/config/validation.ts
    
    Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com>
    
    * Update packages/wrangler/src/config/validation.ts
    
    Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
    
    * update lock file
    
    * update fixture tests
    
    ---------
    
    Co-authored-by: emily-shen <69125074+emily-shen@users.noreply.github.com>
    Co-authored-by: James Opstad <13586373+jamesopstad@users.noreply.github.com>
    3 people authored Apr 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    75b454c View commit details
  4. Secrets Store Secret binding local dev (#8394)

    * feat(miniflare): secret store plugin
    
    * feat(wrangler): secret store setup
    
    * chore: add secret-store fixture
    
    * change name
    
    * generate docs
    
    * rebase on main
    
    * finalise
    
    * fix lint
    
    * unskip e2e
    
    * fix tests
    
    * Create calm-grapes-eat.md
    
    * lint
    
    * lint
    
    * fix tests
    
    * fix lint
    
    * Address comments
    
    * Apply suggestions from code review
    
    Co-authored-by: Carmen Popoviciu <cpopoviciu@cloudflare.com>
    
    * fix snapshots
    
    * fix lockfile
    
    ---------
    
    Co-authored-by: Samuel Macleod <smacleod@cloudflare.com>
    Co-authored-by: Carmen Popoviciu <cpopoviciu@cloudflare.com>
    3 people authored Apr 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    93267cf View commit details
  5. Replace assertion in node-js compat transform hook with early return (#…

    …8806)
    
    * Replace assertion in node-js compat transform hook with early return
    
    * Added changeset
    jamesopstad authored Apr 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2f47670 View commit details
  6. update changeset to patch (#8812)

    petebacondarwin authored Apr 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    586df14 View commit details
  7. feat: add waitForEvent and sendEvent support for local dev (#8775)

    * Bump the workerd-and-workers-types group with 2 updates
    
    Bumps the workerd-and-workers-types group with 2 updates: [@cloudflare/workers-types](https://github.com/cloudflare/workerd) and [workerd](https://github.com/cloudflare/workerd).
    
    
    Updates `@cloudflare/workers-types` from 4.20250404.0 to 4.20250405.0
    - [Release notes](https://github.com/cloudflare/workerd/releases)
    - [Changelog](https://github.com/cloudflare/workerd/blob/main/Dockerfile.release)
    - [Commits](https://github.com/cloudflare/workerd/commits)
    
    Updates `workerd` from 1.20250404.0 to 1.20250405.0
    - [Release notes](https://github.com/cloudflare/workerd/releases)
    - [Changelog](https://github.com/cloudflare/workerd/blob/main/Dockerfile.release)
    - [Commits](cloudflare/workerd@v1.20250404.0...v1.20250405.0)
    
    ---
    updated-dependencies:
    - dependency-name: "@cloudflare/workers-types"
      dependency-version: 4.20250405.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
      dependency-group: workerd-and-workers-types
    - dependency-name: workerd
      dependency-version: 1.20250405.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" package
    
    The following dependency versions have been updated:
    
    | Dependency                | From          | To            |
    | ------------------------- | ------------- | ------------- |
    | workerd                   | 1.20250404.0  | 1.20250405.0  |
    | @cloudflare/workers-types | ^4.20250404.0 | ^4.20250405.0 |
    
    * feat: add `waitForEvent` and `sendEvent` support for local dev
    
    This uses some @ts-expect-errors since these are not in workers-types,
    yet.
    
    * feat: add `waitForEvent` and `sendEvent` support for local dev
    
    This uses some @ts-expect-errors since these are not in workers-types,
    yet.
    
    * remove redundeant tserror directives
    
    * update lockfile
    
    * remove more rendundant tserror directives
    
    * fix: change Context for new workers-types
    
    ---------
    
    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: Peter Bacon Darwin <pbacondarwin@cloudflare.com>
    4 people authored Apr 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ec7e621 View commit details
  8. Copy the full SHA
    b1c89dd View commit details
  9. Version Packages (#8796)

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    workers-devprod and github-actions[bot] authored Apr 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f6b84b7 View commit details
Showing with 3,064 additions and 891 deletions.
  1. +3 −10 .github/ISSUE_TEMPLATE/bug-template.yaml
  2. +2 −3 .github/ISSUE_TEMPLATE/feature-request.yaml
  3. +1 −0 .prettierignore
  4. +1 −1 fixtures/additional-modules/package.json
  5. +1 −1 fixtures/asset-config/package.json
  6. +1 −1 fixtures/d1-read-replication-app/package.json
  7. +1 −1 fixtures/d1-worker-app/package.json
  8. +1 −1 fixtures/get-platform-proxy/package.json
  9. +1 −1 fixtures/local-mode-tests/package.json
  10. +1 −1 fixtures/node-app-pages/package.json
  11. +1 −1 fixtures/nodejs-als-app/package.json
  12. +1 −1 fixtures/nodejs-hybrid-app/package.json
  13. +1 −1 fixtures/pages-dev-proxy-with-script/package.json
  14. +1 −1 fixtures/pages-functions-app/package.json
  15. +1 −1 fixtures/pages-functions-with-routes-app/package.json
  16. +1 −1 fixtures/pages-plugin-mounted-on-root-app/package.json
  17. +1 −1 fixtures/pages-simple-assets/package.json
  18. +2 −0 fixtures/redirected-config-worker-with-environments/.gitignore
  19. +23 −0 fixtures/redirected-config-worker-with-environments/package.json
  20. +5 −0 fixtures/redirected-config-worker-with-environments/src/index.js
  21. +15 −0 fixtures/redirected-config-worker-with-environments/tests/index.test.ts
  22. +30 −0 fixtures/redirected-config-worker-with-environments/tools/build.ts
  23. +13 −0 fixtures/redirected-config-worker-with-environments/tsconfig.json
  24. +9 −0 fixtures/redirected-config-worker-with-environments/turbo.json
  25. +9 −0 fixtures/redirected-config-worker-with-environments/vitest.config.mts
  26. +4 −0 fixtures/redirected-config-worker-with-environments/wrangler.toml
  27. +14 −0 fixtures/redirected-config-worker/tests/index.test.ts
  28. +15 −0 fixtures/secrets-store/package.json
  29. +23 −0 fixtures/secrets-store/src/index.ts
  30. +13 −0 fixtures/secrets-store/tsconfig.json
  31. +13 −0 fixtures/secrets-store/wrangler.jsonc
  32. +7 −0 fixtures/shared/src/run-wrangler-long-lived.ts
  33. +1 −1 fixtures/vitest-pool-workers-examples/package.json
  34. +4 −0 fixtures/vitest-pool-workers-examples/workflows/README.md
  35. +3 −0 fixtures/vitest-pool-workers-examples/workflows/src/env.d.ts
  36. +27 −0 fixtures/vitest-pool-workers-examples/workflows/src/index.ts
  37. +4 −0 fixtures/vitest-pool-workers-examples/workflows/src/tsconfig.json
  38. +6 −0 fixtures/vitest-pool-workers-examples/workflows/test/env.d.ts
  39. +22 −0 fixtures/vitest-pool-workers-examples/workflows/test/integration-self.test.ts
  40. +4 −0 fixtures/vitest-pool-workers-examples/workflows/test/tsconfig.json
  41. +4 −0 fixtures/vitest-pool-workers-examples/workflows/tsconfig.json
  42. +20 −0 fixtures/vitest-pool-workers-examples/workflows/vitest.config.ts
  43. +8 −0 fixtures/vitest-pool-workers-examples/workflows/wrangler.toml
  44. +1 −1 fixtures/wildcard-modules/package.json
  45. +1 −1 fixtures/worker-ts/package.json
  46. +1 −0 fixtures/worker-ts/wrangler.toml
  47. +1 −1 fixtures/workers-with-assets-and-service-bindings/package.json
  48. +1 −1 fixtures/workers-with-assets-only/package.json
  49. +1 −1 fixtures/workers-with-assets-run-worker-first/package.json
  50. +1 −1 fixtures/workers-with-assets-spa/package.json
  51. +1 −1 fixtures/workers-with-assets/package.json
  52. +1 −1 fixtures/workflow-multiple/package.json
  53. +2 −1 fixtures/workflow/package.json
  54. +43 −0 fixtures/workflow/src/index.ts
  55. +38 −1 fixtures/workflow/tests/index.test.ts
  56. +6 −0 fixtures/workflow/wrangler.toml
  57. +1 −1 package.json
  58. +6 −0 packages/create-cloudflare/CHANGELOG.md
  59. +4 −4 packages/create-cloudflare/e2e-tests/cli.test.ts
  60. +2 −2 packages/create-cloudflare/package.json
  61. +4 −4 packages/create-cloudflare/src/helpers/args.ts
  62. +32 −11 packages/create-cloudflare/src/templates.ts
  63. +1 −0 packages/create-cloudflare/templates/angular/pages/c3.ts
  64. +1 −0 packages/create-cloudflare/templates/astro/pages/c3.ts
  65. +1 −0 packages/create-cloudflare/templates/docusaurus/pages/c3.ts
  66. +1 −0 packages/create-cloudflare/templates/gatsby/pages/c3.ts
  67. +1 −0 packages/create-cloudflare/templates/hono/pages/c3.ts
  68. +1 −0 packages/create-cloudflare/templates/next/pages/c3.ts
  69. +1 −0 packages/create-cloudflare/templates/nuxt/pages/c3.ts
  70. +1 −0 packages/create-cloudflare/templates/qwik/pages/c3.ts
  71. +1 −0 packages/create-cloudflare/templates/react/pages/c3.ts
  72. +1 −0 packages/create-cloudflare/templates/remix/pages/c3.ts
  73. +1 −0 packages/create-cloudflare/templates/svelte/pages/c3.ts
  74. +1 −0 packages/create-cloudflare/templates/vue/pages/c3.ts
  75. +1 −1 packages/edge-preview-authenticated-proxy/package.json
  76. +1 −1 packages/format-errors/package.json
  77. +1 −1 packages/kv-asset-handler/package.json
  78. +17 −0 packages/miniflare/CHANGELOG.md
  79. +3 −3 packages/miniflare/package.json
  80. +31 −0 packages/miniflare/src/index.ts
  81. +7 −2 packages/miniflare/src/plugins/index.ts
  82. +144 −0 packages/miniflare/src/plugins/secret-store/index.ts
  83. +1 −0 packages/miniflare/src/workers/secrets-store/constants.ts
  84. +81 −0 packages/miniflare/src/workers/secrets-store/secret.worker.ts
  85. +121 −0 packages/miniflare/test/plugins/secret-store/index.spec.ts
  86. +7 −0 packages/pages-shared/CHANGELOG.md
  87. +2 −2 packages/pages-shared/package.json
  88. +1 −1 packages/playground-preview-worker/package.json
  89. +1 −1 packages/prerelease-registry/package.json
  90. +1 −1 packages/quick-edit-extension/package.json
  91. +11 −0 packages/vite-plugin-cloudflare/CHANGELOG.md
  92. +2 −2 packages/vite-plugin-cloudflare/package.json
  93. +1 −1 packages/vite-plugin-cloudflare/playground/additional-modules/package.json
  94. +1 −1 packages/vite-plugin-cloudflare/playground/cloudflare-env/package.json
  95. +1 −1 packages/vite-plugin-cloudflare/playground/config-changes/package.json
  96. +1 −1 packages/vite-plugin-cloudflare/playground/custom-build-app/package.json
  97. +1 −1 packages/vite-plugin-cloudflare/playground/deps-assets-importing/package.json
  98. +1 −1 packages/vite-plugin-cloudflare/playground/dev-vars/package.json
  99. +1 −1 packages/vite-plugin-cloudflare/playground/durable-objects/package.json
  100. +1 −1 packages/vite-plugin-cloudflare/playground/dynamic-import-paths/package.json
  101. +1 −1 packages/vite-plugin-cloudflare/playground/external-durable-objects/package.json
  102. +1 −1 packages/vite-plugin-cloudflare/playground/external-workers/package.json
  103. +1 −1 packages/vite-plugin-cloudflare/playground/external-workflows/package.json
  104. +1 −1 packages/vite-plugin-cloudflare/playground/hot-channel/package.json
  105. +1 −1 packages/vite-plugin-cloudflare/playground/importable-env/package.json
  106. +1 −1 packages/vite-plugin-cloudflare/playground/module-resolution/package.json
  107. +1 −1 packages/vite-plugin-cloudflare/playground/multi-worker/package.json
  108. +1 −1 packages/vite-plugin-cloudflare/playground/node-compat/package.json
  109. +1 −1 packages/vite-plugin-cloudflare/playground/partyserver/package.json
  110. +1 −1 packages/vite-plugin-cloudflare/playground/prisma/package.json
  111. +1 −1 packages/vite-plugin-cloudflare/playground/react-spa/package.json
  112. +1 −1 packages/vite-plugin-cloudflare/playground/same-worker-service-bindings/package.json
  113. +1 −1 packages/vite-plugin-cloudflare/playground/spa-with-api/package.json
  114. +1 −1 packages/vite-plugin-cloudflare/playground/static-mpa/package.json
  115. +1 −1 packages/vite-plugin-cloudflare/playground/static/package.json
  116. +1 −1 packages/vite-plugin-cloudflare/playground/virtual-modules/package.json
  117. +1 −1 packages/vite-plugin-cloudflare/playground/websockets/package.json
  118. +1 −1 packages/vite-plugin-cloudflare/playground/worker/package.json
  119. +1 −1 packages/vite-plugin-cloudflare/playground/workflows/package.json
  120. +3 −1 packages/vite-plugin-cloudflare/src/index.ts
  121. +12 −0 packages/vitest-pool-workers/CHANGELOG.md
  122. +2 −2 packages/vitest-pool-workers/package.json
  123. +61 −1 packages/vitest-pool-workers/src/pool/index.ts
  124. +1 −0 packages/vitest-pool-workers/src/pool/loopback.ts
  125. +69 −1 packages/vitest-pool-workers/src/worker/entrypoints.ts
  126. +3 −1 packages/vitest-pool-workers/src/worker/index.ts
  127. +1 −1 packages/workers-shared/package.json
  128. +1 −1 packages/workers.new/package.json
  129. +6 −0 packages/workflows-shared/CHANGELOG.md
  130. +2 −2 packages/workflows-shared/package.json
  131. +22 −2 packages/workflows-shared/src/binding.ts
  132. +175 −0 packages/workflows-shared/src/context.ts
  133. +97 −0 packages/workflows-shared/src/engine.ts
  134. +9 −4 packages/workflows-shared/src/instance.ts
  135. +13 −0 packages/workflows-shared/src/lib/timePriorityQueue.ts
  136. +91 −1 packages/workflows-shared/tests/engine.test.ts
  137. +36 −0 packages/wrangler/CHANGELOG.md
  138. +34 −0 packages/wrangler/e2e/dev-with-resources.test.ts
  139. +22 −0 packages/wrangler/e2e/helpers/e2e-wrangler-test.ts
  140. +177 −147 packages/wrangler/e2e/secrets-store.test.ts
  141. +4 −4 packages/wrangler/package.json
  142. +94 −0 packages/wrangler/src/__tests__/config/configuration.test.ts
  143. +39 −0 packages/wrangler/src/__tests__/deploy.test.ts
  144. +2 −0 packages/wrangler/src/__tests__/index.test.ts
  145. +1 −0 packages/wrangler/src/__tests__/pages/pages.test.ts
  146. +119 −44 packages/wrangler/src/__tests__/pipelines.test.ts
  147. +9 −0 packages/wrangler/src/__tests__/type-generation.test.ts
  148. +2 −0 packages/wrangler/src/api/startDevWorker/types.ts
  149. +10 −0 packages/wrangler/src/api/startDevWorker/utils.ts
  150. +1 −0 packages/wrangler/src/config/config.ts
  151. +20 −0 packages/wrangler/src/config/environment.ts
  152. +136 −60 packages/wrangler/src/config/validation.ts
  153. +1 −0 packages/wrangler/src/deployment-bundle/bindings.ts
  154. +17 −0 packages/wrangler/src/deployment-bundle/create-worker-upload-form.ts
  155. +7 −0 packages/wrangler/src/deployment-bundle/worker.ts
  156. +2 −0 packages/wrangler/src/dev.ts
  157. +12 −3 packages/wrangler/src/dev/miniflare.ts
  158. +8 −4 packages/wrangler/src/index.ts
  159. +12 −0 packages/wrangler/src/init.ts
  160. +1 −0 packages/wrangler/src/pages/build.ts
  161. +94 −100 packages/wrangler/src/pages/index.ts
  162. +56 −71 packages/wrangler/src/pipelines/cli/create.ts
  163. +57 −0 packages/wrangler/src/pipelines/cli/get.ts
  164. +0 −35 packages/wrangler/src/pipelines/cli/show.ts
  165. +69 −85 packages/wrangler/src/pipelines/cli/update.ts
  166. +81 −5 packages/wrangler/src/pipelines/index.ts
  167. +1 −0 packages/wrangler/src/secret/index.ts
  168. +160 −27 packages/wrangler/src/secrets-store/commands.ts
  169. +10 −0 packages/wrangler/src/type-generation/index.ts
  170. +18 −0 packages/wrangler/src/utils/print-bindings.ts
  171. +213 −186 pnpm-lock.yaml
  172. +33 −0 tools/deployments/__tests__/validate-pr-description.test.ts
  173. +1 −1 tools/deployments/validate-pr-description.ts
13 changes: 3 additions & 10 deletions .github/ISSUE_TEMPLATE/bug-template.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: "\U0001F41B Bug Report"
description: Report an issue or possible bug
title: "\U0001F41B BUG:"
labels: ["bug"]
type: Bug

body:
- type: markdown
attributes:
value: |
## Quick Bug Form
Thank you for taking the time to file a bug report! Please fill out this form as completely as possible.
- type: dropdown
id: products
@@ -35,14 +34,8 @@ body:
required: true
- type: input
attributes:
label: What versions are you using?
placeholder: 0.0.0 [Wrangler], 0.0.0 [C3], 0.0.0 [Node.js], etc.
validations:
required: true
- type: input
attributes:
label: What operating system and version are you using?
placeholder: Mac Sonoma 14.2.1, Windows 11, Linux (or WSL) Debian Bookworm, etc.
label: What versions & operating system are you using?
placeholder: e.g. Wrangler v4.6, Node v20, Windows 11 etc...
validations:
required: true
- type: input
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature-request.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: "\U0001F680 Feature Request"
description: Have a suggestion for how to improve wrangler? Let us know!
title: "\U0001F680 Feature Request:"
labels: ["enhancement"]
type: Feature

body:
- type: markdown
attributes:
value: |
## Feature Request Form
Thank you for taking the time to file a feature request! Please let us know what you're trying to do, and how wrangler can help.
Thank you for taking the time to file a feature request! Please let us know what you're trying to do, and how Wrangler, Miniflare, Create-Cloudflare etc... can help.
- type: textarea
attributes:
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ fixtures/interactive-dev-tests/src/startup-error.ts
# These are generated by the build step
fixtures/pages-redirected-config/build/*
fixtures/redirected-config-worker/build/*
fixtures/redirected-config-worker-with-environments/build/*

# Import attributes generate an error
packages/unenv-preset/src/preset.ts
2 changes: 1 addition & 1 deletion fixtures/additional-modules/package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"typescript": "catalog:default",
"undici": "catalog:default",
"vitest": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/asset-config/package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
"devDependencies": {
"@cloudflare/vitest-pool-workers": "workspace:*",
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"run-script-os": "^1.1.6",
"typescript": "catalog:default",
"undici": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/d1-read-replication-app/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"typescript": "catalog:default",
"undici": "catalog:default",
"vitest": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/d1-worker-app/package.json
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"typescript": "catalog:default",
"undici": "catalog:default",
"vitest": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/get-platform-proxy/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"typescript": "catalog:default",
"undici": "catalog:default",
"vitest": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/local-mode-tests/package.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"@types/node": "catalog:default",
"buffer": "^6.0.3",
"typescript": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/node-app-pages/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"typescript": "catalog:default",
"undici": "catalog:default",
"vitest": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/nodejs-als-app/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"undici": "catalog:default",
"vitest": "catalog:default",
"wrangler": "workspace:*"
2 changes: 1 addition & 1 deletion fixtures/nodejs-hybrid-app/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"@types/pg": "^8.11.2",
"pg": "8.11.3",
"pg-cloudflare": "^1.1.1",
2 changes: 1 addition & 1 deletion fixtures/pages-dev-proxy-with-script/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"typescript": "catalog:default",
"undici": "catalog:default",
"vitest": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/pages-functions-app/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"pages-plugin-example": "workspace:*",
"typescript": "catalog:default",
"undici": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/pages-functions-with-routes-app/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"typescript": "catalog:default",
"undici": "catalog:default",
"vitest": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/pages-plugin-mounted-on-root-app/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"pages-plugin-example": "workspace:*",
"typescript": "catalog:default",
"undici": "catalog:default",
2 changes: 1 addition & 1 deletion fixtures/pages-simple-assets/package.json
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:*",
"@cloudflare/workers-types": "^4.20250404.0",
"@cloudflare/workers-types": "^4.20250405.0",
"typescript": "catalog:default",
"undici": "catalog:default",
"vitest": "catalog:default",
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
build
23 changes: 23 additions & 0 deletions fixtures/redirected-config-worker-with-environments/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "redirected-config-worker-with-environments",
"private": true,
"description": "",
"license": "ISC",
"author": "",
"main": "src/index.js",
"scripts": {
"build": "node -r esbuild-register tools/build.ts",
"check:type": "tsc",
"dev": "pnpm run build && wrangler dev",
"test:ci": "pnpm run build && vitest run"
},
"devDependencies": {
"@cloudflare/workers-tsconfig": "workspace:^",
"undici": "catalog:default",
"vitest": "catalog:default",
"wrangler": "workspace:*"
},
"volta": {
"extends": "../../package.json"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
async fetch(request, env) {
return new Response("Generated: " + env.generated ?? false);
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { resolve } from "path";
import { describe, it } from "vitest";
import { runWranglerDev } from "../../shared/src/run-wrangler-long-lived";

const basePath = resolve(__dirname, "..");

describe("'wrangler dev' errors because redirected configs can't include environments", () => {
it("uses the generated config", async ({ expect }) => {
await expect(
runWranglerDev(basePath, ["--port=0", "--inspector-port=0"])
).rejects.toThrowError(
/Redirected configurations cannot include environments but the following have been found: \"staging\"/
);
});
});
30 changes: 30 additions & 0 deletions fixtures/redirected-config-worker-with-environments/tools/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { copyFileSync, mkdirSync, rmSync, writeFileSync } from "fs";

// Create a pseudo build directory
rmSync("build", { recursive: true, force: true });
mkdirSync("build");
const config = {
name: "redirected-config-worker",
compatibility_date: "2024-12-01",
main: "index.js",
vars: { generated: true, environmentName: "top-level" },
env: {
staging: {
vars: {
generated: true,
environmentName: "staging",
},
},
},
};
writeFileSync("build/wrangler.json", JSON.stringify(config, undefined, 2));
copyFileSync("src/index.js", "build/index.js");

// Create the redirect file
rmSync(".wrangler/deploy", { recursive: true, force: true });
mkdirSync(".wrangler/deploy", { recursive: true });
const redirect = { configPath: "../../build/wrangler.json" };
writeFileSync(
".wrangler/deploy/config.json",
JSON.stringify(redirect, undefined, 2)
);
13 changes: 13 additions & 0 deletions fixtures/redirected-config-worker-with-environments/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "ES2020",
"esModuleInterop": true,
"module": "CommonJS",
"lib": ["ES2020"],
"types": ["node"],
"skipLibCheck": true,
"moduleResolution": "node",
"noEmit": true
},
"include": ["tests", "../../node-types.d.ts"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "http://turbo.build/schema.json",
"extends": ["//"],
"tasks": {
"build": {
"outputs": ["build/**"]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineProject, mergeConfig } from "vitest/config";
import configShared from "../../vitest.shared";

export default mergeConfig(
configShared,
defineProject({
test: {},
})
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "redirected-config-worker"
compatibility_date = "2024-12-01"

main = "src/index.js"
14 changes: 14 additions & 0 deletions fixtures/redirected-config-worker/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -20,6 +20,20 @@ describe("'wrangler dev' correctly renders pages", () => {
expect(text).toMatchInlineSnapshot(`"Generated: true"`);
});

it("specifying an environment cause an error since they are supported in redirected configs", async ({
expect,
}) => {
await expect(
runWranglerDev(basePath, [
"--port=0",
"--inspector-port=0",
"--env=staging",
])
).rejects.toThrowError(
/You have specified the environment ".*?", but are using a redirected configuration/
);
});

it("uses a custom config from command line rather than generated config", async ({
expect,
onTestFinished,
15 changes: 15 additions & 0 deletions fixtures/secrets-store/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "secret-store",
"private": true,
"scripts": {
"deploy": "wrangler deploy",
"start": "wrangler dev"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20250224.0",
"wrangler": "workspace:*"
},
"volta": {
"extends": "../../package.json"
}
}
23 changes: 23 additions & 0 deletions fixtures/secrets-store/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export interface Env {
SECRET: any;
}

export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
try {
const value = await env.SECRET.get();
return new Response(value);
} catch (e) {
return new Response(
e instanceof Error ? e.message : "Something went wrong",
{
status: 404,
}
);
}
},
};
13 changes: 13 additions & 0 deletions fixtures/secrets-store/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "es2021",
"lib": ["es2021"],
"module": "es2022",
"types": ["@cloudflare/workers-types/experimental"],
"noEmit": true,
"isolatedModules": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
13 changes: 13 additions & 0 deletions fixtures/secrets-store/wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "./node_modules/wrangler/config-schema.json",
"compatibility_date": "2025-01-01",
"main": "src/index.ts",
"name": "secret-store",
"secrets_store_secrets": [
{
"binding": "SECRET",
"secret_name": "secret_name",
"store_id": "a3fb907f446e4d94bd946d7ea6365b1c",
},
],
}
Loading