Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ version, title, author, repository, description and supported platforms),
`src/index.ts` (manifest, navigation and routes), and `src/page.ts` (sidebar UI).
The example serves its page at `/ui/` and preserves JSON at `/`.

The registry previews come from `temps.screenshots` in `package.json`. Replace
the light/dark PNGs in `assets/` with screenshots of your own plugin, and update
each repository-relative `path`, descriptive `alt`, and optional `caption`.
Capture only the plugin UI: never include credentials, account details, or
private project data. The catalog resolves these paths at the plugin's pinned
Git commit; changes appear after merging and refreshing the GitHub catalog.

```sh
bun install --frozen-lockfile
bun test
Expand Down
Binary file added assets/plugin-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
"title": "My plugin",
"category": "Development",
"entrypoint": "src/index.ts",
"screenshots": [
{
"path": "assets/plugin-light.png",
"alt": "My plugin in light mode, showing its online status and hello-world API response",
"caption": "The starter plugin running inside Temps in light mode."
},
{
"path": "assets/plugin-dark.png",
"alt": "My plugin in dark mode, showing its online status and hello-world API response",
"caption": "The same plugin UI adapts to dark mode."
}
],
"platforms": ["linux-amd64-gnu", "linux-arm64-gnu", "linux-amd64-musl", "linux-arm64-musl", "darwin-amd64", "darwin-arm64"]
}
}
17 changes: 17 additions & 0 deletions src/screenshots.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-FileCopyrightText: 2024-2026 Temps Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
import { expect, test } from "bun:test";
import pkg from "../package.json";

test("registry screenshots reference real PNG assets with accessible descriptions", async () => {
expect(pkg.temps.screenshots).toHaveLength(2);
for (const screenshot of pkg.temps.screenshots) {
expect(screenshot.path).toMatch(/^assets\/[a-z-]+\.png$/);
expect(screenshot.alt.length).toBeGreaterThan(20);
const image = Bun.file(new URL(`../${screenshot.path}`, import.meta.url));
expect(await image.exists()).toBe(true);
const bytes = new Uint8Array(await image.arrayBuffer());
expect(Array.from(bytes.slice(0, 8))).toEqual([137, 80, 78, 71, 13, 10, 26, 10]);
expect(bytes.length).toBeLessThan(500_000);
}
});
Loading