I've had a go at reorganising the codebase to make it a bit more manageable as it grows. Effectively separating the classes to their own files and adding a build system. Initially organised around classes, but util will likely makes more sense to separate into discrete methods at some point, but though best to start simple(ish).
Split classes to their own files.
Add NPM to manage dependences (leaflet/lit now built)
Setup rollup to handle build/watch
Updated HACs file to reference built copy in dist.
Some of the class types are a little arbitrary, but hopefully this arrangement makes rough sense.
To get going
npm install
npm run watch - to build dist automatically when files change or npm run build - for a one off build.
Based off of https://github.com/nathan-gs/ha-map-card/pull/47
I've had a go at reorganising the codebase to make it a bit more manageable as it grows. Effectively separating the classes to their own files and adding a build system. Initially organised around classes, but
util
will likely makes more sense to separate into discrete methods at some point, but though best to start simple(ish).rollup
to handle build/watchSome of the class types are a little arbitrary, but hopefully this arrangement makes rough sense.
To get going
npm install
npm run watch
- to build dist automatically when files change ornpm run build
- for a one off build.