wrangler 0.0.0-edec41591 → 0.0.0-edf169d15

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 CHANGED
@@ -8,48 +8,42 @@
8
8
 
9
9
  `wrangler` is a command line tool for building [Cloudflare Workers](https://workers.cloudflare.com/).
10
10
 
11
- > [!WARNING]
12
- >
13
- > Wrangler v2 is **only receiving critical security updates.** We recommend you [migrate to Wrangler v3](https://developers.cloudflare.com/workers/wrangler/migration/update-v2-to-v3/) if you can.
14
-
15
11
  ## Quick Start
16
12
 
13
+ To get started quickly with a Hello World worker, run the command below:
14
+
17
15
  ```bash
18
- # Make a javascript file
19
- echo "export default { fetch() { return new Response('hello world') } }" > index.js
20
- # try it out
21
- npx wrangler dev index.js
22
- # and then deploy it
23
- npx wrangler deploy index.js --name my-worker
24
- # visit https://my-worker.<your workers subdomain>.workers.dev
16
+ npx wrangler init my-worker -y
25
17
  ```
26
18
 
27
- ## Create a Project
19
+ For more info, visit our [Getting Started](https://developers.cloudflare.com/workers/get-started/guide/) guide.
28
20
 
29
- ```bash
30
- # Generate a new project
31
- npx wrangler init my-worker --no-delegate-c3
32
- # try it out
33
- cd my-worker && npm run start
34
- # and then deploy it
35
- npm run deploy
36
- ```
21
+ <details><summary>Wrangler System Requirements</summary>
37
22
 
38
- ## Installation:
23
+ We support running the Wrangler CLI with the [Current, Active, and Maintenance](https://nodejs.org/en/about/previous-releases) versions of Node.js. Your Worker will always be executed in `workerd`, the open source Cloudflare Workers runtime.
39
24
 
40
- ```bash
41
- $ npm install wrangler --save-dev
42
- ```
25
+ Wrangler is only supported on macOS 13.5+, Windows 11, and Linux distros that support glib 2.35. This follows [`workerd`'s OS support policy](https://github.com/cloudflare/workerd?tab=readme-ov-file#running-workerd).
26
+
27
+ </details>
43
28
 
44
- ## Configuration:
29
+ ## Documentation
45
30
 
46
- 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.
31
+ For the latest Wrangler documentation, [click here](https://developers.cloudflare.com/workers/wrangler/).
47
32
 
48
- Example:
33
+ To read more about Workers in general:
34
+
35
+ - [Getting Started](https://developers.cloudflare.com/workers/get-started/guide/)
36
+ - [How Workers works](https://developers.cloudflare.com/workers/reference/how-workers-works/)
37
+ - [Observability](https://developers.cloudflare.com/workers/observability/)
38
+ - [Platform](https://developers.cloudflare.com/workers/platform/)
39
+
40
+ ## Configuration
41
+
42
+ Wrangler is configured via a `wrangler.toml` or `wrangler.json` file in the project root. An example configuration generated by `npx wrangler init` or `npx create cloudflare` is as follows:
49
43
 
50
44
  ```toml
51
45
  name = "my-worker"
52
- main = "./src/index.ts" # init w/ TypeScript
46
+ main = "./src/index.ts"
53
47
  compatibility_date = "YYYY-MM-DD"
54
48
  ```
55
49
 
@@ -57,30 +51,24 @@ For more detailed information about configuration, refer to the [documentation](
57
51
 
58
52
  ## Commands
59
53
 
60
- ### `wrangler init [name]`
61
-
62
- Creates a Worker project. For details on configuration keys and values, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/commands/#init).
54
+ ### Workers
63
55
 
64
- ### `wrangler dev`
56
+ #### `wrangler dev`
65
57
 
66
58
  Start a local development server, with live reloading and devtools.
67
59
 
68
- ### `wrangler deploy`
60
+ #### `wrangler deploy`
69
61
 
70
- Publish the given script to the worldwide Cloudflare network.
62
+ Publish the given script to Cloudflare's global network.
71
63
 
72
64
  For more commands and options, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/commands/).
73
65
 
74
- ## Pages
66
+ ### Pages
75
67
 
76
- ### `wrangler pages dev [directory] [-- command]`
68
+ #### `wrangler pages dev [directory]`
77
69
 
78
- Either serves a static build asset directory, or proxies itself in front of a command.
70
+ Serves a static build asset directory.
79
71
 
80
72
  Builds and runs functions from a `./functions` directory or uses a `_worker.js` file inside the static build asset directory.
81
73
 
82
74
  For more commands and options, refer to the [documentation](https://developers.cloudflare.com/pages/platform/functions#develop-and-preview-locally) or run `wrangler pages dev --help`.
83
-
84
- ## Documentation
85
-
86
- For the latest Wrangler documentation, [click here](https://developers.cloudflare.com/workers/wrangler/).
package/bin/wrangler.js CHANGED
@@ -1,14 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  const { spawn } = require("child_process");
3
3
  const path = require("path");
4
- const fs = require("fs");
5
- const os = require("os");
6
-
7
- const MIN_NODE_VERSION = "16.13.0";
8
- const debug =
9
- process.env["WRANGLER_LOG"] === "debug"
10
- ? (...args) => console.log(...args)
11
- : () => {};
4
+
5
+ const MIN_NODE_VERSION = "18.0.0";
12
6
 
13
7
  let wranglerProcess;
14
8