mapbox / hpp-skel

Skeleton for C++ header-only libraries
Creative Commons Zero v1.0 Universal
117 stars 19 forks source link

Suggested Workflow #22

Open GretaCB opened 7 years ago

GretaCB commented 7 years ago

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

mapsam commented 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?

GretaCB commented 7 years ago

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.

It could provide some of these as a set of opt-in options (ex remove-comments=true/false)

mapsam commented 7 years ago

@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

GretaCB commented 7 years ago

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?

GretaCB commented 7 years ago

Nevermind my point above.

omg 🎉 https://cookiecutter.readthedocs.io/en/latest/readme.html#categories-of-cookiecutters

GretaCB commented 7 years ago

Phase 1 merged https://github.com/mapbox/hpp-skel/pull/29. Keeping ticket open for further thoughts/discussion/iterations.

springmeyer commented 7 years ago

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.