Skip to content

Releases: cloudflare/workers-sdk

[email protected]

01 Aug 14:11
70e0ddb
Compare
Choose a tag to compare

Patch Changes

  • #1577 359d0ba3 Thanks @threepointone! - chore: update esbuild to 0.14.51

  • #1558 b43a7f98 Thanks @rozenmd! - chore: extract devProps parsing into own function

  • #1438 0a9fe918 Thanks @caass! - Initial implementation of wrangler generate

    • wrangler generate and wrangler generate <name> delegate to wrangler init.
    • wrangler generate <name> <template> delegates to create-cloudflare

    Naming behavior is replicated from wrangler 1, and will auto-increment the
    worker name based on pre-existing directories.

  • #1534 d3ae16cf Thanks @cameron-robey! - feat: publish full url on wrangler publish for workers.dev workers

    When the url is printed out on wrangler publish, the full url is printed out so that it can be accessed from the terminal easily by doing cmd+click. Implemented only for workers.dev workers.

    Resolves #1530

  • #1552 e9307365 Thanks @Skye-31! - fix: invalid regular expression error (pages)

  • #1576 f696ebb5 Thanks @petebacondarwin! - feat: add platform/os to usage metrics events

  • #1576 f696ebb5 Thanks @petebacondarwin! - fix: rename pages metrics events to align better with the dashboard

  • #1550 aca9c3e7 Thanks @cameron-robey! - feat: describe current permissions in wrangler whoami

    Often users experience issues due to tokens not having the correct permissions associated with them (often due to new scopes being created for new products). With this, we print out a list of permissions associated with OAuth tokens with the wrangler whoami command to help them debug for OAuth tokens. We cannot access the permissions on an API key, so we direct the user to the location in the dashboard to achieve this.
    We also cache the scopes of OAuth tokens alongside the access and refresh tokens in the .wrangler/config file to achieve this.

    Currently unable to implement #1371 - instead directs the user to the dashboard.
    Resolves #1540

  • #1575 5b1f68ee Thanks @JacobMGEvans! - feat: legacy "kv-namespace" not supported
    In previous Wrangler 1, there was a legacy configuration that was considered a "bug" and removed.
    Before it was removed, tutorials, templates, blogs, etc... had utlized that configuration property
    to handle this in Wrangler 2 we will throw a blocking error that tell the user to utilize "kv_namespaces"

    resolves #1421

  • #1404 17f5b576 Thanks @threepointone! - feat: add cache control options to config.assets

    This adds cache control options to config.assets. This is already supported by the backing library (@cloudflare/kv-asset-handler) so we simply pass on the options at its callsite.

    Additionally, this adds a configuration field to serve an app in "single page app" mode, where a root index.html is served for all html/404 requests (also powered by the same library).

  • #1578 cf552192 Thanks @cameron-robey! - feat: source-map function names

    Following on from #1535, using new functionality from esbuild v0.14.50 of generation of names field in generated sourcemaps, we output the original function name in the stack trace.

  • #1503 ebc1aa57 Thanks @threepointone! - feat: zero config multiworker development (local mode)

    Preamble: Typically, a Worker has been the unit of a javascript project on our platform. Any logic that you need, you fit into one worker, ~ 1MB of javascript and bindings. If you wanted to deploy a larger application, you could define different workers on different routes. This is fine for microservice style architectures, but not all projects can be cleaved along the route boundaries; you lose out on sharing code and resources, and can still cross the size limit with heavy dependencies.

    Service bindings provide a novel mechanism for composing multiple workers into a unified architecture. You could deploy shared code into a worker, and make requests to it from another worker. This lets you architect your code along functional boundaries, while also providing some relief to the 1MB size limit.

    I propose a model for developing multiple bound workers in a single project.

    Consider Worker A, at workers/a.js, with a wrangler.toml like so:

    name = 'A'
    
    [[services]]
    binding = 'Bee'
    service = 'B'

    and content like so:

    export default {
    	fetch(req, env) {
    		return env.Bee.fetch(req);
    	}
    };

    Consider Worker B, at workers/b.js, with a wrangler.toml like so:

    name = 'B'

    and content like so:

    export default {
    	fetch(req, env) {
    		return new Response("Hello World");
    	}
    };

    So, a worker A, bound to B, that simply passes on the request to B.

    Local mode:

    Currently, when I run wrangler dev --local on A (or switch from remote to local mode during a dev session), and make requests to A, they'll fail because the bindings don't exist in local mode.

    What I'd like, is to be able to run wrangler dev --local on B as well, and have my dev instance of A make requests to the dev instance of B. When I'm happy with my changes, I'd simply deploy both workers (again, ideally as a batched publish).

    Proposal: A local dev registry for workers.

    • Running wrangler dev on a machine should start up a local service registry (if there isn't one loaded already) as a server on a well known port.
    • Further, it should then "register" itself with the registry with metadata about itself; whether it's running in remote/local mode, the port and ip its dev server is listening on, and any additional configuration (eg: in remote mode, a couple of extra headers have to be added to every request made to the dev session, so we'd add that data into the registry as well.)
    • Every worker that has service bindings configured, should intercept requests to said binding, and instead make a request to the locally running instance of the service. It could rewrite these requests as it pleases.

    (In future PRs, we'll introduce a system for doing the same with remote mode dev, as well as mixed mode. )

    Related to #1182
    Fixes #1040

  • #1551 1b54b54f Thanks @threepointone! - internal: middleware for modifying worker behaviour

    This adds an internal mechanism for applying multiple "middleware"/facades on to workers. This lets us add functionality during dev and/or publish, where we can modify requests or env, or other ideas. (See #1466 for actual usecases)

    As part of this, I implemented a simple facade that formats errors in dev. To enable it you need to set an environment variable FORMAT_WRANGLER_ERRORS=true. This isn't a new feature we're shipping with wrangler, it's simply to demonstrate how to write middleware. We'll probably remove it in the future.

  • #1486 c4e6f156 Thanks @JacobMGEvans! - feat: commands added for uploading and downloading objects from r2.

  • #1539 95d0f863 Thanks [@thre...

Read more

[email protected]

25 Jul 08:22
0b74633
Compare
Choose a tag to compare

Patch Changes

  • #1500 0826f833 Thanks @cameron-robey! - fix: warn when using --no-bundle with --minify or --node-compat

    Fixes #1491

  • #1523 e1e2ee5c Thanks @threepointone! - fix: don't log version spam in tests

    Currently in tests, we see a bunch of logspam from yargs about "version" being a reserved word, this patch removes that spam.

  • #1498 fe3fbd95 Thanks @cameron-robey! - feat: change version command to give update information
    When running version command, we want to display update information if current version is not up to date. Achieved by replacing default output with the wrangler banner.
    Previous behaviour (just outputting current version) reamins when !isTTY.
    Version command changed from inbuilt .version() from yargs, to a regular command to allow for asynchronous behaviour.

    Implements #1492

  • #1431 a2e3a6b7 Thanks @Skye-31! - chore: Refactor wrangler pages dev to use Wrangler-proper's own dev server.

    This:

    • fixes some bugs (e.g. not proxying WebSockets correctly),
    • presents a much nicer UI (with the slick keybinding controls),
    • adds features that pages dev was missing (e.g. --local-protocol),
    • and reduces the maintenance burden of wrangler pages dev going forward.
  • #1528 60bdc31a Thanks @threepointone! - fix: prevent local mode restart

    In dev, we inject a patch for fetch() to detect bad usages. This patch is copied into the destination directory before it's used. esbuild appears to have a bug where it thinks a dependency has changed so it restarts once in local mode. The fix here is to copy the file to inject into a separate temporary dir.

    Fixes #1515

  • #1502 be4ffde5 Thanks @threepointone! - polish: recommend using an account id when user details aren't available.

    When using an api token, sometimes the call to get a user's membership details fails with a 9109 error. In this scenario, a workaround to skip the membership check is to provide an account_id in wrangler.toml or via CLOUDFLARE_ACCOUNT_ID. This bit of polish adds this helpful tip into the error message.

  • #1499 7098b1ee Thanks @cameron-robey! - fix: no feedback on wrangler kv:namespace delete

  • #1479 862f14e5 Thanks @threepointone! - fix: read process.env.NODE_ENV correctly when building worker

    We replace process.env.NODE_ENV in workers with the value of the environment variable. However, we have a bug where when we make an actual build of wrangler (which has NODE_ENV set as "production"), we were also replacing the expression where we'd replace it in a worker. The result was that all workers would have process.env.NODE_ENV set to production, no matter what the user had set. The fix here is to use a "dynamic" value for the expression so that our build system doesn't replace it.

    Fixes #1477

  • #1471 0953af8e Thanks @JacobMGEvans! - ci: implement CodeCov Integration
    CodeCov is used for analyzing code and tests to improve stability and maintainability. It does this by utilizing static code analysis
    and testing output to provide insights into things that need improving, security concerns, missing test coverage of critical code, and more,
    which can be missed even after exhaustive human review.

  • #1516 e178d6fb Thanks @threepointone! - polish: don't log an error message if wrangler dev startup is interrupted.

    When we quit wrangler dev, any inflight requests are cancelled. Any error handlers for those requests are ignored if the request was cancelled purposely. The check for this was missing for the prewarm request for a dev session, and this patch adds it so it dorsn't get logged to the terminal.

  • #1496 8eb91142 Thanks @threepointone! - fix: add fetch() dev helper correctly for pnp style package managers

    In #992, we added a dev-only helper that would warn when using fetch() in a manner that wouldn't work as expected (because of a bug we currently have in the runtime). We did this by injecting a file that would override usages of fetch(). When using pnp style package managers like yarn, this file can't be resolved correctly. So to fix that, we extract it into the temporary destination directory that we use to build the worker (much like a similar fix we did in #1154)

    Reported at #1320 (comment)

  • #1529 1a0ac8d0 Thanks @GregBrimble! - feat: Adds the --experimental-enable-local-persistence option to wrangler pages dev

    Previously, this was implicitly enabled and stored things in a .mf directory. Now we move to be in line with what wrangler dev does, defaults disabled, and stores in a wrangler-local-state directory.

  • #1514 9271680d Thanks @threepointone! - feat: add config.inspector_port

    This adds a configuration option for the inspector port used by the debugger in wrangler dev. This also includes a bug fix where we weren't passing on this configuration to local mode.

[email protected]

15 Jul 19:53
032dc43
Compare
Choose a tag to compare

Patch Changes

  • #1482 9eb28ec Thanks @petebacondarwin! - fix: do not ask the user for metrics permission if running in a CI

    Fixes #1480

  • #1482 9eb28ec Thanks @petebacondarwin! - feat: support controlling metrics gathering via WRANGLER_SEND_METRICS environment variable

    Setting the WRANGLER_SEND_METRICS environment variable will override any other metrics controls,
    such as the send_metrics property in wrangler.toml and cached user preference.

[email protected]

14 Jul 15:02
fc55964
Compare
Choose a tag to compare

Patch Changes

  • #1474 f602df7 Thanks @threepointone! - fix: enable debugger in local mode

    During a refactor, we missed enabling the inspector by default in local mode. We also broke the logic that detects the inspector url exposed by the local server. This patch passes the argument correctly, fixes the detection logic. Further, it also lets you disable the inspector altogether with --inspect false, if required (for both remote and local mode).

    Fixes #1436

  • #1470 01f49f1 Thanks @petebacondarwin! - fix: ensure that metrics user interactions do not break other UI

    The new metrics usage capture may interact with the user if they have not yet set their metrics permission.
    Sending metrics was being done concurrently with other commands, so there was a chance that the metrics UI broke the other command's UI.
    Now we ensure that metrics UI will happen synchronously.

[email protected]

13 Jul 09:05
501cb6a
Compare
Choose a tag to compare

Patch Changes

  • #1410 52fb634 Thanks @petebacondarwin! - feat: add opt-in usage metrics gathering

    This change adds support in Wrangler for sending usage metrics to Cloudflare.
    This is an opt-in only feature. We will ask the user for permission only once per device.
    The user must grant permission, on a per device basis, before we send usage metrics to Cloudflare.
    The permission can also be overridden on a per project basis by setting send_metrics = false in the wrangler.toml.
    If Wrangler is running in non-interactive mode (such as in a CI job) and the user has not already given permission
    we will assume that we cannot send usage metrics.

    The aim of this feature is to help us learn what and how features of Wrangler (and also the Cloudflare dashboard)
    are being used in order to improve the developer experience.

  • #1457 de03f7f Thanks @rozenmd! - fix: add r2Persist key to miniflare options

    Closes #1454

  • #1463 a7ae733 Thanks @threepointone! - fix: ensure that a helpful error message is shown when on unsupported versions of node.js

    Our entrypoint for wrangler (bin/wrangler.js) needs to run in older versions of node and log a message to the user that they need to upgrade their version of node. Sometimes we use syntax in this entrypoint that doesn't run in older versions of node. crashing the script and failing to log the message. This fix adds a test in CI to make sure we don't regress on that behaviour (as well as fixing the current newer syntax usage)

    Fixes #1443

  • #1459 4e425c6 Thanks @sidharthachatterjee! - fix: wrangler pages publish now more reliably retries an upload in case of a failure

    When wrangler pages publish is run, we make calls to an upload endpoint which could be rate limited and therefore fail. We currently retry those calls after a linear backoff. This change makes that backoff exponential which should reduce the likelihood of subsequent calls being rate limited.

[email protected]

12 Jul 12:18
b05a1cd
Compare
Choose a tag to compare

Patch Changes

  • #1451 62649097 Thanks @WalshyDev! - Fixed an issue where Pages upload would OOM. This was caused by us loading all the file content into memory instead of only when required.

  • #1375 e9e98721 Thanks @JacobMGEvans! - polish: Compliance with the XDG Base Directory Specification
    Wrangler was creating a config file in the home directory of the operating system ~/.wrangler. The XDG path spec is a
    standard for storing files, these changes include XDG pathing compliance for .wrangler/* location and backwards compatibility with previous
    ~/.wrangler locations.

    resolves #1053

  • #1449 ee6c421b Thanks @alankemp! - Output additional information about uploaded scripts at WRANGLER_LOG=log level

[email protected]

11 Jul 14:20
8db14ea
Compare
Choose a tag to compare

Patch Changes

  • #1389 eab9542 Thanks @caass! - Remove delegation message when global wrangler delegates to a local installation

    A message used for debugging purposes was accidentally left in, and confused some
    folks. Now it'll only appear when WRANGLER_LOG is set to debug.

  • #1447 16f9436 Thanks @threepointone! - feat: r2 support in wrangler dev --local

    This adds support for r2 bindings in wrangler dev --local, powered by [email protected] via cloudflare/miniflare#289.

    Fixes #1066

  • #1406 0f35556 Thanks @rozenmd! - fix: use fork to let wrangler know miniflare is ready

    This PR replaces our use of spawn in favour of fork to spawn miniflare in wrangler's dev function. This lets miniflare let wrangler know when we're ready to send requests.

    Closes #1408

  • #1442 f9efc04 Thanks @jrencz! - fix: add missing metadata option to kv:key put

    Closes #1441

  • #999 238b546 Thanks @caass! - Include devtools in wrangler monorepo

    Previously, wrangler relied on @threepointone's built-devtools. Now, these devtools are included in the wrangler repository.

  • #1424 8cf0008 Thanks @caass! - fix: Check config.assets when deciding whether to include a default entry point.

    An entry point isn't mandatory when using --assets, and we can use a default worker when doing so. This fix enables that same behaviour when config.assets is configured.

  • #1448 0d462c0 Thanks @threepointone! - polish: set checkjs: false and jsx: "react" in newly created projects

    When we create a new project, it's annoying having to set jsx: "react" when that's the overwhelmingly default choice, our compiler is setup to do it automatically, and the tsc error message isn't helpful. So we set jsx: "react" in the generated tsconfig.

    Setting checkJs: true is also annoying because it's not a common choice. So we set checkJs: false in the generated tsconfig.

  • #1450 172310d Thanks @threepointone! - polish: tweak static assets facade to log only real errors

    This prevents the abundance of NotFoundErrors being unnecessaryily logged.

  • #1415 f3a8452 Thanks @caass! - Emit type declarations for wrangler

    This is a first go-round of emitting type declarations alongside the bundled JS output,
    which should make it easier to use wrangler as a library.

  • #1433 1c1214f Thanks @threepointone! - polish: adds an actionable message when a worker name isn't provided to tail/secret

    Just a better error message when a Worker name isn't available for wrangler secret or wrangler tail.

    Closes #1380

  • #1427 3fa5041 Thanks @caass! - Check npm_config_user_agent to guess a user's package manager

    The environment variable npm_config_user_agent can be used to guess the package manager
    that was used to execute wrangler. It's imperfect (just like regular user agent sniffing!)
    but the package managers we support all set this property:

[email protected]

05 Jul 11:29
d529533
Compare
Choose a tag to compare

Patch Changes

  • #992 ee6b413 Thanks @petebacondarwin! - fix: add warning to fetch() calls that will change the requested port

    In Workers published to the Edge (rather than previews) there is a bug where a custom port on a downstream fetch request is ignored, defaulting to the standard port.
    For example, https://my.example.com:668 will actually send the request to https://my.example.com:443.

    This does not happen when using wrangler dev (both in remote and local mode), but to ensure that developers are aware of it this change displays a runtime warning in the console when the bug is hit.

    Closes #1320

  • #1378 2579257 Thanks @rozenmd! - chore: fully deprecate the preview command

    Before, we would warn folks that preview was deprecated in favour of dev, but then ran dev on their behalf.
    To avoid maintaining effectively two versions of the dev command, we're now just telling folks to run dev.

  • #1213 1bab3f6 Thanks @threepointone! - fix: pass routes to dev session

    We can pass routes when creating a dev session. The effect of this is when you visit a path that doesn't match the given routes, then it instead does a fetch from the deployed worker on that path (if any). We were previously passing */*, i.e, matching all routes in dev; this fix now passes configured routes instead.

  • #1374 215c4f0 Thanks @threepointone! - feat: commands to manage worker namespaces

    This adds commands to create, delete, list, and get info for "worker namespaces" (name to be bikeshed-ed). This is based on work by @aaronlisman in #1310.

  • #1403 9c6c3fb Thanks @threepointone! - feat: config.no_bundle as a configuration option to prevent bundling

    As a configuration parallel to --no-bundle (introduced in #1300 as --no-build, renamed in #1399 to --no-bundle), this introduces a configuration field no_bundle to prevent bundling of the worker before it's published. It's inheritable, which means it can be defined inside environments as well.

  • #1355 61c31a9 Thanks @williamhorning! - fix: Fallback to non-interactive mode on error

    If the terminal isn't a TTY, fallback to non-interactive mode instead of throwing an error. This makes it so users of Bash on Windows can pipe to wrangler without an error being thrown.

    resolves #1303

  • #1337 1d778ae Thanks @JacobMGEvans! - polish: bundle reporter was not printing during publish errors

    The reporter is now called before the publish API call, printing every time.

    resolves #1328

  • #1393 b36ef43 Thanks @threepointone! - chore: enable node's experimental fetch flag

    We'd previously had some funny behaviour with undici clashing with node's own fetch supporting classes, and had turned off node's fetch implementation. Recent updates to undici appear to have fixed the issue, so let's turn it back on.

    Closes #834

  • #1335 49cf17e Thanks @JacobMGEvans! - feat: resolve --assets cli arg relative to current working directory

    Before we were resolving the Asset directory relative to the location of wrangler.toml at all times.
    Now the --assets cli arg is resolved relative to current working directory.

    resolves #1333

  • #1350 dee034b Thanks @rozenmd! - feat: export an (unstable) function that folks can use in their own scripts to invoke wrangler's dev CLI

    Closes #1350

  • #1342 6426625 Thanks @rozenmd! - polish: split dev function out of index.tsx

  • #1401 6732d95 Thanks @threepointone! - fix: log pubsub beta usage warnings consistently

    This fix makes sure the pubsub beta warnings are logged consistently, once per help menu, through the hierarchy of its command tree.

    Fixes #1370

  • #1344 7ba19fe Thanks @rozenmd! - polish: move init into its own file

  • #1386 4112001 Thanks @rozenmd! - feat: implement fetch for wrangler's unstable_dev API, and write our first integration test.

    Prior to this PR, users of unstable_dev had to provide their own fetcher, and guess the address and port that the wrangler dev server was using.

    With this implementation, it's now possible to test wrangler, using just wrangler (and a test framework):

    describe("worker", async () => {
      const worker = await wrangler.unstable_dev("src/index.ts");
    
      const resp = await worker.fetch();
    
      expect(resp).not.toBe(undefined);
      if (resp) {
        const text = await resp.text();
        expect(text).toMatchInlineSnapshot(`"Hello World!"`);
      }
    
      await worker.stop();
    }

    Closes #1383
    Closes #1384
    Closes #1385

  • #1399 1ab71a7 Thanks @threepointone! - fix: rename --no-build to --no-bundle

    This fix renames the --no-build cli arg to --no-bundle. no-build wasn't a great name because it would imply that we don't run custom builds specified under [build] which isn't true. So we rename closer to what wrangler actually does, which is bundling the input. This also makes it clearer that it's a single file upload.

  • #1278 8201733 Thanks @Maximo-Guk! - Throw error if user attempts to use config with pages

  • #1398 ecfbb0c Thanks @threepointone! - Added support for pubsub namespace (via @elithrar in #1314)

    This adds support for managing pubsub namespaces and brokers (https://developers.cloudflare.com/pub-sub/)

  • #1348 eb948b0 Thanks @threepointone! - polish: add an experimental warning if --assets is used

    We already have a warning when config.assets is used, this adds it for the cli argument as well.

  • #1326 12f2703 Thanks @timabb031! - fix: show console.error/console.warn logs when using dev --local.

    Prior to this change, logging with console.error/console.warn in a Worker wouldn't output anything to the console when running in local mode. This was happening because stderr data event handler was being removed after the Debugger listening... string was found.

    This change updates the stderr data event handler to forward on all events to process.stderr.

    Closes #1324

  • #1309 [e5a6aca](https://github.com/cloudflare/wran...

Read more

[email protected]

22 Jun 15:06
bfbb0be
Compare
Choose a tag to compare

Patch Changes

  • #1301 9074990 Thanks @mrbbot! - Upgrade miniflare to 2.5.1

  • #1272 f7d362e Thanks @JacobMGEvans! - feat: print bundle size during publish and dev

    This logs the complete bundle size of the Worker (as well as when compressed) during publish and dev.

    Via #405 (comment))

  • #1287 2072e27 Thanks @f5io! - fix: kv:key put/get binary file

    As raised in #1254, it was discovered that binary uploads were being mangled by wrangler 2, whereas they worked in wrangler 1. This is because they were read into a string by providing an explicit encoding of utf-8. This fix reads provided files into a node Buffer that is then passed directly to the request.

    Subsequently #1273 was raised in relation to a similar issue with gets from wrangler 2. This was happening due to the downloaded file being converted to utf-8 encoding as it was pushed through console.log. By leveraging process.stdout.write we can push the fetched ArrayBuffer to std out directly without inferring any specific encoding value.

  • #1325 bcd066d Thanks @sidharthachatterjee! - fix: Ensure Response is mutable in Pages functions

  • #1265 e322475 Thanks @petebacondarwin! - fix: support all git versions for wrangler init

    If git does not support the --initial-branch argument then just fallback to the default initial branch name.

    We tried to be more clever about this but there are two many weird corner cases with different git versions on different architectures.
    Now we do our best, with recent versions of git, to ensure that the branch is called main but otherwise just make sure we don't crash.

    Fixes #1228

  • #1311 374655d Thanks @JacobMGEvans! - feat: add --text flag to decode kv:key get response values as utf8 strings

    Previously, all kv values were being rendered directly as bytes to the stdout, which makes sense if the value is a binary blob that you are going to pipe into a file, but doesn't make sense if the value is a simple string.

    resolves #1306

  • #1327 4880d54 Thanks @JacobMGEvans! - feat: resolve --site cli arg relative to current working directory

    Before we were resolving the Site directory relative to the location of wrangler.toml at all times.
    Now the --site cli arg is resolved relative to current working directory.

    resolves #1243

  • #1270 7ed5e1a Thanks @caass! - Delegate to a local install of wrangler if one exists.

    Users will frequently install wrangler globally to run commands like wrangler init, but we also recommend pinning a specific version of wrangler in a project's package.json. Now, when a user invokes a global install of wrangler, we'll check to see if they also have a local installation. If they do, we'll delegate to that version.

  • #1289 0d6098c Thanks @threepointone! - feat: entry point is not mandatory if --assets is passed

    Since we use a facade worker with --assets, an entry point is not strictly necessary. This makes a common usecase of "deploy a bunch of static assets" extremely easy to start, as a one liner npx wrangler dev --assets path/to/folder (and same with publish).

  • #1293 ee57d77 Thanks @petebacondarwin! - fix: do not crash in wrangler dev if user has multiple accounts

    When a user has multiple accounts we show a prompt to allow the user to select which they should use.
    This was broken in wrangler dev as we were trying to start a new ink.js app (to show the prompt)
    from inside a running ink.js app (the UI for wrangler dev).

    This fix refactors the ChooseAccount component so that it can be used directly within another component.

    Fixes #1258

  • #1299 0fd0c30 Thanks @threepointone! - polish: include a copy-pastable message when trying to publish without a compatibility date

  • #1269 fea87cf Thanks @petebacondarwin! - fix: do not consider ancestor files when initializing a project with a specified name

    When initializing a new project (via wrangler init) we attempt to reuse files in the current
    directory, or in an ancestor directory. In particular we look up the directory tree for
    package.json and tsconfig.json and use those instead of creating new ones.

    Now we only do this if you do not specify a name for the new Worker. If you do specify a name,
    we now only consider files in the directory where the Worker will be initialized.

    Fixes #859

  • #1321 8e2b92f Thanks @GregBrimble! - fix: Correctly resolve directories for 'wrangler pages publish'

    Previously, attempting to publish a nested directory or the current directory would result in parsing mangled paths which broke deployments. This has now been fixed.

  • #1293 ee57d77 Thanks @petebacondarwin! - fix: do not hang waiting for account choice when in non-interactive mode

    The previous tests for non-interactive only checked the stdin.isTTY, but
    you can have scenarios where the stdin is interactive but the stdout is not.
    For example when writing the output of a kv:key get command to a file.

    We now check that both stdin and stdout are interactive before trying to
    interact with the user.

  • #1275 35482da Thanks @alankemp! - Add environment variable WRANGLER_LOG to set log level

  • #1294 f6836b0 Thanks @threepointone! - fix: serve --assets in dev + local mode

    A quick bugfix to make sure --assets/config.assets gets served correctly in dev --local.

  • #1237 e1b8ac4 Thanks @threepointone! - feat: --assets / config.assets to serve a folder of static assets

    This adds support for defining assets in wrangler.toml. You can configure it with a string path, or a {bucket, include, exclude} object (much like [site]). This also renames the --experimental-public arg as --assets.

    Via #1162

[email protected]

22 Jun 15:06
bfbb0be
Compare
Choose a tag to compare

Patch Changes