@taraxvoid/voidflow 0.9.0 → 0.11.0-next

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,6 +43,33 @@ jobs:
43
43
  runner: my-hosted-runner
44
44
  ```
45
45
 
46
+ ### Single-environment sites
47
+
48
+ Sites with one production environment and no `next`/`live` branches (`main`
49
+ deploys to prod, pull requests get previews) pass `single-environment: true`,
50
+ the same flag `resolve-env` and `branch-env-map` take:
51
+
52
+ ```yaml
53
+ on:
54
+ push:
55
+ branches: [main]
56
+ pull_request:
57
+ branches: [main]
58
+ types: [opened, synchronize, reopened, ready_for_review]
59
+ workflow_dispatch:
60
+
61
+ jobs:
62
+ validate:
63
+ uses: taraxvoid/voidflow/.github/workflows/site-ci.yml@<sha> # <version>
64
+ with:
65
+ single-environment: true
66
+ ```
67
+
68
+ `main` then gets the production test tier (`test:e2e:all`, `test:e2e:a11y`,
69
+ `test:e2e:lighthouse`) instead of only `test:e2e:full`. Include the `push`
70
+ trigger so a direct push to `main` is validated too; the e2e steps resolve the
71
+ branch from the pushed ref.
72
+
46
73
  ### pnpm sites, build env, extra e2e paths
47
74
 
48
75
  ```yaml
@@ -92,6 +119,19 @@ Unlighthouse version). Start from
92
119
  [`scripts/unlighthouse/unlighthouse.config.example.ts`](scripts/unlighthouse/unlighthouse.config.example.ts)
93
120
  and add `.unlighthouse/` to the site's `.gitignore`.
94
121
 
122
+ ### License policy
123
+
124
+ `site-ci.yml` runs `bun run check:licenses` when the lockfile or `scripts/`
125
+ change. Sites implement that script with the shared check, which runs
126
+ `license-checker` in the site's repo root and fails on GPL, AGPL, SSPL and
127
+ similar copyleft licenses (LGPL is allowed).
128
+
129
+ In the site's `package.json` (pin the tag):
130
+
131
+ ```json
132
+ "check:licenses": "bunx --package @taraxvoid/voidflow@<version> check-licenses"
133
+ ```
134
+
95
135
  ### Playwright preview config
96
136
 
97
137
  Shared `playwright.config` for Astro sites that run e2e against
@@ -120,6 +160,87 @@ Options: `ciPort` (required in CI), `runner` (default `bun`, e.g. `pnpm`),
120
160
  `timeout` (default 30000), `projects` (default Pixel 7 and Desktop Chrome),
121
161
  `testDir` (default `./test/e2e`). Requires `@playwright/test` in the site.
122
162
 
163
+ ## Dependency updates (Renovate)
164
+
165
+ [`default.json`](default.json) is the shared Renovate preset. Sites add a
166
+ `renovate.json`:
167
+
168
+ ```json
169
+ {
170
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
171
+ "extends": ["github>taraxvoid/voidflow"]
172
+ }
173
+ ```
174
+
175
+ It builds on `config:best-practices` (which pins GitHub Action digests), holds
176
+ updates for 3 days like `minimumReleaseAge` in `bunfig.toml` (except our own
177
+ package and security alerts), uses `chore(deps):` Conventional Commits, groups
178
+ actions, astro, biome and playwright, and runs on Monday mornings. Custom
179
+ managers keep three things current that Dependabot cannot see: the
180
+ `@taraxvoid/voidflow@x.y.z` pin inside `package.json` scripts, a lefthook
181
+ remote's `ref` tag, and tool versions in a `justfile` (annotate the line above
182
+ with `# renovate: datasource=... depName=...`). Requires the Renovate GitHub App
183
+ on the repo.
184
+
185
+ ||||||| 4041a59
186
+ ## Git hooks (lefthook)
187
+
188
+ [`lefthook/site.yml`](lefthook/site.yml) is the shared hook set for the site
189
+ stack, consumed as a lefthook remote. It calls the site's own `package.json`
190
+ scripts (`bun run --if-present`, so a missing script is skipped):
191
+
192
+ - `pre-commit`: dependency guard, `format` (formatted files are re-staged),
193
+ `lint:actions`, `check`, `test:unit`, and `check:licenses` / `audit` when the
194
+ lockfile changed.
195
+ - `commit-msg`: advisory Conventional Commits hint (never blocks).
196
+ - `pre-push`: bail if the remote branch is ahead, then `test:push`; skipped when
197
+ there is nothing new to push.
198
+
199
+ ```yaml
200
+ # lefthook.yml in the site
201
+ remotes:
202
+ - git_url: https://github.com/taraxvoid/voidflow
203
+ ref: v0.10.0 # a tag or branch; lefthook passes it to `git clone --branch`
204
+ configs:
205
+ - lefthook/site.yml
206
+
207
+ # Site-specific differences override the remote by name, e.g. skip tests that
208
+ # need a built dist/ before commit:
209
+ pre-commit:
210
+ commands:
211
+ unit:
212
+ run: bun run test:unit -- --exclude 'test/build.test.ts'
213
+ ```
214
+
215
+ Install the binary through mise (`lefthook = "<version>"` in `mise.toml`) and
216
+ set `"prepare": "lefthook install"` so `bun install` wires the hooks. `ref`
217
+ cannot be a commit SHA; pin a release tag.
218
+
219
+ ## Branch rulesets as code
220
+
221
+ Branch protection for the fleet lives in [`rulesets/index.ts`](rulesets/index.ts):
222
+ one canonical `main` / `next` / `live` definition (plus `prerelease` and `maintenance`
223
+ tiers for repos with release channels) and a small per-repo table
224
+ (Netlify or not, check names, CODEOWNERS, extra bypass actors). Hand-edited
225
+ rulesets drift, and drift is how a `next` ruleset ends up requiring a check
226
+ name that no workflow reports any more.
227
+
228
+ ```sh
229
+ just rulesets-plan # read-only: diff every repo against the config
230
+ just rulesets-plan --repo soundry
231
+ just rulesets-plan --check # exit 1 on drift, for CI
232
+ just rulesets-apply # create/update rulesets to match
233
+ just rulesets-apply --prune # also delete rulesets a repo lists under `retire`
234
+ ```
235
+
236
+ Single-environment sites (a stable `main` that deploys to prod) manage only the
237
+ `main` tier; their old `next`/`live` rulesets are listed under `retire`. voidflow itself
238
+ manages `main`, `prerelease` (`next`) and `maintenance` (`release/*`) and sets
239
+ `linearHistory: false` so `next` can be promoted into `main` with a merge commit.
240
+ Uses the `gh` CLI for auth (needs admin on the repos). Rulesets that are not in
241
+ the config are reported and left alone; only `retire` entries are ever deleted,
242
+ and only with `--prune`. It is repo tooling, not part of the published package.
243
+
123
244
  ## Deployments
124
245
 
125
246
  Example deployment job added to your workflow above. `resolve-env` maps the
@@ -155,21 +276,38 @@ Sites with a single production environment and per-PR previews (no `next` or
155
276
 
156
277
  ### Versioning
157
278
 
158
- This project uses semver, released with [release-please](https://github.com/googleapis/release-please)
159
- ([`release-please.yml`](.github/workflows/release-please.yml)). It keeps a standing
160
- `chore(main): release X.Y.Z` PR open against `main`, updated as commits land. Merging it bumps
161
- `package.json` and [`CHANGELOG.md`](CHANGELOG.md), tags `vX.Y.Z`, creates the GitHub release,
162
- and publishes to npm. The PR is opened with the org's release-bot GitHub App token
163
- (`RELEASE_BOT_CLIENT_ID` / `RELEASE_BOT_APP_PRIVATE_KEY`) so CI runs on it.
279
+ Semver, released with [release-please](https://github.com/googleapis/release-please)
280
+ ([`release-please.yml`](.github/workflows/release-please.yml)) on three branch-based channels
281
+ (full flow in [`RELEASING.md`](RELEASING.md)):
282
+
283
+ | Channel | Branch | Example | npm dist-tag |
284
+ |---|---|---|---|
285
+ | stable | `main` | `0.10.0` | `latest` |
286
+ | prerelease | `next` | `0.10.0-next`, `0.10.0-next.1` | `next` |
287
+ | maintenance | `release/N.x` | `0.9.4` | `release-N.x` |
288
+
289
+ release-please keeps a standing release PR open on each channel's branch, updated as commits land.
290
+ Merging it bumps `package.json` (and [`CHANGELOG.md`](CHANGELOG.md) on stable), tags `vX.Y.Z` (`vX.Y.Z-next[.N]` on `next`),
291
+ creates the GitHub release and publishes to npm and JSR under the channel's dist-tag. The PR is
292
+ opened with the org's release-bot GitHub App token (`RELEASE_BOT_CLIENT_ID` /
293
+ `RELEASE_BOT_APP_PRIVATE_KEY`) so CI runs on it.
294
+
295
+ Feature PRs target `next`; promotion to `main` is a merge-commit PR (`just promote`).
164
296
 
165
297
  Commit messages should follow [Conventional Commits](https://www.conventionalcommits.org),
166
298
  enforced loosely, as an advisory `commit-msg` hint (see
167
299
  [`scripts/check-commit-msg.sh`](scripts/check-commit-msg.sh)), not a blocking check. They
168
300
  drive the version bump and generated changelog.
169
301
 
170
- Treat `@main` as unstable. Consumers should pin to the commit SHA of a release tag and
171
- keep the version in a trailing comment, e.g. `@15caea2... # v0.8.1`, so a Renovate or
172
- Dependabot config can bump it. There is no floating major-version tag (`@v1`) to track yet.
302
+ Ways to consume a release:
303
+
304
+ - **Floating major tag**: `@v0` follows the newest stable 0.x release. Easiest to track, and
305
+ mutable like any floating tag.
306
+ - **SHA pin with a version comment**, e.g. `@15caea2... # v0.8.1`: what I use. Same hardening
307
+ as any third-party action, and Renovate or Dependabot can bump it.
308
+ - **Try unreleased changes**: pin the commit SHA of a `vX.Y.Z-next` / `vX.Y.Z-next.N` prerelease tag.
309
+
310
+ Treat `@main` and `@next` as unstable.
173
311
 
174
312
  ## Self-validation
175
313
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taraxvoid/voidflow",
3
- "version": "0.9.0",
3
+ "version": "0.11.0-next",
4
4
  "description": "Shared workflows, actions and tooling for @taraxvoid sites",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -25,7 +25,8 @@
25
25
  "provenance": true
26
26
  },
27
27
  "bin": {
28
- "unlighthouse-runner": "scripts/unlighthouse/run.ts"
28
+ "unlighthouse-runner": "scripts/unlighthouse/run.ts",
29
+ "check-licenses": "scripts/check-licenses.ts"
29
30
  },
30
31
  "exports": {
31
32
  "./playwright": {
@@ -36,7 +37,8 @@
36
37
  },
37
38
  "files": [
38
39
  "playwright",
39
- "scripts/unlighthouse"
40
+ "scripts/unlighthouse",
41
+ "scripts/check-licenses.ts"
40
42
  ],
41
43
  "engines": {
42
44
  "bun": ">=1.4.0"
@@ -48,6 +50,7 @@
48
50
  "@playwright/test": ">=1.40"
49
51
  },
50
52
  "devDependencies": {
51
- "@playwright/test": "^1.40.0"
53
+ "@playwright/test": "^1.40.0",
54
+ "@socketsecurity/bun-security-scanner": "^1.1.3"
52
55
  }
53
56
  }
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * Shared license policy check for the Astro/bun site stack: fail on GPL kudzu.
4
+ *
5
+ * Runs `license-checker` against the current working directory (the caller's
6
+ * repo root) and exits non-zero if any installed package carries a blocked
7
+ * license.
8
+ *
9
+ * Usage: bun check-licenses.ts
10
+ */
11
+
12
+ import { spawnSync } from 'node:child_process'
13
+
14
+ export const FAIL_ON = [
15
+ 'GPL-1.0',
16
+ 'GPL-1.0-only',
17
+ 'GPL-1.0-or-later',
18
+ 'GPL-2.0',
19
+ 'GPL-2.0-only',
20
+ 'GPL-2.0-or-later',
21
+ 'GPL-3.0',
22
+ 'GPL-3.0-only',
23
+ 'GPL-3.0-or-later',
24
+ 'AGPL-1.0',
25
+ 'AGPL-1.0-only',
26
+ 'AGPL-1.0-or-later',
27
+ 'AGPL-2.0',
28
+ 'AGPL-2.0-only',
29
+ 'AGPL-2.0-or-later',
30
+ 'AGPL-3.0',
31
+ 'AGPL-3.0-only',
32
+ 'AGPL-3.0-or-later',
33
+ 'SSPL-1.0',
34
+ 'OSL-2.1',
35
+ 'OSL-3.0',
36
+ 'CPAL-1.0',
37
+ 'EUPL-1.1',
38
+ 'EUPL-1.2',
39
+ 'CECILL-2.1',
40
+ // LGPL is deliberately NOT in this list - it only imposes obligations on
41
+ // modifying/statically linking the library, not on depending on it as-is.
42
+ ].join(';')
43
+
44
+ const result = spawnSync(
45
+ 'bunx',
46
+ ['license-checker', '--summary', '--failOn', FAIL_ON],
47
+ { cwd: process.cwd(), stdio: 'inherit' },
48
+ )
49
+
50
+ if (result.error) {
51
+ console.error(
52
+ `\ncheck:licenses failed - could not run license-checker: ${result.error.message}`,
53
+ )
54
+ process.exit(1)
55
+ }
56
+
57
+ if (result.status !== 0) {
58
+ console.error(
59
+ '\ncheck:licenses failed - at least one disallowed license was found.',
60
+ )
61
+ process.exit(1)
62
+ }
63
+
64
+ console.log(
65
+ '\ncheck:licenses passed - no blocked licenses found in any workspace.',
66
+ )