Skip to content
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
2 changes: 1 addition & 1 deletion .github/.dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
- package-ecosystem: "yarn"
- package-ecosystem: "pnpm"
schedule:
interval: daily
requiredLabels:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
- run: corepack enable
- uses: actions/setup-node@v4
with:
cache: yarn
cache: pnpm
node-version: 20
- run: yarn --immutable && yarn build && yarn generate
- run: pnpm i --frozen-lockfile && pnpm build && pnpm generate

- name: Run benchmarks
run: yarn benchmark
run: pnpm benchmark
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# benchmark options
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ jobs:

- uses: actions/setup-node@v4
with:
cache: 'yarn'
cache: 'pnpm'
node-version: 20
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.releases_created }}

- run: yarn install --immutable
- run: pnpm install --frozen-lockfile
if: ${{ steps.release.outputs.releases_created }}

- run: git config user.email $(git --no-pager show -s --format='%ae' HEAD)
if: ${{ steps.release.outputs.releases_created }}
- run: git config user.name $(git --no-pager show -s --format='%an' HEAD)
if: ${{ steps.release.outputs.releases_created }}

- run: yarn build
- run: pnpm build
if: ${{ steps.release.outputs.releases_created }}

- env:
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,53 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{matrix.node}}
cache: yarn
cache: pnpm
- name: Bootstrap
run: yarn --immutable
run: pnpm i --frozen-lockfile
- name: Build
run: yarn build
run: pnpm build
- name: Generate
run: yarn generate
run: pnpm generate
- name: Check types
run: yarn check-types
run: pnpm check-types
- name: Lint
run: yarn lint
run: pnpm lint
- name: Unit Tests
run: yarn test:unit
run: pnpm test:unit
- name: Browsers Tests
run: yarn test:browsers
run: pnpm test:browsers
# Download spec tests with cache
- name: Restore spec tests cache
uses: actions/cache@master
with:
path: packages/ssz/spec-tests
key: spec-test-data-${{ hashFiles('packages/ssz/test/specTestVersioning.ts') }}
- name: Download spec tests
run: yarn download-spec-tests
run: pnpm download-spec-tests
working-directory: packages/ssz
# Run them in different steps to quickly identifying which command failed
# Otherwise just doing `yarn test:spec` you can't tell which specific suite failed
# Otherwise just doing `pnpm test:spec` you can't tell which specific suite failed
# many of the suites have identical names for minimal and mainnet
- name: Spec tests general
run: yarn test:spec-generic
run: pnpm test:spec-generic
working-directory: packages/ssz
- name: Spec tests phase0-minimal
run: LODESTAR_FORK=phase0 yarn test:spec-static-minimal
run: LODESTAR_FORK=phase0 pnpm test:spec-static-minimal
working-directory: packages/ssz
- name: Spec tests phase0-mainnet
run: LODESTAR_FORK=phase0 yarn test:spec-static-mainnet
run: LODESTAR_FORK=phase0 pnpm test:spec-static-mainnet
working-directory: packages/ssz
- name: Spec tests altair-minimal
run: LODESTAR_FORK=altair yarn test:spec-static-minimal
run: LODESTAR_FORK=altair pnpm test:spec-static-minimal
working-directory: packages/ssz
- name: Spec tests altair-mainnet
run: LODESTAR_FORK=altair yarn test:spec-static-mainnet
run: LODESTAR_FORK=altair pnpm test:spec-static-mainnet
working-directory: packages/ssz
- name: Spec tests bellatrix-minimal
run: LODESTAR_FORK=bellatrix yarn test:spec-static-minimal
run: LODESTAR_FORK=bellatrix pnpm test:spec-static-minimal
working-directory: packages/ssz
- name: Spec tests bellatrix-mainnet
run: LODESTAR_FORK=bellatrix yarn test:spec-static-mainnet
run: LODESTAR_FORK=bellatrix pnpm test:spec-static-mainnet
working-directory: packages/ssz

test-bun:
Expand All @@ -73,18 +73,18 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Yarn
run: bun install -g npm:yarn
- name: Install pnpm
run: bun install -g npm:pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
- name: Build
run: yarn build
run: pnpm build
- name: Generate
run: bun run --filter '*' generate
- name: Unit Tests
Expand Down
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
yarn-error.log
.nyc_output/
.idea/
.vscode
Expand All @@ -15,11 +14,6 @@ benchmark_data/
*.tgz

node_modules
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# Deno
deno.lock
13 changes: 0 additions & 13 deletions .yarnrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"npmClient": "yarn",
"npmClient": "pnpm",
"useNx": true,
"version": "1.18.1",
"stream": true,
Expand Down
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
"workspaces": [
"packages/*"
],
"packageManager": "yarn@1.22.22",
"packageManager": "pnpm@10.23.0",
"scripts": {
"clean": "lerna run clean",
"generate": "lerna run generate",
"build": "yarn clean && lerna run build",
"clean": "pnpm -r clean",
"generate": "pnpm -r generate",
"build": "pnpm clean && pnpm -r build",
"lint": "biome check",
"lint:fix": "biome check --write",
"check-types": "lerna run check-types",
"test:browsers": "lerna run test:browsers",
"test:unit": "lerna run test:unit",
"check-types": "pnpm -r check-types",
"test:browsers": "pnpm -r test:browsers",
"test:unit": "pnpm -r test:unit",
"benchmark:files": "NODE_OPTIONS='--max_old_space_size=4096 --loader=ts-node/esm' benchmark --config .benchrc.yaml",
"benchmark": "yarn benchmark:files 'packages/*/test/perf/**/*.test.ts'",
"benchmark:local": "yarn benchmark --local",
"check-readme": "lerna run check-readme"
"benchmark": "pnpm benchmark:files 'packages/*/test/perf/**/*.test.ts'",
"benchmark:local": "pnpm benchmark --local",
"check-readme": "pnpm -r check-readme"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
Expand All @@ -32,6 +32,7 @@
"vite-plugin-node-polyfills": "^0.23.0",
"vitest": "~3.0.7",
"vitest-in-process-pool": "^2.0.0",
"webdriverio": "^9.2.11"
"webdriverio": "^9.2.11",
"@chainsafe/persistent-merkle-tree": "workspace:"
}
}
1 change: 0 additions & 1 deletion packages/as-sha256/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
yarn-error.log
dist/
lib/
benchmark.txt
2 changes: 1 addition & 1 deletion packages/as-sha256/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AssemblyScript implementation of SHA256.

## Usage

`yarn add @chainsafe/as-sha256`
`pnpm add @chainsafe/as-sha256`

```typescript
import {digest, digest64, SHA256} from "@chainsafe/as-sha256";
Expand Down
10 changes: 5 additions & 5 deletions packages/as-sha256/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
"generate": "rm -rf ./dist && node --loader ts-node/esm/transpile-only ./scripts/codegen.ts",
"asbuild:untouched": "asc assembly/index.ts -o build/untouched.wasm -t build/untouched.wat --runtime minimal --target debug",
"asbuild:optimized": "asc assembly/index.ts -o build/optimized.wasm -t build/optimized.wat --runtime minimal --target release -O3z --noAssert",
"asbuild": "yarn asbuild:untouched && yarn asbuild:optimized",
"asbuild": "pnpm asbuild:untouched && pnpm asbuild:optimized",
"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",
"asbuild:simd": "pnpm asbuild:simd:untouched && pnpm asbuild:simd:optimized",
"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:lib",
"build": "pnpm asbuild && pnpm asbuild:simd && pnpm generate && pnpm build:lib",
"test:unit": "vitest run --dir test/unit/",
"test:browsers": "vitest run --config ./vitest.browser.config.ts --dir test/unit",
"benchmark": "node -r ts-node/register ./node_modules/.bin/benchmark 'test/perf/*.test.ts'",
"benchmark:local": "yarn benchmark --local",
"test:ci": "yarn test:as-ci"
"benchmark:local": "pnpm benchmark --local",
"test:ci": "pnpm test:as-ci"
},
"devDependencies": {
"@chainsafe/babel-plugin-inline-binary-import": "^1.0.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/persistent-merkle-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"clean": "rm -rf lib",
"build": "tsc -p tsconfig.build.json",
"benchmark:files": "node --max-old-space-size=4096 --expose-gc --loader ts-node/esm/transpile-only ../../node_modules/.bin/benchmark",
"benchmark": "yarn benchmark:files 'test/perf/*.test.ts'",
"benchmark:local": "yarn benchmark --local",
"benchmark": "pnpm benchmark:files 'test/perf/*.test.ts'",
"benchmark:local": "pnpm benchmark --local",
"test:unit": "vitest run --dir test/unit"
},
"repository": {
Expand All @@ -59,7 +59,7 @@
},
"homepage": "https://github.com/ChainSafe/persistent-merkle-tree#readme",
"dependencies": {
"@chainsafe/as-sha256": "1.2.0",
"@chainsafe/as-sha256": "workspace:",
"@chainsafe/hashtree": "1.0.2",
"@noble/hashes": "^1.3.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/persistent-merkle-tree/test/utils/expectHex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from "chai";
import {expect} from "vitest";

type BufferLike = string | Uint8Array | Buffer;

Expand All @@ -16,5 +16,5 @@ export function toHex(bytes: BufferLike): string {
}

export function expectEqualHex(value: BufferLike, expected: BufferLike): void {
expect(toHex(value)).to.be.equal(toHex(expected));
expect(toHex(value)).toEqual(toHex(expected));
}
1 change: 0 additions & 1 deletion packages/ssz/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ lib/
node_modules/
.idea/
.vscode
yarn-error.log

spec-tests
17 changes: 9 additions & 8 deletions packages/ssz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,29 @@
"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",
"build:release": "pnpm clean && pnpm build && pnpm build-web && pnpm run build:docs",
"check-types": "tsc --noEmit",
"clean": "rm -rf lib && rm -rf dist && rm -f tsconfig.tsbuildinfo",
"prepublishOnly": "yarn build",
"benchmark": "yarn benchmark:files 'test/perf/*.test.ts'",
"prepublishOnly": "pnpm build",
"benchmark": "pnpm benchmark:files 'test/perf/*.test.ts'",
"benchmark:files": "node --loader=ts-node/esm --max-old-space-size=4096 --expose-gc ../../node_modules/.bin/benchmark",
"benchmark:local": "yarn benchmark --local",
"benchmark:local": "pnpm benchmark --local",
"test:unit": "vitest run --dir test/unit",
"test:spec": "yarn test:spec-generic && yarn test:spec-static test:spec-eip-4881",
"test:spec": "pnpm test:spec-generic && pnpm test:spec-static test:spec-eip-4881",
"test:spec-generic": "vitest run --dir test/spec/generic",
"test:spec-static": "yarn test:spec-static-minimal && yarn test:spec-static-mainnet",
"test:spec-static": "pnpm test:spec-static-minimal && pnpm test:spec-static-mainnet",
"test:spec-static-minimal": "LODESTAR_PRESET=minimal vitest run --dir test/spec/ test/spec/ssz_static.test.ts",
"test:spec-static-mainnet": "LODESTAR_PRESET=mainnet vitest run --dir test/spec/ test/spec/ssz_static.test.ts",
"test:spec-eip-4881": "vitest run --dir test/spec/ test/spec/eip-4881/**/*.test.ts",
"download-spec-tests": "node --loader ts-node/esm/transpile-only test/spec/downloadTests.ts"
},
"dependencies": {
"@chainsafe/as-sha256": "1.2.0",
"@chainsafe/persistent-merkle-tree": "1.2.1"
"@chainsafe/as-sha256": "workspace:",
"@chainsafe/persistent-merkle-tree": "workspace:"
},
"devDependencies": {
"@lodestar/spec-test-util": "^1.23.1",
"@chainsafe/persistent-ts": "workspace:",
"@types/js-yaml": "^4.0.5",
"js-yaml": "^4.1.0",
"snappyjs": "^0.6.1"
Expand Down
Loading