Skip to content

Conversation

@marcusschiesser
Copy link
Collaborator

@marcusschiesser marcusschiesser commented Jun 19, 2025

Summary by CodeRabbit

  • New Features

    • Added a comprehensive list of all available use cases for easier management and test coverage.
    • Introduced a new end-to-end test to verify the "eject" command functionality for Next.js-based projects.
    • Replaced previous CLI question flows with a unified interactive prompt for configuring use case, framework, model, and cloud options.
  • Tests

    • Expanded test coverage to include all use cases in relevant test suites.
    • Removed environment-dependent test conditions and streamlined test logic.
    • Deleted redundant tests related to project ejection and dependency installation.
    • Maintained skip conditions for specific frontend chat use cases.
  • Chores

    • Renamed npm script for TypeScript end-to-end tests to cover multiple test directories.
    • Updated GitHub Actions workflow to use the new test script name.
    • Updated README for clearer descriptions of frameworks, models, and CLI prompts.
    • Simplified CLI by removing deprecated options related to template type and llama parse.
    • Refined type definitions and centralized use case configurations for consistency.

@changeset-bot
Copy link

changeset-bot bot commented Jun 19, 2025

⚠️ No Changeset found

Latest commit: f2e3785

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jun 19, 2025

Walkthrough

This update introduces a centralized constant for all use cases, replacing hardcoded arrays in multiple test suites. It removes environment-dependent logic for framework selection, standardizes test coverage, and adds a new end-to-end test for the "eject" command. Unused imports and obsolete tests are cleaned up for consistency.

Changes

File(s) Change Summary
helpers/types.ts Added ALL_USE_CASES constant enumerating all possible use case strings.
e2e/python/resolve_dependencies.spec.ts
e2e/typescript/resolve_dependencies.spec.ts
Replaced hardcoded use case arrays and dynamic framework selection with ALL_USE_CASES and fixed frameworks.
e2e/shared/llamaindexserver_template.spec.ts Switched to ALL_USE_CASES, removed an obsolete eject/build test, and cleaned up imports/logic.
e2e/typescript/eject.spec.ts Added a new end-to-end test for the "eject" command, including setup, execution, and teardown.
package.json Renamed and updated e2e npm script to run Playwright tests on shared and typescript directories.
.github/workflows/e2e.yml Updated GitHub Actions workflow to use the renamed e2e npm script and removed template-types matrix.
e2e/utils.ts Removed templateType and useLlamaParse parameters from runCreateLlama, added mandatory useCase parameter, and adjusted command args.
index.ts Removed CLI options --template and --use-llama-parse and related logic; introduced cliArgs for typed options.
questions/index.ts Replaced previous conditional question delegation with a unified interactive prompt flow using prompts.
questions/pro.ts
questions/simple.ts
Deleted both files which previously handled separate question flows.
questions/types.ts Simplified types by removing PureQuestionArgs, updating QuestionResults and adding QuestionArgs with optional properties.
questions/usecases.ts Removed redundant useCase string property from use case configurations and replaced explicit AppType with imported TemplateUseCase.
README.md Revised descriptions for frameworks, data handling, model defaults, and CLI prompts for accuracy and clarity.

Sequence Diagram(s)

sequenceDiagram
    participant TestRunner
    participant CLI
    participant AppProcess
    participant FileSystem

    TestRunner->>CLI: Run create-llama CLI with parameters
    CLI->>FileSystem: Generate Next.js project
    TestRunner->>AppProcess: Start app process
    AppProcess-->>TestRunner: App ready (UI element detected)
    TestRunner->>CLI: Run "pnpm run eject"
    CLI->>FileSystem: Create "next" directory
    TestRunner->>CLI: Install dependencies in "next"
    TestRunner->>CLI: Build project in "next"
    CLI-->>TestRunner: Build completes
    TestRunner->>AppProcess: Terminate app process
Loading

Possibly related PRs

Poem

🐇 Hopping through the code with glee,
Central lists for use cases—oh, what harmony!
Out with the old, in with the neat,
Eject command tested, a tidy feat.
With every test, our warren grows strong,
🐰 Code rabbits cheer and bounce along!
New prompts and flows, our path is clear,
Creating llamas with joyful cheer!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5db360a and f2e3785.

📒 Files selected for processing (1)
  • packages/create-llama/e2e/typescript/eject.spec.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/create-llama/e2e/typescript/eject.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: lint
  • GitHub Check: typescript (22, macos-latest, nextjs, none)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, llamacloud)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, none)
  • GitHub Check: Unit Tests (windows-latest, 3.9)
  • GitHub Check: Unit Tests (ubuntu-latest, 3.9)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, llamacloud)
  • GitHub Check: typescript (22, ubuntu-22.04, nextjs, llamacloud)
  • GitHub Check: typescript (22, windows-latest, nextjs, none)
  • GitHub Check: typescript (22, windows-latest, nextjs, llamacloud)
  • GitHub Check: typescript (22, ubuntu-22.04, nextjs, none)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, none)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, none)
  • GitHub Check: typescript (22, macos-latest, nextjs, llamacloud)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, llamacloud)
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
packages/create-llama/helpers/types.ts (1)

52-59: Good centralization of use cases, but consider consistent ordering.

The centralized ALL_USE_CASES constant improves maintainability by providing a single source of truth. However, the ordering differs from the TemplateUseCase union type definition above.

Consider reordering to match the union type for consistency:

 export const ALL_USE_CASES: TemplateUseCase[] = [
-  "agentic_rag",
-  "deep_research",
   "financial_report",
+  "deep_research", 
+  "agentic_rag",
   "code_generator",
   "document_generator",
   "hitl",
 ];
packages/create-llama/e2e/typescript/eject.spec.ts (2)

38-38: Inconsistent useLlamaParse configuration.

The useLlamaParse is hardcoded to false, but other test files set it based on vectorDb === "llamacloud". This inconsistency might cause test behavior to differ from actual usage patterns.

Consider making it consistent with other tests:

-      useLlamaParse: false,
+      useLlamaParse: vectorDb === "llamacloud",

9-9: Consider testing eject with multiple use cases.

Currently only testing with code_generator use case. Since eject behavior might vary across different use cases, consider testing with a broader set or at least document why this specific use case was chosen.

If eject behavior is use-case dependent, consider parameterizing the test similar to other test files in this PR.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8fa8c3b and 1d5b847.

📒 Files selected for processing (5)
  • packages/create-llama/e2e/python/resolve_dependencies.spec.ts (1 hunks)
  • packages/create-llama/e2e/shared/llamaindexserver_template.spec.ts (2 hunks)
  • packages/create-llama/e2e/typescript/eject.spec.ts (1 hunks)
  • packages/create-llama/e2e/typescript/resolve_dependencies.spec.ts (2 hunks)
  • packages/create-llama/helpers/types.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: typescript (22, macos-latest, nextjs, llamacloud, llamaindexserver)
  • GitHub Check: typescript (22, windows-latest, nextjs, none, llamaindexserver)
  • GitHub Check: typescript (22, ubuntu-22.04, nextjs, llamacloud, llamaindexserver)
  • GitHub Check: typescript (22, ubuntu-22.04, nextjs, none, llamaindexserver)
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, llamacloud, llamaindexserver)
  • GitHub Check: typescript (22, macos-latest, nextjs, none, llamaindexserver)
  • GitHub Check: typescript (22, windows-latest, nextjs, llamacloud, llamaindexserver)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, none, llamaindexserver)
  • GitHub Check: lint
  • GitHub Check: python (20, 3.11, macos-latest, fastapi, none, llamaindexserver)
  • GitHub Check: python (20, 3.11, windows-latest, fastapi, llamacloud, llamaindexserver)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, none, llamaindexserver)
  • GitHub Check: python (20, 3.11, ubuntu-22.04, fastapi, llamacloud, llamaindexserver)
  • GitHub Check: Unit Tests (ubuntu-latest, 3.9)
  • GitHub Check: Unit Tests (windows-latest, 3.9)
🔇 Additional comments (9)
packages/create-llama/e2e/typescript/resolve_dependencies.spec.ts (3)

7-7: Good addition of centralized constant import.

Importing ALL_USE_CASES aligns with the PR objective of centralizing use case definitions.


17-17: Improved test predictability by removing environment dependency.

Hardcoding the framework to "nextjs" makes the test behavior more consistent and predictable, eliminating environment-dependent variability.


28-28: Enhanced test coverage with centralized use cases.

Using ALL_USE_CASES ensures comprehensive testing across all defined use cases rather than a limited subset.

packages/create-llama/e2e/python/resolve_dependencies.spec.ts (3)

7-7: Consistent with centralized constant strategy.

Adding the ALL_USE_CASES import aligns with the repository-wide standardization effort.


16-16: Appropriate framework choice for Python tests.

Hardcoding to "fastapi" makes sense for Python-based testing and removes environment dependency.


28-28: Comprehensive use case coverage.

Iterating over ALL_USE_CASES ensures thorough mypy checking across all defined use cases.

packages/create-llama/e2e/shared/llamaindexserver_template.spec.ts (2)

2-2: Clean import reorganization.

Removing unused execSync import and adding ALL_USE_CASES with proper type imports improves code cleanliness and supports the centralized constant usage.

Also applies to: 5-9


23-23: Expanded test coverage with all use cases.

Using ALL_USE_CASES ensures comprehensive testing across all defined use cases rather than a limited subset, improving test coverage consistency.

packages/create-llama/e2e/typescript/eject.spec.ts (1)

1-18: Well-structured dedicated eject test setup.

Good approach to isolate eject functionality testing in its own file with clear constants and configuration.

@marcusschiesser marcusschiesser merged commit 02a9db3 into main Jun 19, 2025
18 checks passed
@marcusschiesser marcusschiesser deleted the ms/more-cleanup branch June 19, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants