feat: plugin pages, ESM-only npm, and a home that sells the listing #2
No files matched your search
@@ -0,0 +1,44 @@
|
||||
# Listing a plugin
|
||||
|
||||
## What counts as a green-tea plugin
|
||||
|
||||
A factory that returns `{ name, mount }`. It imports `@green-tea/core` as types only, with core in
|
||||
`devDependencies`, so installing the plugin never pulls in a second copy of core. It needs
|
||||
`@green-tea/core@26.9.0-beta.2` or newer. That is the release where plugins took this shape and
|
||||
`app.boot()` became public.
|
||||
|
||||
## Where to publish it
|
||||
|
||||
JSR is what we recommend. It records which runtimes a package supports, and the listing shows
|
||||
that on every card.
|
||||
|
||||
npm works too, as long as the package is ESM only: `"type": "module"`, no `require` condition, and
|
||||
no `.cjs` file in `main` or `exports`. Dual ESM/CJS packages are turned away. green-tea is ESM from
|
||||
end to end, and a `require` path is the first thing to break when the Node version floor moves.
|
||||
|
||||
## Add the entry
|
||||
|
||||
Add one file, `src/content/plugins/<name>.yaml`:
|
||||
|
||||
```yaml
|
||||
jsr: "@your-scope/green-tea-your-plugin" # or npm: green-tea-your-plugin
|
||||
repo: https://github.com/you/green-tea-your-plugin
|
||||
description: "One sentence, 20 to 200 characters."
|
||||
```
|
||||
|
||||
Names follow one pattern per registry: `green-tea-<x>` or `@scope/green-tea-<x>` on npm,
|
||||
`@scope/<x>` on JSR. There is no version field and no runtimes field. The listing reads both from
|
||||
the registry, so your entry can't go stale.
|
||||
|
||||
## What gets checked
|
||||
|
||||
The build checks two things on its own: the package exists on the registry you named, and an npm
|
||||
package is ESM only. A package that fails either one is not listed.
|
||||
|
||||
A person checks the rest. The package has to be a factory returning `{ name, mount }` and keep
|
||||
core as a type-only dependency. Its README has to cover all four runtimes (Node, Deno, Bun,
|
||||
workerd) and give a reason next to each one it doesn't support.
|
||||
|
||||
## When it goes live
|
||||
|
||||
Merged entries go out with the next Friday cut.
|
||||
@@ -8,7 +8,7 @@ const linkColumns = [
|
||||
{
|
||||
heading: 'This listing',
|
||||
links: [
|
||||
{ label: 'Add your plugin', href: '#contribute', external: false },
|
||||
{ label: 'Add your plugin', href: '/plugins/#contribute', external: false },
|
||||
{
|
||||
label: 'Source',
|
||||
href: 'https://github.com/Expressive-Tea/green-tea-marketplace',
|
||||
|
||||
@@ -6,7 +6,7 @@ import Icon from './Icon.astro';
|
||||
// what this one is. The logo links out to green-tea rather than to `/`, because a reader who
|
||||
// clicks a brand mark is asking for the project, and the project lives elsewhere.
|
||||
const navLinks = [
|
||||
{ label: 'Add your plugin', href: '#contribute', external: false },
|
||||
{ label: 'Add your plugin', href: '/plugins/#contribute', external: false },
|
||||
{ label: 'Docs', href: 'https://green-tea.expressive-tea.io/docs', external: true },
|
||||
{ label: 'green-tea', href: 'https://green-tea.expressive-tea.io', external: true },
|
||||
{
|
||||
|
||||
+23
-35
@@ -21,6 +21,14 @@ const plugins = (await getCollection('plugins'))
|
||||
internal: (data.jsr ?? data.npm ?? '').startsWith('@green-tea/'),
|
||||
}))
|
||||
.sort((a, b) => a.name.localeCompare(b.name));
|
||||
// "Add your plugin" opens GitHub's new-file editor inside this repo with an example already
|
||||
// filled in, so a contributor edits a few lines and opens the pull request from there.
|
||||
const EXAMPLE = `jsr: "@your-scope/green-tea-your-plugin" # recommended. Or npm: green-tea-your-plugin (ESM only)
|
||||
repo: https://github.com/you/green-tea-your-plugin
|
||||
description: "One sentence, 20 to 200 characters."
|
||||
`;
|
||||
const ADD_URL = `https://github.com/Expressive-Tea/green-tea-marketplace/new/main/src/content/plugins?filename=green-tea-your-plugin.yaml&value=${encodeURIComponent(EXAMPLE)}`;
|
||||
const CONTRIBUTING = 'https://github.com/Expressive-Tea/green-tea-marketplace/blob/main/CONTRIBUTING.md';
|
||||
---
|
||||
|
||||
<html lang="en">
|
||||
@@ -29,7 +37,7 @@ const plugins = (await getCollection('plugins'))
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" href="/plugins/favicon.svg" type="image/svg+xml" />
|
||||
<title>Green Tea. plugins</title>
|
||||
<meta name="description" content="Plugins for green-tea, with the runtimes each one declares." />
|
||||
<meta name="description" content="List your green-tea plugin. JSR recommended; npm works too, as long as it is ESM only." />
|
||||
<link rel="canonical" href="https://green-tea.expressive-tea.io/plugins" />
|
||||
</head>
|
||||
<body>
|
||||
@@ -37,51 +45,31 @@ const plugins = (await getCollection('plugins'))
|
||||
|
||||
<main>
|
||||
<section class="hero wrap">
|
||||
<h1>Plugins</h1>
|
||||
<h1>Built a green-tea plugin? List it here.</h1>
|
||||
<p class="hero__lead">
|
||||
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.
|
||||
Publish it to JSR (our recommendation) or to npm as ESM only. Then add one small file to
|
||||
this repo, and it shows up on the next Friday cut.
|
||||
</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 class="hero__actions">
|
||||
<a class="button" href={ADD_URL}>Add your plugin</a>
|
||||
<a class="button button--ghost" href="#plugins">Browse plugins</a>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section class="wrap">
|
||||
<section class="wrap" id="plugins" aria-label="Plugins">
|
||||
<div class="grid">
|
||||
{plugins.map((plugin) => <PluginCard {...plugin} />)}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="contribute wrap" id="contribute">
|
||||
<h2>Add your plugin</h2>
|
||||
<p>
|
||||
Fork the listing, add one file under <code>src/content/plugins/</code>, open a pull
|
||||
request. There is no version and no runtimes field — both are read from the registry, so
|
||||
your entry cannot go stale.
|
||||
</p>
|
||||
|
||||
<pre><code>npm: green-tea-foo # at least one of npm / jsr
|
||||
jsr: "@acme/green-tea-foo"
|
||||
repo: https://github.com/acme/green-tea-foo
|
||||
description: "One sentence, 20–200 characters."</code></pre>
|
||||
|
||||
<p>
|
||||
A check runs against npm and JSR: the package has to exist, depend on
|
||||
<code>@green-tea/core</code>, and declare at least one runtime. Then a person reads it —
|
||||
that it really is a factory returning <code>{ name, mount }</code>, and that its
|
||||
README lists all four runtimes with a reason beside each one it does not support.
|
||||
</p>
|
||||
<p class="contribute__cadence">
|
||||
Merged entries go live on the next <strong>Friday</strong> cut.
|
||||
</p>
|
||||
<p>
|
||||
<a class="button" href="https://github.com/Expressive-Tea/green-tea-marketplace">
|
||||
Open the listing on GitHub →
|
||||
</a>
|
||||
</p>
|
||||
<h2>How it works</h2>
|
||||
<ol class="steps">
|
||||
<li>Publish to JSR, or to npm as an ESM-only package.</li>
|
||||
<li>Open a pull request that adds one yaml file.</li>
|
||||
<li>When it merges, it goes live the next Friday.</li>
|
||||
</ol>
|
||||
<p>What counts as a plugin, and what a reviewer checks, is in <a href={CONTRIBUTING}>CONTRIBUTING.md</a>.</p>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
|
||||
@@ -419,3 +419,10 @@ main {
|
||||
.plugin__body { grid-template-columns: 1fr; }
|
||||
.versions { order: -1; }
|
||||
}
|
||||
|
||||
.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
|
||||
.button--ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
|
||||
.button--ghost:hover { border-color: var(--matcha); }
|
||||
.steps { padding-left: 1.25rem; }
|
||||
.steps li { padding-block: 0.25rem; }
|
||||
.contribute a:not(.button) { color: var(--matcha); }
|
||||
Reference in new issue
Block a user