Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project management #127

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

moranje
Copy link
Contributor

@moranje moranje commented Apr 24, 2019

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

This doest a lot. he high level overview is that this creates
a way to automate releases based on
semver. More infor in the PR.
@moranje
Copy link
Contributor Author

moranje commented Apr 24, 2019

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
Copy link
Contributor

bd82 commented Apr 25, 2019

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
Copy link
Collaborator

tjvr commented Apr 25, 2019

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
Copy link
Contributor Author

moranje commented Apr 26, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants