create-cloudflare 2.72.7 → 2.72.9
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/cli.js +200 -119
- package/package.json +6 -7
- package/templates/common/js/src/index.js +2 -2
- package/templates/common/js/src/proxy.js +5 -7
- package/templates/common/js/src/redirect.js +4 -8
- package/templates/common/ts/src/index.ts +2 -2
- package/templates/common/ts/src/proxy.ts +5 -7
- package/templates/common/ts/src/redirect.ts +4 -8
package/dist/cli.js
CHANGED
|
@@ -77461,7 +77461,7 @@ function dedent(templ) {
|
|
|
77461
77461
|
__name(dedent, "dedent");
|
|
77462
77462
|
var esm_default = dedent;
|
|
77463
77463
|
|
|
77464
|
-
// ../workers-utils/dist/chunk-
|
|
77464
|
+
// ../workers-utils/dist/chunk-JGKSDUFK.mjs
|
|
77465
77465
|
init_chunk_Q72B4Q5Z();
|
|
77466
77466
|
var import_node_fs = require("node:fs");
|
|
77467
77467
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
@@ -77504,6 +77504,19 @@ function getDurableObjectContainerApps(containers) {
|
|
|
77504
77504
|
return Array.isArray(containers) ? containers.filter(isDurableObjectContainerApp) : [];
|
|
77505
77505
|
}
|
|
77506
77506
|
__name(getDurableObjectContainerApps, "getDurableObjectContainerApps");
|
|
77507
|
+
function getResolvedDurableObjectContainerApps(containers, exports$1) {
|
|
77508
|
+
return getDurableObjectContainerApps(containers).map((container) => {
|
|
77509
|
+
const className = resolveContainerClassName(container, exports$1);
|
|
77510
|
+
if (typeof className !== "string" || className.length === 0) {
|
|
77511
|
+
throw new UserError(
|
|
77512
|
+
`The container "${container.name}" is not linked to a Durable Object. Either set "containers.class_name", or reference this container from a Durable Object's \`exports\` entry via its "container" field.`,
|
|
77513
|
+
{ telemetryMessage: "durable object container class unresolved" }
|
|
77514
|
+
);
|
|
77515
|
+
}
|
|
77516
|
+
return { ...container, class_name: className };
|
|
77517
|
+
});
|
|
77518
|
+
}
|
|
77519
|
+
__name(getResolvedDurableObjectContainerApps, "getResolvedDurableObjectContainerApps");
|
|
77507
77520
|
function getContainerNameToClassNameMap(exports$1) {
|
|
77508
77521
|
const containerNameToClassName = /* @__PURE__ */ new Map();
|
|
77509
77522
|
for (const [className, entry] of Object.entries(
|
|
@@ -77604,12 +77617,17 @@ function getDurableObjectClassNameToUseSQLiteMap(migrations, exports$1) {
|
|
|
77604
77617
|
return durableObjectClassNameToUseSQLiteMap;
|
|
77605
77618
|
}
|
|
77606
77619
|
__name(getDurableObjectClassNameToUseSQLiteMap, "getDurableObjectClassNameToUseSQLiteMap");
|
|
77607
|
-
function validateDurableObjectContainerApplications(config50
|
|
77620
|
+
function validateDurableObjectContainerApplications(config50, containers = getDurableObjectContainerApps(
|
|
77621
|
+
config50.containers
|
|
77622
|
+
)) {
|
|
77608
77623
|
const allDOs = getDurableObjectClassNameToUseSQLiteMap(
|
|
77609
77624
|
config50.migrations,
|
|
77610
77625
|
config50.exports
|
|
77611
77626
|
);
|
|
77612
|
-
for (const container of
|
|
77627
|
+
for (const container of getResolvedDurableObjectContainerApps(
|
|
77628
|
+
containers,
|
|
77629
|
+
config50.exports
|
|
77630
|
+
)) {
|
|
77613
77631
|
const maybeBoundDO = config50.durable_objects.bindings.find(
|
|
77614
77632
|
(durableObject) => durableObject.class_name === container.class_name
|
|
77615
77633
|
);
|
|
@@ -79935,7 +79953,7 @@ var APIError = class extends ParseError {
|
|
|
79935
79953
|
}
|
|
79936
79954
|
isGatewayError() {
|
|
79937
79955
|
if (this.#status !== void 0) {
|
|
79938
|
-
return [524].includes(this.#status);
|
|
79956
|
+
return [502, 503, 504, 524].includes(this.#status);
|
|
79939
79957
|
}
|
|
79940
79958
|
return false;
|
|
79941
79959
|
}
|
|
@@ -80395,9 +80413,9 @@ function formatConfigSnippet(snippet, configPath, formatted = true) {
|
|
|
80395
80413
|
}
|
|
80396
80414
|
__name(formatConfigSnippet, "formatConfigSnippet");
|
|
80397
80415
|
|
|
80398
|
-
// ../workers-utils/dist/chunk-
|
|
80416
|
+
// ../workers-utils/dist/chunk-YZWVNJ5I.mjs
|
|
80399
80417
|
init_chunk_Q72B4Q5Z();
|
|
80400
|
-
var DEFAULT_COMPAT_DATE = "2026-09-
|
|
80418
|
+
var DEFAULT_COMPAT_DATE = "2026-09-16";
|
|
80401
80419
|
function assertNever(_value) {
|
|
80402
80420
|
}
|
|
80403
80421
|
__name(assertNever, "assertNever");
|
|
@@ -80677,13 +80695,6 @@ function mapWorkerMetadataBindings(bindings) {
|
|
|
80677
80695
|
}
|
|
80678
80696
|
];
|
|
80679
80697
|
break;
|
|
80680
|
-
case "websearch":
|
|
80681
|
-
{
|
|
80682
|
-
configObj.websearch = {
|
|
80683
|
-
binding: binding.name
|
|
80684
|
-
};
|
|
80685
|
-
}
|
|
80686
|
-
break;
|
|
80687
80698
|
case "agent_memory": {
|
|
80688
80699
|
configObj.agent_memory = [
|
|
80689
80700
|
...configObj.agent_memory ?? [],
|
|
@@ -81347,7 +81358,6 @@ var import_node_crypto = require("node:crypto");
|
|
|
81347
81358
|
var import_node_os5 = require("node:os");
|
|
81348
81359
|
var timersPromises = __toESM(require("node:timers/promises"), 1);
|
|
81349
81360
|
var import_promises2 = require("node:timers/promises");
|
|
81350
|
-
var import_node_console = require("node:console");
|
|
81351
81361
|
var require_vendors2 = __commonJS2({
|
|
81352
81362
|
"../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports$1, module2) {
|
|
81353
81363
|
module2.exports = [
|
|
@@ -82976,7 +82986,6 @@ var defaultWranglerConfig = {
|
|
|
82976
82986
|
vectorize: [],
|
|
82977
82987
|
ai_search_namespaces: [],
|
|
82978
82988
|
ai_search: [],
|
|
82979
|
-
websearch: void 0,
|
|
82980
82989
|
agent_memory: [],
|
|
82981
82990
|
hyperdrive: [],
|
|
82982
82991
|
workflows: [],
|
|
@@ -98285,7 +98294,6 @@ var friendlyBindingNames = {
|
|
|
98285
98294
|
vectorize: "Vectorize Index",
|
|
98286
98295
|
ai_search_namespaces: "AI Search Namespace",
|
|
98287
98296
|
ai_search: "AI Search Instance",
|
|
98288
|
-
websearch: "Web Search",
|
|
98289
98297
|
agent_memory: "Agent Memory",
|
|
98290
98298
|
hyperdrive: "Hyperdrive Config",
|
|
98291
98299
|
r2_buckets: "R2 Bucket",
|
|
@@ -98339,7 +98347,6 @@ var bindingTypeFriendlyNames = {
|
|
|
98339
98347
|
vectorize: "Vectorize Index",
|
|
98340
98348
|
ai_search_namespace: "AI Search Namespace",
|
|
98341
98349
|
ai_search: "AI Search Instance",
|
|
98342
|
-
websearch: "Web Search",
|
|
98343
98350
|
agent_memory: "Agent Memory",
|
|
98344
98351
|
hyperdrive: "Hyperdrive Config",
|
|
98345
98352
|
service: "Worker",
|
|
@@ -99069,17 +99076,31 @@ function validateRoutes(diagnostics, topLevelEnv, rawEnv, envName) {
|
|
|
99069
99076
|
return result;
|
|
99070
99077
|
}
|
|
99071
99078
|
__name(validateRoutes, "validateRoutes");
|
|
99072
|
-
function normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv) {
|
|
99073
|
-
if (rawEnv.placement) {
|
|
99079
|
+
function normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv, diagnosticField = "placement") {
|
|
99080
|
+
if (rawEnv.placement !== void 0) {
|
|
99081
|
+
if (typeof rawEnv.placement !== "object" || rawEnv.placement === null || Array.isArray(rawEnv.placement)) {
|
|
99082
|
+
diagnostics.errors.push(
|
|
99083
|
+
`The field "${diagnosticField}" should be an object but got ${JSON.stringify(rawEnv.placement)}.`
|
|
99084
|
+
);
|
|
99085
|
+
return inheritable(
|
|
99086
|
+
diagnostics,
|
|
99087
|
+
topLevelEnv,
|
|
99088
|
+
rawEnv,
|
|
99089
|
+
"placement",
|
|
99090
|
+
() => true,
|
|
99091
|
+
void 0
|
|
99092
|
+
);
|
|
99093
|
+
}
|
|
99074
99094
|
const placement = rawEnv.placement;
|
|
99075
99095
|
const hasHint = "hint" in placement;
|
|
99076
|
-
const
|
|
99077
|
-
const
|
|
99078
|
-
|
|
99079
|
-
|
|
99096
|
+
const targetedFields = ["region", "host", "hostname"];
|
|
99097
|
+
const presentTargetedFields = targetedFields.filter(
|
|
99098
|
+
(field) => field in placement
|
|
99099
|
+
);
|
|
99100
|
+
const hasTargetedFields = presentTargetedFields.length > 0;
|
|
99080
99101
|
if (hasHint && hasTargetedFields) {
|
|
99081
99102
|
diagnostics.errors.push(
|
|
99082
|
-
`"
|
|
99103
|
+
`"${diagnosticField}" cannot have both "hint" (smart format) and "region"/"host"/"hostname" (targeted format) fields`
|
|
99083
99104
|
);
|
|
99084
99105
|
return inheritable(
|
|
99085
99106
|
diagnostics,
|
|
@@ -99093,7 +99114,7 @@ function normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv) {
|
|
|
99093
99114
|
if (hasHint) {
|
|
99094
99115
|
validateRequiredProperty(
|
|
99095
99116
|
diagnostics,
|
|
99096
|
-
|
|
99117
|
+
diagnosticField,
|
|
99097
99118
|
"mode",
|
|
99098
99119
|
placement.mode,
|
|
99099
99120
|
"string",
|
|
@@ -99103,75 +99124,58 @@ function normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv) {
|
|
|
99103
99124
|
const hint = placement.hint;
|
|
99104
99125
|
if (hint !== void 0 && typeof hint !== "string") {
|
|
99105
99126
|
diagnostics.errors.push(
|
|
99106
|
-
`"
|
|
99127
|
+
`"${diagnosticField}.hint" must be a string when "${diagnosticField}.mode" is "${mode}"`
|
|
99107
99128
|
);
|
|
99108
99129
|
}
|
|
99109
99130
|
if (hint && mode !== "smart") {
|
|
99110
99131
|
diagnostics.errors.push(
|
|
99111
|
-
`"
|
|
99132
|
+
`"${diagnosticField}.hint" can only be set when "${diagnosticField}.mode" is "smart"`
|
|
99112
99133
|
);
|
|
99113
99134
|
}
|
|
99114
99135
|
} else if (hasTargetedFields) {
|
|
99115
99136
|
validateOptionalProperty(
|
|
99116
99137
|
diagnostics,
|
|
99117
|
-
|
|
99138
|
+
diagnosticField,
|
|
99118
99139
|
"mode",
|
|
99119
99140
|
placement.mode,
|
|
99120
99141
|
"string",
|
|
99121
|
-
["
|
|
99142
|
+
["targeted"]
|
|
99122
99143
|
);
|
|
99123
|
-
|
|
99124
|
-
|
|
99125
|
-
diagnostics,
|
|
99126
|
-
"placement",
|
|
99127
|
-
"region",
|
|
99128
|
-
placement.region,
|
|
99129
|
-
"string"
|
|
99130
|
-
);
|
|
99131
|
-
}
|
|
99132
|
-
if (hasHost) {
|
|
99133
|
-
validateOptionalProperty(
|
|
99144
|
+
for (const field of presentTargetedFields) {
|
|
99145
|
+
validateRequiredProperty(
|
|
99134
99146
|
diagnostics,
|
|
99135
|
-
|
|
99136
|
-
|
|
99137
|
-
placement
|
|
99138
|
-
"string"
|
|
99139
|
-
);
|
|
99140
|
-
}
|
|
99141
|
-
if (hasHostname) {
|
|
99142
|
-
validateOptionalProperty(
|
|
99143
|
-
diagnostics,
|
|
99144
|
-
"placement",
|
|
99145
|
-
"hostname",
|
|
99146
|
-
placement.hostname,
|
|
99147
|
+
diagnosticField,
|
|
99148
|
+
field,
|
|
99149
|
+
placement[field],
|
|
99147
99150
|
"string"
|
|
99148
99151
|
);
|
|
99149
|
-
|
|
99150
|
-
|
|
99151
|
-
|
|
99152
|
-
|
|
99153
|
-
if (hasRegion) {
|
|
99154
|
-
presentFields.push("region");
|
|
99155
|
-
}
|
|
99156
|
-
if (hasHost) {
|
|
99157
|
-
presentFields.push("host");
|
|
99158
|
-
}
|
|
99159
|
-
if (hasHostname) {
|
|
99160
|
-
presentFields.push("hostname");
|
|
99152
|
+
if (placement[field] === "") {
|
|
99153
|
+
diagnostics.errors.push(
|
|
99154
|
+
`"${diagnosticField}.${field}" must be a non-empty string.`
|
|
99155
|
+
);
|
|
99161
99156
|
}
|
|
99157
|
+
}
|
|
99158
|
+
if (presentTargetedFields.length > 1) {
|
|
99162
99159
|
diagnostics.errors.push(
|
|
99163
|
-
`"
|
|
99160
|
+
`"${diagnosticField}" fields ${presentTargetedFields.map((field) => `"${field}"`).join(", ")} are mutually exclusive. Only one can be specified.`
|
|
99164
99161
|
);
|
|
99165
99162
|
}
|
|
99166
99163
|
} else {
|
|
99167
99164
|
validateRequiredProperty(
|
|
99168
99165
|
diagnostics,
|
|
99169
|
-
|
|
99166
|
+
diagnosticField,
|
|
99170
99167
|
"mode",
|
|
99171
99168
|
placement.mode,
|
|
99172
99169
|
"string",
|
|
99173
99170
|
["off", "smart", "targeted"]
|
|
99174
99171
|
);
|
|
99172
|
+
if (placement.mode === "targeted") {
|
|
99173
|
+
validateAtLeastOnePropertyRequired(diagnostics, diagnosticField, [
|
|
99174
|
+
{ key: "region", value: placement.region, type: "string" },
|
|
99175
|
+
{ key: "host", value: placement.host, type: "string" },
|
|
99176
|
+
{ key: "hostname", value: placement.hostname, type: "string" }
|
|
99177
|
+
]);
|
|
99178
|
+
}
|
|
99175
99179
|
}
|
|
99176
99180
|
}
|
|
99177
99181
|
return inheritable(
|
|
@@ -99614,16 +99618,6 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
99614
99618
|
validateBindingArray(envName, validateAISearchBinding),
|
|
99615
99619
|
[]
|
|
99616
99620
|
),
|
|
99617
|
-
websearch: notInheritable(
|
|
99618
|
-
diagnostics,
|
|
99619
|
-
topLevelEnv,
|
|
99620
|
-
rawConfig,
|
|
99621
|
-
rawEnv,
|
|
99622
|
-
envName,
|
|
99623
|
-
"websearch",
|
|
99624
|
-
validateNamedSimpleBinding(envName),
|
|
99625
|
-
void 0
|
|
99626
|
-
),
|
|
99627
99621
|
agent_memory: notInheritable(
|
|
99628
99622
|
diagnostics,
|
|
99629
99623
|
topLevelEnv,
|
|
@@ -100876,7 +100870,6 @@ var validateUnsafeBinding = /* @__PURE__ */ __name((diagnostics, field, value) =
|
|
|
100876
100870
|
"ai",
|
|
100877
100871
|
"ai_search_namespace",
|
|
100878
100872
|
"ai_search",
|
|
100879
|
-
"websearch",
|
|
100880
100873
|
"agent_memory",
|
|
100881
100874
|
"kv_namespace",
|
|
100882
100875
|
"durable_object_namespace",
|
|
@@ -101092,8 +101085,25 @@ function validateDurableObjectContainerImages(diagnostics, field, images, compli
|
|
|
101092
101085
|
valid = false;
|
|
101093
101086
|
}
|
|
101094
101087
|
}
|
|
101088
|
+
const isDockerfileBuild = hasDockerfile && !hasImage;
|
|
101089
|
+
if (isDockerfileBuild) {
|
|
101090
|
+
if (image.build_context !== void 0 && (typeof image.build_context !== "string" || image.build_context.length === 0)) {
|
|
101091
|
+
diagnostics.errors.push(
|
|
101092
|
+
`"${imageField}.build_context" must be a non-empty string.`
|
|
101093
|
+
);
|
|
101094
|
+
valid = false;
|
|
101095
|
+
}
|
|
101096
|
+
if (image.build_vars !== void 0 && (typeof image.build_vars !== "object" || image.build_vars === null || Array.isArray(image.build_vars) || Object.values(image.build_vars).some(
|
|
101097
|
+
(value) => typeof value !== "string"
|
|
101098
|
+
))) {
|
|
101099
|
+
diagnostics.errors.push(
|
|
101100
|
+
`"${imageField}.build_vars" must be an object with string values.`
|
|
101101
|
+
);
|
|
101102
|
+
valid = false;
|
|
101103
|
+
}
|
|
101104
|
+
}
|
|
101095
101105
|
const unsupportedFields = Object.keys(image).filter(
|
|
101096
|
-
(property) => property !== "dockerfile" && property !== "image"
|
|
101106
|
+
(property) => property !== "dockerfile" && property !== "image" && !(isDockerfileBuild && (property === "build_context" || property === "build_vars"))
|
|
101097
101107
|
);
|
|
101098
101108
|
if (unsupportedFields.length > 0) {
|
|
101099
101109
|
diagnostics.errors.push(
|
|
@@ -101105,6 +101115,32 @@ function validateDurableObjectContainerImages(diagnostics, field, images, compli
|
|
|
101105
101115
|
return valid;
|
|
101106
101116
|
}
|
|
101107
101117
|
__name(validateDurableObjectContainerImages, "validateDurableObjectContainerImages");
|
|
101118
|
+
function validateDurableObjectContainerUnsafe(diagnostics, field, value) {
|
|
101119
|
+
if (value === void 0) {
|
|
101120
|
+
return;
|
|
101121
|
+
}
|
|
101122
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
101123
|
+
diagnostics.errors.push(`"${field}" should be an object.`);
|
|
101124
|
+
return;
|
|
101125
|
+
}
|
|
101126
|
+
const unsafe = value;
|
|
101127
|
+
const configuration = unsafe.configuration;
|
|
101128
|
+
if (Object.keys(unsafe).some((key) => key !== "configuration") || configuration !== void 0 && (typeof configuration !== "object" || configuration === null || Array.isArray(configuration) || Object.keys(configuration).some((key) => key !== "experimental_flags"))) {
|
|
101129
|
+
diagnostics.errors.push(
|
|
101130
|
+
`Only "${field}.configuration.experimental_flags" is supported for Durable Object-managed Containers.`
|
|
101131
|
+
);
|
|
101132
|
+
return;
|
|
101133
|
+
}
|
|
101134
|
+
if (configuration !== void 0) {
|
|
101135
|
+
const flags = configuration.experimental_flags;
|
|
101136
|
+
if (flags !== void 0 && (!Array.isArray(flags) || flags.some((flag) => typeof flag !== "string"))) {
|
|
101137
|
+
diagnostics.errors.push(
|
|
101138
|
+
`"${field}.configuration.experimental_flags" should be an array of strings.`
|
|
101139
|
+
);
|
|
101140
|
+
}
|
|
101141
|
+
}
|
|
101142
|
+
}
|
|
101143
|
+
__name(validateDurableObjectContainerUnsafe, "validateDurableObjectContainerUnsafe");
|
|
101108
101144
|
function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
101109
101145
|
const { generateDefaultName = true } = options;
|
|
101110
101146
|
return (diagnostics, field, value, config210) => {
|
|
@@ -101120,19 +101156,16 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
|
101120
101156
|
for (const containerAppOptional of value) {
|
|
101121
101157
|
const isDurableObjectManaged = containerAppOptional.scheduling_policy === "durable_object";
|
|
101122
101158
|
const hasValidDurableObjectClassName = typeof containerAppOptional.class_name === "string" && containerAppOptional.class_name.length > 0;
|
|
101123
|
-
|
|
101124
|
-
|
|
101125
|
-
|
|
101126
|
-
|
|
101127
|
-
|
|
101128
|
-
|
|
101129
|
-
|
|
101130
|
-
|
|
101131
|
-
|
|
101132
|
-
|
|
101133
|
-
"class_name",
|
|
101134
|
-
containerAppOptional.class_name,
|
|
101135
|
-
"string"
|
|
101159
|
+
validateOptionalProperty(
|
|
101160
|
+
diagnostics,
|
|
101161
|
+
field,
|
|
101162
|
+
"class_name",
|
|
101163
|
+
containerAppOptional.class_name,
|
|
101164
|
+
"string"
|
|
101165
|
+
);
|
|
101166
|
+
if (isDurableObjectManaged && containerAppOptional.class_name === "") {
|
|
101167
|
+
diagnostics.errors.push(
|
|
101168
|
+
`"containers.class_name" must be a non-empty string when specified for a Durable Object-managed Container.`
|
|
101136
101169
|
);
|
|
101137
101170
|
}
|
|
101138
101171
|
validateOptionalProperty(
|
|
@@ -101142,7 +101175,7 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
|
101142
101175
|
containerAppOptional.name,
|
|
101143
101176
|
"string"
|
|
101144
101177
|
);
|
|
101145
|
-
if (generateDefaultName && !containerAppOptional.name && (!isDurableObjectManaged || hasValidDurableObjectClassName)) {
|
|
101178
|
+
if (generateDefaultName && !containerAppOptional.name && (!isDurableObjectManaged || containerAppOptional.class_name === void 0 || hasValidDurableObjectClassName)) {
|
|
101146
101179
|
if (containerAppOptional.class_name === void 0) {
|
|
101147
101180
|
diagnostics.errors.push(
|
|
101148
101181
|
`"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object's \`exports\` entry, or set "containers.class_name".`
|
|
@@ -101164,12 +101197,35 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
|
|
|
101164
101197
|
containerAppOptional.images,
|
|
101165
101198
|
options.complianceConfig
|
|
101166
101199
|
);
|
|
101200
|
+
validateContainerObservability(
|
|
101201
|
+
diagnostics,
|
|
101202
|
+
`${field}.observability`,
|
|
101203
|
+
containerAppOptional.observability,
|
|
101204
|
+
config210
|
|
101205
|
+
);
|
|
101206
|
+
if (containerAppOptional.observability?.target_instance_count !== void 0 || containerAppOptional.observability?.target_instance_percentage !== void 0) {
|
|
101207
|
+
diagnostics.errors.push(
|
|
101208
|
+
`"${field}.observability" only supports enabling or disabling logs for Durable Object-managed Containers; instance targeting is not supported.`
|
|
101209
|
+
);
|
|
101210
|
+
}
|
|
101211
|
+
validateDurableObjectContainerUnsafe(
|
|
101212
|
+
diagnostics,
|
|
101213
|
+
`${field}.unsafe`,
|
|
101214
|
+
containerAppOptional.unsafe
|
|
101215
|
+
);
|
|
101167
101216
|
const unsupportedFields = Object.keys(containerAppOptional).filter(
|
|
101168
|
-
(key) => ![
|
|
101217
|
+
(key) => ![
|
|
101218
|
+
"name",
|
|
101219
|
+
"class_name",
|
|
101220
|
+
"scheduling_policy",
|
|
101221
|
+
"images",
|
|
101222
|
+
"observability",
|
|
101223
|
+
"unsafe"
|
|
101224
|
+
].includes(key)
|
|
101169
101225
|
);
|
|
101170
101226
|
if (unsupportedFields.length > 0) {
|
|
101171
101227
|
diagnostics.errors.push(
|
|
101172
|
-
`Unsupported fields for Durable Object-managed Containers in ${field}: ${unsupportedFields.map((key) => `"${key}"`).join(",")}. Only "name", "class_name", "scheduling_policy", and "
|
|
101228
|
+
`Unsupported fields for Durable Object-managed Containers in ${field}: ${unsupportedFields.map((key) => `"${key}"`).join(",")}. Only "name", "class_name", "scheduling_policy", "images", "observability", and restricted "unsafe" settings are supported.`
|
|
101173
101229
|
);
|
|
101174
101230
|
}
|
|
101175
101231
|
continue;
|
|
@@ -103012,6 +103068,8 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName, configPath) => (di
|
|
|
103012
103068
|
"d1_databases",
|
|
103013
103069
|
"r2_buckets",
|
|
103014
103070
|
"vectorize",
|
|
103071
|
+
"ai_search_namespaces",
|
|
103072
|
+
"ai_search",
|
|
103015
103073
|
"hyperdrive",
|
|
103016
103074
|
"services",
|
|
103017
103075
|
"analytics_engine_datasets",
|
|
@@ -103038,6 +103096,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName, configPath) => (di
|
|
|
103038
103096
|
"logpush",
|
|
103039
103097
|
"observability",
|
|
103040
103098
|
"limits",
|
|
103099
|
+
"placement",
|
|
103041
103100
|
"cache"
|
|
103042
103101
|
]) && isValid;
|
|
103043
103102
|
isValid = validateVars(envName)(
|
|
@@ -103052,6 +103111,12 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName, configPath) => (di
|
|
|
103052
103111
|
previews.define,
|
|
103053
103112
|
void 0
|
|
103054
103113
|
) && isValid;
|
|
103114
|
+
normalizeAndValidatePlacement(
|
|
103115
|
+
diagnostics,
|
|
103116
|
+
void 0,
|
|
103117
|
+
previews,
|
|
103118
|
+
`${field}.placement`
|
|
103119
|
+
);
|
|
103055
103120
|
isValid = validateBindingsProperty(envName, validateDurableObjectBinding)(
|
|
103056
103121
|
diagnostics,
|
|
103057
103122
|
`${field}.durable_objects`,
|
|
@@ -103098,6 +103163,18 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName, configPath) => (di
|
|
|
103098
103163
|
previews.vectorize,
|
|
103099
103164
|
void 0
|
|
103100
103165
|
) && isValid;
|
|
103166
|
+
isValid = validateBindingArray(envName, validateAISearchNamespaceBinding)(
|
|
103167
|
+
diagnostics,
|
|
103168
|
+
`${field}.ai_search_namespaces`,
|
|
103169
|
+
previews.ai_search_namespaces,
|
|
103170
|
+
void 0
|
|
103171
|
+
) && isValid;
|
|
103172
|
+
isValid = validateBindingArray(envName, validateAISearchBinding)(
|
|
103173
|
+
diagnostics,
|
|
103174
|
+
`${field}.ai_search`,
|
|
103175
|
+
previews.ai_search,
|
|
103176
|
+
void 0
|
|
103177
|
+
) && isValid;
|
|
103101
103178
|
isValid = validateBindingArray(envName, validateHyperdriveBinding)(
|
|
103102
103179
|
diagnostics,
|
|
103103
103180
|
`${field}.hyperdrive`,
|
|
@@ -104251,7 +104328,6 @@ var BINDING_LOCAL_SUPPORT = {
|
|
|
104251
104328
|
flagship: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
104252
104329
|
vpc_service: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
104253
104330
|
vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
104254
|
-
websearch: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
104255
104331
|
agent_memory: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
|
|
104256
104332
|
};
|
|
104257
104333
|
function getBindingLocalSupport(type) {
|
|
@@ -104745,11 +104821,6 @@ function convertConfigToBindings(config210, options) {
|
|
|
104745
104821
|
}
|
|
104746
104822
|
break;
|
|
104747
104823
|
}
|
|
104748
|
-
case "websearch": {
|
|
104749
|
-
const { binding, ...x } = info;
|
|
104750
|
-
output[binding] = { type: "websearch", ...x };
|
|
104751
|
-
break;
|
|
104752
|
-
}
|
|
104753
104824
|
case "agent_memory": {
|
|
104754
104825
|
for (const { binding, ...x } of info) {
|
|
104755
104826
|
output[binding] = { type: "agent_memory", ...x };
|
|
@@ -104922,7 +104993,6 @@ function printBindings(bindings, options) {
|
|
|
104922
104993
|
bindings
|
|
104923
104994
|
);
|
|
104924
104995
|
const ai_search = extractBindingsOfType("ai_search", bindings);
|
|
104925
|
-
const websearch = extractBindingsOfType("websearch", bindings);
|
|
104926
104996
|
const agent_memory = extractBindingsOfType("agent_memory", bindings);
|
|
104927
104997
|
const hyperdrive = extractBindingsOfType("hyperdrive", bindings);
|
|
104928
104998
|
const r2_buckets = extractBindingsOfType("r2_bucket", bindings);
|
|
@@ -105140,16 +105210,6 @@ function printBindings(bindings, options) {
|
|
|
105140
105210
|
}))
|
|
105141
105211
|
);
|
|
105142
105212
|
}
|
|
105143
|
-
if (websearch.length > 0) {
|
|
105144
|
-
output.push(
|
|
105145
|
-
...websearch.map(({ binding }) => ({
|
|
105146
|
-
name: binding,
|
|
105147
|
-
type: getBindingTypeFriendlyName("websearch"),
|
|
105148
|
-
value: void 0,
|
|
105149
|
-
mode: getMode({ isSimulatedLocally: false })
|
|
105150
|
-
}))
|
|
105151
|
-
);
|
|
105152
|
-
}
|
|
105153
105213
|
if (agent_memory.length > 0) {
|
|
105154
105214
|
output.push(
|
|
105155
105215
|
...agent_memory.map(({ binding, namespace }) => ({
|
|
@@ -105631,7 +105691,7 @@ ${allTailConsumers.map(({ service, streaming }) => {
|
|
|
105631
105691
|
log2(
|
|
105632
105692
|
`${containersTitle}
|
|
105633
105693
|
${containers.map(
|
|
105634
|
-
(container) => container.scheduling_policy === "durable_object" ? `- ${container.class_name} (durable_object)` : `- ${container.name} (${container.image})`
|
|
105694
|
+
(container) => container.scheduling_policy === "durable_object" ? `- ${container.class_name ?? container.name} (durable_object)` : `- ${container.name} (${container.image})`
|
|
105635
105695
|
).join("\n")}`
|
|
105636
105696
|
);
|
|
105637
105697
|
log2("");
|
|
@@ -107635,7 +107695,7 @@ function getWorkerNameFromProject(projectPath) {
|
|
|
107635
107695
|
}
|
|
107636
107696
|
__name(getWorkerNameFromProject, "getWorkerNameFromProject");
|
|
107637
107697
|
function toUrlPath(filePath) {
|
|
107638
|
-
(0,
|
|
107698
|
+
(0, import_node_assert2.default)(
|
|
107639
107699
|
!/^[a-z]:/i.test(filePath),
|
|
107640
107700
|
"Tried to convert a Windows file path with a drive to a URL path."
|
|
107641
107701
|
);
|
|
@@ -112533,7 +112593,7 @@ var Yargs = YargsFactory(esm_default2);
|
|
|
112533
112593
|
var yargs_default = Yargs;
|
|
112534
112594
|
|
|
112535
112595
|
// package.json
|
|
112536
|
-
var version2 = "2.72.
|
|
112596
|
+
var version2 = "2.72.9";
|
|
112537
112597
|
|
|
112538
112598
|
// src/metrics.ts
|
|
112539
112599
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -115120,20 +115180,20 @@ __name2(getPropertyName, "getPropertyName");
|
|
|
115120
115180
|
var package_default = {
|
|
115121
115181
|
name: "frameworks_clis_info",
|
|
115122
115182
|
dependencies: {
|
|
115123
|
-
"@angular/create": "22.1.
|
|
115183
|
+
"@angular/create": "22.1.8",
|
|
115124
115184
|
"@tanstack/cli": "0.71.0",
|
|
115125
|
-
"create-analog": "2.7.
|
|
115185
|
+
"create-analog": "2.7.2",
|
|
115126
115186
|
"create-astro": "5.2.4",
|
|
115127
115187
|
"create-docusaurus": "3.10.2",
|
|
115128
115188
|
"create-hono": "0.19.5",
|
|
115129
|
-
"create-next-app": "16.3.
|
|
115189
|
+
"create-next-app": "16.3.5",
|
|
115130
115190
|
"create-qwik": "1.20.0",
|
|
115131
115191
|
"create-react-router": "8.3.1",
|
|
115132
115192
|
"create-rwsdk": "3.1.3",
|
|
115133
115193
|
"create-solid": "0.12.0",
|
|
115134
115194
|
"create-vike": "0.0.681",
|
|
115135
115195
|
"create-vinext-app": "1.0.0-beta.2",
|
|
115136
|
-
"create-vite": "9.2.
|
|
115196
|
+
"create-vite": "9.2.1",
|
|
115137
115197
|
"create-vue": "3.23.0",
|
|
115138
115198
|
"create-waku": "0.12.5-1.0.0-alpha.10-0",
|
|
115139
115199
|
gatsby: "5.16.1",
|
|
@@ -117699,6 +117759,27 @@ For all limits and quotas, retrieve from the product's \`/platform/limits/\` pag
|
|
|
117699
117759
|
|
|
117700
117760
|
Run \`wrangler types\` after changing bindings in wrangler.jsonc.
|
|
117701
117761
|
|
|
117762
|
+
## Local Explorer (Debugging & Inspection)
|
|
117763
|
+
|
|
117764
|
+
When running \`npx wrangler dev\`, a Local Explorer API is available for inspecting and debugging local Workers, bindings, and storage state. The API base URL is printed in the terminal when the dev server starts.
|
|
117765
|
+
|
|
117766
|
+
Key endpoints (relative to the dev server URL):
|
|
117767
|
+
|
|
117768
|
+
| Endpoint | Description |
|
|
117769
|
+
|----------|-------------|
|
|
117770
|
+
| \`GET /cdn-cgi/local/explorer/api/local/workers\` | List local Workers and their bindings |
|
|
117771
|
+
| \`GET /cdn-cgi/local/explorer/api/storage/kv/namespaces\` | List KV namespaces |
|
|
117772
|
+
| \`GET /cdn-cgi/local/explorer/api/d1/database\` | List D1 databases |
|
|
117773
|
+
| \`GET /cdn-cgi/local/explorer/api/r2/buckets\` | List R2 buckets |
|
|
117774
|
+
| \`GET /cdn-cgi/local/explorer/api/workers/durable_objects/namespaces\` | List Durable Object namespaces |
|
|
117775
|
+
| \`GET /cdn-cgi/local/explorer/api/workflows\` | List Workflows |
|
|
117776
|
+
| \`POST /cdn-cgi/local/explorer/api/local/observability/query\` | Run a read-only SQL query (SELECT/WITH only) over captured request traces and console logs. Tables: \`spans\`, \`logs\` (read attributes via \`json(attributes)\`). Example: \`curl -X POST <base>/cdn-cgi/local/explorer/api/local/observability/query -H 'Content-Type: application/json' -d '{"sql":"SELECT service, name, outcome, duration_ms FROM spans WHERE parent_id IS NULL LIMIT 20"}'\` |
|
|
117777
|
+
| \`POST /cdn-cgi/local/explorer/api/local/observability/clear\` | Clear all captured traces and logs |
|
|
117778
|
+
|
|
117779
|
+
If the routes above don't cover what you need, fetch the full OpenAPI schema (large - use only as a last resort): \`GET /cdn-cgi/local/explorer/api\`
|
|
117780
|
+
|
|
117781
|
+
Use the Local Explorer to debug issues by inspecting storage state (KV keys, D1 rows, R2 objects, DO storage), viewing Worker bindings, and querying request traces and logs captured during the dev session.
|
|
117782
|
+
|
|
117702
117783
|
## Node.js Compatibility
|
|
117703
117784
|
|
|
117704
117785
|
https://developers.cloudflare.com/workers/runtime-apis/nodejs/
|
|
@@ -117725,7 +117806,7 @@ If the application uses Durable Objects or Workflows, refer to the relevant best
|
|
|
117725
117806
|
var import_node_assert7 = __toESM(require("node:assert"));
|
|
117726
117807
|
|
|
117727
117808
|
// ../wrangler/package.json
|
|
117728
|
-
var version3 = "4.
|
|
117809
|
+
var version3 = "4.133.0";
|
|
117729
117810
|
|
|
117730
117811
|
// src/git.ts
|
|
117731
117812
|
var offerGit = async (ctx) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.72.
|
|
3
|
+
"version": "2.72.9",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@babel/parser": "^7.21.3",
|
|
32
32
|
"@babel/types": "^7.21.4",
|
|
33
33
|
"@clack/prompts": "^1.2.0",
|
|
34
|
-
"@cloudflare/workers-types": "^5.
|
|
34
|
+
"@cloudflare/workers-types": "^5.20260916.1",
|
|
35
35
|
"@types/command-exists": "^1.2.0",
|
|
36
36
|
"@types/cross-spawn": "^6.0.2",
|
|
37
37
|
"@types/deepmerge": "^2.2.0",
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"dns2": "^2.1.0",
|
|
51
51
|
"dotenv": "16.3.1",
|
|
52
52
|
"esbuild": "0.28.1",
|
|
53
|
-
"execa": "^7.1.1",
|
|
54
53
|
"exit-hook": "2.2.1",
|
|
55
54
|
"get-port": "^7.1.0",
|
|
56
55
|
"haikunator": "^2.1.2",
|
|
@@ -71,13 +70,13 @@
|
|
|
71
70
|
"which-pm-runs": "^1.1.0",
|
|
72
71
|
"wrap-ansi": "^9.0.0",
|
|
73
72
|
"yargs": "^17.7.2",
|
|
74
|
-
"@cloudflare/cli-shared-helpers": "0.1.
|
|
73
|
+
"@cloudflare/cli-shared-helpers": "0.1.32",
|
|
75
74
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
76
75
|
"@cloudflare/shared-ast-primitives": "1.1.0",
|
|
77
|
-
"@cloudflare/vite-plugin": "1.54.
|
|
76
|
+
"@cloudflare/vite-plugin": "1.54.11",
|
|
78
77
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
79
|
-
"@cloudflare/workers-utils": "0.
|
|
80
|
-
"wrangler": "4.
|
|
78
|
+
"@cloudflare/workers-utils": "0.39.1",
|
|
79
|
+
"wrangler": "4.133.0"
|
|
81
80
|
},
|
|
82
81
|
"engines": {
|
|
83
82
|
"node": ">=22.0.0"
|
|
@@ -37,8 +37,8 @@ export default {
|
|
|
37
37
|
return new Response(
|
|
38
38
|
`Try making requests to:
|
|
39
39
|
<ul>
|
|
40
|
-
<li><code><a href="/redirect
|
|
41
|
-
<li><code><a href="/proxy?modify
|
|
40
|
+
<li><code><a href="/redirect">/redirect</a></code>,</li>
|
|
41
|
+
<li><code><a href="/proxy?modify">/proxy?modify</a></code>, or</li>
|
|
42
42
|
<li><code><a href="/api/todos">/api/todos</a></code></li>`,
|
|
43
43
|
{ headers: { 'Content-Type': 'text/html' } }
|
|
44
44
|
);
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
+
// Keep the destination fixed to prevent this Worker from becoming an open proxy.
|
|
2
|
+
const PROXY_URL = 'https://example.com/';
|
|
3
|
+
|
|
1
4
|
export default {
|
|
2
5
|
async fetch(request, env, ctx) {
|
|
3
6
|
const url = new URL(request.url);
|
|
4
7
|
|
|
5
|
-
const
|
|
6
|
-
const modify = url.searchParams.has('modify'); // check if a query param is set (?proxyUrl=...&modify)
|
|
7
|
-
|
|
8
|
-
if (!proxyUrl) {
|
|
9
|
-
return new Response('Bad request: Missing `proxyUrl` query param', { status: 400 });
|
|
10
|
-
}
|
|
8
|
+
const modify = url.searchParams.has('modify'); // check if a query param is set (?modify)
|
|
11
9
|
|
|
12
10
|
// make subrequests with the global `fetch()` function
|
|
13
|
-
let res = await fetch(
|
|
11
|
+
let res = await fetch(PROXY_URL, request);
|
|
14
12
|
|
|
15
13
|
// optionally, modify the respone
|
|
16
14
|
if (modify) {
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
// Keep the destination fixed to prevent this Worker from becoming an open redirect.
|
|
2
|
+
const REDIRECT_URL = 'https://example.com/';
|
|
3
|
+
|
|
1
4
|
export default {
|
|
2
5
|
async fetch(request, env, ctx) {
|
|
3
|
-
const url = new URL(request.url);
|
|
4
|
-
const redirectUrl = url.searchParams.get('redirectUrl'); // get a query param value (?redirectUrl=...)
|
|
5
|
-
|
|
6
|
-
if (!redirectUrl) {
|
|
7
|
-
return new Response('Bad request: Missing `redirectUrl` query param', { status: 400 });
|
|
8
|
-
}
|
|
9
|
-
|
|
10
6
|
// The Response class has static methods to create common Response objects as a convenience
|
|
11
|
-
return Response.redirect(
|
|
7
|
+
return Response.redirect(REDIRECT_URL);
|
|
12
8
|
},
|
|
13
9
|
};
|
|
@@ -40,8 +40,8 @@ export default {
|
|
|
40
40
|
return new Response(
|
|
41
41
|
`Try making requests to:
|
|
42
42
|
<ul>
|
|
43
|
-
<li><code><a href="/redirect
|
|
44
|
-
<li><code><a href="/proxy?modify
|
|
43
|
+
<li><code><a href="/redirect">/redirect</a></code>,</li>
|
|
44
|
+
<li><code><a href="/proxy?modify">/proxy?modify</a></code>, or</li>
|
|
45
45
|
<li><code><a href="/api/todos">/api/todos</a></code></li>`,
|
|
46
46
|
{ headers: { 'Content-Type': 'text/html' } }
|
|
47
47
|
);
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
+
// Keep the destination fixed to prevent this Worker from becoming an open proxy.
|
|
2
|
+
const PROXY_URL = 'https://example.com/';
|
|
3
|
+
|
|
1
4
|
export default {
|
|
2
5
|
async fetch(request, env, ctx): Promise<Response> {
|
|
3
6
|
const url = new URL(request.url);
|
|
4
7
|
|
|
5
|
-
const
|
|
6
|
-
const modify = url.searchParams.has('modify'); // check if a query param is set (?proxyUrl=...&modify)
|
|
7
|
-
|
|
8
|
-
if (!proxyUrl) {
|
|
9
|
-
return new Response('Bad request: Missing `proxyUrl` query param', { status: 400 });
|
|
10
|
-
}
|
|
8
|
+
const modify = url.searchParams.has('modify'); // check if a query param is set (?modify)
|
|
11
9
|
|
|
12
10
|
// make subrequests with the global `fetch()` function
|
|
13
|
-
let res = await fetch(
|
|
11
|
+
let res = await fetch(PROXY_URL, request);
|
|
14
12
|
|
|
15
13
|
// optionally, modify the respone
|
|
16
14
|
if (modify) {
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
// Keep the destination fixed to prevent this Worker from becoming an open redirect.
|
|
2
|
+
const REDIRECT_URL = 'https://example.com/';
|
|
3
|
+
|
|
1
4
|
export default {
|
|
2
5
|
async fetch(request, env, ctx): Promise<Response> {
|
|
3
|
-
const url = new URL(request.url);
|
|
4
|
-
const redirectUrl = url.searchParams.get('redirectUrl'); // get a query param value (?redirectUrl=...)
|
|
5
|
-
|
|
6
|
-
if (!redirectUrl) {
|
|
7
|
-
return new Response('Bad request: Missing `redirectUrl` query param', { status: 400 });
|
|
8
|
-
}
|
|
9
|
-
|
|
10
6
|
// The Response class has static methods to create common Response objects as a convenience
|
|
11
|
-
return Response.redirect(
|
|
7
|
+
return Response.redirect(REDIRECT_URL);
|
|
12
8
|
},
|
|
13
9
|
} satisfies ExportedHandler<Env>;
|