wrangler 0.0.0-ec358f4f → 0.0.0-ec4cdeed8
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 +2 -2
- package/bin/wrangler.js +6 -29
- package/config-schema.json +2113 -0
- package/package.json +182 -195
- package/templates/checked-fetch.js +1 -1
- package/templates/facade.d.ts +7 -5
- package/templates/gitignore +2 -4
- package/templates/init-tests/test-vitest-new-worker.js +1 -1
- package/templates/init-tests/test-vitest-new-worker.ts +1 -1
- package/templates/middleware/loader-modules.ts +92 -95
- package/templates/middleware/loader-sw.ts +4 -3
- package/templates/middleware/middleware-ensure-req-body-drained.ts +18 -0
- package/templates/middleware/middleware-mock-analytics-engine.d.ts +3 -0
- package/templates/middleware/middleware-mock-analytics-engine.ts +30 -0
- package/templates/middleware/middleware-scheduled.ts +15 -1
- package/templates/modules-watch-stub.js +4 -0
- package/templates/pages-dev-pipeline.ts +2 -1
- package/templates/pages-template-plugin.ts +2 -2
- package/templates/pages-template-worker.ts +1 -1
- package/templates/startDevWorker/InspectorProxyWorker.ts +664 -0
- package/templates/startDevWorker/ProxyWorker.ts +336 -0
- package/templates/tsconfig.init.json +4 -87
- package/wrangler-dist/InspectorProxyWorker.js +460 -0
- package/wrangler-dist/InspectorProxyWorker.js.map +6 -0
- package/wrangler-dist/ProxyWorker.js +238 -0
- package/wrangler-dist/ProxyWorker.js.map +6 -0
- package/wrangler-dist/cli.d.ts +24987 -287
- package/wrangler-dist/cli.js +136583 -110668
- package/Cloudflare_CA.pem +0 -18
- package/templates/middleware/middleware-d1-beta.d.ts +0 -3
- package/templates/middleware/middleware-d1-beta.ts +0 -244
- package/templates/middleware/middleware-multiworker-dev.d.ts +0 -4
- package/templates/middleware/middleware-multiworker-dev.ts +0 -59
- package/templates/middleware/middleware-serve-static-assets.d.ts +0 -6
- package/templates/middleware/middleware-serve-static-assets.ts +0 -56
- package/wrangler-dist/wasm-sync.wasm +0 -0
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<a href="https://www.npmjs.com/package/wrangler"><img alt="npm" src="https://img.shields.io/npm/dw/wrangler?style=flat-square"></a>
|
|
4
4
|
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/cloudflare/workers-sdk?style=flat-square">
|
|
5
5
|
<img alt="GitHub commit activity (branch)" src="https://img.shields.io/github/commit-activity/w/cloudflare/workers-sdk/main?style=flat-square">
|
|
6
|
-
<a href="https://discord.
|
|
6
|
+
<a href="https://discord.cloudflare.com"><img alt="Discord" src="https://img.shields.io/discord/595317990191398933?color=%23F48120&style=flat-square"></a>
|
|
7
7
|
</section>
|
|
8
8
|
|
|
9
9
|
`wrangler` is a command line tool for building [Cloudflare Workers](https://workers.cloudflare.com/).
|
|
@@ -39,7 +39,7 @@ $ npm install wrangler --save-dev
|
|
|
39
39
|
|
|
40
40
|
## Configuration:
|
|
41
41
|
|
|
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.
|
|
42
|
+
Wrangler is configured via a `wrangler.json` or `wrangler.toml` file in the project root. When utilizing the `wrangler init` command, a `wrangler.toml` file will be created for you.
|
|
43
43
|
|
|
44
44
|
Example:
|
|
45
45
|
|
package/bin/wrangler.js
CHANGED
|
@@ -4,7 +4,7 @@ const path = require("path");
|
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const os = require("os");
|
|
6
6
|
|
|
7
|
-
const MIN_NODE_VERSION = "
|
|
7
|
+
const MIN_NODE_VERSION = "18.0.0";
|
|
8
8
|
const debug =
|
|
9
9
|
process.env["WRANGLER_LOG"] === "debug"
|
|
10
10
|
? (...args) => console.log(...args)
|
|
@@ -28,30 +28,6 @@ Consider using a Node.js version manager such as https://volta.sh/ or https://gi
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
let pathToCACerts = process.env.NODE_EXTRA_CA_CERTS;
|
|
32
|
-
if (pathToCACerts) {
|
|
33
|
-
// TODO:
|
|
34
|
-
// - should we log a warning here?
|
|
35
|
-
// - maybe we can generate a certificate that concatenates with ours?
|
|
36
|
-
//
|
|
37
|
-
// I do think it'll be rare that someone wants to add a cert AND
|
|
38
|
-
// use Cloudflare WARP, but let's wait till the situation actually
|
|
39
|
-
// arises before we do anything about it
|
|
40
|
-
} else {
|
|
41
|
-
const osTempDir = os.tmpdir();
|
|
42
|
-
const certDir = path.join(osTempDir, "wrangler-cert");
|
|
43
|
-
const certPath = path.join(certDir, "Cloudflare_CA.pem");
|
|
44
|
-
// copy cert to the system temp dir if needed
|
|
45
|
-
if (!fs.existsSync(certPath)) {
|
|
46
|
-
fs.mkdirSync(certDir, { recursive: true });
|
|
47
|
-
fs.writeFileSync(
|
|
48
|
-
certPath,
|
|
49
|
-
fs.readFileSync(path.join(__dirname, "../Cloudflare_CA.pem"), "utf-8")
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
pathToCACerts = certPath;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
31
|
return spawn(
|
|
56
32
|
process.execPath,
|
|
57
33
|
[
|
|
@@ -63,10 +39,6 @@ Consider using a Node.js version manager such as https://volta.sh/ or https://gi
|
|
|
63
39
|
],
|
|
64
40
|
{
|
|
65
41
|
stdio: ["inherit", "inherit", "inherit", "ipc"],
|
|
66
|
-
env: {
|
|
67
|
-
...process.env,
|
|
68
|
-
NODE_EXTRA_CA_CERTS: pathToCACerts,
|
|
69
|
-
},
|
|
70
42
|
}
|
|
71
43
|
)
|
|
72
44
|
.on("exit", (code) =>
|
|
@@ -76,6 +48,11 @@ Consider using a Node.js version manager such as https://volta.sh/ or https://gi
|
|
|
76
48
|
if (process.send) {
|
|
77
49
|
process.send(message);
|
|
78
50
|
}
|
|
51
|
+
})
|
|
52
|
+
.on("disconnect", () => {
|
|
53
|
+
if (process.disconnect) {
|
|
54
|
+
process.disconnect();
|
|
55
|
+
}
|
|
79
56
|
});
|
|
80
57
|
}
|
|
81
58
|
|