Patch Changes
-
#1272
f7d362e
Thanks @JacobMGEvans! - feat: print bundle size duringpublish
anddev
This logs the complete bundle size of the Worker (as well as when compressed) during
publish
anddev
.Via #405 (comment))
-
#1287
2072e27
Thanks @f5io! - fix: kv:key put/get binary fileAs 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 nodeBuffer
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 throughconsole.log
. By leveragingprocess.stdout.write
we can push the fetchedArrayBuffer
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 forwrangler 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 calledmain
but otherwise just make sure we don't crash.Fixes #1228
-
#1311
374655d
Thanks @JacobMGEvans! - feat: add--text
flag to decodekv:key get
response values as utf8 stringsPreviously, 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 directoryBefore 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 ofwrangler
if one exists.Users will frequently install
wrangler
globally to run commands likewrangler init
, but we also recommend pinning a specific version ofwrangler
in a project'spackage.json
. Now, when a user invokes a global install ofwrangler
, 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 passedSince 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 linernpx wrangler dev --assets path/to/folder
(and same withpublish
). -
#1293
ee57d77
Thanks @petebacondarwin! - fix: do not crash inwrangler dev
if user has multiple accountsWhen a user has multiple accounts we show a prompt to allow the user to select which they should use.
This was broken inwrangler 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 forwrangler 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 nameWhen 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 modeThe 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 akv: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 modeA 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 assetsThis adds support for defining
assets
inwrangler.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