Compare commits

...

2 Commits

Author SHA1 Message Date
Alex Yang aa0301d870 ci: typo 2024-11-04 19:35:54 -08:00
Alex Yang fc29ef8f5d ci: build document on all possible platform 2024-11-04 19:26:26 -08:00
2 changed files with 47 additions and 15 deletions
+40
View File
@@ -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
+7 -15
View File
@@ -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
@@ -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.
@@ -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: