fix(custom-widgets): refine v2 authoring
This commit is contained in:
124 files changed
+2089
-913
No files matched your search
@@ -1,15 +1,9 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
import {
|
||||
CUSTOM_WIDGET_SKILL_MD,
|
||||
CUSTOM_WIDGET_SKILL_SHA256,
|
||||
getCustomWidgetComponent,
|
||||
getCustomWidgetSkill,
|
||||
} from "../core/authoring-resources";
|
||||
import { CUSTOM_WIDGET_SKILL_MD, getCustomWidgetComponent, getCustomWidgetSkill } from "../core/authoring-resources";
|
||||
|
||||
const repositoryRoot = resolve(import.meta.dirname, "../../../..");
|
||||
|
||||
@@ -20,11 +14,15 @@ describe("custom widget Agent Skill", () => {
|
||||
expect(getCustomWidgetSkill().skillMd).toBe(source);
|
||||
});
|
||||
|
||||
test("publishes the exact archive hash", async () => {
|
||||
const archive = await readFile(
|
||||
resolve(repositoryRoot, "apps/docs/static/downloads/homarr-custom-widget-2.0.0.zip"),
|
||||
test("publishes repository-based skills.sh installation metadata", () => {
|
||||
const skill = getCustomWidgetSkill();
|
||||
expect(skill.skillsShUrl).toBe("https://www.skills.sh/homarr-labs/homarr/homarr-custom-widget");
|
||||
expect(skill.sourceUrl).toContain("github.com/homarr-labs/homarr/tree/v2/.agents/skills/homarr-custom-widget");
|
||||
expect(skill.installCommand).toBe(
|
||||
"npx skills add https://github.com/homarr-labs/homarr --skill homarr-custom-widget",
|
||||
);
|
||||
expect(createHash("sha256").update(archive).digest("hex")).toBe(CUSTOM_WIDGET_SKILL_SHA256);
|
||||
expect(skill).not.toHaveProperty("sha256");
|
||||
expect(skill).not.toHaveProperty("downloadUrl");
|
||||
});
|
||||
|
||||
test("publishes safe icon names with the Tabler icon component", () => {
|
||||
|
||||
Reference in new issue
Block a user