Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions .github/workflows/link_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,31 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: yarn install
run: bun install --frozen-lockfile

- name: Install playwright browsers
run: yarn playwright install
run: bunx playwright install

- name: Run crawler
id: crawler
continue-on-error: true
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Running PR workflow: Building and starting local server..."
yarn build
bun run build
sleep 5
yarn start &
sleep 15
bun run start &
sleep 15
export BASE_URL="http://localhost:3000"
else
export BASE_URL="https://www.docs.sei.io/"
fi
echo "Running link checker for ${BASE_URL}"
yarn tsx scripts/checkLinks.ts
bun scripts/checkLinks.ts

- name: Upload broken links artifact
if: steps.crawler.outcome == 'failure'
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/update-trieve-dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,20 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: yarn install
run: bun install --frozen-lockfile

- name: Build Next.js app
run: yarn build
run: bun run build

- name: Run scrape-docs script
run: yarn scrape-docs
run: bun run scrape-docs

- name: Upload to Trieve
run: yarn upload-to-trieve
run: bun run upload-to-trieve
env:
TRIEVE_API_KEY: ${{ secrets.TRIEVE_API_KEY }}
TRIEVE_DATASET_ID: ${{ secrets.TRIEVE_DATASET_ID }}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ node_modules
.DS_Store
.vscode

yarn-error.log

_pagefind/
public/robots.txt
public/sitemap-0.xml
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged
bunx --bun biome check --staged --write --no-errors-on-unmatched
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

25 changes: 0 additions & 25 deletions .prettierrc

This file was deleted.

1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

## Quick Start

Ensure you have `yarn` installed (macOS users can Run `brew install yarn`)
Ensure you have `bun` installed (see [bun.sh](https://bun.sh) for installation instructions)

1. Use `yarn` to install dependencies
2. Use `yarn dev` to run the docs locally.
3. Use `yarn build` to build the docs.
1. Use `bun install` to install dependencies
2. Use `bun dev` to run the docs locally.
3. Use `bun run build` to build the docs.

You should always run `yarn build` before pushing any changes to validate that there are no syntax errors.
You should always run `bun run build` before pushing any changes to validate that there are no syntax errors.

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions app/[[...mdxPath]]/page.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateStaticParamsFor, importPage } from 'nextra/pages';
import { notFound } from 'next/navigation';
import { generateStaticParamsFor, importPage } from 'nextra/pages';
import { useMDXComponents as getMDXComponents } from '../../mdx-components';

export const generateStaticParams = generateStaticParamsFor('mdxPath');
Expand Down Expand Up @@ -80,7 +80,7 @@ export default async function Page(props) {
'@type': 'ListItem',
position: 1,
name: 'Home',
item: siteUrl + '/'
item: `${siteUrl}/`
},
...segments.map((seg, idx) => {
const href = `${siteUrl}/${segments.slice(0, idx + 1).join('/')}`;
Expand Down
18 changes: 8 additions & 10 deletions app/api/llm-md/[...path]/route.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from 'node:fs/promises';
import path from 'node:path';
import { NextResponse } from 'next/server';
import fs from 'fs/promises';
import path from 'path';

export async function GET(request, { params }) {
export async function GET(_request, { params }) {
const { path: segments } = await params;
const docPath = segments.join('/');

Expand All @@ -19,9 +19,7 @@ export async function GET(request, { params }) {
try {
raw = await fs.readFile(filePath, 'utf8');
break;
} catch {
continue;
}
} catch {}
}

if (!raw) {
Expand Down Expand Up @@ -68,7 +66,7 @@ function mdxToMarkdown(source, url) {

// Rebuild with frontmatter including the URL
let md = '---\n';
if (frontmatter) md += frontmatter + '\n';
if (frontmatter) md += `${frontmatter}\n`;
md += `url: ${url}\n`;
md += '---\n\n';
md += result;
Expand Down Expand Up @@ -101,12 +99,12 @@ function convertHtmlTablesToMarkdown(text) {

rows.forEach((row, i) => {
const padded = Array.from({ length: colCount }, (_, j) => row[j] || '');
md += '| ' + padded.join(' | ') + ' |\n';
md += `| ${padded.join(' | ')} |\n`;
if (i === 0) {
md += '| ' + padded.map(() => '---').join(' | ') + ' |\n';
md += `| ${padded.map(() => '---').join(' | ')} |\n`;
}
});

return '\n' + md;
return `\n${md}`;
});
}
Loading
Loading