feat: add schema helper aliases (latest)

- Add schemas/latest.ts and schemas_loose/latest.ts as aliases to current version
- Update constants.ts to use latest.ts instead of hardcoded version imports
- This makes version updates easier - only need to update latest.ts pointer
This commit is contained in:
Joan Xie 2025-09-24 14:21:01 -07:00
commit c4a9500c84
No known key found for this signature in database
5 changed files with 9 additions and 5 deletions

View file

@ -1,6 +1,7 @@
export * as v0_1 from "./0.1.js";
export * as v0_2 from "./0.2.js";
export * as latest from "./latest.js";
export {
MANIFEST_VERSION as CURRENT_MANIFEST_VERSION,
McpbManifestSchema,
} from "./0.2.js";
} from "./latest.js";

1
src/schemas/latest.ts Normal file
View file

@ -0,0 +1 @@
export * from "./0.2.js";

View file

@ -1,2 +1,3 @@
export * as v0_1 from "./0.1.js";
export * as v0_2 from "./0.2.js";
export * as latest from "./latest.js";

View file

@ -0,0 +1 @@
export * from "./0.2.js";

View file

@ -1,7 +1,9 @@
import { McpbManifestSchema as ManifestSchemaV0_1 } from "../schemas/0.1.js";
import { McpbManifestSchema as ManifestSchemaV0_2 } from "../schemas/0.2.js";
import { McpbManifestSchema as CurrentManifestSchema } from "../schemas/latest.js";
import { McpbManifestSchema as LooseManifestSchemaV0_1 } from "../schemas_loose/0.1.js";
import { McpbManifestSchema as LooseManifestSchemaV0_2 } from "../schemas_loose/0.2.js";
import { McpbManifestSchema as CurrentLooseManifestSchema } from "../schemas_loose/latest.js";
/**
* Current manifest version - the version that new manifests should use
@ -27,11 +29,9 @@ export const MANIFEST_SCHEMAS_LOOSE = {
/**
* Get the current manifest schema based on CURRENT_MANIFEST_VERSION
*/
export const CURRENT_MANIFEST_SCHEMA =
MANIFEST_SCHEMAS[CURRENT_MANIFEST_VERSION];
export const CURRENT_MANIFEST_SCHEMA = CurrentManifestSchema;
/**
* Get the current loose manifest schema based on CURRENT_MANIFEST_VERSION
*/
export const CURRENT_MANIFEST_SCHEMA_LOOSE =
MANIFEST_SCHEMAS_LOOSE[CURRENT_MANIFEST_VERSION];
export const CURRENT_MANIFEST_SCHEMA_LOOSE = CurrentLooseManifestSchema;