diff --git a/packages/as-sha256/package.json b/packages/as-sha256/package.json index 104d6e16..f1c4b6d6 100644 --- a/packages/as-sha256/package.json +++ b/packages/as-sha256/package.json @@ -13,8 +13,7 @@ "url": "git+https://github.com/chainsafe/ssz.git" }, "type": "module", - "main": "./lib/cjs/index.js", - "module": "./lib/index.js", + "main": "./lib/index.js", "types": "./lib/index.d.ts", "files": [ "lib", @@ -31,11 +30,9 @@ "asbuild:simd:untouched": "asc assembly/index.simd.ts -o build/untouched.simd.wasm -t build/untouched.simd.wat --runtime minimal --target debug --enable simd", "asbuild:simd:optimized": "asc assembly/index.simd.ts -o build/optimized.simd.wasm -t build/optimized.simd.wat --runtime minimal --target release -O3z --noAssert --enable simd", "asbuild:simd": "yarn asbuild:simd:untouched && yarn asbuild:simd:optimized", - "build:esm": "tsc -p tsconfig.build.esm.json", - "build:cjs": "tsc -p tsconfig.build.cjs.json && echo '{\"type\": \"commonjs\"}' > ./lib/cjs/package.json", - "build:types": "tsc -p tsconfig.build.types.json", + "build:lib": "tsc -p tsconfig.build.json", "build:web": "webpack --mode production --entry ./index.js --output ./dist/as-sha256.min.js", - "build": "yarn asbuild && yarn asbuild:simd && yarn generate && yarn build:cjs && yarn build:esm && yarn build:types", + "build": "yarn asbuild && yarn asbuild:simd && yarn generate && yarn build:lib", "test": "yarn run test:unit", "test:unit": "vitest run --dir test/unit/", "test:browsers": "yarn test:browsers:chrome && yarn test:browsers:firefox", diff --git a/packages/as-sha256/tsconfig.build.cjs.json b/packages/as-sha256/tsconfig.build.cjs.json deleted file mode 100644 index 857f5670..00000000 --- a/packages/as-sha256/tsconfig.build.cjs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.build.cjs.json", - "include": ["src"], - "compilerOptions": { - "outDir": "lib/cjs", - "typeRoots": ["../../node_modules/@types", "./node_modules/@types", "./types"], - } -} diff --git a/packages/as-sha256/tsconfig.build.esm.json b/packages/as-sha256/tsconfig.build.json similarity index 77% rename from packages/as-sha256/tsconfig.build.esm.json rename to packages/as-sha256/tsconfig.build.json index 3eca43ab..0a6d98d9 100644 --- a/packages/as-sha256/tsconfig.build.esm.json +++ b/packages/as-sha256/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.build.esm.json", + "extends": "../../tsconfig.build.json", "include": ["src"], "compilerOptions": { "outDir": "lib", diff --git a/packages/as-sha256/tsconfig.build.types.json b/packages/as-sha256/tsconfig.build.types.json deleted file mode 100644 index bed0d1ce..00000000 --- a/packages/as-sha256/tsconfig.build.types.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../tsconfig.build.types.json", - "include": ["src"], - "compilerOptions": { - "outDir": "lib", - "typeRoots": ["../../node_modules/@types", "./node_modules/@types", "./types"], - } -} diff --git a/packages/persistent-merkle-tree/package.json b/packages/persistent-merkle-tree/package.json index ba28a326..b51090f3 100644 --- a/packages/persistent-merkle-tree/package.json +++ b/packages/persistent-merkle-tree/package.json @@ -3,8 +3,7 @@ "version": "0.9.0", "description": "Merkle tree implemented as a persistent datastructure", "type": "module", - "module": "./lib/index.js", - "main": "./lib/cjs/index.js", + "main": "./lib/index.js", "types": "./lib/index.d.ts", "files": [ "lib" @@ -12,10 +11,7 @@ "scripts": { "check-types": "tsc --noEmit", "clean": "rm -rf lib", - "build": "yarn build:cjs && yarn build:esm && yarn build:types", - "build:esm": "tsc -p tsconfig.build.esm.json", - "build:cjs": "tsc -p tsconfig.build.cjs.json && echo '{\"type\": \"commonjs\"}' > ./lib/cjs/package.json", - "build:types": "tsc -p tsconfig.build.types.json", + "build": "tsc -p tsconfig.build.json", "lint": "eslint --color --ext .ts src/", "lint:fix": "yarn run lint --fix", "benchmark:files": "node --max-old-space-size=4096 --expose-gc --loader ts-node/esm ../../node_modules/.bin/benchmark", diff --git a/packages/persistent-merkle-tree/tsconfig.build.cjs.json b/packages/persistent-merkle-tree/tsconfig.build.cjs.json deleted file mode 100644 index e34cd1b8..00000000 --- a/packages/persistent-merkle-tree/tsconfig.build.cjs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.build.cjs.json", - "include": [ - "src" - ], - "compilerOptions": { - "outDir": "lib/cjs", - "typeRoots": [ - "../../node_modules/@types", - "./node_modules/@types", - "./types" - ], - } -} \ No newline at end of file diff --git a/packages/persistent-merkle-tree/tsconfig.build.esm.json b/packages/persistent-merkle-tree/tsconfig.build.json similarity index 80% rename from packages/persistent-merkle-tree/tsconfig.build.esm.json rename to packages/persistent-merkle-tree/tsconfig.build.json index 2713a118..5f4950d1 100644 --- a/packages/persistent-merkle-tree/tsconfig.build.esm.json +++ b/packages/persistent-merkle-tree/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.build.esm.json", + "extends": "../../tsconfig.build.json", "include": [ "src" ], diff --git a/packages/persistent-merkle-tree/tsconfig.build.types.json b/packages/persistent-merkle-tree/tsconfig.build.types.json deleted file mode 100644 index cffe49c4..00000000 --- a/packages/persistent-merkle-tree/tsconfig.build.types.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.build.types.json", - "include": [ - "src" - ], - "compilerOptions": { - "outDir": "lib", - "typeRoots": [ - "../../node_modules/@types", - "./node_modules/@types", - "./types" - ], - } -} \ No newline at end of file diff --git a/packages/persistent-ts/package.json b/packages/persistent-ts/package.json index e89e57ae..e1b2c843 100644 --- a/packages/persistent-ts/package.json +++ b/packages/persistent-ts/package.json @@ -3,21 +3,16 @@ "version": "0.19.1", "description": "Persistent data structures for TypeScript.", "type": "module", - "main": "./lib/cjs/index.js", - "module": "./lib/index.js", + "main": "./lib/index.js", "types": "./lib/index.d.ts", "files": [ "lib/**/*.d.ts", "lib/**/*.js", - "lib/**/*.js.map", - "lib/**/package.json" + "lib/**/*.js.map" ], "scripts": { "clean": "rm -rf lib", - "build": "yarn build:cjs && yarn build:esm && yarn build:types", - "build:esm": "tsc -p tsconfig.build.esm.json", - "build:cjs": "tsc -p tsconfig.build.cjs.json && echo '{\"type\": \"commonjs\"}' > ./lib/cjs/package.json", - "build:types": "tsc -p tsconfig.build.types.json", + "build": "tsc -p tsconfig.build.json", "lint": "eslint --color --ext .ts src/", "check-types": "tsc --noEmit", "test:unit": "vitest run --dir test/unit", diff --git a/packages/persistent-ts/tsconfig.build.cjs.json b/packages/persistent-ts/tsconfig.build.cjs.json deleted file mode 100644 index e34cd1b8..00000000 --- a/packages/persistent-ts/tsconfig.build.cjs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.build.cjs.json", - "include": [ - "src" - ], - "compilerOptions": { - "outDir": "lib/cjs", - "typeRoots": [ - "../../node_modules/@types", - "./node_modules/@types", - "./types" - ], - } -} \ No newline at end of file diff --git a/packages/ssz/tsconfig.build.esm.json b/packages/persistent-ts/tsconfig.build.json similarity index 80% rename from packages/ssz/tsconfig.build.esm.json rename to packages/persistent-ts/tsconfig.build.json index 2713a118..5f4950d1 100644 --- a/packages/ssz/tsconfig.build.esm.json +++ b/packages/persistent-ts/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.build.esm.json", + "extends": "../../tsconfig.build.json", "include": [ "src" ], diff --git a/packages/persistent-ts/tsconfig.build.types.json b/packages/persistent-ts/tsconfig.build.types.json deleted file mode 100644 index cffe49c4..00000000 --- a/packages/persistent-ts/tsconfig.build.types.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.build.types.json", - "include": [ - "src" - ], - "compilerOptions": { - "outDir": "lib", - "typeRoots": [ - "../../node_modules/@types", - "./node_modules/@types", - "./types" - ], - } -} \ No newline at end of file diff --git a/packages/ssz/package.json b/packages/ssz/package.json index 27510ff2..c13fe47e 100644 --- a/packages/ssz/package.json +++ b/packages/ssz/package.json @@ -6,20 +6,15 @@ "homepage": "https://github.com/chainsafe/ssz", "version": "0.19.0", "type": "module", - "main": "./lib/cjs/index.js", - "module": "./lib/index.js", + "main": "./lib/index.js", "types": "./lib/index.d.ts", "files": [ "lib/**/*.d.ts", "lib/**/*.js", - "lib/**/*.js.map", - "lib/**/package.json" + "lib/**/*.js.map" ], "scripts": { - "build": "yarn run build:cjs && yarn build:esm && yarn build:types", - "build:esm": "tsc -p tsconfig.build.esm.json", - "build:cjs": "tsc -p tsconfig.build.cjs.json && echo '{\"type\": \"commonjs\"}' > ./lib/cjs/package.json", - "build:types": "tsc -p tsconfig.build.types.json", + "build": "tsc -p tsconfig.build.json", "build-web": "webpack --mode production --entry ./lib/esm/web.js --output ./dist/ssz.min.js", "build:docs": "typedoc --exclude src/index.ts,src/web.ts --out docs src", "build:release": "yarn clean && yarn build && yarn build-web && yarn run build:docs", diff --git a/packages/ssz/tsconfig.build.cjs.json b/packages/ssz/tsconfig.build.cjs.json deleted file mode 100644 index e34cd1b8..00000000 --- a/packages/ssz/tsconfig.build.cjs.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.build.cjs.json", - "include": [ - "src" - ], - "compilerOptions": { - "outDir": "lib/cjs", - "typeRoots": [ - "../../node_modules/@types", - "./node_modules/@types", - "./types" - ], - } -} \ No newline at end of file diff --git a/packages/persistent-ts/tsconfig.build.esm.json b/packages/ssz/tsconfig.build.json similarity index 80% rename from packages/persistent-ts/tsconfig.build.esm.json rename to packages/ssz/tsconfig.build.json index 2713a118..5f4950d1 100644 --- a/packages/persistent-ts/tsconfig.build.esm.json +++ b/packages/ssz/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.build.esm.json", + "extends": "../../tsconfig.build.json", "include": [ "src" ], diff --git a/packages/ssz/tsconfig.build.types.json b/packages/ssz/tsconfig.build.types.json deleted file mode 100644 index cffe49c4..00000000 --- a/packages/ssz/tsconfig.build.types.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.build.types.json", - "include": [ - "src" - ], - "compilerOptions": { - "outDir": "lib", - "typeRoots": [ - "../../node_modules/@types", - "./node_modules/@types", - "./types" - ], - } -} \ No newline at end of file diff --git a/setHasher.mjs b/setHasher.mjs index cb2888f4..24b27a27 100644 --- a/setHasher.mjs +++ b/setHasher.mjs @@ -1,7 +1,7 @@ // Set the hasher to hashtree // Used to run benchmarks with with visibility into hashtree performance, useful for Lodestar -import {setHasher} from "@chainsafe/persistent-merkle-tree/lib/cjs/hasher/index.js"; -import {hasher} from "@chainsafe/persistent-merkle-tree/lib/cjs/hasher/hashtree.js"; +import {setHasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/index.js"; +import {hasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/hashtree.js"; setHasher(hasher); export {}; diff --git a/tsconfig.build.cjs.json b/tsconfig.build.cjs.json deleted file mode 100644 index 493a0916..00000000 --- a/tsconfig.build.cjs.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "esModuleInterop": true, - "module": "commonjs", - "noEmit": false, - "declaration": false, - "sourceMap": true, - } -} \ No newline at end of file diff --git a/tsconfig.build.esm.json b/tsconfig.build.esm.json deleted file mode 100644 index 266f0e09..00000000 --- a/tsconfig.build.esm.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "esModuleInterop": true, - "module": "NodeNext", - "noEmit": false, - "declaration": false, - "sourceMap": true, - } -} \ No newline at end of file diff --git a/tsconfig.build.types.json b/tsconfig.build.json similarity index 85% rename from tsconfig.build.types.json rename to tsconfig.build.json index 2d5834b2..51d17778 100644 --- a/tsconfig.build.types.json +++ b/tsconfig.build.json @@ -5,7 +5,7 @@ "module": "NodeNext", "noEmit": false, "declaration": true, + "sourceMap": true, "declarationMap": false, - "emitDeclarationOnly": true, } } \ No newline at end of file