1.4.0 • Published 3 years ago

lerna-script-tasks-idea v1.4.0

Weekly downloads
8
License
BSD
Repository
github
Last release
3 years ago

lerna-script-tasks-idea

lerna-script task to generate WebStorm project for a Lerna managed project with hardcoded conventions:

  • mark node_modules as ignored so WebStorm would not index those. Having >= 20 modules open with node_modules indexing pretty much kills it:/
  • set source level to es6;
  • mark lib, src as source rootps and test, tests as test roots;
  • add mocha run configurations for all modules.

Note: given this task generates WebStorm project files manually, you must close all instances of WebStorm before generating and open afterwards.

install

npm install --save-dev lerna-script-tasks-idea

Usage

Add lerna-script launcher to package.json scripts:

{
  "scripts": {
    "start": "lerna-script"
  }
}

Add export to lerna.js:

const idea = require('lerna-script-tasks-idea');

module.exports.idea = idea();

To generate WebStorm project run:

npm start idea

API

({packages, mochaConfigurations: packageJson => [], excludePatterns, addRoot: boolean = false})(log): Promise

Returns a function that generates WebStorm for all modules in repo.

Parameters:

  • packages - list of packages to generate idea project for or defaults to ones defined in lerna.json;
  • mochaConfigurations - function, that, given packageJson object of a module returns a list of mocha configurations in a format:
    • name - configuration name;
    • environmentVariables - key/value pair of environment variables for configuration;
    • extraOptions - extra mocha options;
    • testKind - kind of test, ex. PATTERN;
    • testPattern - pattern expression.
  • excludePatterns - array of patterns that will be set as the project exclude patterns. Files\Folders matching that pattern will be marked as "excluded" in Idea
  • addRoot - when true, the root.iml file will be generated to make all non-modules visible in IDEA (optional, defaults to false)
  • log - npmlog instance.
1.4.0

3 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1-alpha.0

5 years ago

1.0.0-0

5 years ago

0.10.0

5 years ago

0.9.6

5 years ago

0.9.5

5 years ago

0.9.4

5 years ago

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.1

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

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago