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

Storybook adjustments #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

deboracosilveira
Copy link
Collaborator

@deboracosilveira deboracosilveira commented Mar 25, 2025

  • Remove stories sorting
  • Fix wrong titles
  • Add build as dependency for storybook
  • Remove DS storybook composition from Wagtail storybook

Summary by CodeRabbit

  • Refactor
    • Streamlined Storybook configurations by removing custom sorting logic and reorganizing story categorization for a more intuitive interface.
    • Updated component titles to better reflect current categorization and structure.
    • Added a placeholder note in the configuration to assist with future enhancements.
  • Chores
    • Adjusted task dependencies to ensure that build processes complete before launching story-related tasks, improving overall execution flow.
    • Updated caching and persistence settings for the Storybook task.

Copy link

changeset-bot bot commented Mar 25, 2025

⚠️ No Changeset found

Latest commit: a731b66

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

coderabbitai bot commented Mar 25, 2025

Walkthrough

This pull request updates multiple Storybook configuration files and the project's task dependency settings. A placeholder comment is added in one Storybook config to indicate future Wagtail story composition. The sorting logic for Storybook stories has been removed from two preview configurations. Additionally, story titles have been updated in two file configurations to reflect new categorization schemes, and specific design system story paths have been removed in another Storybook config. Finally, the task dependency in turbo.json has been modified so that the "storybook" task now depends on the "build" task.

Changes

File(s) Change Summary
packages/components/.storybook/main.ts Added a comment (// TODO compose wagtail stories here) as a placeholder in the stories array.
packages/components/.storybook/preview.ts,
packages/design-system/.storybook/preview.ts
Removed the storySort function and corresponding ordering options from the preview configurations.
packages/components/modules/profiles/web/ProfileSettingsComponent/__storybook__/stories.tsx,
packages/design-system/components/web/buttons/FileUploadButton/__storybook__/FileUploadButton.mdx
Updated the title in the Storybook configuration to reflect a new categorization format.
packages/wagtail/.storybook/main.ts Removed specific story resolution paths referring to design system components.
turbo.json Updated the "storybook" task dependency from ["^storybook"] to ["^build"], altering the execution order. New properties "cache": false and "persistent": true added.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Build as Build Task
    participant SB as Storybook Task

    Dev->>Build: Trigger build process
    Build->>SB: Notify build completion
    SB->>Dev: Launch Storybook with updated config
Loading

Suggested labels

needs review

Suggested reviewers

  • priscilladeroode
  • anicioalexandre
  • Ronan-Fernandes

Poem

I'm a rabbit, hopping with glee,
Code paths change, wild and free.
Comments and updates pave the way,
As tasks align in a structured ballet.
With a playful hop and a joyful cheer,
I celebrate the changes far and near!
🐰✨

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.

packages/components/modules/profiles/web/ProfileSettingsComponent/__storybook__/stories.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    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)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    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)
packages/components/.storybook/main.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /packages/components/.eslintrc.js
Error: Cannot find module '@baseapp-frontend/config/.eslintrc-with-restricted-paths.js'
Require stack:

  • /packages/components/.eslintrc.js
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/eslint@8.57.1/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    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)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/packages/components/.eslintrc.js:1:18)
    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)

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40cd629 and a731b66.

⛔ Files ignored due to path filters (1)
  • packages/components/__generated__/ActivityLogsFragment.graphql.ts is excluded by !**/__generated__/**
📒 Files selected for processing (7)
  • packages/components/.storybook/main.ts (1 hunks)
  • packages/components/.storybook/preview.ts (0 hunks)
  • packages/components/modules/profiles/web/ProfileSettingsComponent/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/.storybook/preview.ts (0 hunks)
  • packages/design-system/components/web/buttons/FileUploadButton/__storybook__/FileUploadButton.mdx (1 hunks)
  • packages/wagtail/.storybook/main.ts (0 hunks)
  • turbo.json (1 hunks)
💤 Files with no reviewable changes (3)
  • packages/wagtail/.storybook/main.ts
  • packages/components/.storybook/preview.ts
  • packages/design-system/.storybook/preview.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/components/.storybook/main.ts
  • packages/design-system/components/web/buttons/FileUploadButton/storybook/FileUploadButton.mdx
  • turbo.json
  • packages/components/modules/profiles/web/ProfileSettingsComponent/storybook/stories.tsx

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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: 0

🧹 Nitpick comments (2)
packages/components/.storybook/main.ts (1)

27-27: Add TODO for Wagtail Stories Composition.
A placeholder comment has been added to indicate future composition of Wagtail stories. Once these stories are ready, please replace this TODO with the actual implementation to maintain clarity.

packages/design-system/components/web/buttons/FileUploadButton/__storybook__/FileUploadButton.mdx (1)

3-3: Update Story Title for Consistent Categorization.
The title now uses a pipe (|) delimiter instead of a slash, aligning with the updated categorization scheme. Verify that this new title format is consistently applied across all design system stories.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21ae41b and 40cd629.

⛔ Files ignored due to path filters (1)
  • packages/components/__generated__/ActivityLogsFragment.graphql.ts is excluded by !**/__generated__/**
📒 Files selected for processing (7)
  • packages/components/.storybook/main.ts (1 hunks)
  • packages/components/.storybook/preview.ts (0 hunks)
  • packages/components/modules/profiles/web/ProfileSettingsComponent/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/.storybook/preview.ts (0 hunks)
  • packages/design-system/components/web/buttons/FileUploadButton/__storybook__/FileUploadButton.mdx (1 hunks)
  • packages/wagtail/.storybook/main.ts (0 hunks)
  • turbo.json (1 hunks)
💤 Files with no reviewable changes (3)
  • packages/design-system/.storybook/preview.ts
  • packages/wagtail/.storybook/main.ts
  • packages/components/.storybook/preview.ts
🔇 Additional comments (2)
turbo.json (1)

40-42: Adjust Storybook Task Dependency.
Changing the dependency to ["^build"] ensures that the build task completes before Storybook runs, which supports the updated task flow. Please ensure that there are no unintended circular dependencies with other tasks.

packages/components/modules/profiles/web/ProfileSettingsComponent/__storybook__/stories.tsx (1)

8-10: Revise Component Title for Updated Categorization.
The component title has been updated to use a pipe delimiter and a reorganized path (@baseapp-frontend | components/Profiles/ProfileSettingsComponent), which aligns with the new naming conventions. Ensure this format is used consistently across Storybook.

turbo.json Outdated
@@ -38,7 +38,7 @@
"outputs": []
},
"storybook": {
"dependsOn": ["^storybook"]
"dependsOn": ["^build"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets also add

      "cache": false,
      "persistent": true

since it's similar to a dev mode

@anicioalexandre anicioalexandre added the needs changes PR was reviewed, and changes are required. label Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changes PR was reviewed, and changes are required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants