Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .changeset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pnpm changeset
```

- **TITLE**: A single sentence with an imperative description of the change
- **BODY**: One or more paragraphs explaining the reason for the change and anything notable about the approach
- **BODY**: One or more paragraphs explaining the reason for the change and anything notable about the approach. Aim for more than one sentence but less than three paragraphs to keep it succinct and useful. Larger changes may warrant more detail.

### Good Examples

Expand Down Expand Up @@ -89,7 +89,7 @@ The changelog uses h3 for section headers, so any headers in changeset content m

### Code Examples

For new features or significant changes, include a brief usage example. This helps users understand how to use the new functionality.
For new features or significant changes, consider including a brief usage example. Examples can be helpful for users to understand new functionality, but they are not mandatory—use your judgment based on how self-explanatory the change is.

## Multiple Changesets

Expand Down
5 changes: 5 additions & 0 deletions .changeset/clever-cloths-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

Fix `wrangler pages project validate` to respect file count limits from `CF_PAGES_UPLOAD_JWT`
7 changes: 7 additions & 0 deletions .changeset/hip-spies-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@cloudflare/unenv-preset": minor
---

Remove the experimental flag from `node:_stream_wrap`, `node:dgram`, `node:inspector`, and `node:sqlite`

Those modules are no more experimental since workerd 1.20260115.0
56 changes: 56 additions & 0 deletions .changeset/tall-hairs-send.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
"wrangler": minor
---

`wrangler types` now generates per-environment TypeScript interfaces when named environments exist in your configuration.

When your configuration has named environments (an `env` object), `wrangler types` now generates both:

- **Per-environment interfaces** (e.g., `StagingEnv`, `ProductionEnv`) containing only the bindings explicitly declared in each environment, plus inherited secrets
- **An aggregated `Env` interface** with all bindings from all environments (top-level + named environments), where:
- Bindings present in **all** environments are required
- Bindings not present in all environments are optional
- Secrets are always required (since they're inherited everywhere)
- Conflicting binding types across environments produce union types (e.g., `KVNamespace | R2Bucket`)

However, if your config does not contain any environments, or you manually specify an environment via `--env`, `wrangler types` will continue to generate a single interface as before.

**Example:**

Given the following `wrangler.jsonc`:

```jsonc
{
"name": "my-worker",
"kv_namespaces": [
{
"binding": "SHARED_KV",
"id": "abc123",
},
],
"env": {
"staging": {
"kv_namespaces": [
{ "binding": "SHARED_KV", "id": "staging-kv" },
{ "binding": "STAGING_CACHE", "id": "staging-cache" },
],
},
},
}
```

Running `wrangler types` will generate:

```ts
declare namespace Cloudflare {
interface StagingEnv {
SHARED_KV: KVNamespace;
STAGING_CACHE: KVNamespace;
}
interface Env {
SHARED_KV: KVNamespace; // Required: in all environments
STAGING_CACHE?: KVNamespace; // Optional: only in staging
}
}
interface Env extends Cloudflare.Env {}
```
14 changes: 2 additions & 12 deletions .github/workflows/changeset-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jobs:
For regular PRs, review: ${{ steps.changed-changesets.outputs.added_files }}
Read `.changeset/README.md` for guidelines, then validate:
1. **Version Type**: Correct patch/minor/major (major forbidden for wrangler)
2. **Changelog Quality**: Meaningful descriptions with examples for features
1. **Version Type**: Accept the author's choice of patch/minor unless clearly incorrect
2. **Changelog Quality**: Meaningful descriptions (examples encouraged but not required for features)
3. **Markdown Headers**: No h1/h2/h3 headers (breaks changelog formatting)
4. **Analytics**: If the change collects more analytics, it should be a minor even though there is no user-visible change
5. **Dependabot**: Do not validate dependency update changesets for create-cloudflare
Expand All @@ -72,20 +72,10 @@ jobs:
If there are issues, output "⚠️ Issues found" followed by the specific problems.
If the user has attached an image, use the Read tool to view it. If and only if it's a cute animal, include in your comment a short cuteness report in the style of WeRateDogs (e.g., "This is Barkley. He's wearing a tiny hat and doesn't know why. 13/10"). If it's not an animal, silently ignore the image. If there is more than one image, check each one to find an animal. If you do not find an animal, do not include any reference to a cuteness report.
Return your structured output indicating whether there are blocking issues.
claude_args: |
--allowedTools "Read,Glob,Grep"
--output-format json
--json-schema '{"type":"object","properties":{"has_blocking_issues":{"type":"boolean","description":"True if any changeset has blocking issues that should fail the check"},"summary":{"type":"string","description":"One-line summary of the review"},"issues":{"type":"array","items":{"type":"object","properties":{"file":{"type":"string"},"issue":{"type":"string"},"severity":{"type":"string","enum":["blocking","warning"]}}}}},"required":["has_blocking_issues","summary"]}'
- name: Skip notice
if: github.event.pull_request.title != 'Version Packages' && steps.changed-changesets.outputs.added_files_count == 0
run: |
echo "No new changesets to review (only minor edits to pre-existing changesets detected)"
- name: Fail if blocking issues found
if: always() && steps.claude-review.outputs.structured_output != '' && fromJSON(steps.claude-review.outputs.structured_output).has_blocking_issues == true
run: |
echo "::error::Blocking changeset issues found. Please fix the issues identified in the Claude review comment."
exit 1
2 changes: 1 addition & 1 deletion packages/unenv-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"peerDependencies": {
"unenv": "2.0.0-rc.24",
"workerd": "^1.20251221.0"
"workerd": "^1.20260115.0"
},
"peerDependenciesMeta": {
"workerd": {
Expand Down
48 changes: 28 additions & 20 deletions packages/unenv-preset/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,11 +613,12 @@ function getVmOverrides({
* Returns the overrides for `node:inspector` and `node:inspector/promises` (unenv or workerd)
*
* The native inspector implementation:
* - is experimental and has no default enable date
* - is enabled starting from 2026-01-29
* - can be enabled with the "enable_nodejs_inspector_module" flag
* - can be disabled with the "disable_nodejs_inspector_module" flag
*/
function getInspectorOverrides({
compatibilityDate,
compatibilityFlags,
}: {
compatibilityDate: string;
Expand All @@ -627,11 +628,12 @@ function getInspectorOverrides({
"disable_nodejs_inspector_module"
);

const enabledByFlag =
compatibilityFlags.includes("enable_nodejs_inspector_module") &&
compatibilityFlags.includes("experimental");
const enabledByFlag = compatibilityFlags.includes(
"enable_nodejs_inspector_module"
);
const enabledByDate = compatibilityDate >= "2026-01-29";

const enabled = enabledByFlag && !disabledByFlag;
const enabled = (enabledByFlag || enabledByDate) && !disabledByFlag;

// When enabled, use the native `inspector` module from workerd
return enabled
Expand All @@ -649,11 +651,12 @@ function getInspectorOverrides({
* Returns the overrides for `node:sqlite` (unenv or workerd)
*
* The native sqlite implementation:
* - is experimental and has no default enable date
* - is enabled starting from 2026-01-29
* - can be enabled with the "enable_nodejs_sqlite_module" flag
* - can be disabled with the "disable_nodejs_sqlite_module" flag
*/
function getSqliteOverrides({
compatibilityDate,
compatibilityFlags,
}: {
compatibilityDate: string;
Expand All @@ -663,11 +666,12 @@ function getSqliteOverrides({
"disable_nodejs_sqlite_module"
);

const enabledByFlag =
compatibilityFlags.includes("enable_nodejs_sqlite_module") &&
compatibilityFlags.includes("experimental");
const enabledByFlag = compatibilityFlags.includes(
"enable_nodejs_sqlite_module"
);
const enabledByDate = compatibilityDate >= "2026-01-29";

const enabled = enabledByFlag && !disabledByFlag;
const enabled = (enabledByFlag || enabledByDate) && !disabledByFlag;

// When enabled, use the native `sqlite` module from workerd
return enabled
Expand All @@ -685,11 +689,12 @@ function getSqliteOverrides({
* Returns the overrides for `node:dgram` (unenv or workerd)
*
* The native dgram implementation:
* - is experimental and has no default enable date
* - is enabled starting from 2026-01-29
* - can be enabled with the "enable_nodejs_dgram_module" flag
* - can be disabled with the "disable_nodejs_dgram_module" flag
*/
function getDgramOverrides({
compatibilityDate,
compatibilityFlags,
}: {
compatibilityDate: string;
Expand All @@ -699,11 +704,12 @@ function getDgramOverrides({
"disable_nodejs_dgram_module"
);

const enabledByFlag =
compatibilityFlags.includes("enable_nodejs_dgram_module") &&
compatibilityFlags.includes("experimental");
const enabledByFlag = compatibilityFlags.includes(
"enable_nodejs_dgram_module"
);

const enabled = enabledByFlag && !disabledByFlag;
const enabledByDate = compatibilityDate >= "2026-01-29";
const enabled = (enabledByFlag || enabledByDate) && !disabledByFlag;

// When enabled, use the native `dgram` module from workerd
return enabled
Expand All @@ -721,11 +727,12 @@ function getDgramOverrides({
* Returns the overrides for `node:_stream_wrap` (unenv or workerd)
*
* The native _stream_wrap implementation:
* - is experimental and has no default enable date
* - is enabled starting from 2026-01-29
* - can be enabled with the "enable_nodejs_stream_wrap_module" flag
* - can be disabled with the "disable_nodejs_stream_wrap_module" flag
*/
function getStreamWrapOverrides({
compatibilityDate,
compatibilityFlags,
}: {
compatibilityDate: string;
Expand All @@ -735,11 +742,12 @@ function getStreamWrapOverrides({
"disable_nodejs_stream_wrap_module"
);

const enabledByFlag =
compatibilityFlags.includes("enable_nodejs_stream_wrap_module") &&
compatibilityFlags.includes("experimental");
const enabledByFlag = compatibilityFlags.includes(
"enable_nodejs_stream_wrap_module"
);

const enabled = enabledByFlag && !disabledByFlag;
const enabledByDate = compatibilityDate >= "2026-01-29";
const enabled = (enabledByFlag || enabledByDate) && !disabledByFlag;

// When enabled, use the native `_stream_wrap` module from workerd
return enabled
Expand Down
Loading
Loading