@marktiderman/genesis-cli 1.9.0 → 1.11.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 +35 -5
- package/dist/cli.js +764 -257
- package/dist/cli.js.map +1 -1
- package/dist/doctor.d.ts +31 -4
- package/dist/doctor.js +644 -144
- package/dist/doctor.js.map +1 -1
- package/dist/genesis-catalog.json +73 -15
- package/dist/index.js +647 -147
- package/dist/index.js.map +1 -1
- package/dist/vite.js +648 -148
- package/dist/vite.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -358,8 +358,8 @@ Exit codes: `0` pass, `1` findings, `2` the doctor couldn't run (bad config, Gen
|
|
|
358
358
|
| `raw-color` | error | Hex and `rgb()/hsl()` literals in code and CSS, via the same lexer as the repo's `check:token-usage` (comments, issue refs and `hsl(var(--x))` are fine). A brand file that defines token values needs an `allow` entry. |
|
|
359
359
|
| `undefined-token` | error | `var(--x)` where the theme doesn't define `--x`. Tokens declared in the app's CSS (or only `tokenFiles`) and inline style custom properties count as defined; `--tw-*` and `--radix-*` are ignored. |
|
|
360
360
|
| `shadowed-export` | error | An exported value named like a Genesis export (`export function Button`). Reuse or extend it. |
|
|
361
|
-
| `duplicate-genesis-package` | warn | More than one copy of a `@marktiderman/genesis-*` package that the app can load, with each copy's path, version and the ranges that asked for it. Found by resolving dependencies the way Node does, from each package's real folder, so npm/yarn/bun hoisted and nested trees, pnpm's `.pnpm` store (in the app, or at the workspace root above a sub-app) and bun's isolated `.bun` store all count; a store entry nothing resolves to is ignored. Two copies are two module instances: a `DataProvider` from one is invisible to hooks from the other. |
|
|
362
|
-
| `peer-range-mismatch` | warn | An installed Genesis package's `peerDependencies` range on another Genesis package that the copy it resolves (looked up from its own folder, as Node does) doesn't satisfy: the package, the range and the installed version. Missing peers and non-semver ranges (`workspace:*`) are skipped. Ranges are read with npm's grammar (`^ ~ x - ||`, prereleases only when the range names one). |
|
|
361
|
+
| `duplicate-genesis-package` | warn | More than one copy of a `@marktiderman/genesis-*` package that the app can load, with each copy's path, version and the ranges that asked for it. Found by resolving dependencies the way Node does, from each package's real folder, so npm/yarn/bun hoisted and nested trees, pnpm's `.pnpm` store (in the app, or at the workspace root above a sub-app) and bun's isolated `.bun` store all count; a store entry nothing resolves to is ignored. Two copies are two module instances: a `DataProvider` from one is invisible to hooks from the other. A copy reached only through dev tooling (the app's `devDependencies`, or anything under `@marktiderman/genesis-cli`, wherever it's listed) is `[dev only]`: every path to it from the app runs through declared tooling (test runners, `@types/*`, linters and formatters, compilers and bundlers, Storybook, release tools, or the CLI). Other devDependencies count as runtime: a bundler ships what the app imports from them. When exactly one copy is reached from a declared runtime dependency and every other copy is dev-only, the finding is `info` (it can't split the app's contexts). Anything else warns, a copy reached through an undeclared hoisted package included. An app with no runtime dependencies at all (a bundled SPA listing everything in `devDependencies`) has its devDependencies taken as runtime. |
|
|
362
|
+
| `peer-range-mismatch` | warn | An installed Genesis package's `peerDependencies` range on another Genesis package that the copy it resolves (looked up from its own folder, as Node does) doesn't satisfy: the package, the range and the installed version. Missing peers and non-semver ranges (`workspace:*`) are skipped. Ranges are read with npm's grammar (`^ ~ x - ||`, prereleases only when the range names one). A mismatch inside a dev-only copy (the CLI's own tree) is `info`. |
|
|
363
363
|
| `hand-rolled-sub-nav` | warn | A route under the layout that renders `AppShell` that switches its sections with its own page-level `<TabsList>` or `<SubNavTabs>`, when the installed Genesis has `useAppShellSubNav`. Tabs inside a card, dialog, sheet, popover, accordion, panel, table or another tab's content are fine, as are pages that call the hook. Use `useAppShellSubNav(items, { mode: "tabs" })`, `AppShellPageHeader` and `AppShellSubNavEnd` from `@marktiderman/genesis-ui/layout` ([sub-navigation](../ui/SKILL.md)). |
|
|
364
364
|
| `local-genesis-copy` | warn | An app component definition named like a component of `uiPackage` or of `componentPackages` (forms-studio's `ResourceHeader`, `SettingsSection`, `ResourceSettingsPage`, `HeadlineNumbers`, `SummaryCard`, `ShareDialog`, …): "Genesis already has X". A definition renders JSX, isn't in a file that imports the Genesis one, and is exported or lives outside the routes folder; a route's own non-exported functions and anything passed as `component` / `errorComponent` / `pendingComponent` / `notFoundComponent` (TanStack's `FormError`) are not copies. An exported genesis-ui value is `shadowed-export` instead; `const X = lazy(() => import("@marktiderman/genesis-…"))` is fine. |
|
|
365
365
|
| `resource-workspace` | info | In a routes folder where a detail page (`courses.$courseId.tsx`, `[id]/page.tsx`) renders `AppShellPageHeader`, directly or through one local import, the other detail pages there that don't: one workspace header and tab row for every resource. Reported, never failing (`--strict` included); `rules` can raise it to `warn`. |
|
|
@@ -371,9 +371,38 @@ It also prints **Available but unused**: the Genesis components no file imports.
|
|
|
371
371
|
before building something.
|
|
372
372
|
|
|
373
373
|
The route rules (`hand-rolled-sub-nav`, `resource-workspace`, `page-layout`) read the routes
|
|
374
|
-
folder (`routesDir`, default the first of `src/routes`, `src/app`, `app`, `src/pages`, `pages`)
|
|
375
|
-
TanStack Router
|
|
376
|
-
files skipped, a trailing `_` un-nesting a segment
|
|
374
|
+
folder (`routesDir`, default the first of `src/routes`, `src/app`, `app`, `src/pages`, `pages`).
|
|
375
|
+
**TanStack Router**: flat `a.$id.tsx` or folders, `route.tsx` layouts, `__root.tsx`, `-private`
|
|
376
|
+
files skipped, a trailing `_` un-nesting a segment, and `posts.lazy.tsx` paired with `posts.tsx`
|
|
377
|
+
as one route (findings point at the lazy file, which holds the component). **Next.js `app/`**
|
|
378
|
+
(chosen when the folder has `page` / `layout` files and no `__root`): `layout.tsx` around
|
|
379
|
+
`page.tsx`, `[id]` params, `(group)` and `@slot` folders dropped from the path; private
|
|
380
|
+
`_folders` and the special files (`error`, `global-error`, `loading`, `not-found`, `template`,
|
|
381
|
+
`default`, `route` handlers, metadata files) aren't routes. **Next.js `pages/`**: `_app` is the
|
|
382
|
+
layout; `_document`, `_error`, `404`, `500` and `api/` aren't pages.
|
|
383
|
+
|
|
384
|
+
A route whose component is imported (`component: CoursesPage`, `export { default } from …`)
|
|
385
|
+
renders; only a route that renders nothing but `<Navigate>` / `<Redirect>` / `<Outlet>` (or no
|
|
386
|
+
component) is redirect-only. A route is a layout when it is a layout file, a pathless `_layout`
|
|
387
|
+
route, or renders an `<Outlet>` itself or in the component it imports. `__root` and Next's
|
|
388
|
+
`layout` files are pure layouts, as is a pathless route or one whose only markup around the
|
|
389
|
+
`<Outlet>` is a wrapper (`<div className="space-y-4"><Outlet /></div>`); a route with content of
|
|
390
|
+
its own beside the outlet (text, a heading, a list or table), `posts/route.tsx` included, is a page
|
|
391
|
+
too, and `page-layout` and `hand-rolled-sub-nav` check it. Next's `(group)` and `@slot` folders
|
|
392
|
+
aren't URL segments, but a group's layout wraps only the routes in that group.
|
|
393
|
+
|
|
394
|
+
What a route renders is followed through the app's modules up to six deep: the imports of the
|
|
395
|
+
components it renders (or names as `component:`), `lazy(() => import(…))` /
|
|
396
|
+
`lazyRouteComponent(…)`, re-exports and barrels, through relative paths, tsconfig/jsconfig
|
|
397
|
+
`paths` and `baseUrl` (following `extends`, to a file or a package's config), package.json
|
|
398
|
+
`imports` and the `@/`, `~/`, `#/` defaults. Imports it only calls (data helpers, hooks) aren't
|
|
399
|
+
followed, and an `import(…)` inside a string, comment, template or regex literal isn't one (the
|
|
400
|
+
tokenizer reads regex literals and JSX text such as `Rock 'n roll`; a file it can't read for sure
|
|
401
|
+
is treated as unknown). An import that is neither an
|
|
402
|
+
app file nor an installed or declared package makes that route unsure, and the route rules don't
|
|
403
|
+
report it; it never makes a route a layout. Past six modules the trail stops as a one-hop check
|
|
404
|
+
would: the route is reported.
|
|
405
|
+
|
|
377
406
|
`hand-rolled-sub-nav` and `page-layout` are warnings (failures under `--strict`) and
|
|
378
407
|
`resource-workspace` is `info`. Opt out with `rules`
|
|
379
408
|
(`{ "page-layout": "off" }`) or a justified `allow` entry for one file:
|
|
@@ -436,6 +465,7 @@ bodies blanked, so text inside a function body never matches; the one exception
|
|
|
436
465
|
| `migration-definer-search-path` | error | A `security definer` function or procedure without `set search_path`. Functions are keyed by name and argument types, so overloads are separate; `alter function … security definer` makes one definer, `alter function … set search_path` fixes it, and renames, replaces and drops are followed. |
|
|
437
466
|
| `migration-edited` | error | A `.sql` migration that already exists at the merge base with `supabase.base` (default `origin/main`) was modified, deleted or renamed. Applied migrations are never edited; add a new one. Skipped outside a git repo; a **warn** when the base ref isn't available. |
|
|
438
467
|
| `migration-testing-kit` | error | A migration that uses `genesis_testing`, genesis-supabase's pgTAP kit for test databases only (it signs in as anyone and resets roles). Keep it in `supabase/tests/database/000_genesis_testing.test.sql`. |
|
|
468
|
+
| `migration-view-rls` | error | A view in an exposed schema that runs as its owner once every migration has run: created without `with (security_invoker = true)`, replaced without it, or reset by `alter view … reset (security_invoker)`. A plain view reads past row level security on every table it selects from. `alter view … set (security_invoker = true)`, renames and drops are followed. A view that runs as its owner on purpose (it filters rows itself) takes an `allow` entry: `{ "rule": "migration-view-rls", "match": "public.profile_cards", "reason": "…" }`. |
|
|
439
469
|
|
|
440
470
|
**Which migrations are new.** In a git repo with the base ref, a migration is new when it was
|
|
441
471
|
added, modified or is untracked since the merge base. `since` (a file name or timestamp prefix)
|