/generator-cpp-github

Scaffolder for C++ CMake/Conan Project

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

generator-cpp-github

Generator for Yeoman that scaffolds cross-platform C++ projects with GitHub and VS Code integrations. Example.

Motivation

I like trying new ideas with C++. Setting up a new C++ project for me is so time-consuming that I often find myself spending more time configuring it than actually coding. On top of that, I tend to skip quality tools such as unit testing, SCA and linting in the early stages and then suffer to make them work with already-existing code base. To address all that, I've made this generator. For myself. With technologies that I am often using. With structure that makes sense best to me. Then I thought it could be useful for somebody. So here it is.

Installation

Pre-requisites:

npm install -g generator-cpp-github

Usage

Generate C++ Application into the current dir

yo cpp-github:app
code .

See an example of the project that has been generated with it.

Generate C++ Library into the current dir

yo cpp-github:lib
code .

See an example of the project that has been generated with it.

Validate project folder structure

yo cpp-github:[type] --validate

This will check that your folder structure is the same as in the reference template.

Tech Stack of the project that it will generate

Philosophy

  • Use existing open-source tools as much as possible. Minimize custom solutions
  • Prefer tools that are easy to set up over highly-customizable complex tools
  • Prefer cross-toolchain tools over toolchain-specific solutions. Example - SonarLint over clang-tidy
  • The project is as self-contained as possible. If something is needed to be installed/configured by the developer - there should be a task to do it within the project. Exception - task runner itself and basics such as git
  • Everything should be usable from the local machine. No "CI-specific" solutions. Local ease of use is a priority
  • Thin CI-integration. CI just executes the same tasks that the developer can execute locally
  • Latest C++ standard
  • Code-style is enforced
  • Unit-testing is enforced
  • Maximum possible SCA and linter strictness is enforced
  • Dependencies should be versioned(where possible)
  • If something is unused then it should be removed
  • VS Code is the editor of choice. However, editor-independent solutions are preferred
  • You should be able to build, test, debug and analyze the project without the editor. CLI solutions are preferred
  • macOS, Linux and Windows are the target platforms
  • Trunk-based development
  • Forbid merge into the main unless PR passed all quality checks on a CI
  • Squash merge strategy. Every commit in the main is self-contained
  • Every commit in the main branch is a release candidate
  • Every commit in the main branch has the unique version