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

knip #2635

Merged
merged 4 commits into from
Jan 11, 2025
Merged

knip #2635

merged 4 commits into from
Jan 11, 2025

Conversation

aymericdelab
Copy link
Collaborator

@aymericdelab aymericdelab commented Jan 11, 2025

Summary by CodeRabbit

Here are the release notes for the pull request:

  • Configuration

    • Added new configuration file .knip.json to specify file and directory exclusion patterns
    • Removed various configuration files across different applications
  • Code Cleanup

    • Removed multiple utility functions, hooks, and type definitions
    • Simplified import and export statements in various modules
    • Removed unused components and interfaces
  • Module Restructuring

    • Updated import paths in several model manager files
    • Reorganized module structure in SDK packages
    • Removed deprecated or unused scripts
  • Component Visibility

    • Modified export status of multiple components, making them local to their respective modules
    • Reduced the number of publicly accessible entities in various files

These changes appear to be focused on code maintenance, reducing complexity, and improving the overall project structure.

Copy link

vercel bot commented Jan 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eternum ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2025 0:24am
eternum-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2025 0:24am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
eternum-landing ⬜️ Ignored (Inspect) Visit Preview Jan 11, 2025 0:24am

Copy link
Contributor

mentatbot bot commented Jan 11, 2025

Hi @aymericdelab! You need to be added as a user to interact with me. Please ask @ponderingdemocritus to add you on the settings page.

You are receiving this comment because I am set to review all PRs. That is configurable here.

Copy link
Contributor

coderabbitai bot commented Jan 11, 2025

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.

client/apps/balancing/src/components/ui/badge.tsx

Oops! Something went wrong! :(

ESLint: 9.17.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.

Walkthrough

This pull request introduces a comprehensive set of changes across multiple files in the client applications, primarily focusing on code organization, type visibility, and module restructuring. The modifications include removing exported entities, changing import paths, deleting entire files, and simplifying the codebase. The changes appear to be part of a broader effort to streamline the project's structure, reduce complexity, and potentially prepare for future architectural improvements.

Changes

File/Directory Change Summary
.knip.json New configuration file added to specify ignored paths during processing
client/apps/balancing/src/components/ui/badge.tsx Removed export of BadgeProps and badgeVariants
client/apps/balancing/src/components/ui/table.tsx Removed exports for TableFooter and TableCaption
Multiple files in client/apps/game/ Removed various hooks, components, and utility functions related to sound, quests, and UI elements
Multiple files in client/apps/landing/ Significant reduction in exported types, interfaces, and utility functions across various modules
client/sdk/packages/eternum/src/ Updated import paths for ClientComponents and ContractComponents across multiple files

Poem

🐰 Hop, hop, through the code's dense grove,
Trimming exports with a playful shove.
Paths rearranged, types tucked away,
Simplifying code's wild display!
A cleaner codebase, lean and bright 🌟

Finishing Touches

  • 📝 Generate Docstrings (Beta)

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

Failed to generate code suggestions for PR

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

🔭 Outside diff range comments (3)
client/apps/landing/src/lib/utils.ts (1)

Line range hint 11-14: Handle edge cases for shorter addresses

If the input string is shorter than expected (less than 10 characters), the function may produce incorrect results or throw an error. Consider adding a check to handle such cases.

Apply this diff to fix the issue:

 export function displayAddress(string: string) {
   if (string === undefined) return "unknown";
+  if (string.length <= 10) return string;
   return string.substring(0, 6) + "..." + string.substring(string.length - 4);
 }
client/apps/landing/src/components/modules/bridge-out-step-2.tsx (2)

Line range hint 41-49: Remove commented out code.

The commented out useMemo hooks for donkeysArrivals and donkeyArrivalsEntityIds are no longer used. Clean up the codebase by removing these comments.

-  /*const donkeysArrivals = useMemo(() => {
-    if (bankPosition) {
-      return getOwnerArrivalsAtBank(realmEntityIds as number[]);
-    }
-  }, [realmEntityIds, refreshTrigger, bankPosition]);*/
-
-  /*const donkeyArrivalsEntityIds = useMemo(() => {
-    return donkeyArrivals?.map((entity) => {
-      const position = getComponentValue(dojo.setup.components.Position, entity);
-      return position?.entity_id;
-    });
-  }, [donkeyArrivals]) as number[];*/

Line range hint 51-51: Remove commented out hook call.

The commented out useSyncEntity hook call is no longer needed.

-  //useSyncEntity(donkeyArrivalsEntityIds);
🧹 Nitpick comments (5)
client/apps/game/src/dojo/setup.ts (2)

Line range hint 31-35: Fix misleading comment about debounce time.

The comment states "Increased debounce time to 1 second" but the actual value is set to 200ms. Please update the comment to reflect the actual debounce time.

-  }, 200); // Increased debounce time to 1 second for larger batches
+  }, 200); // Debounce time set to 200ms for batching updates

Line range hint 201-201: Consider filtering entities for better performance.

The syncEntitiesDebounced is called with an empty array for entityKeyClause, which means it's syncing all entities without filtering. For large-scale deployments, this could lead to performance issues.

Consider adding appropriate entity key clauses to filter and sync only the required entities, similar to how specific models are filtered in the getEvents calls below.

client/apps/landing/src/lib/utils.ts (1)

7-9: Consider using Intl.NumberFormat for locale-aware number formatting

The current implementation uses a regular expression to add thousand separators. Utilizing Intl.NumberFormat can provide better locale support and simplify the code.

Apply this diff to refactor the function:

-export const formatNumber = (num: number, decimals: number): string => {
-  return num.toFixed(decimals).replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
-};
+export const formatNumber = (num: number, decimals: number): string => {
+  return new Intl.NumberFormat(undefined, {
+    minimumFractionDigits: decimals,
+    maximumFractionDigits: decimals,
+  }).format(num);
+};
client/apps/game/src/hooks/useUISound.tsx (2)

Line range hint 134-136: Remove unnecessary eslint disable comment.

The switch statement is actually quite large, so the sonarjs/no-small-switch disable comment appears to be outdated and can be removed.


Line range hint 134-220: Consider refactoring the resource sound mapping.

The large switch statement could be replaced with a more maintainable object mapping.

Here's a suggested refactor:

-  // eslint-disable-next-line sonarjs/no-small-switch
-  const playResourceSound = (resourceId: ResourcesIds) => {
-    switch (resourceId) {
-      case ResourcesIds.Fish:
-        playFishingVillage();
-        break;
-      // ... many more cases
-    }
-  };
+  const resourceSoundMap = {
+    [ResourcesIds.Fish]: playFishingVillage,
+    [ResourcesIds.Wheat]: playFarm,
+    [ResourcesIds.Wood]: playAddWood,
+    // ... map remaining resources
+  } as const;
+
+  const playResourceSound = (resourceId: ResourcesIds) => {
+    resourceSoundMap[resourceId]?.();
+  };

This approach:

  • Eliminates the need for a switch statement
  • Reduces code duplication
  • Makes it easier to maintain and update
  • Provides better type safety
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a497425 and ca2e03d.

📒 Files selected for processing (73)
  • .knip.json (1 hunks)
  • client/.knip.json (0 hunks)
  • client/apps/balancing/src/components/ui/badge.tsx (2 hunks)
  • client/apps/balancing/src/components/ui/table.tsx (1 hunks)
  • client/apps/game/.eslintrc.json (0 hunks)
  • client/apps/game/pwa-assets.config.ts (0 hunks)
  • client/apps/game/src/dojo/contractComponents.ts (0 hunks)
  • client/apps/game/src/dojo/debouncedQueries.ts (0 hunks)
  • client/apps/game/src/dojo/queries.ts (0 hunks)
  • client/apps/game/src/dojo/setup.ts (1 hunks)
  • client/apps/game/src/dojo/worker.ts (0 hunks)
  • client/apps/game/src/hooks/context/mainnet-policies.tsx (0 hunks)
  • client/apps/game/src/hooks/helpers/useQuests.tsx (1 hunks)
  • client/apps/game/src/hooks/store/useQuestStore.tsx (0 hunks)
  • client/apps/game/src/hooks/store/useWorldLoading.tsx (1 hunks)
  • client/apps/game/src/hooks/useUISound.tsx (1 hunks)
  • client/apps/game/src/three/components/FogManager.ts (0 hunks)
  • client/apps/game/src/three/scenes/constants.ts (1 hunks)
  • client/apps/game/src/ui/components/resources/realm-transfer.tsx (1 hunks)
  • client/apps/game/src/ui/elements/Switch.tsx (0 hunks)
  • client/apps/game/src/ui/utils/utils.tsx (1 hunks)
  • client/apps/landing/env.ts (0 hunks)
  • client/apps/landing/src/components/modules/bridge-out-step-1.tsx (1 hunks)
  • client/apps/landing/src/components/modules/bridge-out-step-2.tsx (1 hunks)
  • client/apps/landing/src/components/modules/bridged-resources.tsx (1 hunks)
  • client/apps/landing/src/components/modules/cartridge-connect-button.tsx (0 hunks)
  • client/apps/landing/src/components/modules/filters.tsx (0 hunks)
  • client/apps/landing/src/components/modules/guild-leaderboard-panel.tsx (0 hunks)
  • client/apps/landing/src/components/modules/leaderboard.tsx (0 hunks)
  • client/apps/landing/src/components/modules/realm-card.tsx (1 hunks)
  • client/apps/landing/src/components/ui/command.tsx (0 hunks)
  • client/apps/landing/src/components/ui/custom-iframe.tsx (0 hunks)
  • client/apps/landing/src/components/ui/utils/utils.ts (1 hunks)
  • client/apps/landing/src/config.ts (2 hunks)
  • client/apps/landing/src/dojo/contractComponents.ts (1 hunks)
  • client/apps/landing/src/dojo/createClientComponents.ts (1 hunks)
  • client/apps/landing/src/dojo/queries.ts (0 hunks)
  • client/apps/landing/src/hooks/context/DojoContext.tsx (1 hunks)
  • client/apps/landing/src/hooks/get-guilds.tsx (0 hunks)
  • client/apps/landing/src/hooks/gql/fragment-masking.ts (1 hunks)
  • client/apps/landing/src/hooks/helpers/use-contributions.tsx (0 hunks)
  • client/apps/landing/src/hooks/helpers/useEntities.tsx (1 hunks)
  • client/apps/landing/src/hooks/query/leaderboard.tsx (0 hunks)
  • client/apps/landing/src/hooks/query/players.tsx (0 hunks)
  • client/apps/landing/src/hooks/use-entities-utils.tsx (0 hunks)
  • client/apps/landing/src/hooks/use-get-all-players.tsx (0 hunks)
  • client/apps/landing/src/hooks/use-lords-bridged.tsx (0 hunks)
  • client/apps/landing/src/hooks/use-realms-settled.tsx (0 hunks)
  • client/apps/landing/src/hooks/useCollectionTokens.tsx (0 hunks)
  • client/apps/landing/src/hooks/usePrizeClaim.tsx (0 hunks)
  • client/apps/landing/src/lib/ark/getCollectionTokens.ts (0 hunks)
  • client/apps/landing/src/lib/utils.ts (1 hunks)
  • client/apps/landing/src/types/index.ts (0 hunks)
  • client/apps/landing/src/utils/leaderboard.tsx (0 hunks)
  • client/apps/landing/tsconfig.app.tsbuildinfo (1 hunks)
  • client/config/speed.ts (0 hunks)
  • client/sdk/packages/eternum/src/dojo/index.ts (1 hunks)
  • client/sdk/packages/eternum/src/index.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/ArmyManager.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/ArmyMovementManager.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/BattleManager.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/ConfigManager.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/LeaderboardManager.ts (2 hunks)
  • client/sdk/packages/eternum/src/modelManager/MarketManager.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/ResourceInventoryManager.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/ResourceManager.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/StaminaManager.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/TileManager.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/types/index.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/utils/ArmyMovementUtils.ts (1 hunks)
  • client/sdk/packages/eternum/src/modelManager/utils/LeaderboardUtils.ts (1 hunks)
  • client/sdk/packages/eternum/src/scripts/extract.ts (0 hunks)
  • client/sdk/packages/eternum/src/scripts/extractBuildings.ts (0 hunks)
💤 Files with no reviewable changes (35)
  • client/apps/landing/src/hooks/use-realms-settled.tsx
  • client/config/speed.ts
  • client/apps/landing/env.ts
  • client/apps/landing/src/hooks/query/players.tsx
  • client/.knip.json
  • client/apps/landing/src/hooks/useCollectionTokens.tsx
  • client/apps/game/src/hooks/context/mainnet-policies.tsx
  • client/apps/game/.eslintrc.json
  • client/apps/landing/src/components/modules/guild-leaderboard-panel.tsx
  • client/apps/game/src/dojo/contractComponents.ts
  • client/apps/landing/src/hooks/query/leaderboard.tsx
  • client/apps/landing/src/components/modules/filters.tsx
  • client/sdk/packages/eternum/src/scripts/extract.ts
  • client/apps/landing/src/hooks/use-entities-utils.tsx
  • client/apps/landing/src/components/ui/custom-iframe.tsx
  • client/apps/landing/src/hooks/use-lords-bridged.tsx
  • client/apps/landing/src/hooks/get-guilds.tsx
  • client/apps/landing/src/hooks/usePrizeClaim.tsx
  • client/apps/landing/src/components/modules/leaderboard.tsx
  • client/apps/game/pwa-assets.config.ts
  • client/apps/game/src/three/components/FogManager.ts
  • client/apps/landing/src/hooks/helpers/use-contributions.tsx
  • client/apps/game/src/ui/elements/Switch.tsx
  • client/sdk/packages/eternum/src/scripts/extractBuildings.ts
  • client/apps/landing/src/dojo/queries.ts
  • client/apps/game/src/dojo/worker.ts
  • client/apps/landing/src/components/modules/cartridge-connect-button.tsx
  • client/apps/landing/src/hooks/use-get-all-players.tsx
  • client/apps/game/src/hooks/store/useQuestStore.tsx
  • client/apps/landing/src/utils/leaderboard.tsx
  • client/apps/game/src/dojo/debouncedQueries.ts
  • client/apps/game/src/dojo/queries.ts
  • client/apps/landing/src/components/ui/command.tsx
  • client/apps/landing/src/lib/ark/getCollectionTokens.ts
  • client/apps/landing/src/types/index.ts
✅ Files skipped from review due to trivial changes (19)
  • client/sdk/packages/eternum/src/modelManager/LeaderboardManager.ts
  • client/apps/landing/src/components/modules/realm-card.tsx
  • client/sdk/packages/eternum/src/modelManager/TileManager.ts
  • client/sdk/packages/eternum/src/modelManager/utils/ArmyMovementUtils.ts
  • client/apps/game/src/ui/components/resources/realm-transfer.tsx
  • client/sdk/packages/eternum/src/modelManager/utils/LeaderboardUtils.ts
  • client/sdk/packages/eternum/src/modelManager/ResourceInventoryManager.ts
  • client/sdk/packages/eternum/src/modelManager/ConfigManager.ts
  • client/sdk/packages/eternum/src/modelManager/ArmyMovementManager.ts
  • client/apps/landing/tsconfig.app.tsbuildinfo
  • client/sdk/packages/eternum/src/modelManager/BattleManager.ts
  • client/sdk/packages/eternum/src/modelManager/ResourceManager.ts
  • client/sdk/packages/eternum/src/dojo/index.ts
  • client/sdk/packages/eternum/src/modelManager/StaminaManager.ts
  • client/sdk/packages/eternum/src/modelManager/MarketManager.ts
  • client/sdk/packages/eternum/src/modelManager/ArmyManager.ts
  • .knip.json
  • client/apps/landing/src/hooks/gql/fragment-masking.ts
  • client/sdk/packages/eternum/src/modelManager/types/index.ts
⏰ Context from checks skipped due to timeout of 90000ms (17)
  • GitHub Check: test-various (test_ownership_systems)
  • GitHub Check: test-various (transport_test)
  • GitHub Check: test-various (guild_test)
  • GitHub Check: test-various (realm_test)
  • GitHub Check: test-various (trade_test)
  • GitHub Check: test-various (resource_bridge_test)
  • GitHub Check: test-various (map_test)
  • GitHub Check: test-various (bank_test)
  • GitHub Check: test-various (hyperstructure_test)
  • GitHub Check: test-various (config_test)
  • GitHub Check: test-various (resources_test)
  • GitHub Check: test-various (position_test)
  • GitHub Check: test-various (owner_test)
  • GitHub Check: test-various (combat_test)
  • GitHub Check: test-various (season_test)
  • GitHub Check: clippy
  • GitHub Check: Run pr agent on every pull request, respond to user comments
🔇 Additional comments (18)
client/sdk/packages/eternum/src/index.ts (1)

3-3: LGTM! The new dojo module export follows the established pattern.

The addition of export * from "./dojo" maintains consistency with the existing barrel file structure and aligns with the module organization pattern used throughout the file.

Let's verify the dojo module's existence and structure:

✅ Verification successful

The dojo module export is valid and properly structured

The module exists at the correct location and follows the established barrel file pattern, re-exporting from contractComponents and createClientComponents sub-modules.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the dojo module structure and its exports

# Check if the dojo module exists
fd -t f "index.ts" client/sdk/packages/eternum/src/dojo

# Examine the dojo module's exports
rg -t ts "export \*" client/sdk/packages/eternum/src/dojo

Length of output: 333

client/apps/game/src/dojo/setup.ts (1)

22-22: LGTM! Good encapsulation of internal functionality.

The removal of the export declaration is a positive change that properly encapsulates this utility function within its module, as it's only used internally by the setup function.

client/apps/landing/src/lib/utils.ts (1)

1-6: Code changes look good

The imports and functions cn, multiplyByPrecision, and divideByPrecision are correctly implemented and adhere to best practices.

Also applies to: 15-20

client/apps/landing/src/dojo/createClientComponents.ts (1)

4-4: LGTM! Safe removal of unnecessary type export.

The ClientComponents type is correctly scoped as internal since it's only used within this file. External consumers can still derive the type using typeof createClientComponents if needed.

client/apps/balancing/src/components/ui/badge.tsx (1)

23-23: LGTM! Improved component encapsulation.

Good cleanup of the public API surface. Only the Badge component needs to be exported, while BadgeProps and badgeVariants are correctly kept as internal implementation details.

Also applies to: 29-29

client/apps/game/src/hooks/store/useWorldLoading.tsx (1)

20-22: LGTM! Appropriate scoping of internal type.

The LoadingState type is correctly made internal since it's just an implementation detail. External consumers have all they need with the exported LoadingStateKey enum and WorldStore interface.

client/apps/landing/src/config.ts (1)

3-7: Verify removal of configuration exports.

While making these configuration entities internal improves encapsulation, please verify that:

  1. No other modules need the Chain or Token enums for type checking
  2. The tokens and chain constants aren't needed for configuration elsewhere
  3. Exporting only the derived addresses is sufficient for all use cases

Also applies to: 9-13, 15-67, 68-68

client/apps/landing/src/hooks/helpers/useEntities.tsx (1)

8-19: LGTM! Good encapsulation of internal type guards.

The removal of exports for S0EternumRealm interface and type guard functions improves encapsulation since these are only used internally within the module.

client/apps/balancing/src/components/ui/table.tsx (1)

76-76: Verify removal of TableFooter and TableCaption exports.

Let's confirm that these components aren't used elsewhere in the codebase.

✅ Verification successful

Removal of TableFooter and TableCaption exports is safe

These components are not being used anywhere in the codebase. No JSX usage or imports were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any usage of TableFooter or TableCaption components
echo "Searching for TableFooter usage..."
rg "TableFooter" --type tsx --type jsx

echo "Searching for TableCaption usage..."
rg "TableCaption" --type tsx --type jsx

Length of output: 294


Script:

#!/bin/bash
# Search for any usage or imports of TableFooter or TableCaption
echo "Searching for TableFooter..."
rg "TableFooter" -g "*.{tsx,jsx,ts,js}" -B 1 -A 1

echo -e "\nSearching for TableCaption..."
rg "TableCaption" -g "*.{tsx,jsx,ts,js}" -B 1 -A 1

Length of output: 2568


Script:

#!/bin/bash
# Search for actual usage of TableFooter and TableCaption in JSX and imports
echo "Searching for TableFooter usage..."
rg "<TableFooter" -g "*.{tsx,jsx,ts,js}" -B 1 -A 1
rg "import.*TableFooter" -g "*.{tsx,jsx,ts,js}" -B 1 -A 1

echo -e "\nSearching for TableCaption usage..."
rg "<TableCaption" -g "*.{tsx,jsx,ts,js}" -B 1 -A 1
rg "import.*TableCaption" -g "*.{tsx,jsx,ts,js}" -B 1 -A 1

Length of output: 393

client/apps/landing/src/hooks/context/DojoContext.tsx (1)

26-33: LGTM! Proper encapsulation of React Context internals.

Good practice to only expose the provider and hook while keeping the context and types internal. This follows React's context pattern and reduces the public API surface.

client/apps/game/src/hooks/useUISound.tsx (1)

1-2: LGTM! Clean imports.

The imports are minimal and focused on the required functionality.

client/apps/landing/src/components/modules/bridged-resources.tsx (1)

107-107: LGTM! Good encapsulation.

Making BridgeResource a local component is a good choice since it's only used within this module. This change improves encapsulation and reduces the public API surface.

client/apps/game/src/hooks/helpers/useQuests.tsx (1)

176-176: LGTM! Good encapsulation.

Making useQuestClaimStatus a local hook is appropriate since it's only used within this module. This change improves encapsulation and reduces the public API surface.

client/apps/game/src/three/scenes/constants.ts (1)

80-80: LGTM! Good encapsulation.

Making BiomeFilenames a local enum is appropriate since it's only used within this module by biomeModelPaths. This change improves encapsulation and reduces the public API surface.

client/apps/landing/src/components/ui/utils/utils.ts (1)

376-376: LGTM! Good encapsulation.

Making ResourceAddresses a local interface is appropriate since it's only used within this module by getSeasonAddresses. This change improves encapsulation and reduces the public API surface.

client/apps/landing/src/components/modules/bridge-out-step-1.tsx (1)

Line range hint 318-367: LGTM! Good architectural improvement.

Converting SelectResourceRow to a locally scoped component improves encapsulation. This component is only used within this file, so removing its export reduces the public API surface area.

client/apps/game/src/ui/utils/utils.tsx (1)

444-450: LGTM! Good encapsulation of internal utilities.

Making getSeasonAddressesPath and getJSONFile private functions improves encapsulation. These functions are implementation details of getSeasonAddresses and don't need to be exposed.

client/apps/landing/src/dojo/contractComponents.ts (1)

5-5: LGTM! Good type encapsulation.

Making ContractComponents a private type improves encapsulation. This type appears to be an implementation detail of the contract components system.

@aymericdelab aymericdelab merged commit 3e63503 into next Jan 11, 2025
21 of 29 checks passed
@aymericdelab aymericdelab deleted the clean/knip branch January 11, 2025 12:25
@coderabbitai coderabbitai bot mentioned this pull request Jan 11, 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.

1 participant