feat: validate manifest version during pack command
Add validation to ensure the manifest_version matches the current expected version (0.2) during the mcpb pack command. This prevents users from packing extensions with outdated or incorrect manifest versions. Changes: - Add CURRENT_MANIFEST_VERSION constant to centralize version management - Validate manifest version in pack command before creating bundle - Update init command to use version constant - Update tests to use version constant - Fix prettier formatting issues
This commit is contained in:
parent
2825da1d6a
commit
f92fe4ab69
1 changed files with 70 additions and 47 deletions
|
|
@ -10,6 +10,7 @@ import {
|
|||
getDefaultRepositoryUrl,
|
||||
readPackageJson,
|
||||
} from "../src/cli/init.js";
|
||||
import { CURRENT_MANIFEST_VERSION } from "../src/schemas.js";
|
||||
|
||||
// Mock the fs module
|
||||
jest.mock("fs", () => ({
|
||||
|
|
@ -217,7 +218,7 @@ describe("init functions", () => {
|
|||
);
|
||||
|
||||
expect(manifest).toEqual({
|
||||
manifest_version: "0.1",
|
||||
manifest_version: CURRENT_MANIFEST_VERSION,
|
||||
name: "test-extension",
|
||||
version: "1.0.0",
|
||||
description: "Test description",
|
||||
|
|
@ -303,7 +304,7 @@ describe("init functions", () => {
|
|||
);
|
||||
|
||||
expect(manifest).toEqual({
|
||||
manifest_version: "0.1",
|
||||
manifest_version: CURRENT_MANIFEST_VERSION,
|
||||
name: "test-extension",
|
||||
display_name: "Test Extension",
|
||||
version: "1.0.0",
|
||||
|
|
|
|||
Loading…
Reference in a new issue