Repository navigation
Expand file tree
/
Copy pathwrangler.jsonc
More file actions
58 lines (53 loc) · 1.8 KB
/
Copy pathwrangler.jsonc
File metadata and controls
58 lines (53 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
// Example: Worker + Durable Object that runs a Workspace whose
// runtime is an ECMAScript module evaluated in a Dynamic Worker
// loaded through env.LOADER.
//
// Mirrors examples/worker-shell beat for beat — same DO class
// name, same routes, same R2 mount. The only difference is the
// backend: WorkerJavaScriptBackend instead of WorkerShellBackend,
// so exec evaluates JavaScript modules rather than shell commands.
"$schema": "node_modules/wrangler/config-schema.json",
"name": "computer-worker-javascript-example",
"main": "src/index.ts",
"compatibility_date": "2026-05-26",
"compatibility_flags": ["nodejs_compat"],
// Upload every file under src/skills as its own module, under its
// path relative to src/, so it shows up at /bundle/skills/... and
// WorkerBundle("skills") can copy it into the workspace. "Data" keeps
// the bytes exactly as they are on disk.
"find_additional_modules": true,
"rules": [{ "type": "Data", "globs": ["skills/**/*"], "fallthrough": true }],
// Worker Loader binding. The DO's WorkerJavaScriptBackend calls
// env.LOADER.load(...) to mint a Dynamic Worker that evaluates
// each module.
"worker_loaders": [
{
"binding": "LOADER"
}
],
"durable_objects": {
"bindings": [
{
"name": "ContainerExample",
"class_name": "ContainerExample"
}
]
},
// R2 bucket mounted into every Workspace at /workspace/r2 via
// R2Bucket(...). Seed it once with:
// npm run seed:r2 --workspace @example/computer-worker-javascript
// which uploads ./seed/data/hello.txt to the bucket.
"r2_buckets": [
{
"binding": "Bucket",
"bucket_name": "computer-worker-javascript-hello"
}
],
"migrations": [
{
"tag": "v1",
"new_sqlite_classes": ["ContainerExample"]
}
]
}