News Radar RSS

@cloudflare/workers-utils@0.23.0

cloudflare/workers-sdk Releases Developers & Open Source Score 8/10

Summary

<h3>Minor Changes</h3> <ul> <li> <p><a href="https://github.com/cloudflare/workers-sdk/pull/14089" data-hovercard-type="pull_request" data-hovercard-url="/cloudflare/workers-sdk/pull/14089/hovercard">#14089</a> <a href="https://github.com/cloudflare/workers-sdk/commit/c6c61b59431443b2bcda25f3af7624dd2ce19b9b"><code>c6c61b5</code></a> Thanks <a href="https://github.com/alsuren">@alsuren</a>! - Add <code>migrations_pattern</code> to D1 database bindings</p> <p>The D1 binding now accepts an optional <code>migrations_pattern</code> field, allowing you to point <code>wrangler d1 migrations apply</code> and <code>wrangler d1 migrations list</code> at migration files in nested layouts (e.g. ORM-generated folders like <code>migrations/0000_init/migration.sql</code>).</p> <p><code>migrations_pattern</code> is a glob (relative to the wrangler config file) and defaults to <code>${migrations_dir}/*.sql</code>, which preserves today's behaviour. Files that do not match the pattern are not executed.</p> <div class="highlight highlight-source-json-comments notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ "d1_databases": [ { "binding": "DB", "database_name": "my-db", "database_id": "...", "migrations_dir": "migrations", "migrations_pattern": "migrations/*/migration.sql" } ] }"><pre>{ <span class="pl-ent">"d1_databases"</span>: [ { <span class="pl-ent">"binding"</span>: <span class="pl-s"><span class="pl-pds">"</span>DB<span class="pl-pds">"</span></span>, <span class="pl-ent">"database_name"</span>: <span class="pl-s"><span class="pl-pds">"</span>my-db<span class="pl-pds">"</span></span>, <span class="pl-ent">"database_id"</span>: <span class="pl-s"><span class="pl-pds">"</span>...<span class="pl-pds">"</span></span>, <span class="pl-ent">"migrations_dir"</span>: <span class="pl-s"><span class="pl-pds">"</span>migrations<span class="pl-pds">"</span></span>, <span class="pl-ent">"migrations_pattern"</span>: <span class="pl-s"><span class="pl-pds">"</span>migrations/*/migration.sql<span class="pl-pds">"</span></span> } ] }</pre></div> <p>When no migrations match the configured pattern but files matching the common <code>migrations/*/migration.sql</code> (drizzle-style) layout do exist, Wrangler logs a hint suggesting <code>migrations_pattern</code> as an opt-in.</p> <p><code>wrangler d1 migrations create</code> now returns an actionable error if the generated migration filename would not match the configured pattern.</p> </li> <li> <p><a href="https://github.com/cloudflare/workers-sdk/pull/14164" data-hovercard-type="pull_request" data-hovercard-url="/cloudflare/workers-sdk/pull/14164/hovercard">#14164</a> <a href="https://github.com/cloudflare/workers-sdk/commit/b502d5445b9e9e030020a3d65c0334507393aa64"><code>b502d54</code></a> Thanks <a href="https://github.com/G4brym">@G4brym</a>! - Rename the <code>web_search</code> binding kind to <code>websearch</code></p> <p>Pre-launch rename of the public binding type from <code>web_search</code> to <code>websearch</code> so the on-the-wire shape matches the product name (Web Search). The wrangler config key, the binding-type string sent to the Cloudflare API, and the miniflare option key all move from <code>web_search</code> / <code>webSearch</code> to <code>websearch</code>.</p> <p>Update your wrangler config:</p> <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- "web_search": { "binding": "WEBSEARCH" } + "websearch": { "binding": "WEBSEARCH" }"><pre><span class="pl-md"><span class="pl-md">-</span> "web_search": { "binding": "WEBSEARCH" }</span> <span class="pl-mi1"><span class="pl-mi1">+</span> "websearch": { "binding": "WEBSEARCH" }</span></pre></div> <p>The runtime <code>WebSearch</code> type exposed on <code>env.WEBSEARCH</code> is unchanged.</p> </li> <li> <p><a href="https://github.com/cloudflare/workers-sdk/pull/14146" data-hovercard-type="pull_request" data-hovercard-url="/cloudflare/workers-sdk/pull/14146/hovercard">#14146</a> <a href="https://github.com/cloudflare/workers-sdk/commit/c4f45e8b8694c60fb1808f7fbb130e4b4893d20c"><code>c4f45e8</code></a> Thanks <a href="https://github.com/dario-piotrowicz">@dario-piotrowicz</a>! - Simplify <code>constructWranglerConfig</code> to accept a single worker instead of an array</p> <p>The <code>constructWranglerConfig</code> function now accepts a single <code>APIWorkerConfig</code> object instead of <code>APIWorkerConfig | APIWorkerConfig[]</code>. The multi-environment array support has been removed since the array use-case was removed and now the only call site already passes a single worker object. This is a breaking change to the function's public signature.</p> </li> </ul>

Open SourceCloudflareDeveloper Tools

News Radar provides aggregated summaries. Full content and copyright remain with the original publisher.