@raystack/chronicle 0.1.0-canary.5a2be79
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/bin/chronicle.js +2 -0
- package/dist/cli/index.js +9980 -0
- package/next.config.mjs +10 -0
- package/package.json +63 -0
- package/source.config.ts +50 -0
- package/src/app/[[...slug]]/layout.tsx +15 -0
- package/src/app/[[...slug]]/page.tsx +57 -0
- package/src/app/api/apis-proxy/route.ts +59 -0
- package/src/app/api/health/route.ts +3 -0
- package/src/app/api/search/route.ts +90 -0
- package/src/app/apis/[[...slug]]/layout.module.css +22 -0
- package/src/app/apis/[[...slug]]/layout.tsx +26 -0
- package/src/app/apis/[[...slug]]/page.tsx +57 -0
- package/src/app/layout.tsx +26 -0
- package/src/app/llms-full.txt/route.ts +18 -0
- package/src/app/llms.txt/route.ts +15 -0
- package/src/app/providers.tsx +8 -0
- package/src/cli/commands/build.ts +32 -0
- package/src/cli/commands/dev.ts +33 -0
- package/src/cli/commands/init.ts +155 -0
- package/src/cli/commands/serve.ts +53 -0
- package/src/cli/commands/start.ts +33 -0
- package/src/cli/index.ts +21 -0
- package/src/cli/utils/config.ts +43 -0
- package/src/cli/utils/index.ts +3 -0
- package/src/cli/utils/process.ts +7 -0
- package/src/cli/utils/resolve.ts +4 -0
- package/src/cli/utils/scaffold.ts +131 -0
- package/src/components/api/code-snippets.module.css +7 -0
- package/src/components/api/code-snippets.tsx +76 -0
- package/src/components/api/endpoint-page.module.css +58 -0
- package/src/components/api/endpoint-page.tsx +283 -0
- package/src/components/api/field-row.module.css +126 -0
- package/src/components/api/field-row.tsx +204 -0
- package/src/components/api/field-section.module.css +24 -0
- package/src/components/api/field-section.tsx +100 -0
- package/src/components/api/index.ts +8 -0
- package/src/components/api/json-editor.module.css +9 -0
- package/src/components/api/json-editor.tsx +61 -0
- package/src/components/api/key-value-editor.module.css +13 -0
- package/src/components/api/key-value-editor.tsx +62 -0
- package/src/components/api/method-badge.module.css +4 -0
- package/src/components/api/method-badge.tsx +29 -0
- package/src/components/api/response-panel.module.css +8 -0
- package/src/components/api/response-panel.tsx +44 -0
- package/src/components/common/breadcrumb.tsx +3 -0
- package/src/components/common/button.tsx +3 -0
- package/src/components/common/callout.module.css +7 -0
- package/src/components/common/callout.tsx +27 -0
- package/src/components/common/code-block.tsx +3 -0
- package/src/components/common/dialog.tsx +3 -0
- package/src/components/common/index.ts +10 -0
- package/src/components/common/input-field.tsx +3 -0
- package/src/components/common/sidebar.tsx +3 -0
- package/src/components/common/switch.tsx +3 -0
- package/src/components/common/table.tsx +3 -0
- package/src/components/common/tabs.tsx +3 -0
- package/src/components/mdx/code.module.css +42 -0
- package/src/components/mdx/code.tsx +27 -0
- package/src/components/mdx/details.module.css +37 -0
- package/src/components/mdx/details.tsx +18 -0
- package/src/components/mdx/image.tsx +38 -0
- package/src/components/mdx/index.tsx +35 -0
- package/src/components/mdx/link.tsx +38 -0
- package/src/components/mdx/mermaid.module.css +9 -0
- package/src/components/mdx/mermaid.tsx +37 -0
- package/src/components/mdx/paragraph.module.css +8 -0
- package/src/components/mdx/paragraph.tsx +19 -0
- package/src/components/mdx/table.tsx +40 -0
- package/src/components/ui/breadcrumbs.tsx +72 -0
- package/src/components/ui/client-theme-switcher.tsx +18 -0
- package/src/components/ui/footer.module.css +27 -0
- package/src/components/ui/footer.tsx +30 -0
- package/src/components/ui/search.module.css +104 -0
- package/src/components/ui/search.tsx +202 -0
- package/src/lib/api-routes.ts +120 -0
- package/src/lib/config.ts +55 -0
- package/src/lib/get-llm-text.ts +10 -0
- package/src/lib/index.ts +2 -0
- package/src/lib/openapi.ts +188 -0
- package/src/lib/remark-unused-directives.ts +30 -0
- package/src/lib/schema.ts +99 -0
- package/src/lib/snippet-generators.ts +87 -0
- package/src/lib/source.ts +67 -0
- package/src/themes/default/Layout.module.css +81 -0
- package/src/themes/default/Layout.tsx +133 -0
- package/src/themes/default/Page.module.css +46 -0
- package/src/themes/default/Page.tsx +21 -0
- package/src/themes/default/Toc.module.css +48 -0
- package/src/themes/default/Toc.tsx +66 -0
- package/src/themes/default/font.ts +6 -0
- package/src/themes/default/index.ts +13 -0
- package/src/themes/paper/ChapterNav.module.css +71 -0
- package/src/themes/paper/ChapterNav.tsx +96 -0
- package/src/themes/paper/Layout.module.css +33 -0
- package/src/themes/paper/Layout.tsx +25 -0
- package/src/themes/paper/Page.module.css +174 -0
- package/src/themes/paper/Page.tsx +107 -0
- package/src/themes/paper/ReadingProgress.module.css +132 -0
- package/src/themes/paper/ReadingProgress.tsx +294 -0
- package/src/themes/paper/index.ts +8 -0
- package/src/themes/registry.ts +14 -0
- package/src/types/config.ts +69 -0
- package/src/types/content.ts +35 -0
- package/src/types/index.ts +3 -0
- package/src/types/theme.ts +22 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Theme } from '@/types'
|
|
2
|
+
import { defaultTheme } from './default'
|
|
3
|
+
import { paperTheme } from './paper'
|
|
4
|
+
|
|
5
|
+
const themes: Record<string, Theme> = {
|
|
6
|
+
default: defaultTheme,
|
|
7
|
+
paper: paperTheme,
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function getTheme(name?: string): Theme {
|
|
11
|
+
if (!name || !themes[name]) return defaultTheme
|
|
12
|
+
|
|
13
|
+
return themes[name]
|
|
14
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface ChronicleConfig {
|
|
2
|
+
title: string
|
|
3
|
+
description?: string
|
|
4
|
+
logo?: LogoConfig
|
|
5
|
+
theme?: ThemeConfig
|
|
6
|
+
navigation?: NavigationConfig
|
|
7
|
+
search?: SearchConfig
|
|
8
|
+
footer?: FooterConfig
|
|
9
|
+
api?: ApiConfig[]
|
|
10
|
+
llms?: LlmsConfig
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface LlmsConfig {
|
|
14
|
+
enabled?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ApiConfig {
|
|
18
|
+
name: string
|
|
19
|
+
spec: string
|
|
20
|
+
basePath: string
|
|
21
|
+
server: ApiServerConfig
|
|
22
|
+
auth?: ApiAuthConfig
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ApiServerConfig {
|
|
26
|
+
url: string
|
|
27
|
+
description?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ApiAuthConfig {
|
|
31
|
+
type: string
|
|
32
|
+
header: string
|
|
33
|
+
placeholder?: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface LogoConfig {
|
|
37
|
+
light?: string
|
|
38
|
+
dark?: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ThemeConfig {
|
|
42
|
+
name: 'default' | 'paper'
|
|
43
|
+
colors?: Record<string, string>
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface NavigationConfig {
|
|
47
|
+
links?: NavLink[]
|
|
48
|
+
social?: SocialLink[]
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface NavLink {
|
|
52
|
+
label: string
|
|
53
|
+
href: string
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SocialLink {
|
|
57
|
+
type: 'github' | 'twitter' | 'discord' | string
|
|
58
|
+
href: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface SearchConfig {
|
|
62
|
+
enabled?: boolean
|
|
63
|
+
placeholder?: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface FooterConfig {
|
|
67
|
+
copyright?: string
|
|
68
|
+
links?: NavLink[]
|
|
69
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface Frontmatter {
|
|
4
|
+
title: string
|
|
5
|
+
description?: string
|
|
6
|
+
order?: number
|
|
7
|
+
icon?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface Page {
|
|
11
|
+
slug: string[]
|
|
12
|
+
frontmatter: Frontmatter
|
|
13
|
+
content: ReactNode
|
|
14
|
+
toc: TocItem[]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface TocItem {
|
|
18
|
+
title: string
|
|
19
|
+
url: string
|
|
20
|
+
depth: number
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface PageTreeItem {
|
|
24
|
+
type: 'page' | 'folder' | 'separator'
|
|
25
|
+
name: string
|
|
26
|
+
url?: string
|
|
27
|
+
order?: number
|
|
28
|
+
icon?: string
|
|
29
|
+
children?: PageTreeItem[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface PageTree {
|
|
33
|
+
name: string
|
|
34
|
+
children: PageTreeItem[]
|
|
35
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
import type { ChronicleConfig } from './config'
|
|
3
|
+
import type { Page, PageTree } from './content'
|
|
4
|
+
|
|
5
|
+
export interface ThemeLayoutProps {
|
|
6
|
+
children: ReactNode
|
|
7
|
+
config: ChronicleConfig
|
|
8
|
+
tree: PageTree
|
|
9
|
+
classNames?: { layout?: string; body?: string; sidebar?: string; content?: string }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ThemePageProps {
|
|
13
|
+
page: Page
|
|
14
|
+
config: ChronicleConfig
|
|
15
|
+
tree: PageTree
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Theme {
|
|
19
|
+
Layout: React.ComponentType<ThemeLayoutProps>
|
|
20
|
+
Page: React.ComponentType<ThemePageProps>
|
|
21
|
+
className?: string
|
|
22
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": false,
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"declarationMap": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"inlineSources": false,
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"noUnusedLocals": false,
|
|
11
|
+
"noUnusedParameters": false,
|
|
12
|
+
"preserveWatchOutput": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"strict": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"module": "ESNext",
|
|
17
|
+
"target": "es6",
|
|
18
|
+
"outDir": "dist",
|
|
19
|
+
"rootDir": ".",
|
|
20
|
+
"baseUrl": ".",
|
|
21
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
22
|
+
"moduleResolution": "bundler",
|
|
23
|
+
"paths": {
|
|
24
|
+
"@/*": ["./src/*"],
|
|
25
|
+
"@/.source/*": ["./.source/*"]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"include": ["src", ".source", "source.config.ts"],
|
|
29
|
+
"exclude": ["node_modules", "dist"]
|
|
30
|
+
}
|