One YAML file per plugin. There is deliberately no version and no runtimes field in an entry: both are read from npm and JSR when the page is built, so a card cannot go stale or claim support a package never declared. The strictness lives in one flag. Under CI a registry that does not answer fails the build, because a listing that silently drops a plugin is worse than no deploy. Locally an unpublished package falls back to scripts/preview.mjs and says so — a site nobody can look at until its packages ship is a site nobody can design. The three seed plugins are unpublished today, so that fallback is what renders them; it goes away with them. Every card shows all four runtimes, never only the supported ones. Colour means the package declares it runs there, dim grey means it does not — and the tooltip is what separates "declared unsupported" from "nobody said", which look identical but are not the same fact. The brand marks carry no <title>: an SVG's own title wins over its parent's, which is why the first attempt showed a help cursor and no tooltip. They are aria-hidden and pointer-events: none, so the label and the hover both belong to the list item, and the tooltip works from the keyboard too. Type and palette are self-hosted from green-tea-site, so the sites read as one project rather than three that share a colour. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
76 lines
2.8 KiB
Plaintext
76 lines
2.8 KiB
Plaintext
---
|
|
import { getCollection } from 'astro:content';
|
|
import { readEntry } from '../../scripts/registry.mjs';
|
|
// Remove this import together with scripts/preview.mjs once the seed plugins are published.
|
|
import { PREVIEW } from '../../scripts/preview.mjs';
|
|
import PluginCard from '../components/PluginCard.astro';
|
|
import '../styles/global.css';
|
|
|
|
// Read at build time, never at request time — this site is static files on cPanel. Under CI a
|
|
// registry that does not answer fails the build; off CI an unpublished package falls back to
|
|
// preview data so the page can still be looked at. See scripts/registry.mjs.
|
|
const entries = await getCollection('plugins');
|
|
const plugins = await Promise.all(
|
|
entries.map(async (entry) => {
|
|
const { version, runtimes } = await readEntry(entry.data, PREVIEW);
|
|
|
|
return {
|
|
name: entry.data.npm ?? entry.data.jsr,
|
|
description: entry.data.description,
|
|
repo: entry.data.repo,
|
|
npm: entry.data.npm,
|
|
jsr: entry.data.jsr,
|
|
version,
|
|
runtimes,
|
|
// An internal plugin could be listed on JSR alone and still be ours, so check both fields.
|
|
internal: (entry.data.npm ?? entry.data.jsr ?? '').startsWith('@green-tea/'),
|
|
};
|
|
}),
|
|
);
|
|
|
|
plugins.sort((a, b) => a.name.localeCompare(b.name));
|
|
---
|
|
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width" />
|
|
<title>green-tea plugins</title>
|
|
<meta name="description" content="Plugins for green-tea, with the runtimes each one declares." />
|
|
<link rel="canonical" href="https://green-tea.expressive-tea.io/plugins" />
|
|
</head>
|
|
<body>
|
|
<div class="wrap">
|
|
<header>
|
|
<h1>green-tea <em>plugins</em></h1>
|
|
<p>
|
|
A plugin is a named object that adds steps and providers to your graph. It imports green-tea
|
|
as types only, so installing one never pulls a second copy of core.
|
|
</p>
|
|
<p>
|
|
<a href="https://github.com/Expressive-Tea/green-tea-marketplace/blob/main/CONTRIBUTING.md">
|
|
Add your plugin →
|
|
</a>
|
|
</p>
|
|
<p class="requires">
|
|
Everything here needs <code>@green-tea/core@26.9.0-beta.2</code> or newer. That is the
|
|
release where a plugin became <code>{ name, mount }</code> and <code>app.boot()</code>
|
|
went public; on anything older these will not mount.
|
|
</p>
|
|
</header>
|
|
|
|
<div class="grid">
|
|
{plugins.map((plugin) => <PluginCard {...plugin} />)}
|
|
</div>
|
|
|
|
<footer>
|
|
<p>
|
|
Part of <a href="https://expressive-tea.io">Expressive Tea</a> ·
|
|
<a href="https://green-tea.expressive-tea.io">green-tea</a> ·
|
|
<a href="https://github.com/Expressive-Tea/green-tea-marketplace">this listing on GitHub</a>
|
|
</p>
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|