@void/deploy-core 1.4.0 → 1.5.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/index.d.mts +0 -22
- package/dist/index.mjs +10 -20
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/validate.d.ts
|
|
2
1
|
export declare const MANIFEST_REDIRECT_RULE_STATUSES: ReadonlySet<number>;
|
|
3
2
|
export declare const MAX_ROUTING_RULES = 2e3;
|
|
4
3
|
export declare const MAX_REVALIDATE_QUERY_ALLOWLIST_ENTRIES: number;
|
|
@@ -7,8 +6,6 @@ export declare const MAX_REVALIDATE_QUERY_ALLOWLIST_ENTRIES: number;
|
|
|
7
6
|
* Deploy code reads the manifest without re-checking, so run this before creating any deploy state.
|
|
8
7
|
*/
|
|
9
8
|
export declare function validateManifestShape(manifest: unknown): string | null;
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/resource-plan.d.ts
|
|
12
9
|
type DeployResource = {
|
|
13
10
|
type: "d1";
|
|
14
11
|
bindingName: string;
|
|
@@ -44,8 +41,6 @@ type DeployResourcePlan = {
|
|
|
44
41
|
* target adapter and are deliberately absent from this plan.
|
|
45
42
|
*/
|
|
46
43
|
export declare function createDeployResourcePlan(manifest: DeployManifest): DeployResourcePlan;
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/target.d.ts
|
|
49
44
|
/** A concrete destination that can execute a Void deployment. */
|
|
50
45
|
type DeployTarget = "cloudflare" | "void";
|
|
51
46
|
type DeployAppType = "void" | "spa" | "static" | "framework";
|
|
@@ -91,8 +86,6 @@ type DeployTargetAdapter<TOptions, TContext> = {
|
|
|
91
86
|
readonly capabilities: DeployTargetCapabilities;
|
|
92
87
|
deploy(root: string, options: TOptions, context: TContext): Promise<void>;
|
|
93
88
|
};
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/intent.d.ts
|
|
96
89
|
type DeployRuntimeFeatures = Readonly<{
|
|
97
90
|
assets: boolean;
|
|
98
91
|
auth: boolean;
|
|
@@ -120,8 +113,6 @@ type DeployIntent = Readonly<{
|
|
|
120
113
|
* This function performs no I/O and does not mutate the manifest.
|
|
121
114
|
*/
|
|
122
115
|
export declare function createDeployIntent(manifest: DeployManifest): DeployIntent;
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region src/artifact.d.ts
|
|
125
116
|
export declare const DEPLOY_ARTIFACT_VERSION: 1;
|
|
126
117
|
/** Content-addressed metadata for one static asset in a deployment artifact. */
|
|
127
118
|
type DeployAssetManifestEntry = {
|
|
@@ -206,19 +197,11 @@ export declare function createDeployArtifact(input: {
|
|
|
206
197
|
export declare function createDeployUploadPayload(artifact: DeployArtifact, metadata: DeploySourceMetadata & {
|
|
207
198
|
preflight: "true" | null;
|
|
208
199
|
}, workerInput?: DeployWorkerInput): DeployUploadPayload;
|
|
209
|
-
//#endregion
|
|
210
|
-
//#region src/canonical-json.d.ts
|
|
211
200
|
export declare function canonicalJson(value: unknown): string;
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region src/artifact-digest.d.ts
|
|
214
201
|
/** Commit to all executable bytes, asset hashes, bindings, migrations, and routing. */
|
|
215
202
|
export declare function deployArtifactDigest(artifact: DeployArtifact): Promise<string>;
|
|
216
|
-
//#endregion
|
|
217
|
-
//#region src/is-record.d.ts
|
|
218
203
|
/** Narrow object-shaped input without accepting null or arrays. */
|
|
219
204
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/sql-tokenize.d.ts
|
|
222
205
|
/**
|
|
223
206
|
* Char-by-char SQL tokenizer shared by the migration classifier, the
|
|
224
207
|
* destructive-SQL guard, and the remote migration runner.
|
|
@@ -267,8 +250,6 @@ type SqlSegment = {
|
|
|
267
250
|
end: number;
|
|
268
251
|
};
|
|
269
252
|
export declare function tokenizeSql(sql: string): Generator<SqlSegment>;
|
|
270
|
-
//#endregion
|
|
271
|
-
//#region src/migration-plan.d.ts
|
|
272
253
|
export declare const MIGRATION_CLASSIFIER_VERSION = 1;
|
|
273
254
|
export declare const UNSPLIT_MULTI_STATEMENT_PRAGMA = "-- void:allow-unsplit-multi-statement";
|
|
274
255
|
type SqlMigrationClassification = {
|
|
@@ -302,8 +283,6 @@ export declare function splitSqlStatements(sql: string): Array<string> | null;
|
|
|
302
283
|
export declare function classifySqlMigration(sql: string): SqlMigrationClassification;
|
|
303
284
|
/** Preserve the classifier-v1 hash preimage; policy markers and warnings are not hashed. */
|
|
304
285
|
export declare function getMigrationPlanHashInput(plan: MigrationPlanHashInput): unknown;
|
|
305
|
-
//#endregion
|
|
306
|
-
//#region src/index.d.ts
|
|
307
286
|
export declare const SUPPORTED_MANIFEST_VERSIONS: ReadonlyArray<number>;
|
|
308
287
|
export type MigrationMeta = {
|
|
309
288
|
name: string;
|
|
@@ -563,5 +542,4 @@ export type DeployEvent = {
|
|
|
563
542
|
message: string;
|
|
564
543
|
step: string;
|
|
565
544
|
};
|
|
566
|
-
//#endregion
|
|
567
545
|
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
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/is-record.ts
|
|
2
2
|
/** Narrow object-shaped input without accepting null or arrays. */
|
|
3
3
|
function isRecord(value) {
|
|
4
4
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
//#region src/validate.ts
|
|
6
|
+
// src/validate.ts
|
|
8
7
|
const MANIFEST_REDIRECT_RULE_STATUSES = /* @__PURE__ */ new Set([
|
|
9
8
|
200,
|
|
10
9
|
301,
|
|
@@ -296,8 +295,7 @@ function validateManifestShape(manifest) {
|
|
|
296
295
|
function isLocalImageReference(image) {
|
|
297
296
|
return image.startsWith(".") || image.startsWith("/") || image.toLowerCase().includes("dockerfile");
|
|
298
297
|
}
|
|
299
|
-
|
|
300
|
-
//#region src/resource-plan.ts
|
|
298
|
+
// src/resource-plan.ts
|
|
301
299
|
/**
|
|
302
300
|
* Convert a deployment manifest into provider-neutral resource intent.
|
|
303
301
|
*
|
|
@@ -339,8 +337,7 @@ function createDeployResourcePlan(manifest) {
|
|
|
339
337
|
}
|
|
340
338
|
};
|
|
341
339
|
}
|
|
342
|
-
|
|
343
|
-
//#region src/intent.ts
|
|
340
|
+
// src/intent.ts
|
|
344
341
|
/**
|
|
345
342
|
* Interpret a manifest once before a target assigns provider names and ids.
|
|
346
343
|
* This function performs no I/O and does not mutate the manifest.
|
|
@@ -371,8 +368,7 @@ function createDeployIntent(manifest) {
|
|
|
371
368
|
}
|
|
372
369
|
};
|
|
373
370
|
}
|
|
374
|
-
|
|
375
|
-
//#region src/artifact.ts
|
|
371
|
+
// src/artifact.ts
|
|
376
372
|
const DEPLOY_ARTIFACT_VERSION = 1;
|
|
377
373
|
/** Build one target-neutral artifact before either target adds provider state. */
|
|
378
374
|
function createDeployArtifact(input) {
|
|
@@ -404,8 +400,7 @@ function createDeployUploadPayload(artifact, metadata, workerInput) {
|
|
|
404
400
|
...metadata
|
|
405
401
|
};
|
|
406
402
|
}
|
|
407
|
-
|
|
408
|
-
//#region src/canonical-json.ts
|
|
403
|
+
// src/canonical-json.ts
|
|
409
404
|
function canonicalJson(value) {
|
|
410
405
|
if (value === null) return "null";
|
|
411
406
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return JSON.stringify(value);
|
|
@@ -416,8 +411,7 @@ function canonicalJson(value) {
|
|
|
416
411
|
}
|
|
417
412
|
throw new TypeError(`Unsupported canonical JSON value: ${typeof value}`);
|
|
418
413
|
}
|
|
419
|
-
|
|
420
|
-
//#region src/artifact-digest.ts
|
|
414
|
+
// src/artifact-digest.ts
|
|
421
415
|
/** Commit to all executable bytes, asset hashes, bindings, migrations, and routing. */
|
|
422
416
|
async function deployArtifactDigest(artifact) {
|
|
423
417
|
const host = globalThis;
|
|
@@ -429,8 +423,7 @@ async function deployArtifactDigest(artifact) {
|
|
|
429
423
|
const bytes = await host.crypto.subtle.digest("SHA-256", new host.TextEncoder().encode(data));
|
|
430
424
|
return Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
431
425
|
}
|
|
432
|
-
|
|
433
|
-
//#region src/sql-tokenize.ts
|
|
426
|
+
// src/sql-tokenize.ts
|
|
434
427
|
function* tokenizeSql(sql) {
|
|
435
428
|
const sqlLength = sql.length;
|
|
436
429
|
let index = 0;
|
|
@@ -529,8 +522,7 @@ function* tokenizeSql(sql) {
|
|
|
529
522
|
const tail = flushRun(sqlLength);
|
|
530
523
|
if (tail) yield tail;
|
|
531
524
|
}
|
|
532
|
-
|
|
533
|
-
//#region src/migration-plan.ts
|
|
525
|
+
// src/migration-plan.ts
|
|
534
526
|
const MIGRATION_CLASSIFIER_VERSION = 1;
|
|
535
527
|
const UNSPLIT_MULTI_STATEMENT_PRAGMA = "-- void:allow-unsplit-multi-statement";
|
|
536
528
|
function canonicalSql(sql) {
|
|
@@ -641,8 +633,7 @@ function getMigrationPlanHashInput(plan) {
|
|
|
641
633
|
if (plan.kind === "breakpoint-framed") base.statements = plan.statements;
|
|
642
634
|
return base;
|
|
643
635
|
}
|
|
644
|
-
|
|
645
|
-
//#region src/index.ts
|
|
636
|
+
// src/index.ts
|
|
646
637
|
const SUPPORTED_MANIFEST_VERSIONS = [3, 4];
|
|
647
638
|
/**
|
|
648
639
|
* Preserve an existing WebSocket class history while assigning every genuinely
|
|
@@ -721,5 +712,4 @@ function sameStringSet(a, b) {
|
|
|
721
712
|
function isSandboxRegistryImage(image) {
|
|
722
713
|
return /^registry\.cloudflare\.com\/[^/@\s]+\/[^@\s]+@sha256:[a-f\d]{64}$/.test(image);
|
|
723
714
|
}
|
|
724
|
-
//#endregion
|
|
725
715
|
export { DEPLOY_ARTIFACT_VERSION, MANIFEST_REDIRECT_RULE_STATUSES, MAX_REVALIDATE_QUERY_ALLOWLIST_ENTRIES, MAX_ROUTING_RULES, MIGRATION_CLASSIFIER_VERSION, SUPPORTED_MANIFEST_VERSIONS, UNSPLIT_MULTI_STATEMENT_PRAGMA, appendSqliteClassMigration, canonicalJson, canonicalSql, classifySqlMigration, createDeployArtifact, createDeployIntent, createDeployResourcePlan, createDeployUploadPayload, deployArtifactDigest, getMigrationPlanHashInput, hasStandalonePragma, isRecord, isSandboxRegistryImage, isSingleStatement, planWebSocketMigrations, splitSqlStatements, tokenizeSql, validateManifestShape };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@void/deploy-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Shared deployment contracts, manifests, and resource plans for Void.",
|
|
5
5
|
"homepage": "https://void.cloud",
|
|
6
6
|
"bugs": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"typescript": "7.0.2",
|
|
30
|
-
"vite-plus": "1.
|
|
30
|
+
"vite-plus": "1.4.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "vp pack",
|