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

Migrates to Biome and pnpm from Rome and yarn #89

Merged
merged 6 commits into from
Oct 25, 2024
Merged

Conversation

Royal-lobster
Copy link
Owner

@Royal-lobster Royal-lobster commented Oct 25, 2024

Closes #86
Closes #85

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced version control settings in configuration.
  • Bug Fixes

    • Updated schema reference for configuration to a remote URL.
  • Refactor

    • Replaced formatting and linting tools from "rome" to "biome."
  • Style

    • Improved CSS formatting for better readability.
    • Standardized quotation marks in JSX components.

Copy link

stackblitz bot commented Oct 25, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Oct 25, 2024

⚠️ No Changeset found

Latest commit: 02097a0

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

Copy link
Contributor

coderabbitai bot commented Oct 25, 2024

Warning

Rate limit exceeded

@Royal-lobster has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 16 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Files that changed from the base of the PR and between f9e8022 and 02097a0.

Walkthrough

The changes introduced in this pull request include updates to configuration files and code components. The biome.json file has been modified to reference a remote schema and includes new version control settings. The package.json file reflects a transition from "rome" to "biome" for formatting and linting tools, with corresponding updates to scripts and dependencies. Minor syntax adjustments were made in JSX files for consistency in quotation marks, and CSS formatting was improved for readability.

Changes

File Change Summary
biome.json Updated schema reference to remote URL, added vcs section, removed indentSize and trailingComma properties.
package.json Updated formatting and linting scripts from "rome" to "biome", added @biomejs/biome dependency, removed "rome".
src/components/Settings/Elements/SectionHeading.tsx Changed single quotes to double quotes for className in <h2> element.
src/components/Settings/index.tsx Changed single quotes to double quotes for className in div elements.
src/pages/sidebar/index.css Reformatted CSS for consistency, adjusted keyframes for clarity, changed opacity value from .5 to 0.5.

Assessment against linked issues

Objective Addressed Explanation
Replace yarn with pnpm (#86) No changes related to replacing yarn with pnpm.
Update to use biome (#85)

🐰 In the meadow, changes bloom,
Biome's here to lift the gloom.
From Rome we leap, with scripts anew,
Formatting bright, and linting too!
With every hop, our code's refined,
A joyful leap, with peace of mind! 🌼


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
Contributor

@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 (1)
package.json (1)

Migration to pnpm requires updating script commands

While the migration shows good progress with pnpm-lock.yaml present and yarn.lock removed, there are still yarn commands in the package.json scripts that need to be updated:

  • release: Replace yarn build with pnpm build
  • release:cli: Replace yarn build with pnpm build
  • lint:fix: Replace yarn lint with pnpm lint
🔗 Analysis chain

Line range hint 1-73: Verify pnpm migration completeness.

Let's verify if all necessary files for pnpm migration are included in this PR.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for presence of package manager related files and references

# Test 1: Check if pnpm-lock.yaml exists
echo "Checking for pnpm-lock.yaml..."
if [ -f "pnpm-lock.yaml" ]; then
    echo "✓ pnpm-lock.yaml found"
else
    echo "✗ pnpm-lock.yaml missing"
fi

# Test 2: Check for any remaining yarn references in package.json
echo -e "\nChecking for remaining yarn references..."
rg "yarn" package.json

# Test 3: Check if yarn.lock is still present
echo -e "\nChecking if yarn.lock exists (should be removed)..."
if [ -f "yarn.lock" ]; then
    echo "✗ yarn.lock should be removed"
else
    echo "✓ yarn.lock not found"
fi

Length of output: 1076

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 7b0a75f and f9e8022.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • biome.json (1 hunks)
  • package.json (2 hunks)
  • src/components/Settings/Elements/SectionHeading.tsx (1 hunks)
  • src/components/Settings/index.tsx (1 hunks)
  • src/pages/sidebar/index.css (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • src/components/Settings/Elements/SectionHeading.tsx
  • src/components/Settings/index.tsx
  • src/pages/sidebar/index.css
🔇 Additional comments (4)
biome.json (3)

2-2: LGTM: Schema URL correctly points to the official Biome schema.

The schema URL is properly configured to match the installed Biome version (1.9.4).


Line range hint 1-50: Verify formatting consistency after property removals.

The removal of indentSize and trailingComma properties might affect code formatting. While Biome has sensible defaults, we should ensure they match the project's formatting expectations.

Let's check the codebase for formatting consistency:

#!/bin/bash
# Check trailing comma usage in the codebase
rg -A 1 ',$' '*.{js,jsx,ts,tsx}'

# Check indentation patterns
rg '^\s+' '*.{js,jsx,ts,tsx}' | head -n 10

Consider documenting Biome's default formatting rules in the project's contributing guidelines to help maintainers understand the expected code style.


3-7: Verify if disabling VCS integration is intentional.

The VCS configuration has all features disabled, which means Biome won't:

  • Track file changes through Git
  • Use Git ignore patterns
  • Integrate with version control features

This might impact Biome's ability to optimize its operations based on changed files.

Let's check if there's any documentation or discussion about this decision:

✅ Verification successful

VCS integration can safely remain disabled

The VCS configuration appears to be part of a larger migration from Rome to Biome (as per issue #85). Disabling VCS integration is acceptable because:

  1. It's a non-critical feature that only affects performance optimization, not functionality
  2. The configuration properly handles essential aspects like formatting, linting, and file ignores
  3. The project already uses other CI tools for version control integration
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any documentation about VCS configuration
rg -i "vcs|version control|git integration" README.md docs/
# Check for related discussion in PR/issue
gh issue view 85

Length of output: 548


Script:

#!/bin/bash
# Search for any configuration examples or discussions about VCS in the codebase
rg -i "vcs.*config|biome.*vcs" -A 3 -B 3

# Check if there are any other Biome config files that might have VCS enabled
fd biome.json --exec cat {}

# Look for any PR description or comments that might explain this decision
gh pr list --search "biome config" --json title,body,number

Length of output: 1058

package.json (1)

20-21: LGTM! Biome configuration looks good.

The migration from Rome to Biome is correctly implemented with:

  • Updated format and lint scripts to use Biome commands
  • Added @biomejs/biome dependency

Also applies to: 56-56

package.json Outdated
Comment on lines 18 to 19
"release": "yarn build && publish-extension --chrome-zip \"artifacts/chrome.zip\" --chrome-extension-id \"$CHROME_EXTENSION_ID\" --chrome-client-id \"$CHROME_CLIENT_ID\" --chrome-client-secret \"$CHROME_CLIENT_SECRET\" --chrome-refresh-token \"$CHROME_REFRESH_TOKEN\"",
"release:cli": "yarn build && dotenv -e .env -- publish-extension --chrome-zip \"artifacts/chrome.zip\" --chrome-extension-id \"$CHROME_EXTENSION_ID\" --chrome-client-id \"$CHROME_CLIENT_ID\" --chrome-client-secret \"$CHROME_CLIENT_SECRET\" --chrome-refresh-token \"$CHROME_REFRESH_TOKEN\"",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Update remaining yarn commands for pnpm migration.

As part of the migration from yarn to pnpm, these scripts still reference yarn commands:

-    "release": "yarn build && publish-extension --chrome-zip \"artifacts/chrome.zip\" --chrome-extension-id \"$CHROME_EXTENSION_ID\" --chrome-client-id \"$CHROME_CLIENT_ID\" --chrome-client-secret \"$CHROME_CLIENT_SECRET\" --chrome-refresh-token \"$CHROME_REFRESH_TOKEN\"",
-    "release:cli": "yarn build && dotenv -e .env -- publish-extension --chrome-zip \"artifacts/chrome.zip\" --chrome-extension-id \"$CHROME_EXTENSION_ID\" --chrome-client-id \"$CHROME_CLIENT_ID\" --chrome-client-secret \"$CHROME_CLIENT_SECRET\" --chrome-refresh-token \"$CHROME_REFRESH_TOKEN\"",
+    "release": "pnpm build && publish-extension --chrome-zip \"artifacts/chrome.zip\" --chrome-extension-id \"$CHROME_EXTENSION_ID\" --chrome-client-id \"$CHROME_CLIENT_ID\" --chrome-client-secret \"$CHROME_CLIENT_SECRET\" --chrome-refresh-token \"$CHROME_REFRESH_TOKEN\"",
+    "release:cli": "pnpm build && dotenv -e .env -- publish-extension --chrome-zip \"artifacts/chrome.zip\" --chrome-extension-id \"$CHROME_EXTENSION_ID\" --chrome-client-id \"$CHROME_CLIENT_ID\" --chrome-client-secret \"$CHROME_CLIENT_SECRET\" --chrome-refresh-token \"$CHROME_REFRESH_TOKEN\"",
-    "lint:fix": "yarn lint --apply"
+    "lint:fix": "pnpm lint --apply"

Also applies to: 23-23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Replace yarn with pnpm Update to use biome
1 participant