@lexibase/rdx-types 1.0.0-beta.0 → 1.0.0-beta.2
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 +21 -2
- package/dist/index.d.ts +13 -1
- package/dist/plugins.d.ts +42 -0
- package/package.json +2 -2
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ComponentType } from 'react'
|
|
2
|
+
import type { RdxPlugin } from './plugins'
|
|
2
3
|
|
|
4
|
+
/** @deprecated Legacy development website config. New projects use RdxConfig. */
|
|
3
5
|
export type RDXConfig = {
|
|
4
6
|
/**
|
|
5
7
|
* The title of the documentation site.
|
|
@@ -103,10 +105,13 @@ export type RDXConfig = {
|
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
/**
|
|
107
|
-
export type
|
|
108
|
+
/** Public configuration shared by the CLI, runtime, and plugins. */
|
|
109
|
+
export type RdxConfig = {
|
|
108
110
|
title: string
|
|
109
111
|
description?: string
|
|
112
|
+
lang?: string
|
|
113
|
+
docsDir?: string
|
|
114
|
+
plugins?: RdxPlugin[]
|
|
110
115
|
theme?: {
|
|
111
116
|
defaultTheme?: 'system' | 'dark' | 'light'
|
|
112
117
|
}
|
|
@@ -120,3 +125,17 @@ export type RdxRuntimeConfig = {
|
|
|
120
125
|
}
|
|
121
126
|
}
|
|
122
127
|
}
|
|
128
|
+
|
|
129
|
+
/** Compatibility alias for projects created by the first beta. */
|
|
130
|
+
export type RdxRuntimeConfig = RdxConfig
|
|
131
|
+
|
|
132
|
+
export type ResolvedRdxConfig = Omit<
|
|
133
|
+
RdxConfig,
|
|
134
|
+
'description' | 'lang' | 'docsDir' | 'theme' | 'plugins'
|
|
135
|
+
> & {
|
|
136
|
+
description: string
|
|
137
|
+
lang: string
|
|
138
|
+
docsDir: string
|
|
139
|
+
theme: { defaultTheme: 'system' | 'dark' | 'light' }
|
|
140
|
+
plugins: RdxPlugin[]
|
|
141
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
export { VersionsRaw, MDXLoader, DocLink, DocCategory } from './loaders'
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
RDXConfig,
|
|
4
|
+
RdxConfig,
|
|
5
|
+
RdxRuntimeConfig,
|
|
6
|
+
ResolvedRdxConfig,
|
|
7
|
+
} from './config'
|
|
8
|
+
export {
|
|
9
|
+
RdxContentSource,
|
|
10
|
+
RdxPlugin,
|
|
11
|
+
RdxPluginCommand,
|
|
12
|
+
RdxPluginContext,
|
|
13
|
+
RdxProject,
|
|
14
|
+
} from './plugins'
|
|
3
15
|
export {
|
|
4
16
|
RdxDocCategory,
|
|
5
17
|
RdxDocFrontmatter,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ResolvedRdxConfig } from './config'
|
|
2
|
+
|
|
3
|
+
/** A separate documentation tree exposed below /docs/<routePrefix>. */
|
|
4
|
+
export type RdxContentSource = {
|
|
5
|
+
id: string
|
|
6
|
+
label: string
|
|
7
|
+
docsDir: string
|
|
8
|
+
routePrefix: string
|
|
9
|
+
badge?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type RdxPluginContext = {
|
|
13
|
+
rootDir: string
|
|
14
|
+
command: string
|
|
15
|
+
config: ResolvedRdxConfig
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type RdxPluginCommand = {
|
|
19
|
+
name: string
|
|
20
|
+
description: string
|
|
21
|
+
run: (context: RdxPluginContext & { args: string[] }) => void | Promise<void>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Hooks run only for explicitly configured plugins, in declaration order. */
|
|
25
|
+
export type RdxPlugin = {
|
|
26
|
+
name: string
|
|
27
|
+
apiVersion: 1
|
|
28
|
+
setup?: (
|
|
29
|
+
context: RdxPluginContext
|
|
30
|
+
) =>
|
|
31
|
+
| { sources?: RdxContentSource[] }
|
|
32
|
+
| void
|
|
33
|
+
| Promise<{ sources?: RdxContentSource[] } | void>
|
|
34
|
+
commands?: RdxPluginCommand[]
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type RdxProject = {
|
|
38
|
+
rootDir: string
|
|
39
|
+
config: ResolvedRdxConfig
|
|
40
|
+
sources: RdxContentSource[]
|
|
41
|
+
commands: RdxPluginCommand[]
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lexibase/rdx-types",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Shared TypeScript types for RDX documentation projects.",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"homepage": "https://github.com/lexibase/rdx#readme",
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"react": "^19.1.
|
|
29
|
+
"react": "^19.1.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": "19.1.0",
|