diff --git a/src/cli/init.ts b/src/cli/init.ts index 9e62777..60b353e 100644 --- a/src/cli/init.ts +++ b/src/cli/init.ts @@ -5,7 +5,7 @@ import type { z } from "zod"; // Import the schema for DEFAULT_MANIFEST_VERSION // TODO: Allow dynamic manifest version choice -import type { McpbManifestSchema } from "../schemas/0.2.js"; +import type { McpbManifestSchema } from "../schemas/0.3.js"; import { DEFAULT_MANIFEST_VERSION } from "../shared/constants.js"; interface PackageJson { @@ -877,10 +877,10 @@ export function buildManifest( license: string; repository?: { type: string; url: string }; }, - // localization?: { - // resources: string; - // default_locale: string; - // }, + localization?: { + resources: string; + default_locale: string; + }, ): z.infer { const { name, displayName, version, description, authorName } = basicInfo; const { authorEmail, authorUrl } = authorInfo; @@ -909,7 +909,7 @@ export function buildManifest( ...(visualAssets.screenshots.length > 0 ? { screenshots: visualAssets.screenshots } : {}), - // ...(localization ? { localization } : {}), + ...(localization ? { localization } : {}), server: { type: serverType, entry_point: entryPoint, @@ -994,9 +994,9 @@ export async function initExtension( const visualAssets = nonInteractive ? { icon: "", icons: [], screenshots: [] } : await promptVisualAssets(); - // const localization = nonInteractive - // ? undefined - // : await promptLocalization(); + const localization = nonInteractive + ? undefined + : await promptLocalization(); const serverConfig = nonInteractive ? getDefaultServerConfig(packageData) : await promptServerConfig(packageData); @@ -1029,6 +1029,7 @@ export async function initExtension( compatibility, userConfig, optionalFields, + localization, ); // Write manifest diff --git a/src/shared/constants.ts b/src/shared/constants.ts index 53b08ed..e2bcb4c 100644 --- a/src/shared/constants.ts +++ b/src/shared/constants.ts @@ -13,7 +13,7 @@ export const LATEST_MANIFEST_VERSION = "0.3" as const; /** * Default manifest version for new packages */ -export const DEFAULT_MANIFEST_VERSION = "0.2" as const; +export const DEFAULT_MANIFEST_VERSION = "0.3" as const; /** * Map of manifest versions to their strict schemas diff --git a/test/init.test.ts b/test/init.test.ts index 7acd57a..71d79e7 100644 --- a/test/init.test.ts +++ b/test/init.test.ts @@ -216,7 +216,7 @@ describe("init functions", () => { keywords: "", license: "", }, - // undefined, // localization + undefined, // localization ); expect(manifest).toEqual({ @@ -315,10 +315,11 @@ describe("init functions", () => { license: "MIT", repository: { type: "git", url: "https://github.com/user/repo" }, }, - // { // localization - // resources: "resources/${locale}.json", - // default_locale: "en-US", - // }, + { + // localization + resources: "resources/${locale}.json", + default_locale: "en-US", + }, ); expect(manifest).toEqual({ @@ -388,6 +389,10 @@ describe("init functions", () => { keywords: ["test", "extension", "mcp"], license: "MIT", repository: { type: "git", url: "https://github.com/user/repo" }, + localization: { + default_locale: "en-US", + resources: "resources/${locale}.json", + }, }); }); });