Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleymichal committed Feb 5, 2020
1 parent c03e442 commit f8ad9d0
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 68 deletions.
122 changes: 122 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,127 @@
# Changelog

## 💬 1.7.0

- ### Features

- **Do not factor in .gitignore into workers sites upload directory traversal - [gabbifish], [issue/958] [pull/981]**

This change ensures that the wrangler include/exclude logic for Workers Sites bucket directory traversal does NOT take into account .gitignore, since best practice for static site generators is to put your build directory into your .gitignore.

[gabbifish]: https://github.com/gabbifish
[pull/981]: https://github.com/cloudflare/wrangler/pull/981
[issue/958]: https://github.com/cloudflare/wrangler/issues/958

- **Update cloudflare-rs, reqwest, http, uuid - [ashleymichal], [issue/301] [pull/1009]**

These dependency updates may look like routine maintenance, but this reqwest version actually makes support for corporate proxies possible!

[ashleymichal]: https://github.com/ashleymichal
[pull/1009]: https://github.com/cloudflare/wrangler/pull/1009
[issue/301]: https://github.com/cloudflare/wrangler/issues/301

- **Add progress bar during Site upload - [gabbifish], [issue/906] [pull/956]**

Larger static asset uploads in Wrangler now show a progress bar based on the bulk uploads being made.

[gabbifish]: https://github.com/gabbifish
[pull/956]: https://github.com/cloudflare/wrangler/pull/956
[issue/906]: https://github.com/cloudflare/wrangler/issues/906

- **Allow custom webpack config for Workers Sites projects - [ashleymichal], [issue/905] [pull/957]**

Previously we blocked users from declaring `webpack_config` in their `wrangler.toml`, as it can be relatively confusing due to the nested nature of the workers-site directory. We removed that block, and added a friendly help message when webpack build fails and the user has a custom `webpack_config` declared.

[ashleymichal]: https://github.com/ashleymichal
[pull/957]: https://github.com/cloudflare/wrangler/pull/957
[issue/905]: https://github.com/cloudflare/wrangler/issues/905

- **Reformat config api-key output - [bradyjoslin], [issue/889] [pull/910]**

We care a lot about our error output. Now the output from `wrangler config` is consistent between calls with and without the `--api-key` flag.

[bradyjoslin]: https://github.com/bradyjoslin
[pull/910]: https://github.com/cloudflare/wrangler/pull/910
[issue/889]: https://github.com/cloudflare/wrangler/issues/889

- **Improve error message for `wrangler init --site` when wrangler.toml already exists - [ashleygwilliams], [issue/648] [pull/931]**

`wrangler init` generally expects that you don't already have a `wrangler.toml` present; however it is common that users want to add static site functionality to their existing wrangler project and will try using `wrangler init` to do so. Rather than simply complaining that the toml already exists, now we add the `workers-site` directory to the project, and print out the suggested configuration to add to `wrangler.toml`. Much nicer!

[ashleygwilliams]: https://github.com/ashleygwilliams
[pull/931]: https://github.com/cloudflare/wrangler/pull/931
[issue/648]: https://github.com/cloudflare/wrangler/issues/648

- **Add a helpful error message on authentication error - [EverlastingBugstopper], [issue/492] [pull/932]**

Previously, when `wrangler publish` ran into authentication errors, the API result would just print to the screen. Now, it prints a helpful hint to users to re-run `wrangler config` to fix the error.

[EverlastingBugstopper]: https://github.com/EverlastingBugstopper
[pull/932]: https://github.com/cloudflare/wrangler/pull/932
[issue/492]: https://github.com/cloudflare/wrangler/issues/492

- **Provide helpful error when user accidentally puts kv-namespace config under `[site]` - [gabbifish], [issue/798] [pull/937]**

TOML formatting can be tricky, specifically tables, so it is common for users unfamiliar with the format to accidentally nest attributes inside tables without intending it. In this case, if a user adds a kv-namespaces entry to the bottom of a toml with [site] configuration already declared, it is parsed as a part of the [site] table, rather than as a top-level key. The error output from this is not super helpful, as it just says "unknown field `kv-namespaces`" which isn't precisely correct.

This PR detects when this error occurs and provides a help suggestion to put kv-namespaces ABOVE the [site] table entry to fix the problem.

[gabbifish]: https://github.com/gabbifish
[pull/937]: https://github.com/cloudflare/wrangler/pull/937
[issue/798]: https://github.com/cloudflare/wrangler/issues/798

- ### Fixes

- **Don't install `wasm-pack` for `webpack` type projects - [EverlastingBugstopper], [issue/745] [pull/849]**

You may have noticed that Wrangler installs `wasm-pack` for your `webpack` projects, which may seem strange since it's the tool we use to build Rust projects. The reason for this is because you can _also_ build Rust using `wasm-pack` and `webpack` in tandem if you use the [`wasm-pack-plugin`](https://github.com/wasm-tool/wasm-pack-plugin). This plugin recently added support for handling the installation of `wasm-pack` which means Wrangler no longer needs to handle those installs.

[EverlastingBugstopper]: https://github.com/EverlastingBugstopper
[pull/849]: https://github.com/cloudflare/wrangler/pull/849
[issue/745]: https://github.com/cloudflare/wrangler/issues/745

- ### Maintenance

- **Make Azure use latest `rustc` - [EverlastingBugstopper], [issue/887] [pull/893]**

Updates our CI to update the rust toolchain to the latest stable version after installation.

[EverlastingBugstopper]: https://github.com/EverlastingBugstopper
[pull/893]: https://github.com/cloudflare/wrangler/pull/893
[issue/887]: https://github.com/cloudflare/wrangler/issues/887

- **Fix nightly builds - [EverlastingBugstopper], [pull/895], [pull/898]**

Now we confirm Wrangler builds against nightly Rust releases!

[EverlastingBugstopper]: https://github.com/EverlastingBugstopper
[pull/895]: https://github.com/cloudflare/wrangler/pull/895
[pull/898]: https://github.com/cloudflare/wrangler/pull/898

- **Fix compiler warnings on windows - [uma0317], [issue/800] [pull/919]**

We build Wrangler for Mac OSX, Linux, and Windows, and each of these environments has slightly different needs at compile time. In this case, community contributor [uma0317] added configuration that eliminated unused imports for Windows at compile time.

[uma0317]: https://github.com/uma0317
[pull/919]: https://github.com/cloudflare/wrangler/pull/919
[issue/800]: https://github.com/cloudflare/wrangler/issues/800

- **Remove deprecated kv-namespace config check - [ashleymichal], [pull/929]**

Back in 1.1.0, we introduced more robust support for adding KV namespaces to your project. It was a breaking change for users who were still using our first pass at configuration for this in their toml, so we added a friendly error message telling them how to update their `wrangler.toml`. At this point, all of our users have safely transitioned onto the new syntax, and so we removed the warning; any lingering use of the old syntax will be met with a parse error instead.

[ashleymichal]: https://github.com/ashleymichal
[pull/929]: https://github.com/cloudflare/wrangler/pull/929

- **Use binary-install for npm - [EverlastingBugstopper], [pull/862]**

This extracts a lot of the logic in Wrangler's installer to an external package, [binary-install], which we will also use for installing wasm-pack on webpack project builds. Switching to this package also has the added benefit of cleaning up the downloaded binary on `npm uninstall -g @cloudflare/wrangler`.

[EverlastingBugstopper]: https://github.com/EverlastingBugstopper
[pull/862]: https://github.com/cloudflare/wrangler/pull/862
[binary-install]: http://npmjs.org/package/binary-install


## 🎰 1.6.0

- ### Features
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wrangler"
version = "1.6.0"
version = "1.7.0"
authors = ["Ashley Williams <[email protected]>"]
edition = "2018"
license = "MIT/Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $ wrangler publish
```

All of the arguments and flags to this command are optional:

- `name`: defaults to `worker`
- `template`: defaults to the [`https://github.com/cloudflare/worker-template`](https://github.com/cloudflare/worker-template)
- `type`: defaults to ["webpack"](https://developers.cloudflare.com/workers/tooling/wrangler/webpack)
Expand Down Expand Up @@ -91,7 +91,7 @@ $ wrangler publish
```

You can also provide your email and global API key (this is not recommended for security reasons):

```bash
wrangler config --api-key
Enter email:
Expand Down Expand Up @@ -130,7 +130,7 @@ $ wrangler publish

All information regarding wrangler or Cloudflare Workers is located in the [Cloudflare Workers Developer Docs](https://developers.cloudflare.com/workers/). This includes:

- Using wrangler [commands](https://developers.cloudflare.com/workers/tooling/wrangler/commands)
- Using wrangler [commands](https://developers.cloudflare.com/workers/tooling/wrangler/commands)
- Wrangler [configuration](https://developers.cloudflare.com/workers/tooling/wrangler/configuration)
- General documentation surrounding Workers development
- All wrangler features such as Workers Sites and KV
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This is a list of the things that need to happen during a release.
1. Run `cargo build`.
1. Copy `README.md` to `npm/README.md`
1. Bump the version number in `npm/package.json`
1. `cd npm && npm install`
1. `cd npm && npm shrinkwrap`
1. Push up a commit with the `Cargo.toml`, `Cargo.lock`,
and `CHANGELOG.md` changes. The commit message can just be "#.#.#".
1. Request review from the @cloudflare/workers-devexp team.
Expand Down
97 changes: 49 additions & 48 deletions npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

[![crates.io](https://meritbadge.herokuapp.com/wrangler)](https://crates.io/crates/wrangler) &nbsp;
[![Build Status](https://dev.azure.com/ashleygwilliams/wrangler/_apis/build/status/cloudflare.wrangler?branchName=master)](https://dev.azure.com/ashleygwilliams/wrangler/_build/latest?definitionId=1&branchName=master)
[![Github Actions - Test Status](https://github.com/cloudflare/wrangler/workflows/Rust%20Tests/badge.svg)](https://github.com/cloudflare/wrangler/actions)

`wrangler` is a CLI tool designed for folks who are interested in using [Cloudflare Workers](https://workers.cloudflare.com/).

Expand Down Expand Up @@ -47,83 +48,83 @@ $ wrangler publish

### 👯 `generate`

Scaffold a project, including boilerplate code for a Rust library and a Cloudflare Worker.
Scaffold a project, including boilerplate code for a Rust library and a Cloudflare Worker.

```bash
wrangler generate <name> <template> --type=["webpack", "javascript", "rust"]
```
```bash
wrangler generate <name> <template> --type=["webpack", "javascript", "rust"]
```

All of the arguments and flags to this command are optional:
All of the arguments and flags to this command are optional:

- `name`: defaults to `worker`
- `template`: defaults to the [`https://github.com/cloudflare/worker-template`](https://github.com/cloudflare/worker-template)
- `type`: defaults to ["webpack"](https://developers.cloudflare.com/workers/tooling/wrangler/webpack)
- `name`: defaults to `worker`
- `template`: defaults to the [`https://github.com/cloudflare/worker-template`](https://github.com/cloudflare/worker-template)
- `type`: defaults to ["webpack"](https://developers.cloudflare.com/workers/tooling/wrangler/webpack)

### 📥 `init`

Creates a skeleton `wrangler.toml` in an existing directory. This can be used as an alternative to `generate` if you prefer to clone a repository yourself.
Creates a skeleton `wrangler.toml` in an existing directory. This can be used as an alternative to `generate` if you prefer to clone a repository yourself.

```bash
wrangler init <name> --type=["webpack", "javascript", "rust"]
```
```bash
wrangler init <name> --type=["webpack", "javascript", "rust"]
```

All of the arguments and flags to this command are optional:
All of the arguments and flags to this command are optional:

- `name`: defaults to the name of your working directory
- `type`: defaults to ["webpack"](https://developers.cloudflare.com/workers/tooling/wrangler/webpack).
- `name`: defaults to the name of your working directory
- `type`: defaults to ["webpack"](https://developers.cloudflare.com/workers/tooling/wrangler/webpack).

### 🦀⚙️ `build`

Build your project. This command looks at your `wrangler.toml` file and runs the build steps associated
with the `"type"` declared there.
Build your project. This command looks at your `wrangler.toml` file and runs the build steps associated
with the `"type"` declared there.

Additionally, you can configure different [environments](https://developers.cloudflare.com/workers/tooling/wrangler/configuration/environments).
Additionally, you can configure different [environments](https://developers.cloudflare.com/workers/tooling/wrangler/configuration/environments).

### 🔧 `config`

Configure your global Cloudflare user. This is an interactive command that will prompt you for your API token:
Configure your global Cloudflare user. This is an interactive command that will prompt you for your API token:

```bash
wrangler config
Enter API token:
superlongapitoken
```
```bash
wrangler config
Enter API token:
superlongapitoken
```

You can also provide your email and global API key (this is not recommended for security reasons):
You can also provide your email and global API key (this is not recommended for security reasons):

```bash
wrangler config --api-key
Enter email:
[email protected]
Enter global API key:
superlongapikey
```
```bash
wrangler config --api-key
Enter email:
[email protected]
Enter global API key:
superlongapikey
```

You can also [use environment variables](https://developers.cloudflare.com/workers/tooling/wrangler/configuration/) to configure these values.
You can also [use environment variables](https://developers.cloudflare.com/workers/tooling/wrangler/configuration/) to configure these values.

### ☁️ 🆙 `publish`

Publish your Worker to Cloudflare. Several keys in your `wrangler.toml` determine whether you are publishing to a workers.dev subdomain or your own registered domain, proxied through Cloudflare.
Publish your Worker to Cloudflare. Several keys in your `wrangler.toml` determine whether you are publishing to a workers.dev subdomain or your own registered domain, proxied through Cloudflare.

Additionally, you can configure different [environments](https://developers.cloudflare.com/workers/tooling/wrangler/configuration/environments).
Additionally, you can configure different [environments](https://developers.cloudflare.com/workers/tooling/wrangler/configuration/environments).

You can also use environment variables to handle authentication when you publish a Worker.
You can also use environment variables to handle authentication when you publish a Worker.

```bash
# e.g.
CF_API_TOKEN=superlongtoken wrangler publish
# where
# $CF_API_TOKEN -> your Cloudflare API token
```bash
# e.g.
CF_API_TOKEN=superlongtoken wrangler publish
# where
# $CF_API_TOKEN -> your Cloudflare API token

CF_API_KEY=superlongapikey [email protected] wrangler publish
# where
# $CF_API_KEY -> your Cloudflare API key
# $CF_EMAIL -> your Cloudflare account email
```
CF_API_KEY=superlongapikey [email protected] wrangler publish
# where
# $CF_API_KEY -> your Cloudflare API key
# $CF_EMAIL -> your Cloudflare account email
```

### 🗂 `kv`

Interact with your Workers KV store. This is actually a whole suite of subcommands. Read more about in [Wrangler KV Documentation](https://developers.cloudflare.com/workers/tooling/wrangler/kv_commands).
Interact with your Workers KV store. This is actually a whole suite of subcommands. Read more about in [Wrangler KV Documentation](https://developers.cloudflare.com/workers/tooling/wrangler/kv_commands).

## Additional Documentation

Expand All @@ -134,6 +135,6 @@ All information regarding wrangler or Cloudflare Workers is located in the [Clou
- General documentation surrounding Workers development
- All wrangler features such as Workers Sites and KV

#### ✨Workers Sites
## ✨Workers Sites

To learn about deploying static assets using `wrangler`, see the [Workers Sites Quickstart](https://developers.cloudflare.com/workers/sites/).
Loading

0 comments on commit f8ad9d0

Please sign in to comment.