voidflow 0.0.0 → 0.8.3
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 +3 -150
- package/package.json +23 -1
- package/playwright/index.mjs +1 -0
package/README.md
CHANGED
|
@@ -1,156 +1,9 @@
|
|
|
1
1
|
# voidflow
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
Point `uses` in your configuration to a workflow, e.g. in your `.github/workflows/ci.yml`
|
|
8
|
-
|
|
9
|
-
```yaml
|
|
10
|
-
name: CI
|
|
11
|
-
on:
|
|
12
|
-
pull_request:
|
|
13
|
-
branches: [main, next, live]
|
|
14
|
-
types: [opened, synchronize, reopened, ready_for_review]
|
|
15
|
-
workflow_dispatch:
|
|
16
|
-
|
|
17
|
-
jobs:
|
|
18
|
-
validate:
|
|
19
|
-
uses: taraxvoid/voidflow/.github/workflows/site-ci.yml@main
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Non-GitHub / self-hosted runners
|
|
23
|
-
|
|
24
|
-
Pass `runner` (defaults to GitHub runner `ubuntu-latest`)
|
|
25
|
-
|
|
26
|
-
```yaml
|
|
27
|
-
jobs:
|
|
28
|
-
validate:
|
|
29
|
-
uses: taraxvoid/voidflow/.github/workflows/site-ci.yml@main
|
|
30
|
-
with:
|
|
31
|
-
runner: my-hosted-runner
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Workflow Types
|
|
35
|
-
|
|
36
|
-
### Validation / Checks
|
|
37
|
-
|
|
38
|
-
Runs lint, typecheck, check for GPL licenses, e2e with Playwright
|
|
39
|
-
|
|
40
|
-
### Unlighthouse (performance / SEO budgets)
|
|
41
|
-
|
|
42
|
-
`site-ci.yml` runs `bun run test:e2e:lighthouse` on PRs into `live`. Sites
|
|
43
|
-
implement that script with the shared runner here, which serves the built
|
|
44
|
-
static directory on a free port and runs
|
|
45
|
-
[Unlighthouse](https://unlighthouse.dev/) against it, reusing Playwright's
|
|
46
|
-
Chromium. It exits non-zero if a category budget in the site's config fails.
|
|
47
|
-
|
|
48
|
-
In the site's `package.json` (pin the tag):
|
|
49
|
-
|
|
50
|
-
```json
|
|
51
|
-
"test:e2e:lighthouse": "bun run build && bunx --package @taraxvoid/voidflow@0.6.0 unlighthouse-runner --dir dist"
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Options: `--dir` (default `dist`, use `dist/client` for Cloudflare adapter
|
|
55
|
-
builds), `--config` (default `unlighthouse.config.ts`), `--version` (pinned
|
|
56
|
-
Unlighthouse version). Start from
|
|
57
|
-
[`scripts/unlighthouse/unlighthouse.config.example.ts`](scripts/unlighthouse/unlighthouse.config.example.ts)
|
|
58
|
-
and add `.unlighthouse/` to the site's `.gitignore`.
|
|
59
|
-
|
|
60
|
-
### Playwright preview config
|
|
61
|
-
|
|
62
|
-
Shared `playwright.config` for Astro sites that run e2e against
|
|
63
|
-
`astro preview`. It picks a free port outside CI, sets
|
|
64
|
-
`ASTRO_PREVIEW_BACKGROUND=false` (Astro backgrounds `preview` in agent
|
|
65
|
-
environments, which makes Playwright think the server exited), and drops the
|
|
66
|
-
`webServer` when `PLAYWRIGHT_BASE_URL` is set.
|
|
67
|
-
|
|
68
|
-
```sh
|
|
69
|
-
bun add -d @taraxvoid/voidflow # or: pnpm add -D @taraxvoid/voidflow
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
```js
|
|
73
|
-
// playwright.config.js
|
|
74
|
-
import { definePreviewConfig } from '@taraxvoid/voidflow/playwright'
|
|
75
|
-
|
|
76
|
-
export default definePreviewConfig({ ciPort: 4141 })
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Options: `ciPort` (required in CI), `runner` (default `bun`, e.g. `pnpm`),
|
|
80
|
-
`timeout` (default 30000), `projects` (default Pixel 7 and Desktop Chrome),
|
|
81
|
-
`testDir` (default `./test/e2e`). Requires `@playwright/test` in the site.
|
|
82
|
-
|
|
83
|
-
## Deployments
|
|
84
|
-
|
|
85
|
-
Example deployment job added to your workflow above. `resolve-env` maps the
|
|
86
|
-
branch to dev/staging/prod once, up front, so its output can be used both to
|
|
87
|
-
drive the deploy and to label the job (`Deploy [dev]`, `Deploy [staging]`,
|
|
88
|
-
`Deploy [prod]`) — a job's `name:` can reference `needs.<job>.outputs.*` but
|
|
89
|
-
not a step output from within itself, hence the split:
|
|
90
|
-
|
|
91
|
-
```yaml
|
|
92
|
-
jobs:
|
|
93
|
-
resolve-env:
|
|
94
|
-
needs: validate
|
|
95
|
-
if: github.event_name == 'push'
|
|
96
|
-
uses: taraxvoid/voidflow/.github/workflows/resolve-env.yml@main
|
|
97
|
-
|
|
98
|
-
deploy:
|
|
99
|
-
name: Deploy [${{ needs.resolve-env.outputs.env }}]
|
|
100
|
-
needs: resolve-env
|
|
101
|
-
if: github.event_name == 'push'
|
|
102
|
-
environment: ${{ needs.resolve-env.outputs.env }}
|
|
103
|
-
steps:
|
|
104
|
-
- uses: actions/checkout@v7.0.1
|
|
105
|
-
- uses: taraxvoid/voidflow/actions/cloudflare-deploy@main
|
|
106
|
-
with:
|
|
107
|
-
env: ${{ needs.resolve-env.outputs.env }}
|
|
108
|
-
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Versioning
|
|
112
|
-
|
|
113
|
-
This project uses semver, released manually in two steps (`main` requires PRs, so nothing
|
|
114
|
-
can push straight to it — not even Actions):
|
|
115
|
-
|
|
116
|
-
1. Dispatch [`release.yml`](.github/workflows/release.yml) (`workflow_dispatch`, with a
|
|
117
|
-
`version` input) — it regenerates [`CHANGELOG.md`](CHANGELOG.md) via git-cliff, validates,
|
|
118
|
-
and opens a `chore(release): prepare for vX.Y.Z` PR.
|
|
119
|
-
2. Merging that PR triggers [`tag-release.yml`](.github/workflows/tag-release.yml), which
|
|
120
|
-
tags the merge commit and publishes the GitHub release. (Tag pushes aren't covered by
|
|
121
|
-
`main`'s branch protection, only branch pushes are.)
|
|
122
|
-
|
|
123
|
-
Commit messages should follow [Conventional Commits](https://www.conventionalcommits.org) —
|
|
124
|
-
enforced loosely, as an advisory `commit-msg` hint (see
|
|
125
|
-
[`scripts/check-commit-msg.sh`](scripts/check-commit-msg.sh)), not a blocking check. They
|
|
126
|
-
drive the generated changelog.
|
|
127
|
-
|
|
128
|
-
Treat `@main` as unstable. Consumers should pin to an exact release tag, e.g. `@v0.3.0` —
|
|
129
|
-
there is no floating major-version tag (`@v1`) to track yet.
|
|
130
|
-
|
|
131
|
-
## Self-validation
|
|
132
|
-
|
|
133
|
-
This repo validates its own workflows and composite actions (`.github/workflows/ci.yml`):
|
|
134
|
-
|
|
135
|
-
- **actionlint** — workflow schema/logic; also shellchecks `run:` steps in `.github/workflows/*.yml` automatically (`shellcheck` ships on `ubuntu-latest`)
|
|
136
|
-
- **check-jsonschema** — schema-checks `actions/**/action.yml` and the workflow files against [SchemaStore](https://www.schemastore.org/)'s `github-action.json` / `github-workflow.json`
|
|
137
|
-
- **shellcheck** (`scripts/shellcheck-actions.sh`) — checks `run:` steps inside `actions/**/action.yml`, which actionlint doesn't reach
|
|
138
|
-
- **zizmor** — security audit (unpinned refs, script injection via `${{ }}` in `run:`, excess permissions, etc.)
|
|
139
|
-
|
|
140
|
-
### Local dev setup
|
|
3
|
+
This is the unscoped mirror of [`@taraxvoid/voidflow`](https://www.npmjs.com/package/@taraxvoid/voidflow), published from the same release with identical code and version. The scoped package is canonical; its README has the documentation.
|
|
141
4
|
|
|
142
5
|
```sh
|
|
143
|
-
|
|
144
|
-
lefthook install
|
|
6
|
+
bun add -d @taraxvoid/voidflow
|
|
145
7
|
```
|
|
146
8
|
|
|
147
|
-
|
|
148
|
-
- `just lint-workflows` / `lint-actions` / `lint-shell` / `security` — run one check at a time
|
|
149
|
-
- `just dry-run` — full local run of `ci.yml` via [`act`](https://github.com/nektos/act) (needs Docker running); pass extra args, e.g. `just dry-run -j validation`
|
|
150
|
-
- lefthook runs the fast checks (`lint-workflows`, `lint-actions`, `lint-shell`) on `pre-commit`, and `zizmor` on `pre-push`
|
|
151
|
-
|
|
152
|
-
**Colima users:** `.actrc` already disables the docker-socket mount (`--container-daemon-socket -`) — `act` binds `/var/run/docker.sock` by default, which doesn't exist under Colima and fails with `operation not supported`. None of these workflow steps need docker-in-docker, so this is safe.
|
|
153
|
-
|
|
154
|
-
**Run `just dry-run` from a normal checkout, not a linked git worktree.** `act` copies the working tree via `docker cp` rather than a real clone, so a worktree's `.git` pointer back to the parent repo doesn't resolve inside the container — `git ls-files`-based steps (schema validation, `scripts/shellcheck-actions.sh`) silently see zero files instead of erroring. Verified clean end-to-end (`🏁 Job succeeded`) from a plain clone.
|
|
155
|
-
|
|
156
|
-
YMMV, caveat emptor, your satisfaction **not** guaranteed
|
|
9
|
+
Source, issues and docs: <https://github.com/taraxvoid/voidflow>
|
package/package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voidflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Shared workflows, actions and tooling for @taraxvoid sites",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"github-actions",
|
|
8
|
+
"ci",
|
|
9
|
+
"reusable-workflows",
|
|
10
|
+
"playwright",
|
|
11
|
+
"unlighthouse",
|
|
12
|
+
"astro",
|
|
13
|
+
"cloudflare"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/taraxvoid/voidflow#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/taraxvoid/voidflow/issues"
|
|
18
|
+
},
|
|
6
19
|
"repository": {
|
|
7
20
|
"type": "git",
|
|
8
21
|
"url": "git+https://github.com/taraxvoid/voidflow.git"
|
|
@@ -25,7 +38,16 @@
|
|
|
25
38
|
"playwright",
|
|
26
39
|
"scripts/unlighthouse"
|
|
27
40
|
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"bun": ">=1.4.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"test": "bun test"
|
|
46
|
+
},
|
|
28
47
|
"peerDependencies": {
|
|
29
48
|
"@playwright/test": ">=1.40"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@playwright/test": "^1.40.0"
|
|
30
52
|
}
|
|
31
53
|
}
|
package/playwright/index.mjs
CHANGED