no-context / moo

Optimised tokenizer/lexer generator! 🐄 Uses /y for performance. Moo.
BSD 3-Clause "New" or "Revised" License
817 stars 65 forks source link

Project management #127

Open moranje opened 5 years ago

moranje commented 5 years ago

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 commented 5 years ago

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.

bd82 commented 5 years ago

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 👍

tjvr commented 5 years ago

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.)

moranje commented 5 years ago

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"
    ]
  }
}