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

feat: turbo #1173

Closed
wants to merge 1 commit into from
Closed

feat: turbo #1173

wants to merge 1 commit into from

Conversation

songwongtp
Copy link
Collaborator

@songwongtp songwongtp commented Oct 27, 2024

Summary by CodeRabbit

  • New Features

    • Introduced Turbo for optimized build processes.
    • Added a new configuration file turbo.json with defined tasks for building and development.
  • Bug Fixes

    • Enhanced error handling for supported chain IDs in environment variables.
  • Chores

    • Updated .gitignore to exclude the .turbo directory.
    • Added new dependency "turbo": "^2.2.3" to devDependencies in package.json.

Copy link

vercel bot commented Oct 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
celatone-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 27, 2024 3:20pm
initia-celatone-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 27, 2024 3:20pm
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
celatone-frontend-main ⬜️ Ignored (Inspect) Oct 27, 2024 3:20pm
neutron-celatone-frontend ⬜️ Ignored (Inspect) Oct 27, 2024 3:20pm
osmosis-celatone-frontend ⬜️ Ignored (Inspect) Oct 27, 2024 3:20pm
sei-celatone-frontend ⬜️ Ignored (Inspect) Oct 27, 2024 3:20pm
terra-celatone-frontend ⬜️ Ignored (Inspect) Oct 27, 2024 3:20pm

Copy link

coderabbitai bot commented Oct 27, 2024

Walkthrough

The changes in this pull request include modifications to several files to integrate Turbo, a build optimization tool. The .gitignore file now excludes the .turbo directory, while package.json adds Turbo as a development dependency. The src/env.ts file enhances error handling for environment variables related to supported chain IDs, and a new configuration file, turbo.json, is introduced to define build and development tasks.

Changes

File Change Summary
.gitignore Added entry: .turbo to ignore the .turbo directory.
package.json Added new dependency: "turbo": "^2.2.3" in devDependencies.
src/env.ts Enhanced error handling for SUPPORTED_CHAIN_IDS; redundant declaration of FALLBACK_CHAIN.
turbo.json New configuration file with tasks build and dev.

Poem

In the burrow where code does play,
A new tool hops in to save the day.
With Turbo's speed, our builds will fly,
Ignoring the clutter, oh my, oh my!
Environment checks now shine so bright,
Hooray for changes, all feels just right! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

🧹 Outside diff range and nitpick comments (2)
turbo.json (1)

8-11: Add comments to document task configuration.

While the configuration is correct, adding comments would improve maintainability by explaining the purpose of each setting.

 "dev": {
+  // Keep the dev server running
   "persistent": true,
+  // Disable caching for development to ensure fresh builds
   "cache": false
 }
package.json (1)

Line range hint 26-39: Consider updating scripts for Turbo.

The current scripts section could be enhanced to leverage Turbo's capabilities. Consider prefixing the appropriate scripts with turbo run or updating them according to your turbo.json configuration.

Would you like me to provide examples of how to update the scripts to work with Turbo?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d9dde80 and 003e817.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • .gitignore (1 hunks)
  • package.json (1 hunks)
  • src/env.ts (1 hunks)
  • turbo.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🔇 Additional comments (3)
turbo.json (2)

1-2: LGTM! Schema is correctly defined.

The schema URL is properly specified and points to the official Turbo documentation.


1-13: Verify Turbo integration in package.json.

Let's ensure the Turbo integration is complete by verifying the package.json configuration.

✅ Verification successful

Turbo integration is properly configured

The verification confirms that:

  • Turbo is correctly installed as a dev dependency (version ^2.2.3)
  • The required build and dev scripts are present in package.json
  • The scripts align with the configuration in turbo.json
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Turbo integration in package.json

# Test 1: Check if turbo is listed in devDependencies
echo "Checking turbo dependency..."
rg '"turbo":\s*".*"' package.json

# Test 2: Check if build and dev scripts are configured
echo "Checking npm scripts configuration..."
rg '"scripts":\s*{' -A 10 package.json

Length of output: 343


Script:

#!/bin/bash
# Let's try a different approach to check package.json content
echo "Checking package.json content..."
cat package.json

Length of output: 5500

package.json (1)

174-174: LGTM! Turbo dependency version is compatible.

The addition of Turbo v2.2.3 as a dev dependency is compatible with the current setup:

  • Next.js v14.0.0
  • pnpm v9.10.0

Let's verify the Turbo configuration:

✅ Verification successful

Turbo configuration is properly set up and integrated

The verification confirms that Turbo is correctly configured:

  • turbo.json exists with proper schema and task configurations for build and dev
  • .gitignore includes .turbo directory
  • No conflicting pipeline configurations in package.json
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Turbo configuration and integration

# Test 1: Check if turbo.json exists and is properly configured
echo "Checking turbo.json configuration..."
if [ -f "turbo.json" ]; then
    cat turbo.json
else
    echo "Warning: turbo.json is missing"
fi

# Test 2: Check for any existing Turbo pipeline configurations in package.json
echo -e "\nChecking for Turbo pipeline configurations in package.json..."
rg '"pipeline"' package.json

# Test 3: Verify .gitignore entry
echo -e "\nVerifying .gitignore configuration..."
rg '\.turbo' .gitignore

Length of output: 654

Comment on lines +4 to +7
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**"]
},
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider including additional Next.js output directories.

While the current output configuration is valid, consider including other common Next.js output directories for comprehensive caching:

 "build": {
   "dependsOn": ["^build"],
-  "outputs": [".next/**", "!.next/cache/**"]
+  "outputs": [
+    ".next/**",
+    "!.next/cache/**",
+    "dist/**",
+    "build/**",
+    "public/build/**"
+  ]
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**"]
},
"build": {
"dependsOn": ["^build"],
"outputs": [
".next/**",
"!.next/cache/**",
"dist/**",
"build/**",
"public/build/**"
]
},

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.

1 participant