Skip to content

Commit

Permalink
chore: use npm 7 workspaces instead of lerna bootstrap
Browse files Browse the repository at this point in the history
It's faster - running `time npm i` shows a nice speed up:

lerna

```
npm timing command:install Completed in 183859ms
npm timing npm Completed in 184077ms
npm info ok

real	3m4.246s
user	2m48.066s
sys	0m58.948s
```

npm7 + workspaces

```
npm timing command:install Completed in 101724ms
npm timing npm Completed in 101914ms
npm info ok

real	1m42.075s
user	1m52.422s
sys	0m46.022s
```

The downside is it requires npm7 - it's bundled with node 15 but will
require users up upgrade if they are using node 14 or below.
  • Loading branch information
achingbrain committed Feb 18, 2021
1 parent ca26353 commit f18a493
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ stages:
- release

node_js:
- 'node'
- 'lts/*'
- 'node'

os:
- linux
Expand All @@ -27,6 +27,8 @@ os:
before_install:
# prevents windows error: npm ERR! ... git-sh-setup: file not found
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export PATH=/c/PROGRA~1/Git/usr/bin:/c/PROGRA~1/Git/mingw64/libexec/git-core:$PATH ; fi
# workspaces require npm 7 or above
- npm install -g npm@latest

script: npx nyc -s npm run test -- -- -- -t node --bail
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "1.0.0",
"description": "JS implementation of the IPFS UnixFS",
"scripts": {
"postinstall": "lerna bootstrap",
"reset": "lerna run clean && rm -rf packages/*/node_modules node_modules",
"test": "lerna run test",
"coverage": "lerna run coverage",
Expand Down Expand Up @@ -47,5 +46,11 @@
"Diogo Silva <fsdiogo@gmail.com>",
"jbenet <juan@benet.ai>",
"Bernard Mordan <bernard@tableflip.io>"
]
],
"workspaces": [
"packages/*"
],
"engines": {
"npm": ">=7.0.0"
}
}

0 comments on commit f18a493

Please sign in to comment.