Skip to content

Commit b6ef4db

Browse files
rsbhclaude
andauthored
chore: upgrade @raystack/apsara to 1.0.0-rc.3 (#41)
* chore(chronicle): upgrade @raystack/apsara to 1.0.0-rc.3 Add std-env as direct dep to satisfy nitro under isolated linker. Drop redundant resolve.conditions and alias tslib to its ESM entry to unblock dev SSR with apsara v1's transitive base-ui deps. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(chronicle): migrate apsara v1 API breaking changes - DropdownMenu -> Menu, asChild -> render prop - Tabs.Trigger -> Tabs.Tab - Accordion: drop collapsible prop (always collapsible in v1) - Sidebar.Item as={link} -> render={link} - EmptyState: add required icon prop Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 88286c7 commit b6ef4db

12 files changed

Lines changed: 120 additions & 262 deletions

File tree

bun.lock

Lines changed: 18 additions & 171 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/chronicle/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@opentelemetry/resources": "^2.6.1",
4343
"@opentelemetry/sdk-metrics": "^2.6.1",
4444
"@opentelemetry/semantic-conventions": "^1.40.0",
45-
"@raystack/apsara": "0.55.1",
45+
"@raystack/apsara": "1.0.0-rc.3",
4646
"@shikijs/rehype": "^4.0.2",
4747
"@vitejs/plugin-react": "^6.0.1",
4848
"chalk": "^5.6.2",
@@ -69,6 +69,7 @@
6969
"remark-parse": "^11.0.0",
7070
"satori": "^0.25.0",
7171
"slugify": "^1.6.6",
72+
"std-env": "^4.1.0",
7273
"unified": "^11.0.5",
7374
"unist-util-visit": "^5.1.0",
7475
"vite": "8.0.3",

packages/chronicle/src/components/api/field-row.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function FieldRow({ field, location, editable, value, onChange }: FieldRo
3030
const objValue = (value ?? {}) as Record<string, unknown>
3131
return (
3232
<div className={styles.row}>
33-
<Accordion collapsible className={styles.accordion}>
33+
<Accordion className={styles.accordion}>
3434
<Accordion.Item value={field.name}>
3535
<Accordion.Trigger className={styles.trigger}>{label}</Accordion.Trigger>
3636
<Accordion.Content>

packages/chronicle/src/components/api/field-section.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export function FieldSection({
5757
<div className={styles.separator} />
5858
<Tabs defaultValue="fields" className={styles.tabs}>
5959
<Tabs.List>
60-
<Tabs.Trigger value="fields">Fields</Tabs.Trigger>
61-
<Tabs.Trigger value="json">JSON</Tabs.Trigger>
60+
<Tabs.Tab value="fields">Fields</Tabs.Tab>
61+
<Tabs.Tab value="json">JSON</Tabs.Tab>
6262
</Tabs.List>
6363
<Tabs.Content value="fields">
6464
{fieldsContent}

packages/chronicle/src/components/mdx/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function MdxTabs(props: ComponentProps<typeof Tabs>) {
2020
return <ClientOnly><Tabs {...props} /></ClientOnly>
2121
}
2222
MdxTabs.List = Tabs.List
23-
MdxTabs.Trigger = Tabs.Trigger
23+
MdxTabs.Tab = Tabs.Tab
2424
MdxTabs.Content = Tabs.Content
2525

2626
export const mdxComponents: MDXComponents = {

packages/chronicle/src/pages/NotFound.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { DocumentTextIcon } from '@heroicons/react/24/outline';
12
import { EmptyState } from '@raystack/apsara';
23
import styles from './NotFound.module.css';
34

45
export function NotFound() {
56
return (
67
<EmptyState
8+
icon={<DocumentTextIcon width={32} height={32} />}
79
heading="404"
810
subHeading="Page not found"
911
classNames={{ container: styles.emptyState }}

packages/chronicle/src/server/vite-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export async function createViteConfig(
8686
resolve: {
8787
alias: {
8888
'@': path.resolve(packageRoot, 'src'),
89+
'tslib': 'tslib/tslib.es6.js',
8990
},
90-
conditions: ['module-sync', 'import', 'node'],
9191
dedupe: [
9292
'react',
9393
'react-dom',

packages/chronicle/src/themes/default/ContentDirButtons.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChevronDownIcon } from '@heroicons/react/24/outline';
2-
import { Button, DropdownMenu, Flex } from '@raystack/apsara';
2+
import { Button, Menu, Flex } from '@raystack/apsara';
33
import { Link as RouterLink, useLocation, useNavigate } from 'react-router';
44
import { getLandingEntries } from '@/lib/config';
55
import { getActiveContentDir, splitContentButtons } from '@/lib/navigation';
@@ -36,28 +36,30 @@ export function ContentDirButtons() {
3636
</RouterLink>
3737
))}
3838
{overflow.length > 0 ? (
39-
<DropdownMenu>
40-
<DropdownMenu.Trigger asChild>
41-
<Button
42-
size='small'
43-
variant='outline'
44-
color='neutral'
45-
trailingIcon={<ChevronDownIcon width={14} height={14} />}
46-
>
47-
More
48-
</Button>
49-
</DropdownMenu.Trigger>
50-
<DropdownMenu.Content>
39+
<Menu>
40+
<Menu.Trigger
41+
render={
42+
<Button
43+
size='small'
44+
variant='outline'
45+
color='neutral'
46+
trailingIcon={<ChevronDownIcon width={14} height={14} />}
47+
/>
48+
}
49+
>
50+
More
51+
</Menu.Trigger>
52+
<Menu.Content>
5153
{overflow.map(entry => (
52-
<DropdownMenu.Item
54+
<Menu.Item
5355
key={entry.href}
5456
onClick={() => navigate(entry.href)}
5557
>
5658
{entry.label}
57-
</DropdownMenu.Item>
59+
</Menu.Item>
5860
))}
59-
</DropdownMenu.Content>
60-
</DropdownMenu>
61+
</Menu.Content>
62+
</Menu>
6163
) : null}
6264
</Flex>
6365
);

packages/chronicle/src/themes/default/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function SidebarNode({
162162
href={href}
163163
active={isActive}
164164
leadingIcon={icon ?? undefined}
165-
as={link}
165+
render={link}
166166
>
167167
{item.name}
168168
</Sidebar.Item>
Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ChevronDownIcon } from '@heroicons/react/24/outline';
2-
import { Badge, Button, DropdownMenu, Flex } from '@raystack/apsara';
2+
import { Badge, Button, Menu, Flex } from '@raystack/apsara';
33
import { useNavigate } from 'react-router';
44
import { getAllVersions } from '@/lib/config';
55
import { getVersionHomeHref } from '@/lib/navigation';
@@ -17,27 +17,29 @@ export function VersionSwitcher() {
1717
);
1818

1919
return (
20-
<DropdownMenu>
21-
<DropdownMenu.Trigger asChild>
22-
<Button
23-
size='small'
24-
variant='outline'
25-
color='neutral'
26-
trailingIcon={<ChevronDownIcon width={14} height={14} />}
27-
>
28-
<Flex gap='small' align='center'>
29-
{active?.label ?? 'Version'}
30-
{active?.badge ? (
31-
<Badge variant={active.badge.variant} size='micro'>
32-
{active.badge.label}
33-
</Badge>
34-
) : null}
35-
</Flex>
36-
</Button>
37-
</DropdownMenu.Trigger>
38-
<DropdownMenu.Content>
20+
<Menu>
21+
<Menu.Trigger
22+
render={
23+
<Button
24+
size='small'
25+
variant='outline'
26+
color='neutral'
27+
trailingIcon={<ChevronDownIcon width={14} height={14} />}
28+
/>
29+
}
30+
>
31+
<Flex gap='small' align='center'>
32+
{active?.label ?? 'Version'}
33+
{active?.badge ? (
34+
<Badge variant={active.badge.variant} size='micro'>
35+
{active.badge.label}
36+
</Badge>
37+
) : null}
38+
</Flex>
39+
</Menu.Trigger>
40+
<Menu.Content>
3941
{versions.map(v => (
40-
<DropdownMenu.Item
42+
<Menu.Item
4143
key={v.dir ?? '_latest'}
4244
onClick={() => navigate(getVersionHomeHref(config, v.dir))}
4345
>
@@ -49,9 +51,9 @@ export function VersionSwitcher() {
4951
</Badge>
5052
) : null}
5153
</Flex>
52-
</DropdownMenu.Item>
54+
</Menu.Item>
5355
))}
54-
</DropdownMenu.Content>
55-
</DropdownMenu>
56+
</Menu.Content>
57+
</Menu>
5658
);
5759
}

0 commit comments

Comments
 (0)