Skip to content

Commit 30a3b8e

Browse files
Remove vLatest concept and associated files
Remove the concept of "vLatest" throughout the codebase to encourage use of McpbManifestAny which supports all manifest versions. Changes include: - Delete src/schemas/latest.ts and src/schemas_loose/latest.ts - Remove vLatest and latest-related exports from schema index files - Remove McpbManifestLatest type, replace McpbManifest to point to McpbManifestAny - Remove LATEST_MANIFEST_VERSION, LATEST_MANIFEST_SCHEMA constants - Update all main export files (index.ts, cli.ts, node.ts) to export from 0.3.js instead of latest.js - Update tests to use v0_3.McpbManifestSchema explicitly - Add @deprecated annotation to McpbManifest directing users to McpbManifestAny This encourages better version compatibility by using the union type that supports all manifest versions rather than assuming a single "latest" version. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d7f76fc commit 30a3b8e

10 files changed

Lines changed: 20 additions & 56 deletions

File tree

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export * from "./cli/init.js";
33
export * from "./cli/pack.js";
44

55
// Include all shared exports
6-
export * from "./schemas/latest.js";
6+
export * from "./schemas/0.3.js";
77
export * from "./shared/config.js";
88
export * from "./shared/constants.js";
99
export * from "./types.js";

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export * from "./cli/unpack.js";
55
export * from "./node/files.js";
66
export * from "./node/sign.js";
77
export * from "./node/validate.js";
8-
export * from "./schemas/latest.js";
8+
export * from "./schemas/0.3.js";
99
export * from "./shared/config.js";
1010
export * from "./shared/constants.js";
1111
export * from "./types.js";

src/node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export * from "./node/sign.js";
44
export * from "./node/validate.js";
55

66
// Include all shared exports
7-
export * from "./schemas/latest.js";
7+
export * from "./schemas/0.3.js";
88
export * from "./shared/config.js";
99
export * from "./shared/constants.js";
1010
export * from "./types.js";

src/schemas/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ export * as v0_1 from "./0.1.js";
66
export * as v0_2 from "./0.2.js";
77
export * as v0_3 from "./0.3.js";
88
export * as vAny from "./any.js";
9-
export * as vLatest from "./latest.js";
10-
export {
11-
MANIFEST_VERSION as LATEST_MANIFEST_VERSION,
12-
McpbManifestSchema as LatestMcpbManifestSchema,
13-
McpbManifestSchema, // backwards compatibility - exports latest schema
14-
} from "./latest.js";
159

1610
/**
1711
* Map of manifest versions to their strict schemas

src/schemas/latest.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/schemas_loose/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export * as v0_1 from "./0.1.js";
22
export * as v0_2 from "./0.2.js";
33
export * as v0_3 from "./0.3.js";
4-
export * as latest from "./latest.js";

src/schemas_loose/latest.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/shared/constants.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import { McpbManifestSchema as ManifestSchemaV0_1 } from "../schemas/0.1.js";
22
import { McpbManifestSchema as ManifestSchemaV0_2 } from "../schemas/0.2.js";
33
import { McpbManifestSchema as ManifestSchemaV0_3 } from "../schemas/0.3.js";
4-
import { McpbManifestSchema as CurrentManifestSchema } from "../schemas/latest.js";
54
import { McpbManifestSchema as LooseManifestSchemaV0_1 } from "../schemas_loose/0.1.js";
65
import { McpbManifestSchema as LooseManifestSchemaV0_2 } from "../schemas_loose/0.2.js";
76
import { McpbManifestSchema as LooseManifestSchemaV0_3 } from "../schemas_loose/0.3.js";
8-
import { McpbManifestSchema as CurrentLooseManifestSchema } from "../schemas_loose/latest.js";
9-
10-
/**
11-
* Latest manifest version - the version that new manifests should use
12-
* @deprecated
13-
*/
14-
export const LATEST_MANIFEST_VERSION = "0.3" as const;
157

168
/**
179
* Default manifest version for new packages
@@ -35,15 +27,3 @@ export const MANIFEST_SCHEMAS_LOOSE = {
3527
"0.2": LooseManifestSchemaV0_2,
3628
"0.3": LooseManifestSchemaV0_3,
3729
} as const;
38-
39-
/**
40-
* Get the latest manifest schema based on LATEST_MANIFEST_VERSION
41-
* @deprecated
42-
*/
43-
export const LATEST_MANIFEST_SCHEMA = CurrentManifestSchema;
44-
45-
/**
46-
* Get the latest loose manifest schema based on LATEST_MANIFEST_VERSION
47-
* @deprecated
48-
*/
49-
export const LATEST_MANIFEST_SCHEMA_LOOSE = CurrentLooseManifestSchema;

src/types.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ import type {
88
McpbManifestPlatformOverrideSchema,
99
McpbManifestPromptSchema,
1010
McpbManifestRepositorySchema,
11-
McpbManifestSchema,
1211
McpbManifestServerSchema,
1312
McpbManifestToolSchema,
1413
McpbSignatureInfoSchema,
1514
McpbUserConfigurationOptionSchema,
1615
McpbUserConfigValuesSchema,
1716
McpServerConfigSchema,
18-
} from "./schemas/latest.js";
17+
} from "./schemas/0.3.js";
1918

2019
export type McpServerConfig = z.infer<typeof McpServerConfigSchema>;
2120

@@ -48,20 +47,14 @@ export type McpbUserConfigurationOption = z.infer<
4847
export type McpbUserConfigValues = z.infer<typeof McpbUserConfigValuesSchema>;
4948

5049
/**
51-
* McpbManifest type for the latest manifest version only
52-
* Use this when you specifically need the latest version.
53-
*/
54-
export type McpbManifestLatest = z.infer<typeof McpbManifestSchema>;
55-
56-
/**
57-
* Alias for McpbManifestLatest for backwards compatibility.
50+
* McpbManifest type representing the union of all manifest versions
5851
*/
59-
export type McpbManifest = McpbManifestLatest;
52+
export type McpbManifestAny = z.infer<typeof McpbManifestSchemaAny>;
6053

6154
/**
62-
* McpbManifest type representing the union of all manifest versions
55+
* @deprecated Use McpbManifestAny instead to support all manifest versions.
6356
*/
64-
export type McpbManifestAny = z.infer<typeof McpbManifestSchemaAny>;
57+
export type McpbManifest = McpbManifestAny;
6558

6659
/**
6760
* Information about a MCPB package signature

test/schemas.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { readFileSync } from "fs";
22
import { join } from "path";
33

4-
import { McpbManifestSchema, v0_2, v0_3 } from "../src/schemas/index.js";
4+
import { v0_2, v0_3 } from "../src/schemas/index.js";
55

66
describe("McpbManifestSchema", () => {
77
it("should validate a valid manifest", () => {
88
const manifestPath = join(__dirname, "valid-manifest.json");
99
const manifestContent = readFileSync(manifestPath, "utf-8");
1010
const manifestData = JSON.parse(manifestContent);
1111

12-
const result = McpbManifestSchema.safeParse(manifestData);
12+
const result = v0_3.McpbManifestSchema.safeParse(manifestData);
1313

1414
expect(result.success).toBe(true);
1515
if (result.success) {
@@ -23,11 +23,11 @@ describe("McpbManifestSchema", () => {
2323
const manifestContent = readFileSync(manifestPath, "utf-8");
2424
const manifestData = JSON.parse(manifestContent);
2525

26-
const result = McpbManifestSchema.safeParse(manifestData);
26+
const result = v0_3.McpbManifestSchema.safeParse(manifestData);
2727

2828
expect(result.success).toBe(false);
2929
if (!result.success) {
30-
const errors = result.error.issues.map((issue) => issue.path.join("."));
30+
const errors = result.error.issues.map((issue: any) => issue.path.join("."));
3131
expect(errors).toContain("author.name");
3232
expect(errors).toContain("author.email");
3333
expect(errors).toContain("server.type");
@@ -134,7 +134,7 @@ describe("McpbManifestSchema", () => {
134134
},
135135
};
136136

137-
const result = McpbManifestSchema.safeParse(fullManifest);
137+
const result = v0_3.McpbManifestSchema.safeParse(fullManifest);
138138

139139
expect(result.success).toBe(true);
140140
if (result.success) {
@@ -167,7 +167,7 @@ describe("McpbManifestSchema", () => {
167167
},
168168
};
169169

170-
const result = McpbManifestSchema.safeParse(manifest);
170+
const result = v0_3.McpbManifestSchema.safeParse(manifest);
171171
expect(result.success).toBe(true);
172172
});
173173
});
@@ -270,10 +270,10 @@ describe("McpbManifestSchema", () => {
270270
default_locale: "en-US",
271271
},
272272
};
273-
const result = McpbManifestSchema.safeParse(manifest);
273+
const result = v0_3.McpbManifestSchema.safeParse(manifest);
274274
expect(result.success).toBe(false);
275275
if (!result.success) {
276-
const messages = result.error.issues.map((issue) => issue.message);
276+
const messages = result.error.issues.map((issue: any) => issue.message);
277277
expect(messages.join(" ")).toContain("${locale}");
278278
}
279279
});
@@ -286,7 +286,7 @@ describe("McpbManifestSchema", () => {
286286
default_locale: "en_us",
287287
},
288288
};
289-
const result = McpbManifestSchema.safeParse(manifest);
289+
const result = v0_3.McpbManifestSchema.safeParse(manifest);
290290
expect(result.success).toBe(false);
291291
});
292292

@@ -298,7 +298,7 @@ describe("McpbManifestSchema", () => {
298298
default_locale: "en-US",
299299
},
300300
};
301-
const result = McpbManifestSchema.safeParse(manifest);
301+
const result = v0_3.McpbManifestSchema.safeParse(manifest);
302302
expect(result.success).toBe(true);
303303
});
304304
});
@@ -322,7 +322,7 @@ describe("McpbManifestSchema", () => {
322322
...base,
323323
icons: [{ src: "assets/icon.png", size: "16", theme: "light" }],
324324
};
325-
const result = McpbManifestSchema.safeParse(manifest);
325+
const result = v0_3.McpbManifestSchema.safeParse(manifest);
326326
expect(result.success).toBe(false);
327327
});
328328

@@ -331,7 +331,7 @@ describe("McpbManifestSchema", () => {
331331
...base,
332332
icons: [{ src: "assets/icon.png", size: "128x128" }],
333333
};
334-
const result = McpbManifestSchema.safeParse(manifest);
334+
const result = v0_3.McpbManifestSchema.safeParse(manifest);
335335
expect(result.success).toBe(true);
336336
});
337337
});

0 commit comments

Comments
 (0)