restricts imports to a set of whitelisted imports via module-level exports
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'tbundle 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.
I had enabled this because it:
But it's plainly inconvenient:
where it'd be nicer to just:
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.