Skip to content

Commit

Permalink
replace lerna with npm workspaces and typescript references
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Aug 10, 2021
1 parent ae96604 commit c84fca9
Show file tree
Hide file tree
Showing 49 changed files with 38,582 additions and 51,592 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/block-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,22 @@ jobs:
key: Block-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:block
- name: Update to npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:block
- run: npm run build --workspace=@ethereumjs/block
working-directory: ${{github.workspace}}

- name: Build deps for dist.browser for karma
run: npm run build --workspace=@ethereumjs/common

- run: npm run coverage

- uses: codecov/codecov-action@v1
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/blockchain-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,22 @@ jobs:
key: Blockchain-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:blockchain
- name: Update to npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:blockchain
- run: npm run build --workspace=@ethereumjs/blockchain
working-directory: ${{github.workspace}}

- name: Build deps for dist.browser for karma
run: npm run build --workspace=@ethereumjs/block

- run: npm run coverage

- uses: codecov/codecov-action@v1
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/client-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ jobs:
key: Client-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:client
- name: Use npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:client
- run: npm run build --workspace=@ethereumjs/client
working-directory: ${{github.workspace}}

- run: npm run coverage
Expand Down Expand Up @@ -79,14 +82,14 @@ jobs:
key: Client-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:client
# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:client
- run: npm run build --workspace=ethereumjs-client
working-directory: ${{github.workspace}}

- run: npm run test:cli -- --network=${{matrix.network}} --syncmode=${{matrix.syncmode}} --transports rlpx
14 changes: 10 additions & 4 deletions .github/workflows/common-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,22 @@ jobs:
key: Common-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:common
- name: Use npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:common
- run: npm run build --workspace=@ethereumjs/common
working-directory: ${{github.workspace}}

- name: Build deps for dist.browser for karma
run: npm run build --workspace=ethereumjs-util

- run: npm run coverage

- uses: codecov/codecov-action@v1
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/devp2p-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ jobs:
key: Devp2p-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:devp2p
- name: Use npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:devp2p
- run: npm run build --workspace=@ethereumjs/devp2p
working-directory: ${{github.workspace}}

- run: npm run coverage
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/e2e-hardhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ jobs:
path: |
**/node_modules
- name: Use npm v7 for workspaces support
run: npm i -g npm@7

# Build if cache is restored
- run: npm run build
- run: npm run build --workspaces
if: steps.cache.outputs.cache-hit == 'true'

# Otherwise, run install (which also runs bootstrap and build)
# Otherwise, run install (which also runs build)
- run: npm install
if: steps.cache.outputs.cache-hit != 'true'

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/ethash-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ jobs:
key: Ethash-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:ethash
- name: Use npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:ethash
- run: npm run build --workspace=@ethereumjs/ethash
working-directory: ${{github.workspace}}

- run: npm run coverage
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/node-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ jobs:
with:
submodules: recursive

- name: Use npm v7 for workspaces support
run: npm i -g npm@7

- run: npm install
- run: npm run build

- name: Test Block
run: npm run test
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/trie-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,22 @@ jobs:
key: Trie-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:trie
- name: Update to npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:trie
- run: npm run build --workspace=merkle-patricia-tree
working-directory: ${{github.workspace}}

- name: Build deps for dist.browser for karma
run: npm run build --workspace=ethereumjs-util

- run: npm run coverage

- uses: codecov/codecov-action@v1
Expand All @@ -73,15 +79,18 @@ jobs:
with:
key: Trie-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

- name: Update to npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:trie
# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:trie
- run: npm run build --workspace=merkle-patricia-tree
working-directory: ${{github.workspace}}

- run: npm run benchmarks | tee output.txt
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/tx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ jobs:
key: Tx-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:tx
- name: Update to npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:tx
- run: npm run build --workspace=@ethereumjs/tx
working-directory: ${{github.workspace}}

- run: npm run coverage
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/util-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ jobs:
key: Util-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:util
- name: Update to npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:util
- run: npm run build --workspace=ethereumjs-util
working-directory: ${{github.workspace}}

- run: npm run coverage
Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/vm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ jobs:
key: VM-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:vm
# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:vm
- run: npm run build --workspace=@ethereumjs/vm
working-directory: ${{github.workspace}}

- run: npm run coverage
Expand Down Expand Up @@ -69,14 +69,14 @@ jobs:
key: VM-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:vm
# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:vm
- run: npm run build --workspace=@ethereumjs/vm
working-directory: ${{github.workspace}}

- run: npm run test:state:selectedForks
Expand All @@ -98,14 +98,14 @@ jobs:
key: VM-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:vm
# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:vm
- run: npm run build --workspace=@ethereumjs/vm
working-directory: ${{github.workspace}}

- run: npm run test:blockchain
Expand All @@ -127,14 +127,17 @@ jobs:
key: VM-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
path: '**/node_modules'

# Installs root dependencies, ignoring Bootstrap All script.
# Bootstraps the current package only
- run: npm install --ignore-scripts && npm run bootstrap:vm
- name: Update to npm v7 for workspaces support
run: npm i -g npm@7

# Installs root dependencies,
# ignoring postinstall script to build all packages.
- run: npm install --ignore-scripts
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ${{github.workspace}}

# Builds current package and the ones it depends from.
- run: npm run build:vm
- run: npm run build --workspace=@ethereumjs/vm
working-directory: ${{github.workspace}}

- run: npm run build:benchmarks
Expand Down
Loading

0 comments on commit c84fca9

Please sign in to comment.