Skip to content

Commit 3960618

Browse files
authored
chore: create-llama monorepo (#581)
* chore: create-llama monorepo * add root package.json and pnpm workspace * keep e2e inside create-llama * update root package.json * move scripts and dev dependencies of create-llama to root * update e2e test for create-llama package * update lint workflow * update release llama-index-server workflow * update path for test_llama_index_server workflow * remove local lock file * keep lint and format in create-llama * fix: format * update pre-commit * move playwright back to create-llama * disable pnpm for installing generated frontend * use npm for type check * update gitignore * try --ignore-workspace option * Move llama-index-server from packages/python-server to python directory * update CI for python server * Create plenty-spies-tickle.md
1 parent 53e1cd5 commit 3960618

File tree

465 files changed

+633
-1807
lines changed

Some content is hidden

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

465 files changed

+633
-1807
lines changed

.changeset/plenty-spies-tickle.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-llama": patch
3+
---
4+
5+
chore: create-llama monorepo

.github/workflows/e2e.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: E2E Tests
1+
name: E2E Tests for create-llama package
22
on:
33
push:
44
branches: [main]
55
paths-ignore:
6-
- "llama-index-server/**"
6+
- "python/llama-index-server/**"
77
pull_request:
88
branches: [main]
99
paths-ignore:
10-
- "llama-index-server/**"
10+
- "python/llama-index-server/**"
1111

1212
jobs:
1313
e2e-python:
@@ -51,15 +51,15 @@ jobs:
5151

5252
- name: Install Playwright Browsers
5353
run: pnpm exec playwright install --with-deps
54-
working-directory: .
54+
working-directory: packages/create-llama
5555

5656
- name: Build create-llama
5757
run: pnpm run build
58-
working-directory: .
58+
working-directory: packages/create-llama
5959

6060
- name: Install
6161
run: pnpm run pack-install
62-
working-directory: .
62+
working-directory: packages/create-llama
6363

6464
- name: Run Playwright tests for Python
6565
run: pnpm run e2e:python
@@ -70,13 +70,13 @@ jobs:
7070
DATASOURCE: ${{ matrix.datasources }}
7171
PYTHONIOENCODING: utf-8
7272
PYTHONLEGACYWINDOWSSTDIO: utf-8
73-
working-directory: .
73+
working-directory: packages/create-llama
7474

7575
- uses: actions/upload-artifact@v4
7676
if: always()
7777
with:
7878
name: playwright-report-python-${{ matrix.os }}-${{ matrix.frameworks }}-${{ matrix.datasources }}
79-
path: ./playwright-report/
79+
path: packages/create-llama/playwright-report/
8080
overwrite: true
8181
retention-days: 30
8282

@@ -121,15 +121,15 @@ jobs:
121121

122122
- name: Install Playwright Browsers
123123
run: pnpm exec playwright install --with-deps
124-
working-directory: .
124+
working-directory: packages/create-llama
125125

126126
- name: Build create-llama
127127
run: pnpm run build
128-
working-directory: .
128+
working-directory: packages/create-llama
129129

130130
- name: Install
131131
run: pnpm run pack-install
132-
working-directory: .
132+
working-directory: packages/create-llama
133133

134134
- name: Run Playwright tests for TypeScript
135135
run: pnpm run e2e:typescript
@@ -138,12 +138,12 @@ jobs:
138138
LLAMA_CLOUD_API_KEY: ${{ secrets.LLAMA_CLOUD_API_KEY }}
139139
FRAMEWORK: ${{ matrix.frameworks }}
140140
DATASOURCE: ${{ matrix.datasources }}
141-
working-directory: .
141+
working-directory: packages/create-llama
142142

143143
- uses: actions/upload-artifact@v4
144144
if: always()
145145
with:
146146
name: playwright-report-typescript-${{ matrix.os }}-${{ matrix.frameworks }}-${{ matrix.datasources }}-node${{ matrix.node-version }}
147-
path: ./playwright-report/
147+
path: packages/create-llama/playwright-report/
148148
overwrite: true
149149
retention-days: 30

.github/workflows/lint_on_push_or_pull.yml

+2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ jobs:
3535
uses: chartboost/ruff-action@v1
3636
with:
3737
args: "format --check"
38+
src: "python/llama-index-server"
3839

3940
- name: Run Python lint
4041
uses: chartboost/ruff-action@v1
4142
with:
4243
args: "check"
44+
src: "python/llama-index-server"

.github/workflows/release_llama_index_server.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
paths:
8-
- "llama-index-server/**"
8+
- "python/llama-index-server/**"
99
- ".github/workflows/release_llama_index_server.yml"
1010
pull_request:
1111
types:
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
defaults:
2121
run:
22-
working-directory: ./llama-index-server
22+
working-directory: ./python/llama-index-server
2323
if: |
2424
github.event_name == 'push' &&
2525
!startsWith(github.ref, 'refs/heads/release/llama-index-server-v')
@@ -80,7 +80,7 @@ jobs:
8080
runs-on: ubuntu-latest
8181
defaults:
8282
run:
83-
working-directory: ./llama-index-server
83+
working-directory: ./python/llama-index-server
8484
if: |
8585
github.event_name == 'pull_request' &&
8686
github.event.pull_request.merged == true &&
@@ -114,7 +114,7 @@ jobs:
114114
with:
115115
python_version: "3.11"
116116
pypi_token: ${{ secrets.PYPI_TOKEN }}
117-
package_directory: "llama-index-server"
117+
package_directory: "python/llama-index-server"
118118
poetry_install_options: "--without dev"
119119

120120
- name: Create GitHub Release

.github/workflows/test_llama_index_server.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
defaults:
1515
run:
16-
working-directory: llama-index-server
16+
working-directory: python/llama-index-server
1717
strategy:
1818
matrix:
1919
os: [ubuntu-latest, windows-latest]
@@ -50,7 +50,7 @@ jobs:
5050
runs-on: ubuntu-latest
5151
defaults:
5252
run:
53-
working-directory: llama-index-server
53+
working-directory: python/llama-index-server
5454
steps:
5555
- uses: actions/checkout@v4
5656

@@ -82,7 +82,7 @@ jobs:
8282
runs-on: ubuntu-latest
8383
defaults:
8484
run:
85-
working-directory: llama-index-server
85+
working-directory: python/llama-index-server
8686
steps:
8787
- uses: actions/checkout@v4
8888
- name: Install Poetry
@@ -108,4 +108,4 @@ jobs:
108108
uses: actions/upload-artifact@v4
109109
with:
110110
name: llama-index-server
111-
path: llama-index-server/dist/
111+
path: python/llama-index-server/dist/

.gitignore

-26
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ node_modules
66
.pnpm-store
77
.pnp.js
88

9-
# testing
10-
coverage
11-
.coverage
12-
139
# next.js
1410
.next/
1511
out/
@@ -35,31 +31,9 @@ yarn-error.log*
3531
dist/
3632
lib/
3733

38-
# e2e
39-
.cache
40-
test-results/
41-
playwright-report/
42-
blob-report/
43-
playwright/.cache/
44-
.tsbuildinfo
45-
e2e/cache
46-
4734
# intellij
4835
**/.idea
4936

50-
# Python
51-
.mypy_cache/
52-
venv/
53-
.venv/
54-
dist/
55-
.__pycache__
56-
__pycache__
57-
.python-version
58-
.ui
59-
60-
# build artifacts
61-
create-llama-*.tgz
62-
6337
# vscode
6438
.vscode
6539
!.vscode/settings.json

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pnpm format
22
pnpm lint
3-
uvx ruff format --check templates/
3+
uvx ruff format --check packages/create-llama/templates/

package.json

+37-84
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,39 @@
11
{
2-
"name": "create-llama",
3-
"version": "0.5.10",
4-
"description": "Create LlamaIndex-powered apps with one command",
5-
"keywords": [
6-
"rag",
7-
"llamaindex",
8-
"next.js"
9-
],
10-
"repository": {
11-
"type": "git",
12-
"url": "https://github.com/run-llama/create-llama",
13-
"directory": "packages/create-llama"
14-
},
15-
"license": "MIT",
16-
"bin": {
17-
"create-llama": "./dist/index.js"
18-
},
19-
"files": [
20-
"dist"
21-
],
22-
"scripts": {
23-
"build": "bash ./scripts/build.sh",
24-
"build:ncc": "pnpm run clean && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register",
25-
"clean": "rimraf --glob ./dist ./templates/**/__pycache__ ./templates/**/node_modules ./templates/**/poetry.lock",
26-
"dev": "ncc build ./index.ts -w -o dist/",
27-
"e2e": "playwright test",
28-
"e2e:python": "playwright test e2e/shared e2e/python",
29-
"e2e:typescript": "playwright test e2e/shared e2e/typescript",
30-
"format": "prettier --ignore-unknown --cache --check .",
31-
"format:write": "prettier --ignore-unknown --write .",
32-
"lint": "eslint . --ignore-pattern dist --ignore-pattern e2e/cache",
33-
"new-snapshot": "pnpm run build && changeset version --snapshot",
34-
"new-version": "pnpm run build && changeset version",
35-
"pack-install": "bash ./scripts/pack.sh",
36-
"prepare": "husky",
37-
"release": "pnpm run build && changeset publish",
38-
"release-snapshot": "pnpm run build && changeset publish --tag snapshot"
39-
},
40-
"dependencies": {
41-
"@types/async-retry": "1.4.2",
42-
"@types/ci-info": "2.0.0",
43-
"@types/cross-spawn": "6.0.0",
44-
"@types/fs-extra": "11.0.4",
45-
"@types/node": "^20.11.7",
46-
"@types/prompts": "2.4.2",
47-
"@types/tar": "6.1.5",
48-
"@types/validate-npm-package-name": "3.0.0",
49-
"async-retry": "1.3.1",
50-
"async-sema": "3.0.1",
51-
"ci-info": "github:watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540",
52-
"commander": "12.1.0",
53-
"cross-spawn": "7.0.3",
54-
"fast-glob": "3.3.1",
55-
"fs-extra": "11.2.0",
56-
"global-agent": "^3.0.0",
57-
"got": "10.7.0",
58-
"ollama": "^0.5.0",
59-
"ora": "^8.0.1",
60-
"picocolors": "1.0.0",
61-
"prompts": "2.4.2",
62-
"smol-toml": "^1.1.4",
63-
"tar": "6.1.15",
64-
"terminal-link": "^3.0.0",
65-
"update-check": "1.5.4",
66-
"validate-npm-package-name": "3.0.0",
67-
"yaml": "2.4.1"
68-
},
69-
"devDependencies": {
70-
"@changesets/cli": "^2.27.1",
71-
"@playwright/test": "^1.41.1",
72-
"@vercel/ncc": "0.38.1",
73-
"eslint": "^8.56.0",
74-
"eslint-config-prettier": "^8.10.0",
75-
"husky": "^9.0.10",
76-
"prettier": "^3.2.5",
77-
"prettier-plugin-organize-imports": "^3.2.4",
78-
"rimraf": "^5.0.5",
79-
"typescript": "^5.3.3",
80-
"wait-port": "^1.1.0"
81-
},
82-
"packageManager": "[email protected]",
83-
"engines": {
84-
"node": ">=16.14.0"
85-
}
2+
"name": "create-llama-monorepo",
3+
"version": "1.0.0",
4+
"private": true,
5+
"description": "Monorepo for create-llama",
6+
"keywords": [
7+
"rag",
8+
"llamaindex"
9+
],
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/run-llama/create-llama"
13+
},
14+
"license": "MIT",
15+
"workspaces": [
16+
"packages/*"
17+
],
18+
"scripts": {
19+
"prepare": "husky",
20+
"new-snapshot": "pnpm -r build && changeset version --snapshot",
21+
"new-version": "pnpm -r build && changeset version",
22+
"release": "pnpm -r build && changeset publish",
23+
"release-snapshot": "pnpm -r build && changeset publish --tag snapshot",
24+
"build": "pnpm -r --filter create-llama build",
25+
"e2e": "pnpm -r --filter create-llama e2e",
26+
"dev": "pnpm -r --filter create-llama dev",
27+
"format": "pnpm -r --filter create-llama format",
28+
"format:write": "pnpm -r --filter create-llama format:write",
29+
"lint": "pnpm -r --filter create-llama lint"
30+
},
31+
"devDependencies": {
32+
"@changesets/cli": "^2.27.1",
33+
"husky": "^9.0.10"
34+
},
35+
"packageManager": "[email protected]",
36+
"engines": {
37+
"node": ">=16.14.0"
38+
}
8639
}
File renamed without changes.

0 commit comments

Comments
 (0)