Skip to content

Commit 9990ea1

Browse files
committed
fix(kernel): stop bundling SNAPSHOT_OPTION_FLAGS' rationale into the public .d.ts
Its JSDoc was internal refactor rationale, not SDK documentation, but rolldown-plugin-dts inlines it wherever CaptureSnapshotOptions resolves through SnapshotCommandOptionFields. Move it to a source comment (stripped from declaration output) and keep one short hover line. Cuts the packaged size growth from +3.3 kB/+2.2 kB to +2.3 kB/+1.8 kB (unpacked/download); no behavior change.
1 parent 79f7161 commit 9990ea1

1 file changed

Lines changed: 23 additions & 22 deletions

File tree

‎packages/kernel/src/snapshot.ts‎

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,28 +87,29 @@ export type SnapshotOptions = {
8787
customActions?: boolean;
8888
};
8989

90-
/**
91-
* The snapshot capture family stated ONCE as option key ↔ command-flag key.
92-
*
93-
* The same pair (`customActions` ↔ `snapshotCustomActions`, and its seven
94-
* siblings) used to be re-typed by hand at every seam that carries a snapshot
95-
* request across the option/flag vocabulary line — the CLI reader, the client
96-
* option projection, the daemon capture inputs, the presentation key. Each copy
97-
* restated a fact already stated here and decided nothing, so a new snapshot
98-
* option cost one edit per seam and a missed seam dropped the option silently.
99-
*
100-
* Declared in the kernel because both vocabularies are declared here
101-
* ({@link SnapshotOptions}) and above (`CommandFlags` in contracts), so this is
102-
* the lowest point both sides can read. This generalises the shipped
103-
* `screenshotFlagsFromOptions`/`screenshotOptionsFromFlags` pair for the
104-
* screenshot family.
105-
*
106-
* Every projection takes an EXPLICIT key list: a seam admits the options it
107-
* routes and no more, so adding a pair here never silently widens a seam that
108-
* cannot honour it.
109-
*/
110-
// Exported only because the exported types below say `typeof` it.
111-
// fallow-ignore-next-line unused-export
90+
// The snapshot capture family stated ONCE as option key ↔ command-flag key.
91+
//
92+
// The same pair (`customActions` ↔ `snapshotCustomActions`, and its seven
93+
// siblings) used to be re-typed by hand at every seam that carries a snapshot
94+
// request across the option/flag vocabulary line — the CLI reader, the client
95+
// option projection, the daemon capture inputs, the presentation key. Each copy
96+
// restated a fact already stated here and decided nothing, so a new snapshot
97+
// option cost one edit per seam and a missed seam dropped the option silently.
98+
//
99+
// Declared in the kernel because both vocabularies are declared here
100+
// (SnapshotOptions) and above (`CommandFlags` in contracts), so this is
101+
// the lowest point both sides can read. This generalises the shipped
102+
// `screenshotFlagsFromOptions`/`screenshotOptionsFromFlags` pair for the
103+
// screenshot family.
104+
//
105+
// Every projection takes an EXPLICIT key list: a seam admits the options it
106+
// routes and no more, so adding a pair here never silently widens a seam that
107+
// cannot honour it.
108+
//
109+
// Exported only because the exported types below say `typeof` it — this const
110+
// is not itself public API, so the rationale stays a source comment (stripped
111+
// from the published .d.ts) instead of a bundled JSDoc block.
112+
/** The CLI/daemon flag key for each snapshot capture option, by option name. */
112113
export const SNAPSHOT_OPTION_FLAGS = {
113114
interactiveOnly: 'snapshotInteractiveOnly',
114115
depth: 'snapshotDepth',

0 commit comments

Comments
 (0)