open-source-starter

Open source project starter


Keywords
boilerplate, starterkit, starter kit, starter, webpack, open source, code formatter, babel
License
MIT
Install
npm install open-source-starter@1.0.1

Documentation

Open Source Starter

Pre-configured starter for open source Node projects with automated releases

travis build release number dependencies status dev dependencies status

commitizen semantic-release prettier license

This starter provides all necessary setup to quickly start an open source project, with fully automated release, tests, generate CHANGELOG.md, version bump, publish to NPM.

Content

Babel : Use next generation JavaScript

All .js files in src/ will be compiled with Babel and added in the dist/ folder

Config : .babelrc

ESLint : A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease

config: .eslintrc

Prettier : Opinionated code formatter

config: .prettierrc

Husky : Use git hooks with ease

Here it just call lint-staged on pre-commit

config: "husky" in package.json

lint-staged : Run linters against staged git files

Here it calls ESLint and Prettier on git add

config: "lint-staged" in package.json

Commitizen : Conventional commit messages CLI

Semantic Release : Fully automated version management and package publishing

Jest : JavaScript Testing Framework

Add your test files either in src/ with my-file.spec.js format, or in the __tests__ folder at your project root directory

config : jest.config.js

TravisCI : Free continuous integration platform for GitHub projects

config: .travis.yml

Requirements

note: this repo use TravisCI, but you can use any continuous integration system you want, see semantic-release-cli documentation for or more informations.

Installation

  1. Fork or clone this repo git clone https://github.com/JimmyBeldone/open-source-starter.git
  2. Update the package.json file with your repo's information
  3. Configure semantic-release with semantic-release-cli : npx semantic-release-cli setup. semantic-release-cli Once you entered the required informations, semantic-release-cli will add the necessary tokens to your Travis repository settings.
  4. You're all set !

Usage

Stage a file

git add src/my-file.js

From now on when you will use git add on a file in src/, it will be automatically linted and prettified.

Use conventional commit

yarn commit

This script will open Commitizen to help you write conventional commit

Release / Publish

All you need to do is merge on master branch, simple as that.

It will :

  1. Triggers Travis build
  2. Run your test during Travis build
  3. Run semantic-release steps :
    • Analyse your commits
    • Bump version
    • Add release notes
    • Generate CHANGELOG.md
    • Publish to NPM & Github

License

MIT

Copyright (c) 2019 Jimmy Beldone