From c4a9500c84eb7d028becf3e2a0878e6e2b0ca7b9 Mon Sep 17 00:00:00 2001 From: Joan Xie Date: Wed, 24 Sep 2025 14:21:01 -0700 Subject: [PATCH] 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 --- src/schemas/index.ts | 3 ++- src/schemas/latest.ts | 1 + src/schemas_loose/index.ts | 1 + src/schemas_loose/latest.ts | 1 + src/shared/constants.ts | 8 ++++---- 5 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 src/schemas/latest.ts create mode 100644 src/schemas_loose/latest.ts diff --git a/src/schemas/index.ts b/src/schemas/index.ts index d8599cd..427aad4 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -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"; diff --git a/src/schemas/latest.ts b/src/schemas/latest.ts new file mode 100644 index 0000000..79797d0 --- /dev/null +++ b/src/schemas/latest.ts @@ -0,0 +1 @@ +export * from "./0.2.js"; diff --git a/src/schemas_loose/index.ts b/src/schemas_loose/index.ts index 168c457..b58933b 100644 --- a/src/schemas_loose/index.ts +++ b/src/schemas_loose/index.ts @@ -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"; diff --git a/src/schemas_loose/latest.ts b/src/schemas_loose/latest.ts new file mode 100644 index 0000000..79797d0 --- /dev/null +++ b/src/schemas_loose/latest.ts @@ -0,0 +1 @@ +export * from "./0.2.js"; diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 8cf0606..ec7b865 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -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;