@cloudflare/deploy-helpers 0.20.1 → 0.20.3
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/{chunk-Y4VATABS.mjs → chunk-JXU4CCEI.mjs} +4 -3
- package/dist/{context-BjoLoNIB.d.mts → context-CYOACjI9.d.mts} +5 -2
- package/dist/context.d.mts +1 -1
- package/dist/context.mjs +1 -1
- package/dist/index.d.mts +23 -5
- package/dist/index.mjs +177 -121
- package/dist/metafile-esm.json +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
|
-
import { fetchResult, fetchPagedListResult, logger, confirm, fetchListResult, prompt, select } from './chunk-
|
|
3
|
-
export { initDeployHelpersContext } from './chunk-
|
|
2
|
+
import { fetchResult, fetchPagedListResult, cliPresentation, logger, confirm, fetchListResult, prompt, select } from './chunk-JXU4CCEI.mjs';
|
|
3
|
+
export { initDeployHelpersContext } from './chunk-JXU4CCEI.mjs';
|
|
4
4
|
import { createWorkerUploadForm, moduleTypeMimeType } from './chunk-DSGVRFIS.mjs';
|
|
5
5
|
export { createWorkerUploadForm, fromMimeType, handleUnsafeCapnp, moduleTypeMimeType } from './chunk-DSGVRFIS.mjs';
|
|
6
6
|
import { __commonJS, __name, __require, __toESM, __export } from './chunk-U6NEESU5.mjs';
|
|
@@ -12,7 +12,7 @@ import url2, { URLSearchParams as URLSearchParams$1 } from 'node:url';
|
|
|
12
12
|
import * as cli from '@cloudflare/cli-shared-helpers';
|
|
13
13
|
import { updateStatus, cancel } from '@cloudflare/cli-shared-helpers';
|
|
14
14
|
import { SchedulingPolicy, ApplicationsService, listDurableObjects, ApiError, resolveImageName, pushImageIfChanged, ContainerImagePreparationsService, ContainerImagePreparationStatus, createDurableObjectNamespaceResolver, initContainersSharedContext, pushBuiltContainerImage, deployContainers, verifyDockerInstalled } from '@cloudflare/containers-shared';
|
|
15
|
-
import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, partitionExports, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, getResolvedDurableObjectContainerApps, isDurableObjectContainerApp, getDockerPath, validateDurableObjectContainerApplications, getDurableObjectClassNameToUseSQLiteMap, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON,
|
|
15
|
+
import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, partitionExports, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, getResolvedDurableObjectContainerApps, isDurableObjectContainerApp, getDockerPath, validateDurableObjectContainerApplications, getDurableObjectClassNameToUseSQLiteMap, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON, experimental_readRawConfig, experimental_patchConfig, printBindings, PatchConfigError, COMPLIANCE_REGION_CONFIG_UNKNOWN, constructWranglerConfig, getCIMatchTag, formatConfigSnippet, DEFAULT_COMPAT_DATE, writeOutput, getDurableObjectContainerApps, getBindings, hasDurableObjectExports, parseNonHyphenedUuid, getWorkersCIBranchName, getCIOverrideName, isLiveDurableObjectExport, getBindingTypeFriendlyName, defaultWranglerConfig } from '@cloudflare/workers-utils';
|
|
16
16
|
import { Response, FormData } from 'undici';
|
|
17
17
|
import chalk6 from 'chalk';
|
|
18
18
|
import PQueue4 from 'p-queue';
|
|
@@ -2916,7 +2916,7 @@ function describeConflictOwner(remote) {
|
|
|
2916
2916
|
if (remote.source === "wrangler") {
|
|
2917
2917
|
return remote.owner_worker_name ? `owned by worker "${remote.owner_worker_name}"` : "owned by another Worker";
|
|
2918
2918
|
}
|
|
2919
|
-
return
|
|
2919
|
+
return `managed outside ${cliPresentation.displayName}`;
|
|
2920
2920
|
}
|
|
2921
2921
|
__name(describeConflictOwner, "describeConflictOwner");
|
|
2922
2922
|
function renderEmailRoutingPlan(plan, workerName) {
|
|
@@ -3587,7 +3587,7 @@ async function getQueue(complianceConfig, accountId, queueName) {
|
|
|
3587
3587
|
const queues = await listQueues(complianceConfig, accountId, 1, queueName);
|
|
3588
3588
|
if (queues.length === 0) {
|
|
3589
3589
|
throw new UserError(
|
|
3590
|
-
`Queue "${queueName}" does not exist. To create it, run:
|
|
3590
|
+
`Queue "${queueName}" does not exist. To create it, run: ${cliPresentation.commands.queuesCreate} ${queueName}`,
|
|
3591
3591
|
{ telemetryMessage: "queues lookup missing queue" }
|
|
3592
3592
|
);
|
|
3593
3593
|
}
|
|
@@ -3823,7 +3823,7 @@ async function ensureQueuesExistByConfig(config2, accountId, includeProducers =
|
|
|
3823
3823
|
for (const queue of queueNames) {
|
|
3824
3824
|
if (!queueSet.has(queue)) {
|
|
3825
3825
|
throw new UserError(
|
|
3826
|
-
`Queue "${queue}" does not exist. To create it, run:
|
|
3826
|
+
`Queue "${queue}" does not exist. To create it, run: ${cliPresentation.commands.queuesCreate} ${queue}`,
|
|
3827
3827
|
{ telemetryMessage: "queues config missing queue" }
|
|
3828
3828
|
);
|
|
3829
3829
|
}
|
|
@@ -3996,7 +3996,7 @@ async function registerSubdomain(complianceConfig, accountId, configPath, regist
|
|
|
3996
3996
|
if (subdomainAvailabilityCheckError.code === 10032) ; else if (subdomainAvailabilityCheckError.code === 10031) {
|
|
3997
3997
|
if (automaticSubdomain) {
|
|
3998
3998
|
throw new UserError(
|
|
3999
|
-
|
|
3999
|
+
`${cliPresentation.displayName} could not automatically register "${potentialName}" as your workers.dev subdomain because the name is unavailable. Register a different subdomain at https://dash.cloudflare.com/${accountId}/workers/onboarding.`,
|
|
4000
4000
|
{
|
|
4001
4001
|
telemetryMessage: "workers dev automatic registration name unavailable"
|
|
4002
4002
|
}
|
|
@@ -4009,7 +4009,7 @@ async function registerSubdomain(complianceConfig, accountId, configPath, regist
|
|
|
4009
4009
|
} else {
|
|
4010
4010
|
if (automaticSubdomain) {
|
|
4011
4011
|
throw new UserError(
|
|
4012
|
-
|
|
4012
|
+
`${cliPresentation.displayName} could not verify whether "${potentialName}" is available as your \`workers.dev\` subdomain. Register a subdomain at https://dash.cloudflare.com/${accountId}/workers/onboarding.`,
|
|
4013
4013
|
{
|
|
4014
4014
|
telemetryMessage: "workers dev automatic registration availability check failed"
|
|
4015
4015
|
}
|
|
@@ -4048,7 +4048,7 @@ async function registerSubdomain(complianceConfig, accountId, configPath, regist
|
|
|
4048
4048
|
const subdomainCreationError = err;
|
|
4049
4049
|
if (automaticSubdomain) {
|
|
4050
4050
|
throw new UserError(
|
|
4051
|
-
|
|
4051
|
+
`${cliPresentation.displayName} could not automatically register "${potentialName}" as your \`workers.dev\` subdomain. Register a subdomain at https://dash.cloudflare.com/${accountId}/workers/onboarding.`,
|
|
4052
4052
|
{
|
|
4053
4053
|
telemetryMessage: "workers dev automatic registration creation failed"
|
|
4054
4054
|
}
|
|
@@ -4530,6 +4530,22 @@ function getSubdomainValuesAPIMock(config_workers_dev, config_preview_urls, rout
|
|
|
4530
4530
|
};
|
|
4531
4531
|
}
|
|
4532
4532
|
__name(getSubdomainValuesAPIMock, "getSubdomainValuesAPIMock");
|
|
4533
|
+
function renderWorkersDevDefaultWarning(beforeEnabled, afterEnabled) {
|
|
4534
|
+
const workersDevField = cliPresentation.configFields.workersDev;
|
|
4535
|
+
const workersDevAssignment = `${workersDevField}${cliPresentation.configFieldAssignmentSeparator}${beforeEnabled}`;
|
|
4536
|
+
const status = /* @__PURE__ */ __name((enabled, past) => {
|
|
4537
|
+
if (past) {
|
|
4538
|
+
return enabled ? "enabled" : "disabled";
|
|
4539
|
+
} else {
|
|
4540
|
+
return enabled ? "enable" : "disable";
|
|
4541
|
+
}
|
|
4542
|
+
}, "status");
|
|
4543
|
+
return [
|
|
4544
|
+
`Because '${workersDevField}' is not in your ${cliPresentation.displayConfigFileName}, it will be ${status(afterEnabled, true)} for this deployment by default.`,
|
|
4545
|
+
`To override this setting, you can ${status(beforeEnabled, false)} workers.dev by explicitly setting '${workersDevAssignment}' in your ${cliPresentation.displayConfigFileName}.`
|
|
4546
|
+
].join("\n");
|
|
4547
|
+
}
|
|
4548
|
+
__name(renderWorkersDevDefaultWarning, "renderWorkersDevDefaultWarning");
|
|
4533
4549
|
async function validateSubdomainMixedState(scriptName, before, after, previewURLSuffix, firstDeploy) {
|
|
4534
4550
|
const changed = after.workers_dev !== before.workers_dev || after.preview_urls !== before.preview_urls;
|
|
4535
4551
|
if (!changed) {
|
|
@@ -4555,7 +4571,7 @@ async function validateSubdomainMixedState(scriptName, before, after, previewURL
|
|
|
4555
4571
|
"Preview URLs will automatically generate a unique, shareable link for each new version which will be accessible at:",
|
|
4556
4572
|
` ${previewUrl}`,
|
|
4557
4573
|
"",
|
|
4558
|
-
|
|
4574
|
+
`To prevent this Worker from being unintentionally public, you may want to disable the Preview URLs as well by setting \`preview_urls = false\` in your ${cliPresentation.displayConfigFileName}.`
|
|
4559
4575
|
].join("\n")
|
|
4560
4576
|
);
|
|
4561
4577
|
}
|
|
@@ -4566,7 +4582,7 @@ async function validateSubdomainMixedState(scriptName, before, after, previewURL
|
|
|
4566
4582
|
"Preview URLs will automatically generate a unique, shareable link for each new version which will be accessible at:",
|
|
4567
4583
|
` ${previewUrl}`,
|
|
4568
4584
|
"",
|
|
4569
|
-
|
|
4585
|
+
`You may want to enable the Preview URLs as well by setting \`preview_urls = true\` in your ${cliPresentation.displayConfigFileName}.`
|
|
4570
4586
|
].join("\n")
|
|
4571
4587
|
);
|
|
4572
4588
|
}
|
|
@@ -4602,19 +4618,7 @@ async function subdomainDeploy(props, accountId, scriptName, workerUrl, routes,
|
|
|
4602
4618
|
logger
|
|
4603
4619
|
);
|
|
4604
4620
|
if (!firstDeploy && config2.workers_dev == void 0 && after.enabled !== before.enabled) {
|
|
4605
|
-
|
|
4606
|
-
if (past) {
|
|
4607
|
-
return enabled ? "enabled" : "disabled";
|
|
4608
|
-
} else {
|
|
4609
|
-
return enabled ? "enable" : "disable";
|
|
4610
|
-
}
|
|
4611
|
-
}, "status");
|
|
4612
|
-
logger.warn(
|
|
4613
|
-
[
|
|
4614
|
-
`Because 'workers_dev' is not in your Wrangler file, it will be ${status(after.enabled, true)} for this deployment by default.`,
|
|
4615
|
-
`To override this setting, you can ${status(before.enabled, false)} workers.dev by explicitly setting 'workers_dev = ${before.enabled}' in your Wrangler file.`
|
|
4616
|
-
].join("\n")
|
|
4617
|
-
);
|
|
4621
|
+
logger.warn(renderWorkersDevDefaultWarning(before.enabled, after.enabled));
|
|
4618
4622
|
}
|
|
4619
4623
|
if (!firstDeploy && config2.preview_urls == void 0 && after.previews_enabled !== before.previews_enabled) {
|
|
4620
4624
|
const status = /* @__PURE__ */ __name((enabled, past) => {
|
|
@@ -4626,8 +4630,8 @@ async function subdomainDeploy(props, accountId, scriptName, workerUrl, routes,
|
|
|
4626
4630
|
}, "status");
|
|
4627
4631
|
logger.warn(
|
|
4628
4632
|
[
|
|
4629
|
-
`Because your 'workers.dev' route is ${status(after.enabled, true)} and your 'preview_urls' setting is not in your
|
|
4630
|
-
`To override this setting, you can ${status(before.previews_enabled, false)} Preview URLs by explicitly setting 'preview_urls = ${before.previews_enabled}' in your
|
|
4633
|
+
`Because your 'workers.dev' route is ${status(after.enabled, true)} and your 'preview_urls' setting is not in your ${cliPresentation.displayConfigFileName}, Preview URLs will be ${status(after.previews_enabled, true)} for this deployment by default.`,
|
|
4634
|
+
`To override this setting, you can ${status(before.previews_enabled, false)} Preview URLs by explicitly setting 'preview_urls = ${before.previews_enabled}' in your ${cliPresentation.displayConfigFileName}.`
|
|
4631
4635
|
].join("\n")
|
|
4632
4636
|
);
|
|
4633
4637
|
}
|
|
@@ -6775,7 +6779,7 @@ async function confirmLatestDeploymentOverwriteAndGetLatest(config2, accountId,
|
|
|
6775
6779
|
if (latest && latest.versions.length >= 2) {
|
|
6776
6780
|
const versionCache = /* @__PURE__ */ new Map();
|
|
6777
6781
|
cli.warn(
|
|
6778
|
-
`Your last deployment has multiple versions. To progress that deployment use "
|
|
6782
|
+
`Your last deployment has multiple versions. To progress that deployment use "${cliPresentation.commands.versionsDeploy}" instead.`,
|
|
6779
6783
|
{ shape: cli.shapes.corners.tl, newlineBefore: false }
|
|
6780
6784
|
);
|
|
6781
6785
|
cli.newline();
|
|
@@ -6789,7 +6793,7 @@ async function confirmLatestDeploymentOverwriteAndGetLatest(config2, accountId,
|
|
|
6789
6793
|
);
|
|
6790
6794
|
const confirmed = await inputPrompt({
|
|
6791
6795
|
type: "confirm",
|
|
6792
|
-
question: `"
|
|
6796
|
+
question: `"${cliPresentation.commands.deploy}" will upload a new version and deploy it globally immediately.
|
|
6793
6797
|
Are you sure you want to continue?`,
|
|
6794
6798
|
label: "",
|
|
6795
6799
|
defaultValue: isNonInteractiveOrCI(),
|
|
@@ -7119,7 +7123,7 @@ async function validateImageLessContainerApplicationsForUpload(config2, containe
|
|
|
7119
7123
|
}
|
|
7120
7124
|
if (namespace === void 0 || existing === void 0) {
|
|
7121
7125
|
throw new UserError(
|
|
7122
|
-
`Container "${container.name}" has no named images and has not been provisioned. Run
|
|
7126
|
+
`Container "${container.name}" has no named images and has not been provisioned. Run \`${cliPresentation.commands.deploy}\` to create its Durable Object-managed application before using \`${cliPresentation.commands.versionsUpload}\`, or configure at least one named image.`,
|
|
7123
7127
|
{
|
|
7124
7128
|
telemetryMessage: "versions upload image less container application missing"
|
|
7125
7129
|
}
|
|
@@ -7299,7 +7303,8 @@ async function prepareDurableObjectContainerApplications(config2, durableObjectC
|
|
|
7299
7303
|
}) {
|
|
7300
7304
|
validateDurableObjectContainerApplications(
|
|
7301
7305
|
config2,
|
|
7302
|
-
durableObjectContainerConfig
|
|
7306
|
+
durableObjectContainerConfig,
|
|
7307
|
+
cliPresentation.displayConfigFileName
|
|
7303
7308
|
);
|
|
7304
7309
|
const managedContainers = getResolvedDurableObjectContainerApps(
|
|
7305
7310
|
durableObjectContainerConfig,
|
|
@@ -7429,7 +7434,7 @@ function applyServiceAndEnvironmentTags(config2, tags) {
|
|
|
7429
7434
|
const shouldApplyTags = hasDefinedEnvironments(config2);
|
|
7430
7435
|
if (shouldApplyTags && !serviceName) {
|
|
7431
7436
|
logger.warn(
|
|
7432
|
-
|
|
7437
|
+
`No top-level \`name\` has been defined in your ${cliPresentation.displayConfigFileName}. Add a top-level \`name\` to group this Worker together with its sibling environments in the Cloudflare dashboard.`
|
|
7433
7438
|
);
|
|
7434
7439
|
}
|
|
7435
7440
|
const serviceTag = shouldApplyTags && serviceName ? `${SERVICE_TAG_PREFIX}${serviceName}` : null;
|
|
@@ -7490,7 +7495,7 @@ async function getMigrationsToUpload(scriptName, props) {
|
|
|
7490
7495
|
);
|
|
7491
7496
|
if (foundIndex === -1) {
|
|
7492
7497
|
logger.warn(
|
|
7493
|
-
`The published script ${scriptName} has a migration tag "${script.migration_tag}, which was not found in your ${configFileName(config2.configPath)} file. You may have already deleted it. Applying all available migrations to the script...`
|
|
7498
|
+
`The published script ${scriptName} has a migration tag "${script.migration_tag}, which was not found in your ${configFileName(config2.configPath, config2.userConfigPath)} file. You may have already deleted it. Applying all available migrations to the script...`
|
|
7494
7499
|
);
|
|
7495
7500
|
migrations = {
|
|
7496
7501
|
old_tag: script.migration_tag,
|
|
@@ -7991,6 +7996,11 @@ var ProvisionResourceHandler = class {
|
|
|
7991
7996
|
connect(id) {
|
|
7992
7997
|
this.binding[this.idField] = id;
|
|
7993
7998
|
}
|
|
7999
|
+
/** Returns the resource identifier, or undefined if it is empty or inherited. */
|
|
8000
|
+
getResolvedIdentifier() {
|
|
8001
|
+
const identifier = this.binding[this.idField];
|
|
8002
|
+
return typeof identifier === "string" && identifier.length > 0 ? identifier : void 0;
|
|
8003
|
+
}
|
|
7994
8004
|
hasConfiguredResourceIdentifier() {
|
|
7995
8005
|
const id = this.binding[this.idField];
|
|
7996
8006
|
return typeof id === "string" && id.length > 0 || this.name !== void 0;
|
|
@@ -8592,25 +8602,71 @@ function getRawConfigBindings(config2, resourceType) {
|
|
|
8592
8602
|
return config2[configField] ?? [];
|
|
8593
8603
|
}
|
|
8594
8604
|
__name(getRawConfigBindings, "getRawConfigBindings");
|
|
8595
|
-
function addBindingToPatch(patch, resourceType, binding) {
|
|
8596
|
-
const serialisableBinding = Object.fromEntries(
|
|
8597
|
-
Object.entries(binding).filter(
|
|
8598
|
-
([_, value]) => value !== void 0 && typeof value !== "symbol"
|
|
8599
|
-
)
|
|
8600
|
-
);
|
|
8605
|
+
function addBindingToPatch(patch, resourceType, binding, index) {
|
|
8601
8606
|
if (resourceType === "queue") {
|
|
8602
8607
|
patch.queues ??= {};
|
|
8603
8608
|
patch.queues.producers ??= [];
|
|
8604
|
-
patch.queues.producers
|
|
8609
|
+
patch.queues.producers[index] = binding;
|
|
8605
8610
|
return;
|
|
8606
8611
|
}
|
|
8607
8612
|
const configField = HANDLERS[resourceType].configField;
|
|
8608
8613
|
patch[configField] ??= [];
|
|
8609
|
-
patch[configField]
|
|
8610
|
-
|
|
8611
|
-
);
|
|
8614
|
+
const patchBindings = patch[configField];
|
|
8615
|
+
patchBindings[index] = binding;
|
|
8612
8616
|
}
|
|
8613
8617
|
__name(addBindingToPatch, "addBindingToPatch");
|
|
8618
|
+
function writeProvisionedIdsToConfig(configPath, resources, targetEnvironment) {
|
|
8619
|
+
const { rawConfig } = experimental_readRawConfig(
|
|
8620
|
+
{ config: configPath },
|
|
8621
|
+
{ useRedirectIfAvailable: false }
|
|
8622
|
+
);
|
|
8623
|
+
const environment = targetEnvironment && rawConfig.env?.[targetEnvironment] !== void 0 ? targetEnvironment : void 0;
|
|
8624
|
+
const configEnvironment = environment ? rawConfig.env?.[environment] : rawConfig;
|
|
8625
|
+
const patchEnvironment = {};
|
|
8626
|
+
const patch = environment ? { env: { [environment]: patchEnvironment } } : patchEnvironment;
|
|
8627
|
+
let hasChanges = false;
|
|
8628
|
+
for (const resource of resources) {
|
|
8629
|
+
const configBindings = getRawConfigBindings(
|
|
8630
|
+
configEnvironment ?? {},
|
|
8631
|
+
resource.resourceType
|
|
8632
|
+
);
|
|
8633
|
+
const index = configBindings.findIndex(
|
|
8634
|
+
(binding) => binding.binding === resource.binding
|
|
8635
|
+
);
|
|
8636
|
+
if (index === -1) {
|
|
8637
|
+
continue;
|
|
8638
|
+
}
|
|
8639
|
+
const identifier = resource.handler.getResolvedIdentifier();
|
|
8640
|
+
if (identifier === void 0) {
|
|
8641
|
+
continue;
|
|
8642
|
+
}
|
|
8643
|
+
const { binding: _, ...configBinding } = toConfigBinding(resource.binding, {
|
|
8644
|
+
type: resource.resourceType,
|
|
8645
|
+
[resource.handler.idField]: identifier
|
|
8646
|
+
});
|
|
8647
|
+
const identifierPatch = {};
|
|
8648
|
+
const existingBinding = configBindings[index];
|
|
8649
|
+
for (const [field, value] of Object.entries(configBinding)) {
|
|
8650
|
+
if (typeof value === "string" && value !== existingBinding[field]) {
|
|
8651
|
+
identifierPatch[field] = value;
|
|
8652
|
+
}
|
|
8653
|
+
}
|
|
8654
|
+
if (Object.keys(identifierPatch).length === 0) {
|
|
8655
|
+
continue;
|
|
8656
|
+
}
|
|
8657
|
+
addBindingToPatch(
|
|
8658
|
+
patchEnvironment,
|
|
8659
|
+
resource.resourceType,
|
|
8660
|
+
identifierPatch,
|
|
8661
|
+
index
|
|
8662
|
+
);
|
|
8663
|
+
hasChanges = true;
|
|
8664
|
+
}
|
|
8665
|
+
if (hasChanges) {
|
|
8666
|
+
experimental_patchConfig(configPath, patch, false);
|
|
8667
|
+
}
|
|
8668
|
+
}
|
|
8669
|
+
__name(writeProvisionedIdsToConfig, "writeProvisionedIdsToConfig");
|
|
8614
8670
|
function isPermissionDeniedAPIError(error62) {
|
|
8615
8671
|
return error62 instanceof APIError && error62.status === 403;
|
|
8616
8672
|
}
|
|
@@ -8744,6 +8800,7 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
|
|
|
8744
8800
|
logger.debug("No settings found");
|
|
8745
8801
|
}
|
|
8746
8802
|
const pendingResources = [];
|
|
8803
|
+
const resolvedResources = [];
|
|
8747
8804
|
const skippedProvisioning = /* @__PURE__ */ new Map();
|
|
8748
8805
|
for (const [bindingName, binding] of Object.entries(bindings ?? {})) {
|
|
8749
8806
|
if (!isProvisionableBinding(binding)) {
|
|
@@ -8755,6 +8812,12 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
|
|
|
8755
8812
|
complianceConfig,
|
|
8756
8813
|
accountId
|
|
8757
8814
|
);
|
|
8815
|
+
const resource = {
|
|
8816
|
+
binding: bindingName,
|
|
8817
|
+
resourceType: binding.type,
|
|
8818
|
+
handler
|
|
8819
|
+
};
|
|
8820
|
+
const configuredIdentifier = handler.getResolvedIdentifier();
|
|
8758
8821
|
let shouldProvision;
|
|
8759
8822
|
try {
|
|
8760
8823
|
shouldProvision = await handler.shouldProvision(settings);
|
|
@@ -8767,14 +8830,13 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
|
|
|
8767
8830
|
continue;
|
|
8768
8831
|
}
|
|
8769
8832
|
if (shouldProvision) {
|
|
8770
|
-
pendingResources.push(
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
handler
|
|
8774
|
-
});
|
|
8833
|
+
pendingResources.push(resource);
|
|
8834
|
+
} else if (configuredIdentifier === void 0 && handler.getResolvedIdentifier() !== void 0) {
|
|
8835
|
+
resolvedResources.push(resource);
|
|
8775
8836
|
}
|
|
8776
8837
|
}
|
|
8777
8838
|
return {
|
|
8839
|
+
resolvedResources,
|
|
8778
8840
|
pendingResources: pendingResources.sort(
|
|
8779
8841
|
(a, b) => HANDLERS[a.resourceType].sort - HANDLERS[b.resourceType].sort
|
|
8780
8842
|
),
|
|
@@ -8784,7 +8846,7 @@ async function collectPendingResources(complianceConfig, accountId, scriptName,
|
|
|
8784
8846
|
__name(collectPendingResources, "collectPendingResources");
|
|
8785
8847
|
async function provisionBindings(bindings, accountId, scriptName, autoCreate, config2, options) {
|
|
8786
8848
|
const configPath = config2.userConfigPath ?? config2.configPath;
|
|
8787
|
-
const { pendingResources, skippedProvisioning } = await collectPendingResources(config2, accountId, scriptName, bindings);
|
|
8849
|
+
const { pendingResources, resolvedResources, skippedProvisioning } = await collectPendingResources(config2, accountId, scriptName, bindings);
|
|
8788
8850
|
if (pendingResources.length > 0) {
|
|
8789
8851
|
assert6(
|
|
8790
8852
|
configPath,
|
|
@@ -8829,6 +8891,7 @@ async function provisionBindings(bindings, accountId, scriptName, autoCreate, co
|
|
|
8829
8891
|
scriptName,
|
|
8830
8892
|
autoCreate
|
|
8831
8893
|
);
|
|
8894
|
+
resolvedResources.push(resource);
|
|
8832
8895
|
}
|
|
8833
8896
|
for (const [bindingName, binding] of Object.entries(bindings ?? {})) {
|
|
8834
8897
|
if (binding.type === "queue" && typeof binding.queue_name === "string") {
|
|
@@ -8840,44 +8903,17 @@ async function provisionBindings(bindings, accountId, scriptName, autoCreate, co
|
|
|
8840
8903
|
}
|
|
8841
8904
|
}
|
|
8842
8905
|
}
|
|
8843
|
-
const patch = {};
|
|
8844
|
-
const existingBindingNames = /* @__PURE__ */ new Map();
|
|
8845
|
-
const isUsingRedirectedConfig = config2.userConfigPath && config2.userConfigPath !== config2.configPath;
|
|
8846
|
-
if (isUsingRedirectedConfig) {
|
|
8847
|
-
const { rawConfig: unredirectedConfig } = await experimental_readRawConfig(
|
|
8848
|
-
{ config: config2.userConfigPath },
|
|
8849
|
-
{ useRedirectIfAvailable: false }
|
|
8850
|
-
);
|
|
8851
|
-
for (const resourceType of Object.keys(
|
|
8852
|
-
HANDLERS
|
|
8853
|
-
)) {
|
|
8854
|
-
const bindingNames = /* @__PURE__ */ new Set();
|
|
8855
|
-
for (const binding of getRawConfigBindings(
|
|
8856
|
-
unredirectedConfig,
|
|
8857
|
-
resourceType
|
|
8858
|
-
)) {
|
|
8859
|
-
bindingNames.add(binding.binding);
|
|
8860
|
-
}
|
|
8861
|
-
existingBindingNames.set(resourceType, bindingNames);
|
|
8862
|
-
}
|
|
8863
|
-
}
|
|
8864
|
-
for (const [bindingName, binding] of Object.entries(bindings ?? {})) {
|
|
8865
|
-
if (!isProvisionableBinding(binding)) {
|
|
8866
|
-
continue;
|
|
8867
|
-
}
|
|
8868
|
-
if (isUsingRedirectedConfig && !existingBindingNames.get(binding.type)?.has(bindingName)) {
|
|
8869
|
-
continue;
|
|
8870
|
-
}
|
|
8871
|
-
const bindingToWrite = toConfigBinding(bindingName, binding);
|
|
8872
|
-
addBindingToPatch(patch, binding.type, bindingToWrite);
|
|
8873
|
-
}
|
|
8874
8906
|
if (options.skipConfigWriteback) {
|
|
8875
8907
|
logger.log(
|
|
8876
8908
|
"Your Worker was deployed with provisioned resources. You may add the resource IDs to your config file if you wish, but future deploys will continue to work even without IDs."
|
|
8877
8909
|
);
|
|
8878
8910
|
} else if (!isNonInteractiveOrCI()) {
|
|
8879
8911
|
try {
|
|
8880
|
-
|
|
8912
|
+
writeProvisionedIdsToConfig(
|
|
8913
|
+
configPath,
|
|
8914
|
+
resolvedResources,
|
|
8915
|
+
config2.targetEnvironment
|
|
8916
|
+
);
|
|
8881
8917
|
logger.log(
|
|
8882
8918
|
"Your Worker was deployed with provisioned resources. We've written the IDs of these resources to your config file, which you can choose to save or discard. Either way future deploys will continue to work."
|
|
8883
8919
|
);
|
|
@@ -8886,6 +8922,16 @@ async function provisionBindings(bindings, accountId, scriptName, autoCreate, co
|
|
|
8886
8922
|
throw e;
|
|
8887
8923
|
}
|
|
8888
8924
|
}
|
|
8925
|
+
if (config2.userConfigPath && config2.userConfigPath !== config2.configPath) {
|
|
8926
|
+
assert6(config2.configPath);
|
|
8927
|
+
try {
|
|
8928
|
+
writeProvisionedIdsToConfig(config2.configPath, resolvedResources);
|
|
8929
|
+
} catch (error62) {
|
|
8930
|
+
if (!(error62 instanceof PatchConfigError)) {
|
|
8931
|
+
logger.warn(`Could not update the generated config: ${error62}`);
|
|
8932
|
+
}
|
|
8933
|
+
}
|
|
8934
|
+
}
|
|
8889
8935
|
}
|
|
8890
8936
|
logger.log(`\u{1F389} Resources provisioned, continuing with deployment...
|
|
8891
8937
|
`);
|
|
@@ -9060,27 +9106,30 @@ async function createD1Database(complianceConfig, accountId, name) {
|
|
|
9060
9106
|
});
|
|
9061
9107
|
}
|
|
9062
9108
|
if (errorCode === 7406) {
|
|
9063
|
-
throw new UserError(
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
On the Workers Free plan? Upgrade to create more:
|
|
9068
|
-
https://dash.cloudflare.com/${accountId}/workers/plans
|
|
9069
|
-
|
|
9070
|
-
Already on a paid plan? You can request a higher limit — learn more in the D1 docs:
|
|
9071
|
-
https://developers.cloudflare.com/d1/
|
|
9072
|
-
|
|
9073
|
-
Or free up space:
|
|
9074
|
-
To list your existing databases, run: wrangler d1 list
|
|
9075
|
-
To delete a database, run: wrangler d1 delete <database-name>
|
|
9076
|
-
`,
|
|
9077
|
-
{ telemetryMessage: "d1 create database limit reached" }
|
|
9078
|
-
);
|
|
9109
|
+
throw new UserError(renderD1DatabaseLimitError(accountId), {
|
|
9110
|
+
telemetryMessage: "d1 create database limit reached"
|
|
9111
|
+
});
|
|
9079
9112
|
}
|
|
9080
9113
|
throw e;
|
|
9081
9114
|
}
|
|
9082
9115
|
}
|
|
9083
9116
|
__name(createD1Database, "createD1Database");
|
|
9117
|
+
function renderD1DatabaseLimitError(accountId) {
|
|
9118
|
+
return esm_default`
|
|
9119
|
+
You have reached the maximum number of D1 databases for your account.
|
|
9120
|
+
|
|
9121
|
+
On the Workers Free plan? Upgrade to create more:
|
|
9122
|
+
https://dash.cloudflare.com/${accountId}/workers/plans
|
|
9123
|
+
|
|
9124
|
+
Already on a paid plan? You can request a higher limit — learn more in the D1 docs:
|
|
9125
|
+
https://developers.cloudflare.com/d1/
|
|
9126
|
+
|
|
9127
|
+
Or free up space:
|
|
9128
|
+
To list your existing databases, run: ${cliPresentation.commands.d1List}
|
|
9129
|
+
To delete a database, run: ${cliPresentation.commands.d1Delete} <database-name>
|
|
9130
|
+
`;
|
|
9131
|
+
}
|
|
9132
|
+
__name(renderD1DatabaseLimitError, "renderD1DatabaseLimitError");
|
|
9084
9133
|
async function listDatabases(complianceConfig, accountId, limitCalls = false, pageSize = 10) {
|
|
9085
9134
|
let page = 1;
|
|
9086
9135
|
const results = [];
|
|
@@ -9228,9 +9277,9 @@ function addRequiredSecretsInheritBindings(config2, bindings, options) {
|
|
|
9228
9277
|
if (options.type === "deploy" && !options.workerExists) {
|
|
9229
9278
|
throw new UserError(
|
|
9230
9279
|
`The following required secrets have not been set: ${inheritedSecrets.join(", ")}
|
|
9231
|
-
This Worker does not exist yet, so secrets cannot be set in advance with
|
|
9280
|
+
This Worker does not exist yet, so secrets cannot be set in advance with \`${cliPresentation.commands.secretPut}\`.
|
|
9232
9281
|
To deploy a new Worker with secrets, supply them via a secrets file:
|
|
9233
|
-
|
|
9282
|
+
${cliPresentation.commands.deploy} --secrets-file <path-to-file>
|
|
9234
9283
|
where the file contains lines in the format \`SECRET_NAME=value\` (or JSON).
|
|
9235
9284
|
See https://developers.cloudflare.com/workers/configuration/secrets/#secrets-on-deployed-workers for more information.`,
|
|
9236
9285
|
{ telemetryMessage: "required secrets missing before first deploy" }
|
|
@@ -9248,8 +9297,8 @@ function handleMissingSecretsError(err, config2, options) {
|
|
|
9248
9297
|
const missingSecretNames = err.notes.map((note) => note.text.match(/^inherit binding '(.+?)' is invalid/)).filter((match) => match !== null).map((match) => match[1]).filter((secretName) => config2.secrets?.required?.includes(secretName));
|
|
9249
9298
|
if (missingSecretNames.length > 0) {
|
|
9250
9299
|
err.preventReport();
|
|
9251
|
-
const secretPutCommand =
|
|
9252
|
-
const secretsFileCommand =
|
|
9300
|
+
const secretPutCommand = options.type === "deploy" ? cliPresentation.commands.secretPut : cliPresentation.commands.versionsSecretPut;
|
|
9301
|
+
const secretsFileCommand = `${options.type === "deploy" ? cliPresentation.commands.deploy : cliPresentation.commands.versionsUpload} --secrets-file <path-to-file>`;
|
|
9253
9302
|
const action = options.type === "deploy" ? "deploying" : "uploading";
|
|
9254
9303
|
throw new UserError(
|
|
9255
9304
|
`The following required secrets have not been set: ${missingSecretNames.join(", ")}
|
|
@@ -30052,7 +30101,7 @@ async function checkWorkflowConflicts(config2, accountId, scriptName) {
|
|
|
30052
30101
|
const message = `The following workflow(s) already exist and belong to different workers:
|
|
30053
30102
|
${conflictList}
|
|
30054
30103
|
|
|
30055
|
-
Deploying will reassign these workflows to "${scriptName}". Workflow names must be unique per account. If this reassignment is unintended, rename the workflow(s) in
|
|
30104
|
+
Deploying will reassign these workflows to "${scriptName}". Workflow names must be unique per account. If this reassignment is unintended, rename the workflow(s) in your ${cliPresentation.displayConfigFileName}.`;
|
|
30056
30105
|
return { hasConflicts: true, conflicts, message };
|
|
30057
30106
|
}
|
|
30058
30107
|
__name(checkWorkflowConflicts, "checkWorkflowConflicts");
|
|
@@ -30721,7 +30770,7 @@ async function verifyWorkerMatchesCITag(complianceConfig, accountId, workerName,
|
|
|
30721
30770
|
logger.debug(e);
|
|
30722
30771
|
if (isWorkerNotFoundError(e)) {
|
|
30723
30772
|
throw new FatalError(
|
|
30724
|
-
`The
|
|
30773
|
+
`The Worker "${workerName}" was not found in your account. Check that the name in your ${configFileName(configPath)} file is correct and that the Worker exists in this account.`,
|
|
30725
30774
|
{ telemetryMessage: "ci match tag worker not found" }
|
|
30726
30775
|
);
|
|
30727
30776
|
} else if (e instanceof APIError) {
|
|
@@ -30731,7 +30780,7 @@ async function verifyWorkerMatchesCITag(complianceConfig, accountId, workerName,
|
|
|
30731
30780
|
);
|
|
30732
30781
|
} else {
|
|
30733
30782
|
throw new FatalError(
|
|
30734
|
-
|
|
30783
|
+
`${cliPresentation.displayName} cannot validate that your Worker name matches what is expected by the build system. Please retry the build. If the problem persists, please contact support.`,
|
|
30735
30784
|
{ telemetryMessage: "ci match tag validation failed" }
|
|
30736
30785
|
);
|
|
30737
30786
|
}
|
|
@@ -30896,7 +30945,7 @@ function validateWorkerProps(props, config2) {
|
|
|
30896
30945
|
if (!compatibilityDate) {
|
|
30897
30946
|
const compatibilityDateStr = DEFAULT_COMPAT_DATE;
|
|
30898
30947
|
throw new UserError(
|
|
30899
|
-
`A compatibility_date is required when uploading a Worker. Add the following to your ${configFileName(config2.configPath)} file:
|
|
30948
|
+
`A compatibility_date is required when uploading a Worker. Add the following to your ${configFileName(config2.configPath, config2.userConfigPath)} file:
|
|
30900
30949
|
\`\`\`
|
|
30901
30950
|
${formatConfigSnippet({ compatibility_date: compatibilityDateStr }, config2.configPath, false)}
|
|
30902
30951
|
\`\`\`
|
|
@@ -30915,13 +30964,13 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
30915
30964
|
}
|
|
30916
30965
|
if (config2.text_blobs && format === "modules") {
|
|
30917
30966
|
throw new UserError(
|
|
30918
|
-
`You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config2.configPath)} file`,
|
|
30967
|
+
`You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config2.configPath, config2.userConfigPath)} file`,
|
|
30919
30968
|
{ telemetryMessage: "text_blobs with es module worker" }
|
|
30920
30969
|
);
|
|
30921
30970
|
}
|
|
30922
30971
|
if (config2.data_blobs && format === "modules") {
|
|
30923
30972
|
throw new UserError(
|
|
30924
|
-
`You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config2.configPath)} file`,
|
|
30973
|
+
`You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config2.configPath, config2.userConfigPath)} file`,
|
|
30925
30974
|
{ telemetryMessage: "data_blobs with es module worker" }
|
|
30926
30975
|
);
|
|
30927
30976
|
}
|
|
@@ -30996,7 +31045,7 @@ async function preUploadApiChecks(props, config2) {
|
|
|
30996
31045
|
tags = script.tags ?? tags;
|
|
30997
31046
|
if (props.command === "deploy" && props.failIfWorkerNameTaken) {
|
|
30998
31047
|
throw new UserError(
|
|
30999
|
-
`A Worker named "${name}" already exists in your account. This deploy could not confirm that it should update that Worker, so it stopped instead of overwriting it. To update the existing Worker, add a
|
|
31048
|
+
`A Worker named "${name}" already exists in your account. This deploy could not confirm that it should update that Worker, so it stopped instead of overwriting it. To update the existing Worker, add a ${cliPresentation.displayConfigFileName} that names "${name}"; to deploy separately, use a different name.`,
|
|
31000
31049
|
{ telemetryMessage: "deploy unverified worker name already exists" }
|
|
31001
31050
|
);
|
|
31002
31051
|
}
|
|
@@ -31546,7 +31595,7 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
31546
31595
|
err.preventReport();
|
|
31547
31596
|
if (err.notes[0].text === "binding DB of type d1 must have a valid `id` specified [code: 10021]") {
|
|
31548
31597
|
throw new UserError(
|
|
31549
|
-
|
|
31598
|
+
`You must use a real database in the database_id configuration. You can find your databases using '${cliPresentation.commands.d1List}', or read how to develop locally with D1 here: https://developers.cloudflare.com/d1/configuration/local-development`,
|
|
31550
31599
|
{ telemetryMessage: "deploy d1 database binding invalid id" }
|
|
31551
31600
|
);
|
|
31552
31601
|
}
|
|
@@ -31585,7 +31634,12 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
31585
31634
|
logger.log("Uploaded", workerName, formatTime(uploadMs));
|
|
31586
31635
|
if (shouldDeployContainers) {
|
|
31587
31636
|
assert6(versionId && accountId);
|
|
31588
|
-
initContainersSharedContext({
|
|
31637
|
+
initContainersSharedContext({
|
|
31638
|
+
cliPresentation,
|
|
31639
|
+
logger,
|
|
31640
|
+
fetchPagedListResult,
|
|
31641
|
+
fetchResult
|
|
31642
|
+
});
|
|
31589
31643
|
const containerDeployments = [];
|
|
31590
31644
|
for (const container of normalisedContainerConfig) {
|
|
31591
31645
|
if ("dockerfile" in container) {
|
|
@@ -31639,7 +31693,7 @@ async function deployWorker(props, config2, buildResult, callbacks) {
|
|
|
31639
31693
|
);
|
|
31640
31694
|
} catch (error62) {
|
|
31641
31695
|
throw new UserError(
|
|
31642
|
-
|
|
31696
|
+
`The Worker version was deployed, but ${cliPresentation.displayName} could not finish applying its Durable Object-managed Container application settings. Re-run the same \`${cliPresentation.commands.deploy}\` command to retry and finish deployment.`,
|
|
31643
31697
|
{
|
|
31644
31698
|
telemetryMessage: "deploy durable object container application creation failed after deployment",
|
|
31645
31699
|
cause: error62
|
|
@@ -31751,7 +31805,7 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
|
|
|
31751
31805
|
});
|
|
31752
31806
|
if (migrations !== void 0) {
|
|
31753
31807
|
throw new UserError(
|
|
31754
|
-
|
|
31808
|
+
`This Worker has a pending Durable Object migration, which cannot be applied by \`${cliPresentation.commands.versionsUpload}\`. Durable Object migrations must be applied with \`${cliPresentation.commands.deploy}\`. Run \`${cliPresentation.commands.deploy}\` to apply the migration, then retry \`${cliPresentation.commands.versionsUpload}\`.`,
|
|
31755
31809
|
{ telemetryMessage: "versions upload pending durable object migration" }
|
|
31756
31810
|
);
|
|
31757
31811
|
}
|
|
@@ -32004,8 +32058,8 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
|
|
|
32004
32058
|
}
|
|
32005
32059
|
}
|
|
32006
32060
|
}
|
|
32007
|
-
const cmdVersionsDeploy = blue(
|
|
32008
|
-
const cmdTriggersDeploy = blue(
|
|
32061
|
+
const cmdVersionsDeploy = blue(cliPresentation.commands.versionsDeploy);
|
|
32062
|
+
const cmdTriggersDeploy = blue(cliPresentation.commands.triggersDeploy);
|
|
32009
32063
|
logger.info(
|
|
32010
32064
|
gray(`
|
|
32011
32065
|
To deploy this version to production traffic use the command ${cmdVersionsDeploy}
|
|
@@ -32142,7 +32196,7 @@ function validateNodeCompatMode(compatibilityDateStr = "2000-01-01", compatibili
|
|
|
32142
32196
|
}
|
|
32143
32197
|
if (noBundle && hasNodejsCompatV2Flag) {
|
|
32144
32198
|
logger.warn(
|
|
32145
|
-
|
|
32199
|
+
`\`nodejs_compat_v2\` compatibility flag and \`--no-bundle\` can't be used together. If you want to polyfill Node.js built-ins and disable ${cliPresentation.displayName}'s bundling, please polyfill as part of your own bundling process.`
|
|
32146
32200
|
);
|
|
32147
32201
|
}
|
|
32148
32202
|
return mode;
|
|
@@ -32158,7 +32212,7 @@ function renderInconsistentExportsAcrossVersionsError(serverMessage) {
|
|
|
32158
32212
|
"",
|
|
32159
32213
|
"What to do:",
|
|
32160
32214
|
" 1. Deploy the version that changes `exports` at 100% first:",
|
|
32161
|
-
|
|
32215
|
+
` ${cliPresentation.commands.versionsDeployAt(100)}`,
|
|
32162
32216
|
" 2. Once that deploy is stable, run your percentage-split deploy.",
|
|
32163
32217
|
"",
|
|
32164
32218
|
"Learn more: https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#gradual-deployments-for-durable-objects"
|
|
@@ -32487,7 +32541,8 @@ function resolveWorkerName(args, config2) {
|
|
|
32487
32541
|
if (!workerName) {
|
|
32488
32542
|
throw new UserError(
|
|
32489
32543
|
`Required Worker name missing. Please specify the Worker name in your ${configFileName(
|
|
32490
|
-
config2.configPath
|
|
32544
|
+
config2.configPath,
|
|
32545
|
+
config2.userConfigPath
|
|
32491
32546
|
)} file, or pass it with --worker-name <worker-name>.`,
|
|
32492
32547
|
{ telemetryMessage: "preview command missing worker name" }
|
|
32493
32548
|
);
|
|
@@ -32939,7 +32994,7 @@ function buildPreviewContainerConfig(config2, parentWorkerName, previewSlug, pre
|
|
|
32939
32994
|
continue;
|
|
32940
32995
|
}
|
|
32941
32996
|
throw new UserError(
|
|
32942
|
-
`The container class_name "${className}" in "previews.containers" does not match any Durable Object class in your ${configFileName(config2.configPath)} file. Declare the class in "migrations" or "exports", or bind it under "previews.durable_objects".`,
|
|
32997
|
+
`The container class_name "${className}" in "previews.containers" does not match any Durable Object class in your ${configFileName(config2.configPath, config2.userConfigPath)} file. Declare the class in "migrations" or "exports", or bind it under "previews.durable_objects".`,
|
|
32943
32998
|
{
|
|
32944
32999
|
telemetryMessage: "no preview DO class matches container class_name"
|
|
32945
33000
|
}
|
|
@@ -33077,7 +33132,7 @@ function formatNoActivePreviewUrlsMessage(config2) {
|
|
|
33077
33132
|
}
|
|
33078
33133
|
const workersDevAlreadyConfigured = config2.preview_urls === true;
|
|
33079
33134
|
const customDomainAlreadyConfigured = customDomainRoute?.previews_enabled === true;
|
|
33080
|
-
const cautionText = workersDevAlreadyConfigured && customDomainAlreadyConfigured ?
|
|
33135
|
+
const cautionText = workersDevAlreadyConfigured && customDomainAlreadyConfigured ? `Caution: \`${cliPresentation.commands.deploy}\` publishes the code in your current checkout to the deployed Worker. If you have already made this change, confirm it was applied by running \`${cliPresentation.commands.deploy}\` from a clean checkout of your production branch. Then return to your feature branch and run \`${cliPresentation.commands.preview}\` again.` : `Caution: \`${cliPresentation.commands.deploy}\` publishes the code in your current checkout to the deployed Worker, not only these settings. If you use Git, commit the configuration change and run \`${cliPresentation.commands.deploy}\` from a clean checkout of your production branch. Then return to your feature branch and run \`${cliPresentation.commands.preview}\` again.`;
|
|
33081
33136
|
let workersDevInstruction = `Add this to your ${configName}:`;
|
|
33082
33137
|
if (config2.preview_urls === true) {
|
|
33083
33138
|
workersDevInstruction = `Your ${configName} already contains:`;
|
|
@@ -33123,7 +33178,8 @@ function getPreviewMigrationsToUpload(workerName, config2, currentMigrationTag)
|
|
|
33123
33178
|
if (foundIndex === -1) {
|
|
33124
33179
|
logger.warn(
|
|
33125
33180
|
`The published preview for ${workerName} has a migration tag "${currentMigrationTag}", which was not found in your ${configFileName(
|
|
33126
|
-
config2.configPath
|
|
33181
|
+
config2.configPath,
|
|
33182
|
+
config2.userConfigPath
|
|
33127
33183
|
)} file. You may have already deleted it. Applying all available migrations to the preview...`
|
|
33128
33184
|
);
|
|
33129
33185
|
return {
|
|
@@ -33387,7 +33443,7 @@ function logMissingCustomDomainPreviewUrlsWarning(config2, previewResource, depl
|
|
|
33387
33443
|
}
|
|
33388
33444
|
logger.log("");
|
|
33389
33445
|
logger.warn(
|
|
33390
|
-
|
|
33446
|
+
`Custom domain Preview URLs are configured, but none are active for this Preview. If you added \`previews_enabled = true\` after your last deployment, run \`${cliPresentation.commands.deploy}\` once to publish the custom domain Preview route, then run \`${cliPresentation.commands.preview}\` again. If you already deployed with that setting, the custom domain may still be provisioning.`
|
|
33391
33447
|
);
|
|
33392
33448
|
}
|
|
33393
33449
|
__name(logMissingCustomDomainPreviewUrlsWarning, "logMissingCustomDomainPreviewUrlsWarning");
|
|
@@ -33918,4 +33974,4 @@ __name(formatBindings, "formatBindings");
|
|
|
33918
33974
|
* THE SOFTWARE.
|
|
33919
33975
|
*/
|
|
33920
33976
|
|
|
33921
|
-
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, EXPORTS_RECONCILIATION_ERROR_CODE, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, PREVIEW_DOMAIN_PROVISIONING_NOTE, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, assertPreviewBuildOutputRootConfig, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createDurableObjectContainerApplication, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployDurableObjectContainerApplications, deployVersionedDurableObjectContainerApplications, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, ensureQueuesExistByConfig, extractBuildOutputBindings, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatNoActivePreviewUrlsMessage, generatePreviewAlias, getBindingValue, getBranchName2 as getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getVersionedDurableObjectContainerApplications, getWorkerSubdomain, getWorkersDevSubdomain, getWorkersDevSubdomainIfAccessible, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, prepareDurableObjectContainerApplications, preview, previewBuildOutput, previewContainerAppName, previewDelete, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveVersionedDurableObjectContainerApplications, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateImageLessContainerApplicationsForUpload, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };
|
|
33977
|
+
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, EXPORTS_RECONCILIATION_ERROR_CODE, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, PREVIEW_DOMAIN_PROVISIONING_NOTE, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewScriptSettings, assertPreviewBuildOutputRootConfig, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createDurableObjectContainerApplication, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployDurableObjectContainerApplications, deployVersionedDurableObjectContainerApplications, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, ensureQueuesExistByConfig, extractBuildOutputBindings, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatNoActivePreviewUrlsMessage, generatePreviewAlias, getBindingValue, getBranchName2 as getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getVersionedDurableObjectContainerApplications, getWorkerSubdomain, getWorkersDevSubdomain, getWorkersDevSubdomainIfAccessible, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, prepareDurableObjectContainerApplications, preview, previewBuildOutput, previewContainerAppName, previewDelete, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderD1DatabaseLimitError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, renderWorkersDevDefaultWarning, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveVersionedDurableObjectContainerApplications, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateImageLessContainerApplicationsForUpload, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };
|