yunabe / tslab

Interactive JavaScript and TypeScript programming with Jupyter
Apache License 2.0
700 stars 44 forks source link

Using tslab as interactive documentation with turborepo #question #73

Open alfonsodev opened 1 year ago

alfonsodev commented 1 year ago

Hi thanks to all contributors for creating this.

I'm trying to add tslab as a way to have interactive documentation for libraries inside our monorepo. I'm using turborepo with a strcuture like

apps/
  docs/
     test.ipynb

 lib/
    shared/
      src/
        Command.ts
        index.ts

then when I'm importing code from our shared library it is found but to transpiled,

Screenshot 2022-10-08 at 17 28 43

this is somewhat expected, as similarly when importing libraries in a nextjs project you need to add

const withTM = require('next-transpile-modules')(['@codefulness/shared']);

to have it working properly.

I guess my question is, is it posible to do something similar in tslab environment, as it seems it can resolve properly the library folder, but I'm guessing is expecting to be already javascript ?

thank you!