A quick start JS package template.
- Automated releases with Travis CI and Semantic Release
- CommonJS, ES2015 modules and UMD builds
- Testing with Jest
- Automatic code formatting with Prettier
- Clone this repository
git clone [email protected]:colinmeinke/package.git __PROJECT_NAME__
- Change to your new project directory
cd __PROJECT_NAME__
- Kill the existing
.git
directory and reinitialise with a new repository:rm -rf .git
git init
git remote add origin [email protected]:__USER_OR_ORGANISATION_NAME__/__PROJECT_NAME__.git
- Install dependencies:
yarn install
- Replace all placeholders* in:
package.json
rollup.config.js
- Setup Semantic Release using the CLI:
yarn setup:semantic-release
- Use
https://registry.npmjs.org/
as your npm registry - You will need npm login credentials and to have verified your email with npm
- You will need to sign in to Travis CI
- Select Travis CI when asked which CI you wish to use
- Type n when asked about adding a
.travis.yml
file
- Use
*placeholders have a prefix and suffix of __
- Write some code
- Commit:
yarn commit
- Push:
git push
- Sit back and relax! If your build passes and you have committed fixes, features or breaking changes a new release will be rolled.
To initialise a command line helper to walk you through the process of writing conventional commits. This convention allows us to automate our release process.
This command will also automatically format staged files using Prettier.
yarn commit
To manually run the build process and output:
- CommonJS to
/cjs
- ES2015 modules to
/modules
- UMD to
/dist
yarn build
To manually run your tests.
yarn test
- Disable tests: If you don't have any tests you can remove
- npm test
from thescript
section of.travis.yml
- Disable code formatting: To stop Prettier formatting files when you commit
you can remove
"precommit": "pretty-quick --staged"
from thescripts
section ofpackage.json