wrangler 3.76.0 → 3.78.0
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/config-schema.json +183 -156
- package/package.json +8 -8
- 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-serve-static-assets.ts +2 -2
- package/wrangler-dist/cli.d.ts +86 -21
- package/wrangler-dist/cli.js +90545 -86285
package/config-schema.json
CHANGED
@@ -137,6 +137,61 @@
|
|
137
137
|
},
|
138
138
|
"type": "array"
|
139
139
|
},
|
140
|
+
"DurableObjectMigration": {
|
141
|
+
"additionalProperties": false,
|
142
|
+
"description": "Configuration in wrangler for Durable Object Migrations",
|
143
|
+
"properties": {
|
144
|
+
"deleted_classes": {
|
145
|
+
"description": "The Durable Objects being removed.",
|
146
|
+
"items": {
|
147
|
+
"type": "string"
|
148
|
+
},
|
149
|
+
"type": "array"
|
150
|
+
},
|
151
|
+
"new_classes": {
|
152
|
+
"description": "The new Durable Objects being defined.",
|
153
|
+
"items": {
|
154
|
+
"type": "string"
|
155
|
+
},
|
156
|
+
"type": "array"
|
157
|
+
},
|
158
|
+
"new_sqlite_classes": {
|
159
|
+
"description": "The new SQLite Durable Objects being defined.",
|
160
|
+
"items": {
|
161
|
+
"type": "string"
|
162
|
+
},
|
163
|
+
"type": "array"
|
164
|
+
},
|
165
|
+
"renamed_classes": {
|
166
|
+
"description": "The Durable Objects being renamed.",
|
167
|
+
"items": {
|
168
|
+
"additionalProperties": false,
|
169
|
+
"properties": {
|
170
|
+
"from": {
|
171
|
+
"type": "string"
|
172
|
+
},
|
173
|
+
"to": {
|
174
|
+
"type": "string"
|
175
|
+
}
|
176
|
+
},
|
177
|
+
"required": [
|
178
|
+
"from",
|
179
|
+
"to"
|
180
|
+
],
|
181
|
+
"type": "object"
|
182
|
+
},
|
183
|
+
"type": "array"
|
184
|
+
},
|
185
|
+
"tag": {
|
186
|
+
"description": "A unique identifier for this migration.",
|
187
|
+
"type": "string"
|
188
|
+
}
|
189
|
+
},
|
190
|
+
"required": [
|
191
|
+
"tag"
|
192
|
+
],
|
193
|
+
"type": "object"
|
194
|
+
},
|
140
195
|
"Environment": {
|
141
196
|
"additionalProperties": false,
|
142
197
|
"description": "The `Environment` interface declares all the configuration fields that can be specified for an environment.\n\nThis could be the top-level default environment, or a specific named environment.",
|
@@ -473,58 +528,7 @@
|
|
473
528
|
"default": [],
|
474
529
|
"description": "A list of migrations that should be uploaded with your Worker.\n\nThese define changes in your Durable Object declarations.\n\nMore details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations",
|
475
530
|
"items": {
|
476
|
-
"
|
477
|
-
"properties": {
|
478
|
-
"deleted_classes": {
|
479
|
-
"description": "The Durable Objects being removed.",
|
480
|
-
"items": {
|
481
|
-
"type": "string"
|
482
|
-
},
|
483
|
-
"type": "array"
|
484
|
-
},
|
485
|
-
"new_classes": {
|
486
|
-
"description": "The new Durable Objects being defined.",
|
487
|
-
"items": {
|
488
|
-
"type": "string"
|
489
|
-
},
|
490
|
-
"type": "array"
|
491
|
-
},
|
492
|
-
"new_sqlite_classes": {
|
493
|
-
"description": "The new SQLite Durable Objects being defined.",
|
494
|
-
"items": {
|
495
|
-
"type": "string"
|
496
|
-
},
|
497
|
-
"type": "array"
|
498
|
-
},
|
499
|
-
"renamed_classes": {
|
500
|
-
"description": "The Durable Objects being renamed.",
|
501
|
-
"items": {
|
502
|
-
"additionalProperties": false,
|
503
|
-
"properties": {
|
504
|
-
"from": {
|
505
|
-
"type": "string"
|
506
|
-
},
|
507
|
-
"to": {
|
508
|
-
"type": "string"
|
509
|
-
}
|
510
|
-
},
|
511
|
-
"required": [
|
512
|
-
"from",
|
513
|
-
"to"
|
514
|
-
],
|
515
|
-
"type": "object"
|
516
|
-
},
|
517
|
-
"type": "array"
|
518
|
-
},
|
519
|
-
"tag": {
|
520
|
-
"description": "A unique identifier for this migration.",
|
521
|
-
"type": "string"
|
522
|
-
}
|
523
|
-
},
|
524
|
-
"required": [
|
525
|
-
"tag"
|
526
|
-
],
|
527
|
-
"type": "object"
|
531
|
+
"$ref": "#/definitions/DurableObjectMigration"
|
528
532
|
},
|
529
533
|
"type": "array"
|
530
534
|
},
|
@@ -567,10 +571,40 @@
|
|
567
571
|
"description": "Add polyfills for node builtin modules and globals",
|
568
572
|
"type": "boolean"
|
569
573
|
},
|
574
|
+
"observability": {
|
575
|
+
"$ref": "#/definitions/Observability",
|
576
|
+
"description": "Specify the observability behavior of the Worker."
|
577
|
+
},
|
578
|
+
"pipelines": {
|
579
|
+
"default": "`[]`",
|
580
|
+
"description": "Specifies list of Pipelines bound to this Worker environment\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
|
581
|
+
"items": {
|
582
|
+
"additionalProperties": false,
|
583
|
+
"properties": {
|
584
|
+
"binding": {
|
585
|
+
"description": "The binding name used to refer to the bound service.",
|
586
|
+
"type": "string"
|
587
|
+
},
|
588
|
+
"pipeline": {
|
589
|
+
"description": "Name of the Pipeline to bind",
|
590
|
+
"type": "string"
|
591
|
+
}
|
592
|
+
},
|
593
|
+
"required": [
|
594
|
+
"binding",
|
595
|
+
"pipeline"
|
596
|
+
],
|
597
|
+
"type": "object"
|
598
|
+
},
|
599
|
+
"type": "array"
|
600
|
+
},
|
570
601
|
"placement": {
|
571
602
|
"additionalProperties": false,
|
572
603
|
"description": "Specify how the Worker should be located to minimize round-trip time.\n\nMore details: https://developers.cloudflare.com/workers/platform/smart-placement/",
|
573
604
|
"properties": {
|
605
|
+
"hint": {
|
606
|
+
"type": "string"
|
607
|
+
},
|
574
608
|
"mode": {
|
575
609
|
"enum": [
|
576
610
|
"off",
|
@@ -970,6 +1004,7 @@
|
|
970
1004
|
"logfwdr",
|
971
1005
|
"migrations",
|
972
1006
|
"mtls_certificates",
|
1007
|
+
"pipelines",
|
973
1008
|
"queues",
|
974
1009
|
"r2_buckets",
|
975
1010
|
"rules",
|
@@ -990,6 +1025,23 @@
|
|
990
1025
|
"directory": {
|
991
1026
|
"description": "Absolute path to assets directory",
|
992
1027
|
"type": "string"
|
1028
|
+
},
|
1029
|
+
"html_handling": {
|
1030
|
+
"enum": [
|
1031
|
+
"auto-trailing-slash",
|
1032
|
+
"force-trailing-slash",
|
1033
|
+
"drop-trailing-slash",
|
1034
|
+
"none"
|
1035
|
+
],
|
1036
|
+
"type": "string"
|
1037
|
+
},
|
1038
|
+
"not_found_handling": {
|
1039
|
+
"enum": [
|
1040
|
+
"single-page-application",
|
1041
|
+
"404-page",
|
1042
|
+
"none"
|
1043
|
+
],
|
1044
|
+
"type": "string"
|
993
1045
|
}
|
994
1046
|
},
|
995
1047
|
"required": [
|
@@ -1019,6 +1071,23 @@
|
|
1019
1071
|
"Literal": {
|
1020
1072
|
"$ref": "#/definitions/TypeOf%3CZodUnion%3C%5Bdef-class-1315922706-6501-8772-1315922706-0-54395%2Cdef-class-1315922706-9299-10989-1315922706-0-54395%2Cdef-class-1315922706-12937-13365-1315922706-0-54395%2Cdef-class-1315922706-15083-15273-1315922706-0-54395%5D%3E%3E"
|
1021
1073
|
},
|
1074
|
+
"Observability": {
|
1075
|
+
"additionalProperties": false,
|
1076
|
+
"properties": {
|
1077
|
+
"enabled": {
|
1078
|
+
"description": "If observability is enabled for this Worker",
|
1079
|
+
"type": "boolean"
|
1080
|
+
},
|
1081
|
+
"head_sampling_rate": {
|
1082
|
+
"description": "The sampling rate",
|
1083
|
+
"type": "number"
|
1084
|
+
}
|
1085
|
+
},
|
1086
|
+
"required": [
|
1087
|
+
"enabled"
|
1088
|
+
],
|
1089
|
+
"type": "object"
|
1090
|
+
},
|
1022
1091
|
"RawConfig": {
|
1023
1092
|
"additionalProperties": false,
|
1024
1093
|
"properties": {
|
@@ -1511,58 +1580,7 @@
|
|
1511
1580
|
"default": [],
|
1512
1581
|
"description": "A list of migrations that should be uploaded with your Worker.\n\nThese define changes in your Durable Object declarations.\n\nMore details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations",
|
1513
1582
|
"items": {
|
1514
|
-
"
|
1515
|
-
"properties": {
|
1516
|
-
"deleted_classes": {
|
1517
|
-
"description": "The Durable Objects being removed.",
|
1518
|
-
"items": {
|
1519
|
-
"type": "string"
|
1520
|
-
},
|
1521
|
-
"type": "array"
|
1522
|
-
},
|
1523
|
-
"new_classes": {
|
1524
|
-
"description": "The new Durable Objects being defined.",
|
1525
|
-
"items": {
|
1526
|
-
"type": "string"
|
1527
|
-
},
|
1528
|
-
"type": "array"
|
1529
|
-
},
|
1530
|
-
"new_sqlite_classes": {
|
1531
|
-
"description": "The new SQLite Durable Objects being defined.",
|
1532
|
-
"items": {
|
1533
|
-
"type": "string"
|
1534
|
-
},
|
1535
|
-
"type": "array"
|
1536
|
-
},
|
1537
|
-
"renamed_classes": {
|
1538
|
-
"description": "The Durable Objects being renamed.",
|
1539
|
-
"items": {
|
1540
|
-
"additionalProperties": false,
|
1541
|
-
"properties": {
|
1542
|
-
"from": {
|
1543
|
-
"type": "string"
|
1544
|
-
},
|
1545
|
-
"to": {
|
1546
|
-
"type": "string"
|
1547
|
-
}
|
1548
|
-
},
|
1549
|
-
"required": [
|
1550
|
-
"from",
|
1551
|
-
"to"
|
1552
|
-
],
|
1553
|
-
"type": "object"
|
1554
|
-
},
|
1555
|
-
"type": "array"
|
1556
|
-
},
|
1557
|
-
"tag": {
|
1558
|
-
"description": "A unique identifier for this migration.",
|
1559
|
-
"type": "string"
|
1560
|
-
}
|
1561
|
-
},
|
1562
|
-
"required": [
|
1563
|
-
"tag"
|
1564
|
-
],
|
1565
|
-
"type": "object"
|
1583
|
+
"$ref": "#/definitions/DurableObjectMigration"
|
1566
1584
|
},
|
1567
1585
|
"type": "array"
|
1568
1586
|
},
|
@@ -1609,14 +1627,44 @@
|
|
1609
1627
|
"description": "Add polyfills for node builtin modules and globals",
|
1610
1628
|
"type": "boolean"
|
1611
1629
|
},
|
1630
|
+
"observability": {
|
1631
|
+
"$ref": "#/definitions/Observability",
|
1632
|
+
"description": "Specify the observability behavior of the Worker."
|
1633
|
+
},
|
1612
1634
|
"pages_build_output_dir": {
|
1613
1635
|
"description": "The directory of static assets to serve.\n\nThe presence of this field in `wrangler.toml` indicates a Pages project, and will prompt the handling of the configuration file according to the Pages-specific validation rules.",
|
1614
1636
|
"type": "string"
|
1615
1637
|
},
|
1638
|
+
"pipelines": {
|
1639
|
+
"default": "`[]`",
|
1640
|
+
"description": "Specifies list of Pipelines bound to this Worker environment\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
|
1641
|
+
"items": {
|
1642
|
+
"additionalProperties": false,
|
1643
|
+
"properties": {
|
1644
|
+
"binding": {
|
1645
|
+
"description": "The binding name used to refer to the bound service.",
|
1646
|
+
"type": "string"
|
1647
|
+
},
|
1648
|
+
"pipeline": {
|
1649
|
+
"description": "Name of the Pipeline to bind",
|
1650
|
+
"type": "string"
|
1651
|
+
}
|
1652
|
+
},
|
1653
|
+
"required": [
|
1654
|
+
"binding",
|
1655
|
+
"pipeline"
|
1656
|
+
],
|
1657
|
+
"type": "object"
|
1658
|
+
},
|
1659
|
+
"type": "array"
|
1660
|
+
},
|
1616
1661
|
"placement": {
|
1617
1662
|
"additionalProperties": false,
|
1618
1663
|
"description": "Specify how the Worker should be located to minimize round-trip time.\n\nMore details: https://developers.cloudflare.com/workers/platform/smart-placement/",
|
1619
1664
|
"properties": {
|
1665
|
+
"hint": {
|
1666
|
+
"type": "string"
|
1667
|
+
},
|
1620
1668
|
"mode": {
|
1621
1669
|
"enum": [
|
1622
1670
|
"off",
|
@@ -2483,58 +2531,7 @@
|
|
2483
2531
|
"default": [],
|
2484
2532
|
"description": "A list of migrations that should be uploaded with your Worker.\n\nThese define changes in your Durable Object declarations.\n\nMore details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations",
|
2485
2533
|
"items": {
|
2486
|
-
"
|
2487
|
-
"properties": {
|
2488
|
-
"deleted_classes": {
|
2489
|
-
"description": "The Durable Objects being removed.",
|
2490
|
-
"items": {
|
2491
|
-
"type": "string"
|
2492
|
-
},
|
2493
|
-
"type": "array"
|
2494
|
-
},
|
2495
|
-
"new_classes": {
|
2496
|
-
"description": "The new Durable Objects being defined.",
|
2497
|
-
"items": {
|
2498
|
-
"type": "string"
|
2499
|
-
},
|
2500
|
-
"type": "array"
|
2501
|
-
},
|
2502
|
-
"new_sqlite_classes": {
|
2503
|
-
"description": "The new SQLite Durable Objects being defined.",
|
2504
|
-
"items": {
|
2505
|
-
"type": "string"
|
2506
|
-
},
|
2507
|
-
"type": "array"
|
2508
|
-
},
|
2509
|
-
"renamed_classes": {
|
2510
|
-
"description": "The Durable Objects being renamed.",
|
2511
|
-
"items": {
|
2512
|
-
"additionalProperties": false,
|
2513
|
-
"properties": {
|
2514
|
-
"from": {
|
2515
|
-
"type": "string"
|
2516
|
-
},
|
2517
|
-
"to": {
|
2518
|
-
"type": "string"
|
2519
|
-
}
|
2520
|
-
},
|
2521
|
-
"required": [
|
2522
|
-
"from",
|
2523
|
-
"to"
|
2524
|
-
],
|
2525
|
-
"type": "object"
|
2526
|
-
},
|
2527
|
-
"type": "array"
|
2528
|
-
},
|
2529
|
-
"tag": {
|
2530
|
-
"description": "A unique identifier for this migration.",
|
2531
|
-
"type": "string"
|
2532
|
-
}
|
2533
|
-
},
|
2534
|
-
"required": [
|
2535
|
-
"tag"
|
2536
|
-
],
|
2537
|
-
"type": "object"
|
2534
|
+
"$ref": "#/definitions/DurableObjectMigration"
|
2538
2535
|
},
|
2539
2536
|
"type": "array"
|
2540
2537
|
},
|
@@ -2577,10 +2574,40 @@
|
|
2577
2574
|
"description": "Add polyfills for node builtin modules and globals",
|
2578
2575
|
"type": "boolean"
|
2579
2576
|
},
|
2577
|
+
"observability": {
|
2578
|
+
"$ref": "#/definitions/Observability",
|
2579
|
+
"description": "Specify the observability behavior of the Worker."
|
2580
|
+
},
|
2581
|
+
"pipelines": {
|
2582
|
+
"default": "`[]`",
|
2583
|
+
"description": "Specifies list of Pipelines bound to this Worker environment\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
|
2584
|
+
"items": {
|
2585
|
+
"additionalProperties": false,
|
2586
|
+
"properties": {
|
2587
|
+
"binding": {
|
2588
|
+
"description": "The binding name used to refer to the bound service.",
|
2589
|
+
"type": "string"
|
2590
|
+
},
|
2591
|
+
"pipeline": {
|
2592
|
+
"description": "Name of the Pipeline to bind",
|
2593
|
+
"type": "string"
|
2594
|
+
}
|
2595
|
+
},
|
2596
|
+
"required": [
|
2597
|
+
"binding",
|
2598
|
+
"pipeline"
|
2599
|
+
],
|
2600
|
+
"type": "object"
|
2601
|
+
},
|
2602
|
+
"type": "array"
|
2603
|
+
},
|
2580
2604
|
"placement": {
|
2581
2605
|
"additionalProperties": false,
|
2582
2606
|
"description": "Specify how the Worker should be located to minimize round-trip time.\n\nMore details: https://developers.cloudflare.com/workers/platform/smart-placement/",
|
2583
2607
|
"properties": {
|
2608
|
+
"hint": {
|
2609
|
+
"type": "string"
|
2610
|
+
},
|
2584
2611
|
"mode": {
|
2585
2612
|
"enum": [
|
2586
2613
|
"off",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.78.0",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -63,15 +63,15 @@
|
|
63
63
|
"selfsigned": "^2.0.1",
|
64
64
|
"source-map": "^0.6.1",
|
65
65
|
"unenv": "npm:unenv-nightly@2.0.0-1724863496.70db6f1",
|
66
|
-
"workerd": "1.
|
66
|
+
"workerd": "1.20240909.0",
|
67
67
|
"xxhash-wasm": "^1.0.1",
|
68
68
|
"@cloudflare/kv-asset-handler": "0.3.4",
|
69
|
-
"
|
70
|
-
"
|
69
|
+
"@cloudflare/workers-shared": "0.5.1",
|
70
|
+
"miniflare": "3.20240909.1"
|
71
71
|
},
|
72
72
|
"devDependencies": {
|
73
73
|
"@cloudflare/types": "^6.18.4",
|
74
|
-
"@cloudflare/workers-types": "^4.
|
74
|
+
"@cloudflare/workers-types": "^4.20240909.0",
|
75
75
|
"@cspotcode/source-map-support": "0.8.1",
|
76
76
|
"@iarna/toml": "^3.0.0",
|
77
77
|
"@microsoft/api-extractor": "^7.47.0",
|
@@ -146,19 +146,19 @@
|
|
146
146
|
"ts-json-schema-generator": "^1.5.0",
|
147
147
|
"undici": "^5.28.4",
|
148
148
|
"update-check": "^1.5.4",
|
149
|
-
"vitest": "
|
149
|
+
"vitest": "~2.0.5",
|
150
150
|
"vitest-websocket-mock": "^0.3.0",
|
151
151
|
"ws": "^8.17.1",
|
152
152
|
"xdg-app-paths": "^8.3.0",
|
153
153
|
"yargs": "^17.7.2",
|
154
154
|
"yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
|
155
155
|
"@cloudflare/cli": "1.1.1",
|
156
|
-
"@cloudflare/pages-shared": "^0.11.55",
|
157
156
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
157
|
+
"@cloudflare/pages-shared": "^0.11.57",
|
158
158
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
159
159
|
},
|
160
160
|
"peerDependencies": {
|
161
|
-
"@cloudflare/workers-types": "^4.
|
161
|
+
"@cloudflare/workers-types": "^4.20240909.0"
|
162
162
|
},
|
163
163
|
"peerDependenciesMeta": {
|
164
164
|
"@cloudflare/workers-types": {
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/// <reference path="middleware-mock-analytics-engine.d.ts"/>
|
2
|
+
|
3
|
+
import { bindings } from "config:middleware/mock-analytics-engine";
|
4
|
+
import type { Middleware } from "./common";
|
5
|
+
|
6
|
+
const bindingsEnv = Object.fromEntries(
|
7
|
+
bindings.map((binding) => [
|
8
|
+
binding,
|
9
|
+
{
|
10
|
+
writeDataPoint() {
|
11
|
+
// no op in dev
|
12
|
+
},
|
13
|
+
},
|
14
|
+
])
|
15
|
+
) satisfies Record<string, AnalyticsEngineDataset>;
|
16
|
+
|
17
|
+
const analyticsEngine: Middleware = async (
|
18
|
+
request,
|
19
|
+
env,
|
20
|
+
_ctx,
|
21
|
+
middlewareCtx
|
22
|
+
) => {
|
23
|
+
// we're going to directly modify env so it maintains referential equality
|
24
|
+
for (const binding of bindings) {
|
25
|
+
env[binding] ??= bindingsEnv[binding];
|
26
|
+
}
|
27
|
+
return await middlewareCtx.next(request, env);
|
28
|
+
};
|
29
|
+
|
30
|
+
export default analyticsEngine;
|
@@ -14,7 +14,7 @@ import type * as kvAssetHandler from "@cloudflare/kv-asset-handler";
|
|
14
14
|
|
15
15
|
const ASSET_MANIFEST = JSON.parse(manifest);
|
16
16
|
|
17
|
-
const staticAssets: Middleware = async (request, env,
|
17
|
+
const staticAssets: Middleware = async (request, env, ctx, middlewareCtx) => {
|
18
18
|
let options: Partial<Options> = {
|
19
19
|
ASSET_MANIFEST,
|
20
20
|
ASSET_NAMESPACE: env.__STATIC_CONTENT,
|
@@ -27,7 +27,7 @@ const staticAssets: Middleware = async (request, env, _ctx, middlewareCtx) => {
|
|
27
27
|
{
|
28
28
|
request,
|
29
29
|
waitUntil(promise) {
|
30
|
-
return
|
30
|
+
return ctx.waitUntil(promise);
|
31
31
|
},
|
32
32
|
},
|
33
33
|
options
|