Repository navigation
Commit 6b978f1
committed
docs(core): fix ComponentRegistry singleton example in README
packages/core/README.md's Component Registry snippet taught
`new ComponentRegistry()`, but ComponentRegistry is an exported singleton
instance, not a class -- packages/core/dist/registry/Registry.d.ts declares
`export declare const ComponentRegistry: Registry<any>`. The #5138 doc-snippet
type gate measures this as TS2351: This expression is not constructable.
README ships to npm inside the package's `files`, so a reader who copied the
snippet got a compile error.
Drops the `new`, calls ComponentRegistry.register/get directly on the
singleton, and adds one line stating it is the process-level shared instance
SchemaRenderer resolves every `type` against -- the same wording
packages/components/README.md was given in #5160, kept consistent across
both READMEs.
Updates the UNGATED_DOCS ledger entry for packages/core/README.md in
scripts/check-doc-snippet-types.mjs: TS2351x1 is dropped from the reason
text now that the diagnostic is gone (measured before/after against the
built dist/*.d.ts). The entry is not deleted -- the document's remaining
TS2339x2 pair is a separate, pre-existing defect out of scope here, tracked
as #5257.
Fixes #5258
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RV6yuVCxymHYE16PL9vQkE1 parent bc2922a commit 6b978f1
3 files changed
Lines changed: 34 additions & 4 deletions
File tree
- .changeset
- packages/core
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
| 49 | + | |
| 50 | + | |
52 | 51 | | |
53 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
0 commit comments