wrangler 2.0.21 → 2.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/bin/wrangler.js +1 -1
- package/miniflare-dist/index.mjs +527 -5
- package/package.json +18 -5
- package/src/__tests__/configuration.test.ts +88 -16
- package/src/__tests__/dev.test.tsx +95 -4
- package/src/__tests__/generate.test.ts +93 -0
- package/src/__tests__/helpers/mock-cfetch.ts +54 -2
- package/src/__tests__/index.test.ts +10 -27
- package/src/__tests__/jest.setup.ts +31 -1
- package/src/__tests__/kv.test.ts +82 -61
- package/src/__tests__/metrics.test.ts +35 -0
- package/src/__tests__/publish.test.ts +573 -254
- package/src/__tests__/r2.test.ts +155 -71
- package/src/__tests__/user.test.ts +1 -0
- package/src/__tests__/validate-dev-props.test.ts +56 -0
- package/src/__tests__/version.test.ts +35 -0
- package/src/__tests__/whoami.test.tsx +60 -1
- package/src/api/dev.ts +43 -9
- package/src/bundle.ts +297 -37
- package/src/cfetch/internal.ts +34 -2
- package/src/config/config.ts +14 -2
- package/src/config/environment.ts +40 -8
- package/src/config/index.ts +13 -0
- package/src/config/validation.ts +110 -8
- package/src/create-worker-preview.ts +3 -1
- package/src/create-worker-upload-form.ts +25 -0
- package/src/dev/dev.tsx +135 -31
- package/src/dev/local.tsx +48 -20
- package/src/dev/remote.tsx +39 -12
- package/src/dev/use-esbuild.ts +25 -0
- package/src/dev/validate-dev-props.ts +31 -0
- package/src/dev-registry.tsx +157 -0
- package/src/dev.tsx +137 -65
- package/src/generate.ts +112 -14
- package/src/index.tsx +222 -7
- package/src/inspect.ts +93 -5
- package/src/metrics/index.ts +1 -0
- package/src/metrics/is-ci.ts +14 -0
- package/src/metrics/metrics-config.ts +19 -2
- package/src/metrics/metrics-dispatcher.ts +1 -0
- package/src/metrics/metrics-usage-headers.ts +24 -0
- package/src/metrics/send-event.ts +2 -2
- package/src/miniflare-cli/assets.ts +543 -0
- package/src/miniflare-cli/index.ts +36 -4
- package/src/module-collection.ts +3 -3
- package/src/pages/constants.ts +1 -0
- package/src/pages/deployments.tsx +1 -1
- package/src/pages/dev.tsx +85 -639
- package/src/pages/publish.tsx +1 -1
- package/src/pages/upload.tsx +32 -13
- package/src/publish.ts +139 -112
- package/src/r2.ts +68 -0
- package/src/user/choose-account.tsx +20 -11
- package/src/user/user.tsx +20 -2
- package/src/whoami.tsx +79 -1
- package/src/worker.ts +12 -0
- package/templates/first-party-worker-module-facade.ts +18 -0
- package/templates/format-dev-errors.ts +32 -0
- package/templates/pages-shim.ts +9 -0
- package/templates/{static-asset-facade.js → serve-static-assets.ts} +21 -7
- package/templates/service-bindings-module-facade.js +51 -0
- package/templates/service-bindings-sw-facade.js +39 -0
- package/wrangler-dist/cli.d.ts +32 -3
- package/wrangler-dist/cli.js +45257 -25209
package/README.md
CHANGED
|
@@ -39,11 +39,25 @@ npm run deploy
|
|
|
39
39
|
$ npm install wrangler --save-dev
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
## Configuration:
|
|
43
|
+
|
|
44
|
+
Wrangler is configured via a `wrangler.toml` file in the project root. When utilizing the `wrangler init` command, a `wrangler.toml` file will be created for you.
|
|
45
|
+
|
|
46
|
+
example:
|
|
47
|
+
|
|
48
|
+
```toml
|
|
49
|
+
main = "./src/index.ts" # init w/ TypeScript
|
|
50
|
+
name = "my-worker"
|
|
51
|
+
compatibility_date = "YYY-MM-DD"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
for more detailed information about configuration, see the [documentation](https://developers.cloudflare.com/workers/cli-wrangler/configuration)
|
|
55
|
+
|
|
42
56
|
## Commands
|
|
43
57
|
|
|
44
58
|
### `wrangler init [name]`
|
|
45
59
|
|
|
46
|
-
Creates a Worker project. For details on configuration keys and values, refer to the [documentation](https://developers.cloudflare.com/workers/
|
|
60
|
+
Creates a Worker project. For details on configuration keys and values, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/commands/#init).
|
|
47
61
|
|
|
48
62
|
### `wrangler dev`
|
|
49
63
|
|
|
@@ -67,4 +81,8 @@ For more commands and options, refer to the [documentation](https://developers.c
|
|
|
67
81
|
|
|
68
82
|
## Documentation
|
|
69
83
|
|
|
70
|
-
For the latest Wrangler documentation, [click here](https://
|
|
84
|
+
For the latest Wrangler documentation, [click here](https://developers.cloudflare.com/workers/wrangler/).
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```
|
package/bin/wrangler.js
CHANGED
|
@@ -35,7 +35,7 @@ Consider using a Node.js version manager such as https://volta.sh/ or https://gi
|
|
|
35
35
|
// - maybe we can generate a certificate that concatenates with ours?
|
|
36
36
|
//
|
|
37
37
|
// I do think it'll be rare that someone wants to add a cert AND
|
|
38
|
-
// use
|
|
38
|
+
// use Cloudflare WARP, but let's wait till the situation actually
|
|
39
39
|
// arises before we do anything about it
|
|
40
40
|
} else {
|
|
41
41
|
const osTempDir = os.tmpdir();
|