@pixi-ui-editor/schema 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1932 -81
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +217 -8
- package/dist/index.js.map +1 -1
- package/dist/prefabs.d.ts.map +1 -1
- package/dist/prefabs.js +37 -1
- package/dist/prefabs.js.map +1 -1
- package/package.json +4 -2
- package/dist/assetPaths.test.d.ts +0 -2
- package/dist/assetPaths.test.d.ts.map +0 -1
- package/dist/assetPaths.test.js +0 -26
- package/dist/assetPaths.test.js.map +0 -1
- package/dist/index.test-fixtures.d.ts +0 -20
- package/dist/index.test-fixtures.d.ts.map +0 -1
- package/dist/index.test-fixtures.js +0 -161
- package/dist/index.test-fixtures.js.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/index.test.js +0 -458
- package/dist/index.test.js.map +0 -1
- package/dist/manifest.test.d.ts +0 -2
- package/dist/manifest.test.d.ts.map +0 -1
- package/dist/manifest.test.js +0 -35
- package/dist/manifest.test.js.map +0 -1
package/dist/manifest.test.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { parseProjectManifest, ProjectManifestError, serializeProjectManifest } from "./manifest.js";
|
|
3
|
-
const validManifest = {
|
|
4
|
-
formatVersion: 1,
|
|
5
|
-
projectId: "40000000-0000-4000-8000-000000000001",
|
|
6
|
-
name: "Demo Project",
|
|
7
|
-
createdAt: "2026-01-01T00:00:00.000Z",
|
|
8
|
-
editorVersion: "0.0.0",
|
|
9
|
-
};
|
|
10
|
-
describe("project manifest", () => {
|
|
11
|
-
it("round-trips a valid manifest deterministically regardless of key order", () => {
|
|
12
|
-
const reordered = Object.fromEntries(Object.entries(validManifest).reverse());
|
|
13
|
-
const serialized = serializeProjectManifest(validManifest);
|
|
14
|
-
expect(serialized).toBe(serializeProjectManifest(reordered));
|
|
15
|
-
expect(serialized.endsWith("\n")).toBe(true);
|
|
16
|
-
expect(serialized).toContain("\n \"createdAt\"");
|
|
17
|
-
expect(parseProjectManifest(JSON.parse(serialized))).toEqual(validManifest);
|
|
18
|
-
});
|
|
19
|
-
it.each([
|
|
20
|
-
["INVALID_MANIFEST_SHAPE", { ...validManifest, projectId: "not-a-uuid" }],
|
|
21
|
-
["INVALID_MANIFEST_SHAPE", { ...validManifest, name: "" }],
|
|
22
|
-
["UNSUPPORTED_MANIFEST_VERSION", { ...validManifest, formatVersion: 2 }],
|
|
23
|
-
])("rejects an invalid manifest with code %s", (code, invalid) => {
|
|
24
|
-
expect(() => parseProjectManifest(invalid)).toThrow(ProjectManifestError);
|
|
25
|
-
try {
|
|
26
|
-
parseProjectManifest(invalid);
|
|
27
|
-
expect.unreachable();
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
expect(error).toBeInstanceOf(ProjectManifestError);
|
|
31
|
-
expect(error.code).toBe(code);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=manifest.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.test.js","sourceRoot":"","sources":["../src/manifest.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,wBAAwB,EAAwB,MAAM,eAAe,CAAC;AAE3H,MAAM,aAAa,GAAoB;IACrC,aAAa,EAAE,CAAC;IAChB,SAAS,EAAE,sCAAsC;IACjD,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,0BAA0B;IACrC,aAAa,EAAE,OAAO;CACvB,CAAC;AAEF,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;QA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CAAE,KAA8B,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it } from \"vitest\";\r\nimport { parseProjectManifest, ProjectManifestError, serializeProjectManifest, type ProjectManifest } from \"./manifest.js\";\r\n\r\nconst validManifest: ProjectManifest = {\r\n formatVersion: 1,\r\n projectId: \"40000000-0000-4000-8000-000000000001\",\r\n name: \"Demo Project\",\r\n createdAt: \"2026-01-01T00:00:00.000Z\",\r\n editorVersion: \"0.0.0\",\r\n};\r\n\r\ndescribe(\"project manifest\", () => {\r\n it(\"round-trips a valid manifest deterministically regardless of key order\", () => {\r\n const reordered = Object.fromEntries(Object.entries(validManifest).reverse()) as ProjectManifest;\r\n\r\n const serialized = serializeProjectManifest(validManifest);\r\n expect(serialized).toBe(serializeProjectManifest(reordered));\r\n expect(serialized.endsWith(\"\\n\")).toBe(true);\r\n expect(serialized).toContain(\"\\n \\\"createdAt\\\"\");\r\n\r\n expect(parseProjectManifest(JSON.parse(serialized))).toEqual(validManifest);\r\n });\r\n\r\n it.each([\r\n [\"INVALID_MANIFEST_SHAPE\", { ...validManifest, projectId: \"not-a-uuid\" }],\r\n [\"INVALID_MANIFEST_SHAPE\", { ...validManifest, name: \"\" }],\r\n [\"UNSUPPORTED_MANIFEST_VERSION\", { ...validManifest, formatVersion: 2 }],\r\n ] as const)(\"rejects an invalid manifest with code %s\", (code, invalid) => {\r\n expect(() => parseProjectManifest(invalid)).toThrow(ProjectManifestError);\r\n try {\r\n parseProjectManifest(invalid);\r\n expect.unreachable();\r\n } catch (error) {\r\n expect(error).toBeInstanceOf(ProjectManifestError);\r\n expect((error as ProjectManifestError).code).toBe(code);\r\n }\r\n });\r\n});\r\n"]}
|