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:
parent
fefd9e1d21
commit
c4a9500c84
5 changed files with 9 additions and 5 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
export * as v0_1 from "./0.1.js";
|
export * as v0_1 from "./0.1.js";
|
||||||
export * as v0_2 from "./0.2.js";
|
export * as v0_2 from "./0.2.js";
|
||||||
|
export * as latest from "./latest.js";
|
||||||
export {
|
export {
|
||||||
MANIFEST_VERSION as CURRENT_MANIFEST_VERSION,
|
MANIFEST_VERSION as CURRENT_MANIFEST_VERSION,
|
||||||
McpbManifestSchema,
|
McpbManifestSchema,
|
||||||
} from "./0.2.js";
|
} from "./latest.js";
|
||||||
|
|
|
||||||
1
src/schemas/latest.ts
Normal file
1
src/schemas/latest.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "./0.2.js";
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
export * as v0_1 from "./0.1.js";
|
export * as v0_1 from "./0.1.js";
|
||||||
export * as v0_2 from "./0.2.js";
|
export * as v0_2 from "./0.2.js";
|
||||||
|
export * as latest from "./latest.js";
|
||||||
|
|
|
||||||
1
src/schemas_loose/latest.ts
Normal file
1
src/schemas_loose/latest.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from "./0.2.js";
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import { McpbManifestSchema as ManifestSchemaV0_1 } from "../schemas/0.1.js";
|
import { McpbManifestSchema as ManifestSchemaV0_1 } from "../schemas/0.1.js";
|
||||||
import { McpbManifestSchema as ManifestSchemaV0_2 } from "../schemas/0.2.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_1 } from "../schemas_loose/0.1.js";
|
||||||
import { McpbManifestSchema as LooseManifestSchemaV0_2 } from "../schemas_loose/0.2.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
|
* 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
|
* Get the current manifest schema based on CURRENT_MANIFEST_VERSION
|
||||||
*/
|
*/
|
||||||
export const CURRENT_MANIFEST_SCHEMA =
|
export const CURRENT_MANIFEST_SCHEMA = CurrentManifestSchema;
|
||||||
MANIFEST_SCHEMAS[CURRENT_MANIFEST_VERSION];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current loose manifest schema based on CURRENT_MANIFEST_VERSION
|
* Get the current loose manifest schema based on CURRENT_MANIFEST_VERSION
|
||||||
*/
|
*/
|
||||||
export const CURRENT_MANIFEST_SCHEMA_LOOSE =
|
export const CURRENT_MANIFEST_SCHEMA_LOOSE = CurrentLooseManifestSchema;
|
||||||
MANIFEST_SCHEMAS_LOOSE[CURRENT_MANIFEST_VERSION];
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue