@void/deploy-core 1.1.0 → 1.1.12
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/index.d.mts +46 -9
- package/dist/index.mjs +11 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -49,13 +49,14 @@ export declare function createDeployResourcePlan(manifest: DeployManifest): Depl
|
|
|
49
49
|
/** A concrete destination that can execute a Void deployment. */
|
|
50
50
|
type DeployTarget = "cloudflare" | "void";
|
|
51
51
|
type DeployAppType = "void" | "spa" | "static" | "framework";
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Void does not read deploy target capabilities. Removed in the
|
|
54
|
+
* next major version.
|
|
55
|
+
*/
|
|
52
56
|
type DeployCapabilitySupport = "supported" | "partial" | "unsupported";
|
|
53
57
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* A target reports what it can execute today. Capability declarations must not
|
|
57
|
-
* be aspirational: feature gates are removed only when the corresponding
|
|
58
|
-
* adapter and end-to-end coverage exist.
|
|
58
|
+
* @deprecated Void does not read deploy target capabilities. They do not gate
|
|
59
|
+
* deploys or appear in diagnostics. Removed in the next major version.
|
|
59
60
|
*/
|
|
60
61
|
type DeployTargetCapabilities = {
|
|
61
62
|
managedProjects: boolean;
|
|
@@ -86,6 +87,7 @@ type DeployTargetCapabilities = {
|
|
|
86
87
|
*/
|
|
87
88
|
type DeployTargetAdapter<TOptions, TContext> = {
|
|
88
89
|
readonly target: DeployTarget;
|
|
90
|
+
/** @deprecated Void ignores this field. Removed in the next major version. */
|
|
89
91
|
readonly capabilities: DeployTargetCapabilities;
|
|
90
92
|
deploy(root: string, options: TOptions, context: TContext): Promise<void>;
|
|
91
93
|
};
|
|
@@ -144,11 +146,42 @@ type DeploySourceMetadata = {
|
|
|
144
146
|
commitUrl: string | null;
|
|
145
147
|
gitRef: string | null;
|
|
146
148
|
};
|
|
147
|
-
/**
|
|
149
|
+
/** One Worker module uploaded to R2 before the deployment is finalized. */
|
|
150
|
+
type DeployWorkerModule = {
|
|
151
|
+
/** Module path relative to the Worker output, the same key `workerFiles` uses. */
|
|
152
|
+
name: string;
|
|
153
|
+
/** Byte length of the module. */
|
|
154
|
+
size: number;
|
|
155
|
+
/** SHA-256 of the module bytes as 64 lowercase hex characters. */
|
|
156
|
+
sha256: string;
|
|
157
|
+
};
|
|
158
|
+
/** Request body of `POST /projects/:id/deploy/worker-upload-urls`. */
|
|
159
|
+
type DeployWorkerUploadRequest = {
|
|
160
|
+
modules: Array<DeployWorkerModule>;
|
|
161
|
+
};
|
|
162
|
+
/** Upload URLs for each requested module, in request order. */
|
|
163
|
+
type DeployWorkerUploadResponse = {
|
|
164
|
+
id: string;
|
|
165
|
+
urls: Array<{
|
|
166
|
+
url: string;
|
|
167
|
+
headers: Record<string, string>;
|
|
168
|
+
}>;
|
|
169
|
+
};
|
|
170
|
+
/** Worker modules already uploaded through `worker-upload-urls`, named by its upload `id`. */
|
|
171
|
+
type DeployWorkerInput = {
|
|
172
|
+
id: string;
|
|
173
|
+
modules: Array<DeployWorkerModule>;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* JSON payload accepted by the managed deployment API. Worker modules travel
|
|
177
|
+
* either inline as `workerFiles` or uploaded beforehand as `workerInput`,
|
|
178
|
+
* never both.
|
|
179
|
+
*/
|
|
148
180
|
type DeployUploadPayload = {
|
|
149
181
|
manifest: DeployManifest;
|
|
150
182
|
assetManifest: Record<string, DeployAssetManifestEntry>;
|
|
151
183
|
workerFiles?: Record<string, string>;
|
|
184
|
+
workerInput?: DeployWorkerInput;
|
|
152
185
|
} & DeploySourceMetadata & {
|
|
153
186
|
preflight: "true" | null;
|
|
154
187
|
};
|
|
@@ -165,10 +198,14 @@ export declare function createDeployArtifact(input: {
|
|
|
165
198
|
assetManifest: Record<string, DeployAssetManifestEntry>;
|
|
166
199
|
workerFiles?: Record<string, string>;
|
|
167
200
|
}): DeployArtifact;
|
|
168
|
-
/**
|
|
201
|
+
/**
|
|
202
|
+
* Convert the canonical artifact into the stable hosted-platform wire shape.
|
|
203
|
+
* Pass `workerInput` when the Worker modules were uploaded beforehand; the
|
|
204
|
+
* artifact must then carry no inline `workerFiles`.
|
|
205
|
+
*/
|
|
169
206
|
export declare function createDeployUploadPayload(artifact: DeployArtifact, metadata: DeploySourceMetadata & {
|
|
170
207
|
preflight: "true" | null;
|
|
171
|
-
}): DeployUploadPayload;
|
|
208
|
+
}, workerInput?: DeployWorkerInput): DeployUploadPayload;
|
|
172
209
|
//#endregion
|
|
173
210
|
//#region src/canonical-json.d.ts
|
|
174
211
|
export declare function canonicalJson(value: unknown): string;
|
|
@@ -525,4 +562,4 @@ export type DeployEvent = {
|
|
|
525
562
|
step: string;
|
|
526
563
|
};
|
|
527
564
|
//#endregion
|
|
528
|
-
export type { DeployAppType, DeployArtifact, DeployAssetManifestEntry, DeployAssetUploadRequest, DeployCapabilitySupport, DeployIntent, DeployResource, DeployResourcePlan, DeployRuntimeFeatures, DeploySourceMetadata, DeployTarget, DeployTargetAdapter, DeployTargetCapabilities, DeployUploadPayload, MigrationPlanHashInput, SqlMigrationClassification, SqlSegment };
|
|
565
|
+
export type { DeployAppType, DeployArtifact, DeployAssetManifestEntry, DeployAssetUploadRequest, DeployCapabilitySupport, DeployIntent, DeployResource, DeployResourcePlan, DeployRuntimeFeatures, DeploySourceMetadata, DeployTarget, DeployTargetAdapter, DeployTargetCapabilities, DeployUploadPayload, DeployWorkerInput, DeployWorkerModule, DeployWorkerUploadRequest, DeployWorkerUploadResponse, MigrationPlanHashInput, SqlMigrationClassification, SqlSegment };
|
package/dist/index.mjs
CHANGED
|
@@ -382,8 +382,13 @@ function createDeployArtifact(input) {
|
|
|
382
382
|
...input.workerFiles && Object.keys(input.workerFiles).length > 0 ? { workerFiles: input.workerFiles } : {}
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
/**
|
|
386
|
-
|
|
385
|
+
/**
|
|
386
|
+
* Convert the canonical artifact into the stable hosted-platform wire shape.
|
|
387
|
+
* Pass `workerInput` when the Worker modules were uploaded beforehand; the
|
|
388
|
+
* artifact must then carry no inline `workerFiles`.
|
|
389
|
+
*/
|
|
390
|
+
function createDeployUploadPayload(artifact, metadata, workerInput) {
|
|
391
|
+
if (workerInput && artifact.workerFiles) throw new Error("A deployment sends its Worker modules inline or as uploads, not both.");
|
|
387
392
|
return {
|
|
388
393
|
manifest: {
|
|
389
394
|
...artifact.manifest,
|
|
@@ -391,6 +396,10 @@ function createDeployUploadPayload(artifact, metadata) {
|
|
|
391
396
|
},
|
|
392
397
|
assetManifest: { ...artifact.assetManifest },
|
|
393
398
|
...artifact.workerFiles ? { workerFiles: { ...artifact.workerFiles } } : {},
|
|
399
|
+
...workerInput ? { workerInput: {
|
|
400
|
+
id: workerInput.id,
|
|
401
|
+
modules: workerInput.modules.map((module) => ({ ...module }))
|
|
402
|
+
} } : {},
|
|
394
403
|
...metadata
|
|
395
404
|
};
|
|
396
405
|
}
|