@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.
@@ -1,9 +1,8 @@
1
1
  import { createRequire } from 'node:module';
2
2
  import { __name } from './chunk-U6NEESU5.mjs';
3
+ import { resolveCliPresentation } from '@cloudflare/workers-utils';
3
4
 
4
5
  createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
5
-
6
- // src/shared/context.ts
7
6
  var logger;
8
7
  var fetchResult;
9
8
  var fetchListResult;
@@ -12,7 +11,9 @@ var fetchKVGetValue;
12
11
  var confirm;
13
12
  var prompt;
14
13
  var select;
14
+ var cliPresentation = resolveCliPresentation();
15
15
  function initDeployHelpersContext(ctx) {
16
+ cliPresentation = resolveCliPresentation(ctx.cliPresentation);
16
17
  logger = ctx.logger;
17
18
  fetchResult = ctx.fetchResult;
18
19
  fetchListResult = ctx.fetchListResult;
@@ -24,4 +25,4 @@ function initDeployHelpersContext(ctx) {
24
25
  }
25
26
  __name(initDeployHelpersContext, "initDeployHelpersContext");
26
27
 
27
- export { confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, logger, prompt, select };
28
+ export { cliPresentation, confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, logger, prompt, select };
@@ -1,8 +1,10 @@
1
1
  import { BuiltImage, ContainerNormalizedConfig, BuiltContainerImage } from '@cloudflare/containers-shared';
2
- import { ContainerApp, Config, FetchResultFetcher, FetchListResultFetcher, FetchPagedListResultFetcher, FetchKVGetValueFetcher, Logger, Entry, ValidatedAssetsOptions, LegacyAssetPaths, Route, DurableObjectCodeUpdateStrategy, CfModule, CfWorkerSourceMap, CfModuleType } from '@cloudflare/workers-utils';
2
+ import { ContainerApp, Config, CliPresentationOverrides, FetchResultFetcher, FetchListResultFetcher, FetchPagedListResultFetcher, FetchKVGetValueFetcher, Logger, Entry, ValidatedAssetsOptions, LegacyAssetPaths, Route, DurableObjectCodeUpdateStrategy, CfModule, CfWorkerSourceMap, CfModuleType, CliPresentation } from '@cloudflare/workers-utils';
3
3
 
4
4
  /** API, logging, and prompt implementations supplied by the consumer. */
5
5
  type DeployHelpersContext = {
6
+ /** Consumer-specific names and commands used in user-facing output. */
7
+ cliPresentation?: CliPresentationOverrides;
6
8
  fetchResult: FetchResultFetcher;
7
9
  fetchListResult: FetchListResultFetcher;
8
10
  fetchPagedListResult: FetchPagedListResultFetcher;
@@ -195,10 +197,11 @@ declare let fetchKVGetValue: FetchKVGetValueFetcher;
195
197
  declare let confirm: DeployHelpersContext["confirm"];
196
198
  declare let prompt: DeployHelpersContext["prompt"];
197
199
  declare let select: DeployHelpersContext["select"];
200
+ declare let cliPresentation: CliPresentation;
198
201
  /**
199
202
  * Set the global context for deploy-helpers. Must be called once at
200
203
  * startup before any deploy-helpers function that needs these values.
201
204
  */
202
205
  declare function initDeployHelpersContext(ctx: DeployHelpersContext): void;
203
206
 
204
- export { type BuiltDurableObjectContainerImage as B, type ContainerlessConfig as C, type DeployProps as D, type SharedDeployVersionsProps as S, type TriggerProps as T, type VersionsUploadProps as V, type WorkerBuildResult as W, type TriggerDeployment as a, type ContainerDeployConfig as b, type DeployHelpersContext as c, confirm as d, fetchListResult as e, fetchKVGetValue as f, fetchPagedListResult as g, fetchResult as h, initDeployHelpersContext as i, logger as l, prompt as p, select as s };
207
+ export { type BuiltDurableObjectContainerImage as B, type ContainerlessConfig as C, type DeployProps as D, type SharedDeployVersionsProps as S, type TriggerProps as T, type VersionsUploadProps as V, type WorkerBuildResult as W, type TriggerDeployment as a, type ContainerDeployConfig as b, type DeployHelpersContext as c, cliPresentation as d, confirm as e, fetchKVGetValue as f, fetchListResult as g, fetchPagedListResult as h, initDeployHelpersContext as i, fetchResult as j, logger as l, prompt as p, select as s };
@@ -1,3 +1,3 @@
1
- export { d as confirm, f as fetchKVGetValue, e as fetchListResult, g as fetchPagedListResult, h as fetchResult, i as initDeployHelpersContext, l as logger, p as prompt, s as select } from './context-BjoLoNIB.mjs';
1
+ export { d as cliPresentation, e as confirm, f as fetchKVGetValue, g as fetchListResult, h as fetchPagedListResult, j as fetchResult, i as initDeployHelpersContext, l as logger, p as prompt, s as select } from './context-CYOACjI9.mjs';
2
2
  import '@cloudflare/workers-utils';
3
3
  import '@cloudflare/containers-shared';
package/dist/context.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'node:module';
2
- export { confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, logger, prompt, select } from './chunk-Y4VATABS.mjs';
2
+ export { cliPresentation, confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, logger, prompt, select } from './chunk-JXU4CCEI.mjs';
3
3
  import './chunk-U6NEESU5.mjs';
4
4
 
5
5
  createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SharedDeployVersionsProps, D as DeployProps, C as ContainerlessConfig, W as WorkerBuildResult, V as VersionsUploadProps, T as TriggerProps, a as TriggerDeployment, B as BuiltDurableObjectContainerImage } from './context-BjoLoNIB.mjs';
2
- export { b as ContainerDeployConfig, c as DeployHelpersContext, i as initDeployHelpersContext } from './context-BjoLoNIB.mjs';
1
+ import { S as SharedDeployVersionsProps, D as DeployProps, C as ContainerlessConfig, W as WorkerBuildResult, V as VersionsUploadProps, T as TriggerProps, a as TriggerDeployment, B as BuiltDurableObjectContainerImage } from './context-CYOACjI9.mjs';
2
+ export { b as ContainerDeployConfig, c as DeployHelpersContext, i as initDeployHelpersContext } from './context-CYOACjI9.mjs';
3
3
  import * as _cloudflare_workers_utils from '@cloudflare/workers-utils';
4
4
  import { CfModule, Config, AssetsOptions, ComplianceConfig, LegacyAssetPaths, Route, ZoneIdRoute, ZoneNameRoute, CustomDomainRoute, CfPlacement, Binding as Binding$1, RawConfig, CfCapnp, CfScriptFormat, ParseError, WorkerMetadataBinding, CfUserLimits, CfWorkerInit, TailConsumer, StreamingTailConsumer, Observability, ResolvedDurableObjectContainerApp, DurableObjectContainerApp, ExportsReconciliationErrorDetail, ExportsReconciliationResult, StartDevWorkerInput, Json, CacheOptions, PreviewsConfig } from '@cloudflare/workers-utils';
5
5
  import { FormData } from 'undici';
@@ -87,6 +87,15 @@ declare function getSubdomainValuesAPIMock(config_workers_dev: boolean | undefin
87
87
  workers_dev: boolean;
88
88
  preview_urls: boolean;
89
89
  };
90
+ /**
91
+ * Renders the warning shown when the configured workers.dev state differs from
92
+ * the remotely configured state.
93
+ *
94
+ * @param beforeEnabled Whether workers.dev was enabled before the deployment.
95
+ * @param afterEnabled Whether workers.dev is enabled for the deployment.
96
+ * @returns Consumer-specific guidance for making the setting explicit.
97
+ */
98
+ declare function renderWorkersDevDefaultWarning(beforeEnabled: boolean, afterEnabled: boolean): string;
90
99
  declare function validateEventTriggerTargets(config: Config, scriptName: string): void;
91
100
 
92
101
  type WorkersDevSubdomainRegistrationContext = "workers_dev" | "workflows";
@@ -815,8 +824,10 @@ declare function isExportsReconciliationErrorDetails(value: unknown): value is E
815
824
  * percentage-split deployment).
816
825
  *
817
826
  * The server's own message is already actionable; we augment it with a
818
- * concrete next-step that points back at `wrangler versions deploy` and a
819
- * link to the gradual-deployments docs.
827
+ * concrete CLI-specific next step and a link to the gradual-deployments docs.
828
+ *
829
+ * @param serverMessage Error message returned by the deployment API.
830
+ * @returns The server message followed by consumer-specific recovery guidance.
820
831
  */
821
832
  declare function renderInconsistentExportsAcrossVersionsError(serverMessage: string): string;
822
833
 
@@ -898,6 +909,13 @@ declare function provisionBindings(bindings: StartDevWorkerInput["bindings"], ac
898
909
  skipConfigWriteback?: boolean;
899
910
  }): Promise<ProvisionBindingsResult>;
900
911
  declare function getSettings(complianceConfig: ComplianceConfig, accountId: string, scriptName: string): Promise<Settings>;
912
+ /**
913
+ * Renders actionable guidance after D1 rejects creation at the account limit.
914
+ *
915
+ * @param accountId Account identifier used to construct the upgrade URL.
916
+ * @returns Consumer-specific database listing and deletion guidance.
917
+ */
918
+ declare function renderD1DatabaseLimitError(accountId: string): string;
901
919
 
902
920
  interface Binding {
903
921
  type: string;
@@ -1294,4 +1312,4 @@ type DrawConnectedChildBoxOptions = {
1294
1312
  */
1295
1313
  declare function drawConnectedChildBox(contentLines: string[], options?: DrawConnectedChildBoxOptions): string;
1296
1314
 
1297
- export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, BuiltDurableObjectContainerImage, type BulkInputNullableResult, type BulkInputResult, type BundleSize, type Consumer, type ConsumerSettings, ContainerlessConfig, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployCallbacks, DeployProps, type DeploymentResource, type DurableObjectContainerApplication, EXPORTS_RECONCILIATION_ERROR_CODE, type EnvBindings, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, type JsonLike, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, type NonVersionedScriptSettings, PREVIEW_DOMAIN_PROVISIONING_NOTE, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreparedContainerImages, type PreviewArgs, type PreviewAssetsOptions, type PreviewBaseConfig, type PreviewBaseConfigPatch, type PreviewBuildOutput, type PreviewBuildOutputRootConfig, type PreviewCallbacks, type PreviewDeleteArgs, type PreviewDeploymentModule, type PreviewRequestOptions, type PreviewResource, type PreviewResult, type Producer, type ProvisionBindingsResult, type PullRequestMetadata, type PurgeQueueBody, type PurgeQueueResponse, type QueueJurisdiction, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type UpdatePreviewRequestParams, type VersionCache, type VersionId, type VersionedDurableObjectContainerApplication, type VersionsUploadCallbacks, VersionsUploadProps, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, WorkerBuildResult, type WorkerSubdomain, type Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, 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, 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, handleUnsafeCapnp, 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 };
1315
+ export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, BuiltDurableObjectContainerImage, type BulkInputNullableResult, type BulkInputResult, type BundleSize, type Consumer, type ConsumerSettings, ContainerlessConfig, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployCallbacks, DeployProps, type DeploymentResource, type DurableObjectContainerApplication, EXPORTS_RECONCILIATION_ERROR_CODE, type EnvBindings, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, type JsonLike, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, type NonVersionedScriptSettings, PREVIEW_DOMAIN_PROVISIONING_NOTE, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreparedContainerImages, type PreviewArgs, type PreviewAssetsOptions, type PreviewBaseConfig, type PreviewBaseConfigPatch, type PreviewBuildOutput, type PreviewBuildOutputRootConfig, type PreviewCallbacks, type PreviewDeleteArgs, type PreviewDeploymentModule, type PreviewRequestOptions, type PreviewResource, type PreviewResult, type Producer, type ProvisionBindingsResult, type PullRequestMetadata, type PurgeQueueBody, type PurgeQueueResponse, type QueueJurisdiction, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type UpdatePreviewRequestParams, type VersionCache, type VersionId, type VersionedDurableObjectContainerApplication, type VersionsUploadCallbacks, VersionsUploadProps, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, WorkerBuildResult, type WorkerSubdomain, type Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, 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, 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, handleUnsafeCapnp, 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 };