github cloudflare/workers-sdk wrangler@2.0.8

latest releases: create-cloudflare@2.32.1, wrangler@3.86.1, @cloudflare/vitest-pool-workers@0.5.27...
2 years ago

Patch Changes

  • #1184 4a10176 Thanks @timabb031! - polish: add cron trigger to wrangler.toml when new Scheduled Worker is created

    When wrangler init is used to create a new Scheduled Worker a cron trigger (1 * * * *) will be added to wrangler.toml, but only if wrangler.toml is being created during init. If wrangler.toml exists prior to running wrangler init then wrangler.toml will remain unchanged even if the user selects the "Scheduled Handler" option. This is as per existing tests in init.test.ts that ensure wrangler.toml is never overwritten after agreeing to prompts. That can change if it needs to.

  • #1163 52c0bf0 Thanks @threepointone! - fix: only log available bindings once in dev

    Because we were calling printBindings during the render phase of <Dev/>, we were logging the bindings multiple times (render can be called multiple times, and the interaction of Ink's stdout output intermingled with console is a bit weird). We could have put it into an effect, but I think a better solution here is to simply log it before we even start rendering <Dev/> (so we could see the bindings even if Dev fails to load, for example).

    This also adds a fix that masks any overriden values so that we don't accidentally log potential secrets into the terminal.

  • #1154 5d6de58 Thanks @threepointone! - fix: extract Cloudflare_CA.pem to temp dir before using it

    With package managers like yarn, the cloudflare cert won't be available on the filesystem as expected (since the module is inside a .zip file). This fix instead extracts the file out of the module, copies it to a temporary directory, and directs node to use that as the cert instead, preventing warnings like #1136.

    Fixes #1136

  • #1166 08e3a49 Thanks @threepointone! - fix: warn on unexpected fields on migrations

    This adds a warning for unexpected fields on [migrations] config, reported in #1165. It also adds a test for incorrect renamed_classes in a migration.

  • #1122 c2d2f44 Thanks @petebacondarwin! - fix: display chained errors from the CF API

    For example if you have an invalid CF_API_TOKEN and try running wrangler whoami
    you now get the additional 6111 error information:

    ✘ [ERROR] A request to the Cloudflare API (/user) failed.
    
      Invalid request headers [code: 6003]
      - Invalid format for Authorization header [code: 6111]
    
  • #1152 b817136 Thanks @threepointone! - polish: Give a copy-paste config when [migrations] are missing

    This gives a slightly better message when migrations are missing for declared durable objcts. Specifically, it gives a copy-pastable section to add to wrangler.toml, and doesn't show the warning at all for invalid class names anymore.

    Partially makes #1076 better.

  • #1141 a8c509a Thanks @rozenmd! - fix: rename "publish" package.json script to "deploy"

    Renaming the default "publish" package.json script to "deploy" to avoid confusion with npm's publish command.

    Closes #1121

  • #1175 e978986 Thanks @timabb031! - feature: allow user to select a handler template with wrangler init

    This allows the user to choose which template they'd like to use when they are prompted to create a new worker.
    The options are currently "None"/"Fetch Handler"/"Scheduled Handler".
    Support for new handler types such as email can be added easily in future.

Don't miss a new workers-sdk release

NewReleases is sending notifications on new releases.