This project contains the configuration and build scripts for most of my Typescript projects, with scripts to create a new project and keep existing ones up-to-date. Even this readme is a template for others.
- build scripts with
make
- build pipeline with
gitlab
- update github commit status
- publish docker images from branches & tags
- publish npm packages from tags
- bundled with
rollup
- type checked with
typescript
- style checked with
eslint
(withtslint
rules and other plugins) - tested with
mocha
(with source map support and helpers for async leak tracking) - code coverage measured with
nyc
- changelog generated with
standard-release
- everything frontend: React, CSS, etc
- heavy backend libraries: ORMs, etc
To create a new repository from this template:
- create your new repo on Github & Gitlab (your server or Gitlab.com)
git clone git@github.com:ssube/rollup-template.git your-project
cd your-project
git remote add github git@github.com:yourname/your-project.git
git remote add gitlab git@gitlab.com:yourname/your-project.git
- set up repository mirroring in Gitlab
- set up some maintenance bots
make git-push
- install your dependencies
- write some code
Once your project is set up:
make
to bundle and test- commit
make git-push
The git-push
target pushes to Github first, to avoid conflicts with changes
from bots and other contributors.
When your project is ready to release:
make release-dry
to make sure your changelog and options look rightmake release
Additional options can be passed with the RELEASE_OPTS
variable. Frequently
used options include --release-as minor
and --prerelease
.
This template works with or expects a few external services, namely a Gitlab CI server (self-hosted or using Gitlab.com).
Good tests and clever bots can eliminate the most painful parts of project maintenance. This repository is configured to work with:
None of these are required, but Renovate and Snyk can be very helpful when dependencies release a security patch.
This template expects a few secrets to exist in the environment, including tokens for the external services.
Name | Description |
---|---|
CC_TEST_REPORTER_ID | code climate ID |
CODECLIMATE_SECRET | code climate token |
CODECOV_SECRET | codecov token |
DOCKER_SECRET | docker config, required for publishing images |
GITHUB_SECRET | github.com token, required for publishing status |
NPM_SECRET | npmjs.com token, required for publishing npm packages |
SONAR_SECRET | sonarcloud token |
Secrets should be provided as environment variables, with the secret value
base64
-encoded.