@marktiderman/genesis-cli 1.13.1 → 1.14.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 +12 -3
- package/dist/cli.js +541 -107
- package/dist/cli.js.map +1 -1
- package/dist/doctor.d.ts +1 -1
- package/dist/doctor.js +364 -2
- package/dist/doctor.js.map +1 -1
- package/dist/genesis-catalog.json +29 -286
- package/dist/index.js +372 -10
- package/dist/index.js.map +1 -1
- package/dist/vite.js +364 -2
- package/dist/vite.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -215,9 +215,14 @@ runs count that copy as handled. It exits 1 when something still needs you.
|
|
|
215
215
|
keeping its range prefix; `workspace:`, `file:` and other ranges are left alone, nothing is
|
|
216
216
|
downgraded.
|
|
217
217
|
2. Runs a codemod only when a release declares a breaking change it fixes: the registry in
|
|
218
|
-
`src/upgrade/codemods.ts`
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
`src/upgrade/codemods.ts` names the package and the first version that breaks, and a codemod
|
|
219
|
+
runs when a package moves across it. A major move (or a 0.x minor) without one is listed so you
|
|
220
|
+
read its changelog. `genesis codemod` lists them and `genesis codemod <id> [--dry-run]` runs
|
|
221
|
+
one by hand, for an app that moved its versions some other way:
|
|
222
|
+
|
|
223
|
+
| Codemod | Runs when | Changes |
|
|
224
|
+
| --- | --- | --- |
|
|
225
|
+
| `genesis-core-2-scope-names` | genesis-core crosses 2.0.0 | Genesis API usage only, never an app's own names that match (a view field means one inside `defineView(…)` or an object typed `ViewDefinition`/`ViewField`; the prop means an attribute of `<NativeResourceView>` or a key of an object typed `NativeResourceViewProps`; each with the name imported from Genesis): a view field's `timeZone: "practice"` → `"scope"`, NativeResourceView's `practiceTimeZone` (attribute or object key) → `scopeTimeZone`, `resolveZone("practice", …)` → `"scope"`, and DisplayTimeZones' `practice` (a `{ viewer, practice }` object's key, `.practice` on a value from `useDisplayTimeZones()` or typed `DisplayTimeZones`) → `scope`. `scope={{ practiceId }}` needs nothing (it is the app's own key in ResourceScope's open slot); when a file reads `scope.practiceId` and nothing declares it, the codemod prints the one-line `ResourceScope` augmentation that types it. The doctor's `removed-scope-name` rule finds what it would rewrite. |
|
|
221
226
|
3. Reinstalls, then refreshes every file in `genesis.lock.json` from the newly installed package:
|
|
222
227
|
unchanged in the app, it takes the new version; changed by both, it is merged with `git
|
|
223
228
|
merge-file` against the old version (the base); a conflict goes to `<file>.genesis-next` and
|
|
@@ -394,6 +399,10 @@ Exit codes: `0` pass, `1` findings, `2` the doctor couldn't run (bad config, Gen
|
|
|
394
399
|
| `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`. |
|
|
395
400
|
| `page-layout` | warn | A route inside the AppShell (under the layout route that renders it) that renders no Genesis page layout (the `…Page` / `…PageShell` components `uiPackage` and `componentPackages` export, not `BreadcrumbPage`) itself, through one local import, or from a layout route around it (`my/route.tsx` supplying `DetailPage` covers `my/index.tsx`). A `…Page`, `…Screen` or `…Workspace` imported from any Genesis package counts. Routes outside the shell (sign-in, landing, public forms) aren't checked until Genesis ships layouts for them. Layout-only (`route.tsx`, `__root`, `<Outlet>`) and redirect-only routes are skipped; off with the `native` pack (see `native-screen-layout`). |
|
|
396
401
|
| `iso-date-slice` | warn | A day cut from an ISO timestamp: `.toISOString().slice(0, 10)`, `.substring(0, 10)`, `.substr(0, 10)`, `.split("T")[0]` or `.split("T").at(0)`. That's the day in UTC, which for an evening in the Americas is already tomorrow. Use `personDay(person)` or `dayIn(zone)` from `@marktiderman/genesis-core/dates`. Test files are skipped; where UTC is what you mean (a log name, a UTC report), allow it with a reason. |
|
|
402
|
+
| `resource-view-tree` | error | A `<ResourceView>` or `<ResourcePage>` with `tree` and `pagination="server"` or `"cursor"` (bare or in braces). A tree is built from every row on the client, so the screen throws when it renders. Leave `pagination` unset. Only the tag's own attributes count, not a `tree` inside an expression. ([Tree mode](../../docs/RESOURCE-VIEW.md#tree-mode)) |
|
|
403
|
+
| `studio-server-auth-import` | warn | An import of a studio-server file the package doesn't export (`@marktiderman/genesis-studio-server/dist/…`, `/src/…`, `/lib/…`), or a CommonJS `require("@marktiderman/genesis-studio-server")` of the ESM-only root. Besides the doctor's scan it reads the app's `.cjs` and `.mjs` files (tests skipped), where a `require` usually is. Both fail at run time with `ERR_PACKAGE_PATH_NOT_EXPORTED`. Use `@marktiderman/genesis-studio-server/auth`: the token checks and `switchToUser`, for `import` and `require`. An ESM import of the root is fine. |
|
|
404
|
+
| `removed-scope-name` | error | A "practice" name genesis-core 2 removed, in a file that imports a Genesis package: a view field's `timeZone: "practice"` (a string value in a view definition), NativeResourceView's `practiceTimeZone`, `resolveZone("practice", …)`, or DisplayTimeZones' `practice`. `defineView` refuses the first when the view loads and the rest are type errors; this lists them in CI. `genesis codemod genesis-core-2-scope-names` rewrites every one. It reads only Genesis API usage, the same shapes the codemod rewrites (see its row above); comments and an app's own `practice` settings, props and `resolveZone` are skipped. |
|
|
405
|
+
| `scope-practice-id` | info | `scope.practiceId` read with no `ResourceScope` augmentation in the app (declaration files included). It still works, as the app's own key in the open slot, but reads as `unknown`; the message gives the one-line augmentation. Never fails, `--strict` included. |
|
|
397
406
|
| `stale-exception` | warn | An `allow` entry that no longer matches anything. |
|
|
398
407
|
|
|
399
408
|
It also prints **Available but unused**: the Genesis components no file imports. Check it
|