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

fix(web): tailwind class not included on build #1313

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

airslice
Copy link
Contributor

@airslice airslice commented Dec 13, 2024

Overview

What I've done

What I haven't done

How I tested

Which point I want you to review particularly

Memo

Summary by CodeRabbit

  • Chores
    • Updated Tailwind CSS configuration to include TypeScript and TSX files for enhanced utility generation.

Copy link

coderabbitai bot commented Dec 13, 2024

Walkthrough

The changes involve an update to the Tailwind CSS configuration file located at web/tailwind.config.js. A new path, "./src/**/*.{ts,tsx}", has been added to the content array, enabling Tailwind CSS to scan TypeScript and TSX files in the src directory and its subdirectories for class names. This modification expands the file scope for utility generation while maintaining the existing paths for the builtin widgets.

Changes

File Change Summary
web/tailwind.config.js Added "./src/**/*.{ts,tsx}" to the content array for Tailwind CSS to scan TypeScript files.

Suggested labels

web

Suggested reviewers

  • mkumbobeaty
  • m-abe-dev

Poem

In the land of code, where rabbits hop,
New paths are added, we’ll never stop!
Tailwind now sees, with a joyful glance,
TypeScript and TSX join the dance.
Hooray for the change, let’s give a cheer,
Our styles will flourish, the future is near! 🐇✨


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 generate docstrings to generate docstrings for this PR. (Experiment)
  • @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

netlify bot commented Dec 13, 2024

Deploy Preview for reearth-web ready!

Name Link
🔨 Latest commit 2021b06
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/675ba77fa531980008c4de15
😎 Deploy Preview https://deploy-preview-1313--reearth-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@mulengawilfred mulengawilfred left a comment

Choose a reason for hiding this comment

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

Looks good

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: 0

🧹 Outside diff range and nitpick comments (1)
web/tailwind.config.js (1)

9-10: Consider documenting the path structure

While the fix addresses the immediate issue, it would be helpful to document why certain paths are explicitly listed versus using the catch-all pattern.

Add a comment explaining the path structure:

  content: [
+   // Widget-specific paths for special handling
    "./src/beta/lib/reearth-widget-ui/**/*.{ts,tsx}",
    "./src/beta/features/Visualizer/Crust/Widgets/Widget/builtin/**/*.{ts,tsx}",
+   // General application source files
    "./src/**/*.{ts,tsx}"
  ],
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f65878e and 2021b06.

📒 Files selected for processing (1)
  • web/tailwind.config.js (1 hunks)
🔇 Additional comments (1)
web/tailwind.config.js (1)

9-10: Verify path redundancy in content configuration

The newly added path "./src/**/*.{ts,tsx}" is a broader pattern that encompasses the other specific paths. This could lead to:

  1. Redundant file scanning as files under src/beta/ will be scanned twice
  2. Potentially slower build times due to increased scanning scope

Consider consolidating the paths to avoid redundancy:

  content: [
-   "./src/beta/lib/reearth-widget-ui/**/*.{ts,tsx}",
-   "./src/beta/features/Visualizer/Crust/Widgets/Widget/builtin/**/*.{ts,tsx}",
-   "./src/**/*.{ts,tsx}"
+   "./src/**/*.{ts,tsx}"
  ],

Let's verify if there are any special cases in the specific paths that require separate handling:

✅ Verification successful

Consolidate Tailwind content paths for better maintainability

The specific paths can be safely consolidated into the single "./src/**/*.{ts,tsx}" pattern because:

  1. The widget-specific files use standard Tailwind directives and utilities (found in globals.css)
  2. The only Tailwind-related usage in widget directories is a utility function using tailwind-merge (in utils.ts)
  3. No special Tailwind configurations or build requirements were found in the widget directories
  content: [
-   "./src/beta/lib/reearth-widget-ui/**/*.{ts,tsx}",
-   "./src/beta/features/Visualizer/Crust/Widgets/Widget/builtin/**/*.{ts,tsx}",
-   "./src/**/*.{ts,tsx}"
+   "./src/**/*.{ts,tsx}"
  ],
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any unique configurations or special handling in the widget directories

# Check for unique Tailwind configurations or special comments in widget files
rg -l '@tailwind|@apply|tailwind' ./src/beta/lib/reearth-widget-ui/
rg -l '@tailwind|@apply|tailwind' ./src/beta/features/Visualizer/Crust/Widgets/Widget/builtin/

Length of output: 341


Script:

#!/bin/bash
# Let's first check the actual directory structure to locate the widget files
fd -t d "widget|Widget" --ignore-case

# Then check for any Tailwind-related patterns in TypeScript/TSX files
fd -e ts -e tsx | xargs rg -l '@tailwind|@apply|tailwind'

Length of output: 561


Script:

#!/bin/bash
# Let's check the content of the file that uses Tailwind to understand its usage
cat web/src/beta/lib/reearth-widget-ui/utils.ts

# Also check if there are any special build configurations or CSS imports in these widget directories
fd -e css -e scss . web/src/beta/lib/reearth-widget-ui/ web/src/beta/features/Visualizer/Crust/Widgets/

Length of output: 378


Script:

#!/bin/bash
# Let's check the content of globals.css to see if it has any special Tailwind directives
cat web/src/beta/lib/reearth-widget-ui/styles/globals.css

# Also check if there are any special build or configuration files in these directories
fd -e config.js -e config.ts . web/src/beta/lib/reearth-widget-ui/ web/src/beta/features/Visualizer/Crust/Widgets/

Length of output: 1651

@airslice airslice merged commit 3cc7f17 into main Dec 13, 2024
20 checks passed
@airslice airslice deleted the fix/tailwind-class-not-detected branch December 13, 2024 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants