elsassph / roku-markdown

A simple markdown renderer for Roku
MIT License
3 stars 3 forks source link

bslib and BS definitions bundled with released package #2

Closed darktasevski closed 3 years ago

darktasevski commented 3 years ago

I'm not that familiar with how Brighterscript applications are working, but are *.d.bs files necessary for the roku-markdown to function? This is what is in roku-markdown dir after ropm installation:

Screen Shot 2021-06-14 at 12 06 45 PM

Also, in the source directory, aside from roku-markdown files, there is also bslib library:

Screen Shot 2021-06-14 at 12 09 43 PM

Why and do we need the bslib bundled with roku-markdown, it looks like none of its functions is being used in the roku-markdown code?

elsassph commented 3 years ago

Good questions. I'm myself figuring things out.

The files under roku_modules shouldn't be added to your repository. They should be ignored like one ignore node_modules.

The .d.bs are expected to be present, but they are really useful for brighterscript projects. They aren't usefult for "vanilla" brightscript projects. They in fact are annoying because they want you to use the class with the new keyword (which you can't use in normal brs). You can exclude all the d.bs in your bsconfig.json.

bslib is a dependency that brighterscript always adds (even if it's not used) - it serves in brs transpilation (though markdown lib doesn't use it).

elsassph commented 3 years ago

Note that .bs files definitely aren't supposed to be packaged (though they shouldn't harm)

darktasevski commented 3 years ago

Note that .bs files definitely aren't supposed to be packaged (though they shouldn't harm)

But they are packaged, ergo my question here. Wasn't sure if that's expected or not. roku_modules are not added to the repo, we're already using another ropm package, so we know the drill.

I guess that this can be fixed by modifying the files field in package.json, like this:

  "files": [
    "dist/components/Renderer.brs",
    "dist/components/Scroller.brs",
    "dist/source/Parser.brs"
  ]

That aside, the library seems to be working very well, thank you!

philippe-elsass-deltatre commented 3 years ago

The ropm module should have the d.bs - it's necessary if you do a brighterscript projec.

Your package shouldn't have he d.bs - are you packaging with bsc?

darktasevski commented 3 years ago

Oh, wow... TIL that bsc is ignoring d.bs files during the packaging process. Just checked, and there are no d.bs files in the final zip. I'll close this issue then, as d.bs are visible only in local dev env.