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 Build Issue #59

Merged
merged 10 commits into from
Feb 27, 2025
Merged

Fix Build Issue #59

merged 10 commits into from
Feb 27, 2025

Conversation

vignesha22
Copy link
Contributor

@vignesha22 vignesha22 commented Feb 26, 2025

Description

  • Fixed build issues faced on React by changing build command to bun
  • Added types build folder separately

Types of changes

What types of changes does your code introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Further comments (optional)

Summary by CodeRabbit

  • Build & Configuration

    • Updated Node.js Docker image version to cimg/node:20.11.1 for improved compatibility.
    • Transitioned from npm to Bun for dependency management, updating installation and build commands accordingly.
  • Code Refactor

    • Updated all module import/export statements to use explicit file extensions for improved clarity.
    • Enhanced internal error handling with additional checks in key SDK and wallet components.
  • Chores

    • Overall internal cleanup and consistency improvements to ensure a more reliable and maintainable codebase.

Copy link

coderabbitai bot commented Feb 26, 2025

Walkthrough

This PR consolidates and standardizes module resolution across the codebase. Major updates include explicit addition of “.js” extensions in import/export paths, removal of obsolete polyfill files, and adjustments to error handling and type declarations in several modules. In addition, package metadata has been updated (version bump, new build scripts using bun, dependency changes) and TypeScript configurations have been reworked with several new config files replacing older ones.

Changes

File(s) Change Summary
.gitignore Consolidated handling of the dist directory by adding an entry under # build and removing the previous entry under # dist.
CHANGELOG.md Added a new entry for v5.0.1 (2025-02-26) detailing fixes (React build command update using bun and a separate types build folder).
package.json Updated version to 5.0.1; added "type": "module"; restructured scripts to use bun; revised main/module/types fields and updated/replaced dependencies.
src/browser-polyfill.ts, src/node-polyfill.ts Removed obsolete polyfill files that were no longer in use.
src/browser.ts, src/index.ts, src/node.ts Updated export statements to include explicit .js extensions and adjusted module entry points.
src/sdk/** (various subdirectories) Updated numerous files to explicitly reference .js in import/export paths; refined error handling and type declarations; and enforced consistent module resolution across base, common, dto, network, wallet, and related modules.
tsconfig*.json, tsup.config.ts Removed obsolete TypeScript and bundler configuration files; introduced new config files (tsconfig.base.json, tsconfig.cjs.json, tsconfig.default.json, tsconfig.esm.json, tsconfig.types.json) to standardize build and type-checking settings.

Poem

I'm a bouncy little rabbit,
Hopping through lines of code at night,
Adding ".js" here and there with delight,
Configs revamped, polyfills out of sight,
With bun in the script and types so bright,
I munch on carrots and celebrate these changes right!
🥕🐇


📜 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 963baab and a1c9dd3.

⛔ Files ignored due to path filters (1)
  • bun.lockb is excluded by !**/bun.lockb
📒 Files selected for processing (1)
  • package.json (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

🪧 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 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 (5)
tsconfig/tsconfig.default.json (1)

1-18: Well-structured base TypeScript configuration

This configuration file provides a solid foundation for the other specialized build configs by establishing appropriate include/exclude patterns and essential compiler options. The exclusion of test and mock files ensures clean production builds, while enabling source maps supports proper debugging capabilities.

The comment on line 2 has a small grammatical issue:

-  // This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.
+  // This file is used to compile for cjs and esm (see package.json build scripts). It should exclude all test files.
🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Expected a property but instead found '// This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 14-14: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 14-14: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 14-17: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 17-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

tsconfig/tsconfig.cjs.json (1)

1-11: Properly configured CommonJS output settings

This configuration correctly specifies CommonJS module settings, ensuring compatibility with Node.js environments. Setting verbatimModuleSyntax to false allows TypeScript to properly transform ESM syntax to CommonJS, which is essential for the build process.

The comment on line 2 has the same grammatical issue as in tsconfig.default.json:

-  // This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.
+  // This file is used to compile for cjs and esm (see package.json build scripts). It should exclude all test files.
🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Expected a property but instead found '// This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

tsconfig/tsconfig.esm.json (1)

1-9: LGTM! New ESM TypeScript configuration is properly set up.

This new configuration correctly extends the base configuration and sets up the appropriate module system for ESM output, which aligns well with the PR objective of fixing build issues in a React environment.

Minor typo in the comment: "This file is used to compile the for cjs and esm" - the word "the" seems unnecessary.

-  // This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.
+  // This file is used to compile for cjs and esm (see package.json build scripts). It should exclude all test files.
🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Expected a property but instead found '// This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 4-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

tsconfig/tsconfig.types.json (1)

1-13: LGTM! New TypeScript configuration for declaration files is well-structured.

This configuration correctly sets up separate output directories for compiled code and type definitions, which aligns with the PR objective of improving build organization.

Minor typo in the comment: "This file is used to compile the for cjs and esm" - the word "the" seems unnecessary.

-  // This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.
+  // This file is used to compile for cjs and esm (see package.json build scripts). It should exclude all test files.
🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Expected a property but instead found '// This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 4-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/sdk/types/bignumber.ts (1)

2-2: Remove redundant 'use strict' directive.

JavaScript modules are automatically in strict mode, so this directive is unnecessary.

- "use strict";
🧰 Tools
🪛 Biome (1.9.4)

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6c15670 and f5436e5.

⛔ Files ignored due to path filters (2)
  • bun.lockb is excluded by !**/bun.lockb
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (102)
  • .gitignore (1 hunks)
  • CHANGELOG.md (1 hunks)
  • package.json (4 hunks)
  • src/browser-polyfill.ts (0 hunks)
  • src/browser.ts (1 hunks)
  • src/index.ts (1 hunks)
  • src/node-polyfill.ts (0 hunks)
  • src/node.ts (1 hunks)
  • src/sdk/SessionKeyValidator/SessionKeyValidator.ts (2 hunks)
  • src/sdk/SessionKeyValidator/index.ts (1 hunks)
  • src/sdk/SessionKeyValidator/interfaces.ts (1 hunks)
  • src/sdk/base/BaseAccountAPI.ts (1 hunks)
  • src/sdk/base/Bootstrap.ts (1 hunks)
  • src/sdk/base/ClientConfig.ts (1 hunks)
  • src/sdk/base/DeterministicDeployer.ts (1 hunks)
  • src/sdk/base/EtherspotWalletAPI.ts (6 hunks)
  • src/sdk/base/HttpRpcClient.ts (1 hunks)
  • src/sdk/base/PaymasterAPI.ts (1 hunks)
  • src/sdk/base/TransactionDetailsForUserOp.ts (1 hunks)
  • src/sdk/base/VerifyingPaymasterAPI.ts (1 hunks)
  • src/sdk/base/calcPreVerificationGas.ts (1 hunks)
  • src/sdk/base/index.ts (1 hunks)
  • src/sdk/bundler/index.ts (1 hunks)
  • src/sdk/bundler/providers/EtherspotBundler.ts (1 hunks)
  • src/sdk/bundler/providers/GenericBundler.ts (1 hunks)
  • src/sdk/bundler/providers/index.ts (1 hunks)
  • src/sdk/common/ERC4337Utils.ts (1 hunks)
  • src/sdk/common/OperationUtils.ts (1 hunks)
  • src/sdk/common/classes/index.ts (1 hunks)
  • src/sdk/common/exceptions/index.ts (1 hunks)
  • src/sdk/common/exceptions/validation.exception.ts (1 hunks)
  • src/sdk/common/getGasFee.ts (1 hunks)
  • src/sdk/common/getInitData.ts (1 hunks)
  • src/sdk/common/getInstalledModules.ts (1 hunks)
  • src/sdk/common/index.ts (1 hunks)
  • src/sdk/common/interfaces.ts (1 hunks)
  • src/sdk/common/rxjs/distinct-unique-key.operator.ts (1 hunks)
  • src/sdk/common/rxjs/error.subject.ts (0 hunks)
  • src/sdk/common/rxjs/index.ts (1 hunks)
  • src/sdk/common/rxjs/object.subject.ts (1 hunks)
  • src/sdk/common/rxjs/synchronized.subject.ts (1 hunks)
  • src/sdk/common/rxjs/unique.subject.ts (1 hunks)
  • src/sdk/common/service.ts (1 hunks)
  • src/sdk/common/transformers/index.ts (1 hunks)
  • src/sdk/common/transformers/transform-big-number.ts (1 hunks)
  • src/sdk/common/utils/bignumber-utils.ts (1 hunks)
  • src/sdk/common/utils/deep-compare.ts (1 hunks)
  • src/sdk/common/utils/get-bytes.ts (1 hunks)
  • src/sdk/common/utils/hashing-utils.ts (3 hunks)
  • src/sdk/common/utils/hexlify.ts (3 hunks)
  • src/sdk/common/utils/index.ts (1 hunks)
  • src/sdk/common/utils/json-utils.ts (1 hunks)
  • src/sdk/common/utils/userop-utils.ts (1 hunks)
  • src/sdk/common/utils/viem-utils.ts (3 hunks)
  • src/sdk/context.ts (1 hunks)
  • src/sdk/dto/index.ts (1 hunks)
  • src/sdk/dto/sign-message.dto.ts (1 hunks)
  • src/sdk/dto/utils/index.ts (1 hunks)
  • src/sdk/dto/utils/validate-dto.ts (1 hunks)
  • src/sdk/dto/validators/index.ts (1 hunks)
  • src/sdk/dto/validators/is-address.validator.ts (1 hunks)
  • src/sdk/dto/validators/is-big-numberish.validator.ts (1 hunks)
  • src/sdk/dto/validators/is-hex.validator.ts (1 hunks)
  • src/sdk/dto/validators/is-hex32.validator.ts (1 hunks)
  • src/sdk/dto/validators/is-url.validator.ts (1 hunks)
  • src/sdk/errorHandler/errorHandler.service.ts (1 hunks)
  • src/sdk/index.ts (1 hunks)
  • src/sdk/interfaces.ts (1 hunks)
  • src/sdk/network/constants.ts (1 hunks)
  • src/sdk/network/index.ts (1 hunks)
  • src/sdk/network/interfaces.ts (1 hunks)
  • src/sdk/network/network.service.ts (1 hunks)
  • src/sdk/network/utils/index.ts (1 hunks)
  • src/sdk/network/utils/network-name-to-chain-id.ts (1 hunks)
  • src/sdk/network/utils/prepare-network-name.ts (1 hunks)
  • src/sdk/sdk.ts (2 hunks)
  • src/sdk/types/bignumber-logger.ts (1 hunks)
  • src/sdk/types/bignumber.ts (5 hunks)
  • src/sdk/types/user-operation-types.ts (1 hunks)
  • src/sdk/wallet/index.ts (1 hunks)
  • src/sdk/wallet/providers/dynamic.wallet-provider.ts (1 hunks)
  • src/sdk/wallet/providers/index.ts (1 hunks)
  • src/sdk/wallet/providers/interfaces.ts (1 hunks)
  • src/sdk/wallet/providers/key.wallet-provider.ts (5 hunks)
  • src/sdk/wallet/providers/meta-mask.wallet-provider.ts (1 hunks)
  • src/sdk/wallet/providers/utils/index.ts (1 hunks)
  • src/sdk/wallet/providers/utils/is-wallet-connect-provider.ts (1 hunks)
  • src/sdk/wallet/providers/utils/is-wallet-provider.ts (1 hunks)
  • src/sdk/wallet/providers/wallet-connect-2.wallet-provider.ts (1 hunks)
  • src/sdk/wallet/providers/wallet-connect.wallet-provider.ts (1 hunks)
  • src/sdk/wallet/providers/walletClient.provider.ts (1 hunks)
  • src/sdk/wallet/providers/web3.wallet-provider.ts (1 hunks)
  • src/sdk/wallet/providers/web3eip1193.wallet-provider.ts (1 hunks)
  • src/sdk/wallet/wallet.service.ts (1 hunks)
  • tsconfig.build.json (0 hunks)
  • tsconfig.json (0 hunks)
  • tsconfig/tsconfig.base.json (1 hunks)
  • tsconfig/tsconfig.cjs.json (1 hunks)
  • tsconfig/tsconfig.default.json (1 hunks)
  • tsconfig/tsconfig.esm.json (1 hunks)
  • tsconfig/tsconfig.types.json (1 hunks)
  • tsup.config.ts (0 hunks)
💤 Files with no reviewable changes (6)
  • src/browser-polyfill.ts
  • tsconfig.json
  • tsup.config.ts
  • tsconfig.build.json
  • src/sdk/common/rxjs/error.subject.ts
  • src/node-polyfill.ts
✅ Files skipped from review due to trivial changes (73)
  • src/sdk/network/utils/prepare-network-name.ts
  • src/sdk/network/interfaces.ts
  • src/sdk/dto/validators/is-hex32.validator.ts
  • src/sdk/common/exceptions/validation.exception.ts
  • src/sdk/dto/validators/is-url.validator.ts
  • src/sdk/dto/utils/validate-dto.ts
  • src/sdk/base/DeterministicDeployer.ts
  • src/sdk/network/utils/network-name-to-chain-id.ts
  • src/sdk/types/bignumber-logger.ts
  • src/sdk/dto/utils/index.ts
  • src/sdk/wallet/providers/walletClient.provider.ts
  • src/sdk/common/transformers/index.ts
  • src/sdk/interfaces.ts
  • src/sdk/common/utils/get-bytes.ts
  • src/sdk/base/ClientConfig.ts
  • src/sdk/base/TransactionDetailsForUserOp.ts
  • src/sdk/base/Bootstrap.ts
  • src/sdk/common/rxjs/synchronized.subject.ts
  • src/sdk/context.ts
  • src/sdk/base/PaymasterAPI.ts
  • src/sdk/bundler/providers/GenericBundler.ts
  • .gitignore
  • src/sdk/common/utils/userop-utils.ts
  • src/sdk/wallet/providers/wallet-connect-2.wallet-provider.ts
  • src/sdk/errorHandler/errorHandler.service.ts
  • src/sdk/network/constants.ts
  • src/sdk/common/utils/bignumber-utils.ts
  • src/sdk/SessionKeyValidator/interfaces.ts
  • src/sdk/common/getGasFee.ts
  • src/sdk/bundler/index.ts
  • src/sdk/wallet/providers/web3.wallet-provider.ts
  • src/sdk/common/rxjs/distinct-unique-key.operator.ts
  • src/sdk/wallet/providers/utils/is-wallet-connect-provider.ts
  • src/sdk/common/transformers/transform-big-number.ts
  • src/sdk/dto/validators/is-address.validator.ts
  • src/sdk/SessionKeyValidator/index.ts
  • src/sdk/dto/validators/is-hex.validator.ts
  • src/sdk/base/BaseAccountAPI.ts
  • src/sdk/types/user-operation-types.ts
  • src/sdk/network/utils/index.ts
  • src/sdk/wallet/providers/dynamic.wallet-provider.ts
  • src/node.ts
  • src/sdk/common/utils/deep-compare.ts
  • src/sdk/common/getInstalledModules.ts
  • src/sdk/dto/index.ts
  • src/sdk/base/calcPreVerificationGas.ts
  • src/sdk/wallet/providers/utils/index.ts
  • src/sdk/dto/validators/is-big-numberish.validator.ts
  • src/sdk/network/index.ts
  • src/sdk/wallet/providers/wallet-connect.wallet-provider.ts
  • src/sdk/dto/sign-message.dto.ts
  • src/sdk/common/getInitData.ts
  • src/sdk/wallet/providers/meta-mask.wallet-provider.ts
  • src/sdk/base/VerifyingPaymasterAPI.ts
  • src/sdk/wallet/wallet.service.ts
  • src/index.ts
  • src/sdk/common/exceptions/index.ts
  • src/sdk/bundler/providers/index.ts
  • src/sdk/common/service.ts
  • src/sdk/dto/validators/index.ts
  • src/sdk/wallet/providers/web3eip1193.wallet-provider.ts
  • src/sdk/common/index.ts
  • src/sdk/wallet/providers/utils/is-wallet-provider.ts
  • src/sdk/network/network.service.ts
  • src/sdk/common/rxjs/index.ts
  • src/sdk/common/ERC4337Utils.ts
  • src/sdk/base/HttpRpcClient.ts
  • src/sdk/common/classes/index.ts
  • src/sdk/wallet/index.ts
  • src/sdk/wallet/providers/interfaces.ts
  • src/sdk/common/rxjs/object.subject.ts
  • src/sdk/wallet/providers/index.ts
  • src/sdk/common/OperationUtils.ts
🧰 Additional context used
🪛 Biome (1.9.4)
tsconfig/tsconfig.esm.json

[error] 2-2: Expected a property but instead found '// This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 4-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

tsconfig/tsconfig.types.json

[error] 2-2: Expected a property but instead found '// This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: Expected a property but instead found '}'.

Expected a property here.

(parse)


[error] 4-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/sdk/types/bignumber.ts

[error] 1-2: Redundant use strict directive.

The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
Safe fix: Remove the redundant use strict directive.

(lint/suspicious/noRedundantUseStrict)

tsconfig/tsconfig.base.json

[error] 2-2: Expected a property but instead found '// This tsconfig file contains the shared config for the build (tsconfig.build.json) and type checking (tsconfig.json) config.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: Expected a property but instead found '// NOTE: Enabling incremental builds speeds up tsc. Keep in mind though that it does not reliably bust the cache when the tsconfig.json file changes.'.

Expected a property here.

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 11-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 11-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 11-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 11-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-15: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 16-16: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 16-16: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 16-16: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 16-17: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 18-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 18-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 18-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 18-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 20-20: Expected an array, an object, or a literal but instead found '// By using ES2022 we get access to the .cause property on Error instances.'.

Expected an array, an object, or a literal here.

(parse)


[error] 21-21: expected , but instead found "DOM"

Remove "DOM"

(parse)


[error] 21-21: expected , but instead found // We are adding DOMhere to get thefetch, etc. types. This should be removed once these types are available via DefinitelyTyped.

Remove // We are adding DOM here to get the fetch, etc. types. This should be removed once these types are available via DefinitelyTyped.

(parse)


[error] 19-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 22-23: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 24-24: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 24-24: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 24-24: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 24-24: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 25-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 25-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 25-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 25-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 27-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 28-28: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 28-28: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 28-31: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 31-32: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

tsconfig/tsconfig.cjs.json

[error] 2-2: Expected a property but instead found '// This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 10-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

tsconfig/tsconfig.default.json

[error] 2-2: Expected a property but instead found '// This file is used to compile the for cjs and esm (see package.json build scripts). It should exclude all test files.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 4-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 7-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 14-14: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 14-14: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 14-17: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 17-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

🔇 Additional comments (55)
src/sdk/common/rxjs/unique.subject.ts (1)

2-2: Import path updated with explicit .js extension.

The addition of the '.js' extension to the import path aligns with the PR objective of fixing build issues in a React environment. This change follows modern ECMAScript Module (ESM) resolution standards, which often require explicit file extensions, especially in strict ESM environments.

src/sdk/bundler/providers/EtherspotBundler.ts (2)

1-3: Improved ESM compatibility with explicit extensions

Adding .js extensions to import paths ensures compatibility with ECMAScript modules (ESM) standards, where explicit file extensions are required. This change directly addresses the build issues in React environments mentioned in the PR objectives.


7-7: Type safety improvement for apiKey property

Changing the type from string to string | undefined better aligns with how the property is used in the constructor (where apiKey is an optional parameter). This improves type safety while accurately reflecting the implementation.

src/sdk/wallet/providers/key.wallet-provider.ts (10)

2-2: Updated import path with explicit .js extension.

This change adds an explicit .js extension to the import path, which is consistent with ECMAScript modules (ESM) requirements. This is a necessary change for proper module resolution in modern bundlers and environments.


4-4: Changed import source for Networks.

The import for Networks has been updated from ../../network/constants to ../../network/index.js. This adds the explicit .js extension and changes the source file, likely to fix module resolution issues.


20-21: Added account validation in constructor.

This defensive check ensures that a valid account is set during initialization, preventing potential runtime errors later in the code execution.


28-28: Added account validation in signMessage method.

This check ensures that the wallet account is set before attempting to sign a message, preventing potential runtime errors.


33-35: Added parameter validation for signMessage.

These checks validate that all required parameters are provided before proceeding with the signing operation, improving robustness and error handling.


51-51: Added account validation in signTypedData method.

This check ensures that the wallet account is set before attempting to sign typed data, preventing potential runtime errors.


59-61: Added parameter validation for signTypedData.

These checks validate that all required parameters are provided before proceeding with the typed data signing operation, improving robustness and error handling.


84-84: Added account validation in signUserOp method.

This check ensures that the wallet account is set before attempting to sign a user operation, preventing potential runtime errors.


92-92: Added account validation in eth_sendTransaction method.

This check ensures that the wallet account is set before attempting to send a transaction, preventing potential runtime errors.


102-102: Added account validation in eth_signTransaction method.

This check ensures that the wallet account is set before attempting to sign a transaction, preventing potential runtime errors.

src/browser.ts (1)

3-3: Properly addressed module resolution issue for React environments

The explicit file extension in the export path is an excellent fix that aligns with modern ECMAScript Module resolution standards, particularly in React environments. This change helps bundlers like webpack correctly resolve modules without ambiguity.

CHANGELOG.md (1)

3-6: Changelog accurately reflects PR objectives

The changelog entry properly documents the two key changes: switching to bun for the build command and adding a separate types build folder.

Note that the release date is set to February 26, 2025. Please verify if this is the intended date for this release.

src/sdk/common/utils/json-utils.ts (1)

3-4: Improved type safety with optional defaultValue parameter.

The changes to the parseJson function make it more flexible by allowing the defaultValue parameter to be optional, while correctly updating the return type to reflect that the function may return undefined.

This change aligns well with modern TypeScript practices and helps improve type safety in the codebase.

tsconfig/tsconfig.base.json (1)

1-32: Comprehensive base TypeScript configuration looks good.

This configuration provides a solid foundation for other TypeScript configurations to build upon. The settings are appropriate for a modern TypeScript library targeting Node.js environments.

The option to include the DOM library is noted as temporary in the comments, which is good documentation for future maintenance.

🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Expected a property but instead found '// This tsconfig file contains the shared config for the build (tsconfig.build.json) and type checking (tsconfig.json) config.'.

Expected a property here.

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 3-3: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: Expected a property but instead found '// NOTE: Enabling incremental builds speeds up tsc. Keep in mind though that it does not reliably bust the cache when the tsconfig.json file changes.'.

Expected a property here.

(parse)


[error] 3-4: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 5-5: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-6: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 6-7: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 8-8: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-9: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 9-10: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 11-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 11-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 11-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 11-11: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 12-12: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-13: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 13-15: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 16-16: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 16-16: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 16-16: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 16-17: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 18-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 18-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 18-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 18-18: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 19-19: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 20-20: Expected an array, an object, or a literal but instead found '// By using ES2022 we get access to the .cause property on Error instances.'.

Expected an array, an object, or a literal here.

(parse)


[error] 21-21: expected , but instead found "DOM"

Remove "DOM"

(parse)


[error] 21-21: expected , but instead found // We are adding DOMhere to get thefetch, etc. types. This should be removed once these types are available via DefinitelyTyped.

Remove // We are adding DOM here to get the fetch, etc. types. This should be removed once these types are available via DefinitelyTyped.

(parse)


[error] 19-22: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 22-23: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 24-24: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 24-24: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 24-24: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 24-24: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 25-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 25-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 25-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 25-25: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 26-26: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 27-27: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 28-28: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 28-28: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 28-31: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)


[error] 31-32: End of file expected

Use an array for a sequence of values: [1, 2]

(parse)

src/sdk/SessionKeyValidator/SessionKeyValidator.ts (2)

1-7: Update to import statements with .js extension

All import statements have been updated to include the .js extension, which helps with module resolution in a React environment and aligns with the PR objective to fix build issues.


335-335: Improved variable declaration from let to const

Changed variable declaration from let to const since url is not reassigned within the function. This is a good practice that enforces immutability.

src/sdk/common/utils/hexlify.ts (3)

3-3: Updated import path with .js extension

The import path has been updated to include the .js extension and changed from "../types" to "../index.js". This change aligns with the module resolution standardization effort across the codebase.


71-71: Simplified constant declaration by removing explicit type

The explicit type annotation : string has been removed from the HexCharacters constant declaration. This is fine as TypeScript will infer the type from the assigned string value.


121-121: Changed variable declaration from let to const

Changed variable declaration from let to const for the loop variable v since it's not reassigned within the loop iteration. This is a good practice that enforces immutability.

src/sdk/common/utils/index.ts (1)

1-10: Updated export statements with .js extensions

All export statements have been updated to include the .js extension, which helps with module resolution. Additionally, a new export for 'hexlify.js' has been added. These changes align with the standardization of module resolution across the codebase.

src/sdk/common/utils/hashing-utils.ts (2)

2-3: Updated import statements with .js extensions

Import statements have been updated to include the .js extension and the import path for BytesLike has changed from "../types" to "../index.js". This aligns with the module resolution standardization effort.


7-7: Improved result initialization from null to empty string

Changed the initialization of result from null to an empty string '' in both the initial declaration and error handler. This ensures the variable always maintains a consistent string type, preventing potential type-related issues and making the code more predictable.

Also applies to: 59-59

src/sdk/types/bignumber.ts (5)

23-24: Import paths updated with .js extension.

The explicit file extensions improve module resolution in modern environments, which is consistent with the PR's goal to fix build issues.


222-222: Good error handling with nullish coalescing operator.

Adding the null check with ?? ensures proper error handling when toBN(this).toString(10) fails to produce a valid result.


310-310: Improved error handling for value conversion.

Similar to the toString method, this change properly handles cases where the value fails to convert to a string.


363-364: Return type updated to include undefined.

The return type has been updated from string to string | undefined to more accurately reflect the possible return values.


368-369: Return type updated to include undefined.

The return type has been updated from string to string | undefined to more accurately reflect the possible return values.

src/sdk/index.ts (2)

1-9: Updated import and export paths with .js extensions.

All import and export statements now include the .js extension, which is crucial for improving module resolution in modern JavaScript environments. This change directly addresses the build issues mentioned in the PR objectives.


9-9: Added export for wallet module.

The addition of the wallet module export expands the SDK's functionality and is consistent with the overall changes in this PR.

src/sdk/base/EtherspotWalletAPI.ts (8)

1-9: Updated import paths with .js extensions.

Import paths now include .js extensions, ensuring consistent module resolution across the codebase. This aligns with the PR's goal of fixing build issues.


48-49: Updated property types to include null.

The predefinedAccountAddress and bootstrapAddress property types now explicitly include null as a possible value, improving type safety.


56-60: Improved constructor logic with better fallback handling.

The constructor now uses optional chaining for params.optionsLike and provides clear fallback paths for setting the bootstrapAddress. This makes the code more robust.


64-64: Added null check for EOA address.

Using the nullish coalescing operator to provide a default value when EOAAddress is undefined prevents potential runtime errors.


116-118: Added null check for account address.

The code now checks if this.accountAddress exists before proceeding, throwing a helpful error message if it doesn't. This prevents potential runtime errors and provides better debugging information.


165-167: Added null check for account address.

Similar to the previous check, this ensures this.accountAddress exists before using it in getAllValidators, preventing potential runtime errors.


220-222: Added null check for validator address.

The code now verifies that this.validatorAddress exists before proceeding with getInitCodeData, throwing a helpful error message if it doesn't.


294-296: Added null check for nonce key.

The code now verifies that nonceKey exists before proceeding, which prevents potential runtime errors and provides a clearer error message.

src/sdk/common/utils/viem-utils.ts (4)

4-5: Updated import paths with .js extensions.

Import paths now include .js extensions, ensuring consistent module resolution across the codebase.


29-29: Added explicit return type to function.

The return type ReturnType<typeof createWalletClient> has been explicitly defined, improving type safety and code documentation.


37-37: Added explicit return type to function.

The return type ReturnType<typeof createWalletClient> has been explicitly defined, improving type safety and code documentation.


67-67: Improved string handling in prepareAddress function.

The function now initializes result as an empty string instead of null, and sets it to an empty string instead of null when it equals AddressZero. This change makes the code more consistent with the function's return type and improves string handling.

Also applies to: 73-73

src/sdk/base/index.ts (1)

1-8: Good implementation of explicit file extensions for ESM compatibility.

All export statements now include .js extensions, which aligns with the "type": "module" configuration in package.json. This change ensures proper module resolution in ESM environments, particularly for React applications.

package.json (5)

3-3: Version bump correctly reflects the bugfix nature of the PR.

The minor version increment from 5.0.0 to 5.0.1 appropriately indicates a non-breaking bugfix, as described in the PR objectives.


20-23: Module system configuration properly aligned with build targets.

The addition of "type": "module" and updated output paths for module and types are critical changes to fix the React build issues. This configuration ensures that the package is properly recognized as an ES module while maintaining compatibility through multiple distribution formats.


40-56: Build system modernization with bun improves developer experience.

The updated build scripts use bun for improved performance and add separate outputs for CommonJS, ESM, and types. This addresses the main objective of the PR to "modify the build command to utilize 'bun'" and add "a separate build folder for types".

The explicit generation of package.json files in the distribution directories with the correct module type settings is an excellent approach to maintain compatibility.


82-107: React-related dependencies added to support development and testing.

The addition of React-related dependencies (@tanstack/react-query, @types/react, @types/react-dom, @vitejs/plugin-react, react, react-dom) suggests that the package now properly supports React environments, which aligns with the PR's goal of fixing build issues in React.


69-75:

✅ Verification successful

Verify the compatibility of the new dependencies.

The addition of biome (replacing buffer), the fixed version of crypto, and the new debug dependency represent significant changes to the project's dependencies.


🏁 Script executed:

#!/bin/bash
# Check if these dependencies are compatible with React environments
npm info biome@^0.3.3 engines
npm info [email protected] engines
npm info [email protected] engines

# Check if any of these have known issues with React
npm view biome@^0.3.3 readme
npm view [email protected] readme

Length of output: 26247


Dependency compatibility verified

The npm info outputs show that all three dependencies (biome, crypto, and debug) specify a minimal requirement of Node.js version ">=6.0". Their readmes also do not indicate any known incompatibilities with React environments. Based on these checks, the changes appear safe, assuming your project’s Node version meets this requirement.

src/sdk/sdk.ts (3)

1-22: Consistent update of import statements for ESM compatibility.

Import statements have been properly updated to include .js extensions, ensuring consistency with the "type": "module" declaration. This matches the pattern applied throughout the codebase.


251-253: Improved error handling for missing account address.

The added error check prevents potential issues when accountAddress is not available, providing a clear error message rather than letting the code proceed with undefined values. This is a good defensive programming practice.


277-280: clearUserOpsFromBatch now properly resets all arrays.

The implementation now includes clearing the value array, which was previously missing. This ensures complete cleanup of the batch state and prevents any inconsistencies between the arrays.

src/sdk/common/interfaces.ts (2)

1-1: Import path update with .js extension is appropriate.

Adding the .js extension to the import path is consistent with the PR objective of standardizing module resolution across the codebase. This change helps resolve build issues in ES module environments where explicit file extensions are required.


5-6:

❓ Verification inconclusive

Verify impact of making properties required instead of optional.

Changing data and value from optional to required properties in the BatchUserOpsRequest interface could potentially be a breaking change if existing code relies on these fields being optional. This change may require updates to all implementations that use this interface.

Consider:

  1. Do all existing implementations already provide these fields?
  2. Is backward compatibility needed?

🏁 Script executed:

#!/bin/bash
# Check all usages of BatchUserOpsRequest to ensure they provide data and value
rg -A 5 "BatchUserOpsRequest" --type typescript
# Check for places where BatchUserOpsRequest objects are created
rg -A 10 -B 5 "data\?: string\[\]|value\?: BigNumberish\[\]" --type typescript

Length of output: 198


Below is a revised script to help verify that every usage of BatchUserOpsRequest properly provides the required data and value fields. The original commands used a file‐type filter that isn’t recognized, so try running these commands instead:

Review Comment Verification: BatchUserOpsRequest Field Requirement

The interface change from optional to required properties should be carefully validated across the codebase. Please verify:

  • That all current instantiations of BatchUserOpsRequest include the data and value fields.
  • Whether these changes might break any legacy code paths expecting the fields to be optional.

Once you’ve manually confirmed these points using the updated shell scripts (or another reliable method), you can decide whether additional changes or backward compatibility layers are necessary.


🏁 Script executed:

[run_scripts]
#!/bin/bash
echo "Searching for usages of BatchUserOpsRequest in .ts files:"
rg -A 5 "BatchUserOpsRequest" -g "*.ts"

echo "Searching for object instantiations or definitions of BatchUserOpsRequest:"
rg -A 10 -B 5 "BatchUserOpsRequest\s*=\s*{" -g "*.ts"

Length of output: 2010


Impact Verification Summary for Changing Optional to Required Fields

The updated verification shows that in at least one key location (i.e. in src/sdk/sdk.ts), the BatchUserOpsRequest is correctly instantiated with both data and value provided. However, a regex error during the second search prevented a full automated scan of all object constructions. Please double-check manually (or via alternative searches) that all instances where a BatchUserOpsRequest is created supply these fields. Also, ensure that any external consumers, if applicable, adjust to these now-required properties.

  • Location Verified:

    • src/sdk/common/interfaces.ts — Declaration of the interface with required fields.
    • src/sdk/sdk.ts — Instantiation of BatchUserOpsRequest with all fields provided.
  • Action Items:

    • Manually verify all usages where BatchUserOpsRequest objects are instantiated.
    • Confirm that external code (if any) is updated to conform with these required fields.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f5436e5 and 963baab.

📒 Files selected for processing (1)
  • .circleci/config.yml (3 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.circleci/config.yml

[warning] 58-58: wrong indentation: expected 12 but found 10

(indentation)

🔇 Additional comments (16)
.circleci/config.yml (16)

13-13: Node Docker Image Upgrade
The Docker image has been updated from an older Node version to cimg/node:20.11.1. This ensures your build environment is more up-to-date and better aligned with Bun's requirements.


19-25: Add Bun Installation Step in Install Job
A new step has been added to install Bun before proceeding with dependency installation. This is a good move given the shift to Bun for dependency management and build commands. Consider checking if Bun is already installed to prevent redundant installations when applicable.


30-30: Cache Key Update for Bun
The cache key now uses {{ checksum "bun.lockb" }} instead of the previous checksum for package.json. This change accurately reflects the dependency management change.


33-33: Update Dependency Installation Command
The command is now updated to bun install, which aligns with the transition from npm to Bun. This is consistent with the other changes.


35-38: Updated Cache Saving Paths
The cache saving step now includes both ./node_modules and ~/.bun under the save paths. This ensures that any Bun-related files are persisted correctly.


41-41: Build Command Updated for Dry Run
Using bun run build for the dry run build step is consistent with the overall bun migration.


49-49: e2e-tests Job: Node Image Upgrade
The e2e-tests job now uses cimg/node:20.11.1, ensuring consistency across jobs.


66-66: e2e-tests: Cache Restore Updated for Bun
The cache restore step now looks for bun.lockb, ensuring consistency with the new dependency management file.


72-72: e2e-tests: Dependency Installation with Bun
The dependency installation command has been correctly updated to bun install in the e2e-tests job.


75-75: e2e-tests: Build Command Update
The build command in the e2e-tests job is now bun run build, keeping the build process consistent with the rest of the project.


172-172: Publish Job: Node Image Upgrade
The docker image for the publish-npm-package job has been updated to use cimg/node:20.11.1, aligning with other jobs in the workflow.


178-184: Publish Job: Repeating Bun Installation Step
Similar to the other jobs, the publish-npm-package job installs Bun prior to further actions. While this repetition is acceptable, consider the possibility of abstracting this into a reusable command if you find it being duplicated across multiple jobs in the future.


186-186: Publish Job: Updated Cache Restore for Bun
The cache restore key correctly uses {{ checksum "bun.lockb" }}, which is consistent with the changes in the install and e2e-tests jobs.


192-192: Publish Job: Dependency Installation via Bun
The dependency installation command has been updated to bun install, ensuring consistency with the overall transition to Bun.


194-194: Publish Job: Build Command with Bun
The build command in this job is now updated to bun run build. This change supports the new build system using Bun.


200-200: Publish Job: Publishing Command Updated
The command for publishing to npm has been modified to use bun publish --access public. This reflects the move away from npm CLI commands.

@arddluma arddluma force-pushed the Build_Issue_React_Viem branch from 29e07de to 963baab Compare February 26, 2025 22:55
@vignesha22 vignesha22 merged commit ba5088a into master Feb 27, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants