LiveSplitOne icon indicating copy to clipboard operation
LiveSplitOne copied to clipboard

Turn livesplit-core into its own package

Open CryZe opened this issue 6 years ago • 2 comments

livesplit-core should be its own package that just gets imported like any other package. The idea is to make it separate enough that we can publish it to npm whenever we do a new release of livesplit-core. In general I'd like to start modularizing the codebase a bit more, so that we can possibly move the "layout renderer" into its own package as well. This would ensure that all the layout's CSS is properly separated out from the rest of the UI and it allows other experimentation such as a Twitch Extension where you may not want everything.

CryZe avatar Jan 27 '20 10:01 CryZe

The layout rendering is already pretty separate from the UI. The only things that are currently shared are:

  • livesplit-core
  • The util functions
  • The imported fonts (Fira, timer, Roboto)
  • A few lines of css in main.scss

I think we just need to either extract or duplicate each of these components, and then we can separate everything really easily.

wooferzfg avatar Jan 28 '20 06:01 wooferzfg

Yeah the only hard part is to ensure nothing gets duplicated in the end, and the package works on its own despite using a bunch of non-JS (SCSS, TypeScript, ...)

CryZe avatar Jan 28 '20 16:01 CryZe

While it's not a full npm package, the canvas renderer allowed me to essentially host a full LSO in just a few lines in a completely separate codebase, which is essentially what this issue was intended for

image

CryZe avatar Apr 28 '24 08:04 CryZe