0.1.4 • Published 6 years ago

lerna-jsconfig v0.1.4

Weekly downloads
103
License
MIT
Repository
github
Last release
6 years ago

Lerna-JSConfig

Generate jsconfig.json allowing VSCode to \"Open Definition\" your Lerna packages.

Install

$ npm i --save lerna-jsconfig

Usage

  1. Add a jsconfig.json to your Lerna root

    {
      "compilerOptions": {
        "baseUrl": ".",
        "paths": {}
      }
    }
  2. From inside your Lerna project:

    $ npx --no-install lerna-jsconfig

CLI Output

lerna notice cli v3.4.3
lerna success found 13 packages
jsconfig.json was updated in Lerna root: /Users/username/repos/lerna-project-dir
{ compilerOptions:
   { baseUrl: '.',
     paths:
      { '@project/comp-a': [Array],
        '@project/comp-b': [Array],
        '@project/comp-c': [Array] } } }

JSON Output

<lerna-root>/tsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@project/comp-a": [
        "./packages/comp-a/src/index.js"
      ],
      "@project/comp-b": [
        "./packages/comp-b/src/index.js"
      ],
      "@project/comp-b": [
        "./packages/comp-b/src/index.js"
      ]
    }
  }
}
$ npx --no-install lerna-jsconfig

WARNING!

  • This will overwrite any existing jsconfig.json paths.
  • You MUST have a jsconfig.json in your Lerna root before running this.
  • You MUST have a package.json with a main or module entry point in the package.json files for each or your packages.