Skip to content

Commit f18a493

Browse files
committed
chore: use npm 7 workspaces instead of lerna bootstrap
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.
1 parent ca26353 commit f18a493

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ stages:
1616
- release
1717

1818
node_js:
19-
- 'node'
2019
- 'lts/*'
20+
- 'node'
2121

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

3133
script: npx nyc -s npm run test -- -- -- -t node --bail
3234
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "1.0.0",
44
"description": "JS implementation of the IPFS UnixFS",
55
"scripts": {
6-
"postinstall": "lerna bootstrap",
76
"reset": "lerna run clean && rm -rf packages/*/node_modules node_modules",
87
"test": "lerna run test",
98
"coverage": "lerna run coverage",
@@ -47,5 +46,11 @@
4746
"Diogo Silva <fsdiogo@gmail.com>",
4847
"jbenet <juan@benet.ai>",
4948
"Bernard Mordan <bernard@tableflip.io>"
50-
]
49+
],
50+
"workspaces": [
51+
"packages/*"
52+
],
53+
"engines": {
54+
"npm": ">=7.0.0"
55+
}
5156
}

0 commit comments

Comments
 (0)