Check outfiddly
Run typing, linting & tests all within Jest
{
"projects": [
{ "displayName": "test" },
{
"displayName": "lint",
"runner": "jest-runner-eslint",
"testMatch": ["<rootDir>/**/*.ts"]
}, {
"displayName": "type",
"runner": "jest-runner-tsc",
"testMatch": ["<rootDir>/**/*.ts"]
}
]
}
name: CI
on: [push, pull_request]
jobs:
main:
strategy:
matrix:
node: [12, 14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm test
env:
CI: true
> npx envinfo --system --binaries
System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 47.79 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
envinfo
npx license mit > LICENSE.md
npx gitignore node
npx covgen ben@benmvp.com
git init
npm init -y
Best Practice Open Source Repo Setup
{
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"jsnext:main": "lib/esm/index.js",
"sideEffects": false,
"types": "lib/types/index.d.ts",
"files": ["lib"],
"scripts": {
"build:cjs": "babel src -d lib/cjs --presets cjs.js",
"build:esm": "babel src -d lib/esm --presets esm.js",
"build:types": "tsc -d --declarationDir lib/types",
"build": "npx npm-run-all --parallel build:**"
}
}
name: Release
on:
push:
branches: [master]
jobs:
main:
steps:
# Setup & install
- name: Build package
run: npm run build
- name: Release new version
run: npx semantic-release
semantic-release
babel-cjs.js
/ babel-esm.js
@babel/preset-typescript
eslint-plugin-prettier
@typescript-eslint/eslint-plugin
sideEffects
in package.json
LICENSE
@benmvp/cli