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 (Cherry Pick Edition 🍒 ) #913

Merged
merged 38 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
64cb6ea
tooling: adding clean script
evertonfraga Aug 18, 2020
aaa5c8a
git: adding dist.browser to gitignore
evertonfraga Sep 8, 2020
151d3e2
Merge
evertonfraga Sep 9, 2020
8732b84
docs: Add verdaccio documentation
evertonfraga Sep 9, 2020
c9ca244
Ethereumjs Config implementation
evertonfraga Sep 16, 2020
cba84eb
blockchain,vm: Making builds pass
evertonfraga Sep 16, 2020
2aaad0b
Using gitpkg urls
evertonfraga Sep 16, 2020
ce7417a
tooling: Enabling lint on pre-push
evertonfraga Sep 21, 2020
5ee7e94
block: lint
holgerd77 Oct 16, 2020
91c5ccf
block: Linting fixes
evertonfraga Oct 6, 2020
7a19075
blockchain: lint
holgerd77 Oct 16, 2020
32d5876
common: lint
holgerd77 Oct 16, 2020
a94615e
ethash: lint
holgerd77 Oct 16, 2020
ac6913c
tx: lint
holgerd77 Oct 16, 2020
64017b3
vm: lint (open fixes)
holgerd77 Oct 16, 2020
5fddd4d
vm: Fixing linting errors
evertonfraga Oct 6, 2020
c204dfb
vm: lint fixes and rule exceptions
evertonfraga Oct 6, 2020
71020f7
vm: Adding rules to ignore list to be handled later
evertonfraga Oct 6, 2020
6c259f8
blockchain: fix test runner
evertonfraga Sep 21, 2020
6d31bcf
vm: fix test run
evertonfraga Sep 21, 2020
73c577b
common: fix test run
evertonfraga Sep 21, 2020
f6a831b
tx: fix test run
holgerd77 Oct 16, 2020
d38b4ff
ethash: fix test run
evertonfraga Sep 22, 2020
9bedc1a
lint: minor fixes
holgerd77 Oct 16, 2020
89718cf
block: fix typescript in tests
evertonfraga Oct 6, 2020
957ee14
vm: minor lint fix
holgerd77 Oct 16, 2020
960fa46
vm: karma tests tuning
evertonfraga Oct 6, 2020
b95e7e2
Fixing coverage config
evertonfraga Oct 7, 2020
1e48a30
Fixing eslint dependencies
evertonfraga Oct 8, 2020
1d34d19
tx: karma concurrency to 1
evertonfraga Oct 8, 2020
f694f76
Extending prettier config from parent package
evertonfraga Oct 8, 2020
003f37d
account: removed re-introduced package
holgerd77 Oct 16, 2020
69fc2e7
updating remote package references
evertonfraga Oct 8, 2020
1b6d977
monorepo: set @ethereumjs/config gitpkh URLs to master (lint-return-v…
holgerd77 Oct 19, 2020
8700cc5
monorepo: lint fixes (ESLint max line width change to 100)
holgerd77 Oct 19, 2020
0680001
monorepo: testing an updated @ethereumjs/config lint script version
holgerd77 Oct 19, 2020
9f8b3af
monorepo: added updated root package-lock.json to prevent caching iss…
holgerd77 Oct 19, 2020
3d105d1
monorepo: use v2.0.0 config packages
holgerd77 Oct 20, 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 @@ -65,11 +65,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 @@ -81,31 +85,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 @@ -119,6 +125,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