@cloudflare/workers-utils 0.47.0 → 0.47.2
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/dist/browser.d.mts +9 -0
- package/dist/{chunk-TAK63GWY.mjs → chunk-2HLTAS5V.mjs} +14 -13
- package/dist/{chunk-PWC7WAOU.mjs → chunk-CAPCWVOB.mjs} +7422 -2066
- package/dist/{compliance-BiKBqVqG.d.mts → compliance-BRDsvbha.d.mts} +9 -0
- package/dist/compliance.d.mts +1 -1
- package/dist/index.d.mts +69 -7
- package/dist/index.mjs +171 -1052
- package/dist/metafile-esm.json +1 -1
- package/dist/test-helpers/index.d.mts +1 -1
- package/dist/test-helpers/index.mjs +1 -1
- package/dist/zod-format.mjs +1 -1
- package/package.json +5 -6
package/dist/browser.d.mts
CHANGED
|
@@ -1030,6 +1030,11 @@ interface EnvironmentInheritable {
|
|
|
1030
1030
|
/**
|
|
1031
1031
|
* Include source maps when uploading this worker.
|
|
1032
1032
|
*
|
|
1033
|
+
* Defaults to `true` for `wrangler deploy`, `wrangler versions upload` and
|
|
1034
|
+
* `wrangler preview`, where source maps that can't be resolved are skipped
|
|
1035
|
+
* rather than failing the upload. Defaults to `false` for
|
|
1036
|
+
* `wrangler build --experimental-cf-build-output`.
|
|
1037
|
+
*
|
|
1033
1038
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#source-maps
|
|
1034
1039
|
*
|
|
1035
1040
|
* @inheritable
|
|
@@ -2306,6 +2311,10 @@ interface ConfigFields<Dev extends RawDevConfig> {
|
|
|
2306
2311
|
* or a `*@domain` catch-all (e.g. `"*@example.com"`). Every entry creates an
|
|
2307
2312
|
* Email Routing rule whose action routes mail to this Worker.
|
|
2308
2313
|
*
|
|
2314
|
+
* A `*@domain` catch-all must use the zone apex (e.g. `"*@example.com"`,
|
|
2315
|
+
* not `"*@mail.example.com"`). The zone catch-all also receives mail for
|
|
2316
|
+
* every subdomain in the zone that has no literal rule.
|
|
2317
|
+
*
|
|
2309
2318
|
* This field is top-level only and applies to every environment of the
|
|
2310
2319
|
* Worker; it cannot be set under `env.*`.
|
|
2311
2320
|
*
|
|
@@ -171,7 +171,7 @@ function getDurableObjectClassNameToUseSQLiteMap(migrations, exports$1) {
|
|
|
171
171
|
__name(getDurableObjectClassNameToUseSQLiteMap, "getDurableObjectClassNameToUseSQLiteMap");
|
|
172
172
|
function validateDurableObjectContainerApplications(config, containers = getDurableObjectContainerApps(
|
|
173
173
|
config.containers
|
|
174
|
-
)) {
|
|
174
|
+
), configFileName2 = "Wrangler config file") {
|
|
175
175
|
const allDOs = getDurableObjectClassNameToUseSQLiteMap(
|
|
176
176
|
config.migrations,
|
|
177
177
|
config.exports
|
|
@@ -186,7 +186,7 @@ function validateDurableObjectContainerApplications(config, containers = getDura
|
|
|
186
186
|
const useSQLite = allDOs.get(container.class_name);
|
|
187
187
|
if (useSQLite === void 0 && maybeBoundDO === void 0) {
|
|
188
188
|
throw new UserError(
|
|
189
|
-
`The container class_name ${container.class_name} does not match any durable object class_name defined in your
|
|
189
|
+
`The container class_name ${container.class_name} does not match any durable object class_name defined in your ${configFileName2}. Note that the durable object must be defined in the same script as the container.`,
|
|
190
190
|
{ telemetryMessage: "no DO defined that matches container class_name" }
|
|
191
191
|
);
|
|
192
192
|
}
|
|
@@ -989,12 +989,12 @@ function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
989
989
|
return result;
|
|
990
990
|
}
|
|
991
991
|
__name(parseTree, "parseTree");
|
|
992
|
-
function findNodeAtLocation(root,
|
|
992
|
+
function findNodeAtLocation(root, path3) {
|
|
993
993
|
if (!root) {
|
|
994
994
|
return void 0;
|
|
995
995
|
}
|
|
996
996
|
let node = root;
|
|
997
|
-
for (let segment of
|
|
997
|
+
for (let segment of path3) {
|
|
998
998
|
if (typeof segment === "string") {
|
|
999
999
|
if (node.type !== "object" || !Array.isArray(node.children)) {
|
|
1000
1000
|
return void 0;
|
|
@@ -1343,14 +1343,14 @@ __name(getNodeType, "getNodeType");
|
|
|
1343
1343
|
|
|
1344
1344
|
// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
1345
1345
|
function setProperty(text, originalPath, value, options) {
|
|
1346
|
-
const
|
|
1346
|
+
const path3 = originalPath.slice();
|
|
1347
1347
|
const errors = [];
|
|
1348
1348
|
const root = parseTree(text, errors);
|
|
1349
1349
|
let parent = void 0;
|
|
1350
1350
|
let lastSegment = void 0;
|
|
1351
|
-
while (
|
|
1352
|
-
lastSegment =
|
|
1353
|
-
parent = findNodeAtLocation(root,
|
|
1351
|
+
while (path3.length > 0) {
|
|
1352
|
+
lastSegment = path3.pop();
|
|
1353
|
+
parent = findNodeAtLocation(root, path3);
|
|
1354
1354
|
if (parent === void 0 && value !== void 0) {
|
|
1355
1355
|
if (typeof lastSegment === "string") {
|
|
1356
1356
|
value = { [lastSegment]: value };
|
|
@@ -1581,8 +1581,8 @@ function format2(documentText, range, options) {
|
|
|
1581
1581
|
return format(documentText, range, options);
|
|
1582
1582
|
}
|
|
1583
1583
|
__name(format2, "format");
|
|
1584
|
-
function modify(text,
|
|
1585
|
-
return setProperty(text,
|
|
1584
|
+
function modify(text, path3, value, options) {
|
|
1585
|
+
return setProperty(text, path3, value, options);
|
|
1586
1586
|
}
|
|
1587
1587
|
__name(modify, "modify");
|
|
1588
1588
|
function applyEdits(text, edits) {
|
|
@@ -3080,8 +3080,6 @@ function isRedirectedRawConfig(rawConfig, configPath, userConfigPath) {
|
|
|
3080
3080
|
return isRedirectedConfig({ configPath, userConfigPath });
|
|
3081
3081
|
}
|
|
3082
3082
|
__name(isRedirectedRawConfig, "isRedirectedRawConfig");
|
|
3083
|
-
|
|
3084
|
-
// src/config/index.ts
|
|
3085
3083
|
function configFormat(configPath) {
|
|
3086
3084
|
if (configPath?.endsWith("toml")) {
|
|
3087
3085
|
return "toml";
|
|
@@ -3095,7 +3093,10 @@ function configFormat(configPath) {
|
|
|
3095
3093
|
return "none";
|
|
3096
3094
|
}
|
|
3097
3095
|
__name(configFormat, "configFormat");
|
|
3098
|
-
function configFileName(configPath) {
|
|
3096
|
+
function configFileName(configPath, userConfigPath) {
|
|
3097
|
+
if (userConfigPath !== void 0) {
|
|
3098
|
+
return path.basename(userConfigPath);
|
|
3099
|
+
}
|
|
3099
3100
|
const format3 = configFormat(configPath);
|
|
3100
3101
|
switch (format3) {
|
|
3101
3102
|
case "toml":
|