From 6d02975cd34c2cfb1b45ee91bfc32765759b12ee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 20 Mar 2022 17:24:55 +0000 Subject: [PATCH] Version Packages --- .changeset/angry-items-serve.md | 5 - .changeset/blue-nails-unite.md | 7 - .changeset/clean-swans-attend.md | 9 - .changeset/clean-trainers-clap.md | 14 -- .changeset/clever-beers-poke.md | 5 - .changeset/cyan-parrots-eat.md | 9 - .changeset/dull-fishes-lay.md | 39 ---- .changeset/eighty-worms-thank.md | 5 - .changeset/famous-pets-complain.md | 16 -- .changeset/fluffy-cameras-greet.md | 8 - .changeset/giant-sloths-fail.md | 5 - .changeset/gold-readers-grin.md | 7 - .changeset/good-beans-cheer.md | 18 -- .changeset/itchy-bobcats-hug.md | 22 -- .changeset/large-pillows-clap.md | 11 - .changeset/late-crabs-care.md | 8 - .changeset/lemon-fireants-kneel.md | 14 -- .changeset/lemon-radios-sparkle.md | 9 - .changeset/lemon-teachers-sip.md | 5 - .changeset/nice-jars-teach.md | 10 - .changeset/olive-seahorses-sleep.md | 13 -- .changeset/perfect-cars-leave.md | 9 - .changeset/pink-apricots-fix.md | 5 - .changeset/short-worms-argue.md | 9 - .changeset/silver-poems-brush.md | 5 - .changeset/small-jokes-lay.md | 7 - .changeset/stale-coats-joke.md | 7 - .changeset/swift-suits-smoke.md | 12 - .changeset/thick-keys-worry.md | 7 - .changeset/young-chefs-live.md | 5 - package-lock.json | 2 +- .../example-pages-functions-app/CHANGELOG.md | 8 + .../example-pages-functions-app/package.json | 3 +- packages/wrangler/CHANGELOG.md | 217 ++++++++++++++++++ packages/wrangler/package.json | 2 +- 35 files changed, 229 insertions(+), 308 deletions(-) delete mode 100644 .changeset/angry-items-serve.md delete mode 100644 .changeset/blue-nails-unite.md delete mode 100644 .changeset/clean-swans-attend.md delete mode 100644 .changeset/clean-trainers-clap.md delete mode 100644 .changeset/clever-beers-poke.md delete mode 100644 .changeset/cyan-parrots-eat.md delete mode 100644 .changeset/dull-fishes-lay.md delete mode 100644 .changeset/eighty-worms-thank.md delete mode 100644 .changeset/famous-pets-complain.md delete mode 100644 .changeset/fluffy-cameras-greet.md delete mode 100644 .changeset/giant-sloths-fail.md delete mode 100644 .changeset/gold-readers-grin.md delete mode 100644 .changeset/good-beans-cheer.md delete mode 100644 .changeset/itchy-bobcats-hug.md delete mode 100644 .changeset/large-pillows-clap.md delete mode 100644 .changeset/late-crabs-care.md delete mode 100644 .changeset/lemon-fireants-kneel.md delete mode 100644 .changeset/lemon-radios-sparkle.md delete mode 100644 .changeset/lemon-teachers-sip.md delete mode 100644 .changeset/nice-jars-teach.md delete mode 100644 .changeset/olive-seahorses-sleep.md delete mode 100644 .changeset/perfect-cars-leave.md delete mode 100644 .changeset/pink-apricots-fix.md delete mode 100644 .changeset/short-worms-argue.md delete mode 100644 .changeset/silver-poems-brush.md delete mode 100644 .changeset/small-jokes-lay.md delete mode 100644 .changeset/stale-coats-joke.md delete mode 100644 .changeset/swift-suits-smoke.md delete mode 100644 .changeset/thick-keys-worry.md delete mode 100644 .changeset/young-chefs-live.md create mode 100644 packages/example-pages-functions-app/CHANGELOG.md diff --git a/.changeset/angry-items-serve.md b/.changeset/angry-items-serve.md deleted file mode 100644 index 4598b22aa632..000000000000 --- a/.changeset/angry-items-serve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wrangler": patch ---- - -fix: do not warn about miniflare in the configuration diff --git a/.changeset/blue-nails-unite.md b/.changeset/blue-nails-unite.md deleted file mode 100644 index 0885df375d39..000000000000 --- a/.changeset/blue-nails-unite.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -fix: use `expiration_ttl` to expire assets with `[site]` - -This switches how we expire static assets with `[site]` uploads to use `expiration_ttl` instead of `expiration`. This is because we can't trust the time that a deploy target may provide (like in https://github.com/cloudflare/wrangler/issues/2224). diff --git a/.changeset/clean-swans-attend.md b/.changeset/clean-swans-attend.md deleted file mode 100644 index 22bee5769fb0..000000000000 --- a/.changeset/clean-swans-attend.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"wrangler": patch ---- - -Force-open a chromium-based browser for devtools - -We rely on Chromium-based devtools for debugging workers, so when opening up the devtools URL, -we should force a chromium-based browser to launch. For now, this means checking (in order) -for Chrome and Edge, and then failing if neither of those are available. diff --git a/.changeset/clean-trainers-clap.md b/.changeset/clean-trainers-clap.md deleted file mode 100644 index c2b4ef56d682..000000000000 --- a/.changeset/clean-trainers-clap.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"wrangler": patch ---- - -fix: consolidate `getEntry()` logic - -This consolidates some logic into `getEntry()`, namely including `guessWorkerFormat()` and custom builds. This simplifies the code for both `dev` and `publish`. - -- Previously, the implementation of custom builds inside `dev` assumed it could be a long running process; however it's not (else consider that `publish` would never work). -- By running custom builds inside `getEntry()`, we can be certain that the entry point exists as we validate it and before we enter `dev`/`publish`, simplifying their internals -- We don't have to do periodic checks inside `wrangler dev` because it's now a one shot build (and always should have been) -- This expands test coverage a little for both `dev` and `publish`. -- The 'format' of a worker is intrinsic to its contents, so it makes sense to establish its value inside `getEntry()` -- This also means less async logic inside ``, which is always a good thing diff --git a/.changeset/clever-beers-poke.md b/.changeset/clever-beers-poke.md deleted file mode 100644 index 53498fccd217..000000000000 --- a/.changeset/clever-beers-poke.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wrangler": patch ---- - -Validate that if `route` exists in wrangler.toml, `routes` does not (and vice versa) diff --git a/.changeset/cyan-parrots-eat.md b/.changeset/cyan-parrots-eat.md deleted file mode 100644 index 19244fe5a321..000000000000 --- a/.changeset/cyan-parrots-eat.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"wrangler": patch ---- - -fix: add warning about setting upstream-protocol to `http` - -We have not implemented setting upstream-protocol to `http` and currently do not intend to. - -This change just adds a warning if a developer tries to do so and provides a link to an issue where they can add their use-case. diff --git a/.changeset/dull-fishes-lay.md b/.changeset/dull-fishes-lay.md deleted file mode 100644 index c70e14d13d32..000000000000 --- a/.changeset/dull-fishes-lay.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -"wrangler": patch ---- - -feat: support wrangler 1.x module specifiers with a deprecation warning - -This implements wrangler 1.x style module specifiers, but also logs a deprecation warning for every usage. - -Consider a project like so: - -``` - project - ├── index.js - └── some-dependency.js -``` - -where the content of `index.js` is: - -```jsx -import SomeDependency from "some-dependency.js"; -addEventListener("fetch", (event) => { - // ... -}); -``` - -`wrangler` 1.x would resolve `import SomeDependency from "some-dependency.js";` to the file `some-dependency.js`. This will work in `wrangler` v2, but it will log a deprecation warning. Instead, you should rewrite the import to specify that it's a relative path, like so: - -```diff -- import SomeDependency from "some-dependency.js"; -+ import SomeDependency from "./some-dependency.js"; -``` - -In a near future version, this will become a breaking deprecation and throw an error. - -(This also updates `workers-chat-demo` to use the older style specifier, since that's how it currently is at https://github.com/cloudflare/workers-chat-demo) - -Known issue: This might not work as expected with `.js`/`.cjs`/`.mjs` files as expected, but that's something to be fixed overall with the module system. - -Closes https://github.com/cloudflare/wrangler2/issues/586 diff --git a/.changeset/eighty-worms-thank.md b/.changeset/eighty-worms-thank.md deleted file mode 100644 index f13c1b7ea7d9..000000000000 --- a/.changeset/eighty-worms-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wrangler": patch ---- - -feat: Incomplete subcommands render a help message for that specific subcommand. diff --git a/.changeset/famous-pets-complain.md b/.changeset/famous-pets-complain.md deleted file mode 100644 index e9e4850f9016..000000000000 --- a/.changeset/famous-pets-complain.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"wrangler": patch ---- - -feat: support adding secrets in non-interactive mode - -Now the user can pipe in the secret value to the `wrangler secret put` command. -For example: - -``` -cat my-secret.txt | wrangler secret put secret-key --name worker-name -``` - -This requires that the user is logged in, and has only one account, or that the `account_id` has been set in `wrangler.toml`. - -Fixes #170 diff --git a/.changeset/fluffy-cameras-greet.md b/.changeset/fluffy-cameras-greet.md deleted file mode 100644 index 283cb8678711..000000000000 --- a/.changeset/fluffy-cameras-greet.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"wrangler": patch ---- - -Deprecate `wrangler route`, `wrangler route list`, and `wrangler route delete` - -Users should instead modify their wrangler.toml or use the `--routes` flag when publishing -to manage routes. diff --git a/.changeset/giant-sloths-fail.md b/.changeset/giant-sloths-fail.md deleted file mode 100644 index dd4090751048..000000000000 --- a/.changeset/giant-sloths-fail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wrangler": patch ---- - -Request Pages OAuth scopes when logging in diff --git a/.changeset/gold-readers-grin.md b/.changeset/gold-readers-grin.md deleted file mode 100644 index 4311669aded0..000000000000 --- a/.changeset/gold-readers-grin.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -polish: add a small banner for commands - -This adds a small banner for most commands. Specifically, we avoid any commands that maybe used as a parse input (like json into jq). The banner itself simply says "⛅️ wrangler" with an orange underline. diff --git a/.changeset/good-beans-cheer.md b/.changeset/good-beans-cheer.md deleted file mode 100644 index b3eaea9618f1..000000000000 --- a/.changeset/good-beans-cheer.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -"wrangler": patch ---- - -fix: resolve modules correctly in `wrangler dev --local` - -This is an alternate fix to https://github.com/cloudflare/miniflare/pull/205, and fixes the error where miniflare would get confused resolving relative modules on macs because of `/var`/`/private/var` being symlinks. Instead, we `realpathSync` the bundle path before passing it on to miniflare, and that appears to fix the problem. - -Test plan: - -``` -cd packages/wrangler -npm run build -cd ../workers-chat-demo -npx wrangler dev --local -``` - -Fixes https://github.com/cloudflare/wrangler2/issues/443 diff --git a/.changeset/itchy-bobcats-hug.md b/.changeset/itchy-bobcats-hug.md deleted file mode 100644 index 09dc7ea0e518..000000000000 --- a/.changeset/itchy-bobcats-hug.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -"wrangler": patch ---- - -Stop reporting breadcrumbs to sentry - -Sentry's SDK automatically tracks "breadcrumbs", which are pieces of information -that get tracked leading up to an exception. This can be useful for debugging -errors because it gives better insight into what happens before an error occurs, -so you can more easily understand and recreate exactly what happened before an -error occurred. - -Unfortunately, Sentry automatically includes all `console` statements. And since -we use the console a lot (e.g. logging every request received in `wrangler dev`), -this is mostly useless. Additionally, since developers frequently use the console -to debug their workers we end up with a bunch of data that is not only irrelevant -to the reported error, but also contains data that could be potentially sensitive. - -For now, we're turning off breadcrumbs entirely. Later, we might wish to add our -own breadcrumbs manually (e.g. add a "wrangler dev" breadcrumb when a user runs -`wrangler dev`), at which point we can selectively enable breadcrumbs to catch -only the ones we've put in there ourselves. diff --git a/.changeset/large-pillows-clap.md b/.changeset/large-pillows-clap.md deleted file mode 100644 index 56e9a5952842..000000000000 --- a/.changeset/large-pillows-clap.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"wrangler": patch ---- - -fix: improve authentication logging and warnings - -- If a user has previously logged in via Wrangler 1 with an API token, we now display a helpful warning. -- When logging in and out, we no longer display the path to the internal user auh config file. -- When logging in, we now display an initial message to indicate the authentication flow is starting. - -Fixes [#526](https://github.com/cloudflare/wrangler2/issues/526) diff --git a/.changeset/late-crabs-care.md b/.changeset/late-crabs-care.md deleted file mode 100644 index cdeb789f7bc1..000000000000 --- a/.changeset/late-crabs-care.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"wrangler": patch ---- - -fix: Ensure generateConfigFromFileTree generates config correctly for multiple splats - -Functions with multiple parameters, like /near/[latitude]/[longitude].ts wouldn't work. This -fixes that. diff --git a/.changeset/lemon-fireants-kneel.md b/.changeset/lemon-fireants-kneel.md deleted file mode 100644 index e37dbc028596..000000000000 --- a/.changeset/lemon-fireants-kneel.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"wrangler": patch ---- - -feat: add support for `--local-protocol=https` to `wrangler dev` - -This change adds full support for the setting the protocol that the localhost proxy server listens to. -Previously, it was only possible to use `HTTP`. But now you can set it to `HTTPS` as well. - -To support `HTTPS`, Wrangler needs an SSL certificate. -Wrangler now generates a self-signed certificate, as needed, and caches it in the `~/.wrangler/local-cert` directory. -These certificates expire after 30 days and are regenerated by Wrangler as needed. - -Note that if you use HTTPS then your browser will complain about the self-signed and you must tell it to accept the certificate before it will let you access the page. diff --git a/.changeset/lemon-radios-sparkle.md b/.changeset/lemon-radios-sparkle.md deleted file mode 100644 index c28ed4a29da7..000000000000 --- a/.changeset/lemon-radios-sparkle.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"wrangler": patch ---- - -refactor: initialize the user auth state synchronously - -We can now initialize the user state synchronously, which means that -we can remove the checks for whether it has been done or not in each -of the user auth functions. diff --git a/.changeset/lemon-teachers-sip.md b/.changeset/lemon-teachers-sip.md deleted file mode 100644 index c5c0d4c54e8a..000000000000 --- a/.changeset/lemon-teachers-sip.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wrangler": patch ---- - -fix: validate that local_protocol and upstream_protocol can only take "http" or "https" diff --git a/.changeset/nice-jars-teach.md b/.changeset/nice-jars-teach.md deleted file mode 100644 index 02ee6e17a84f..000000000000 --- a/.changeset/nice-jars-teach.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"wrangler": patch ---- - -Show an actionable error message when publishing to a workers.dev subdomain that hasn't been created yet. - -When publishing a worker to workers.dev, you need to first have registered your workers.dev subdomain -(e.g. my-subdomain.workers.dev). We now check to ensure that the user has created their subdomain before -uploading a worker to workers.dev, and if they haven't, we provide a link to where they can go through -the workers onboarding flow and create one. diff --git a/.changeset/olive-seahorses-sleep.md b/.changeset/olive-seahorses-sleep.md deleted file mode 100644 index acebac875c2c..000000000000 --- a/.changeset/olive-seahorses-sleep.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"wrangler": patch ---- - -fix: error if a non-legacy service environment tries to define a worker name - -Given that service environments all live off the same worker, it doesn't make sense -for them to have different names. - -This change adds validation to tell the developer to remove such `name` fields in -service environment config. - -Fixes #623 diff --git a/.changeset/perfect-cars-leave.md b/.changeset/perfect-cars-leave.md deleted file mode 100644 index 3877e0945cea..000000000000 --- a/.changeset/perfect-cars-leave.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"wrangler": patch ---- - -fix: default `watch_dir` to `src` of project directory - -Via wrangler 1, when using custom builds in `wrangler dev`, `watch_dir` should default to `src` of the "project directory" (i.e - wherever the `wrangler.toml` is defined if it exists, else in the cwd. - -Fixes https://github.com/cloudflare/wrangler2/issues/631 diff --git a/.changeset/pink-apricots-fix.md b/.changeset/pink-apricots-fix.md deleted file mode 100644 index 2a3b0e8640e9..000000000000 --- a/.changeset/pink-apricots-fix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"example-pages-functions-app": patch ---- - -Added a Pages Functions example project for tests diff --git a/.changeset/short-worms-argue.md b/.changeset/short-worms-argue.md deleted file mode 100644 index c35780b240a9..000000000000 --- a/.changeset/short-worms-argue.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"wrangler": patch ---- - -fix: stop checking for open port once it has timed out in `waitForPortToBeAvailable()` - -Previously, if `waitForPortToBeAvailable()` timed out, the `checkPort()` -function would continue to be called. -Now we clean up fully once the promise is resolved or rejected. diff --git a/.changeset/silver-poems-brush.md b/.changeset/silver-poems-brush.md deleted file mode 100644 index 7ef43c7a2e72..000000000000 --- a/.changeset/silver-poems-brush.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wrangler": patch ---- - -fix: use environment specific and inherited config values in `publish` diff --git a/.changeset/small-jokes-lay.md b/.changeset/small-jokes-lay.md deleted file mode 100644 index e1112e1cbf65..000000000000 --- a/.changeset/small-jokes-lay.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -fix: `config.site.entry-point` as a breaking deprecation - -This makes configuring `site.entry-point` in config as a breaking deprecation, and throws an error. We do this because existing apps with `site.entry-point` _won't_ work in v2. diff --git a/.changeset/stale-coats-joke.md b/.changeset/stale-coats-joke.md deleted file mode 100644 index 8ccff7da53c7..000000000000 --- a/.changeset/stale-coats-joke.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -fix: gracefully fail if we can't create `~/.wrangler/reporting.toml` - -In some scenarios (CI/CD, docker, etc), we won't have write access to `~/.wrangler`. We already don't write a configuration file there if one passes a `CF_API_TOKEN`/`CLOUDFLARE_API_TOKEN` env var. This also adds a guard when writing the error reporting configuration file. diff --git a/.changeset/swift-suits-smoke.md b/.changeset/swift-suits-smoke.md deleted file mode 100644 index 4bc9326b6066..000000000000 --- a/.changeset/swift-suits-smoke.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"wrangler": patch ---- - -fix: check for the correct inspector port in local dev - -Previously, the `useLocalWorker()` hook was being passed the wrong port for the `inspectorPort` prop. - -Once this was fixed, it became apparent that we were waiting for the port to become free in the wrong place, since this port is already being listened to in `useInspector()` by the time we were starting the check. - -Now, the check to see if the inspector port is free is done in `useInspector()`, -which also means that `Remote` benefits from this check too. diff --git a/.changeset/thick-keys-worry.md b/.changeset/thick-keys-worry.md deleted file mode 100644 index bb2041535e25..000000000000 --- a/.changeset/thick-keys-worry.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"wrangler": patch ---- - -feat: expire unused assets in `[site]` uploads - -This expires any previously uploaded assets when using a Sites / `[site]` configuration. Because we currently do a full iteration of a namespace's keys when publishing, for rapidly changing sites this means that uploads get slower and slower. We can't just delete unused assets because it leads to occasional 404s on older publishes while we're publishing. So we expire previous assets while uploading new ones. The implementation/constraints of the kv api means that uploads may become slower, but should hopefully be faster overall. These optimisations also only matter for rapidly changing sites, so common usecases still have the same perf characteristics. diff --git a/.changeset/young-chefs-live.md b/.changeset/young-chefs-live.md deleted file mode 100644 index 73c7df5bec32..000000000000 --- a/.changeset/young-chefs-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"wrangler": patch ---- - -fix: improve validation error message for fields that must be one of a selection of choices diff --git a/package-lock.json b/package-lock.json index 0c7cdd986eef..7d5f46d085a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17362,7 +17362,7 @@ "version": "1.0.0" }, "packages/wrangler": { - "version": "0.0.19", + "version": "0.0.20", "license": "MIT OR Apache-2.0", "dependencies": { "esbuild": "0.14.23", diff --git a/packages/example-pages-functions-app/CHANGELOG.md b/packages/example-pages-functions-app/CHANGELOG.md new file mode 100644 index 000000000000..4e0aa838e1b1 --- /dev/null +++ b/packages/example-pages-functions-app/CHANGELOG.md @@ -0,0 +1,8 @@ +# example-pages-functions-app + +## null +### Patch Changes + + + +- [#617](https://github.com/cloudflare/wrangler2/pull/617) [`8c98c00`](https://github.com/cloudflare/wrangler2/commit/8c98c008a8f80ab92bff6425312a170d7e582533) Thanks [@GregBrimble](https://github.com/GregBrimble)! - Added a Pages Functions example project for tests diff --git a/packages/example-pages-functions-app/package.json b/packages/example-pages-functions-app/package.json index 5cf3df8f77fd..362b7661503d 100644 --- a/packages/example-pages-functions-app/package.json +++ b/packages/example-pages-functions-app/package.json @@ -29,5 +29,6 @@ } ] } - } + }, + "version": null } diff --git a/packages/wrangler/CHANGELOG.md b/packages/wrangler/CHANGELOG.md index ba483f666d73..213cdd96f7df 100644 --- a/packages/wrangler/CHANGELOG.md +++ b/packages/wrangler/CHANGELOG.md @@ -1,5 +1,222 @@ # wrangler +## 0.0.20 + +### Patch Changes + +- [#627](https://github.com/cloudflare/wrangler2/pull/627) [`ff53f4e`](https://github.com/cloudflare/wrangler2/commit/ff53f4e88a062936c4ae9a390307583017dbbb29) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: do not warn about miniflare in the configuration + +* [#649](https://github.com/cloudflare/wrangler2/pull/649) [`e0b9366`](https://github.com/cloudflare/wrangler2/commit/e0b93661a7160e718b4fc0c58fa90149968d4317) Thanks [@threepointone](https://github.com/threepointone)! - fix: use `expiration_ttl` to expire assets with `[site]` + + This switches how we expire static assets with `[site]` uploads to use `expiration_ttl` instead of `expiration`. This is because we can't trust the time that a deploy target may provide (like in https://github.com/cloudflare/wrangler/issues/2224). + +- [#599](https://github.com/cloudflare/wrangler2/pull/599) [`7d4ea43`](https://github.com/cloudflare/wrangler2/commit/7d4ea4342947128eb156a58da69dd008d504103b) Thanks [@caass](https://github.com/caass)! - Force-open a chromium-based browser for devtools + + We rely on Chromium-based devtools for debugging workers, so when opening up the devtools URL, + we should force a chromium-based browser to launch. For now, this means checking (in order) + for Chrome and Edge, and then failing if neither of those are available. + +* [#567](https://github.com/cloudflare/wrangler2/pull/567) [`05b81c5`](https://github.com/cloudflare/wrangler2/commit/05b81c5809b9ceed10d0c21c0f5f5de76b23a67d) Thanks [@threepointone](https://github.com/threepointone)! - fix: consolidate `getEntry()` logic + + This consolidates some logic into `getEntry()`, namely including `guessWorkerFormat()` and custom builds. This simplifies the code for both `dev` and `publish`. + + - Previously, the implementation of custom builds inside `dev` assumed it could be a long running process; however it's not (else consider that `publish` would never work). + - By running custom builds inside `getEntry()`, we can be certain that the entry point exists as we validate it and before we enter `dev`/`publish`, simplifying their internals + - We don't have to do periodic checks inside `wrangler dev` because it's now a one shot build (and always should have been) + - This expands test coverage a little for both `dev` and `publish`. + - The 'format' of a worker is intrinsic to its contents, so it makes sense to establish its value inside `getEntry()` + - This also means less async logic inside ``, which is always a good thing + +- [#628](https://github.com/cloudflare/wrangler2/pull/628) [`b640ab5`](https://github.com/cloudflare/wrangler2/commit/b640ab514a9a62ffd3ee63438354ea167e80c873) Thanks [@caass](https://github.com/caass)! - Validate that if `route` exists in wrangler.toml, `routes` does not (and vice versa) + +* [#591](https://github.com/cloudflare/wrangler2/pull/591) [`42c2c0f`](https://github.com/cloudflare/wrangler2/commit/42c2c0fda6820dc7b8c0005857459d55ec82d266) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: add warning about setting upstream-protocol to `http` + + We have not implemented setting upstream-protocol to `http` and currently do not intend to. + + This change just adds a warning if a developer tries to do so and provides a link to an issue where they can add their use-case. + +- [#596](https://github.com/cloudflare/wrangler2/pull/596) [`187264d`](https://github.com/cloudflare/wrangler2/commit/187264d4013842df4062a1e0f5dd8cef0b30d0a8) Thanks [@threepointone](https://github.com/threepointone)! - feat: support wrangler 1.x module specifiers with a deprecation warning + + This implements wrangler 1.x style module specifiers, but also logs a deprecation warning for every usage. + + Consider a project like so: + + ``` + project + ├── index.js + └── some-dependency.js + ``` + + where the content of `index.js` is: + + ```jsx + import SomeDependency from "some-dependency.js"; + addEventListener("fetch", event => { + // ... + }); + ``` + + `wrangler` 1.x would resolve `import SomeDependency from "some-dependency.js";` to the file `some-dependency.js`. This will work in `wrangler` v2, but it will log a deprecation warning. Instead, you should rewrite the import to specify that it's a relative path, like so: + + ```diff + - import SomeDependency from "some-dependency.js"; + + import SomeDependency from "./some-dependency.js"; + ``` + + In a near future version, this will become a breaking deprecation and throw an error. + + (This also updates `workers-chat-demo` to use the older style specifier, since that's how it currently is at https://github.com/cloudflare/workers-chat-demo) + + Known issue: This might not work as expected with `.js`/`.cjs`/`.mjs` files as expected, but that's something to be fixed overall with the module system. + + Closes https://github.com/cloudflare/wrangler2/issues/586 + +* [#579](https://github.com/cloudflare/wrangler2/pull/579) [`2f0e59b`](https://github.com/cloudflare/wrangler2/commit/2f0e59bed76676f088403c7f0ceb9046668c547d) Thanks [@JacobMGEvans](https://github.com/JacobMGEvans)! - feat: Incomplete subcommands render a help message for that specific subcommand. + +- [#559](https://github.com/cloudflare/wrangler2/pull/559) [`16fb5e6`](https://github.com/cloudflare/wrangler2/commit/16fb5e686024aba614d805a4edb49fb53a8e32db) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - feat: support adding secrets in non-interactive mode + + Now the user can pipe in the secret value to the `wrangler secret put` command. + For example: + + ``` + cat my-secret.txt | wrangler secret put secret-key --name worker-name + ``` + + This requires that the user is logged in, and has only one account, or that the `account_id` has been set in `wrangler.toml`. + + Fixes #170 + +* [#597](https://github.com/cloudflare/wrangler2/pull/597) [`94c2698`](https://github.com/cloudflare/wrangler2/commit/94c2698cd6d62ec7cb69530697f2eac2bf068163) Thanks [@caass](https://github.com/caass)! - Deprecate `wrangler route`, `wrangler route list`, and `wrangler route delete` + + Users should instead modify their wrangler.toml or use the `--routes` flag when publishing + to manage routes. + +- [#564](https://github.com/cloudflare/wrangler2/pull/564) [`ffd5c0d`](https://github.com/cloudflare/wrangler2/commit/ffd5c0d1b93871e751371bf45498bfc468fa5b84) Thanks [@GregBrimble](https://github.com/GregBrimble)! - Request Pages OAuth scopes when logging in + +* [#638](https://github.com/cloudflare/wrangler2/pull/638) [`06f9278`](https://github.com/cloudflare/wrangler2/commit/06f9278d69dfe137ed9837e29bbf48bbd364e8c1) Thanks [@threepointone](https://github.com/threepointone)! - polish: add a small banner for commands + + This adds a small banner for most commands. Specifically, we avoid any commands that maybe used as a parse input (like json into jq). The banner itself simply says "⛅️ wrangler" with an orange underline. + +- [#561](https://github.com/cloudflare/wrangler2/pull/561) [`6e9a219`](https://github.com/cloudflare/wrangler2/commit/6e9a219f53b7d13bee94c8468846553df48c72c3) Thanks [@threepointone](https://github.com/threepointone)! - fix: resolve modules correctly in `wrangler dev --local` + + This is an alternate fix to https://github.com/cloudflare/miniflare/pull/205, and fixes the error where miniflare would get confused resolving relative modules on macs because of `/var`/`/private/var` being symlinks. Instead, we `realpathSync` the bundle path before passing it on to miniflare, and that appears to fix the problem. + + Test plan: + + ``` + cd packages/wrangler + npm run build + cd ../workers-chat-demo + npx wrangler dev --local + ``` + + Fixes https://github.com/cloudflare/wrangler2/issues/443 + +* [#592](https://github.com/cloudflare/wrangler2/pull/592) [`56886cf`](https://github.com/cloudflare/wrangler2/commit/56886cfc7edf02cf0ae029f380a517c0142fd467) Thanks [@caass](https://github.com/caass)! - Stop reporting breadcrumbs to sentry + + Sentry's SDK automatically tracks "breadcrumbs", which are pieces of information + that get tracked leading up to an exception. This can be useful for debugging + errors because it gives better insight into what happens before an error occurs, + so you can more easily understand and recreate exactly what happened before an + error occurred. + + Unfortunately, Sentry automatically includes all `console` statements. And since + we use the console a lot (e.g. logging every request received in `wrangler dev`), + this is mostly useless. Additionally, since developers frequently use the console + to debug their workers we end up with a bunch of data that is not only irrelevant + to the reported error, but also contains data that could be potentially sensitive. + + For now, we're turning off breadcrumbs entirely. Later, we might wish to add our + own breadcrumbs manually (e.g. add a "wrangler dev" breadcrumb when a user runs + `wrangler dev`), at which point we can selectively enable breadcrumbs to catch + only the ones we've put in there ourselves. + +- [#645](https://github.com/cloudflare/wrangler2/pull/645) [`61aea30`](https://github.com/cloudflare/wrangler2/commit/61aea3052f90dc7a05f77dd2d60e8b32af143a83) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: improve authentication logging and warnings + + - If a user has previously logged in via Wrangler 1 with an API token, we now display a helpful warning. + - When logging in and out, we no longer display the path to the internal user auh config file. + - When logging in, we now display an initial message to indicate the authentication flow is starting. + + Fixes [#526](https://github.com/cloudflare/wrangler2/issues/526) + +* [#608](https://github.com/cloudflare/wrangler2/pull/608) [`a7fa544`](https://github.com/cloudflare/wrangler2/commit/a7fa544f4050f2b2eea573fcac784b148de25bc6) Thanks [@sidharthachatterjee](https://github.com/sidharthachatterjee)! - fix: Ensure generateConfigFromFileTree generates config correctly for multiple splats + + Functions with multiple parameters, like /near/[latitude]/[longitude].ts wouldn't work. This + fixes that. + +- [#580](https://github.com/cloudflare/wrangler2/pull/580) [`8013e0a`](https://github.com/cloudflare/wrangler2/commit/8013e0a86cb309f912bd1068725d4a5535795082) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - feat: add support for `--local-protocol=https` to `wrangler dev` + + This change adds full support for the setting the protocol that the localhost proxy server listens to. + Previously, it was only possible to use `HTTP`. But now you can set it to `HTTPS` as well. + + To support `HTTPS`, Wrangler needs an SSL certificate. + Wrangler now generates a self-signed certificate, as needed, and caches it in the `~/.wrangler/local-cert` directory. + These certificates expire after 30 days and are regenerated by Wrangler as needed. + + Note that if you use HTTPS then your browser will complain about the self-signed and you must tell it to accept the certificate before it will let you access the page. + +* [#639](https://github.com/cloudflare/wrangler2/pull/639) [`5161e1e`](https://github.com/cloudflare/wrangler2/commit/5161e1e85c4cb6604c54a791301e38cb90e57632) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - refactor: initialize the user auth state synchronously + + We can now initialize the user state synchronously, which means that + we can remove the checks for whether it has been done or not in each + of the user auth functions. + +- [#580](https://github.com/cloudflare/wrangler2/pull/580) [`aaac8dd`](https://github.com/cloudflare/wrangler2/commit/aaac8ddfda9658a2cb35b757518ee085a994dfe5) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: validate that local_protocol and upstream_protocol can only take "http" or "https" + +* [#568](https://github.com/cloudflare/wrangler2/pull/568) [`b6f2266`](https://github.com/cloudflare/wrangler2/commit/b6f226624417ffa4b5e7c3098d4955bc23d58603) Thanks [@caass](https://github.com/caass)! - Show an actionable error message when publishing to a workers.dev subdomain that hasn't been created yet. + + When publishing a worker to workers.dev, you need to first have registered your workers.dev subdomain + (e.g. my-subdomain.workers.dev). We now check to ensure that the user has created their subdomain before + uploading a worker to workers.dev, and if they haven't, we provide a link to where they can go through + the workers onboarding flow and create one. + +- [#641](https://github.com/cloudflare/wrangler2/pull/641) [`21ee93e`](https://github.com/cloudflare/wrangler2/commit/21ee93e40ad5870328f22f106113ffc88a212894) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: error if a non-legacy service environment tries to define a worker name + + Given that service environments all live off the same worker, it doesn't make sense + for them to have different names. + + This change adds validation to tell the developer to remove such `name` fields in + service environment config. + + Fixes #623 + +* [#646](https://github.com/cloudflare/wrangler2/pull/646) [`c75cfb8`](https://github.com/cloudflare/wrangler2/commit/c75cfb83df4c98d6f678535439483948ce9fff5b) Thanks [@threepointone](https://github.com/threepointone)! - fix: default `watch_dir` to `src` of project directory + + Via wrangler 1, when using custom builds in `wrangler dev`, `watch_dir` should default to `src` of the "project directory" (i.e - wherever the `wrangler.toml` is defined if it exists, else in the cwd. + + Fixes https://github.com/cloudflare/wrangler2/issues/631 + +- [#621](https://github.com/cloudflare/wrangler2/pull/621) [`e452a04`](https://github.com/cloudflare/wrangler2/commit/e452a041fbe7439eff88ab34a1d2124ee0dff40a) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: stop checking for open port once it has timed out in `waitForPortToBeAvailable()` + + Previously, if `waitForPortToBeAvailable()` timed out, the `checkPort()` + function would continue to be called. + Now we clean up fully once the promise is resolved or rejected. + +* [#600](https://github.com/cloudflare/wrangler2/pull/600) [`1bbd834`](https://github.com/cloudflare/wrangler2/commit/1bbd8340d2f9868e6384e2ef58e6f73ec6b6dda7) Thanks [@skirsten](https://github.com/skirsten)! - fix: use environment specific and inherited config values in `publish` + +- [#577](https://github.com/cloudflare/wrangler2/pull/577) [`7faf0eb`](https://github.com/cloudflare/wrangler2/commit/7faf0ebec1aa92f64c1a1d0d702d03f4cfa868cd) Thanks [@threepointone](https://github.com/threepointone)! - fix: `config.site.entry-point` as a breaking deprecation + + This makes configuring `site.entry-point` in config as a breaking deprecation, and throws an error. We do this because existing apps with `site.entry-point` _won't_ work in v2. + +* [#578](https://github.com/cloudflare/wrangler2/pull/578) [`c56847c`](https://github.com/cloudflare/wrangler2/commit/c56847cb261e9899d60b50599f910efa9cefdee9) Thanks [@threepointone](https://github.com/threepointone)! - fix: gracefully fail if we can't create `~/.wrangler/reporting.toml` + + In some scenarios (CI/CD, docker, etc), we won't have write access to `~/.wrangler`. We already don't write a configuration file there if one passes a `CF_API_TOKEN`/`CLOUDFLARE_API_TOKEN` env var. This also adds a guard when writing the error reporting configuration file. + +- [#621](https://github.com/cloudflare/wrangler2/pull/621) [`e452a04`](https://github.com/cloudflare/wrangler2/commit/e452a041fbe7439eff88ab34a1d2124ee0dff40a) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: check for the correct inspector port in local dev + + Previously, the `useLocalWorker()` hook was being passed the wrong port for the `inspectorPort` prop. + + Once this was fixed, it became apparent that we were waiting for the port to become free in the wrong place, since this port is already being listened to in `useInspector()` by the time we were starting the check. + + Now, the check to see if the inspector port is free is done in `useInspector()`, + which also means that `Remote` benefits from this check too. + +* [#587](https://github.com/cloudflare/wrangler2/pull/587) [`49869a3`](https://github.com/cloudflare/wrangler2/commit/49869a367d5f5dc71c9f48e0daf1f5047b482185) Thanks [@threepointone](https://github.com/threepointone)! - feat: expire unused assets in `[site]` uploads + + This expires any previously uploaded assets when using a Sites / `[site]` configuration. Because we currently do a full iteration of a namespace's keys when publishing, for rapidly changing sites this means that uploads get slower and slower. We can't just delete unused assets because it leads to occasional 404s on older publishes while we're publishing. So we expire previous assets while uploading new ones. The implementation/constraints of the kv api means that uploads may become slower, but should hopefully be faster overall. These optimisations also only matter for rapidly changing sites, so common usecases still have the same perf characteristics. + +- [#580](https://github.com/cloudflare/wrangler2/pull/580) [`9ef36a9`](https://github.com/cloudflare/wrangler2/commit/9ef36a903988d3c18982186ca272ff4d026ad8b2) Thanks [@petebacondarwin](https://github.com/petebacondarwin)! - fix: improve validation error message for fields that must be one of a selection of choices + ## 0.0.19 ### Patch Changes diff --git a/packages/wrangler/package.json b/packages/wrangler/package.json index 583115e8dac7..9344718b56b1 100644 --- a/packages/wrangler/package.json +++ b/packages/wrangler/package.json @@ -1,6 +1,6 @@ { "name": "wrangler", - "version": "0.0.19", + "version": "0.0.20", "author": "wrangler@cloudflare.com", "description": "Command-line interface for all things Cloudflare Workers", "bin": {