Skip to content

Commit

Permalink
Monorepo: More LRU updates and ESM Fixes (#2809)
Browse files Browse the repository at this point in the history
* GitHub Actions browser workflow file fix

* Fix yaml file

* Util: switch to type commonjs for main package.json, skip provider tests, re-add to browser CI run

* Common: switch to type commonjs in package.json

* Tx: switch to type commonjs in package.json

* Trie: switch to type commonjs in package.json, require fixes, skip stream.spec.ts, activate in browser CI workflow

* Add missing import path

* Bring back webdriverio for additional browser testing flexibility

* Rebuild package-lock.json

* Block: fixes and re-add to browser CI workflow

* Blockchain: fixes

* Blockchain: update LRU cache from v7 to v10

* Rebuild package-lock.json

* Blockchain: move Consensus interface to types.ts (fixes Blockchain test run so might be something generally quirky and generally can't hurt anyhow)

* Genesis: require -> import (only temporary, will refactored anyhow, then: no central JSON-distribution-file)

* Blockchain: reactivate browser test CI workflow

* Wallet fixes

* Wallet: update uuid from v8 to v9, require -> import, added @types/uuid

* Rebuild package-lock.json

* Wallet: move main source to dedicated file, index.ts -> wallet.ts

* Wallet: rework Wallet to have its own wallet.ts file and a distributing index.ts file

* Wallet: add vitest.config.browser.ts, exclude index.spec.ts, add to CI browser test workflow

* StateManager: switch type to commonjs in package.json, add vitest.config.browser.ts file, exlude two failing test files, activate CI browser test workflow

* Util: test other browser test provider and browser in CI

* Do not cancel browser workflow in progress to see all results

* Partially switch back to (default) webdriverio provider, remove fail-fast from browser CI workflow, other fixes

* Update crc dep

* Remove sed from tsbuild

* Trie: remove src/trie subfolder

* Trie: adopt paths to new structure

* Fix trie export

* Switch genesisStates to js and migrate tape to vitest

* Merge remote-tracking branch 'origin/master' into more-lru-updates-and-esm-fixes

* fix trie test again

* Remove broken karma test run

* Remove karma tsconfig

---------

Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com>
Co-authored-by: acolytec3 <konjou@gmail.com>
  • Loading branch information
3 people committed Jun 22, 2023
1 parent 3c1c835 commit e0282e3
Show file tree
Hide file tree
Showing 73 changed files with 11,546 additions and 11,034 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ env:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test-all-browser:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
fail-fast: false
steps:
- uses: actions/checkout@v3

Expand All @@ -31,28 +31,23 @@ jobs:

- run: npm ci

# Install playwright dependencies
# Install playwright dependencies
- run: npx playwright install-deps

- run: npm run test:browser -w=@ethereumjs/rlp
# - run: npm run test:browser -w=@ethereumjs/util
# Util: random tests fail with an odd "unable to import a module" error
- run: npm run test:browser -w=@etheruemjs/common
# Trie: several tests not passing yet
# - run: npm run test:browser -w=@ethereumjs/trie
- run: npm run test:browser -w=@ethereumjs/util
- run: npm run test:browser -w=@ethereumjs/common
- run: npm run test:browser -w=@ethereumjs/trie
- run: npm run test:browser -w=@ethereumjs/tx
# Block: serveral tests not passing yet
# - run: npm run test:browser -w=@ethereumjs/block
- run: npm run test:browser -w=@ethereumjs/block
# No browser tests for devp2p
# Blockchain: strange errors, needs another look
# - run: npm run test:browser -w=@ethereumjs/blockchain
- run: npm run test:browser -w=@ethereumjs/blockchain
# No browser tests for ethash
- run: npm run test:browser -w=@ethereumjs/wallet
- run: cd ../statemanager && npm run test:browser
# EVM: several tests not passing yet
# - run: cd ../evm && npm run test:browser
# StateManager: selected tests not passing yet
# - run: cd ../statemanager && npm run test:browser
# Wallet: import failing
# - run: npm run test:browser -w=@ethereumjs/wallet

# VM: several tests not passing yet
# - run: npm run test:browser -w=@ethereumjs/vm

2 changes: 0 additions & 2 deletions .github/workflows/client-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ jobs:
max_attempts: 3
command: cd ${{github.workspace}}/packages/client && npm run test:integration

- run: npm run test:browser

- run: npm run lint

test-client-dockerfile:
Expand Down
2 changes: 0 additions & 2 deletions config/cli/ts-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ post_build_fixes() {
blue "[Post Build Fixes]"
if [ -f ./dist/esm/index.js ];
then
echo "Adding JSON type assertions to ESM build outputs"
find . -wholename "**/dist/esm/**.js" -exec sed -i '/from \S\+\.json'\''/ s/;//;/from \S\+\.json/ s/.*/& assert {type: \"json\"};/' {} +
echo "Adding ./dist/cjs/package.json"
rm -f ./dist/cjs/package.json
cat <<EOT >> ./dist/cjs/package.json
Expand Down
Loading

0 comments on commit e0282e3

Please sign in to comment.