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: add missing package dependencies #509

Merged
merged 5 commits into from
Oct 29, 2024
Merged

Conversation

billyjacoby
Copy link
Contributor

@billyjacoby billyjacoby commented Oct 29, 2024

Summary by CodeRabbit

  • Bug Fixes

    • Removed the link-module-alias dependency across multiple packages, which may improve module aliasing behavior.
    • Updated build scripts to streamline the build process by removing unnecessary commands.
  • New Features

    • Added a gitHead field to various packages for better version control tracking.
  • Chores

    • Updated build and build:watch scripts to include the --force flag for TypeScript compilation, enhancing build reliability.

Copy link

coderabbitai bot commented Oct 29, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request involves updates to multiple package.json files across various packages within the @injectivelabs organization. The primary change across all files is the removal of the link-module-alias dependency from the dependencies section. Additionally, scripts related to postinstall, build, and build:watch have been modified to eliminate references to link-module-alias. The gitHead field has been updated to a new commit hash in each package. No other structural changes were made to the packages.

Changes

File Path Change Summary
packages/exceptions/package.json Removed link-module-alias dependency; modified scripts to remove references to it; updated gitHead.
packages/networks/package.json Removed link-module-alias dependency; modified scripts to remove references to it; updated gitHead.
packages/sdk-ts/package.json Removed link-module-alias dependency; modified scripts to remove references to it; updated gitHead.
packages/test-utils/package.json Removed link-module-alias dependency; modified scripts to remove references to it; updated gitHead.
packages/ts-types/package.json Removed link-module-alias dependency; modified scripts to remove references to it; updated gitHead.
packages/utils/package.json Removed link-module-alias dependency; modified scripts to remove references to it; updated gitHead.
packages/wallet-ts/package.json Removed link-module-alias dependency; modified scripts to remove references to it; updated gitHead.
packages/wallets/wallet-base/package.json Removed link-module-alias dependency; modified scripts to remove references to it; added gitHead.
packages/wallets/wallet-cosmos-strategy/package.json Removed link-module-alias dependency; modified scripts to remove references to it; added gitHead.
packages/wallets/wallet-cosmos/package.json Removed link-module-alias dependency; modified scripts to remove references to it; updated gitHead.
packages/wallets/wallet-evm/package.json Removed link-module-alias dependency; modified scripts to remove references to it; updated gitHead.
packages/wallets/wallet-ledger/package.json Removed link-module-alias dependency; modified scripts to remove references to it; added gitHead.
packages/wallets/wallet-strategy/package.json Removed link-module-alias dependency; added gitHead.
packages/wallets/wallet-trezor/package.json Removed link-module-alias dependency; modified scripts to remove references to it; added gitHead.
packages/wallets/wallet-core/package.json Updated build scripts to include --force; added gitHead.
packages/wallets/wallet-cosmostation/package.json Updated build scripts to include --force; added gitHead.
packages/wallets/wallet-magic/package.json Updated build scripts to include --force; added gitHead.
packages/wallets/wallet-private-key/package.json Updated build scripts to include --force; added gitHead.
packages/wallets/wallet-wallet-connect/package.json Updated build scripts to include --force; added gitHead.

Possibly related PRs

  • feat/proto generation #505: The changes in the main PR regarding the removal of the link-module-alias dependency and modifications to the package.json scripts are related to the updates in the package.json files introduced in this PR, which also involve changes to dependencies and scripts, although they focus on protocol generation rather than the specific dependency removal.

Suggested reviewers

  • ThomasRalee

🐰 In the meadow, changes bloom,
Dependencies fade, making room.
Scripts now dance without a care,
With link-module-alias no longer there.
A hop, a skip, a build so bright,
In CodeRabbit's world, all feels right! 🐇✨


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.

Copy link

socket-security bot commented Oct 29, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

Copy link

socket-security bot commented Oct 29, 2024

Report too large to display inline

View full report↗︎

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

🧹 Outside diff range and nitpick comments (2)
packages/wallets/wallet-ledger/package.json (1)

Line range hint 15-18: Consider documenting module alias usage.

The package uses module aliases (_moduleAliases) but the mechanism to apply them is being changed. Consider adding a comment in the package.json to document how these aliases are now being handled across the workspace.

package.json (1)

89-89: Document the module aliasing strategy.

Since you're centralizing the module aliasing configuration, consider adding documentation about:

  1. How module aliases are configured and managed
  2. The relationship between link-module-alias and tsc-alias
  3. Any required steps for developers when adding new aliases

Would you like me to help create a documentation template for this?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b4b6317 and 3e57c96.

📒 Files selected for processing (15)
  • package.json (1 hunks)
  • packages/exceptions/package.json (0 hunks)
  • packages/networks/package.json (0 hunks)
  • packages/sdk-ts/package.json (0 hunks)
  • packages/test-utils/package.json (0 hunks)
  • packages/ts-types/package.json (0 hunks)
  • packages/utils/package.json (0 hunks)
  • packages/wallet-ts/package.json (0 hunks)
  • packages/wallets/wallet-base/package.json (0 hunks)
  • packages/wallets/wallet-cosmos-strategy/package.json (0 hunks)
  • packages/wallets/wallet-cosmos/package.json (0 hunks)
  • packages/wallets/wallet-evm/package.json (0 hunks)
  • packages/wallets/wallet-ledger/package.json (1 hunks)
  • packages/wallets/wallet-strategy/package.json (0 hunks)
  • packages/wallets/wallet-trezor/package.json (0 hunks)
💤 Files with no reviewable changes (13)
  • packages/exceptions/package.json
  • packages/networks/package.json
  • packages/sdk-ts/package.json
  • packages/test-utils/package.json
  • packages/ts-types/package.json
  • packages/utils/package.json
  • packages/wallet-ts/package.json
  • packages/wallets/wallet-base/package.json
  • packages/wallets/wallet-cosmos-strategy/package.json
  • packages/wallets/wallet-cosmos/package.json
  • packages/wallets/wallet-evm/package.json
  • packages/wallets/wallet-strategy/package.json
  • packages/wallets/wallet-trezor/package.json
🔇 Additional comments (1)
packages/wallets/wallet-ledger/package.json (1)

Line range hint 1-67: Verify the availability of link-module-alias for build scripts.

The package still uses link-module-alias in its scripts (postinstall and build) but the dependency has been removed. This could break the build process if the dependency isn't available through the workspace.

Let's verify the dependency availability:

✅ Verification successful

link-module-alias dependency is available through workspace root

The dependency is correctly managed at the workspace level:

  • Found in root package.json as version ^1.2.0
  • Also available in @injectivelabs/injective-ts package

The removal of the direct dependency while maintaining the scripts is the correct approach for workspace-level dependency management. The build process will continue to work as expected since the dependency is available through the workspace root.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if link-module-alias is available in the root package.json
echo "Checking root package.json for link-module-alias..."
jq '.dependencies["link-module-alias"] // .devDependencies["link-module-alias"] // empty' package.json

# Check if any workspace package still has link-module-alias
echo "Checking workspace packages for link-module-alias..."
fd --type f package.json --exec jq -r 'select(.dependencies["link-module-alias"] // .devDependencies["link-module-alias"]) | "\(.name): link-module-alias found"'

Length of output: 558

package.json Outdated
@@ -86,6 +86,7 @@
"jest-junit": "^15.0.0",
"lerna": "6.6.1",
"lint-staged": "^11.1.2",
"link-module-alias": "^1.2.0",
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Module aliasing setup needs attention

The verification reveals potential issues with the module aliasing setup:

  • The root package.json doesn't have any link-module-alias related scripts, but the package is being added as a devDependency
  • Individual packages have _moduleAliases configurations (e.g., wallet-strategy uses ~wallet-strategy)
  • The project uses TypeScript path mappings in tsconfig.json for workspace packages
  • Both link-module-alias and tsc-alias are present, but neither appears to be properly integrated in the build process

This suggests that adding link-module-alias without corresponding script setup might not achieve the intended module aliasing functionality. The module aliasing strategy needs to be unified - either fully migrate to TypeScript paths with tsc-alias or properly configure link-module-alias in the build process.

🔗 Analysis chain

LGTM! Centralizing module aliasing in root package.

Moving link-module-alias to root devDependencies while removing it from individual packages is a good practice to avoid dependency duplication across the monorepo.

Let's verify the module aliasing setup:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for module alias configurations and potential conflicts

# Test 1: Look for _moduleAliases in package.json files
echo "Checking for module alias configurations..."
rg -l '"_moduleAliases"' --type json

# Test 2: Check for postinstall scripts that might use link-module-alias
echo "Checking for link-module-alias usage in scripts..."
rg -l 'link-module-alias' --type json

# Test 3: Look for tsconfig paths configurations
echo "Checking for path mappings in tsconfig..."
fd tsconfig.json --exec grep -l '"paths"' {} \;

Length of output: 1993


Script:

#!/bin/bash
# Let's check the actual module alias configurations and scripts

# Check root package.json scripts
echo "=== Root package.json scripts ==="
cat package.json | jq '.scripts'

# Check _moduleAliases configuration in one of the packages
echo -e "\n=== Sample _moduleAliases configuration from wallet-strategy ==="
cat packages/wallets/wallet-strategy/package.json | jq '._moduleAliases'

# Check tsconfig paths configuration
echo -e "\n=== TSConfig paths configuration ==="
cat tsconfig.json | jq '.compilerOptions.paths'

# Check if there are any tsc-alias usages in scripts
echo -e "\n=== Checking for tsc-alias usage ==="
rg -l 'tsc-alias' --type json

Length of output: 3602

@bangjelkoski bangjelkoski merged commit a3dcfb3 into dev Oct 29, 2024
3 checks passed
@bangjelkoski bangjelkoski deleted the fix/wallet-package-deps branch October 29, 2024 21:11
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