everything-dev
Version:
A consolidated product package for building Module Federation apps with oRPC APIs.
58 lines (56 loc) • 2.38 kB
JavaScript
let zod = require("zod");
//#region src/services/platform/manifest-schema.ts
/**
* The platform release manifest's wire schema (ADR 0034) — a leaf module so
* the registry's resolution machine and the manifest's composer can both
* import it without a cycle. The composer, inventory, compat gate, and
* resolution machine live in `platform/manifest.ts` and
* `registry/resolution.ts` respectively; this file holds only the schema.
*/
const PlatformReleaseManifestSchema = zod.z.object({
schemaVersion: zod.z.literal(1),
kind: zod.z.literal("everything-dev/platform-manifest"),
frameworkVersion: zod.z.string().min(1),
everyPluginVersion: zod.z.string().min(1),
/** The serving build's repo HEAD (full sha) — omitted when the compose
* context has no git (regression image builds, build-arg-less builds). */
gitSha: zod.z.string().min(7).optional(),
image: zod.z.object({
ref: zod.z.string().min(1),
tags: zod.z.array(zod.z.string().min(1))
}),
catalog: zod.z.record(zod.z.string(), zod.z.string()),
sharedDeps: zod.z.record(zod.z.string(), zod.z.object({
version: zod.z.string(),
requiredVersion: zod.z.union([zod.z.string(), zod.z.boolean()]),
singleton: zod.z.boolean(),
eager: zod.z.boolean(),
strictVersion: zod.z.boolean(),
shareScope: zod.z.string()
})),
templateInventory: zod.z.array(zod.z.object({
path: zod.z.string(),
sha256: zod.z.string().regex(/^[0-9a-f]{64}$/)
})),
compat: zod.z.object({ minChild: zod.z.string().min(1) }),
/**
* The release's own slot-pin map (ADR 0034 amendment — release-scoped
* extends inheritance): each entry records the immutable version-manifest
* pointer the release published for a config slot (dotted config path, e.g.
* `app.auth`, `app.auth.ui`, `plugins.votes.ui`) — the son of the store, so
* children pinned to this release can re-point inherited slots at THESE
* bytes instead of the parent's live config whenever the parent publishes.
* Optional: releases composed before the field carry no slots, and old
* readers strip unknown keys.
*/
slots: zod.z.record(zod.z.string(), zod.z.object({
base: zod.z.string().min(1),
pin: zod.z.object({
manifest: zod.z.string().min(1),
integrity: zod.z.string().min(1)
})
})).optional()
});
//#endregion
exports.PlatformReleaseManifestSchema = PlatformReleaseManifestSchema;
//# sourceMappingURL=manifest-schema.cjs.map