@sdxc/kit 2026.10.24 → 2026.10.26
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 +28 -15
- package/changelog.jsonl +125 -4
- package/dist/architecture/graph.d.ts +16 -3
- package/dist/architecture/graph.js +37 -19
- package/dist/architecture/layers.d.ts +10 -3
- package/dist/architecture/layers.js +38 -9
- package/dist/commands/destroy.d.ts +1 -1
- package/dist/commands/make.d.ts +5 -5
- package/dist/commands/make.js +11 -8
- package/dist/commands/scaffold.d.ts +1 -1
- package/dist/contract.d.ts +3 -3
- package/dist/doctor/checks.d.ts +2 -2
- package/dist/doctor/checks.js +14 -2
- package/dist/doctor/constant-names.d.ts +17 -0
- package/dist/doctor/constant-names.js +106 -0
- package/dist/doctor/dependencies.d.ts +3 -3
- package/dist/doctor/dependencies.js +3 -3
- package/dist/doctor/fan-out.d.ts +3 -2
- package/dist/doctor/fan-out.js +4 -3
- package/dist/doctor/fetch-param.d.ts +15 -0
- package/dist/doctor/fetch-param.js +37 -0
- package/dist/doctor/files.d.ts +2 -0
- package/dist/doctor/files.js +4 -0
- package/dist/doctor/local-const.d.ts +15 -0
- package/dist/doctor/local-const.js +54 -0
- package/dist/doctor/logger.d.ts +15 -0
- package/dist/doctor/logger.js +41 -0
- package/dist/doctor/orphans.d.ts +3 -3
- package/dist/doctor/orphans.js +33 -7
- package/dist/doctor/process-env.d.ts +15 -0
- package/dist/doctor/process-env.js +39 -0
- package/dist/doctor/project.js +17 -13
- package/dist/doctor/result-throws.d.ts +5 -4
- package/dist/doctor/result-throws.js +6 -5
- package/dist/doctor/source-rule.d.ts +35 -0
- package/dist/doctor/source-rule.js +52 -0
- package/dist/doctor/stack-imports.d.ts +15 -0
- package/dist/doctor/stack-imports.js +60 -0
- package/dist/doctor/syntax.d.ts +31 -0
- package/dist/doctor/syntax.js +56 -0
- package/dist/make/binding.d.ts +13 -8
- package/dist/make/binding.js +96 -64
- package/dist/make/from-model.js +2 -7
- package/dist/make/index.js +2 -7
- package/dist/package-manager.d.ts +6 -0
- package/dist/package-manager.js +25 -2
- package/dist/scaffold/index.js +25 -19
- package/dist/ui/commands.js +2 -5
- package/dist/ui/registry.d.ts +2 -2
- package/dist/ui/registry.js +1 -1
- package/dist/upgrade/changelog.d.ts +2 -0
- package/dist/upgrade/changelog.js +2 -0
- package/dist/upgrade/project.d.ts +2 -2
- package/dist/upgrade/prompt.d.ts +3 -2
- package/dist/upgrade/prompt.js +43 -2
- package/package.json +5 -5
- package/registry/ui/youtube-embed.json +3 -3
- package/stubs/scaffold.test-mcp.stub +5 -1
- package/templates/app/AGENTS.md +3 -1
- package/templates/app/app/commands/db/fresh.ts +20 -13
- package/templates/app/app/commands/db/migrate.ts +42 -32
- package/templates/app/app/http/controllers/api/openapi.test.ts +29 -0
- package/templates/app/app/http/controllers/api/openapi.tsx +8 -2
- package/templates/app/app/http/controllers/health.test.ts +35 -0
- package/templates/app/app/http/controllers/health.ts +16 -0
- package/templates/app/app/http/controllers/mcp.test.ts +16 -0
- package/templates/app/app/http/middleware/access.ts +6 -3
- package/templates/app/app/http/middleware/page.ts +3 -4
- package/templates/app/app/http/middleware/server-timing.test.ts +1 -1
- package/templates/app/app/initializers/database.test.ts +6 -1
- package/templates/app/app/initializers/health.ts +17 -0
- package/templates/app/app/initializers/openapi.ts +5 -4
- package/templates/app/app/initializers/router.test.ts +1 -1
- package/templates/app/app/initializers/router.tsx +5 -6
- package/templates/app/app/test/cloudflare-workers.test.ts +27 -0
- package/templates/app/app/test/cloudflare-workers.ts +17 -4
- package/templates/app/app/test/database.ts +33 -0
- package/templates/app/app/test/mcp.ts +96 -0
- package/templates/app/package.json +1 -0
- package/templates/app/resources/layouts/document.tsx +2 -3
- package/templates/app/routes/api.ts +17 -7
- package/templates/app/app/http/controllers/api/health.tsx +0 -15
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ Every `@sdxc/*` package versions as the UTC date it was published, and a daily r
|
|
|
45
45
|
- `sdxc upgrade [release]` moves every `@sdxc/*` package the project lists to the target release, latest when left out, and `remix` to the version that release requires, then installs and prints a prompt for an AI agent from that release's changelog.
|
|
46
46
|
- `sdxc doctor` reports packages pinned behind the project's release and a `remix` pin other than the release's peer; `sdxc upgrade <release>` fixes both.
|
|
47
47
|
|
|
48
|
-
`sdxc doctor` also checks secrets, migrations, the app layout
|
|
48
|
+
`sdxc doctor` also checks secrets, migrations, the app layout, JSDoc comment shape and source conventions (local `let`, constant names, the stack's imports, `env`, `fetch` and logging), and runs a project's own checks written with `defineCheck` from `@sdxc/kit/doctor`. The [doctor guide](https://sdxc.dev/docs/sdxc/check-a-project) lists every check.
|
|
49
49
|
|
|
50
50
|
## API
|
|
51
51
|
|
|
@@ -67,6 +67,9 @@ Every `@sdxc/*` package versions as the UTC date it was published, and a daily r
|
|
|
67
67
|
| `sdxc stats` | Counts lines of code per kind of code, and the code to test ratio |
|
|
68
68
|
| `sdxc run` | Runs the project's command line (`run.entry`, default `bootstrap/cli.ts`) |
|
|
69
69
|
| `sdxc doctor` | Lints the project: release drift, secrets, migrations, layout, JSDoc and its own checks |
|
|
70
|
+
| `sdxc fix` | Applies the repairs `sdxc doctor` names that the kit can make safely |
|
|
71
|
+
| `sdxc setup` | Installs a multi-file feature (auth, billing, flags), or lists them with no name |
|
|
72
|
+
| `sdxc diagram` | Draws the project's layer architecture as Mermaid, or as SVG through `@sdxc/diagram` |
|
|
70
73
|
| `sdxc ui` | Copies `@sdxc/ui` components into the project and points imports at the copies |
|
|
71
74
|
| `sdxc upgrade` | Moves the `@sdxc/*` packages and `remix` to a release and prints the prompt |
|
|
72
75
|
| `sdxc deploy` | Builds, then runs the app's own `db migrate --remote` and `deploy`, once confirmed |
|
|
@@ -502,20 +505,30 @@ Move the @sdxc packages to another release and print the prompt for the code
|
|
|
502
505
|
|
|
503
506
|
The CLI reads `.config/sdxc.jsonc` (or `sdxc.jsonc` at the project root). Every key is optional.
|
|
504
507
|
|
|
505
|
-
| Key
|
|
506
|
-
|
|
|
507
|
-
| `ui.directory`
|
|
508
|
-
| `ui.alias`
|
|
509
|
-
| `ui.tests`
|
|
510
|
-
| `make.routes`
|
|
511
|
-
| `make.migrations`
|
|
512
|
-
| `make.tests`
|
|
513
|
-
| `make.specs`
|
|
514
|
-
| `make.stubs`
|
|
515
|
-
| `doctor.checks`
|
|
516
|
-
| `doctor.migrations.accept`
|
|
517
|
-
| `
|
|
518
|
-
| `
|
|
508
|
+
| Key | Default | Meaning |
|
|
509
|
+
| ----------------------------- | -------------------------------------- | ---------------------------------------------------------------------------- |
|
|
510
|
+
| `ui.directory` | `resources/components/ui` | Where `sdxc ui add` writes components |
|
|
511
|
+
| `ui.alias` | inferred from tsconfig `paths` | Import prefix for the copies |
|
|
512
|
+
| `ui.tests` | `false` | Copy a component's tests beside it |
|
|
513
|
+
| `make.routes` | `web` | Route contract `sdxc make controller` adds to, a module in `routes/` |
|
|
514
|
+
| `make.migrations` | `{ "default": "database/migrations" }` | Migration chains by name |
|
|
515
|
+
| `make.tests` | `true` | Write a test beside every generated file except migrations and factories |
|
|
516
|
+
| `make.specs` | `true` | Write a pairing `.spec` for controllers, commands, MCP tools and scaffolds |
|
|
517
|
+
| `make.stubs` | `.config/sdxc/stubs` | Stubs that replace the built-in ones |
|
|
518
|
+
| `doctor.checks` | `.config/sdxc/checks` | The project's own `sdxc doctor` checks, one module each |
|
|
519
|
+
| `doctor.migrations.accept` | `[]` | Migration errors `sdxc doctor` steps past, each `{ "file", "column" }` |
|
|
520
|
+
| `doctor.complexity.max` | `4` | Highest cyclomatic complexity a function may have |
|
|
521
|
+
| `doctor.moduleSize.maxLines` | `200` | Most code lines a module may hold |
|
|
522
|
+
| `doctor.crap.max` | `12` | Highest CRAP score a function may have |
|
|
523
|
+
| `doctor.crap.coverage` | `coverage/coverage-final.json` | Istanbul coverage the `crap` check reads |
|
|
524
|
+
| `doctor.testRatio.min` | `0.3` | Lowest test lines per code line |
|
|
525
|
+
| `doctor.fanOut.max` | `15` | Most project modules one module may import statically |
|
|
526
|
+
| `doctor.duplication.minLines` | `8` | Fewest code lines that count as a duplicated block |
|
|
527
|
+
| `doctor.mutation.report` | `reports/mutation/mutation.json` | Mutation-testing report the `mutation` check reads |
|
|
528
|
+
| `doctor.mutation.maxSurvived` | `0` | Most surviving mutants the `mutation` check allows |
|
|
529
|
+
| `run.entry` | `bootstrap/cli.ts` | Module `sdxc run` starts, relative to the project root |
|
|
530
|
+
| `format` | none | Command run once on every file a command wrote or edited, the paths appended |
|
|
531
|
+
| `lock` | `.config/sdxc.lock.jsonl` | Where the CLI keeps its state |
|
|
519
532
|
|
|
520
533
|
`format` is an argument list, such as `["bunx", "vp", "fmt"]`.
|
|
521
534
|
|