Repository navigation
Commit 1c8b320
fix(client): publishItem JSDoc names NO_DRAFT, not the retired [no_draft] opener (#20187)
Fixes #19704
Clause-②: no
`publishItem`'s JSDoc in `packages/client/src/index.ts` (ships into
`dist/index.d.ts`) documented the publish-refusal spelling as `404
[no_draft]` — the bracketed lowercase message opener the 2026-08-29
maintainer ruling retired from every `@objectstack/metadata-protocol`
producer via #16245 / PR #19683 (`7a25a3ee9c`). The runtime has answered
`status: 404, code: 'NO_DRAFT'` with no bracketed opener since that PR
landed. This corrects the docstring to name `NO_DRAFT` on the `code`
axis, following the same 404 `NO_DRAFT` convention already used in
`packages/spec/src/api/plugin-rest-api.zod.ts`. No behaviour change.
The card's own `Blocked-by: #16245` is satisfied — that PR merged on
2026-09-22 (`7a25a3ee9c`). Triage originally planned to fold this card
into #19705's round; per the claim's serial-constraints note, that round
closed via a PR touching only QA files and never picked this line up, so
this card proceeded on its own.
## Measured
- **Site confirmed**: `packages/client/src/index.ts:2152` read `404
[no_draft] when there is nothing to publish.` on `origin/main`
`455dcc06`.
- **Tree-wide sweep**: `git grep -n --fixed-strings "[no_draft]"` over
the tracked tree (excluding `content/docs/releases/` and
`CHANGELOG.md`s) found no other present-tense claim of this spelling
inside `packages/client/src/`. Control words in the same file —
`NO_DRAFT` and `[item_locked]` are zero there while `publish` hits 55
times — show the grep discriminates rather than being silently broken.
- **Published-surface question (triage's UNMEASURED item)**: built
`@objectstack/client` and grepped the emitted `dist/index.d.ts` — the
docstring **does ship** (with positive controls, two neighbouring JSDoc
lines, confirmed present too). This is a published-surface correction,
so it carries `.changeset/19704-client-no-draft-jsdoc.md` (`patch`), not
the `skip-changeset` route.
- **Runtime producer**: `SysMetadataRepository.promoteDraft`
(`packages/metadata-protocol/src/sys-metadata-repository.ts:946`) throws
`status: 404`, `code: 'NO_DRAFT'`, message `"No pending draft exists for
{type}/{name} — nothing to publish."` — no bracketed opener. The new
docstring names exactly that.
- No test pins the old `[no_draft]` text (zero `git grep` hits across
`packages/client/`'s test files).
## Acceptance notes
Two more present-tense claims of the same *retired bracketed-opener*
shape turned up while measuring the above, both outside this card's file
surface (packages/client/src/ + the [no_draft] spelling specifically) —
reported rather than fixed here:
- `packages/rest/src/rest-server.ts:8427` — a source comment (`404
[no_draft] when nothing to publish.`) on the same `POST
/meta/:type/:name/publish` route this card's producer serves. Same
defect family as #19704 and #16245, different file.
- `packages/client/src/index.ts:6297` — a sibling docstring (`Get a
sharing rule by id or name. 404 [RULE_NOT_FOUND] when absent.`) for a
*different* code. Its producer
(`packages/plugins/plugin-sharing/src/sharing-rule-service.ts:818`, bare
`throw new Error('RULE_NOT_FOUND')`) and REST mapping
(`packages/rest/src/rest-server.ts:12807-12808`, `:12920`) never emit a
bracketed message either — the #16245 shape recurring on a code that
ruling never touched.
Neither is the `[no_draft]` spelling this card claims, and the second
isn't in scope by spelling; both are named in the round report for the
dispatching seat to route.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01UYBdGBzWSrAMzpW8ah3GbP)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6cc8dcd commit 1c8b320
2 files changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2149 | 2149 | | |
2150 | 2150 | | |
2151 | 2151 | | |
2152 | | - | |
| 2152 | + | |
2153 | 2153 | | |
2154 | 2154 | | |
2155 | 2155 | | |
| |||
0 commit comments