0.9.3 • Published 6 years ago

lerna-script-preset-wix-npm-basic v0.9.3

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

lerna-script-preset-wix-npm-basic

A preset for wix npm-based repos that exposes following tasks:

  • clean - cleans all modules - node_modules, target, *.log.... also cleans yarn.lock and package-lock.json
  • test - runs build and test tasks for all modules with incremental runs - does not run tests for unchanged modules;
  • prepush - syncs .nvmrc from root of repo to all modules, module versions, package.json docs/repo links, etc.
  • idea - idea task;

Usage

Given you have non-lerna project, install needed modules:

npm install --save-dev lerna lerna-script lerna-script-preset-wix-npm-basic husky

init lerna:

node_modules/.bin/lerna init

add to lerna.json:

"lerna-script-tasks": "lerna-script-preset-wix-npm-basic"

setup your package.json

{
  "name": "aggregator",
  "private": true,
  "version": "1.0.0",
  "scripts": {
    "prepush": "lerna-script sync",
    "postinstall": "lerna bootstrap",
    "clean": "lerna-script clean",
    "test": "lerna-script test",
    "idea": "lerna-script idea"
  },
  "devDependencies": {
    "husky": "^0.14.3",
    "lerna": "^2.0.0",
    "lerna-script": "latest",
    "lerna-script-preset-wix-npm-basic": "latest"
  }
}

Then:

  • upon install of root module all modules will be bootstrapped;
  • prepush task will be executed by husky and all sync actions will be performed;

If preset almost works for you, you can reuse most of it but customize a selected task, like:

const preset = require('lerna-script-preset-wix-npm')();

function clean(log) {
  preset.clean(log).then(() => {
    //do your thing
  });
}

module.exports = {
  ...preset,
  clean
}
0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.8

6 years ago

0.8.7

6 years ago

0.8.6

6 years ago

0.8.5

6 years ago

0.8.4

6 years ago

0.8.3

6 years ago

0.8.2

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.8

6 years ago

0.5.7

7 years ago

0.5.6

7 years ago

0.5.5

7 years ago

0.5.4

7 years ago