Skip to content

Conversation

@anicioalexandre
Copy link
Collaborator

@anicioalexandre anicioalexandre commented Dec 20, 2024

  • use fixed version on catalogs dependencies on baseapp-frontend ecosystem (template and packages) aiming for more stability on the core dependencies we use

Summary by CodeRabbit

  • New Features

    • Updated various package dependencies to their latest versions, enhancing functionality and stability across the application.
  • Bug Fixes

    • Resolved issues related to dependency management, ensuring compatibility and performance improvements.
  • Documentation

    • Updated changelogs for multiple packages to reflect recent changes and version increments.
  • Chores

    • Incremented version numbers for several packages in their respective package.json files.

@changeset-bot
Copy link

changeset-bot bot commented Dec 20, 2024

⚠️ No Changeset found

Latest commit: f2f900b

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 20, 2024

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/__mocks__/eventEmitterMock.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.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)

Walkthrough

This pull request involves version updates and dependency modifications across multiple packages in the monorepo. The changes primarily focus on updating package versions, standardizing dependency versions from caret (^) to exact versions, and updating specific dependencies like @baseapp-frontend/utils. The modifications span packages such as authentication, components, design-system, graphql, provider, utils, wagtail, and the workspace configuration.

Changes

File Change Summary
package.json Updated @parcel/packager-ts and @parcel/transformer-typescript-types to latest versions
packages/authentication/package.json Version incremented from 4.0.5 to 4.0.6
packages/components/package.json Version incremented from 0.0.36 to 0.0.37
packages/design-system/package.json Version incremented from 0.0.24 to 0.0.25
packages/graphql/package.json Version incremented from 1.1.14 to 1.1.15
packages/provider/package.json Version incremented from 2.0.5 to 2.0.6
packages/utils/package.json Version incremented from 3.0.4 to 3.0.5, events dependency updated
packages/wagtail/package.json Version incremented from 1.0.9 to 1.0.10
pnpm-workspace.yaml Converted multiple dependency versions from caret to exact versions

Possibly related PRs

Suggested reviewers

  • pt-tsl

Poem

🐰 Hop, hop, versioning delight!
Dependencies aligned just right
Packages dancing, versions new
A rabbit's code review, true blue!
Precision is our guiding light 🌟

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


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. (Beta)
  • @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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8b2cfcf and 33176fb72489cf2d62ce79a4ad611eb29aa588c7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • package.json (1 hunks)
  • packages/authentication/CHANGELOG.md (1 hunks)
  • packages/authentication/package.json (1 hunks)
  • packages/components/CHANGELOG.md (1 hunks)
  • packages/components/package.json (1 hunks)
  • packages/design-system/CHANGELOG.md (1 hunks)
  • packages/design-system/package.json (1 hunks)
  • packages/graphql/CHANGELOG.md (1 hunks)
  • packages/graphql/package.json (1 hunks)
  • packages/provider/CHANGELOG.md (1 hunks)
  • packages/provider/package.json (1 hunks)
  • packages/utils/CHANGELOG.md (1 hunks)
  • packages/utils/package.json (2 hunks)
  • packages/wagtail/CHANGELOG.md (1 hunks)
  • packages/wagtail/package.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (12)
  • packages/components/package.json
  • packages/design-system/package.json
  • packages/graphql/package.json
  • packages/wagtail/package.json
  • packages/authentication/package.json
  • packages/provider/package.json
  • packages/provider/CHANGELOG.md
  • packages/graphql/CHANGELOG.md
  • packages/wagtail/CHANGELOG.md
  • packages/design-system/CHANGELOG.md
  • packages/components/CHANGELOG.md
  • pnpm-workspace.yaml
🔇 Additional comments (4)
packages/utils/CHANGELOG.md (2)

3-8: Version bump and dependency stabilization looks good

The changelog entry correctly documents:

  1. Patch version bump (3.0.5)
  2. Implementation of stable versions for core dependencies, which aligns with the PR objectives

7-7: Verify the impact of removing events from catalogs

The removal of events from catalogs could be a breaking change depending on its usage. Let's verify if this change impacts any consumers.

packages/utils/package.json (1)

4-4: LGTM: Version bump follows semver

The version bump from 3.0.4 to 3.0.5 follows semantic versioning for patch updates.

packages/authentication/CHANGELOG.md (1)

3-9: LGTM: Changelog update is appropriate

The changelog entry properly documents the dependency update to @baseapp-frontend/utils@3.0.5.

package.json Outdated
Comment on lines +22 to +23
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Revert "latest" versions to fixed versions

Using "latest" for @parcel/packager-ts and @parcel/transformer-typescript-types contradicts the PR objective of implementing fixed versions for stability. The "latest" tag can lead to unexpected breaking changes during builds.

Apply this diff to maintain fixed versions:

-    "@parcel/packager-ts": "latest",
-    "@parcel/transformer-typescript-types": "latest",
+    "@parcel/packager-ts": "2.13.2",
+    "@parcel/transformer-typescript-types": "2.13.2",
📝 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
"@parcel/packager-ts": "latest",
"@parcel/transformer-typescript-types": "latest",
"@parcel/packager-ts": "2.13.2",
"@parcel/transformer-typescript-types": "2.13.2",

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Use fixed version instead of caret range

Using ^3.3.0 for events allows minor version updates, which contradicts the PR objective of implementing fixed versions for stability.

Apply this diff to use a fixed version:

-    "events": "^3.3.0",
+    "events": "3.3.0",
📝 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
"events": "^3.3.0",
"events": "3.3.0",

@sonarqubecloud
Copy link

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 comments (2)
packages/wagtail/.storybook/__mocks__/eventEmitterMock.ts (1)

Line range hint 1-4: Replace usage of Function with an explicit function type
Static analysis reports that 'Function' is a banned type because it is overly broad. Define a specialized type for listener callbacks instead. For example:

-export class EventEmitter {
-  private events: Record<string, Function[]> = {}
+type EventListener = (...args: any[]) => void;

+export class EventEmitter {
+  private events: Record<string, EventListener[]> = {}

   on(event: string, listener: Function) {
     ...

This refactor improves readability, type safety, and aligns with best practices.

🧰 Tools
🪛 Biome (1.9.4)

[error] 17-17: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

packages/components/__mocks__/eventEmitterMock.ts (1)

Line range hint 1-4: Eliminate banned 'Function' type usage
According to linting rules, 'Function' is overly permissive. Replace it with an explicit function type to improve maintainability and correctness. For instance:

-export class EventEmitter {
-  private events: Record<string, Function[]> = {}
+type EventListener = (...args: any[]) => void;

+export class EventEmitter {
+  private events: Record<string, EventListener[]> = {}

   on(event: string, listener: Function) {
     ...

This change aligns with recommended TypeScript best practices.

🧰 Tools
🪛 Biome (1.9.4)

[error] 17-17: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

🧹 Nitpick comments (4)
packages/design-system/components/inputs/Searchbar/__storybook__/stories.tsx (1)

32-33: No functional changes, but watch out for trailing spaces.

These lines are blank or contain closing braces. Double-check for any stray whitespace to keep your file tidy.

packages/design-system/components/avatars/ClickableAvatar/__storybook__/stories.tsx (1)

10-11: Maintain consistency in starry lines.

Ensuring that your story configuration lines remain minimal and straightforward helps avoid confusion when reading through the metadata.

packages/components/modules/navigations/Header/AccountMenu/AccountPopover/__storybook__/stories.tsx (1)

Line range hint 19-42: Consider specifying the type parameter for stronger type safety.

Currently, meta is typed as Meta without a type parameter. If AccountPopover has its own props interface, you can do something like:

-const meta: Meta = {
+const meta: Meta<AccountPopoverProps> = {

This ensures stricter type checking for the component’s props in the Storybook context.

packages/components/tsconfig.json (1)

6-8: Consider more robust alternatives to path mapping

While path mapping works, it's fragile and could break if the node_modules structure changes. Consider these more robust alternatives:

  1. Use package.json resolutions (Yarn) or overrides (npm) to enforce a single version
  2. Leverage workspace features for better dependency management
  3. Properly declare peer dependencies

Example package.json configuration:

{
  "resolutions": {
    "@mui/system": "<version>"
  }
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 33176fb72489cf2d62ce79a4ad611eb29aa588c7 and f2f900b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (36)
  • package.json (1 hunks)
  • packages/authentication/CHANGELOG.md (1 hunks)
  • packages/authentication/package.json (1 hunks)
  • packages/components/CHANGELOG.md (1 hunks)
  • packages/components/__mocks__/eventEmitterMock.ts (1 hunks)
  • packages/components/modules/navigations/Header/AccountMenu/AccountPopover/__storybook__/stories.tsx (2 hunks)
  • packages/components/package.json (2 hunks)
  • packages/components/tsconfig.json (1 hunks)
  • packages/design-system/CHANGELOG.md (1 hunks)
  • packages/design-system/components/Logo/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/Popover/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/Scrollbar/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/avatars/ClickableAvatar/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/buttons/IconButton/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/dialogs/ConfirmDialog/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/dialogs/Dialog/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/displays/LoadingState/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/drawers/SwipeableDrawer/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/inputs/Searchbar/__storybook__/stories.tsx (2 hunks)
  • packages/design-system/components/inputs/SocialTextField/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/inputs/TextField/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/inputs/TextareaField/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/stories.tsx (1 hunks)
  • packages/design-system/package.json (1 hunks)
  • packages/graphql/CHANGELOG.md (1 hunks)
  • packages/graphql/package.json (1 hunks)
  • packages/provider/CHANGELOG.md (1 hunks)
  • packages/provider/package.json (1 hunks)
  • packages/utils/CHANGELOG.md (1 hunks)
  • packages/utils/package.json (2 hunks)
  • packages/wagtail/.storybook/__mocks__/eventEmitterMock.ts (1 hunks)
  • packages/wagtail/CHANGELOG.md (1 hunks)
  • packages/wagtail/package.json (1 hunks)
  • packages/wagtail/tsconfig.json (1 hunks)
  • pnpm-workspace.yaml (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/design-system/components/displays/LoadingState/storybook/stories.tsx
🚧 Files skipped from review as they are similar to previous changes (16)
  • packages/design-system/package.json
  • packages/graphql/package.json
  • packages/authentication/package.json
  • packages/wagtail/package.json
  • packages/provider/package.json
  • packages/utils/package.json
  • packages/wagtail/CHANGELOG.md
  • packages/design-system/CHANGELOG.md
  • packages/utils/CHANGELOG.md
  • package.json
  • packages/provider/CHANGELOG.md
  • packages/components/package.json
  • packages/graphql/CHANGELOG.md
  • packages/components/CHANGELOG.md
  • packages/authentication/CHANGELOG.md
  • pnpm-workspace.yaml
🧰 Additional context used
🪛 Biome (1.9.4)
packages/wagtail/.storybook/__mocks__/eventEmitterMock.ts

[error] 17-17: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

packages/components/__mocks__/eventEmitterMock.ts

[error] 17-17: Don't use 'Function' as a type.

Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.

(lint/complexity/noBannedTypes)

🔇 Additional comments (41)
packages/wagtail/tsconfig.json (1)

18-18: LGTM! Excluding the dist directory follows TypeScript best practices.

The addition of "dist" to the exclude array prevents TypeScript from processing compiled files, which is the correct approach to avoid potential circular compilation issues and improve build performance.

Let's verify if this configuration is consistent across other packages in the monorepo:

✅ Verification successful

Consistent exclude patterns found across packages with minor variations

The verification shows that all packages consistently exclude both "node_modules" and "dist" directories, with some packages having additional excludes for their specific needs:

  • Most packages follow the basic pattern of excluding "node_modules" and "dist"
  • graphql and design-system packages additionally exclude "./relay.config.js"
  • components package has extra excludes for test files ("jest", "/*.test.ts", "/*.test.tsx")

These variations are justified by the specific requirements of each package, and the core exclusion of "dist" is consistently implemented across all packages.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check tsconfig.json files across packages for consistent exclude patterns
# Expected: All tsconfig.json files should exclude both node_modules and dist

# Find all tsconfig.json files in packages directory
fd tsconfig.json packages/ --exec sh -c '
    echo "=== Checking $1 ==="
    # Extract and display the exclude array
    jq -r ".exclude // [] | @csv" "$1"
    echo
' sh {}

Length of output: 911

packages/design-system/components/inputs/TextField/__storybook__/stories.tsx (2)

6-9: Good adherence to modern Storybook patterns.

Switching to a meta constant is a more explicit way of defining Storybook metadata while improving type safety. No issues found with these lines.


11-11: Exporting the meta object is clear and conventional.

This standardized export style aligns well with current best practices. No further changes needed.

packages/design-system/components/inputs/TextareaField/__storybook__/stories.tsx (2)

6-9: Clearer separation of metadata definition.

Declaring the meta object inline with its title and component references is a neat approach that improves readability.


11-11: Consistent export of the meta object.

This export approach matches the project’s new Storybook structure. Looks good.

packages/design-system/components/Logo/__storybook__/stories.tsx (3)

1-1: Importing ComponentType is appropriate for strong typing.

This addition ensures the Logo component is typed properly when cast. Nice detail.


9-12: Properly typed Storybook meta object.

Casting Logo as ComponentType<LogoProps> further clarifies the component’s type in Storybook. Excellent usage of generics.


14-14: Clean export of the meta object.

This aligns with the updated Storybook conventions. No further adjustments needed.

packages/design-system/components/inputs/SocialTextField/__storybook__/stories.tsx (2)

6-9: Clear definition of the Storybook meta.

Defining the metadata constant separately from the export is a neat and type-safe approach.


11-11: Straightforward export aligns with best practices.

Consistent use of meta for the default export is good for maintainability and clarity.

packages/design-system/components/typographies/TypographyWithEllipsis/__storybook__/stories.tsx (2)

6-9: Consistent implementation of Storybook's Meta object.
This approach of defining a meta constant and then exporting it enhances clarity and aligns with recommended Storybook patterns.


11-11: Exporting meta as default is a recommended best practice.
Exporting the meta constant helps keep the Storybook configuration reusable and consistent across components.

packages/design-system/components/buttons/IconButton/__storybook__/stories.tsx (2)

8-11: Refactored default export to a dedicated meta constant.
This refactoring is in line with modern Storybook guidelines, making the configuration explicit and easily maintained.


13-13: Default export of meta ensures clear structure.
Keeping all Storybook metadata in a single constant fosters consistency and readability for future updates.

packages/design-system/components/Scrollbar/__storybook__/stories.tsx (2)

7-10: Refined Storybook configuration via a meta constant.
Defining metadata in a dedicated constant clarifies the component's configuration and ensures consistent typing.


12-12: Default export of the meta object.
Aligns with the recommended practice for exporting Storybook metadata, making it easier for future maintenance.

packages/design-system/components/avatars/AvatarWithPlaceholder/__storybook__/stories.tsx (2)

7-10: Adoption of a dedicated meta constant.
Establishes a uniform pattern across Storybook stories, improving readability and type safety.


12-12: Exporting meta as default.
This standard approach makes the story definition more explicit and consistent with other components.

packages/design-system/components/inputs/Searchbar/__storybook__/stories.tsx (3)

1-2: Good use of a typed import from the updated utils package.

By importing WithControllerProps, you ensure that the SearchbarProps are augmented with controller-related properties, which enhances clarity and type-safety.


8-8: Appropriate use of generics for Storybook metadata.

Defining meta with Meta<WithControllerProps<SearchbarProps>> accurately reflects the expanded prop structure. This improves maintainability and ensures type hints are preserved in Storybook.


34-34: Consistent default export pattern.

Switching to export default meta aligns with Storybook’s recommended approach to define and export story metadata.

packages/design-system/components/drawers/SwipeableDrawer/__storybook__/stories.tsx (3)

9-9: Clearer Storybook setup with typed metadata.

Defining meta as Meta<SwipeableDrawerProps> helps ensure that the SwipeableDrawer stories are properly typed and documented.


12-13: Logical grouping of metadata properties.

Keeping title and component together inside meta increases readability and consistency in your Storybook configuration.


14-14: Exporting metadata as default is consistent with recommended patterns.

Refactoring to export default meta follows the latest Storybook best practices.

packages/design-system/components/dialogs/ConfirmDialog/__storybook__/stories.tsx (3)

9-9: Meta constant approach for story typing.

Typing the metadata as Meta<ConfirmDialogProps> improves clarity around the story’s properties.


12-13: Structured metadata definition.

Organizing configuration details for Storybook in a single object fosters maintainability.


14-14: Consistent default export pattern.

Exporting meta as default aligns with the overall refactoring across your design system to improve type coverage and consistency.

packages/design-system/components/avatars/ClickableAvatar/__storybook__/stories.tsx (2)

7-7: Clearer type definition for the avatar props.

By specifying Meta<ClickableAvatarProps>, you are providing precise typing and better auto-documentation support in Storybook.


12-12: Default export maintains a consistent style across the codebase.

Defining the meta constant and exporting it simplifies the story setup and improves readability.

packages/components/modules/navigations/Header/AccountMenu/AccountPopover/__storybook__/stories.tsx (1)

44-44: No issues with the default export structure.

The default export is consistent with the updated approach and aligns with other stories in the repository.

packages/design-system/components/Popover/__storybook__/stories.tsx (2)

9-12: Good practice specifying the type parameter.

Defining meta as Meta<MenuPopoverProps> ensures better type checking for the Popover's props.


14-14: Default export is concise and clear.

Exporting meta as the default is a straightforward approach, improving clarity in the Storybook configuration.

packages/design-system/components/dialogs/Dialog/__storybook__/stories.tsx (2)

9-12: Clear type specification on meta.

Defining meta as Meta<DialogProps> helps maintain better type safety and consistency in Storybook stories.


14-14: Maintains alignment with the updated Storybook export style.

No issues found with the default export. The structure follows the recommended pattern.

packages/wagtail/.storybook/__mocks__/eventEmitterMock.ts (3)

8-8: Optional chaining implemented correctly
Utilizing optional chaining (?.) here is a safe way to avoid errors when events[event] might be undefined. Good job on preventing potential runtime exceptions.


13-13: Optional chaining in emit()
Again, optional chaining is properly utilized. This ensures that the iteration only executes if the array is defined.


19-20: Confirm necessity of // @ts-ignore
While this ignore directive prevents type errors, consider whether it's strictly necessary. If the filter logic can be safely typed (e.g., when you change the function type away from Function), this directive may no longer be required.

packages/components/__mocks__/eventEmitterMock.ts (3)

8-8: Optional chaining for safeguarding your push() operation
This usage of ?.push() is a robust way to avoid potential errors when events[event] is uninitialized.


13-13: Safe iteration with optional chaining
Using ?.forEach() ensures that no error is thrown if this.events[event] is undefined. This helps prevent runtime exceptions.


19-20: Assess // @ts-ignore
If you switch from using Function to a strongly typed function signature, you may not require this ignore directive. Consider removing it after applying the stronger type.

packages/components/tsconfig.json (1)

6-8: Verify if this path mapping is necessary

The explicit path mapping to node_modules suggests potential dependency resolution issues. Let's verify if this is required:

✅ Verification successful

Let me try a different approach to verify the necessity of this path mapping.


Let me try one more verification to check the actual imports and usage patterns.


Based on the verification results, I can now provide a final response:

Path mapping to @mui/system is necessary for consistent dependency resolution

The path mapping in tsconfig.json is justified based on the following findings:

  • Multiple packages (wagtail, design-system, components) depend on @mui/system
  • The codebase has direct imports of @mui/system in several files
  • All Material-UI dependencies are managed through a "catalog:material-ui" version specification
  • The path mapping ensures consistent resolution of @mui/system across the monorepo
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for multiple @mui/system versions that might cause conflicts
echo "Checking for multiple @mui/system installations..."
find . -name "node_modules" -type d -exec find {} -name "@mui" -type d \; | grep system

# Check package-lock.json or yarn.lock for @mui/system references
echo "Checking lock files for @mui/system versions..."
find . -name "package-lock.json" -o -name "yarn.lock" -exec grep -l "@mui/system" {} \;

Length of output: 391


Script:

#!/bin/bash
# Check package.json files for @mui/system dependency
echo "Checking package.json files for @mui/system..."
fd package.json --type f --exec grep -l "@mui/system" {}

# Check for imports of @mui/system in the codebase
echo "Checking imports of @mui/system..."
rg "from ['\"]\@mui/system['\"]" -l

# Check tsconfig files for any other path mappings
echo "Checking other tsconfig files..."
fd tsconfig.json --type f --exec cat {}

Length of output: 4764


Script:

#!/bin/bash
# Check for @mui/system imports with proper escaping
echo "Checking @mui/system imports..."
rg -l "from ['\"]@mui/system['\"]"

# Check package.json contents for dependency details
echo "Checking package.json contents for @mui/system..."
fd package.json --type f --exec sh -c 'echo "=== $1 ==="; cat "$1"' sh {}

# Look for any Material-UI related imports
echo "Checking Material-UI related imports..."
rg -l "@mui/"

Length of output: 47996

@anicioalexandre anicioalexandre merged commit 2ed2bb1 into master Dec 25, 2024
9 checks passed
@anicioalexandre anicioalexandre deleted the BA-2012-stable-versions branch December 25, 2024 14:16
@coderabbitai coderabbitai bot mentioned this pull request Sep 16, 2025
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.

2 participants