@bensandee/tooling 0.60.1 → 0.61.0
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 +30 -7
- package/dist/bin.mjs +593 -354
- package/dist/docker-check/index.d.mts +1 -0
- package/package.json +7 -7
- package/tooling.schema.json +4 -0
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ The tool auto-detects project structure, CI platform, project type, and Docker p
|
|
|
32
32
|
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
33
|
| `tooling repo:sync [dir]` | Detect, generate, and sync project tooling (idempotent). First run prompts for release strategy, CI platform (if not detected), and formatter (if Prettier found). Subsequent runs are non-interactive. |
|
|
34
34
|
| `tooling repo:sync --check [dir]` | Dry-run drift detection. Exits 1 if files would change. CI-friendly. |
|
|
35
|
-
| `tooling checks:run` | Run project checks (build, docker:build, typecheck, lint, test, format, knip, tooling:check, docker:check). Flags: `--skip`, `--add`, `--fail-fast`, `--verbose`, `--with-coverage`.
|
|
35
|
+
| `tooling checks:run` | Run project checks (build, docker:build, typecheck, lint, test, format, knip, tooling:check, docker:check). Flags: `--skip`, `--add`, `--fail-fast`, `--verbose`, `--with-coverage`, `--no-coverage`. |
|
|
36
36
|
|
|
37
37
|
**Flags:** `--yes` (accept all defaults), `--no-ci`, `--no-prompt`, `--eslint-plugin`
|
|
38
38
|
|
|
@@ -56,15 +56,24 @@ The `--add` flag appends extra checks (must be defined in `package.json`):
|
|
|
56
56
|
tooling checks:run --add e2e
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
**Coverage is branch-aware by default.** With neither coverage flag, the `test` step runs via `pnpm run test:coverage` (producing `coverage/coverage-summary.json` for the `coverage:*` commands) **only on the repo's default branch** — PR and feature-branch runs skip the v8 instrumentation cost automatically. The current branch is read from `GITHUB_REF` / `GITHUB_REF_NAME` (set by GitHub _and_ Forgejo Actions), falling back to `git rev-parse --abbrev-ref HEAD` for local runs; tag and pull-request refs count as non-default. The default branch is `.tooling.json#defaultBranch` if set, otherwise detected via `git symbolic-ref refs/remotes/origin/HEAD`, otherwise `main`.
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Explicit flags always win, regardless of branch:
|
|
62
|
+
|
|
63
|
+
- `--with-coverage` — force the `test` step to run with coverage.
|
|
64
|
+
- `--no-coverage` — force it to run without coverage.
|
|
65
|
+
|
|
66
|
+
If both are passed, `--no-coverage` wins.
|
|
67
|
+
|
|
68
|
+
Because the decision is branch-aware, the generated CI workflow runs plain `pnpm ci:check` (no coverage flag) and lets `checks:run` decide — except when coverage is disabled in `.tooling.json`, where it passes `--no-coverage` to force it off everywhere.
|
|
69
|
+
|
|
70
|
+
**Extend the `check` script with `--add`, never a shell chain.** `repo:sync` generates `check` as a single rooted command (`bst checks:run`) and `ci:check` as `pnpm check --skip 'docker:*'`. When CI runs `pnpm ci:check`, pnpm appends the resolved `--skip 'docker:*'` (and any flags you add, e.g. `--no-coverage`) to the _end_ of the resolved script — so they reach `bst checks:run` only if that is the last command. Adding extra checks via an `&&` chain silently drops `--skip 'docker:*'` and any forwarded flag:
|
|
62
71
|
|
|
63
72
|
```jsonc
|
|
64
73
|
// ✓ forwarded flags reach bst checks:run
|
|
65
74
|
"check": "bst checks:run --add check:env-drift,check:custom"
|
|
66
75
|
|
|
67
|
-
// ✗ --
|
|
76
|
+
// ✗ --skip / --no-coverage land on check:custom instead
|
|
68
77
|
"check": "bst checks:run && pnpm check:env-drift && pnpm check:custom"
|
|
69
78
|
```
|
|
70
79
|
|
|
@@ -399,10 +408,24 @@ Each package is tagged independently using its own version, so packages in a mon
|
|
|
399
408
|
| --------------------------- | -------- | --------------------------------------------------------------------- |
|
|
400
409
|
| `DOCKER_REGISTRY_HOST` | variable | Registry hostname (e.g. `code.orangebikelabs.com`) |
|
|
401
410
|
| `DOCKER_REGISTRY_NAMESPACE` | variable | Full namespace for tagging (e.g. `code.orangebikelabs.com/bensandee`) |
|
|
402
|
-
| `
|
|
403
|
-
| `
|
|
411
|
+
| `<REGISTRY>_USERNAME` | secret | Registry username — name depends on registry host (see below) |
|
|
412
|
+
| `<REGISTRY>_PASSWORD` | secret | Registry password — name depends on registry host (see below) |
|
|
413
|
+
|
|
414
|
+
**Registry-specific secret names.** The workflow generator picks the secret reference at gen time from the registry host. The env-var name inside the step is always `DOCKER_USERNAME` / `DOCKER_PASSWORD` (so the CLI reads them under stable names), but the right-hand side of `${{ secrets.X }}` is registry-specific:
|
|
415
|
+
|
|
416
|
+
| Host | Username secret | Password secret |
|
|
417
|
+
| ------------------------- | --------------------------------- | --------------------------------- |
|
|
418
|
+
| `code.orangebikelabs.com` | `FORGEJO_REGISTRY_USERNAME` | `FORGEJO_REGISTRY_PASSWORD` |
|
|
419
|
+
| `docker.io` | `DOCKERHUB_USERNAME` | `DOCKERHUB_PASSWORD` |
|
|
420
|
+
| `quay.io` | `QUAY_USERNAME` | `QUAY_PASSWORD` |
|
|
421
|
+
| `ghcr.io` | `GHCR_USERNAME` | `GHCR_PASSWORD` |
|
|
422
|
+
| anything else | `<UPPER_SNAKE_HOSTNAME>_USERNAME` | `<UPPER_SNAKE_HOSTNAME>_PASSWORD` |
|
|
423
|
+
|
|
424
|
+
When `package.json#repository` and `.tooling.json#registryHost` are both absent the generator falls back to neutral `REGISTRY_USERNAME` / `REGISTRY_PASSWORD`.
|
|
425
|
+
|
|
426
|
+
This rename exists because Forgejo's [act fork auto-injects](https://code.forgejo.org/forgejo/runner/src/branch/main/act/runner/run_context.go#L1437) `secrets.DOCKER_USERNAME` / `secrets.DOCKER_PASSWORD` into every `container:` image pull regardless of the target registry, so reusing those generic names across multiple registries causes confusing "denied" / "incorrect username or password" errors. The registry-specific names defeat the auto-injection trigger.
|
|
404
427
|
|
|
405
|
-
**Forgejo setup:** On Forgejo,
|
|
428
|
+
**Forgejo setup:** On Forgejo, the username secret is your Forgejo account username, and the password secret can reuse the same token as `RELEASE_TOKEN`. The token needs write permissions on the org, package, and repository scopes. These permissions should be set for the **user** if the package is under a user namespace (e.g. `bensandee`), or the **organization** if it's under an org namespace (e.g. `orangebikelabs`). After migrating, the old `DOCKER_USERNAME` / `DOCKER_PASSWORD` user/org-level secrets can be deleted once every consumer has been regenerated.
|
|
406
429
|
|
|
407
430
|
## Config file
|
|
408
431
|
|