feat: sell the listing to plugin authors, not just describe it
The home had the facts but no pull. It now shows a whole plugin in the hero, explains what a plugin is and why it is cheap to write, says what listing here gets you, and ends on the honest hook: the listing is new, so the first community plugins get the front row. Every claim is one the code backs today. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
8 files changed
+442
-91
No files matched your search
@@ -0,0 +1,47 @@
|
||||
---
|
||||
import { ADD_URL, CONTRIBUTING_URL } from '../../links';
|
||||
---
|
||||
|
||||
<section class="section wrap">
|
||||
<div class="front">
|
||||
<h2>The listing is new. The first plugins get the front row.</h2>
|
||||
<p>Every plugin here today is one of ours. The first community entries are the ones people will see first.</p>
|
||||
<p class="front__actions">
|
||||
<a class="button button--solid" href={ADD_URL}>Add your plugin</a>
|
||||
<a class="button button--ghost" href={CONTRIBUTING_URL}>Read CONTRIBUTING.md</a>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.front {
|
||||
text-align: center;
|
||||
padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3rem);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 16px;
|
||||
background:
|
||||
radial-gradient(ellipse at top, rgba(95, 184, 138, 0.14), transparent 60%),
|
||||
radial-gradient(ellipse at bottom, rgba(124, 108, 240, 0.1), transparent 60%),
|
||||
var(--panel);
|
||||
}
|
||||
|
||||
.front h2 {
|
||||
font-size: clamp(1.5rem, 4vw, 2.2rem);
|
||||
margin: 0 auto 14px;
|
||||
max-width: 24ch;
|
||||
}
|
||||
|
||||
.front p {
|
||||
color: var(--dim);
|
||||
margin: 0 auto;
|
||||
max-width: 56ch;
|
||||
}
|
||||
|
||||
.front__actions {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 1.75rem !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,121 @@
|
||||
---
|
||||
import { Code } from 'astro:components';
|
||||
import { ADD_URL } from '../../links';
|
||||
|
||||
// A whole plugin, written against the real `Plugin` type in core (src/plugin.ts). If that type
|
||||
// changes, this has to change with it — it is the first thing a plugin author reads.
|
||||
const SAMPLE = `import type { Plugin } from '@green-tea/core';
|
||||
|
||||
export function greeting(text = 'hello'): Plugin {
|
||||
return {
|
||||
name: 'greeting',
|
||||
mount({ scope }) {
|
||||
scope.add({
|
||||
kind: 'provider',
|
||||
name: 'greeting',
|
||||
needs: [],
|
||||
provides: ['greeting'],
|
||||
run: () => ({ greeting: text }),
|
||||
});
|
||||
},
|
||||
};
|
||||
}`;
|
||||
---
|
||||
|
||||
<section class="hero">
|
||||
<div class="wrap hero__grid">
|
||||
<div class="hero__content">
|
||||
<p class="kicker">Green Tea. plugins</p>
|
||||
<h1>Write it once. It mounts in any <span class="nowrap">green-tea</span> app.</h1>
|
||||
<p class="hero__lead">
|
||||
A plugin is a name and a mount function. It adds providers and steps to the graph, and
|
||||
green-tea figures out where they run. Publish it to JSR or npm, list it here, and it gets a
|
||||
page of its own.
|
||||
</p>
|
||||
<p class="hero__actions">
|
||||
<a class="button button--solid" href={ADD_URL}>Add your plugin</a>
|
||||
<a class="button button--ghost" href="#plugins">Browse plugins</a>
|
||||
</p>
|
||||
<p class="hero__micro">Node · Deno · Bun · workerd</p>
|
||||
</div>
|
||||
|
||||
<figure class="hero__code" aria-label="A complete plugin">
|
||||
<figcaption>greeting.ts</figcaption>
|
||||
<Code code={SAMPLE} lang="ts" theme="github-dark" />
|
||||
</figure>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.hero {
|
||||
padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2rem, 5vw, 3.5rem);
|
||||
}
|
||||
|
||||
.hero__grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
|
||||
align-items: center;
|
||||
gap: clamp(2rem, 5vw, 3.5rem);
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
font-size: clamp(2.2rem, 5.5vw, 3.3rem);
|
||||
line-height: 1.15;
|
||||
margin: 0 0 18px;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.hero__lead {
|
||||
color: var(--dim);
|
||||
max-width: 52ch;
|
||||
margin: 0;
|
||||
font-size: 1.08rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.hero__actions {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
margin: 1.75rem 0 1.25rem;
|
||||
}
|
||||
|
||||
.hero__micro {
|
||||
margin: 0;
|
||||
color: var(--dim);
|
||||
font-size: 0.85rem;
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
|
||||
.hero__code {
|
||||
margin: 0;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 24px 60px -30px rgba(95, 184, 138, 0.35);
|
||||
}
|
||||
|
||||
.hero__code figcaption {
|
||||
padding: 10px 16px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
color: var(--dim);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
.hero__code :global(pre) {
|
||||
margin: 0;
|
||||
padding: 16px 18px;
|
||||
background: transparent !important;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.65;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.hero__grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,89 @@
|
||||
---
|
||||
import { Code } from 'astro:components';
|
||||
import { EXAMPLE_ENTRY } from '../../links';
|
||||
|
||||
// The editor gets the comment that explains npm; the card is too narrow for it.
|
||||
const shown = EXAMPLE_ENTRY.replace(/[ \t]+#.*$/m, '').trim();
|
||||
---
|
||||
|
||||
<section class="section wrap" id="contribute">
|
||||
<p class="kicker">How it works</p>
|
||||
<h2>Three steps</h2>
|
||||
|
||||
<ol class="steps">
|
||||
<li class="step">
|
||||
<h3>Publish</h3>
|
||||
<p>Put it on JSR, or on npm as an ESM-only package.</p>
|
||||
</li>
|
||||
<li class="step step--wide">
|
||||
<h3>Add one file</h3>
|
||||
<p>Open a pull request that adds one yaml file.</p>
|
||||
<Code code={shown} lang="yaml" theme="github-dark" />
|
||||
</li>
|
||||
<li class="step">
|
||||
<h3>Go live</h3>
|
||||
<p>Once it merges, it is out on the next Friday cut.</p>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.steps {
|
||||
list-style: none;
|
||||
counter-reset: step;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr minmax(0, 2fr) 1fr;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.step {
|
||||
counter-increment: step;
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
padding: 22px 24px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.step::before {
|
||||
content: counter(step);
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
background: rgba(95, 184, 138, 0.12);
|
||||
border: 1px solid rgba(95, 184, 138, 0.35);
|
||||
color: var(--matcha);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.step h3 {
|
||||
margin: 12px 0 6px;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.step p {
|
||||
margin: 0;
|
||||
color: var(--dim);
|
||||
}
|
||||
|
||||
.step :global(pre) {
|
||||
margin: 14px 0 0;
|
||||
padding: 12px 14px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--line);
|
||||
font-size: 0.76rem;
|
||||
line-height: 1.6;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.steps {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
// Every claim here is checked against core: the shape and the three-method API are
|
||||
// `Plugin`/`PluginApi` in src/plugin.ts, and `mountPlugin` hands over nothing else, which is why a
|
||||
// plugin cannot reorder or remove what an app already has.
|
||||
const points = [
|
||||
{
|
||||
title: 'One object',
|
||||
body: '<code>{ name, mount }</code>. No base class to extend and no lifecycle to learn. <code>mount</code> gets <code>bus.on</code>, <code>scope.add</code> and <code>onShutdown</code>, and that is the whole API.',
|
||||
},
|
||||
{
|
||||
title: 'Core as types only',
|
||||
body: 'Plugins import <code>@green-tea/core</code> with <code>import type</code>. Installing one never pulls in a second copy of core, so there is no version to line up.',
|
||||
},
|
||||
{
|
||||
title: 'The graph picks the order',
|
||||
body: 'Say what your plugin needs and what it provides, and green-tea decides where it runs. A plugin can add to an app, but it cannot reorder or remove anything that is already there.',
|
||||
},
|
||||
];
|
||||
---
|
||||
|
||||
<section class="section wrap">
|
||||
<p class="kicker">The idea</p>
|
||||
<h2>What's a plugin, and why write one?</h2>
|
||||
|
||||
<div class="points">
|
||||
{
|
||||
points.map((point, i) => (
|
||||
<article class="point">
|
||||
<span class="point__n" aria-hidden="true">{String(i + 1).padStart(2, '0')}</span>
|
||||
<h3>{point.title}</h3>
|
||||
<p set:html={point.body} />
|
||||
</article>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.points {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.point {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 12px;
|
||||
padding: 22px 24px;
|
||||
}
|
||||
|
||||
.point__n {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.78rem;
|
||||
color: var(--violet);
|
||||
}
|
||||
|
||||
.point h3 {
|
||||
margin: 6px 0 10px;
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.point p {
|
||||
margin: 0;
|
||||
color: var(--dim);
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
.point :global(code) {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.88em;
|
||||
color: var(--matcha);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
// Nothing here promises traffic or reach. Each line is something the listing already does.
|
||||
const reasons = [
|
||||
{ title: 'A page of its own', body: 'Your README, every published version and an install command people can copy.' },
|
||||
{ title: 'Runtimes read, not typed', body: 'Each card shows where your plugin runs, taken from what the package declares.' },
|
||||
{
|
||||
title: "It doesn't go stale",
|
||||
body: 'Your entry has no version in it. Every build asks the registry, so a new release shows up at the next cut without another pull request.',
|
||||
},
|
||||
{ title: 'Read by a person', body: 'Someone who works on green-tea reads each entry before it is listed.' },
|
||||
];
|
||||
---
|
||||
|
||||
<section class="section wrap">
|
||||
<p class="kicker">Why here</p>
|
||||
<h2>Why list it here</h2>
|
||||
|
||||
<dl class="reasons">
|
||||
{
|
||||
reasons.map((reason) => (
|
||||
<div class="reason">
|
||||
<dt>{reason.title}</dt>
|
||||
<dd>{reason.body}</dd>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.reasons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: 28px 36px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.reason {
|
||||
border-left: 2px solid var(--matcha);
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
.reason dt {
|
||||
font-family: var(--font-heading);
|
||||
font-weight: 700;
|
||||
font-size: 1.05rem;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.reason dd {
|
||||
margin: 0;
|
||||
color: var(--dim);
|
||||
line-height: 1.65;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
// Links more than one section needs. The GitHub repo does not exist yet, so these 404 until it does.
|
||||
|
||||
/** What "Add your plugin" pre-fills in GitHub's new-file editor. */
|
||||
export const EXAMPLE_ENTRY = `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."
|
||||
`;
|
||||
|
||||
// GitHub's new-file editor, inside this repo, with the example already filled in: a contributor
|
||||
// edits a few lines and opens the pull request from there.
|
||||
export 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_ENTRY)}`;
|
||||
|
||||
export const CONTRIBUTING_URL = 'https://github.com/Expressive-Tea/green-tea-marketplace/blob/main/CONTRIBUTING.md';
|
||||
+14
-29
@@ -3,6 +3,11 @@ import { getCollection } from 'astro:content';
|
||||
import Header from '../components/Header.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import PluginCard from '../components/PluginCard.astro';
|
||||
import Hero from '../components/sections/Hero.astro';
|
||||
import WhatIsAPlugin from '../components/sections/WhatIsAPlugin.astro';
|
||||
import WhyHere from '../components/sections/WhyHere.astro';
|
||||
import HowItWorks from '../components/sections/HowItWorks.astro';
|
||||
import FrontRow from '../components/sections/FrontRow.astro';
|
||||
import '../styles/global.css';
|
||||
|
||||
// Read at build time by the collection's loader (scripts/loader.mjs) — this site is static files
|
||||
@@ -21,14 +26,6 @@ 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">
|
||||
@@ -44,33 +41,21 @@ const CONTRIBUTING = 'https://github.com/Expressive-Tea/green-tea-marketplace/bl
|
||||
<Header />
|
||||
|
||||
<main>
|
||||
<section class="hero wrap">
|
||||
<h1>Built a green-tea plugin? List it here.</h1>
|
||||
<p class="hero__lead">
|
||||
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="hero__actions">
|
||||
<a class="button" href={ADD_URL}>Add your plugin</a>
|
||||
<a class="button button--ghost" href="#plugins">Browse plugins</a>
|
||||
</p>
|
||||
</section>
|
||||
<Hero />
|
||||
<WhatIsAPlugin />
|
||||
|
||||
<section class="wrap" id="plugins" aria-label="Plugins">
|
||||
<section class="section wrap" id="plugins">
|
||||
<p class="kicker">The listing</p>
|
||||
<h2>Official plugins, and room for yours</h2>
|
||||
<p class="section__lead">Three to start. The version and runtimes on each card come straight from the registry.</p>
|
||||
<div class="grid">
|
||||
{plugins.map((plugin) => <PluginCard {...plugin} />)}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="contribute wrap" id="contribute">
|
||||
<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>
|
||||
<WhyHere />
|
||||
<HowItWorks />
|
||||
<FrontRow />
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
|
||||
+29
-62
@@ -72,75 +72,34 @@ main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.hero {
|
||||
padding-top: clamp(3rem, 7vw, 5rem);
|
||||
/* Each home section brings its own layout; this is the rhythm they share. */
|
||||
.section {
|
||||
padding-top: clamp(3.5rem, 8vw, 5.5rem);
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
font-size: clamp(2.2rem, 6vw, 3.4rem);
|
||||
margin: 0 0 16px;
|
||||
letter-spacing: -0.01em;
|
||||
.section h2 {
|
||||
font-size: clamp(1.6rem, 4vw, 2.2rem);
|
||||
margin: 0 0 24px;
|
||||
}
|
||||
|
||||
.hero__lead {
|
||||
.section__lead {
|
||||
color: var(--dim);
|
||||
margin: -12px 0 24px;
|
||||
max-width: 62ch;
|
||||
margin: 0;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
/* Full container width, like every other section, so its left edge lines up with the cards above.
|
||||
The reading measure is capped on the prose instead — the same split the hero already uses,
|
||||
where `.hero__lead` is narrow inside a full-width `.hero`. Capping the section itself centred it
|
||||
at a narrower width and knocked the whole block out of alignment. */
|
||||
.contribute {
|
||||
padding-top: clamp(3rem, 7vw, 4.5rem);
|
||||
/* Keeps a hyphenated name like green-tea on one line in a large heading. */
|
||||
.nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.contribute h2 {
|
||||
font-size: clamp(1.5rem, 4vw, 2rem);
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
|
||||
.contribute p {
|
||||
color: var(--dim);
|
||||
margin: 0 0 16px;
|
||||
max-width: 68ch;
|
||||
}
|
||||
|
||||
/* The snippet is short and fixed, so it sizes to the prose rather than stretching to the grid. */
|
||||
.contribute pre {
|
||||
max-width: 68ch;
|
||||
}
|
||||
|
||||
.contribute code {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.9em;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.contribute pre {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 10px;
|
||||
padding: 16px 18px;
|
||||
overflow-x: auto;
|
||||
margin: 0 0 20px;
|
||||
}
|
||||
|
||||
.contribute pre code {
|
||||
font-size: 0.82rem;
|
||||
line-height: 1.7;
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.contribute__cadence {
|
||||
border-left: 3px solid var(--matcha);
|
||||
padding-left: 14px;
|
||||
}
|
||||
|
||||
.contribute__cadence strong {
|
||||
.kicker {
|
||||
margin: 0 0 8px;
|
||||
color: var(--matcha);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.78rem;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.button {
|
||||
@@ -159,6 +118,18 @@ main {
|
||||
border-color: var(--matcha);
|
||||
}
|
||||
|
||||
/* The one action the page is for. */
|
||||
.button--solid {
|
||||
background: var(--matcha);
|
||||
border-color: var(--matcha);
|
||||
color: var(--base);
|
||||
}
|
||||
|
||||
.button--solid:hover {
|
||||
background: var(--matcha-deep);
|
||||
border-color: var(--matcha-deep);
|
||||
}
|
||||
|
||||
/* The one thing a reader has to know before installing anything here. */
|
||||
.requires {
|
||||
margin: 24px 0 0;
|
||||
@@ -420,9 +391,5 @@ main {
|
||||
.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