Revert "feat: replace manifest_version with $schema field"

This reverts commit 7997e72758.
This commit is contained in:
Joan Xie 2025-08-27 11:24:18 -07:00
commit 5a46a05108
No known key found for this signature in database
6 changed files with 30 additions and 94 deletions

View file

@ -91,7 +91,7 @@ describe("DXT CLI", () => {
fs.writeFileSync(
join(tempDir, "manifest.json"),
JSON.stringify({
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
manifest_version: "1.0",
name: "Test Extension",
version: "1.0.0",
description: "A test extension",
@ -188,7 +188,7 @@ describe("DXT CLI", () => {
fs.writeFileSync(
join(tempExecDir, "manifest.json"),
JSON.stringify({
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
manifest_version: "1.0",
name: "Test Executable Extension",
version: "1.0.0",
description: "A test extension with executable files",

View file

@ -90,7 +90,7 @@ describe("getMcpConfigForManifest", () => {
};
const baseManifest: McpbManifest = {
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
manifest_version: "1.0.0",
name: "test-extension",
version: "1.0.0",
description: "Test extension",
@ -305,7 +305,7 @@ describe("getMcpConfigForManifest", () => {
describe("hasRequiredConfigMissing", () => {
const baseManifest: McpbManifest = {
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
manifest_version: "1.0.0",
name: "test-extension",
version: "1.0.0",
description: "Test extension",

View file

@ -217,7 +217,7 @@ describe("init functions", () => {
);
expect(manifest).toEqual({
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
manifest_version: "0.1",
name: "test-extension",
version: "1.0.0",
description: "Test description",
@ -303,7 +303,7 @@ describe("init functions", () => {
);
expect(manifest).toEqual({
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
manifest_version: "0.1",
name: "test-extension",
display_name: "Test Extension",
version: "1.0.0",

View file

@ -1,5 +1,5 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
"manifest_version": "1.0",
"name": "test-extension",
"version": "1.0.0",
"description": "A test DXT extension",

View file

@ -37,7 +37,7 @@ describe("McpbManifestSchema", () => {
it("should validate manifest with all optional fields", () => {
const fullManifest = {
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
manifest_version: "1.0",
name: "full-extension",
display_name: "Full Featured Extension",
version: "2.0.0",
@ -117,7 +117,7 @@ describe("McpbManifestSchema", () => {
serverTypes.forEach((type) => {
const manifest = {
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
manifest_version: "1.0",
name: "test",
version: "1.0.0",
description: "Test",
@ -136,73 +136,4 @@ describe("McpbManifestSchema", () => {
expect(result.success).toBe(true);
});
});
describe("backward compatibility", () => {
it("should accept manifest with dxt_version instead of $schema", () => {
const legacyManifest = {
dxt_version: "0.1",
name: "legacy-extension",
version: "1.0.0",
description: "Legacy extension",
author: { name: "Test Author" },
server: {
type: "node",
entry_point: "server.js",
mcp_config: {
command: "node",
args: ["server.js"],
},
},
};
const result = McpbManifestSchema.safeParse(legacyManifest);
expect(result.success).toBe(true);
});
it("should accept manifest with $schema", () => {
const modernManifest = {
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
name: "modern-extension",
version: "1.0.0",
description: "Modern extension",
author: { name: "Test Author" },
server: {
type: "node",
entry_point: "server.js",
mcp_config: {
command: "node",
args: ["server.js"],
},
},
};
const result = McpbManifestSchema.safeParse(modernManifest);
expect(result.success).toBe(true);
});
it("should reject manifest without $schema or dxt_version", () => {
const invalidManifest = {
name: "invalid-extension",
version: "1.0.0",
description: "Invalid extension",
author: { name: "Test Author" },
server: {
type: "node",
entry_point: "server.js",
mcp_config: {
command: "node",
args: ["server.js"],
},
},
};
const result = McpbManifestSchema.safeParse(invalidManifest);
expect(result.success).toBe(false);
if (!result.success) {
expect(result.error.issues[0].message).toContain(
"Either '$schema' or 'dxt_version' (deprecated) must be provided"
);
}
});
});
});

View file

@ -1,5 +1,5 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
"manifest_version": "1.0",
"name": "test-extension",
"display_name": "Test Extension",
"version": "1.0.0",