skrypt-ai 0.3.2 → 0.3.3

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.js CHANGED
@@ -18,7 +18,7 @@ import { loginCommand, logoutCommand, whoamiCommand } from './commands/login.js'
18
18
  import { cronCommand } from './commands/cron.js';
19
19
  import { deployCommand } from './commands/deploy.js';
20
20
  import { testCommand } from './commands/test.js';
21
- const VERSION = '0.3.2';
21
+ const VERSION = '0.3.3';
22
22
  async function checkForUpdates() {
23
23
  try {
24
24
  const res = await fetch('https://registry.npmjs.org/skrypt-ai/latest', {
@@ -1,9 +1,17 @@
1
1
  import { DocsLayout } from '@/components/docs-layout'
2
+ import { readFileSync } from 'fs'
3
+ import { join } from 'path'
4
+
5
+ function getDocsConfig() {
6
+ const configPath = join(process.cwd(), 'docs.json')
7
+ return JSON.parse(readFileSync(configPath, 'utf-8'))
8
+ }
2
9
 
3
10
  export default function Layout({
4
11
  children,
5
12
  }: {
6
13
  children: React.ReactNode
7
14
  }) {
8
- return <DocsLayout>{children}</DocsLayout>
15
+ const docsConfig = getDocsConfig()
16
+ return <DocsLayout docsConfig={docsConfig}>{children}</DocsLayout>
9
17
  }
@@ -6,7 +6,14 @@ import { Header } from './header'
6
6
  import { TableOfContents } from './table-of-contents'
7
7
  import { Breadcrumbs } from './breadcrumbs'
8
8
 
9
- export function DocsLayout({ children }: { children: React.ReactNode }) {
9
+ interface DocsConfig {
10
+ navigation: Array<{
11
+ group: string
12
+ pages: Array<{ title: string; path: string }>
13
+ }>
14
+ }
15
+
16
+ export function DocsLayout({ children, docsConfig }: { children: React.ReactNode; docsConfig: DocsConfig }) {
10
17
  const [menuOpen, setMenuOpen] = useState(false)
11
18
 
12
19
  return (
@@ -19,6 +26,7 @@ export function DocsLayout({ children }: { children: React.ReactNode }) {
19
26
  <Sidebar
20
27
  open={menuOpen}
21
28
  onClose={() => setMenuOpen(false)}
29
+ docsConfig={docsConfig}
22
30
  />
23
31
  <main className="flex-1 min-w-0 px-4 md:px-8 py-6 md:ml-[var(--sidebar-width)] xl:mr-[var(--toc-width)]">
24
32
  <div className="max-w-3xl mx-auto">
@@ -12,37 +12,39 @@ interface NavItem {
12
12
  items?: NavItem[]
13
13
  }
14
14
 
15
- // This will be populated from docs.json
16
- const navigation: NavItem[] = [
17
- {
18
- title: 'Getting Started',
19
- items: [
20
- { title: 'Introduction', href: '/docs' },
21
- { title: 'Installation', href: '/docs/installation' },
22
- { title: 'Quick Start', href: '/docs/quickstart' },
23
- ],
24
- },
25
- {
26
- title: 'API Reference',
27
- items: [
28
- { title: 'Overview', href: '/docs/api' },
29
- { title: 'Authentication', href: '/docs/api/auth' },
30
- { title: 'Endpoints', href: '/docs/api/endpoints' },
31
- ],
32
- },
33
- {
34
- title: 'API Playground',
35
- href: '/reference',
36
- },
37
- ]
15
+ interface NavPage {
16
+ title: string
17
+ path: string
18
+ }
19
+
20
+ interface NavGroup {
21
+ group: string
22
+ pages: NavPage[]
23
+ }
24
+
25
+ interface DocsConfig {
26
+ navigation: NavGroup[]
27
+ }
28
+
29
+ function buildNavigation(config: DocsConfig): NavItem[] {
30
+ return config.navigation.map((group) => ({
31
+ title: group.group,
32
+ items: group.pages.map((page) => ({
33
+ title: page.title,
34
+ href: page.path,
35
+ })),
36
+ }))
37
+ }
38
38
 
39
39
  interface SidebarProps {
40
40
  open?: boolean
41
41
  onClose?: () => void
42
+ docsConfig: DocsConfig
42
43
  }
43
44
 
44
- export function Sidebar({ open, onClose }: SidebarProps) {
45
+ export function Sidebar({ open, onClose, docsConfig }: SidebarProps) {
45
46
  const pathname = usePathname()
47
+ const navigation = buildNavigation(docsConfig)
46
48
 
47
49
  return (
48
50
  <>
@@ -58,7 +60,6 @@ export function Sidebar({ open, onClose }: SidebarProps) {
58
60
  <aside
59
61
  className={cn(
60
62
  'fixed left-0 top-16 bottom-0 w-[var(--sidebar-width)] border-r border-[var(--color-border)] bg-[var(--color-bg)] overflow-y-auto z-50 transition-transform duration-200',
61
- // Mobile: slide in/out
62
63
  'md:translate-x-0',
63
64
  open ? 'translate-x-0' : '-translate-x-full md:translate-x-0'
64
65
  )}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skrypt-ai",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "AI-powered documentation generator with code examples",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",