@raystack/chronicle 0.3.0 → 0.4.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/cli/index.js +289 -9931
- package/package.json +20 -12
- package/src/cli/commands/build.ts +28 -31
- package/src/cli/commands/dev.ts +24 -31
- package/src/cli/commands/init.ts +38 -132
- package/src/cli/commands/serve.ts +36 -55
- package/src/cli/commands/start.ts +20 -31
- package/src/cli/index.ts +14 -14
- package/src/cli/utils/config.ts +25 -26
- package/src/cli/utils/index.ts +3 -3
- package/src/cli/utils/resolve.ts +7 -3
- package/src/cli/utils/scaffold.ts +11 -130
- package/src/components/mdx/code.tsx +10 -1
- package/src/components/mdx/details.module.css +1 -26
- package/src/components/mdx/details.tsx +2 -3
- package/src/components/mdx/image.tsx +5 -34
- package/src/components/mdx/index.tsx +15 -1
- package/src/components/mdx/link.tsx +18 -15
- package/src/components/ui/breadcrumbs.tsx +8 -42
- package/src/components/ui/search.tsx +63 -51
- package/src/lib/api-routes.ts +6 -8
- package/src/lib/config.ts +12 -36
- package/src/lib/head.tsx +49 -0
- package/src/lib/openapi.ts +8 -8
- package/src/lib/page-context.tsx +111 -0
- package/src/lib/remark-strip-md-extensions.ts +14 -0
- package/src/lib/source.ts +139 -63
- package/src/pages/ApiLayout.tsx +33 -0
- package/src/pages/ApiPage.tsx +73 -0
- package/src/pages/DocsLayout.tsx +18 -0
- package/src/pages/DocsPage.tsx +43 -0
- package/src/pages/NotFound.tsx +17 -0
- package/src/server/App.tsx +72 -0
- package/src/server/api/apis-proxy.ts +69 -0
- package/src/server/api/health.ts +5 -0
- package/src/server/api/page/[...slug].ts +18 -0
- package/src/server/api/search.ts +118 -0
- package/src/server/api/specs.ts +9 -0
- package/src/server/build-search-index.ts +117 -0
- package/src/server/entry-client.tsx +88 -0
- package/src/server/entry-server.tsx +102 -0
- package/src/server/routes/llms.txt.ts +21 -0
- package/src/server/routes/og.tsx +75 -0
- package/src/server/routes/robots.txt.ts +11 -0
- package/src/server/routes/sitemap.xml.ts +40 -0
- package/src/server/utils/safe-path.ts +17 -0
- package/src/server/vite-config.ts +129 -0
- package/src/themes/default/Layout.tsx +78 -48
- package/src/themes/default/Page.module.css +44 -0
- package/src/themes/default/Page.tsx +9 -11
- package/src/themes/default/Toc.tsx +25 -39
- package/src/themes/default/index.ts +7 -9
- package/src/themes/paper/ChapterNav.tsx +64 -45
- package/src/themes/paper/Layout.module.css +1 -1
- package/src/themes/paper/Layout.tsx +24 -12
- package/src/themes/paper/Page.module.css +16 -4
- package/src/themes/paper/Page.tsx +56 -63
- package/src/themes/paper/ReadingProgress.tsx +160 -139
- package/src/themes/paper/index.ts +5 -5
- package/src/themes/registry.ts +14 -7
- package/src/types/content.ts +5 -21
- package/src/types/globals.d.ts +4 -0
- package/src/types/theme.ts +4 -3
- package/tsconfig.json +2 -3
- package/next.config.mjs +0 -10
- package/source.config.ts +0 -51
- package/src/app/[[...slug]]/layout.tsx +0 -15
- package/src/app/[[...slug]]/page.tsx +0 -106
- package/src/app/api/apis-proxy/route.ts +0 -59
- package/src/app/api/health/route.ts +0 -3
- package/src/app/api/search/route.ts +0 -90
- package/src/app/apis/[[...slug]]/layout.tsx +0 -26
- package/src/app/apis/[[...slug]]/page.tsx +0 -117
- package/src/app/layout.tsx +0 -57
- package/src/app/llms-full.txt/route.ts +0 -18
- package/src/app/llms.txt/route.ts +0 -15
- package/src/app/og/route.tsx +0 -62
- package/src/app/providers.tsx +0 -8
- package/src/app/robots.ts +0 -10
- package/src/app/sitemap.ts +0 -29
- package/src/cli/utils/process.ts +0 -7
- package/src/themes/default/font.ts +0 -6
- /package/src/{app/apis/[[...slug]]/layout.module.css → pages/ApiLayout.module.css} +0 -0
package/src/app/og/route.tsx
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { ImageResponse } from 'next/og'
|
|
2
|
-
import type { NextRequest } from 'next/server'
|
|
3
|
-
import { loadConfig } from '@/lib/config'
|
|
4
|
-
|
|
5
|
-
export async function GET(request: NextRequest) {
|
|
6
|
-
const { searchParams } = request.nextUrl
|
|
7
|
-
const title = searchParams.get('title') ?? loadConfig().title
|
|
8
|
-
const description = searchParams.get('description') ?? ''
|
|
9
|
-
const siteName = loadConfig().title
|
|
10
|
-
|
|
11
|
-
return new ImageResponse(
|
|
12
|
-
(
|
|
13
|
-
<div
|
|
14
|
-
style={{
|
|
15
|
-
height: '100%',
|
|
16
|
-
width: '100%',
|
|
17
|
-
display: 'flex',
|
|
18
|
-
flexDirection: 'column',
|
|
19
|
-
justifyContent: 'center',
|
|
20
|
-
padding: '60px 80px',
|
|
21
|
-
backgroundColor: '#0a0a0a',
|
|
22
|
-
color: '#fafafa',
|
|
23
|
-
}}
|
|
24
|
-
>
|
|
25
|
-
<div
|
|
26
|
-
style={{
|
|
27
|
-
fontSize: 24,
|
|
28
|
-
color: '#888',
|
|
29
|
-
marginBottom: 16,
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
{siteName}
|
|
33
|
-
</div>
|
|
34
|
-
<div
|
|
35
|
-
style={{
|
|
36
|
-
fontSize: 56,
|
|
37
|
-
fontWeight: 700,
|
|
38
|
-
lineHeight: 1.2,
|
|
39
|
-
marginBottom: 24,
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
{title}
|
|
43
|
-
</div>
|
|
44
|
-
{description && (
|
|
45
|
-
<div
|
|
46
|
-
style={{
|
|
47
|
-
fontSize: 24,
|
|
48
|
-
color: '#999',
|
|
49
|
-
lineHeight: 1.4,
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
{description}
|
|
53
|
-
</div>
|
|
54
|
-
)}
|
|
55
|
-
</div>
|
|
56
|
-
),
|
|
57
|
-
{
|
|
58
|
-
width: 1200,
|
|
59
|
-
height: 630,
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
}
|
package/src/app/providers.tsx
DELETED
package/src/app/robots.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { MetadataRoute } from 'next'
|
|
2
|
-
import { loadConfig } from '@/lib/config'
|
|
3
|
-
|
|
4
|
-
export default function robots(): MetadataRoute.Robots {
|
|
5
|
-
const config = loadConfig()
|
|
6
|
-
return {
|
|
7
|
-
rules: { userAgent: '*', allow: '/' },
|
|
8
|
-
...(config.url && { sitemap: `${config.url}/sitemap.xml` }),
|
|
9
|
-
}
|
|
10
|
-
}
|
package/src/app/sitemap.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { MetadataRoute } from 'next'
|
|
2
|
-
import { loadConfig } from '@/lib/config'
|
|
3
|
-
import { source } from '@/lib/source'
|
|
4
|
-
import { loadApiSpecs } from '@/lib/openapi'
|
|
5
|
-
import { buildApiRoutes } from '@/lib/api-routes'
|
|
6
|
-
|
|
7
|
-
export default function sitemap(): MetadataRoute.Sitemap {
|
|
8
|
-
const config = loadConfig()
|
|
9
|
-
if (!config.url) return []
|
|
10
|
-
|
|
11
|
-
const baseUrl = config.url.replace(/\/$/, '')
|
|
12
|
-
|
|
13
|
-
const docPages = source.getPages().map((page) => ({
|
|
14
|
-
url: `${baseUrl}/${page.slugs.join('/')}`,
|
|
15
|
-
...(page.data.lastModified && { lastModified: new Date(page.data.lastModified) }),
|
|
16
|
-
}))
|
|
17
|
-
|
|
18
|
-
const apiPages = config.api?.length
|
|
19
|
-
? buildApiRoutes(loadApiSpecs(config.api)).map((route) => ({
|
|
20
|
-
url: `${baseUrl}/apis/${route.slug.join('/')}`,
|
|
21
|
-
}))
|
|
22
|
-
: []
|
|
23
|
-
|
|
24
|
-
return [
|
|
25
|
-
{ url: baseUrl },
|
|
26
|
-
...docPages,
|
|
27
|
-
...apiPages,
|
|
28
|
-
]
|
|
29
|
-
}
|
package/src/cli/utils/process.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ChildProcess } from 'child_process'
|
|
2
|
-
|
|
3
|
-
export function attachLifecycleHandlers(child: ChildProcess) {
|
|
4
|
-
child.on('close', (code) => process.exit(code ?? 0))
|
|
5
|
-
process.on('SIGINT', () => child.kill('SIGINT'))
|
|
6
|
-
process.on('SIGTERM', () => child.kill('SIGTERM'))
|
|
7
|
-
}
|
|
File without changes
|