@cloudflare/deploy-helpers 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-EE2VTGDT.mjs +1144 -0
- package/dist/{chunk-HE3NAOND.mjs → chunk-Q72B4Q5Z.mjs} +5 -22
- package/dist/chunk-Z4LB73IF.mjs +24 -0
- package/dist/{context-DAPhsIL6.d.mts → context-2uDdhwGj.d.mts} +1 -0
- package/dist/context.d.mts +1 -1
- package/dist/context.mjs +2 -1
- package/dist/create-worker-upload-form.d.mts +19 -0
- package/dist/create-worker-upload-form.mjs +2 -0
- package/dist/index.d.mts +10 -21
- package/dist/index.mjs +6677 -2856
- package/dist/metafile-esm.json +1 -1
- package/package.json +9 -14
|
@@ -14,6 +14,10 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
14
14
|
var __commonJS = (cb, mod) => function __require2() {
|
|
15
15
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
16
|
};
|
|
17
|
+
var __export = (target, all) => {
|
|
18
|
+
for (var name in all)
|
|
19
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
+
};
|
|
17
21
|
var __copyProps = (to, from, except, desc) => {
|
|
18
22
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
23
|
for (let key of __getOwnPropNames(from))
|
|
@@ -31,25 +35,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
31
35
|
mod
|
|
32
36
|
));
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
var logger;
|
|
36
|
-
var fetchResult;
|
|
37
|
-
var fetchListResult;
|
|
38
|
-
var fetchPagedListResult;
|
|
39
|
-
var fetchKVGetValue;
|
|
40
|
-
var confirm;
|
|
41
|
-
var prompt;
|
|
42
|
-
var select;
|
|
43
|
-
function initDeployHelpersContext(ctx) {
|
|
44
|
-
logger = ctx.logger;
|
|
45
|
-
fetchResult = ctx.fetchResult;
|
|
46
|
-
fetchListResult = ctx.fetchListResult;
|
|
47
|
-
fetchPagedListResult = ctx.fetchPagedListResult;
|
|
48
|
-
fetchKVGetValue = ctx.fetchKVGetValue;
|
|
49
|
-
confirm = ctx.confirm;
|
|
50
|
-
prompt = ctx.prompt;
|
|
51
|
-
select = ctx.select;
|
|
52
|
-
}
|
|
53
|
-
__name(initDeployHelpersContext, "initDeployHelpersContext");
|
|
54
|
-
|
|
55
|
-
export { __commonJS, __name, __require, __toESM, confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, logger, prompt, select };
|
|
38
|
+
export { __commonJS, __export, __name, __require, __toESM };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __name } from './chunk-Q72B4Q5Z.mjs';
|
|
2
|
+
|
|
3
|
+
// src/shared/context.ts
|
|
4
|
+
var logger;
|
|
5
|
+
var fetchResult;
|
|
6
|
+
var fetchListResult;
|
|
7
|
+
var fetchPagedListResult;
|
|
8
|
+
var fetchKVGetValue;
|
|
9
|
+
var confirm;
|
|
10
|
+
var prompt;
|
|
11
|
+
var select;
|
|
12
|
+
function initDeployHelpersContext(ctx) {
|
|
13
|
+
logger = ctx.logger;
|
|
14
|
+
fetchResult = ctx.fetchResult;
|
|
15
|
+
fetchListResult = ctx.fetchListResult;
|
|
16
|
+
fetchPagedListResult = ctx.fetchPagedListResult;
|
|
17
|
+
fetchKVGetValue = ctx.fetchKVGetValue;
|
|
18
|
+
confirm = ctx.confirm;
|
|
19
|
+
prompt = ctx.prompt;
|
|
20
|
+
select = ctx.select;
|
|
21
|
+
}
|
|
22
|
+
__name(initDeployHelpersContext, "initDeployHelpersContext");
|
|
23
|
+
|
|
24
|
+
export { confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, logger, prompt, select };
|
package/dist/context.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { g as confirm, e as fetchKVGetValue, c as fetchListResult, d as fetchPagedListResult, f as fetchResult, i as initDeployHelpersContext, l as logger, p as prompt, s as select } from './context-
|
|
1
|
+
export { g as confirm, e as fetchKVGetValue, c as fetchListResult, d as fetchPagedListResult, f as fetchResult, i as initDeployHelpersContext, l as logger, p as prompt, s as select } from './context-2uDdhwGj.mjs';
|
|
2
2
|
import '@cloudflare/workers-utils';
|
package/dist/context.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, logger, prompt, select } from './chunk-
|
|
1
|
+
export { confirm, fetchKVGetValue, fetchListResult, fetchPagedListResult, fetchResult, initDeployHelpersContext, logger, prompt, select } from './chunk-Z4LB73IF.mjs';
|
|
2
|
+
import './chunk-Q72B4Q5Z.mjs';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FormData } from 'undici';
|
|
2
|
+
import { CfModuleType, CfWorkerInit, Binding, CfCapnp } from '@cloudflare/workers-utils';
|
|
3
|
+
|
|
4
|
+
declare const moduleTypeMimeType: {
|
|
5
|
+
[type in CfModuleType]: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
declare function fromMimeType(mimeType: string): CfModuleType;
|
|
8
|
+
/**
|
|
9
|
+
* Creates a `FormData` upload from Worker data and bindings
|
|
10
|
+
*/
|
|
11
|
+
declare function createWorkerUploadForm(worker: Omit<CfWorkerInit, "bindings" | "rawBindings">, bindings: Record<string, Binding> | undefined, options?: {
|
|
12
|
+
dryRun?: true;
|
|
13
|
+
unsafe?: {
|
|
14
|
+
metadata?: Record<string, unknown>;
|
|
15
|
+
capnp?: CfCapnp;
|
|
16
|
+
};
|
|
17
|
+
}): FormData;
|
|
18
|
+
|
|
19
|
+
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { S as SharedDeployVersionsProps, D as DeployProps, W as WorkerBuildResult, V as VersionsUploadProps, T as TriggerProps, a as TriggerDeployment } from './context-
|
|
2
|
-
export { b as DeployHelpersContext, i as initDeployHelpersContext } from './context-
|
|
1
|
+
import { S as SharedDeployVersionsProps, D as DeployProps, W as WorkerBuildResult, V as VersionsUploadProps, T as TriggerProps, a as TriggerDeployment } from './context-2uDdhwGj.mjs';
|
|
2
|
+
export { b as DeployHelpersContext, i as initDeployHelpersContext } from './context-2uDdhwGj.mjs';
|
|
3
3
|
import * as _cloudflare_workers_utils from '@cloudflare/workers-utils';
|
|
4
|
-
import { ComplianceConfig, Config, AssetsOptions, LegacyAssetPaths, Route, ZoneIdRoute, ZoneNameRoute, CustomDomainRoute, CfPlacement, Binding as Binding$1, RawConfig, ConfigBindingFieldName, CfCapnp,
|
|
4
|
+
import { ComplianceConfig, Config, AssetsOptions, LegacyAssetPaths, Route, ZoneIdRoute, ZoneNameRoute, CustomDomainRoute, CfPlacement, Binding as Binding$1, RawConfig, ConfigBindingFieldName, CfCapnp, CfScriptFormat, CfModule, ParseError, WorkerMetadataBinding, CfUserLimits, TailConsumer, StreamingTailConsumer, Observability, CfWorkerInit, ExportsReconciliationResult, ExportsReconciliationErrorDetail, StartDevWorkerInput, CfTailConsumer, ContainerApp, CacheOptions } from '@cloudflare/workers-utils';
|
|
5
5
|
import { ContainerNormalizedConfig, ImageURIConfig } from '@cloudflare/containers-shared';
|
|
6
6
|
import { FormData } from 'undici';
|
|
7
|
+
export { createWorkerUploadForm, fromMimeType, moduleTypeMimeType } from './create-worker-upload-form.mjs';
|
|
7
8
|
import { Options } from '@cspotcode/source-map-support';
|
|
8
9
|
import Protocol from 'devtools-protocol';
|
|
9
10
|
import { NodeJSCompatMode, WorkerRegistry } from 'miniflare';
|
|
@@ -226,7 +227,7 @@ declare function deletePullConsumer(complianceConfig: ComplianceConfig, accountI
|
|
|
226
227
|
declare function listConsumers(complianceConfig: ComplianceConfig, accountId: string, queueName: string): Promise<Consumer[]>;
|
|
227
228
|
declare function deleteWorkerConsumer(complianceConfig: ComplianceConfig, accountId: string, queueName: string, scriptName: string, envName: string | undefined): Promise<void>;
|
|
228
229
|
declare function updateQueueConsumers(complianceConfig: ComplianceConfig, accountId: string, scriptName: string, config: Config): Promise<Promise<TriggerDeployment>[]>;
|
|
229
|
-
declare function ensureQueuesExistByConfig(config: Config, accountId: string): Promise<void>;
|
|
230
|
+
declare function ensureQueuesExistByConfig(config: Config, accountId: string, includeProducers?: boolean, scriptName?: string): Promise<void>;
|
|
230
231
|
|
|
231
232
|
/**
|
|
232
233
|
* Parse placement out of a Config
|
|
@@ -451,21 +452,6 @@ declare function getBindings(config: Config | undefined, options?: {
|
|
|
451
452
|
|
|
452
453
|
declare function handleUnsafeCapnp(capnp: CfCapnp): Buffer;
|
|
453
454
|
|
|
454
|
-
declare const moduleTypeMimeType: {
|
|
455
|
-
[type in CfModuleType]: string | undefined;
|
|
456
|
-
};
|
|
457
|
-
declare function fromMimeType(mimeType: string): CfModuleType;
|
|
458
|
-
/**
|
|
459
|
-
* Creates a `FormData` upload from Worker data and bindings
|
|
460
|
-
*/
|
|
461
|
-
declare function createWorkerUploadForm(worker: Omit<CfWorkerInit, "bindings" | "rawBindings">, bindings: Record<string, Binding$1> | undefined, options?: {
|
|
462
|
-
dryRun?: true;
|
|
463
|
-
unsafe?: {
|
|
464
|
-
metadata?: Record<string, unknown>;
|
|
465
|
-
capnp?: CfCapnp;
|
|
466
|
-
};
|
|
467
|
-
}): FormData;
|
|
468
|
-
|
|
469
455
|
/**
|
|
470
456
|
* Inject bindings into the Worker to support Workers Sites. These are injected at the last minute so that
|
|
471
457
|
* they don't display in the output of `printBindings()`
|
|
@@ -852,14 +838,17 @@ type PackageDependency = {
|
|
|
852
838
|
* - Pnpm catalog packages (version prefixed with `catalog:`)
|
|
853
839
|
* - Local packages (version prefixed with `file:` or `link:`)
|
|
854
840
|
* - Packages whose installed version cannot be resolved
|
|
841
|
+
* - Packages matching any pattern in `excludePackages`
|
|
855
842
|
*
|
|
856
843
|
* The result is capped at {@link MAX_PACKAGE_DEPENDENCIES} entries.
|
|
857
844
|
*
|
|
858
845
|
* @param projectPath - Path to the project directory (where package.json is located)
|
|
846
|
+
* @param excludePackages - Optional list of package name patterns (glob-style with
|
|
847
|
+
* `*` wildcards) to exclude from the collected dependencies
|
|
859
848
|
* @returns An array of package dependency entries, or `undefined` if package.json
|
|
860
849
|
* cannot be read or no valid dependencies are found
|
|
861
850
|
*/
|
|
862
|
-
declare function collectPackageDependencies(projectPath: string): Promise<PackageDependency[] | undefined>;
|
|
851
|
+
declare function collectPackageDependencies(projectPath: string, excludePackages?: string[]): Promise<PackageDependency[] | undefined>;
|
|
863
852
|
|
|
864
853
|
type Settings = {
|
|
865
854
|
bindings: Array<WorkerMetadataBinding>;
|
|
@@ -1138,4 +1127,4 @@ type DrawConnectedChildBoxOptions = {
|
|
|
1138
1127
|
*/
|
|
1139
1128
|
declare function drawConnectedChildBox(contentLines: string[], options?: DrawConnectedChildBoxOptions): string;
|
|
1140
1129
|
|
|
1141
|
-
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, type BulkInputNullableResult, type BulkInputResult, type Consumer, type ConsumerSettings, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployCallbacks, DeployProps, type DeploymentResource, EXPORTS_RECONCILIATION_ERROR_CODE, type EnvBindings, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, type JsonLike, NoInputError, type NonVersionedScriptSettings, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreviewArgs, type PreviewAssetsOptions, type PreviewDefaults, type PreviewDefaultsPatch, type PreviewDeleteArgs, type PreviewRequestOptions, type PreviewResource, type PreviewResult, type PreviewSettingsArgs, type PreviewSettingsUpdateArgs, type Producer, type PurgeQueueBody, type PurgeQueueResponse, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type UpdatePreviewRequestParams, type VersionCache, type VersionId, 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 Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewDefaults, assemblePreviewScriptSettings, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, convertConfigToBindings, createDeployment, createPreview, createPreviewDeployment, createTruncatedAlias,
|
|
1130
|
+
export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, type ApiDeployment, type ApiVersion, type AssetManifest, type AssetUploadStats, type AssetsUploadResult, type Binding, type BulkInputNullableResult, type BulkInputResult, type Consumer, type ConsumerSettings, type CreatePreviewDeploymentRequestParams, type CreatePreviewRequestParams, type CustomDomain, type CustomDomainChangeset, type DeployCallbacks, DeployProps, type DeploymentResource, EXPORTS_RECONCILIATION_ERROR_CODE, type EnvBindings, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, type JsonLike, NoInputError, type NonVersionedScriptSettings, type PackageDependency, type Percentage, type PostQueueBody, type PostQueueResponse, type PostTypedConsumerBody, type PreviewArgs, type PreviewAssetsOptions, type PreviewDefaults, type PreviewDefaultsPatch, type PreviewDeleteArgs, type PreviewRequestOptions, type PreviewResource, type PreviewResult, type PreviewSettingsArgs, type PreviewSettingsUpdateArgs, type Producer, type PurgeQueueBody, type PurgeQueueResponse, type QueueResponse, type QueueSettings, type RetrieveSourceMapFunction, type RouteObject, type ScriptReference, type Settings, SharedDeployVersionsProps, TriggerDeployment, TriggerProps, type TypedConsumerResponse, type UpdatePreviewRequestParams, type VersionCache, type VersionId, 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 Workflow, type WorkflowConflict, type Zone, type ZoneIdCache, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewDefaults, assemblePreviewScriptSettings, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, convertConfigToBindings, createDeployment, createPreview, createPreviewDeployment, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, editWorkerPreviewDefaults, ensureQueuesExistByConfig, extractBindingsOfType, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatPreviewsSettings, generatePreviewAlias, getBindingValue, getBindings, getBranchName, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewDeployment, getQueue, getRemoteConfigDiff, getSettings, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getWorkerPreviewDefaults, getWorkersDevSubdomain, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, handleUnsafeCapnp, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isUnsafeBindingType, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, mergeDeep, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, postConsumer, preview, previewDelete, previewSettingsGet, previewSettingsUpdate, printBindings, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateFileSecrets, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, warnOrError, workerNotFoundErrorMessage };
|