Skip to content

Conversation

@kotAPI
Copy link
Collaborator

@kotAPI kotAPI commented Nov 15, 2024

This PR fixes previously broken css/scss bundling builds

Summary by CodeRabbit

  • New Features

    • Introduced a new CSS build process using Rollup, improving performance and maintainability.
    • Added a configuration file for Rollup to streamline CSS processing.
  • Bug Fixes

    • Enhanced type safety in batch item retrieval functions, ensuring clearer expectations for returned values.
  • Documentation

    • Updated Storybook configurations for AvatarPrimitive and ButtonPrimitive components to improve type safety.
  • Style

    • Restructured color tokens for improved consistency and readability without altering values.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 15, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces several modifications primarily focused on the build tooling and type safety within the project. The package.json file has been updated to replace Parcel with Rollup for CSS building, which includes the removal of the Parcel dependency and the addition of Rollup plugins. A new configuration file, rollup-css.config.js, has been added to manage CSS processing. Additionally, type assertions have been enhanced in several TypeScript files, improving type safety for specific functions. Finally, the color tokens in colors.tokens.js have been restructured for consistency.

Changes

File Change Summary
package.json - Updated build-css script to use Rollup instead of Parcel.
- Removed Parcel dependency.
- Added Rollup plugins: rollup-plugin-postcss and rollup-plugin-scss.
rollup-css.config.js - Added new configuration file for Rollup CSS processing, specifying input and output for SCSS.
src/core/batches.ts - Enhanced type assertions for getActiveBatchItem, getNextBatchItem, and getPrevBatchItem functions, specifying return types as `HTMLElement
src/core/primitives/Avatar/stories/AvatarPrimitive.stories.tsx - Updated render function to explicitly type args as any.
src/core/primitives/Button/ButtonPrimitive.stories.tsx - Updated render function to explicitly type args as any.
styles/jsTokens/colors.tokens.js - Restructured color tokens from shorthand syntax to a JSON-like format for consistency and readability.

Possibly related PRs

  • Release/0.0.22 #391: The changes in package.json regarding the update of the build-css script and the addition of Rollup plugins are related to the overall build tooling and configuration, which aligns with the modifications made in the main PR.
  • Better typescript support added #398: The addition of @types/react in package.json enhances TypeScript support, which is relevant to the changes in the main PR that involve updates to build tooling and configuration.
  • Use Button Primitive in Toggle, ToggleGroup - and more QOL improvements #402: The updates to the Toggle component to use ButtonPrimitive reflect a shift in component implementation, which may relate to the overall changes in the UI components as seen in the main PR.
  • AlertDialog Component #448: The introduction of the AlertDialog component and its associated styles in the alert-dialog.scss file indicates a broader enhancement of the UI components, which is consistent with the changes in the main PR regarding the build and styling configurations.

🐰 In the garden where colors bloom,
With Rollup's magic, we clear the gloom.
Type safety dances, bright and clear,
As we craft our tokens, hold them dear.
A hop, a skip, our code's refined,
In this joyful patch, new paths we find! 🌼

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

rollup-css.config.js

Oops! Something went wrong! :(

ESLint: 8.56.0

Error: Failed to load parser '@babel/eslint-parser' declared in '.eslintrc.cjs': Cannot find module '@babel/core/package.json'
Require stack:

  • /node_modules/@babel/eslint-parser/lib/parse.cjs
  • /node_modules/@babel/eslint-parser/lib/index.cjs
  • /node_modules/@eslint/eslintrc/dist/eslintrc.cjs
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object. (/node_modules/@babel/eslint-parser/lib/parse.cjs:14:19)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
    at Module._load (node:internal/modules/cjs/loader:1127:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)

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.

@codecov
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.30%. Comparing base (495aa65) to head (4351850).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #557   +/-   ##
=======================================
  Coverage   92.30%   92.30%           
=======================================
  Files          12       12           
  Lines          65       65           
  Branches       15       15           
=======================================
  Hits           60       60           
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kotAPI kotAPI merged commit 3ad695f into main Nov 15, 2024
6 checks passed
@kotAPI kotAPI deleted the pranay/restore-builds branch November 15, 2024 15:47
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.

[New Feature] Remove parcel bundler package from repo BUG: Fix build-css command during build steps

2 participants