Skip to content

Commit

Permalink
chore(wrangler): use the unenv preset from @cloudflare/unenv-preset
Browse files Browse the repository at this point in the history
Co-authored-by: Pete Bacon Darwin <[email protected]>

Merge branch 'main' into use-cf-preset
  • Loading branch information
vicb committed Jan 15, 2025
1 parent 336cc48 commit ebd9626
Show file tree
Hide file tree
Showing 53 changed files with 1,273 additions and 354 deletions.
11 changes: 0 additions & 11 deletions .changeset/c3-frameworks-update-7746.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/c3-frameworks-update-7747.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/c3-frameworks-update-7748.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/c3-frameworks-update-7749.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/cuddly-pets-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

chore(wrangler): use the unenv preset from `@cloudflare/unenv-preset`
5 changes: 0 additions & 5 deletions .changeset/dry-numbers-doubt.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/dull-coins-scream.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/eleven-dingos-scream.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/fifty-flies-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@cloudflare/unenv-preset": patch
"wrangler": patch
---

chore: update unenv depency version
5 changes: 0 additions & 5 deletions .changeset/lemon-years-sniff.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/lovely-years-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/workers-shared": patch
---

fix: on a 404 from KV, we do not want the asset to stay in cache for the normal 1 year TTL. Instead we want to re-insert with a 60s TTL to revalidate and prevent a bad 404 from persisting.
5 changes: 0 additions & 5 deletions .changeset/many-boats-glow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/polite-vans-refuse.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/shy-flies-float.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/smart-lions-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"wrangler": patch
---

feat: pull resource names for provisioning from config if provided

Uses `database_name` and `bucket_name` for provisioning if specified. For R2, this only happens if there is not a bucket with that name already. Also respects R2 `jurisdiction` if provided.
5 changes: 0 additions & 5 deletions .changeset/ten-eyes-tease.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/tough-walls-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/workers-shared": minor
---

Adds jaeger tracing for asset-worker.
5 changes: 0 additions & 5 deletions .changeset/young-apes-battle.md

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"@cloudflare/elements>@types/react": "^18",
"capnpc-ts>typescript": "4.2.4",
"@types/node": "$@types/node",
"@cloudflare/unenv-preset>@types/node": "^22.10.2"
"@cloudflare/unenv-preset>@types/node": "^22.10.5"
},
"patchedDependencies": {
"@cloudflare/[email protected]": "patches/@[email protected]",
Expand Down
47 changes: 47 additions & 0 deletions packages/create-cloudflare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
# create-cloudflare

## 2.37.0

### Minor Changes

- [#7676](https://github.com/cloudflare/workers-sdk/pull/7676) [`ab92f83`](https://github.com/cloudflare/workers-sdk/commit/ab92f837a995b2d3229609ba798dfc322a8ed171) Thanks [@penalosa](https://github.com/penalosa)! - Output the `wrangler.json` config format when running `create-cloudflare`

### Patch Changes

- [#7746](https://github.com/cloudflare/workers-sdk/pull/7746) [`836b316`](https://github.com/cloudflare/workers-sdk/commit/836b3165e416312d246e67c28a43345339da9485) Thanks [@dependabot](https://github.com/apps/dependabot)! - chore: update dependencies of "create-cloudflare" package

The following dependency versions have been updated:

| Dependency | From | To |
| --------------- | ------ | ------ |
| create-next-app | 15.1.3 | 15.1.4 |

- [#7747](https://github.com/cloudflare/workers-sdk/pull/7747) [`e747ddf`](https://github.com/cloudflare/workers-sdk/commit/e747ddf6a47319dbb6d361e6d0046749759949c0) Thanks [@dependabot](https://github.com/apps/dependabot)! - chore: update dependencies of "create-cloudflare" package

The following dependency versions have been updated:

| Dependency | From | To |
| --------------- | ------ | ------ |
| @angular/create | 19.0.6 | 19.0.7 |

- [#7748](https://github.com/cloudflare/workers-sdk/pull/7748) [`d13e288`](https://github.com/cloudflare/workers-sdk/commit/d13e288428c675ffb27860502749adb12664cb48) Thanks [@dependabot](https://github.com/apps/dependabot)! - chore: update dependencies of "create-cloudflare" package

The following dependency versions have been updated:

| Dependency | From | To |
| ---------- | ------ | ------ |
| sv | 0.6.10 | 0.6.11 |

- [#7749](https://github.com/cloudflare/workers-sdk/pull/7749) [`7f94b9d`](https://github.com/cloudflare/workers-sdk/commit/7f94b9dc1b36d782b8853a4b8e9170cc15689a3e) Thanks [@dependabot](https://github.com/apps/dependabot)! - chore: update dependencies of "create-cloudflare" package

The following dependency versions have been updated:

| Dependency | From | To |
| ---------- | ------ | ------ |
| nuxi | 3.17.2 | 3.20.0 |

- [#7743](https://github.com/cloudflare/workers-sdk/pull/7743) [`5955dac`](https://github.com/cloudflare/workers-sdk/commit/5955dac5ef2c6a0b6eea6dc28d11491966c07c2b) Thanks [@vicb](https://github.com/vicb)! - Update the Next.js experimental template

- Use create-next-app@^14.2.23
- Rename wrangler types output to cloudflare-env.d.ts

- [#7742](https://github.com/cloudflare/workers-sdk/pull/7742) [`8fb0f25`](https://github.com/cloudflare/workers-sdk/commit/8fb0f25e70cd43ffc947ded9a0d7c0ce88e7b359) Thanks [@threepointone](https://github.com/threepointone)! - chore: update wrangler versions in templates

## 2.36.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/create-cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-cloudflare",
"version": "2.36.0",
"version": "2.37.0",
"description": "A CLI for creating and deploying new applications to Cloudflare.",
"keywords": [
"cloudflare",
Expand Down
6 changes: 6 additions & 0 deletions packages/edge-preview-authenticated-proxy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# edge-preview-authenticated-proxy

## 0.2.2

### Patch Changes

- [#7630](https://github.com/cloudflare/workers-sdk/pull/7630) [`b687dff`](https://github.com/cloudflare/workers-sdk/commit/b687dffa7cf9f77e553f475d6a400c3560a360e9) Thanks [@edmundhung](https://github.com/edmundhung)! - fix OPTIONS raw http request support by overriding raw request method with the X-CF-Http-Method header

## 0.2.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/edge-preview-authenticated-proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "edge-preview-authenticated-proxy",
"version": "0.2.1",
"version": "0.2.2",
"private": true,
"scripts": {
"check:lint": "eslint . --max-warnings=0",
Expand Down
6 changes: 6 additions & 0 deletions packages/miniflare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# miniflare

## 3.20241230.2

### Patch Changes

- [#7738](https://github.com/cloudflare/workers-sdk/pull/7738) [`8e9aa40`](https://github.com/cloudflare/workers-sdk/commit/8e9aa40a6c914a3a9804dccdca7202aecda45ba7) Thanks [@penalosa](https://github.com/penalosa)! - Use TEXT bindings for plain text values in Miniflare. This is an internal detail that should have no user facing impact.

## 3.20241230.1

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/miniflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miniflare",
"version": "3.20241230.1",
"version": "3.20241230.2",
"description": "Fun, full-featured, fully-local simulator for Cloudflare Workers",
"keywords": [
"cloudflare",
Expand Down
7 changes: 7 additions & 0 deletions packages/pages-shared/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @cloudflare/pages-shared

## 0.13.1

### Patch Changes

- Updated dependencies [[`8e9aa40`](https://github.com/cloudflare/workers-sdk/commit/8e9aa40a6c914a3a9804dccdca7202aecda45ba7)]:
- [email protected]

## 0.13.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/pages-shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflare/pages-shared",
"version": "0.13.0",
"version": "0.13.1",
"repository": {
"type": "git",
"url": "https://github.com/cloudflare/workers-sdk.git",
Expand Down
6 changes: 6 additions & 0 deletions packages/playground-preview-worker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# playground-preview-worker

## 0.1.2

### Patch Changes

- [#7630](https://github.com/cloudflare/workers-sdk/pull/7630) [`b687dff`](https://github.com/cloudflare/workers-sdk/commit/b687dffa7cf9f77e553f475d6a400c3560a360e9) Thanks [@edmundhung](https://github.com/edmundhung)! - fix OPTIONS raw http request support by overriding raw request method with the X-CF-Http-Method header

## 0.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/playground-preview-worker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "playground-preview-worker",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"scripts": {
"build-middleware": "pnpm run build-middleware:common && pnpm run build-middleware:loader",
Expand Down
6 changes: 6 additions & 0 deletions packages/unenv-preset/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @cloudflare/unenv-preset

## 0.1.1

### Patch Changes

- [#7721](https://github.com/cloudflare/workers-sdk/pull/7721) [`5c2c55a`](https://github.com/cloudflare/workers-sdk/commit/5c2c55a2b79863cedf701f9b7e49439ca7d70cea) Thanks [@vicb](https://github.com/vicb)! - chore(unenv-preset): Add .cjs output for the preset

## 0.1.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/unenv-preset/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflare/unenv-preset",
"version": "0.1.0",
"version": "0.1.1",
"description": "cloudflare preset for unenv",
"keywords": [
"cloudflare",
Expand Down Expand Up @@ -48,7 +48,7 @@
"devDependencies": {
"@types/node": "*",
"typescript": "catalog:default",
"unbuild": "^2.0.0",
"unbuild": "^3.2.0",
"undici": "catalog:default",
"vitest": "catalog:default",
"wrangler": "workspace:*"
Expand Down
8 changes: 8 additions & 0 deletions packages/vitest-pool-workers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @cloudflare/vitest-pool-workers

## 0.6.1

### Patch Changes

- Updated dependencies [[`df0e5be`](https://github.com/cloudflare/workers-sdk/commit/df0e5bef817c09754471ac4842531a1e14e5576a), [`8e9aa40`](https://github.com/cloudflare/workers-sdk/commit/8e9aa40a6c914a3a9804dccdca7202aecda45ba7), [`f613276`](https://github.com/cloudflare/workers-sdk/commit/f6132761c80d90c3521c93d48d0f0aed62bb360a), [`d102b60`](https://github.com/cloudflare/workers-sdk/commit/d102b60238c1dddfdd829ffee62c451cb526717a), [`c63f1b0`](https://github.com/cloudflare/workers-sdk/commit/c63f1b0790d7487074152c958ad10a910d4eae34)]:
- [email protected]
- [email protected]

## 0.6.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest-pool-workers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cloudflare/vitest-pool-workers",
"version": "0.6.0",
"version": "0.6.1",
"description": "Workers Vitest integration for writing Vitest unit and integration tests that run inside the Workers runtime",
"keywords": [
"cloudflare",
Expand Down
13 changes: 12 additions & 1 deletion packages/workers-shared/asset-worker/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import {
import { getHeaders } from "./utils/headers";
import type { AssetConfig } from "../../utils/types";
import type EntrypointType from "./index";
import type { Env } from "./index";

export const handleRequest = async (
request: Request,
env: Env,
configuration: Required<AssetConfig>,
exists: typeof EntrypointType.prototype.unstable_exists,
getByETag: typeof EntrypointType.prototype.unstable_getByETag
Expand Down Expand Up @@ -52,7 +54,16 @@ export const handleRequest = async (
return new InternalServerErrorResponse(new Error("Unknown action"));
}

const asset = await getByETag(intent.asset.eTag);
const asset = await env.JAEGER.enterSpan("getByETag", async (span) => {
span.setTags({
pathname,
eTag: intent.asset.eTag,
status: intent.asset.status,
});

return await getByETag(intent.asset.eTag);
});

const headers = getHeaders(intent.asset.eTag, asset.contentType, request);

const strongETag = `"${intent.asset.eTag}"`;
Expand Down
Loading

0 comments on commit ebd9626

Please sign in to comment.