@reddoorla/maintenance 0.8.0 → 0.10.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 CHANGED
@@ -15,19 +15,26 @@ pnpm reddoor-maint --help
15
15
 
16
16
  A reddoor site goes through this sequence the first time you adopt the package. Each recipe is idempotent — running it again on an already-onboarded site is a `noop`.
17
17
 
18
+ ```bash
19
+ pnpm reddoor-maint init
20
+ ```
21
+
22
+ `init` runs the whole chain in order against the current directory (or `init [site]` for an explicit path). It's a thin orchestrator — every underlying recipe still creates its own branch and stops on a dirty tree, so the operator ends up with a stack of `maint/<recipe>-<ts>` branches to PR.
23
+
18
24
  ```text
19
- convert-to-pnpm → onboard → sync-configs → svelte-codemods → audit
25
+ convert-to-pnpm → onboard → sync-configs → svelte-codemods → a11y-fixtures-page → audit
20
26
  ```
21
27
 
22
- | Step | Recipe | What it does |
23
- | ---- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
24
- | 1 | `convert-to-pnpm` | Removes `package-lock.json` / `yarn.lock`, pins `packageManager: pnpm@…`, rewrites `npm` references in scripts, runs `pnpm install` to materialise `pnpm-lock.yaml`. |
25
- | 2 | `onboard` | Installs `@reddoorla/maintenance` + the audit deps (`@lhci/cli`, `@playwright/test`, `@axe-core/playwright`) on the site. Pins the maintenance dep to a caret range against this package's own version at runtime. |
26
- | 3 | `sync-configs` | Writes the canonical config templates into the site (eslint, prettier, lighthouserc, playwright config, svelte config) and merges canonical entries into `.gitignore`. |
27
- | 4 | `svelte-codemods` | Optional cleanup pass applying the Svelte 5 gotcha codemods (`export let` → `$props()`, `on:event` → `onevent`, `$:` → `$derived`/`$effect`, etc.) for sites that surface new strictness warnings after the original upgrade. |
28
- | 5 | `audit` | Runs `deps`, `lighthouse`, `a11y`, `security`, `lint` see [Audits](#audits). |
28
+ | Step | Recipe | What it does |
29
+ | ---- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
+ | 1 | `convert-to-pnpm` | Removes `package-lock.json` / `yarn.lock`, pins `packageManager: pnpm@…`, rewrites `npm` references in scripts, runs `pnpm install` to materialise `pnpm-lock.yaml`. |
31
+ | 2 | `onboard` | Installs `@reddoorla/maintenance` + the audit deps (`@lhci/cli`, `@playwright/test`, `@axe-core/playwright`) on the site. Pins the maintenance dep to a caret range against this package's own version at runtime. |
32
+ | 3 | `sync-configs` | Writes the canonical config templates into the site (eslint, prettier, lighthouserc, playwright config, svelte config) and merges canonical entries into `.gitignore`. |
33
+ | 4 | `svelte-codemods` | Optional cleanup pass applying the Svelte 5 gotcha codemods (`export let` → `$props()`, `on:event` → `onevent`, `$:` → `$derived`/`$effect`, etc.) for sites that surface new strictness warnings after the original upgrade. |
34
+ | 5 | `a11y-fixtures-page` | Writes a starter `src/routes/dev/a11y-fixtures/+page.svelte` if the route doesn't already exist. The hardcoded URL in `lighthouse` and `playwright-a11y` configs targets this route. Operator edits are never clobbered. |
35
+ | 6 | `audit` | Runs `deps`, `lighthouse`, `a11y`, `security`, `lint` — see [Audits](#audits). |
29
36
 
30
- Each recipe refuses to run on a dirty working tree, creates a fresh `maint/<recipe>-<UTC-ms-timestamp>` branch, and emits one or more atomic commits.
37
+ Each recipe refuses to run on a dirty working tree, creates a fresh `maint/<recipe>-<UTC-ms-timestamp>` branch, and emits one or more atomic commits. Running individual steps standalone (e.g. `reddoor-maint sync-configs`) still works — `init` is for when you want the whole chain in one command.
31
38
 
32
39
  ---
33
40
 
@@ -37,6 +44,7 @@ Each recipe refuses to run on a dirty working tree, creates a fresh `maint/<reci
37
44
  reddoor-maint list-audits # audit descriptions
38
45
  reddoor-maint list-recipes # recipe descriptions
39
46
 
47
+ reddoor-maint init [site] # full onboarding chain (preferred entrypoint)
40
48
  reddoor-maint audit [site] # run audits
41
49
  reddoor-maint sync-configs [site]
42
50
  reddoor-maint bump-deps [site]
@@ -72,11 +80,13 @@ Each recipe is `(site, opts?) => Promise<RecipeResult>` and is exported from the
72
80
 
73
81
  ```ts
74
82
  import {
83
+ init,
75
84
  syncConfigs,
76
85
  bumpDeps,
77
86
  onboard,
78
87
  convertToPnpm,
79
88
  svelteCodemods,
89
+ a11yFixturesPage,
80
90
  upgradeSvelte4to5,
81
91
  } from "@reddoorla/maintenance";
82
92
  ```
@@ -113,6 +123,14 @@ Standalone codemod pass for sites already on Svelte 5. Applies the same gotcha c
113
123
 
114
124
  The full 7-step Svelte 4 → 5 migration: bump framework versions, migrate `svelte.config.js`, run the official `svelte-migrate` codemod, run `@tailwindcss/upgrade`, apply gotcha codemods over `src/**/*.svelte`, verify with `pnpm install` + `pnpm run check`, and write a `MIGRATION_SVELTE_5.md` summary. Each step is its own commit; the file leaves a record of what ran and what may need manual review.
115
125
 
126
+ ### `a11y-fixtures-page`
127
+
128
+ Writes a starter `src/routes/dev/a11y-fixtures/+page.svelte` if the route doesn't already exist. The `lighthouse` and `playwright-a11y` configs both target this URL — newly-onboarded sites need the route to exist for either audit to pass. The template is intentionally generic (semantic landmarks + headings + a relative link); operator edits to an existing page are never clobbered.
129
+
130
+ ### `init`
131
+
132
+ One-shot guided onboarding: runs `convert-to-pnpm → onboard → sync-configs → svelte-codemods → a11y-fixtures-page → audit` in sequence against a site. Each underlying recipe still creates its own branch — `init` is a thin orchestrator, not a branch-collapser. Stops the chain on the first `failed` recipe or uncaught error; `noop` results continue the chain. Exit code is 1 if any step failed _or_ the final audit pass reports a `fail`.
133
+
116
134
  ---
117
135
 
118
136
  ## Audits
@@ -122,7 +140,7 @@ Each audit is `(ctx) => Promise<AuditResult>` and is exported from the package e
122
140
  | Name | What it checks |
123
141
  | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
124
142
  | `deps` | Diffs site's `package.json` against `src/configs/baseline-versions.ts`. Surfaces deps that drift from the canonical version map. |
125
- | `lighthouse` | Runs `@lhci/cli autorun` using the canonical `lighthouserc.json`. |
143
+ | `lighthouse` | Runs `@lhci/cli autorun` using the canonical `lighthouserc.json`. Hits `/dev/a11y-fixtures` by default; sites without that route can set `package.json#reddoor.lighthouseUrl` to override. |
126
144
  | `a11y` | Spawns Playwright + `@axe-core/playwright` against a canonical set of a11y routes. |
127
145
  | `security` | `pnpm audit --json --prod` with automatic fall-through to `npm audit` when pnpm can't run (missing lockfile, error envelope, etc.). Normalises advisory shapes from both tools into a single `AdvisoryEntry[]`. |
128
146
  | `lint` | ESLint + Prettier using the canonical configs (re-exported via `@reddoorla/maintenance/configs/eslint` and `@reddoorla/maintenance/configs/prettier`). |