Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: build document on all possible target #1433

Closed
wants to merge 2 commits into from
Closed
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
40 changes: 40 additions & 0 deletions .github/workflows/build-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build Docs

on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true

jobs:
doc:
strategy:
fail-fast: false
matrix:
node-version: [20.x, 21.x, 22.x, 23.x]
os: [ubuntu-latest, macos-latest, windows-latest]
name: Build Docs on Node.js ${{ matrix.node-version }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Run Build
run: pnpx turbo run build --filter @llamaindex/doc
22 changes: 7 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Right now, for first-time contributors, these three packages are of the highest

- `packages/llamaindex` which is the main NPM library `llamaindex`
- `examples` is where the demo code lives
- `apps/docs` is where the code for the documentation of https://ts.llamaindex.ai/ is located
- `apps/next` is where the code for the documentation of https://ts.llamaindex.ai/ is located

### Turborepo docs

Expand All @@ -21,14 +21,9 @@ Install NodeJS. Preferably v18 using nvm or n.
Inside the LlamaIndexTS directory:

```
npm i -g pnpm ts-node
pnpm install
```

Note: we use pnpm in this repo, which has a lot of the same functionality and CLI options as npm but it does do some things better in a monorepo, like centralizing dependencies and caching.

PNPM's has documentation on its [workspace feature](https://pnpm.io/workspaces) and Turborepo had some [useful documentation also](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks).

### Running Typescript

When we publish to NPM we will have a tsc compiled version of the library in JS. For now, the easiest thing to do is use ts-node.
Expand Down Expand Up @@ -65,20 +60,17 @@ To install packages for every package or application run
pnpm add -w [NPM Package]
```

### Docs
### Doc

To contribute to the docs, go to the docs website folder and run the Docusaurus instance.
To contribute to the docs, go to the docs website folder and run the Next.js server:

```bash
cd apps/docs
pnpm install
pnpm start
# run this if you are first time
pnpx turbo run build --filter @llamaindex/doc
cd apps/next
pnpm run dev
```

That should start a webserver which will serve the docs on https://localhost:3000

Any changes you make should be reflected in the browser. If you need to regenerate the API docs and find that your TSDoc isn't getting the updates, feel free to remove apps/docs/api. It will automatically regenerate itself when you run pnpm start again.

## Changeset

We use [changesets](https://github.com/changesets/changesets) for managing versions and changelogs. To create a new changeset, run in the root folder:
Expand Down