@lexibase/rdx-types 1.0.0-beta.4 → 1.0.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 +196 -99
- package/dist/index.d.ts +2 -1
- package/dist/plugins.d.ts +4 -2
- package/dist/search.d.ts +13 -0
- package/package.json +7 -3
package/dist/config.d.ts
CHANGED
|
@@ -1,153 +1,250 @@
|
|
|
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
18
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
19
|
+
* Enable local documentation search in the navbar.
|
|
20
|
+
* Search uses the project's content sources; no external service is required.
|
|
21
|
+
* @defaultValue false
|
|
10
22
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* A short description of the project.
|
|
15
|
-
* Used for SEO and meta tags.
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
description: string
|
|
19
|
-
|
|
23
|
+
search?: boolean
|
|
20
24
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
25
|
+
* Enable floating heading navigation on documentation pages.
|
|
26
|
+
* Hidden when a page has too few sections to navigate.
|
|
27
|
+
* @defaultValue false
|
|
24
28
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
TOC?: boolean
|
|
27
30
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
+
* Default HTML and social-preview description of the project.
|
|
32
|
+
* This does not replace descriptions authored in documents or the homepage.
|
|
33
|
+
* @defaultValue ''
|
|
31
34
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
description?: string
|
|
34
36
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
37
|
+
* HTML document language, such as 'en' or 'pt-BR'.
|
|
38
|
+
* This does not automatically translate the interface or documentation.
|
|
39
|
+
* @defaultValue 'en'
|
|
38
40
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
41
46
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
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 []
|
|
45
50
|
*/
|
|
51
|
+
plugins?: RdxPlugin[]
|
|
52
|
+
/** Theme preferences for the shared RDX interface. */
|
|
46
53
|
theme?: {
|
|
47
54
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
55
|
+
* Theme used on first visit, before the user chooses a preference.
|
|
56
|
+
* 'system' follows the operating system's color preference.
|
|
57
|
+
* @defaultValue 'system'
|
|
51
58
|
*/
|
|
52
|
-
defaultTheme
|
|
59
|
+
defaultTheme?: 'system' | 'dark' | 'light'
|
|
53
60
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* Navbar configurations options.
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
59
|
-
navbar: {
|
|
61
|
+
/** Logo, optional label and action buttons in the shared navbar. */
|
|
62
|
+
navbar?: {
|
|
60
63
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
+
* Text beside the logo. Empty or omitted shows only the logo.
|
|
65
|
+
* This does not change metadata.applicationName or browser titles.
|
|
66
|
+
* @defaultValue ''
|
|
64
67
|
*/
|
|
65
68
|
title?: string
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* This logo component is injected via `rdx.config.ts` and must be a valid React component.
|
|
69
|
-
* It should accept at least a `className` prop for styling purposes.
|
|
70
|
-
* Consumers of the design system can override the default logo by providing their own component,
|
|
71
|
-
* such as an inline SVG or image-based logo, allowing full customization of branding.
|
|
72
|
-
*
|
|
73
|
-
*/
|
|
74
|
-
logo: ComponentType<{ className?: string }>
|
|
75
|
-
|
|
76
69
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
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
|
|
79
74
|
*/
|
|
75
|
+
logo?: ComponentType<{ className?: string }>
|
|
76
|
+
/** Optional GitHub link and theme toggle. Omitted actions remain hidden. */
|
|
80
77
|
actions?: {
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
*/
|
|
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. */
|
|
85
81
|
github?: {
|
|
86
|
-
/**
|
|
87
|
-
* Whether to show the GitHub button in the navbar.
|
|
88
|
-
*
|
|
89
|
-
*/
|
|
82
|
+
/** Whether the repository action is displayed. */
|
|
90
83
|
visible: boolean
|
|
91
84
|
/**
|
|
92
|
-
* URL
|
|
93
|
-
*
|
|
94
|
-
*
|
|
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.
|
|
95
87
|
*/
|
|
96
88
|
url: string
|
|
97
89
|
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Whether to display the theme toggle (system/dark/light) in the navbar.
|
|
101
|
-
*
|
|
102
|
-
*/
|
|
103
|
-
showToggleMode?: boolean
|
|
104
90
|
}
|
|
105
91
|
}
|
|
106
92
|
}
|
|
107
93
|
|
|
108
|
-
/**
|
|
94
|
+
/** Options for the built-in landing page or a project-owned home.tsx component. */
|
|
109
95
|
export type RdxHomepage = {
|
|
96
|
+
/**
|
|
97
|
+
* Show a homepage at '/'. When false or omitted, '/' redirects to '/docs'.
|
|
98
|
+
* @defaultValue false
|
|
99
|
+
*/
|
|
110
100
|
enabled?: boolean
|
|
111
|
-
/**
|
|
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
|
+
*/
|
|
112
108
|
component?: ComponentType
|
|
109
|
+
/** Built-in homepage heading. Defaults to metadata.applicationName. */
|
|
113
110
|
title?: string
|
|
111
|
+
/** Optional text below the built-in heading; omitted means no description. */
|
|
114
112
|
description?: string
|
|
115
|
-
|
|
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
|
+
}[]
|
|
116
120
|
}
|
|
117
121
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Portable subset of 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
|
+
/** Optional people or organizations credited in the document's metadata. */
|
|
141
|
+
authors?: {
|
|
142
|
+
/** Author or organization name; independent of the site's applicationName. */
|
|
143
|
+
name: string
|
|
144
|
+
/** Optional absolute HTTP(S) profile or organization URL. */
|
|
145
|
+
url?: string
|
|
146
|
+
}[]
|
|
147
|
+
/** Optional keywords emitted in the document's metadata. */
|
|
148
|
+
keywords?: string[]
|
|
149
|
+
/** Browser and device icons. Referenced files must exist in public/ or online. */
|
|
150
|
+
icons?: {
|
|
151
|
+
/**
|
|
152
|
+
* Browser tab icon URL, or a list of icons with explicit sizes and MIME types.
|
|
153
|
+
* @example '/favicon.ico'
|
|
154
|
+
*/
|
|
155
|
+
icon?:
|
|
156
|
+
| string
|
|
157
|
+
| {
|
|
158
|
+
/** Root-relative asset path or absolute HTTP(S) image URL. */
|
|
159
|
+
url: string
|
|
160
|
+
/** Icon dimensions, such as '96x96', or 'any' for a scalable icon. */
|
|
161
|
+
sizes?: string
|
|
162
|
+
/** Image MIME type, such as 'image/png' or 'image/svg+xml'. */
|
|
163
|
+
type?: string
|
|
164
|
+
}[]
|
|
165
|
+
/**
|
|
166
|
+
* Traditional shortcut icon link for browser compatibility.
|
|
167
|
+
* @example '/favicon.ico'
|
|
168
|
+
*/
|
|
169
|
+
shortcut?: string
|
|
170
|
+
/**
|
|
171
|
+
* Icon used when adding the site to the home screen on Apple devices.
|
|
172
|
+
* @example '/apple-touch-icon.png'
|
|
173
|
+
*/
|
|
174
|
+
apple?: string
|
|
127
175
|
}
|
|
128
|
-
|
|
176
|
+
/**
|
|
177
|
+
* URL of an existing web app manifest describing the app's name, icons, etc.
|
|
178
|
+
* RDX only emits the link; it does not generate the manifest or enable a PWA.
|
|
179
|
+
* @example '/site.webmanifest'
|
|
180
|
+
*/
|
|
181
|
+
manifest?: string
|
|
182
|
+
/** Optional crawler directives; these do not protect content from access. */
|
|
183
|
+
robots?: {
|
|
184
|
+
/** Whether search engines are instructed to index the page. */
|
|
185
|
+
index?: boolean
|
|
186
|
+
/** Whether search engines are instructed to follow links on the page. */
|
|
187
|
+
follow?: boolean
|
|
188
|
+
}
|
|
189
|
+
/** Optional Open Graph link previews. No fixed URL is applied to every page. */
|
|
190
|
+
openGraph?: {
|
|
191
|
+
/** Preview title override; defaults to metadata.applicationName. */
|
|
129
192
|
title?: string
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
193
|
+
/** Preview description override; defaults to the root description. */
|
|
194
|
+
description?: string
|
|
195
|
+
/** Optional site name shown by platforms that support it. */
|
|
196
|
+
siteName?: string
|
|
197
|
+
/** Open Graph locale, e.g. 'pt_BR' (underscore), unlike HTML lang 'pt-BR'. */
|
|
198
|
+
locale?: string
|
|
199
|
+
/** Supported Open Graph content type for the documentation site. */
|
|
200
|
+
type?: 'website'
|
|
201
|
+
/** Preview images. Relative URLs are resolved against metadataBase. */
|
|
202
|
+
images?: {
|
|
203
|
+
/** Root-relative asset path or absolute HTTP(S) image URL. */
|
|
204
|
+
url: string
|
|
205
|
+
/** Actual image width in pixels; a positive integer. */
|
|
206
|
+
width?: number
|
|
207
|
+
/** Actual image height in pixels; a positive integer. */
|
|
208
|
+
height?: number
|
|
209
|
+
/** Accessible description of the image. */
|
|
210
|
+
alt?: string
|
|
211
|
+
}[]
|
|
212
|
+
}
|
|
213
|
+
/** Optional Twitter/X card metadata. */
|
|
214
|
+
twitter?: {
|
|
215
|
+
/** Text-oriented summary or a large-image preview card. */
|
|
216
|
+
card?: 'summary' | 'summary_large_image'
|
|
217
|
+
/** Card title override; defaults to metadata.applicationName. */
|
|
218
|
+
title?: string
|
|
219
|
+
/** Card description override; defaults to the root description. */
|
|
220
|
+
description?: string
|
|
221
|
+
/** Account associated with the site, usually '@account'. */
|
|
222
|
+
site?: string
|
|
223
|
+
/** Account credited as the creator, usually '@account'. */
|
|
224
|
+
creator?: string
|
|
225
|
+
/** Image URLs; root-relative paths are resolved against metadataBase. */
|
|
226
|
+
images?: string[]
|
|
138
227
|
}
|
|
139
228
|
}
|
|
140
229
|
|
|
141
|
-
/** Compatibility alias for
|
|
142
|
-
export type RdxRuntimeConfig =
|
|
230
|
+
/** Compatibility alias for the first beta; points to the same RDXConfig contract. */
|
|
231
|
+
export type RdxRuntimeConfig = RDXConfig
|
|
143
232
|
|
|
233
|
+
/** Internal configuration after validation and application of RDX defaults. */
|
|
144
234
|
export type ResolvedRdxConfig = Omit<
|
|
145
|
-
|
|
146
|
-
'description' | 'lang' | '
|
|
235
|
+
RDXConfig,
|
|
236
|
+
'description' | 'lang' | 'theme' | 'plugins' | 'TOC' | 'search'
|
|
147
237
|
> & {
|
|
238
|
+
/** Resolved local search activation. */
|
|
239
|
+
search: boolean
|
|
240
|
+
/** Resolved floating heading navigation activation. */
|
|
241
|
+
TOC: boolean
|
|
242
|
+
/** Resolved site description; empty when not provided. */
|
|
148
243
|
description: string
|
|
244
|
+
/** Resolved HTML language; 'en' when not provided. */
|
|
149
245
|
lang: string
|
|
150
|
-
|
|
246
|
+
/** Resolved initial theme preference. */
|
|
151
247
|
theme: { defaultTheme: 'system' | 'dark' | 'light' }
|
|
248
|
+
/** Activated plugins, in declaration order. */
|
|
152
249
|
plugins: RdxPlugin[]
|
|
153
250
|
}
|
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/dist/search.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Public text only: never serialize filesystem paths or raw MDX. */
|
|
2
|
+
export interface RdxSearchEntry {
|
|
3
|
+
href: string
|
|
4
|
+
title: string
|
|
5
|
+
category: string
|
|
6
|
+
section: string
|
|
7
|
+
text: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface RdxSearchIndex {
|
|
11
|
+
schemaVersion: 1
|
|
12
|
+
entries: RdxSearchEntry[]
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lexibase/rdx-types",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared TypeScript types for RDX documentation projects.",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -26,13 +26,17 @@
|
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://github.com/lexibase/rdx#readme",
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"react": "^19.1
|
|
29
|
+
"react": "^19.3.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/react": "19.
|
|
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
|
}
|