Refined Template for NodeJS Projects

This tool is specifically designed for a particular project and is not intended for direct use in other projects.
To begin, open a Terminal session and execute the following command:
>
Switch to fullscreen mode and then exit when necessary.
Proceed by installing the necessary server dependencies.
Next, install the required client dependencies.
Perform a Git checkout to the ‘boilerplate’ branch.
Once completed, open the project using your preferred text editor. At this point, it should resemble the following:
Initiate the development server to start the project.

Setup for nodejs backend project

This setup includes:

  • autoformatting code
  • Git hooks are employed for various purposes, such as

  • pre-commit

    • check dependencies
    • ,

    • code linting
    • , and

    • test code
    • . Additionally,


    • commit-msg

      • linting of commit message conventional commit
      • is also a common use case for git hooks.

      • An autogenerated changelog has been created, consisting of

      • npm run first-release

        : generate changelog based on

        conventional commit

        type
      • and


      • npm run changelog

        : update changelog based on

        conventional commit

        type
      • .

      • mutation testing


        • npm run coverage

          : run coverage over
          Mutation Testing
          (

          stryker

          )

      Please note that the package version is not automatically updated. These settings should be used along with a release management tool, such as gitflow-avh, which will handle the release management process.

      npx nodejs-project-boilerplate

      The commit message type should adhere to the
      conventional commit
      convention, which is based on the Angular convention.


      type(scope): message

      Must be one of the following:

      • The following text has been rephrased to avoid repetition while keeping its meaning.
        “””

        build

        : Modifications that impact the build system or dependencies from external sources (for instance, gulp, broccoli, npm)
        “””.
      • Updates have been made to our CI configuration files and scripts, including changes to various scopes such as Travis, Circle, BrowserStack, and SauceLabs.
      • The changes made are only in the documentation.

      • feat

        : A new feature

      • fix

        : A bug fix
      • A modification in the code that enhances performance.
      • A code change that does not address a bug or introduce a new feature.

      • style
        : Modifications that have no impact on the code’s purpose, such as whitespace, formatting, or the absence of semicolons.
      • The task involves either adding tests that are missing or rectifying tests that already exist.

      The name of the npm package affected should be the scope as perceived by the person reading the generated changelog from the commit message.


      • git init

      • git flow init

      • <config git flow>

      • git flow feature start init-project

      • npx nodejs-project-boilerplate

      • git add . && git commit -m 'build: init project'

      • git flow feature finish
      • Please refer to msdt_code1 (or an alternative version).
      • Use
        npm run changelog
        for versions different from
        1.0.0
        .

      • git flow release finish

      • git flow feature <feature-name> start

      • <develop and commit your new feature>

      • git flow feature finish

      • git flow release start x.y.x

      • npm run changelog

      • git flow release finish
      
      

Frequently Asked Questions