Skip to content

Commit 79c0e46

Browse files
authored
Astro dev experience (#191)
1 parent 0882cc4 commit 79c0e46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+5731
-145
lines changed

docs/.gitignore

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
11
api-reference
2-
!api-reference/meta.json
2+
!api-reference/meta.json
3+
4+
# build output
5+
dist/
6+
# generated types
7+
.astro/
8+
9+
# dependencies
10+
node_modules/
11+
12+
# logs
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
pnpm-debug.log*
17+
18+
19+
# environment variables
20+
.env
21+
.env.production
22+
.env.local
23+
24+
# macOS-specific files
25+
.DS_Store

docs/astro.config.mjs

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
// @ts-check
2+
import { defineConfig, passthroughImageService } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
import react from '@astrojs/react';
5+
import AutoImport from 'astro-auto-import';
6+
import starlightAutoSidebar from 'starlight-auto-sidebar'
7+
import path from 'path';
8+
9+
// https://astro.build/config
10+
export default defineConfig({
11+
site: "https://developers.llamaindex.ai",
12+
base: "/typescript/",
13+
outDir: path.resolve('./dist/typescript/workflows/'),
14+
integrations: [
15+
starlight({
16+
plugins: [starlightAutoSidebar()],
17+
title: 'LlamaIndex TypeScript Workflows Documentation',
18+
head: [
19+
{
20+
tag: 'script',
21+
content: `
22+
(function (w, d, s, l, i) {
23+
w[l] = w[l] || [];
24+
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
25+
var f = d.getElementsByTagName(s)[0],
26+
j = d.createElement(s),
27+
dl = l != "dataLayer" ? "&l=" + l : "";
28+
j.async = true;
29+
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
30+
f.parentNode.insertBefore(j, f);
31+
})(window, document, "script", "dataLayer", "GTM-WWRFB36R");
32+
`,
33+
},
34+
{
35+
tag: 'script',
36+
content: `
37+
document.addEventListener("DOMContentLoaded", function () {
38+
var script = document.createElement("script");
39+
script.type = "module";
40+
script.id = "runllm-widget-script"
41+
script.src = "https://widget.runllm.com";
42+
script.setAttribute("version", "stable");
43+
script.setAttribute("crossorigin", "true");
44+
script.setAttribute("runllm-keyboard-shortcut", "Mod+j");
45+
script.setAttribute("runllm-name", "LlamaIndex");
46+
script.setAttribute("runllm-position", "BOTTOM_RIGHT");
47+
script.setAttribute("runllm-assistant-id", "209");
48+
script.setAttribute("runllm-disable-ask-a-person", true);
49+
script.setAttribute(
50+
"runllm-slack-community-url",
51+
"https://discord.com/invite/eN6D2HQ4aX"
52+
);
53+
script.async = true;
54+
document.head.appendChild(script);
55+
});
56+
`
57+
}
58+
],
59+
social: [
60+
{
61+
icon: 'twitter',
62+
label: 'Twitter',
63+
href: 'https://x.com/llama_index'
64+
},
65+
{
66+
icon: 'linkedin',
67+
label: 'LinkedIn',
68+
href: 'https://www.linkedin.com/company/llamaindex'
69+
},
70+
{
71+
icon: 'blueSky',
72+
label: 'Bluesky',
73+
href: 'https://bsky.app/profile/llamaindex.bsky.social'
74+
},
75+
{
76+
icon: 'github',
77+
label: 'GitHub',
78+
href: 'https://github.com/run-llama/llama_index/'
79+
}
80+
],
81+
logo: {
82+
light: './src/assets/llamaindex-dark.svg',
83+
dark: './src/assets/llamaindex-light.svg',
84+
replacesTitle: true,
85+
},
86+
favicon: '/logo-dark.png',
87+
components: {
88+
SiteTitle: './src/components/SiteTitle.astro',
89+
Header: './src/components/Header.astro',
90+
},
91+
sidebar: [
92+
{
93+
label: 'Workflows',
94+
autogenerate: { directory: 'workflows', collapsed: true },
95+
},
96+
{
97+
label: 'Workflows API Reference 🔗',
98+
link: '/workflows-api-reference/'
99+
},
100+
],
101+
}),
102+
AutoImport({
103+
imports: [
104+
{
105+
'@icons-pack/react-simple-icons': ['SiBun', 'SiCloudflareworkers', 'SiDeno', 'SiNodedotjs', 'SiTypescript', 'SiVite', 'SiNextdotjs', 'SiDiscord', 'SiGithub', 'SiNpm', 'SiX'],
106+
'@astrojs/starlight/components': ['Card', 'CardGrid', 'LinkCard', 'Icon', 'Tabs', 'TabItem', 'Aside', 'LinkButton']
107+
},
108+
],
109+
}),
110+
react(),
111+
],
112+
image: {
113+
service: passthroughImageService(),
114+
}
115+
});

docs/biome.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
"root": false,
33
"extends": "//",
44
"files": {
5-
"includes": ["src/**", "tests/**"]
5+
"includes": [
6+
"src/**",
7+
"tests/**",
8+
"!src/components",
9+
"!src/content",
10+
"!src/pages",
11+
"!src/content.config.ts"
12+
]
613
},
714
"linter": {
815
"rules": {

docs/package.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
"packageManager": "[email protected]",
77
"scripts": {
88
"test": "vitest run",
9-
"test:watch": "vitest"
9+
"test:watch": "vitest",
10+
"dev": "astro dev",
11+
"start": "astro dev",
12+
"build": "astro build",
13+
"preview": "astro preview",
14+
"astro": "astro"
1015
},
1116
"repository": {
1217
"type": "git",
@@ -26,6 +31,32 @@
2631
"url": "https://github.com/run-llama/workflows-ts/issues"
2732
},
2833
"homepage": "https://github.com/run-llama/workflows-ts/blob/main/examples/README.md",
34+
"dependencies": {
35+
"@astrojs/mdx": "^4.2.6",
36+
"@astrojs/react": "^4.2.7",
37+
"@astrojs/starlight": "^0.34.3",
38+
"@icons-pack/react-simple-icons": "^12.8.0",
39+
"@types/react": "^19.1.4",
40+
"@types/react-dom": "^19.1.5",
41+
"astro": "^5.6.1",
42+
"astro-auto-import": "^0.4.4",
43+
"astro-icon": "^1.1.5",
44+
"cross-env": "^7.0.3",
45+
"dotenv": "^16.4.5",
46+
"fs-extra": "^11.3.0",
47+
"fumadocs-typescript": "^4.0.6",
48+
"fumadocs-ui": "^15.3.3",
49+
"glob": "^11.0.2",
50+
"js-yaml": "^4.1.0",
51+
"marked": "^15.0.11",
52+
"react": "^19.1.0",
53+
"react-dom": "^19.1.0",
54+
"sharp": "^0.32.5",
55+
"starlight-auto-sidebar": "^0.1.2",
56+
"typedoc": "^0.28.4",
57+
"typedoc-plugin-markdown": "^4.6.3",
58+
"typedoc-plugin-merge-modules": "^7.0.0"
59+
},
2960
"devDependencies": {
3061
"@llamaindex/workflow-core": "workspace:*",
3162
"@llamaindex/workflow-otel": "workspace:^",
Lines changed: 22 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)