docs: add the community files GitHub expects before this goes public
The repository had a LICENSE and nothing else. Adds CONTRIBUTING, a code of conduct, a security policy, the DCO, issue templates and a pull request template — the set GitHub checks for, written for these packages rather than copied from core. **This adds a `contrib` branch, reversing a decision made earlier today.** The promotion originally mirrored `main` alone, on the reasoning that a repository with no documented contribution flow does not need a branch nobody targets. That reasoning held right up until we decided to document one. CONTRIBUTING has to send people somewhere, `main` is the wrong answer — a pull request there puts the forges out of step and breaks the next promotion — so `develop → contrib` is back, the same arrangement core runs. What is adapted rather than inherited: - Node 22, not core's 18, which is what every package here already requires. - No build step anywhere. JSR transpiles the source, so `deno publish --dry-run` is what stands in for one. - The four traps an assistant falls into *here*: turning `import type` into a value import, adding a build, writing for Node alone, and changing `engines` without the README's Runtimes table. - SECURITY scopes each package separately, and sends vulnerabilities in the framework itself to core — same people, but the advisory has to live where the fix does. There is also a plugin proposal template, which exists to ask the question that is cheaper in a paragraph than in a written pull request: whether a thing belongs in the official set at all, or is better as the author's own package. The template says the second outcome is first-class, because it usually is. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
10 files changed
+460
-23
No files matched your search
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: A plugin behaves differently from what its README or its types promise
|
||||
labels: bug
|
||||
---
|
||||
|
||||
## Which plugin
|
||||
|
||||
<!-- @green-tea/jwt, @green-tea/metrics or @green-tea/rate-limit -->
|
||||
|
||||
## What happened
|
||||
|
||||
## What you expected
|
||||
|
||||
## Minimal reproduction
|
||||
|
||||
The smallest app that shows it — the `createApp` call, the plugin options, and the route:
|
||||
|
||||
```ts
|
||||
|
||||
```
|
||||
|
||||
## Environment
|
||||
|
||||
- Plugin version:
|
||||
- `@green-tea/core` version:
|
||||
- Runtime and version: <!-- Node 22.11 / Deno 2.1 / Bun 1.3 / Cloudflare Workers -->
|
||||
- OS:
|
||||
|
||||
<!--
|
||||
If it works on one runtime and not another, say which. That difference is usually
|
||||
the bug rather than a detail of it.
|
||||
|
||||
Each README has a Runtimes table. If the behaviour you hit is a runtime the table
|
||||
already rules out, that is a documentation problem rather than a bug — still worth
|
||||
filing, just say so.
|
||||
-->
|
||||
@@ -0,0 +1,14 @@
|
||||
# Design questions and "should this live here?" threads do not fit a form, and they are
|
||||
# worth having. Keep the blank option available.
|
||||
blank_issues_enabled: true
|
||||
|
||||
contact_links:
|
||||
- name: Security vulnerability
|
||||
url: https://github.com/Expressive-Tea/green-tea-plugins/security/advisories/new
|
||||
about: Report it privately instead. Never in a public issue — see SECURITY.md.
|
||||
- name: A bug in green-tea itself
|
||||
url: https://github.com/Expressive-Tea/green-tea/issues/new
|
||||
about: The framework lives in its own repository. Plugins are types-only against it.
|
||||
- name: Documentation
|
||||
url: https://green-tea.expressive-tea.io/docs/
|
||||
about: How to wire a route, a module, a plugin or a runtime adapter.
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Plugin proposal
|
||||
about: Suggest something for the official set — before writing it
|
||||
labels: enhancement
|
||||
---
|
||||
|
||||
## What it does
|
||||
|
||||
<!-- One paragraph. What a user gets that they do not have today. -->
|
||||
|
||||
## Why it belongs in the official set
|
||||
|
||||
<!--
|
||||
The honest question is not whether the code would be good. It is whether this
|
||||
belongs here rather than as your own package.
|
||||
|
||||
A plugin that depends on a service, a vendor or a protocol we cannot test is
|
||||
usually better as `@you/green-tea-whatever`, published to JSR or npm. That is a
|
||||
first-class outcome, not a consolation — say so if you already plan it that way
|
||||
and only want a sanity check.
|
||||
-->
|
||||
|
||||
## Runtimes it could support
|
||||
|
||||
<!--
|
||||
Node, Deno, Bun, workerd — and which it cannot, with the reason. A plugin that
|
||||
needs a filesystem cannot serve workerd, for instance, and knowing that early
|
||||
changes the design rather than the documentation.
|
||||
-->
|
||||
|
||||
## Shape
|
||||
|
||||
```ts
|
||||
// The call as a user would write it.
|
||||
```
|
||||
@@ -0,0 +1,26 @@
|
||||
> **Base branch:** on GitHub this must target `contrib`, not `main`. You can change it above before you submit — and [here is why](https://github.com/Expressive-Tea/green-tea-plugins/blob/main/CONTRIBUTING.md#where-to-send-your-changes). Delete this line once the base is right.
|
||||
|
||||
## What this changes
|
||||
|
||||
<!-- A sentence or two, on the why rather than the what. -->
|
||||
|
||||
Closes #
|
||||
|
||||
## Which runtimes you ran
|
||||
|
||||
<!-- Not all four are expected for a typo. Say which you ran rather than leaving it to be guessed. -->
|
||||
|
||||
- [ ] `npm test` (Node)
|
||||
- [ ] `npm run test:deno`
|
||||
- [ ] `npm run test:bun`
|
||||
- [ ] `npm run test:edge`
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] The base branch above is `contrib`
|
||||
- [ ] Commits are signed off (`git commit -s`)
|
||||
- [ ] `lint`, `format:check`, `typecheck`, `complexity:check` and `deno publish --dry-run` pass locally
|
||||
- [ ] New behaviour has a test
|
||||
- [ ] Core is still imported as `import type` only — never a value import
|
||||
- [ ] If `engines` changed, the package README's Runtimes table changed with it
|
||||
- [ ] A breaking change is under `### Breaking`, first in that package's CHANGELOG
|
||||
@@ -1,25 +1,27 @@
|
||||
name: Promote → GitHub
|
||||
|
||||
# Promotion. Runs on GITEA ONLY. Mirrors one branch to the public GitHub repo and nothing else:
|
||||
# Promotion. Runs on GITEA ONLY. Mirrors two branches to the public GitHub repo and nothing else:
|
||||
#
|
||||
# main → GitHub main
|
||||
# main → GitHub main what has been promoted
|
||||
# develop → GitHub contrib what outside contributors fork from and target
|
||||
#
|
||||
# Development happens on `develop` and feature branches, and those stay Gitea-private — which is
|
||||
# why this is a workflow rather than Gitea's push-mirror, since that would expose every branch.
|
||||
# Feature branches stay private, which is why this is a workflow rather than a push-mirror — that
|
||||
# would expose every branch.
|
||||
#
|
||||
# Only `main`, and no `contrib` counterpart yet: unlike core, this repository has no documented
|
||||
# flow for outside contributions, so there is nothing for a second mirrored branch to serve. Add
|
||||
# one here when that flow exists, rather than shipping a branch nobody targets.
|
||||
# `contrib` exists because CONTRIBUTING.md sends people there. A pull request against `main` would
|
||||
# put the two forges out of step, so contributors need a branch that tracks current development,
|
||||
# and this is it. Same arrangement as core.
|
||||
#
|
||||
# The push is NOT forced. A refusal means GitHub `main` holds commits that Gitea `main` does not,
|
||||
# which is a question to answer rather than an obstacle to remove.
|
||||
# Neither push is forced. For `contrib` that is the guard rather than a limitation: the push is
|
||||
# refused exactly when `contrib` holds external merges nobody has carried into `develop` yet. Carry
|
||||
# them, and the next develop push fast-forwards.
|
||||
#
|
||||
# Tags are deliberately NOT mirrored, and `--tags` is left off the push for the same reason. These
|
||||
# packages publish to JSR, where a version can never be replaced or removed — so promoting a tag
|
||||
# has to stay a decision someone takes deliberately, never a side effect of promoting a branch.
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
push-github:
|
||||
@@ -33,12 +35,17 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_PROMOTE_TOKEN }}
|
||||
run: |
|
||||
case "$GITHUB_REF_NAME" in
|
||||
main) target=main ;;
|
||||
develop) target=contrib ;;
|
||||
*) echo "::error::promote runs for main and develop only, got '$GITHUB_REF_NAME'"; exit 1 ;;
|
||||
esac
|
||||
if [ -z "$GH_TOKEN" ]; then
|
||||
echo "::error::GH_PROMOTE_TOKEN is not set on this repository. Add it in Settings → Actions → Secrets; core carries the same secret."
|
||||
echo "::error::GH_PROMOTE_TOKEN is not set on this repository. Add it in Settings → Actions → Secrets."
|
||||
exit 1
|
||||
fi
|
||||
git remote add github "https://x-access-token:${GH_TOKEN}@github.com/Expressive-Tea/green-tea-plugins.git"
|
||||
if ! git push github "HEAD:refs/heads/main"; then
|
||||
echo "::error::GitHub main has commits that Gitea main does not. Find out what they are and carry them; never force this push."
|
||||
if ! git push github "HEAD:refs/heads/${target}"; then
|
||||
echo "::error::GitHub ${target} has commits that ${GITHUB_REF_NAME} does not. For contrib that means external merges not yet carried into develop — carry them (CONTRIBUTING.md); never force this push."
|
||||
exit 1
|
||||
fi
|
||||
Reference in new issue
Block a user