-
Notifications
You must be signed in to change notification settings - Fork 183
chore: create-llama monorepo #581
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
Conversation
🦋 Changeset detectedLatest commit: 1eb52e6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis update restructures the repository into a monorepo centered around the "create-llama" package. The root Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Monorepo Root
participant CreateLlamaPkg
participant GitHub Actions
Developer->>Monorepo Root: Runs workspace script (e.g., build, lint)
Monorepo Root->>CreateLlamaPkg: Delegates command to package via pnpm workspace
CreateLlamaPkg-->>Monorepo Root: Executes package-specific logic
Developer->>GitHub Actions: Pushes code / opens PR
GitHub Actions->>Monorepo Root: Triggers workflow
GitHub Actions->>CreateLlamaPkg: Runs tests/lint/build in subdirectory
CreateLlamaPkg-->>GitHub Actions: Returns results/artifacts
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (6)
packages/create-llama/.gitignore (2)
54-56
: Fix duplicate and unusual Python cache patternsThere are a couple of issues with the Python ignore patterns:
dist/
is duplicated (already appears on line 35).__pycache__
(line 55) has an unusual leading dot - the standard pattern is just__pycache__
# Python .mypy_cache/ venv/ .venv/ -dist/ -.__pycache__ __pycache__
1-62
: Add newline at end of fileThe file is missing a trailing newline at the end, which is a common best practice for text files.
Make sure the file ends with a newline character.
packages/create-llama/package.json (2)
51-57
: Consider pinning dependency versions for better stabilitySeveral dependencies use caret ranges (
^
) which could introduce breaking changes in minor version updates:
global-agent: ^3.0.0
ollama: ^0.5.0
ora: ^8.0.1
smol-toml: ^1.1.4
terminal-link: ^3.0.0
For a production CLI tool, consider pinning to exact versions for better stability.
22-34
: Consider adding a general 'test' scriptThe
scripts
section is comprehensive with specific e2e test scripts, but there's no generaltest
script that users can run withnpm test
. Consider adding one that runs all tests."scripts": { "build": "bash ./scripts/build.sh", "build:ncc": "pnpm run clean && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register", "clean": "rimraf --glob ./dist ./templates/**/__pycache__ ./templates/**/node_modules ./templates/**/poetry.lock", "dev": "ncc build ./index.ts -w -o dist/", "e2e": "playwright test", "e2e:python": "playwright test e2e/shared e2e/python", "e2e:typescript": "playwright test e2e/shared e2e/typescript", + "test": "pnpm run e2e", "format": "prettier --ignore-unknown --cache --check .", "format:write": "prettier --ignore-unknown --write .", "lint": "eslint . --ignore-pattern dist --ignore-pattern e2e/cache", "pack-install": "bash ./scripts/pack.sh" },
.github/workflows/e2e.yml (1)
54-73
: Suggest DRY-up repeated working-directory settings
You could reduce duplication by leveraging:jobs: e2e-python: defaults: run: shell: bash working-directory: packages/create-llama # ...Then omit
working-directory
in individual steps. This simplifies the workflow and eases future maintenance.Also applies to: 124-142
package.json (1)
6-9
: Keywords set; consider adding more
The tags"rag"
and"llamaindex"
fit the context. Optionally, you might include"monorepo"
or"pnpm-workspace"
to improve discoverability.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
packages/create-llama/templates/components/agents/python/form_filling/sec_10k_template.csv
is excluded by!**/*.csv
packages/create-llama/templates/components/agents/typescript/form_filling/sec_10k_template.csv
is excluded by!**/*.csv
packages/create-llama/templates/components/data/101.pdf
is excluded by!**/*.pdf
📒 Files selected for processing (11)
.changeset/plenty-spies-tickle.md
(1 hunks).github/workflows/e2e.yml
(5 hunks).github/workflows/lint_on_push_or_pull.yml
(1 hunks).github/workflows/release_llama_index_server.yml
(4 hunks).github/workflows/test_llama_index_server.yml
(4 hunks).gitignore
(0 hunks).husky/pre-commit
(1 hunks)package.json
(1 hunks)packages/create-llama/.gitignore
(1 hunks)packages/create-llama/e2e/typescript/resolve_dependencies.spec.ts
(1 hunks)packages/create-llama/package.json
(1 hunks)
💤 Files with no reviewable changes (1)
- .gitignore
⏰ Context from checks skipped due to timeout of 90000ms (25)
- GitHub Check: typescript (22, 3.11, ubuntu-22.04, nextjs, --llamacloud)
- GitHub Check: typescript (22, 3.11, ubuntu-22.04, nextjs, --example-file)
- GitHub Check: typescript (22, 3.11, ubuntu-22.04, nextjs, --no-files)
- GitHub Check: typescript (22, 3.11, windows-latest, nextjs, --llamacloud)
- GitHub Check: typescript (22, 3.11, windows-latest, nextjs, --example-file)
- GitHub Check: typescript (22, 3.11, windows-latest, nextjs, --no-files)
- GitHub Check: typescript (22, 3.11, macos-latest, nextjs, --llamacloud)
- GitHub Check: typescript (22, 3.11, macos-latest, nextjs, --example-file)
- GitHub Check: typescript (22, 3.11, macos-latest, nextjs, --no-files)
- GitHub Check: typescript (20, 3.11, ubuntu-22.04, nextjs, --llamacloud)
- GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, --llamacloud)
- GitHub Check: typescript (20, 3.11, ubuntu-22.04, nextjs, --example-file)
- GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, --example-file)
- GitHub Check: typescript (20, 3.11, ubuntu-22.04, nextjs, --no-files)
- GitHub Check: typescript (20, 3.11, windows-latest, nextjs, --llamacloud)
- GitHub Check: python (20, 3.11, windows-latest, fastapi, --llamacloud)
- GitHub Check: typescript (20, 3.11, windows-latest, nextjs, --example-file)
- GitHub Check: python (20, 3.11, windows-latest, fastapi, --example-file)
- GitHub Check: typescript (20, 3.11, windows-latest, nextjs, --no-files)
- GitHub Check: python (20, 3.11, windows-latest, fastapi, --no-files)
- GitHub Check: typescript (20, 3.11, macos-latest, nextjs, --llamacloud)
- GitHub Check: typescript (20, 3.11, macos-latest, nextjs, --example-file)
- GitHub Check: Unit Tests (windows-latest, 3.9)
- GitHub Check: python (20, 3.11, macos-latest, fastapi, --example-file)
- GitHub Check: typescript (20, 3.11, macos-latest, nextjs, --no-files)
🔇 Additional comments (36)
packages/create-llama/.gitignore (1)
1-62
: Overall gitignore structure is well-organizedThe gitignore file comprehensively covers all necessary patterns for a Node.js/Next.js project with Python components, organized with clear section headers.
packages/create-llama/package.json (1)
1-79
: Well-structured package.json for monorepo setupThe package.json is well-organized with all necessary metadata, scripts, and dependencies for the package within the monorepo structure.
.changeset/plenty-spies-tickle.md (1)
1-6
: Properly formatted changeset for the monorepo restructuringThe changeset correctly documents the patch-level chore for creating the monorepo structure. This is appropriate for tracking the non-breaking structural change.
.husky/pre-commit (1)
3-3
: Path correctly updated for monorepo structureThe path update for the
uvx ruff format
command properly reflects the new location of templates in the monorepo structure.packages/create-llama/e2e/typescript/resolve_dependencies.spec.ts (1)
77-77
: Good addition of the--ignore-workspace
flag for monorepo compatibilityThis change correctly adds the
--ignore-workspace
flag to the pnpm install command, which is essential in a monorepo setup. The flag ensures that the e2e tests install dependencies directly from the registry rather than using workspace references, providing proper isolation for testing..github/workflows/lint_on_push_or_pull.yml (2)
38-38
: Correctly updated Python linting pathThe source path has been properly updated to target Python code in its new monorepo location.
44-44
: Correctly updated Python format check pathThe source path has been properly updated to target Python code in its new monorepo location.
.github/workflows/test_llama_index_server.yml (4)
16-16
: Correctly updated unit-test working directory pathThe working directory has been properly updated to reflect the new monorepo structure.
53-53
: Correctly updated type-check working directory pathThe working directory has been properly updated to reflect the new monorepo structure.
85-85
: Correctly updated build working directory pathThe working directory has been properly updated to reflect the new monorepo structure.
111-111
: Correctly updated artifact upload pathThe artifact upload path has been properly updated to reflect the new monorepo structure.
.github/workflows/release_llama_index_server.yml (4)
8-8
: Correctly updated path filter for workflow triggerThe path filter has been properly updated to reflect the new location of the llama-index-server package in the monorepo.
22-22
: Correctly updated working directory for release jobThe working directory has been properly updated to reflect the new monorepo structure.
83-83
: Correctly updated working directory for publish jobThe working directory has been properly updated to reflect the new monorepo structure.
117-117
: Correctly updated package directory for PyPI publishingThe package directory path has been properly updated to reflect the new monorepo structure.
.github/workflows/e2e.yml (12)
1-1
: Workflow name updated to reflect package context
Good job renaming the workflow to"E2E Tests for create-llama package"
, which clearly indicates its scope.
6-6
: Paths-ignore updated to bypass Python server changes
Ignoringpython/llama-index-server/**
prevents unnecessary E2E runs when only the Python server code changes.Also applies to: 10-10
54-55
: Ensure Playwright installation runs in the package directory
Usingworking-directory: packages/create-llama
here correctly scopes the Playwright browser setup to thecreate-llama
package.
58-59
: Build step scoped to the package
Great use ofworking-directory: packages/create-llama
to execute the build within the correct workspace.
62-63
: Pack-install step scoped to the package
Thepack-install
script is now correctly invoked inside thecreate-llama
package directory.
73-73
: Execute Python E2E tests within the package
The test runner is now correctly pointed atpackages/create-llama
, ensuring isolation.
79-79
: Upload artifact path updated
The report upload path now matches the package structure atpackages/create-llama/playwright-report/
.
124-125
: Install Playwright for TypeScript scoped to package
Good catch addingworking-directory: packages/create-llama
for the TypeScript browser install step.
128-129
: TypeScript build step correctly scoped
The build command is now properly run inside the package directory.
132-133
: Pack-install for TypeScript in correct context
Ensuringpack-install
runs withinpackages/create-llama
is spot on.
141-142
: Execute TypeScript E2E tests in the package
Using the package directory for the E2E test run aligns with the monorepo layout.
147-147
: Artifact upload path for TypeScript updated
The artifacts are now uploaded frompackages/create-llama/playwright-report/
, matching the workspace structure.package.json (9)
2-5
: Monorepo root manifest correctly defined
Thename
,version
,private
, anddescription
fields reflect the new monorepo structure.
10-13
: Repository information updated
Therepository
block points to the correct Git URL and type.
14-14
: License declared as MIT
The open-source licensing is clearly stated.
15-17
: Workspace globs configured
["packages/*"]
correctly scopes your workspaces.
19-23
: Verify Husky prepare script
Theprepare
script invokeshusky
, but Husky v7+ recommendshusky install
to initialize Git hooks. Please confirm your current setup or consider updating to:"prepare": "husky install"
24-29
: Confirm workspace filter targets
The--filter create-llama
flag assumes your workspace’sname
is exactly"create-llama"
. Please verify inpackages/create-llama/package.json
that this matches, or adjust to:"build": "pnpm -r --filter ./packages/create-llama build"
31-34
: DevDependencies trimmed for root
Only@changesets/cli
andhusky
remain at the root, delegating other tools to workspace packages. This aligns well with your monorepo approach.
35-35
: Pinning pnpm version
packageManager
is set to[email protected]
, ensuring consistent installs across environments.
36-38
: Node engine requirement
Specifyingnode >=16.14.0
ensures compatibility with modern Node features.
Summary by CodeRabbit