reuters-graphics / bluprint

Dead-easy application scaffolding and CLI.
MIT License
7 stars 2 forks source link

Add command to test a local bluprint from disk #30

Open jarib opened 2 years ago

jarib commented 2 years ago

I've implemented bluprint test ../local-dir as suggested in https://github.com/reuters-graphics/bluprint/issues/21.

I tried to reuse as much as possible from bluprint start, which means importing some functions from ../start in the test command. I build a tarball of the given directory, in order to reuse most of those functions. It could probably be refactored to something cleaner, but I didn't attempt that here.

I made a best effort attempt at parsing .gitignore and ignoring those files when building the tarball. Another approach using git archive is available here: https://github.com/jarib/bluprint/tree/test-command-using-git-archive. The downside is that the files then have to be commited in the local bluprint's repo to be picked up by the test command. Seems like it would be easy to forget and a quite frustrating DX, so I prefer the approach in this PR.