diff --git a/.changeset/forty-mice-travel.md b/.changeset/forty-mice-travel.md deleted file mode 100644 index f13d1b957671..000000000000 --- a/.changeset/forty-mice-travel.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"wrangler": patch ---- - -fix: strip leading `*`/`*.` from routes when deducing a host for `dev` - -When given routes, we use the host name from the route to deduce a zone id to pass along with the host to set with dev `session`. Route patterns can include leading `*`/`*.`, which we don't account for when deducing said zone id, resulting in subtle errors for the session. This fix strips those leading characters as appropriate. - -Fixes https://github.com/cloudflare/wrangler2/issues/1002 diff --git a/.changeset/grumpy-dolphins-explain.md b/.changeset/grumpy-dolphins-explain.md deleted file mode 100644 index 48c2440cd225..000000000000 --- a/.changeset/grumpy-dolphins-explain.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -fix: trim trailing whitespace from the secrets before uploading - -resolves #993 diff --git a/.changeset/heavy-rabbits-accept.md b/.changeset/heavy-rabbits-accept.md deleted file mode 100644 index 167293cef1d0..000000000000 --- a/.changeset/heavy-rabbits-accept.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -"wrangler": patch ---- - -fix: display the correct help information when a subcommand is invalid - -Previously, when an invalid subcommand was used, such as `wrangler r2 foo`, -the help that was displayed showed the top-level commands prefixed by the command in used. -E.g. - -``` -wrangler r2 init [name] 📥 Create a wrangler.toml configuration file -wrangler r2 dev [script] 👂 Start a local server for developing your worker -wrangler r2 publish [script] 🆙 Publish your Worker to Cloudflare. -... -``` - -Now the correct command help is displayed: - -``` -$ wrangler r2 foo - -✘ [ERROR] Unknown argument: foo - - -wrangler r2 - -📦 Interact with an R2 store - -Commands: - wrangler r2 bucket Manage R2 buckets - -Flags: - -c, --config Path to .toml configuration file [string] - -h, --help Show help [boolean] - -v, --version Show version number [boolean] -``` - -Fixes #871 diff --git a/.changeset/hot-insects-cry.md b/.changeset/hot-insects-cry.md deleted file mode 100644 index 03c4cc13966c..000000000000 --- a/.changeset/hot-insects-cry.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -"wrangler": patch ---- - -feat: implement support for service bindings - -This adds experimental support for service bindings, aka worker-to-worker bindings. It's lets you "call" a worker from another worker, without incurring any network cost, and (ideally) with much less latency. To use it, define a `[services]` field in `wrangler.toml`, which is a map of bindings to worker names (and environment). Let's say you already have a worker named "my-worker" deployed. In another worker's configuration, you can create a service binding to it like so: - -```toml -[[services]] -binding = "MYWORKER" -service = "my-worker" -environment = "production" # optional, defaults to the worker's `default_environment` for now -``` - -And in your worker, you can call it like so: - -```js -export default { - fetch(req, env, ctx) { - return env.MYWORKER.fetch(new Request("http://domain/some-path")); - }, -}; -``` - -Fixes https://github.com/cloudflare/wrangler2/issues/1026 diff --git a/.changeset/large-pets-cheer.md b/.changeset/large-pets-cheer.md deleted file mode 100644 index ef1930d993e3..000000000000 --- a/.changeset/large-pets-cheer.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -fix: Incorrect extension extraction from file paths. - -Our extension extraction logic was taking into account folder names, which can include periods. The logic would incorrectly identify a file path of .well-known/foo as having the extension of well-known/foo when in reality it should be an empty string. diff --git a/.changeset/lazy-sheep-rest.md b/.changeset/lazy-sheep-rest.md deleted file mode 100644 index ed49149ed60a..000000000000 --- a/.changeset/lazy-sheep-rest.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -fix: don't fetch migrations when in `--dry-run` mode - -Fixes https://github.com/cloudflare/wrangler2/issues/1038 diff --git a/.changeset/metal-bees-shop.md b/.changeset/metal-bees-shop.md deleted file mode 100644 index fc8d1973649f..000000000000 --- a/.changeset/metal-bees-shop.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -"wrangler": patch ---- - -fix: `wrangler init` should not crash if Git is not available on Windows - -We check for the presence of Git by trying to run `git --version`. -On non-Windows we get an Error with `code` set to "ENOENT". -One Windows we get a different error: - -``` -{ - "shortMessage":"Command failed with exit code 1: git --version", - "command":"git --version", - "escapedCommand":"git --version", - "exitCode":1, - "stdout":"", - "stderr":"'git' is not recognized as an internal or external command,\r\noperable program or batch file.", - "failed":true, - "timedOut":false, - "isCanceled":false, - "killed":false -} -``` - -Since we don't really care what the error is, now we just assume that Git -is not available if an error is thrown. - -Fixes #1022 diff --git a/.changeset/polite-buses-prove.md b/.changeset/polite-buses-prove.md deleted file mode 100644 index 26159af61181..000000000000 --- a/.changeset/polite-buses-prove.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wranglerjs-compat-webpack-plugin": patch ---- - -Bumping wranglerjs-compat-webpack-plugin to do a release diff --git a/.changeset/shy-eels-march.md b/.changeset/shy-eels-march.md deleted file mode 100644 index ba0f52fa9ef1..000000000000 --- a/.changeset/shy-eels-march.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"wrangler": patch ---- - -feature: add support for publishing to Custom Domains - -With the release of Custom Domains for workers, users can publish directly to a custom domain on a route, rather than creating a dummy DNS record first and manually pointing the worker over - this adds the same support to wrangler. - -Users declare routes as normal, but to indicate that a route should be treated as a custom domain, a user simply uses the object format in the toml file, but with a new key: custom_domain (i.e. `routes = [{ pattern = "api.example.com", custom_domain = true }]`) - -When wrangler sees a route like this, it peels them off from the rest of the routes and publishes them separately, using the /domains api. This api is very defensive, erroring eagerly if there are conflicts in existing Custom Domains or managed DNS records. In the case of conflicts, wrangler prompts for confirmation, and then retries with parameters to indicate overriding is allowed. diff --git a/.changeset/sweet-worms-fail.md b/.changeset/sweet-worms-fail.md deleted file mode 100644 index 65b86b156930..000000000000 --- a/.changeset/sweet-worms-fail.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"wrangler": patch ---- - -feat: bind a durable object by environment - -For durable objects, instead of just `{ name, class_name, script_name}`, this lets you bind by environment as well, like so `{ name, class_name, script_name, environment }`. - -Fixes https://github.com/cloudflare/wrangler2/issues/996 diff --git a/.changeset/tame-tigers-impress.md b/.changeset/tame-tigers-impress.md deleted file mode 100644 index 624f38c6c563..000000000000 --- a/.changeset/tame-tigers-impress.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"wrangler": patch ---- - -fix: pages "command" can consist of multiple words - -On Windows, the following command `wrangler pages dev -- foo bar` would error -saying that `bar` was not a known argument. This is because `foo` and `bar` are -passed to Yargs as separate arguments. - -A workaround is to put the command in quotes: `wrangler pages dev -- "foo bar"`. -But this fix makes the `command` argument variadic, which also solves the problem. - -Fixes [#965](https://github.com/cloudflare/wrangler2/issues/965) diff --git a/.changeset/tricky-actors-pretend.md b/.changeset/tricky-actors-pretend.md deleted file mode 100644 index 0ec1b8241208..000000000000 --- a/.changeset/tricky-actors-pretend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wrangler": patch ---- - -feat: trying to use node builtins should recommend you enable node_compat in wrangler.toml diff --git a/.changeset/violet-poems-wait.md b/.changeset/violet-poems-wait.md deleted file mode 100644 index a5f26fbf5c63..000000000000 --- a/.changeset/violet-poems-wait.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"wrangler": patch ---- - -polish: validate payload for `kv:bulk put` on client side - -This adds client side validation for the paylod for `kv:bulk put`, importantly ensuring we're uploading only string key/value pairs (as well as validation for the other fields). - -Fixes https://github.com/cloudflare/wrangler2/issues/571 diff --git a/.changeset/wild-seas-breathe.md b/.changeset/wild-seas-breathe.md deleted file mode 100644 index 2c95d3784802..000000000000 --- a/.changeset/wild-seas-breathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wrangler": patch ---- - -fix: don't attempt to login during a --dryRun diff --git a/package-lock.json b/package-lock.json index 9a5ba4ff8dbd..33815713785d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20308,7 +20308,7 @@ } }, "packages/wrangler": { - "version": "2.0.5", + "version": "2.0.6", "license": "MIT OR Apache-2.0", "dependencies": { "@esbuild-plugins/node-globals-polyfill": "^0.1.1", @@ -20857,7 +20857,7 @@ } }, "packages/wranglerjs-compat-webpack-plugin": { - "version": "0.0.1", + "version": "0.0.2", "license": "MIT OR Apache-2.0", "dependencies": { "rimraf": "^3.0.2" diff --git a/packages/wrangler/CHANGELOG.md b/packages/wrangler/CHANGELOG.md index 39f50662bdad..c40e2ec26f88 100644 --- a/packages/wrangler/CHANGELOG.md +++ b/packages/wrangler/CHANGELOG.md @@ -1,5 +1,147 @@ # wrangler +## 2.0.6 + +### Patch Changes + +- [#1018](https://github.com/cloudflare/wrangler2/pull/1018) [`cd2c42f`](https://github.com/cloudflare/wrangler2/commit/cd2c42fca02bff463d78398428dcf079a80e2ae6) Thanks [@threepointone](https://github.com/threepointone)! - fix: strip leading `*`/`*.` from routes when deducing a host for `dev` + + When given routes, we use the host name from the route to deduce a zone id to pass along with the host to set with dev `session`. Route patterns can include leading `*`/`*.`, which we don't account for when deducing said zone id, resulting in subtle errors for the session. This fix strips those leading characters as appropriate. + + Fixes https://github.com/cloudflare/wrangler2/issues/1002 + +* [#1044](https://github.com/cloudflare/wrangler2/pull/1044) [`7a191a2`](https://github.com/cloudflare/wrangler2/commit/7a191a2fd0cb08f2a80c29703a307286264ef74f) Thanks [@JacobMGEvans](https://github.com/JacobMGEvans)! - fix: trim trailing whitespace from the secrets before uploading + + resolves #993 + +- [#1052](https://github.com/cloudflare/wrangler2/pull/1052) [`233eef2`](https://github.com/cloudflare/wrangler2/commit/233eef2081d093b08ec02e68445c5e9c26ebe58c) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: display the correct help information when a subcommand is invalid + + Previously, when an invalid subcommand was used, such as `wrangler r2 foo`, + the help that was displayed showed the top-level commands prefixed by the command in used. + E.g. + + ``` + wrangler r2 init [name] 📥 Create a wrangler.toml configuration file + wrangler r2 dev [script] 👂 Start a local server for developing your worker + wrangler r2 publish [script] 🆙 Publish your Worker to Cloudflare. + ... + ``` + + Now the correct command help is displayed: + + ``` + $ wrangler r2 foo + + ✘ [ERROR] Unknown argument: foo + + + wrangler r2 + + 📦 Interact with an R2 store + + Commands: + wrangler r2 bucket Manage R2 buckets + + Flags: + -c, --config Path to .toml configuration file [string] + -h, --help Show help [boolean] + -v, --version Show version number [boolean] + ``` + + Fixes #871 + +* [#906](https://github.com/cloudflare/wrangler2/pull/906) [`3279f10`](https://github.com/cloudflare/wrangler2/commit/3279f103fb3b1c27addb4c69c30ad970ab0d5f77) Thanks [@threepointone](https://github.com/threepointone)! - feat: implement support for service bindings + + This adds experimental support for service bindings, aka worker-to-worker bindings. It's lets you "call" a worker from another worker, without incurring any network cost, and (ideally) with much less latency. To use it, define a `[services]` field in `wrangler.toml`, which is a map of bindings to worker names (and environment). Let's say you already have a worker named "my-worker" deployed. In another worker's configuration, you can create a service binding to it like so: + + ```toml + [[services]] + binding = "MYWORKER" + service = "my-worker" + environment = "production" # optional, defaults to the worker's `default_environment` for now + ``` + + And in your worker, you can call it like so: + + ```js + export default { + fetch(req, env, ctx) { + return env.MYWORKER.fetch(new Request("http://domain/some-path")); + } + }; + ``` + + Fixes https://github.com/cloudflare/wrangler2/issues/1026 + +- [#1045](https://github.com/cloudflare/wrangler2/pull/1045) [`8eeef9a`](https://github.com/cloudflare/wrangler2/commit/8eeef9ace652ffad3be0116f6f58c71dc251e49c) Thanks [@jrf0110](https://github.com/jrf0110)! - fix: Incorrect extension extraction from file paths. + + Our extension extraction logic was taking into account folder names, which can include periods. The logic would incorrectly identify a file path of .well-known/foo as having the extension of well-known/foo when in reality it should be an empty string. + +* [#1039](https://github.com/cloudflare/wrangler2/pull/1039) [`95852c3`](https://github.com/cloudflare/wrangler2/commit/95852c304716e8b9b97ef2a5486c8337cc278f1d) Thanks [@threepointone](https://github.com/threepointone)! - fix: don't fetch migrations when in `--dry-run` mode + + Fixes https://github.com/cloudflare/wrangler2/issues/1038 + +- [#1033](https://github.com/cloudflare/wrangler2/pull/1033) [`ffce3e3`](https://github.com/cloudflare/wrangler2/commit/ffce3e3fa1bf04a1597d4fd1c6ef5ed536b81308) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: `wrangler init` should not crash if Git is not available on Windows + + We check for the presence of Git by trying to run `git --version`. + On non-Windows we get an Error with `code` set to "ENOENT". + One Windows we get a different error: + + ``` + { + "shortMessage":"Command failed with exit code 1: git --version", + "command":"git --version", + "escapedCommand":"git --version", + "exitCode":1, + "stdout":"", + "stderr":"'git' is not recognized as an internal or external command,\r\noperable program or batch file.", + "failed":true, + "timedOut":false, + "isCanceled":false, + "killed":false + } + ``` + + Since we don't really care what the error is, now we just assume that Git + is not available if an error is thrown. + + Fixes #1022 + +* [#982](https://github.com/cloudflare/wrangler2/pull/982) [`6791703`](https://github.com/cloudflare/wrangler2/commit/6791703abc6f9e61a7f954db48d53c6994c80e03) Thanks [@matthewdavidrodgers](https://github.com/matthewdavidrodgers)! - feature: add support for publishing to Custom Domains + + With the release of Custom Domains for workers, users can publish directly to a custom domain on a route, rather than creating a dummy DNS record first and manually pointing the worker over - this adds the same support to wrangler. + + Users declare routes as normal, but to indicate that a route should be treated as a custom domain, a user simply uses the object format in the toml file, but with a new key: custom_domain (i.e. `routes = [{ pattern = "api.example.com", custom_domain = true }]`) + + When wrangler sees a route like this, it peels them off from the rest of the routes and publishes them separately, using the /domains api. This api is very defensive, erroring eagerly if there are conflicts in existing Custom Domains or managed DNS records. In the case of conflicts, wrangler prompts for confirmation, and then retries with parameters to indicate overriding is allowed. + +- [#1019](https://github.com/cloudflare/wrangler2/pull/1019) [`5816eba`](https://github.com/cloudflare/wrangler2/commit/5816ebae462a5ec9252b9df1b46ace3204bc81e8) Thanks [@threepointone](https://github.com/threepointone)! - feat: bind a durable object by environment + + For durable objects, instead of just `{ name, class_name, script_name}`, this lets you bind by environment as well, like so `{ name, class_name, script_name, environment }`. + + Fixes https://github.com/cloudflare/wrangler2/issues/996 + +* [#1057](https://github.com/cloudflare/wrangler2/pull/1057) [`608dcd9`](https://github.com/cloudflare/wrangler2/commit/608dcd940ba2096d975dbbbedb63c34943617d4a) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: pages "command" can consist of multiple words + + On Windows, the following command `wrangler pages dev -- foo bar` would error + saying that `bar` was not a known argument. This is because `foo` and `bar` are + passed to Yargs as separate arguments. + + A workaround is to put the command in quotes: `wrangler pages dev -- "foo bar"`. + But this fix makes the `command` argument variadic, which also solves the problem. + + Fixes [#965](https://github.com/cloudflare/wrangler2/issues/965) + +- [#1027](https://github.com/cloudflare/wrangler2/pull/1027) [`3545e41`](https://github.com/cloudflare/wrangler2/commit/3545e419a70f4f0d5dd305972bf63acf11f91d5c) Thanks [@rozenmd](https://github.com/rozenmd)! - feat: trying to use node builtins should recommend you enable node_compat in wrangler.toml + +* [#1024](https://github.com/cloudflare/wrangler2/pull/1024) [`110f340`](https://github.com/cloudflare/wrangler2/commit/110f340061918026938cda2aba158276386fe6e9) Thanks [@threepointone](https://github.com/threepointone)! - polish: validate payload for `kv:bulk put` on client side + + This adds client side validation for the paylod for `kv:bulk put`, importantly ensuring we're uploading only string key/value pairs (as well as validation for the other fields). + + Fixes https://github.com/cloudflare/wrangler2/issues/571 + +- [#1037](https://github.com/cloudflare/wrangler2/pull/1037) [`963e9e0`](https://github.com/cloudflare/wrangler2/commit/963e9e08e52f7871923bded3fd5c2cb2ec452532) Thanks [@rozenmd](https://github.com/rozenmd)! - fix: don't attempt to login during a --dryRun + ## 2.0.5 ### Patch Changes diff --git a/packages/wrangler/package.json b/packages/wrangler/package.json index f291cc327cf0..1d7e057a3ae5 100644 --- a/packages/wrangler/package.json +++ b/packages/wrangler/package.json @@ -1,6 +1,6 @@ { "name": "wrangler", - "version": "2.0.5", + "version": "2.0.6", "author": "wrangler@cloudflare.com", "description": "Command-line interface for all things Cloudflare Workers", "bin": { diff --git a/packages/wranglerjs-compat-webpack-plugin/CHANGELOG.md b/packages/wranglerjs-compat-webpack-plugin/CHANGELOG.md index 130befcf1d4a..3f7ff5b2efdf 100644 --- a/packages/wranglerjs-compat-webpack-plugin/CHANGELOG.md +++ b/packages/wranglerjs-compat-webpack-plugin/CHANGELOG.md @@ -1,5 +1,11 @@ # wranglerjs-compat-webpack-plugin +## 0.0.2 + +### Patch Changes + +- [#1034](https://github.com/cloudflare/wrangler2/pull/1034) [`53033f3`](https://github.com/cloudflare/wrangler2/commit/53033f3091e2d8fc675a0b078b36b3aa37673cba) Thanks [@threepointone](https://github.com/threepointone)! - Bumping wranglerjs-compat-webpack-plugin to do a release + ## 0.0.1 ### Patch Changes diff --git a/packages/wranglerjs-compat-webpack-plugin/package.json b/packages/wranglerjs-compat-webpack-plugin/package.json index 9760ab986f83..694d05cfd4d2 100644 --- a/packages/wranglerjs-compat-webpack-plugin/package.json +++ b/packages/wranglerjs-compat-webpack-plugin/package.json @@ -1,6 +1,6 @@ { "name": "wranglerjs-compat-webpack-plugin", - "version": "0.0.1", + "version": "0.0.2", "description": "A webpack plugin to emulate the behavior of wrangler1's `type = webpack`", "author": "wrangler@cloudflare.com", "license": "MIT OR Apache-2.0",