Skip to content

Commit

Permalink
chore: remove monorepo setup (#17)
Browse files Browse the repository at this point in the history
* chore: remove monorepo setup
  • Loading branch information
joepegler authored Mar 11, 2024
1 parent ba5c590 commit c351b61
Show file tree
Hide file tree
Showing 36 changed files with 83 additions and 91 deletions.
12 changes: 6 additions & 6 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[
{
"name": "core (esm)",
"path": "./packages/core/_esm/index.js",
"limit": "100 kB",
"path": "./dist/_esm/index.js",
"limit": "5 kB",
"import": "*"
},
{
"name": "core (cjs)",
"path": "./packages/core/_cjs/index.js",
"limit": "200 kB"
"path": "./dist/_cjs/index.js",
"limit": "10 kB"
},
{
"name": "core (tree-shaking)",
"path": "./packages/core/_esm/index.js",
"limit": "100 kB",
"path": "./dist/_esm/index.js",
"limit": "5 kB",
"import": "{ createSmartAccount }"
}
]
Binary file modified bun.lockb
Binary file not shown.
50 changes: 41 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"workspaces": ["packages/*"],
"type": "module",
"name": "sdk",
"main": "./dist/_cjs/index.js",
"module": "./dist/_esm/index.js",
"types": "./dist/_types/index.d.ts",
"typings": "./dist/_types/index.d.ts",
"homepage": "https://biconomy.io",
"sideEffects": false,
"name": "@biconomy/core",
"author": "Biconomy",
"version": "1.0.0",
"version": "0.0.1",
"description": "sdk for account abstraction, smart accounts, erc-4337 and erc-7579.",
"keywords": [
"erc-7579",
Expand All @@ -12,18 +17,44 @@
"biconomy",
"sdk"
],
"sideEffects": false,
"license": "MIT",
"scope": "@biconomy",
"repository": "github:bcnmy/sdk",
"exports": {
".": {
"types": "./dist/_types/index.d.ts",
"import": "./dist/_esm/index.js",
"default": "./dist/_cjs/index.js"
},
"./account": {
"types": "./_types/account/index.d.ts",
"import": "./_esm/account/index.js",
"default": "./_cjs/account/index.js"
},
"./bundler": {
"types": "./_types/bundler/index.d.ts",
"import": "./_esm/bundler/index.js",
"default": "./_cjs/bundler/index.js"
},
"./paymaster": {
"types": "./_types/paymaster/index.d.ts",
"import": "./_esm/paymaster/index.js",
"default": "./_cjs/paymaster/index.js"
},
"./modules": {
"types": "./_types/modules/index.d.ts",
"import": "./_esm/modules/index.js",
"default": "./_cjs/modules/index.js"
}
},
"scripts": {
"format": "biome format . --write",
"lint": "biome check .",
"lint:fix": "bun run lint --apply",
"build": "bun run clean && bun run build:cjs && bun run build:esm && bun run build:types",
"build:cjs": "tsc --project ./tsconfig/tsconfig.cjs.json && tsc-alias -p ./tsconfig/tsconfig.cjs.json && echo > ./packages/core/_cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project ./tsconfig/tsconfig.esm.json && tsc-alias -p ./tsconfig/tsconfig.esm.json && echo > ./packages/core/_esm/package.json '{\"type\": \"module\",\"sideEffects\":false}'",
"build:cjs": "tsc --project ./tsconfig/tsconfig.cjs.json && tsc-alias -p ./tsconfig/tsconfig.cjs.json && echo > ./dist/_cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project ./tsconfig/tsconfig.esm.json && tsc-alias -p ./tsconfig/tsconfig.esm.json && echo > ./dist/_esm/package.json '{\"type\": \"module\",\"sideEffects\":false}'",
"build:types": "tsc --project ./tsconfig/tsconfig.types.json && tsc-alias -p ./tsconfig/tsconfig.types.json",
"clean": "rimraf ./packages/core/_esm ./packages/core/_cjs ./packages/core/_types ./packages/core/tsconfig",
"clean": "rimraf ./src/_esm ./src/_cjs ./src/_types ./src/tsconfig",
"test": "vitest dev -c ./tests/vitest.config.ts",
"test:ci": "CI=true vitest -c ./tests/vitest.config.ts --coverage",
"size": "size-limit",
Expand Down Expand Up @@ -51,7 +82,8 @@
"vitest": "^1.3.1"
},
"peerDependencies": {
"typescript": "^5.0.0"
"typescript": "^5",
"viem": "^2"
},
"commitlint": {
"extends": ["@commitlint/config-conventional"]
Expand Down
31 changes: 0 additions & 31 deletions packages/core/package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/bundler/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type { BundlerRpcSchema, BundlerActions } from "./actions/index.js"
export { bundlerActions } from "./actions/index.js"
export { extractChainIdFromBundlerUrl } from "./utils/helpers.js"
export { createBundlerClient } from "./createBundlerClient.js"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions tests/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import {
type UserOperationStruct,
createSmartAccount,
walletClientToSmartAccountSigner
} from "../packages/core/account/index.js"
import { DEFAULT_ECDSA_OWNERSHIP_MODULE } from "../packages/core/account/utils/constants.js"
import { SignTransactionNotSupportedBySmartAccount } from "../packages/core/account/utils/errors.js"
import { getChain } from "../packages/core/account/utils/helpers.js"
import { extractChainIdFromBundlerUrl } from "../packages/core/bundler/utils/helpers.js"
} from "../src/account/index.js"
import { DEFAULT_ECDSA_OWNERSHIP_MODULE } from "../src/account/utils/constants.js"
import { SignTransactionNotSupportedBySmartAccount } from "../src/account/utils/errors.js"
import { getChain } from "../src/account/utils/helpers.js"
import { extractChainIdFromBundlerUrl } from "../src/bundler/utils/helpers.js"

describe("Biconomy Smart Account core tests", () => {
let smartAccount: Awaited<ReturnType<typeof createSmartAccount>>
Expand Down
6 changes: 3 additions & 3 deletions tests/bundler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { http } from "viem"
import { describe, expect, it } from "vitest"

import { privateKeyToAccount } from "viem/accounts"
import { getChain } from "../packages/core/account/utils/helpers.js"
import { createBundlerClient } from "../packages/core/bundler/createBundlerClient.js"
import { extractChainIdFromBundlerUrl } from "../packages/core/bundler/utils/helpers.js"
import { getChain } from "../src/account/utils/helpers.js"
import { createBundlerClient } from "../src/bundler/createBundlerClient.js"
import { extractChainIdFromBundlerUrl } from "../src/bundler/utils/helpers.js"

describe("Bundler tests", () => {
const bundlerUrl = process.env.BUNDLER_URL ?? ""
Expand Down
8 changes: 4 additions & 4 deletions tests/modules/ecdsaOwnershipModule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { privateKeyToAccount } from "viem/accounts"
import {
createSmartAccount,
walletClientToSmartAccountSigner
} from "../../packages/core/account/index.js"
import { DEFAULT_ECDSA_OWNERSHIP_MODULE } from "../../packages/core/account/utils/constants.js"
import { getChain } from "../../packages/core/account/utils/helpers.js"
import { extractChainIdFromBundlerUrl } from "../../packages/core/bundler/utils/helpers.js"
} from "../../src/account/index.js"
import { DEFAULT_ECDSA_OWNERSHIP_MODULE } from "../../src/account/utils/constants.js"
import { getChain } from "../../src/account/utils/helpers.js"
import { extractChainIdFromBundlerUrl } from "../../src/bundler/utils/helpers.js"

describe("Biconomy Smart Account core tests", () => {
let smartAccount: Awaited<ReturnType<typeof createSmartAccount>>
Expand Down
10 changes: 0 additions & 10 deletions tests/tsconfig.json

This file was deleted.

4 changes: 0 additions & 4 deletions tests/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { defineConfig } from "vitest/config"

export default defineConfig({
test: {
alias: {
"../packages": join(__dirname, "../packages"),
"~tests": join(__dirname, ".")
},
coverage: {
all: false,
provider: "v8",
Expand Down
10 changes: 4 additions & 6 deletions tsconfig/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"include": [],
"compilerOptions": {
"incremental": false,
"strict": true,
"useDefineForClassFields": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
Expand All @@ -20,12 +19,11 @@
"moduleResolution": "NodeNext",
"module": "NodeNext",
"target": "ES2021",
"lib": [
"ES2022",
"DOM"
],
"lib": ["ES2022"],
"skipLibCheck": true,
"noErrorTruncation": true
"noErrorTruncation": true,
"noEmit": true,
"strict": true
},
"tsc-alias": {
"resolveFullPaths": true,
Expand Down
3 changes: 2 additions & 1 deletion tsconfig/tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "../packages/core/_cjs",
"outDir": "../dist/_cjs",
"removeComments": true,
"verbatimModuleSyntax": false,
"noEmit": false
}
}
3 changes: 2 additions & 1 deletion tsconfig/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "es2015",
"outDir": "../packages/core/_esm"
"outDir": "../dist/_esm",
"noEmit": false
}
}
10 changes: 5 additions & 5 deletions tsconfig/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"extends": "./tsconfig.base.json",
"include": [
"../packages/"
"../src/"
],
"exclude": [
"../packages/**/*.test.ts",
"../packages/**/*.test-d.ts",
"../packages/**/*.bench.ts"
"../src/**/*.test.ts",
"../src/**/*.test-d.ts",
"../src/**/*.bench.ts"
],
"compilerOptions": {
"moduleResolution": "node",
"sourceMap": true,
"rootDir": "../packages/core"
"rootDir": "../src"
}
}
7 changes: 4 additions & 3 deletions tsconfig/tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext",
"outDir": "../packages/core/_esm",
"declarationDir": "../packages/core/_types",
"outDir": "../dist/_esm",
"declarationDir": "../dist/_types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
"declarationMap": true,
"noEmit": false
}
}
6 changes: 3 additions & 3 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["packages/core/index.ts"],
"basePath": "packages",
"includes": "packages",
"entryPoints": ["src/index.ts"],
"basePath": "src",
"includes": "src",
"out": "docs",
"gitRevision": "main"
}

0 comments on commit c351b61

Please sign in to comment.