workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

Add support for new bindings to wrangler types

Open DaniFoldi opened this issue 4 months ago • 3 comments

Fixes # [insert GH or internal issue number(s)].

What this PR solves / how to test:

This PR adds support for Email Send, Vectorize, Hyperdrive, mTLS, Browser Rendering and Workers AI bindings to wrangler types.

Author has addressed the following:

  • Tests
    • [x] Included
    • [ ] Not necessary because:
  • Changeset (Changeset guidelines)
    • [x] Included
    • [ ] Not necessary because:
  • Associated docs
    • [ ] Issue(s)/PR(s):
    • [ ] Not necessary because:

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

DaniFoldi avatar Feb 25 '24 12:02 DaniFoldi

🦋 Changeset detected

Latest commit: eed80d348cc9a1888ab036264748e8fd02e670df

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

changeset-bot[bot] avatar Feb 25 '24 12:02 changeset-bot[bot]

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/8158618486/npm-package-wrangler-5089

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

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

Or you can use npx with this latest build directly:

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

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.20240223.0
workerd 1.20240223.1 1.20240223.1
workerd --version 1.20240223.1 2024-02-23

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

github-actions[bot] avatar Feb 26 '24 11:02 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.39%. Comparing base (04b37fc) to head (eed80d3). Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5089      +/-   ##
==========================================
+ Coverage   70.31%   70.39%   +0.07%     
==========================================
  Files         298      298              
  Lines       15551    15567      +16     
  Branches     4001     4007       +6     
==========================================
+ Hits        10935    10958      +23     
+ Misses       4616     4609       -7     
Files Coverage Δ
packages/wrangler/src/type-generation.ts 99.29% <100.00%> (+0.08%) :arrow_up:

... and 6 files with indirect coverage changes

codecov[bot] avatar Feb 26 '24 12:02 codecov[bot]

@DaniFoldi looks like this is failing type checking? Would you be able to fix these failures?

mrbbot avatar Mar 04 '24 16:03 mrbbot

Of course, I'll remove unsafe from the omit since the test actually has unsafe bindings defined. How should I go about fixing the dispatch_namespaces error? It's defined on EnvironmentInheritable, so I can either move it to non-inheritable (which shouldn't be breaking as only their union is exported, and if anything this is a fix, or I can manually patch the type to also include dispatch namespaces from the inheritable config (smaller diff, but worse solution imo).

DaniFoldi avatar Mar 04 '24 17:03 DaniFoldi

Rebased on main, test failures seemed unrelated. Could you please take another look, @mrbbot?

DaniFoldi avatar Mar 05 '24 15:03 DaniFoldi