wrangler 0.0.0-aca9c3e7 → 0.0.0-ace48698
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 +1286 -330
- package/package.json +23 -9
- package/src/__tests__/api-dev.test.ts +209 -0
- package/src/__tests__/api-devregistry.test.js +56 -0
- package/src/__tests__/api.test.ts +80 -0
- package/src/__tests__/configuration.test.ts +240 -382
- package/src/__tests__/dev.test.tsx +86 -26
- package/src/__tests__/dialogs.test.tsx +40 -0
- package/src/__tests__/generate.test.ts +235 -0
- package/src/__tests__/helpers/mock-cfetch.ts +86 -16
- package/src/__tests__/helpers/mock-console.ts +11 -2
- package/src/__tests__/helpers/mock-get-zone-from-host.ts +8 -0
- package/src/__tests__/helpers/mock-known-routes.ts +7 -0
- package/src/__tests__/helpers/mock-oauth-flow.ts +4 -2
- package/src/__tests__/helpers/msw/handlers/namespaces.ts +104 -0
- package/src/__tests__/helpers/msw/handlers/oauth.ts +36 -0
- package/src/__tests__/helpers/msw/handlers/r2.ts +80 -0
- package/src/__tests__/helpers/msw/handlers/user.ts +63 -0
- package/src/__tests__/helpers/msw/index.ts +14 -0
- package/src/__tests__/helpers/worker-scripts/child-wrangler.toml +1 -0
- package/src/__tests__/helpers/worker-scripts/hello-world-worker.js +5 -0
- package/src/__tests__/helpers/worker-scripts/hello-world-wrangler.toml +1 -0
- package/src/__tests__/helpers/worker-scripts/parent-worker.js +8 -0
- package/src/__tests__/helpers/worker-scripts/parent-wrangler.toml +5 -0
- package/src/__tests__/index.test.ts +41 -55
- package/src/__tests__/init.test.ts +1186 -362
- package/src/__tests__/jest.setup.ts +65 -0
- package/src/__tests__/metrics.test.ts +6 -1
- package/src/__tests__/middleware.scheduled.test.ts +135 -0
- package/src/__tests__/middleware.test.ts +726 -0
- package/src/__tests__/pages.test.ts +951 -101
- package/src/__tests__/paths.test.ts +39 -0
- package/src/__tests__/publish.test.ts +739 -443
- package/src/__tests__/r2.test.ts +236 -182
- package/src/__tests__/secret.test.ts +152 -0
- package/src/__tests__/tail.test.ts +172 -95
- package/src/__tests__/test-old-node-version.js +3 -3
- package/src/__tests__/user.test.ts +15 -4
- package/src/__tests__/whoami.test.tsx +80 -101
- package/src/__tests__/worker-namespace.test.ts +142 -148
- package/src/api/dev.ts +155 -34
- package/src/api/index.ts +1 -0
- package/src/bundle.ts +367 -14
- package/src/cfetch/internal.ts +102 -20
- package/src/cli.ts +3 -1
- package/src/config/config.ts +13 -1
- package/src/config/environment.ts +51 -1
- package/src/config/index.ts +63 -8
- package/src/config/validation-helpers.ts +19 -6
- package/src/config/validation.ts +131 -6
- package/src/config-cache.ts +3 -2
- package/src/create-worker-preview.ts +21 -3
- package/src/create-worker-upload-form.ts +59 -21
- package/src/d1/backups.tsx +212 -0
- package/src/d1/create.tsx +54 -0
- package/src/d1/delete.tsx +56 -0
- package/src/d1/execute.tsx +294 -0
- package/src/d1/formatTimeAgo.ts +14 -0
- package/src/d1/index.ts +75 -0
- package/src/d1/list.tsx +48 -0
- package/src/d1/options.ts +12 -0
- package/src/d1/types.tsx +14 -0
- package/src/d1/utils.ts +39 -0
- package/src/dev/dev.tsx +72 -23
- package/src/dev/get-local-persistence-path.tsx +31 -0
- package/src/dev/local.tsx +458 -157
- package/src/dev/remote.tsx +298 -112
- package/src/dev/start-server.ts +506 -0
- package/src/dev/use-esbuild.ts +31 -1
- package/src/dev-registry.tsx +33 -0
- package/src/dev.tsx +465 -200
- package/src/dialogs.tsx +23 -0
- package/src/{worker-namespace.ts → dispatch-namespace.ts} +18 -18
- package/src/entry.ts +2 -1
- package/src/environment-variables.ts +17 -2
- package/src/generate.ts +273 -14
- package/src/git-client.ts +85 -3
- package/src/index.tsx +245 -52
- package/src/init.ts +563 -142
- package/src/inspect.ts +116 -31
- package/src/{metrics/is-ci.ts → is-ci.ts} +0 -0
- package/src/logger.ts +11 -4
- package/src/metrics/index.ts +1 -0
- package/src/metrics/metrics-config.ts +1 -1
- package/src/metrics/metrics-dispatcher.ts +1 -0
- package/src/metrics/metrics-usage-headers.ts +24 -0
- package/src/metrics/send-event.ts +8 -7
- package/src/miniflare-cli/assets.ts +137 -465
- package/src/miniflare-cli/index.ts +141 -18
- package/src/module-collection.ts +12 -3
- package/src/pages/build.tsx +75 -41
- package/src/pages/constants.ts +9 -0
- package/src/pages/deployments.tsx +10 -10
- package/src/pages/dev.tsx +365 -87
- package/src/pages/errors.ts +66 -0
- package/src/pages/functions/buildPlugin.ts +6 -1
- package/src/pages/functions/buildWorker.ts +6 -1
- package/src/pages/functions/routes-consolidation.test.ts +250 -0
- package/src/pages/functions/routes-consolidation.ts +73 -0
- package/src/pages/functions/routes-transformation.test.ts +282 -0
- package/src/pages/functions/routes-transformation.ts +115 -0
- package/src/pages/functions/routes-validation.test.ts +403 -0
- package/src/pages/functions/routes-validation.ts +202 -0
- package/src/pages/functions.tsx +82 -0
- package/src/pages/hash.tsx +13 -0
- package/src/pages/index.tsx +65 -55
- package/src/pages/projects.tsx +9 -3
- package/src/pages/publish.tsx +140 -42
- package/src/pages/types.ts +9 -0
- package/src/pages/upload.tsx +41 -39
- package/src/paths.ts +49 -4
- package/src/proxy.ts +336 -155
- package/src/publish.ts +92 -15
- package/src/r2.ts +17 -4
- package/src/tail/filters.ts +4 -6
- package/src/tail/index.ts +21 -5
- package/src/tail/printing.ts +43 -3
- package/src/user/user.tsx +7 -4
- package/src/whoami.tsx +5 -5
- package/src/worker.ts +52 -9
- package/src/zones.ts +91 -0
- package/templates/d1-beta-facade.js +174 -0
- package/templates/experimental-local-cache-stubs.js +27 -0
- package/templates/first-party-worker-module-facade.ts +18 -0
- package/templates/init-tests/test-jest-new-worker.js +25 -0
- package/templates/init-tests/test-vitest-new-worker.js +26 -0
- package/templates/middleware/common.ts +62 -0
- package/templates/middleware/loader-modules.ts +84 -0
- package/templates/middleware/loader-sw.ts +213 -0
- package/templates/middleware/middleware-pretty-error.ts +40 -0
- package/templates/middleware/middleware-scheduled.ts +15 -0
- package/templates/new-worker.js +1 -1
- package/templates/pages-dev-pipeline.ts +35 -0
- package/templates/pages-template-plugin.ts +16 -4
- package/templates/pages-template-worker.ts +16 -5
- package/templates/service-bindings-module-facade.js +15 -10
- package/templates/service-bindings-sw-facade.js +10 -7
- package/wrangler-dist/cli.d.ts +527 -12
- package/wrangler-dist/cli.js +95010 -78901
- package/src/faye-websocket.d.ts +0 -6
- package/src/miniflare-cli/enum-keys.ts +0 -17
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