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

Feat kv commands #405

Merged
merged 62 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
731f9b6
feat: use cloudflare-rs
ashleymichal Aug 2, 2019
5169f34
feat: #340 first draft of wrangler kv add <namespace>
ashleymichal Aug 2, 2019
59fdb64
Add documentation for kv create
ashleymichal Aug 5, 2019
22e9052
refactor: handle success in endpoint caller
ashleymichal Aug 7, 2019
b8bc14b
feat: kv delete <namespace>
ashleymichal Aug 5, 2019
1ff3c02
feat: kv rename
ashleymichal Aug 5, 2019
b5fbdd2
Merge pull request #403 from cloudflare/alewis/feat-rename-namespace
ashleymichal Aug 7, 2019
2e4a9ee
feat: kv list (raw output)
ashleymichal Aug 5, 2019
3900fb6
Pretty up list output
ashleymichal Aug 7, 2019
1c05b10
correct rename output example in docs
ashleymichal Aug 7, 2019
c0dd867
Merge pull request #404 from cloudflare/alewis/feat-list-namespaces
ashleymichal Aug 7, 2019
22fc8c6
Update cloudflare-rs invocations to match updates
ashleymichal Aug 14, 2019
1022df1
Merge pull request #437 from cloudflare/alewis/update-dependencies
ashleymichal Aug 15, 2019
13ec991
Merge remote-tracking branch 'origin/master' into feat-kv-commands
ashleymichal Aug 15, 2019
bcea204
update cloudflare-rs invocations
ashleymichal Aug 19, 2019
3e1b854
Merge remote-tracking branch 'origin/master' into feat-kv-commands
ashleymichal Aug 19, 2019
8f3a14e
Add gets for single keys from Workers KV (#454)
gabbifish Aug 21, 2019
a1ff27a
Add individual write subcommand for Workers KV (#458)
gabbifish Aug 21, 2019
df8219a
Add bulk upload to Workers KV (#445)
gabbifish Aug 21, 2019
408c34e
Implementation of single and bulk deletion from KV (#452)
gabbifish Aug 21, 2019
ed43c93
Merge branch 'master' into feat-kv-commands
ashleymichal Aug 21, 2019
725ea2f
Add key listing functionality for workers kv subcommands (#462)
gabbifish Aug 22, 2019
464667b
make error message about lack of workers kv entitlements more clear
gabbifish Aug 22, 2019
eb1bca8
fix #406: remove panics and ensure required args for kv subcommands a…
gabbifish Aug 27, 2019
acb6892
clarify Workers KV upgrade error
gabbifish Aug 27, 2019
7c27abb
Gabbi/improve bulk error handling (#466)
gabbifish Aug 27, 2019
e87e5eb
Merge branch 'master' into feat-kv-commands
ashleymichal Aug 27, 2019
4752e23
Remove logic for uploading directories from bulk (#485)
ashleymichal Aug 30, 2019
d8a04c6
Update kv docs
ashleymichal Aug 30, 2019
4f1c239
Gabbi/update subcommand invocations (#501)
gabbifish Aug 30, 2019
a1d72bf
Merge pull request #503 from cloudflare/alewis/kv-docs
ashleymichal Sep 3, 2019
570f5ef
Gabbi/url encode (#507)
gabbifish Sep 3, 2019
70b7ea9
Update usage of cloudflare::Credentials::User -> UserAuthKey
ashleymichal Sep 4, 2019
f1469a5
Gabbi/add interactive delete (#511)
gabbifish Sep 4, 2019
c5a4995
Merge pull request #520 from cloudflare/alewis/update-dependencies
ashleymichal Sep 4, 2019
5f20b4e
refactor: pass project to kv commands in prep for environments
ashleymichal Sep 5, 2019
e3800e2
Merge pull request #526 from cloudflare/alewis/refactor-pass-project
ashleymichal Sep 5, 2019
ee872bc
refactor: organize kv by command type
ashleymichal Sep 5, 2019
264de89
Merge pull request #527 from cloudflare/alewis/refactor-directories
ashleymichal Sep 6, 2019
8fb1f56
Use url encoded strings for list keys prefixes
gabbifish Sep 9, 2019
ad5b33b
Gabbi/more detailed subcommand docs (#537)
gabbifish Sep 9, 2019
bfe8d92
Alewis/refactor key list (#531)
ashleymichal Sep 9, 2019
e71a91d
Fix merge conflict in src/main.rs
gabbifish Sep 9, 2019
4237934
s/project/target
gabbifish Sep 9, 2019
aac2161
fix with steve's feedback
gabbifish Sep 10, 2019
f55263d
use cloudflare-rs package from crates.io (#549)
gabbifish Sep 11, 2019
28de238
Gabbi/add kv env support (#542)
gabbifish Sep 11, 2019
bf19955
remove `kv:namespace rename` subcommand (#555)
gabbifish Sep 11, 2019
f667c7b
Gabbi/perscriptive namespace titles (#557)
gabbifish Sep 11, 2019
69ac09a
Print out namespaces list as json by default (#541)
gabbifish Sep 11, 2019
267caf9
Gabbi/merge master in (#562)
gabbifish Sep 12, 2019
bd9f4f5
warn user to remove binding if deleted + check input for bindings (#560)
gabbifish Sep 12, 2019
a8926e7
Re-order kv commands docs to be more user friendly (#558)
EverlastingBugstopper Sep 12, 2019
109b3a5
Update readme to point people to KV commands docs (#568)
gabbifish Sep 12, 2019
e71e699
fix links to environmenets
gabbifish Sep 12, 2019
399cf3c
Allow use of same json file to bulk delete as bulk put
ashleymichal Sep 12, 2019
ec5ff3f
Merge pull request #577 from cloudflare/alewis/bulk-delete
ashleymichal Sep 12, 2019
d33ce50
Merge 09/12 merges to master into feat-kv-commands (#580)
gabbifish Sep 12, 2019
81ac1e6
Fix panic when `kv: ` command does not have subcommand (#579)
gabbifish Sep 12, 2019
6c3d133
Merge branch 'master' into feat-kv-commands
ashleymichal Sep 13, 2019
17e98f4
Resolve merge conflicts in README
ashleymichal Sep 13, 2019
293ff89
Fix links to environments docs
ashleymichal Sep 13, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
962 changes: 601 additions & 361 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ build = "build.rs"
atty = "0.2.11"
binary-install = "0.0.3-alpha"
clap = "2.32.0"
cloudflare = "0.3.1"
config = "0.9.2"
console = "0.7.5"
dirs = "1.0.5"
Expand All @@ -35,8 +36,14 @@ base64 = "0.10.1"
lazy_static = "1.3.0"
text_io = "0.1.7"
exitfailure = "0.5.1"
prettytable-rs = "0.8.0"
notify-forked = "4.0.12"
ws = "0.9.0"
url = "2.1.0"
walkdir = "2.2.9"
percent-encoding = "1.0.1"
http = "0.1.1"
regex = "1"

[dev-dependencies]
assert_cmd = "0.11.1"
Expand Down
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ General documentation surrounding workers development and using `wrangler` can b
wrangler generate <name> <template> --type=["webpack", "javascript", "rust"]
```

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"
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"

- ### 🦀⚙️ `build`

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 build different environments. This is useful if you have different builds for different environments, but typically isn't needed. For more information see the [environments documentation](https://github.com/cloudflare/wrangler/blob/master/docs/environments.md).
Additionally, you can build different environments. This is useful if you have different builds for different environments, but typically isn't needed. For more information see the [environments documentation](https://github.com/cloudflare/wrangler/blob/master/docs/content/environments.md).

- ### 🔧 `config`

Expand Down Expand Up @@ -113,7 +117,7 @@ If you would like to publish to your own domain, you will need to specify these

#### Publishing the same code to multiple places

If you would like to be able to publish your code to multiple places, please see the documentation for [environments](https://github.com/cloudflare/wrangler/blob/master/docs/environments.md).
If you would like to be able to publish your code to multiple places, please see the documentation for [environments](https://github.com/cloudflare/wrangler/blob/master/docs/content/environments.md).

- ### 🔬 `preview`

Expand Down Expand Up @@ -148,7 +152,10 @@ If you would like to be able to publish your code to multiple places, please see
wrangler preview post hello=hello
```

Additionally, you can preview different environments. This is useful if you have different builds for different environments (like staging vs. production), but typically isn't needed. For more information see the [environments documentation](https://github.com/cloudflare/wrangler/blob/master/docs/environments.md).
Additionally, you can preview different environments. This is useful if you have different builds for different environments (like staging vs. production), but typically isn't needed. For more information see the [environments documentation](https://github.com/cloudflare/wrangler/blob/master/docs/content/environments.md).

- ### 🗂️ `kv`
Interact with your Cloudflare Workers KV store. [Check out the docs.](./docs/content/kv_commands.md)

## 🔩 Configuration

Expand Down Expand Up @@ -191,17 +198,17 @@ There are two types of configuration that `wrangler` uses: global user and per p
- `webpack`: This project contains any number of JavaScript files or Rust/C/C++ files that compile to
WebAssembly. Rust files will be built with `wasm-pack`.
This project type uses webpack and webpack plugins in the background to build your worker.
- `zone_id`: This is the ID of the "zone" or domain you want to run your script on. This is optional if you are using a [workers.dev](https://workers.dev) subdomain and is only required when `workers_dev` is false, or excluded from an [environment](https://github.com/cloudflare/wrangler/blob/master/docs/environments.md) configuration.
- `zone_id`: This is the ID of the "zone" or domain you want to run your script on. This is optional if you are using a [workers.dev](https://workers.dev) subdomain and is only required when `workers_dev` is false, or excluded from an [environment](https://github.com/cloudflare/wrangler/blob/master/docs/content/environments.md) configuration.
- `account_id`: This is the ID of the account associated with your zone. You might have more than one account, so make sure to use the ID of the account associated with the `zone_id` you provide, if you provide one.
- `route`: This is the route you'd like to use your worker on. You need to include the hostname. Examples:

- `*example.com/*`
- `http://example.com/hello`

This key is optional if you are using a [workers.dev](https://workers.dev) subdomain and is only required when `workers_dev` is false, or excluded from an [environment](https://github.com/cloudflare/wrangler/blob/master/docs/environments.md).
This key is optional if you are using a [workers.dev](https://workers.dev) subdomain and is only required when `workers_dev` is false, or excluded from an [environment](https://github.com/cloudflare/wrangler/blob/master/docs/content/environments.md).

- `webpack_config`: This is the path to the webpack configuration file for your worker. This is optional and defaults to `webpack.config.js`
- `workers_dev`: This is a boolean flag that specifies if your worker will be deployed to your [workers.dev](https://workers.dev) subdomain. For more information, please read the [environments documentation](https://github.com/cloudflare/wrangler/blob/master/docs/environments.md).
- `workers_dev`: This is a boolean flag that specifies if your worker will be deployed to your [workers.dev](https://workers.dev) subdomain. For more information, please read the [environments documentation](https://github.com/cloudflare/wrangler/blob/master/docs/content/environments.md).
- `kv-namespaces`: These specify any [Workers KV](https://workers.cloudflare.com/docs/reference/storage/) Namespaces you want to access from
inside your Worker. Each namespace you include should have an entry in your `wrangler.toml` that includes:

Expand All @@ -217,11 +224,13 @@ There are two types of configuration that `wrangler` uses: global user and per p
]
```

Note: Creating your KV Namespaces should be handled either via the [api](https://workers.cloudflare.com/docs/reference/storage/writing-data/) or via your Cloudflare dashboard.
Note: Creating your KV Namespaces should be handled using Wrangler's [KV Commands](./docs/content/kv_commands.md).

#### Environments

#### Environments

Additionally, you can configure Wrangler to publish to multiple environments. This means that your same codebase can be deployed to multiple places on your [workers.dev](https://workers.dev) subdomain, across multiple accounts, zones, and routes. Read more [here](/docs/environments.md).
Additionally, you can configure Wrangler to publish to multiple environments. This means that your same codebase can be deployed to multiple places on your [workers.dev](https://workers.dev) subdomain, across multiple accounts, zones, and routes. Read more [here](/docs/content/environments.md).

## Additional Installation Instructions

Expand Down
6 changes: 3 additions & 3 deletions docs/environments.md → docs/content/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ You will be warned if `workers_dev` is left out of the top level configuration b
```console
$ wrangler publish
⚠️ Please specify the workers_dev boolean in the top level of your wrangler.toml.
⚠️ If you do not add workers_dev, this command may act unexpectedly in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/environments.md for more information.
⚠️ If you do not add workers_dev, this command may act unexpectedly in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/content/environments.md for more information.
✨ Built successfully, built project size is 517 bytes.
✨ Successfully published your script.
✨ Success! Your worker was successfully published. You can view it at https://my-worker.<your-subdomain>.workers.dev
Expand Down Expand Up @@ -345,7 +345,7 @@ With this configuration, Wrangler will behave in the following manner:
$ wrangler publish
⚠️ The `private` field is deprecated; please use `workers_dev` to toggle between publishing to your workers.dev subdomain and your own domain.
⚠️ Please specify the workers_dev boolean in the top level of your wrangler.toml.
⚠️ If you do not add workers_dev, this command may act unexpectedly in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/environments.md for more information.
⚠️ If you do not add workers_dev, this command may act unexpectedly in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/content/environments.md for more information.
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to https://my-worker.<your-subdomain>.workers.dev
```
Expand All @@ -355,7 +355,7 @@ $ wrangler publish --release
⚠️ --release will be deprecated.
⚠️ The `private` field is deprecated; please use `workers_dev` to toggle between publishing to your workers.dev subdomain and your own domain.
⚠️ Please specify the workers_dev boolean in the top level of your wrangler.toml.
⚠️ If you do not add workers_dev, this command may act unexpectedly in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/environments.md for more information.
⚠️ If you do not add workers_dev, this command may act unexpectedly in v1.5.0. Please see https://github.com/cloudflare/wrangler/blob/master/docs/content/environments.md for more information.
✨ Built successfully, built project size is 523 bytes.
✨ Successfully published your script to example.com/*
```
Expand Down
Loading