Open GretaCB opened 7 years ago
If we're interested in a really quick solution for creating a new project from scratch, I've had great success with cookiecutter in the past. Possibly too abstract for us, though, since these libraries also exist as examples, rather than purely as templates?
Per chat with @mapsam and @springmeyer , we can try writing a script that preps the skel to be converted into a brand new project/repo.
git init .
per https://git-scm.com/docs/git-init#_examplesmodule.cpp
and module-utils.cpp
)It could provide some of these as a set of opt-in options (ex remove-comments=true/false
)
@GretaCB awesome
remove comments (perhaps there is an already-existing lib that does this by looking for a specific comment syntax/symbol or we can write our own lib to do this)
Looks like gcc has a build-in command that may do this, according to SO https://stackoverflow.com/a/2394040
Great find @mapsam !
Also, didnt mean to bypass the templating idea. Did a quick search, I think the tricky part will be finding an already-existing cookiecutter tool specifically for C++ and/or Node, though ideally for Node Addons. But perhaps we can take some of the functionality and features of https://cookiecutter.readthedocs.io/en/latest/readme.html and write them into the "liftoff" script?
Nevermind my point above.
omg 🎉 https://cookiecutter.readthedocs.io/en/latest/readme.html#categories-of-cookiecutters
Phase 1 merged https://github.com/mapbox/hpp-skel/pull/29. Keeping ticket open for further thoughts/discussion/iterations.
also just found http://yeoman.io, which appears to be a popular nodejs way of scaffolding a project with templates. https://github.com/duivvv/generator-module-boilerplate is an example of using it.
While working on a new header-only library from this skeleton (gzip), wasn't completely sure how we want to suggest creating a separate library when using this skeleton as a foundation. This ticket is also relevant to the workflow we'll want to suggest when using node-cpp-skel.
Possibilities
I'll do a bit more research on how other projects/developers have done this.
cc @springmeyer @mapsam