From 3b7183e9fa22faca444b32aac28ac618adb9a74d Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Tue, 16 Jan 2018 09:49:58 -0800 Subject: [PATCH] feat: add lerna clean for clean:full and build:full scripts With loopback-next monorepo, sometimes we have to switch between branches that have different packages. It becomes problematic to ensure clean states. This PR adds some scripts to solve the issue: - npm run clean:full (triggers lerna clean to remove all node_modules) - npm run build:full (run full clean, lerna bootstrap, build, test, and lint) --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 67f578880072..f24314bc0e1e 100644 --- a/package.json +++ b/package.json @@ -35,9 +35,10 @@ "prettier:check": "npm run prettier:cli -- -l", "prettier:fix": "npm run prettier:cli -- --write", "clean": "lerna run --loglevel=silent clean", + "clean:full": "npm run clean && lerna clean --yes --loglevel=silent", "build": "lerna run --loglevel=silent build", "build:current": "lerna run --loglevel=silent build:current", - "build:full": "npm run clean && npm run build && npm run mocha && npm run lint", + "build:full": "npm run clean:full && npm run bootstrap && npm run build && npm run mocha && npm run lint", "pretest": "npm run clean && npm run build:current", "test": "node packages/build/bin/run-nyc npm run mocha", "mocha": "node packages/build/bin/select-dist mocha --opts test/mocha.opts \"packages/*/DIST/test/**/*.js\" \"packages/cli/test\"",