vhs
vhs copied to clipboard
Code organization
Right now, all the sources of vhs are piled into the root of this repository. We'll need to clean that up sooner or later, into at least one src/ subdir.
I presume that it would be best do do this when there aren't many features in progress, so that merging into moved files is less of a headache.
Hey! I agree, keeping everything in the root is getting a bit too much. Moving into package is probably a better option.
Hey!
I agree with you guys. I believe it would be more easy to work just adding a few packages. However rearrange the structure depends on personal tastes.
@maaslalani @rm-dr how would you structure it?
I would probably structure the code as a few separate packages.
lexer(token / keyword related code)parser(language / command related code)video(ffmpeg related code)tty(ttyd / browser related code)
But, very open to suggestions if there are better ways to organize the code.
I'm my mind I've got something like this:
pkg(vhs internals)lexerparsercommand- command_x.go
- command_x_test.go
- command_y.go
- command_y_test.go
cmd(Cobra commands)- root.go
- record.go
- serve.go
Still not perfect organization but I did factor out the lexer and parser so that others can build on top of the language!