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: always import with file extension #48

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@commitlint/config-conventional": "^17.6.3",
"eslint": "^8.39.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.27.5",
"husky": "^8.0.0",
"lerna": "^6.6.1",
"lint-staged": "^13.2.2",
Expand All @@ -37,7 +38,20 @@
"eslintConfig": {
"extends": [
"react-app"
]
],
"env": {
"es2021": true,
"node": true
},
"parserOptions": {
"sourceType": "module"
},
"rules": {
"import/extensions": [
"error",
"ignorePackages"
]
}
},
"husky": {
"hooks": {
Expand Down
22 changes: 11 additions & 11 deletions packages/accounts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// Don't use wildcard exports, instead use named exports

//kernel exports
export { KernelFactoryAbi } from "./kernel-zerodev/abis/KernelFactoryAbi";
export { KernelAccountAbi } from "./kernel-zerodev/abis/KernelAccountAbi";
export {
ValidatorMode,
KernelBaseValidator,
} from "./kernel-zerodev/validator/base";
export type { KernelBaseValidatorParams } from "./kernel-zerodev/validator/base";
export { KernelAccountAbi } from "./kernel-zerodev/abis/KernelAccountAbi.js";
export { KernelFactoryAbi } from "./kernel-zerodev/abis/KernelFactoryAbi.js";
export { KernelSmartContractAccount } from "./kernel-zerodev/account.js";
export type { KernelSmartAccountParams } from "./kernel-zerodev/account.js";
export { KernelAccountProvider } from "./kernel-zerodev/provider.js";
export type {
KernelBatchUserOperationCallData,
KernelUserOperationCallData,
} from "./kernel-zerodev/types";
export type { KernelSmartAccountParams } from "./kernel-zerodev/account";
export { KernelSmartContractAccount } from "./kernel-zerodev/account";
export { KernelAccountProvider } from "./kernel-zerodev/provider";
} from "./kernel-zerodev/types.js";
export {
KernelBaseValidator,
ValidatorMode,
} from "./kernel-zerodev/validator/base.js";
export type { KernelBaseValidatorParams } from "./kernel-zerodev/validator/base.js";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
type BatchUserOperationCallData,
PrivateKeySigner,
type BatchUserOperationCallData,
} from "@alchemy/aa-core";
import {
encodeAbiParameters,
Expand All @@ -13,11 +13,11 @@ import { polygonMumbai } from "viem/chains";
import {
KernelSmartContractAccount,
type KernelSmartAccountParams,
} from "../account";
import { KernelAccountProvider } from "../provider";
import { KernelBaseValidator, ValidatorMode } from "../validator/base";
import { MockSigner } from "./mocks/mock-signer";
import type { KernelUserOperationCallData } from "../types";
} from "../account.js";
import { KernelAccountProvider } from "../provider.js";
import type { KernelUserOperationCallData } from "../types.js";
import { KernelBaseValidator, ValidatorMode } from "../validator/base.js";
import { MockSigner } from "./mocks/mock-signer.js";

describe("Kernel Account Tests", () => {
//any wallet should work
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { KernelBaseValidator, ValidatorMode } from "../validator/base";
import { MockSignerValidator } from "./mocks/mock-signer-validator";
import { KernelBaseValidator, ValidatorMode } from "../validator/base.js";
import { MockSignerValidator } from "./mocks/mock-signer-validator.js";

describe("Base Validator Test", () => {
const dummyAddress = "0xabcfC3DB1e0f5023F5a4f40c03D149f316E6A5cc";
Expand Down
28 changes: 14 additions & 14 deletions packages/accounts/src/kernel-zerodev/account.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import {
BaseSmartContractAccount,
type BaseSmartAccountParams,
type BatchUserOperationCallData,
type SmartAccountSigner,
} from "@alchemy/aa-core";
import type { Address } from "abitype";
import { parseAbiParameters } from "abitype";
import {
concatHex,
encodeAbiParameters,
encodeFunctionData,
type FallbackTransport,
hashMessage,
type Hex,
toBytes,
type FallbackTransport,
type Hex,
type Transport,
} from "viem";
import { parseAbiParameters } from "abitype";
import { KernelBaseValidator, ValidatorMode } from "./validator/base";
import { KernelAccountAbi } from "./abis/KernelAccountAbi";
import { KernelFactoryAbi } from "./abis/KernelFactoryAbi";
import {
type BaseSmartAccountParams,
BaseSmartContractAccount,
type SmartAccountSigner,
} from "@alchemy/aa-core";
import type { BatchUserOperationCallData } from "@alchemy/aa-core/src";
import { MultiSendAbi } from "./abis/MultiSendAbi";
import { encodeCall } from "./utils";
import { KernelAccountAbi } from "./abis/KernelAccountAbi.js";
import { KernelFactoryAbi } from "./abis/KernelFactoryAbi.js";
import { MultiSendAbi } from "./abis/MultiSendAbi.js";
import { encodeCall } from "./utils.js";
import { KernelBaseValidator, ValidatorMode } from "./validator/base.js";

export interface KernelSmartAccountParams<
TTransport extends Transport | FallbackTransport = Transport
Expand Down
4 changes: 2 additions & 2 deletions packages/accounts/src/kernel-zerodev/provider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Hash, HttpTransport } from "viem";
import { SmartAccountProvider } from "@alchemy/aa-core";
import { KernelSmartContractAccount } from "./account";
import type { Hash, HttpTransport } from "viem";
import { KernelSmartContractAccount } from "./account.js";

export class KernelAccountProvider extends SmartAccountProvider<HttpTransport> {
signMessage = async (msg: string | Uint8Array): Promise<Hash> => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/__tests__/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { UserOperationRequest } from "../types";
import { getUserOperationHash } from "../utils";
import { getUserOperationHash } from "../utils.js";

describe("Utils Tests", () => {
const ENTRYPOINT_ADDRESS = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/signer/hd-account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { HDAccount } from "viem";
import { LocalAccountSigner } from "./local-account";
import { LocalAccountSigner } from "./local-account.js";

/**
* @deprecated use LocalAccountSigner instead
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/signer/local-account.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalAccountSigner } from "./local-account";
import { LocalAccountSigner } from "./local-account.js";

describe("Local Account Signer Tests", () => {
describe("Using HD Account", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/signer/private-key.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type PrivateKeyAccount } from "viem";
import { LocalAccountSigner } from "./local-account";
import { LocalAccountSigner } from "./local-account.js";

/**
* @deprecated use LocalAccountSigner instead
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
integrity sha512-iowxq3U30sghZotgl4s/oJRci6WPBfNO5YYgk2cIOMCHr3LeGPcsZjCEr+33Q4N+oV3OABDAtA+pyvWjbvBifQ==

"@alchemy/aa-core@file:packages/core":
version "0.1.0-alpha.7"
version "0.1.0-alpha.14"
dependencies:
abitype "^0.8.3"

Expand Down Expand Up @@ -6519,7 +6519,7 @@ eslint-plugin-flowtype@^8.0.3:
lodash "^4.17.21"
string-natural-compare "^3.0.1"

eslint-plugin-import@^2.25.3, eslint-plugin-import@^2.26.0:
eslint-plugin-import@^2.25.3, eslint-plugin-import@^2.26.0, eslint-plugin-import@^2.27.5:
version "2.27.5"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz#876a6d03f52608a3e5bb439c2550588e51dd6c65"
integrity sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==
Expand Down