github cloudflare/workers-sdk wrangler@4.60.0

11 hours ago

Minor Changes

  • #11113 bba0968 Thanks @AmirSa12! - Add wrangler complete command for shell completion scripts (bash, zsh, powershell)

    Usage:

    # Bash
    wrangler complete bash >> ~/.bashrc
    
    # Zsh
    wrangler complete zsh >> ~/.zshrc
    
    # Fish
    wrangler complete fish >> ~/.config/fish/completions/wrangler.fish
    
    # PowerShell
    wrangler complete powershell > $PROFILE
    • Uses @bomb.sh/tab library for cross-shell compatibility
    • Completions are dynamically generated from experimental_getWranglerCommands() API
  • #11893 f9e8a45 Thanks @NuroDev! - 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:

    {
    	"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:

    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 {}

Patch Changes

  • #12030 614bbd7 Thanks @jbwcloudflare! - Fix wrangler pages project validate to respect file count limits from CF_PAGES_UPLOAD_JWT

  • #11993 788bf78 Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260116.0 1.20260120.0
  • #12039 1375577 Thanks @dimitropoulos! - Fixed the flag casing for the time period flag for the d1 insights command.

  • #12026 c3407ad Thanks @dario-piotrowicz! - Fix wrangler setup not automatically selecting workers as the target for new SvelteKit apps

    The Sveltekit adapter:cloudflare adapter now accepts two different targets workers or pages. Since the wrangler auto configuration only targets workers, wrangler should instruct the adapter to use the workers variant. (The auto configuration process would in any case not work if the user were to target pages.)

  • Updated dependencies [788bf78, ae108f0]:

    • miniflare@4.20260120.0
    • @cloudflare/unenv-preset@2.11.0
    • @cloudflare/kv-asset-handler@0.4.2

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.