Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to ethereumjs-config v2.0.0 (old) #886

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b213a7b
tooling: adding clean script
evertonfraga Aug 18, 2020
da1ce63
account: Integrating @ethereumjs/config-typescript
evertonfraga Aug 27, 2020
07e7aef
git: adding dist.browser to gitignore
evertonfraga Sep 8, 2020
ec9b292
Adding dist.browser to prettierignore
evertonfraga Sep 8, 2020
949b250
Merge
evertonfraga Sep 9, 2020
351a193
docs: Add verdaccio documentation
evertonfraga Sep 9, 2020
095804b
Ethereumjs Config implementation
evertonfraga Sep 16, 2020
4192398
blockchain,vm: Making builds pass
evertonfraga Sep 16, 2020
25f7241
Using gitpkg urls
evertonfraga Sep 16, 2020
ed24f35
tooling: Enabling lint on pre-push
evertonfraga Sep 21, 2020
019490e
account: lint, docs rebuild
evertonfraga Sep 21, 2020
3aac8d0
block: lint, docs rebuild
evertonfraga Sep 21, 2020
1639d22
blockchain: lint, docs rebuild
evertonfraga Sep 21, 2020
4205381
blockchain: lint, docs rebuild
evertonfraga Sep 21, 2020
3994df9
common: lint, docs rebuild
evertonfraga Sep 21, 2020
3b7e6ff
ethash: lint
evertonfraga Sep 21, 2020
6b749c1
account: fix test run
evertonfraga Sep 21, 2020
6810c8a
blockchain: fix test runner
evertonfraga Sep 21, 2020
3b33542
vm: fix test run
evertonfraga Sep 21, 2020
c95e55a
common: fix test run
evertonfraga Sep 21, 2020
171a8d6
tx: fix test run
evertonfraga Sep 22, 2020
4633078
ethash: fix test run
evertonfraga Sep 22, 2020
b5551b5
ethash: Fixes lint; Reference local variable instead of global "exports"
evertonfraga Sep 22, 2020
05f56ee
tx: Lint fixes
evertonfraga Sep 22, 2020
c7c63b7
tx: Post-rebase fixes
evertonfraga Sep 22, 2020
02932ad
lint: minor fixes
evertonfraga Sep 23, 2020
6582671
block: Linting fixes
evertonfraga Oct 6, 2020
347c2e5
vm: fix merge results
evertonfraga Oct 6, 2020
5763061
common: Disable specific eslint rule
evertonfraga Oct 6, 2020
22e5efa
block: fix typescript in tests
evertonfraga Oct 6, 2020
40d1aad
vm: Fixing linting errors
evertonfraga Oct 6, 2020
ec3e61e
vm: lint fixes and rule exceptions
evertonfraga Oct 6, 2020
5f4e756
vm: Adding rules to ignore list to be handled later
evertonfraga Oct 6, 2020
960bfa5
vm: karma tests tuning
evertonfraga Oct 6, 2020
ca29b04
Fixing coverage config
evertonfraga Oct 7, 2020
6707424
triggering tests
evertonfraga Oct 8, 2020
f7d0482
Fixing eslint dependencies
evertonfraga Oct 8, 2020
6d6ac9e
Package-lock updates
evertonfraga Oct 8, 2020
70c7930
Removing merge conflict markers
evertonfraga Oct 8, 2020
7108daf
tx: karma concurrency to 1
evertonfraga Oct 8, 2020
6628ec5
lint: prettier fix on lates PRs merged to master
evertonfraga Oct 8, 2020
919f8ce
Extending prettier config from parent package
evertonfraga Oct 8, 2020
2a7e0f0
lint: Updated maximum line width to 100
evertonfraga Oct 8, 2020
7b7de30
updating remote package references
evertonfraga Oct 8, 2020
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.swp
.idea
*.lerna_backup
.tmp

# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node
Expand Down Expand Up @@ -68,6 +69,7 @@ jspm_packages/

# generate output
dist
dist.browser

# Gatsby files
.cache/
Expand Down
54 changes: 46 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,15 @@ Installs dependencies for all sub-packages, and links them to create an integrat

#### `npm run build`

Produces `dist` files for all sub-packages. This command can be scoped.
Builds all monorepo packages by default. If a scope is provided, it will only build that particular package.

Scoped example, that will only build the VM package:
npm run build -- --scope @ethereumjs/vm


#### `npm run build:tree -- --scope @ethereumjs/blockchain`

Builds all local packages that the provided package (eg: @ethereumjs/blockchain) depends on, and itself. This unusual syntax just means: pass whatever arguments are after `--` to the underlying script.
Builds all local packages that the provided package depends on (e.g.: @ethereumjs/blockchain), and builds itself.

If no scope is provided, `npm run build:tree`, will build all sub-packages.

Expand All @@ -82,31 +86,33 @@ There's a set of rather standardized commands you will find in each package of t

#### `npm run build`

Uses TypeScript compiler to build files from `src` or `lib`. Files can be found at `packages/<name>/dist`.
Uses TypeScript compiler to build source files. The resulting files can be found at `packages/<name>/dist`.

#### `npm run coverage`

Runs whatever is on `npm run test` script, capturing coverage information. By the end, it displays a coverage table. Additional reports can be found at `packages/<name>/coverage`.
Runs whatever is on `npm run test` script, capturing testing coverage information. By the end, it displays a coverage table. Additional reports can be found at `packages/<name>/coverage/`.

#### `npm run docs:build`

Generates package documentation and outputs it to `./packages/<name>/docs`.
Generates package documentation and saves them to `./packages/<name>/docs`.

#### `npm run lint`

Checks code style according to the rules defined in [ethereumjs-config](https://github.com/ethereumjs/ethereumjs-config).

#### `npm run lint:fix`

Fixes code style according to the rules.
Fixes code style according to the rules. Differently from `npm run lint`, this command actually writes to files.

#### `npm run test`

Runs all package tests. Note that the VM has several test scopes - refer to [packages/vm/package.json](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/vm/package.json) for more info.
Runs the package tests.

_Note that the VM has several test scopes - refer to [packages/vm/package.json](https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/vm/package.json) for more info._

#### `npm run clean`

Removes root and package `node_modules` directories. Useful to run before `npm i` for a fresh install.
Removes root and package `node_modules` directories, and other generated files, like `coverage`, `dist` and others. This is useful to run after changing branches, to have a clean slate to work with.

### Going further

Expand All @@ -120,6 +126,38 @@ As this project is powered by Lerna, you can install it globally to enjoy lots m

Hoisting is enabled so dependencies are moved to the root `node_modules`. `lerna clean` [does not remove the root `node_modules`](https://github.com/lerna/lerna/issues/1304) so for convenience you can use the project script `npm run clean`.

### Testing packages locally on other projects

There are some ways you can link this repository packages to other projects before publishing. You can symlink dependencies with [`npm link <package>`](https://docs.npmjs.com/cli/link), or install packages from the filesystem using [`npm install <folder>`](https://docs.npmjs.com/cli/install). But they are subject to some externalities and most importantly with how your package manager handles the lifecycle of packages during installs.

_Note: Git references do not work with monorepo setups out of the box due to the lack of directory traversal on the syntax. E.g.:_

npm install git@github.com:ethereumjs/ethereumjs-vm.git

_One way to fetch packages remotely from GitHub before publishing is using [gitpkg.now.sh](https://gitpkg.now.sh/)._

But there's a cleaner way to manage your dependencies using Verdaccio.

#### Install Verdaccio

Verdaccio is an npm registry and proxy that can be of great help to test packages locally. Check out their [Getting Started guide](https://github.com/verdaccio/verdaccio#get-started).

#### Installs, hoists dependencies and builds packages
npm install

#### Publish monorepo packages to Verdaccio
lerna exec "npm publish --registry http://localhost:4873 --ignore-scripts"

#### Unpublish all monorepo packages from Verdaccio
lerna exec "npm unpublish \$LERNA_PACKAGE_NAME --registry http://localhost:4873 --force"

#### Setup @ethereumjs scope to local Verdaccio server
npm config set @ethereumjs:registry http://localhost:4873

#### Teardown @ethereumjs scope to local Verdaccio server
npm config delete @ethereumjs:registry


# EthereumJS

See our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices.
Expand Down
Loading