Skip to content

Commit

Permalink
Fix esm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Mar 7, 2024
1 parent 466968d commit fdbec68
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 15 deletions.
12 changes: 10 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
module.exports = {
parser: "@typescript-eslint/parser",
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "airbnb-typescript/base", "plugin:prettier/recommended"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"airbnb-typescript/base",
"plugin:import/typescript",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:prettier/recommended",
],
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
Expand All @@ -23,11 +30,12 @@ module.exports = {
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"security/detect-object-injection": "warn",
"security/detect-unsafe-regex": "error",
"import/extensions": "error", // Now we need to specify extensions for imports for esm builds
"security/detect-object-injection": "off", // turning off Injection Sink rule
"@typescript-eslint/no-throw-literal": "off", // temp deactivated needs to be removed once fixed
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/ban-ts-comment": "off",
"import/extensions": ["error", "ignorePackages"],
"import/no-unresolved": "off",
},
settings: {},
overrides: [
Expand Down
2 changes: 1 addition & 1 deletion packages/account/src/utils/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
EntryPointAddressesByVersion,
BiconomyFactoriesByVersion,
BiconomyImplementationsByVersion,
} from "./Types";
} from "./Types.js";

export const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000";

Expand Down
4 changes: 2 additions & 2 deletions packages/account/src/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { encodeAbiParameters, parseAbiParameters, keccak256, Hex, Chain } from "
import type { UserOperationStruct } from "@alchemy/aa-core";
import { SupportedSigner, convertSigner } from "@biconomy/common";
import { extractChainIdFromBundlerUrl } from "@biconomy/bundler";
import { BiconomySmartAccountV2Config } from "./Types";
import { BiconomySmartAccountV2Config } from "./Types.js";
import { extractChainIdFromPaymasterUrl } from "@biconomy/bundler";
import * as chains from "viem/chains";
import { ERROR_MESSAGES } from "./Constants";
import { ERROR_MESSAGES } from "./Constants.js";

/**
* pack the userOperation
Expand Down
6 changes: 3 additions & 3 deletions packages/account/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./Types";
export * from "./Utils";
export * from "./Constants";
export * from "./Types.js";
export * from "./Utils.js";
export * from "./Constants.js";
10 changes: 9 additions & 1 deletion packages/bundler/src/interfaces/IBundler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { StateOverrideSet } from "@biconomy/common";
import { UserOpResponse, UserOpGasResponse, UserOpReceipt, UserOpByHashResponse, UserOpStatus, SimulationType, GasFeeValues } from "../utils/Types";
import {
UserOpResponse,
UserOpGasResponse,
UserOpReceipt,
UserOpByHashResponse,
UserOpStatus,
SimulationType,
GasFeeValues,
} from "../utils/Types.js";
import { UserOperationStruct } from "@alchemy/aa-core";

export interface IBundler {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/utils/Helpers/convertSigner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EthersSigner } from "../EthersSigner.js";
import { SupportedSigner } from "../Types";
import { SupportedSigner } from "../Types.js";
import { WalletClient } from "viem";
import { WalletClientSigner, SmartAccountSigner } from "@alchemy/aa-core";
import { UNIQUE_PROPERTIES_PER_SIGNER } from "../Constants.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/src/interfaces/ISessionStorage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Hex } from "viem";
import { SmartAccountSigner } from "@alchemy/aa-core";
import { SignerData } from "../utils/Types";
import { SignerData } from "../utils/Types.js";

export type SessionStatus = "PENDING" | "ACTIVE" | "INACTIVE" | "EXPIRED";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SmartAccountSigner, WalletClientSigner } from "@alchemy/aa-core";
import { ISessionStorage, SessionLeafNode, SessionSearchParam, SessionStatus } from "../interfaces/ISessionStorage.js";
import { mainnet } from "viem/chains";
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
import { SignerData } from "../utils/Types";
import { SignerData } from "../utils/Types.js";

export class SessionLocalStorage implements ISessionStorage {
private smartAccountAddress: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ISessionValidationModule } from "../interfaces/ISessionValidationModule.js";
import { ERC20SessionKeyData, SessionValidationModuleConfig } from "../utils/Types";
import { ERC20SessionKeyData, SessionValidationModuleConfig } from "../utils/Types.js";
import { encodeAbiParameters, parseAbiParameters } from "viem";

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/src/utils/Types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Chain, Hex } from "viem";
import { SmartAccountSigner, UserOperationStruct } from "@alchemy/aa-core";
import { SessionKeyManagerModule } from "../SessionKeyManagerModule";
import { SessionKeyManagerModule } from "../SessionKeyManagerModule.js";
import { ISessionStorage } from "../interfaces/ISessionStorage.js";
import { SupportedSigner } from "@biconomy/common";
export type ModuleVersion = "V1_0_0"; // | 'V1_0_1'
Expand Down
2 changes: 1 addition & 1 deletion packages/paymaster/src/interfaces/IPaymaster.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type UserOperationStruct } from "@alchemy/aa-core";
import { PaymasterAndDataResponse } from "../utils/Types";
import { PaymasterAndDataResponse } from "../utils/Types.js";

export interface IPaymaster {
// Implementing class may add extra parameter (for example paymasterServiceData with it's own type) in below function signature
Expand Down

0 comments on commit fdbec68

Please sign in to comment.