@lexibase/rdx-types 1.0.0-beta.5 → 1.1.0
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/dist/config.d.ts +201 -105
- package/dist/index.d.ts +1 -1
- package/dist/plugins.d.ts +4 -2
- package/package.json +5 -1
package/dist/config.d.ts
CHANGED
|
@@ -1,161 +1,257 @@
|
|
|
1
1
|
import type { ComponentType } from 'react'
|
|
2
2
|
import type { RdxPlugin } from './plugins'
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Public configuration shared by defineConfig, the CLI, runtime and plugins.
|
|
6
|
+
*
|
|
7
|
+
* Set the site name once in metadata.applicationName. Live documentation always
|
|
8
|
+
* lives in docs/; the generated .rdx/ directory is not a customization API.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* export default defineConfig({
|
|
12
|
+
* metadata: { applicationName: 'My documentation' },
|
|
13
|
+
* navbar: { title: '' },
|
|
14
|
+
* homepage: { enabled: false },
|
|
15
|
+
* })
|
|
16
|
+
*/
|
|
5
17
|
export type RDXConfig = {
|
|
6
|
-
search?: boolean
|
|
7
|
-
TOC?: boolean
|
|
8
|
-
/**
|
|
9
|
-
* The title of the documentation site.
|
|
10
|
-
* Displayed in the navbar and browser tab.
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
title: string
|
|
14
|
-
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
+
* Enable local documentation search in the navbar.
|
|
20
|
+
* Search uses the project's content sources; no external service is required.
|
|
21
|
+
* @defaultValue false
|
|
19
22
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
search?: boolean
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* Enable floating heading navigation on documentation pages.
|
|
26
|
+
* Hidden when a page has too few sections to navigate.
|
|
27
|
+
* @defaultValue false
|
|
26
28
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
TOC?: boolean
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* Default HTML and social-preview description of the project.
|
|
32
|
+
* This does not replace descriptions authored in documents or the homepage.
|
|
33
|
+
* @defaultValue ''
|
|
33
34
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
description?: string
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* HTML document language, such as 'en' or 'pt-BR'.
|
|
38
|
+
* This does not automatically translate the interface or documentation.
|
|
39
|
+
* @defaultValue 'en'
|
|
40
40
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
lang?: string
|
|
42
|
+
/** Site identity and SEO options. applicationName is required. */
|
|
43
|
+
metadata: RdxMetadata
|
|
44
|
+
/** Optional landing page. Disabled by default; '/' then redirects to '/docs'. */
|
|
45
|
+
homepage?: RdxHomepage
|
|
43
46
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
+
* Activated plugin objects, returned by their factories, e.g. versioning().
|
|
48
|
+
* Installing a package alone does not activate it. Hooks run in this order.
|
|
49
|
+
* @defaultValue []
|
|
47
50
|
*/
|
|
51
|
+
plugins?: RdxPlugin[]
|
|
52
|
+
/** Theme preferences for the shared RDX interface. */
|
|
48
53
|
theme?: {
|
|
49
54
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
55
|
+
* Theme used on first visit, before the user chooses a preference.
|
|
56
|
+
* 'system' follows the operating system's color preference.
|
|
57
|
+
* @defaultValue 'system'
|
|
53
58
|
*/
|
|
54
|
-
defaultTheme
|
|
59
|
+
defaultTheme?: 'system' | 'dark' | 'light'
|
|
55
60
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* Navbar configurations options.
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
navbar: {
|
|
61
|
+
/** Logo, optional label and action buttons in the shared navbar. */
|
|
62
|
+
navbar?: {
|
|
62
63
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* Text beside the logo. Empty or omitted shows only the logo.
|
|
65
|
+
* This does not change metadata.applicationName or browser titles.
|
|
66
|
+
* @defaultValue ''
|
|
66
67
|
*/
|
|
67
68
|
title?: string
|
|
68
|
-
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*/
|
|
76
|
-
logo: ComponentType<{ className?: string }>
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Configuration for navbar action buttons
|
|
80
|
-
*
|
|
70
|
+
* Imported React component accepting an optional className for styling.
|
|
71
|
+
* Pass the component itself, not JSX or an image path. Defaults to the RDX logo.
|
|
72
|
+
* @example
|
|
73
|
+
* logo: MyLogo
|
|
81
74
|
*/
|
|
75
|
+
logo?: ComponentType<{ className?: string }>
|
|
76
|
+
/** Optional GitHub link and theme toggle. Omitted actions remain hidden. */
|
|
82
77
|
actions?: {
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*/
|
|
78
|
+
/** Show the system/light/dark theme switcher in the navbar. */
|
|
79
|
+
showToggleMode?: boolean
|
|
80
|
+
/** Optional repository link. Both visibility and URL must be specified. */
|
|
87
81
|
github?: {
|
|
88
|
-
/**
|
|
89
|
-
* Whether to show the GitHub button in the navbar.
|
|
90
|
-
*
|
|
91
|
-
*/
|
|
82
|
+
/** Whether the repository action is displayed. */
|
|
92
83
|
visible: boolean
|
|
93
84
|
/**
|
|
94
|
-
* URL
|
|
95
|
-
*
|
|
96
|
-
*
|
|
85
|
+
* Absolute HTTP(S) repository URL, or '#' as a temporary placeholder.
|
|
86
|
+
* Real links open in a new tab; the placeholder stays in the current tab.
|
|
97
87
|
*/
|
|
98
88
|
url: string
|
|
99
89
|
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Whether to display the theme toggle (system/dark/light) in the navbar.
|
|
103
|
-
*
|
|
104
|
-
*/
|
|
105
|
-
showToggleMode?: boolean
|
|
106
90
|
}
|
|
107
91
|
}
|
|
108
92
|
}
|
|
109
93
|
|
|
110
|
-
/**
|
|
94
|
+
/** Options for the built-in landing page or a project-owned home.tsx component. */
|
|
111
95
|
export type RdxHomepage = {
|
|
96
|
+
/**
|
|
97
|
+
* Show a homepage at '/'. When false or omitted, '/' redirects to '/docs'.
|
|
98
|
+
* @defaultValue false
|
|
99
|
+
*/
|
|
112
100
|
enabled?: boolean
|
|
113
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Imported React component that owns the homepage body.
|
|
103
|
+
* The shared navbar remains; built-in title, description and buttons are not
|
|
104
|
+
* injected into this component. Used only when enabled is true.
|
|
105
|
+
* @example
|
|
106
|
+
* component: Home // import Home from './home'
|
|
107
|
+
*/
|
|
114
108
|
component?: ComponentType
|
|
109
|
+
/** Built-in homepage heading. Defaults to metadata.applicationName. */
|
|
115
110
|
title?: string
|
|
111
|
+
/** Optional text below the built-in heading; omitted means no description. */
|
|
116
112
|
description?: string
|
|
117
|
-
|
|
113
|
+
/** Buttons below the built-in description. The first button is primary. */
|
|
114
|
+
buttons?: {
|
|
115
|
+
/** Visible button text and accessible name; must not be empty. */
|
|
116
|
+
label: string
|
|
117
|
+
/** Root-relative path or absolute HTTP(S) URL, e.g. '/docs/init/intro'. */
|
|
118
|
+
href: string
|
|
119
|
+
}[]
|
|
118
120
|
}
|
|
119
121
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Site identity and portable Next.js metadata, translated by the RDX runtime.
|
|
124
|
+
* Root-relative asset URLs refer to files the project owns in public/.
|
|
125
|
+
* No asset files, deployment domain or global canonical URL are created here.
|
|
126
|
+
*/
|
|
127
|
+
export type RdxMetadata = {
|
|
128
|
+
/**
|
|
129
|
+
* Absolute HTTP(S) deployment URL used to resolve relative metadata URLs.
|
|
130
|
+
* Set this to the real public site URL when deploying; no domain is assumed.
|
|
131
|
+
* @example 'https://docs.example.com'
|
|
132
|
+
*/
|
|
133
|
+
metadataBase?: string
|
|
134
|
+
/**
|
|
135
|
+
* Required, non-empty site name: the single source of shared branding.
|
|
136
|
+
* Supplies the browser title and page-title suffix, social-preview defaults,
|
|
137
|
+
* footer, accessible logo name and built-in homepage fallback.
|
|
138
|
+
*/
|
|
139
|
+
applicationName: string
|
|
140
|
+
/**
|
|
141
|
+
* Starting year shown in the footer. The CLI fills the project creation year;
|
|
142
|
+
* replace it with an earlier founding year when appropriate. Must be a positive
|
|
143
|
+
* integer no later than the current year. Omit to show only the current year.
|
|
144
|
+
* Equal years are displayed once, e.g. 2026; earlier years form a range.
|
|
145
|
+
*/
|
|
146
|
+
since?: number
|
|
147
|
+
/** Optional people or organizations credited in the document's metadata. */
|
|
148
|
+
authors?: {
|
|
149
|
+
/** Author or organization name; independent of the site's applicationName. */
|
|
150
|
+
name: string
|
|
151
|
+
/** Optional absolute HTTP(S) profile or organization URL. */
|
|
152
|
+
url?: string
|
|
153
|
+
}[]
|
|
154
|
+
/** Optional keywords emitted in the document's metadata. */
|
|
155
|
+
keywords?: string[]
|
|
156
|
+
/** Browser and device icons. Referenced files must exist in public/ or online. */
|
|
157
|
+
icons?: {
|
|
158
|
+
/**
|
|
159
|
+
* Browser tab icon URL, or a list of icons with explicit sizes and MIME types.
|
|
160
|
+
* @example '/favicon.ico'
|
|
161
|
+
*/
|
|
162
|
+
icon?:
|
|
163
|
+
| string
|
|
164
|
+
| {
|
|
165
|
+
/** Root-relative asset path or absolute HTTP(S) image URL. */
|
|
166
|
+
url: string
|
|
167
|
+
/** Icon dimensions, such as '96x96', or 'any' for a scalable icon. */
|
|
168
|
+
sizes?: string
|
|
169
|
+
/** Image MIME type, such as 'image/png' or 'image/svg+xml'. */
|
|
170
|
+
type?: string
|
|
171
|
+
}[]
|
|
172
|
+
/**
|
|
173
|
+
* Traditional shortcut icon link for browser compatibility.
|
|
174
|
+
* @example '/favicon.ico'
|
|
175
|
+
*/
|
|
176
|
+
shortcut?: string
|
|
177
|
+
/**
|
|
178
|
+
* Icon used when adding the site to the home screen on Apple devices.
|
|
179
|
+
* @example '/apple-touch-icon.png'
|
|
180
|
+
*/
|
|
181
|
+
apple?: string
|
|
133
182
|
}
|
|
134
|
-
|
|
183
|
+
/**
|
|
184
|
+
* URL of an existing web app manifest describing the app's name, icons, etc.
|
|
185
|
+
* RDX only emits the link; it does not generate the manifest or enable a PWA.
|
|
186
|
+
* @example '/site.webmanifest'
|
|
187
|
+
*/
|
|
188
|
+
manifest?: string
|
|
189
|
+
/** Optional crawler directives; these do not protect content from access. */
|
|
190
|
+
robots?: {
|
|
191
|
+
/** Whether search engines are instructed to index the page. */
|
|
192
|
+
index?: boolean
|
|
193
|
+
/** Whether search engines are instructed to follow links on the page. */
|
|
194
|
+
follow?: boolean
|
|
195
|
+
}
|
|
196
|
+
/** Optional Open Graph link previews. No fixed URL is applied to every page. */
|
|
197
|
+
openGraph?: {
|
|
198
|
+
/** Preview title override; defaults to metadata.applicationName. */
|
|
135
199
|
title?: string
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
200
|
+
/** Preview description override; defaults to the root description. */
|
|
201
|
+
description?: string
|
|
202
|
+
/** Optional site name shown by platforms that support it. */
|
|
203
|
+
siteName?: string
|
|
204
|
+
/** Open Graph locale, e.g. 'pt_BR' (underscore), unlike HTML lang 'pt-BR'. */
|
|
205
|
+
locale?: string
|
|
206
|
+
/** Supported Open Graph content type for the documentation site. */
|
|
207
|
+
type?: 'website'
|
|
208
|
+
/** Preview images. Relative URLs are resolved against metadataBase. */
|
|
209
|
+
images?: {
|
|
210
|
+
/** Root-relative asset path or absolute HTTP(S) image URL. */
|
|
211
|
+
url: string
|
|
212
|
+
/** Actual image width in pixels; a positive integer. */
|
|
213
|
+
width?: number
|
|
214
|
+
/** Actual image height in pixels; a positive integer. */
|
|
215
|
+
height?: number
|
|
216
|
+
/** Accessible description of the image. */
|
|
217
|
+
alt?: string
|
|
218
|
+
}[]
|
|
219
|
+
}
|
|
220
|
+
/** Optional Twitter/X card metadata. */
|
|
221
|
+
twitter?: {
|
|
222
|
+
/** Text-oriented summary or a large-image preview card. */
|
|
223
|
+
card?: 'summary' | 'summary_large_image'
|
|
224
|
+
/** Card title override; defaults to metadata.applicationName. */
|
|
225
|
+
title?: string
|
|
226
|
+
/** Card description override; defaults to the root description. */
|
|
227
|
+
description?: string
|
|
228
|
+
/** Account associated with the site, usually '@account'. */
|
|
229
|
+
site?: string
|
|
230
|
+
/** Account credited as the creator, usually '@account'. */
|
|
231
|
+
creator?: string
|
|
232
|
+
/** Image URLs; root-relative paths are resolved against metadataBase. */
|
|
233
|
+
images?: string[]
|
|
144
234
|
}
|
|
145
235
|
}
|
|
146
236
|
|
|
147
|
-
/** Compatibility alias for
|
|
148
|
-
export type RdxRuntimeConfig =
|
|
237
|
+
/** Compatibility alias for the first beta; points to the same RDXConfig contract. */
|
|
238
|
+
export type RdxRuntimeConfig = RDXConfig
|
|
149
239
|
|
|
240
|
+
/** Internal configuration after validation and application of RDX defaults. */
|
|
150
241
|
export type ResolvedRdxConfig = Omit<
|
|
151
|
-
|
|
152
|
-
'description' | 'lang' | '
|
|
242
|
+
RDXConfig,
|
|
243
|
+
'description' | 'lang' | 'theme' | 'plugins' | 'TOC' | 'search'
|
|
153
244
|
> & {
|
|
245
|
+
/** Resolved local search activation. */
|
|
154
246
|
search: boolean
|
|
247
|
+
/** Resolved floating heading navigation activation. */
|
|
155
248
|
TOC: boolean
|
|
249
|
+
/** Resolved site description; empty when not provided. */
|
|
156
250
|
description: string
|
|
251
|
+
/** Resolved HTML language; 'en' when not provided. */
|
|
157
252
|
lang: string
|
|
158
|
-
|
|
253
|
+
/** Resolved initial theme preference. */
|
|
159
254
|
theme: { defaultTheme: 'system' | 'dark' | 'light' }
|
|
255
|
+
/** Activated plugins, in declaration order. */
|
|
160
256
|
plugins: RdxPlugin[]
|
|
161
257
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/plugins.d.ts
CHANGED
|
@@ -28,9 +28,9 @@ export type RdxPlugin = {
|
|
|
28
28
|
setup?: (
|
|
29
29
|
context: RdxPluginContext
|
|
30
30
|
) =>
|
|
31
|
-
| { sources?: RdxContentSource[] }
|
|
31
|
+
| { sources?: RdxContentSource[]; runtimeFiles?: string[] }
|
|
32
32
|
| void
|
|
33
|
-
| Promise<{ sources?: RdxContentSource[] } | void>
|
|
33
|
+
| Promise<{ sources?: RdxContentSource[]; runtimeFiles?: string[] } | void>
|
|
34
34
|
commands?: RdxPluginCommand[]
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -39,4 +39,6 @@ export type RdxProject = {
|
|
|
39
39
|
config: ResolvedRdxConfig
|
|
40
40
|
sources: RdxContentSource[]
|
|
41
41
|
commands: RdxPluginCommand[]
|
|
42
|
+
/** Project-relative files plugins need when serving deployed documentation. */
|
|
43
|
+
runtimeFiles: string[]
|
|
42
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lexibase/rdx-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared TypeScript types for RDX documentation projects.",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -32,7 +32,11 @@
|
|
|
32
32
|
"@types/react": "19.3.0",
|
|
33
33
|
"@rdx/typescript-config": "1.0.0"
|
|
34
34
|
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": "^22.18.0 || ^24.11.0"
|
|
37
|
+
},
|
|
35
38
|
"scripts": {
|
|
39
|
+
"dev": "node ./build.mjs --watch",
|
|
36
40
|
"build": "node ./build.mjs",
|
|
37
41
|
"check-types": "tsc --noEmit"
|
|
38
42
|
}
|