moo icon indicating copy to clipboard operation
moo copied to clipboard

Project management

Open moranje opened this issue 5 years ago • 4 comments

Here's an optional automated release workflow other project I use have benefitted from. This does several things.

Commit hooks

This sets up several commit hooks to run checks on pre-commit and pre-push.

Enforce conventional commit messages

Spec

To use this npm run commit. This opens a prompt that guides you through the commit message. This is used later create semver released and an automated changelog.

Automated releases

A feat will be either a major (if there are any breaking changes) or minor version bump. A fix will lead to a patch version update. Anything else won't trigger a release. If set-up with tokens it will release to NPM and github. It will even release update the version in the package.json and the commit the changed files to github. Also files will be formatted with prettier by default.

Setup

First:

npm install -g semantic-release-cli

Then:

semantic-release-cli setup

Important! Answer NO to "Generate travis.yml" question

moranje avatar Apr 24 '19 21:04 moranje

Here's a link to a project I've used this on. Take a look at the commit messages and the changelog. The release is triggered by travis for any commit released on master.

moranje avatar Apr 24 '19 21:04 moranje

Thanks for the example @moranje I was wondering how to integrate conventional commits and more automated releases in some of my projects and now I know I need to inspect the @semantic-release project workflows 👍

  • https://github.com/semantic-release/semantic-release

bd82 avatar Apr 25 '19 10:04 bd82

Hey, thanks for suggesting this! :) On consideration, I don't think semantic-release solves any problems that we have right now; sorry if I gave the wrong impression.

I do think setting up Prettier would be worthwhile, though; do you think the way I set it up for my project scratchblocks is reasonable? (We'd probably want a different .prettierrc for Moo.)

tjvr avatar Apr 25 '19 23:04 tjvr

No worries. It's here if you need it. I've had to look to master several times in my package.json because of unreleased features. It's not because of an impression you gave.

Your setup looks good. I would probably include, markdown files and possibly yml files. Using lint-staged would be a nice touch as well.

{
  "scripts": {
    "format": "prettier {,**/}*.{js,json,md,yml} --write"
  },

  "lint-staged": {
    "package.json": [
      "prettier-package-json --write",
      "git add"
    ],
	// I haven't checked this
    "{,**/}*.{js,json,md,yml}": [
      "prettier --write",
      "git add"
    ]
  }
}

moranje avatar Apr 26 '19 06:04 moranje