IBM / report-toolkit

A toolkit for consumers of Node.js diagnostic Reports
https://ibm.github.io/report-toolkit
Other
84 stars 10 forks source link

disable ESLint rule monorepo/no-internal-imports #26

Open boneskull opened 5 years ago

boneskull commented 5 years ago

I had enabled this because it:

  1. restricts imports to a set of whitelisted imports via module-level exports
  2. discourages consumers from reaching into the guts of any given package and doing weird stuff

But it's plainly inconvenient:

import {observable} from '@report-toolkit/common';
const {all, the, stuff, I, need, to, use} = observable;

where it'd be nicer to just:

import {all, the, stuff, I, need, to, use} from '@report-toolkit/common/observable';

Now, each package puts everything in 'src/', so we'd want to actually move the files out of there and into the package root.

This same thing should be possible when using the CJS bundle. I'm not sure the best way to accomplish that, but I think we can look at RxJS as an example, because I believe it allows this. It doesn't bundle itself for CJS, however (it just compiles via TypeScript), which means our Rollup configuration may be limited to generating UMD bundles for browser use. We could then just use @babel/cli to transpile for CJS.

boneskull commented 5 years ago

also the pkg-exports thing could be helpful here.