sdocs 0.0.55 → 0.0.56
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/CHANGELOG.md +10 -0
- package/dist/language/config-schema.d.ts +25 -0
- package/dist/language/config-schema.js +131 -0
- package/dist/language/index.d.ts +1 -0
- package/dist/language/index.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.0.56] - 2026-07-05
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **`configSchema` in `sdocs/language`** — a structured description of the
|
|
15
|
+
`sdocs.config.*` shape (keys, documentation, and value enums) mirroring
|
|
16
|
+
`SdocsConfig`. Editor tooling reads it to complete the config file in
|
|
17
|
+
projects that don't install `sdocs`, so config completion can't drift from
|
|
18
|
+
the config type.
|
|
19
|
+
|
|
10
20
|
## [0.0.55] - 2026-07-05
|
|
11
21
|
|
|
12
22
|
### Changed
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A structured description of the `sdocs.config.*` shape, mirroring the
|
|
3
|
+
* `SdocsConfig` type. Editor tooling consumes this to offer key and value
|
|
4
|
+
* completions in projects that don't install `sdocs` (where the TypeScript
|
|
5
|
+
* type isn't resolvable). Keep it in step with `SdocsConfig` in `types.ts`.
|
|
6
|
+
*/
|
|
7
|
+
/** One config key: how to present, insert, and (for enums) value-complete it. */
|
|
8
|
+
export interface ConfigFieldSchema {
|
|
9
|
+
/** Short type hint shown as the completion detail, e.g. `'string | string[]'`. */
|
|
10
|
+
detail: string;
|
|
11
|
+
/** Markdown documentation for the key. */
|
|
12
|
+
doc: string;
|
|
13
|
+
/** Snippet inserted after the key name — includes the `:` and a tabstop. */
|
|
14
|
+
insert: string;
|
|
15
|
+
/** Allowed values, for value-position completion. */
|
|
16
|
+
values?: string[];
|
|
17
|
+
/** Whether `values` are strings (quoted on insert) or literals (inserted bare). */
|
|
18
|
+
quoted?: boolean;
|
|
19
|
+
/** Nested object schema, when this key holds an object. */
|
|
20
|
+
object?: ConfigSchema;
|
|
21
|
+
}
|
|
22
|
+
/** A config object shape: its keys mapped to their field descriptions. */
|
|
23
|
+
export type ConfigSchema = Record<string, ConfigFieldSchema>;
|
|
24
|
+
/** The `sdocs.config.*` schema, rooted at the exported config object. */
|
|
25
|
+
export declare const configSchema: ConfigSchema;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A structured description of the `sdocs.config.*` shape, mirroring the
|
|
3
|
+
* `SdocsConfig` type. Editor tooling consumes this to offer key and value
|
|
4
|
+
* completions in projects that don't install `sdocs` (where the TypeScript
|
|
5
|
+
* type isn't resolvable). Keep it in step with `SdocsConfig` in `types.ts`.
|
|
6
|
+
*/
|
|
7
|
+
// Sizing knobs shared by the page/docs/layout content objects.
|
|
8
|
+
const maxWidth = {
|
|
9
|
+
detail: 'string',
|
|
10
|
+
doc: 'Content column max width — any CSS length (`1200px`, `80ch`, `100%`).',
|
|
11
|
+
insert: ": '$0'",
|
|
12
|
+
};
|
|
13
|
+
const padding = {
|
|
14
|
+
detail: 'string',
|
|
15
|
+
doc: 'Space around the content — any CSS padding shorthand (`16px`, `1rem 2rem`).',
|
|
16
|
+
insert: ": '$0'",
|
|
17
|
+
};
|
|
18
|
+
// Stage-layout knobs shared by the docs preview/example stages.
|
|
19
|
+
const direction = {
|
|
20
|
+
detail: "'row' | 'column'",
|
|
21
|
+
doc: 'Preview/example stage `flex-direction`. Default: `row`.',
|
|
22
|
+
insert: ": '${0:row}'",
|
|
23
|
+
values: ['row', 'column', 'row-reverse', 'column-reverse'],
|
|
24
|
+
quoted: true,
|
|
25
|
+
};
|
|
26
|
+
const gap = {
|
|
27
|
+
detail: 'string',
|
|
28
|
+
doc: 'Gap between stage items — any CSS length. Default: `16px`.',
|
|
29
|
+
insert: ": '$0'",
|
|
30
|
+
};
|
|
31
|
+
const contentX = {
|
|
32
|
+
detail: "'left' | 'center' | 'right' | 'justify'",
|
|
33
|
+
doc: 'Horizontal alignment of stage contents. Default: `left`.',
|
|
34
|
+
insert: ": '${0:left}'",
|
|
35
|
+
values: ['left', 'center', 'right', 'justify'],
|
|
36
|
+
quoted: true,
|
|
37
|
+
};
|
|
38
|
+
const contentY = {
|
|
39
|
+
detail: "'top' | 'middle' | 'bottom' | 'justify'",
|
|
40
|
+
doc: 'Vertical alignment of stage contents. Default: `top`.',
|
|
41
|
+
insert: ": '${0:top}'",
|
|
42
|
+
values: ['top', 'middle', 'bottom', 'justify'],
|
|
43
|
+
quoted: true,
|
|
44
|
+
};
|
|
45
|
+
/** The `sdocs.config.*` schema, rooted at the exported config object. */
|
|
46
|
+
export const configSchema = {
|
|
47
|
+
include: {
|
|
48
|
+
detail: 'string | string[]',
|
|
49
|
+
doc: 'Glob pattern(s) locating your `.sdoc` files. Default: `./src/**/*.sdoc`.',
|
|
50
|
+
insert: ": ['$0']",
|
|
51
|
+
},
|
|
52
|
+
port: {
|
|
53
|
+
detail: 'number',
|
|
54
|
+
doc: 'Dev server port. Default: `3000`.',
|
|
55
|
+
insert: ': ${0:3000}',
|
|
56
|
+
},
|
|
57
|
+
open: {
|
|
58
|
+
detail: 'boolean',
|
|
59
|
+
doc: 'Open the browser when the dev server starts. Default: `false`.',
|
|
60
|
+
insert: ': ${0:false}',
|
|
61
|
+
values: ['true', 'false'],
|
|
62
|
+
},
|
|
63
|
+
css: {
|
|
64
|
+
detail: 'string | Record<string, string>',
|
|
65
|
+
doc: 'CSS loaded inside preview iframes — a single stylesheet path, or a map of named stylesheets to switch between.',
|
|
66
|
+
insert: ": '$0'",
|
|
67
|
+
},
|
|
68
|
+
logo: {
|
|
69
|
+
detail: 'string',
|
|
70
|
+
doc: 'Sidebar logo text. Default: `sdocs`.',
|
|
71
|
+
insert: ": '${0:sdocs}'",
|
|
72
|
+
},
|
|
73
|
+
icon: {
|
|
74
|
+
detail: 'string | false',
|
|
75
|
+
doc: "Sidebar logo icon: `'sdocs'` for the built-in mascot, an image URL, or `false` to hide it. Default: `'sdocs'`.",
|
|
76
|
+
insert: ": '${0:sdocs}'",
|
|
77
|
+
values: ['sdocs'],
|
|
78
|
+
quoted: true,
|
|
79
|
+
},
|
|
80
|
+
sidebar: {
|
|
81
|
+
detail: 'object',
|
|
82
|
+
doc: 'Sidebar ordering and default-expanded folders.',
|
|
83
|
+
insert: ': {\n\t$0\n}',
|
|
84
|
+
object: {
|
|
85
|
+
order: {
|
|
86
|
+
detail: 'Record<string, string[]>',
|
|
87
|
+
doc: "Per-folder sort overrides. Keys are folder paths (`'root'` for the top level); `'*'` stands for unlisted items.",
|
|
88
|
+
insert: ': {\n\t$0\n}',
|
|
89
|
+
},
|
|
90
|
+
open: {
|
|
91
|
+
detail: 'string[]',
|
|
92
|
+
doc: 'Folders expanded by default on load.',
|
|
93
|
+
insert: ': [$0]',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
content: {
|
|
98
|
+
detail: 'object',
|
|
99
|
+
doc: 'Content presentation per entity kind. Entity and block attributes override these.',
|
|
100
|
+
insert: ': {\n\t$0\n}',
|
|
101
|
+
object: {
|
|
102
|
+
page: {
|
|
103
|
+
detail: 'object',
|
|
104
|
+
doc: '`[PAGE]` content. Defaults: `maxWidth` `1200px`, `padding` `32px`, `toc` `true`.',
|
|
105
|
+
insert: ': {\n\t$0\n}',
|
|
106
|
+
object: {
|
|
107
|
+
maxWidth,
|
|
108
|
+
padding,
|
|
109
|
+
toc: {
|
|
110
|
+
detail: 'boolean',
|
|
111
|
+
doc: 'Show the page table of contents. Default: `true`.',
|
|
112
|
+
insert: ': ${0:true}',
|
|
113
|
+
values: ['true', 'false'],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
docs: {
|
|
118
|
+
detail: 'object',
|
|
119
|
+
doc: '`[DOCS]` pages. `maxWidth` is the content column; `padding`/`direction`/`gap`/`contentX`/`contentY` are the default preview & example stage layout.',
|
|
120
|
+
insert: ': {\n\t$0\n}',
|
|
121
|
+
object: { maxWidth, padding, direction, gap, contentX, contentY },
|
|
122
|
+
},
|
|
123
|
+
layout: {
|
|
124
|
+
detail: 'object',
|
|
125
|
+
doc: '`[LAYOUT]` stages. Defaults: `maxWidth` `100%`, `padding` `0px`.',
|
|
126
|
+
insert: ': {\n\t$0\n}',
|
|
127
|
+
object: { maxWidth, padding },
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
};
|
package/dist/language/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { scanSdoc, offsetToPosition, ENTITY_KINDS, SUB_BLOCK_KINDS, type Span, type EntityKind, type SubBlockKind, type AttrValue, type Attrs, type SubBlock, type Entity, type TagBlock, type ScanError, type SdocFile, } from './scanner.js';
|
|
2
2
|
export { projectSdoc, type SdocProjection, type ProjectedLineKind, } from './projection.js';
|
|
3
3
|
export { segmentPageBody, type PageSegment, } from './page-islands.js';
|
|
4
|
+
export { configSchema, type ConfigSchema, type ConfigFieldSchema, } from './config-schema.js';
|
|
4
5
|
export { parseSdoc, parseArgsLiteral, slugifyTitle, normalizeBody, attributeRules, type AttrRule, type ArgValue, type Sizing, type PreviewBlock, type ExampleBlock, type DocsEntity, type PageEntity, type LayoutEntity, type SdocEntity, type SdocDocument, } from './parser.js';
|
package/dist/language/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { scanSdoc, offsetToPosition, ENTITY_KINDS, SUB_BLOCK_KINDS, } from './scanner.js';
|
|
2
2
|
export { projectSdoc, } from './projection.js';
|
|
3
3
|
export { segmentPageBody, } from './page-islands.js';
|
|
4
|
+
export { configSchema, } from './config-schema.js';
|
|
4
5
|
export { parseSdoc, parseArgsLiteral, slugifyTitle, normalizeBody, attributeRules, } from './parser.js';
|