wrangler 0.0.0-fa42d7ca → 0.0.0-fa7e4da92

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
@@ -10,42 +10,40 @@
10
10
 
11
11
  ## Quick Start
12
12
 
13
+ To get started quickly with a Hello World worker, run the command below:
14
+
13
15
  ```bash
14
- # Make a javascript file
15
- echo "export default { fetch() { return new Response('hello world') } }" > index.js
16
- # try it out
17
- npx wrangler dev index.js
18
- # and then deploy it
19
- npx wrangler deploy index.js --name my-worker
20
- # visit https://my-worker.<your workers subdomain>.workers.dev
16
+ npx wrangler init my-worker -y
21
17
  ```
22
18
 
23
- ## Create a Project
19
+ For more info, visit our [Getting Started](https://developers.cloudflare.com/workers/get-started/guide/) guide.
24
20
 
25
- ```bash
26
- # Generate a new project
27
- npx wrangler init my-worker --no-delegate-c3
28
- # try it out
29
- cd my-worker && npm run start
30
- # and then deploy it
31
- npm run deploy
32
- ```
21
+ <details><summary>Wrangler System Requirements</summary>
33
22
 
34
- ## 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.
35
24
 
36
- ```bash
37
- $ npm install wrangler --save-dev
38
- ```
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>
28
+
29
+ ## Documentation
39
30
 
40
- ## Configuration:
31
+ For the latest Wrangler documentation, [click here](https://developers.cloudflare.com/workers/wrangler/).
32
+
33
+ To read more about Workers in general:
41
34
 
42
- 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.
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/)
43
39
 
44
- Example:
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:
45
43
 
46
44
  ```toml
47
45
  name = "my-worker"
48
- main = "./src/index.ts" # init w/ TypeScript
46
+ main = "./src/index.ts"
49
47
  compatibility_date = "YYYY-MM-DD"
50
48
  ```
51
49
 
@@ -53,30 +51,24 @@ For more detailed information about configuration, refer to the [documentation](
53
51
 
54
52
  ## Commands
55
53
 
56
- ### `wrangler init [name]`
57
-
58
- 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
59
55
 
60
- ### `wrangler dev`
56
+ #### `wrangler dev`
61
57
 
62
58
  Start a local development server, with live reloading and devtools.
63
59
 
64
- ### `wrangler deploy`
60
+ #### `wrangler deploy`
65
61
 
66
- Publish the given script to the worldwide Cloudflare network.
62
+ Publish the given script to Cloudflare's global network.
67
63
 
68
64
  For more commands and options, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/commands/).
69
65
 
70
- ## Pages
66
+ ### Pages
71
67
 
72
- ### `wrangler pages dev [directory] [-- command]`
68
+ #### `wrangler pages dev [directory]`
73
69
 
74
- Either serves a static build asset directory, or proxies itself in front of a command.
70
+ Serves a static build asset directory.
75
71
 
76
72
  Builds and runs functions from a `./functions` directory or uses a `_worker.js` file inside the static build asset directory.
77
73
 
78
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`.
79
-
80
- ## Documentation
81
-
82
- 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