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

Add tooling for code coverage, changelogs, and conventional commits #54

Merged
merged 4 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ jobs:
with:
useLockFile: false

- name: 👕 Lint commit messages
uses: wagoid/commitlint-github-action@v4

- name: ▶️ Run flow-typed script
run: npm run flow-typed

- name: ▶️ Run build script
run: npm run build

- name: ⬆️ Upload karma coverage report
uses: codecov/codecov-action@v2
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
File renamed without changes.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
beaver-logger
------------

[![build status][build-badge]][build]
[![code coverage][coverage-badge]][coverage]
[![npm version][version-badge]][package]

[build-badge]: https://img.shields.io/github/workflow/status/krakenjs/beaver-logger/build?logo=github&style=flat-square
[build]: https://github.com/krakenjs/beaver-logger/actions?query=workflow:build
[coverage-badge]: https://img.shields.io/codecov/c/github/krakenjs/beaver-logger.svg?style=flat-square
[coverage]: https://codecov.io/github/krakenjs/beaver-logger/
[version-badge]: https://img.shields.io/npm/v/beaver-logger.svg?style=flat-square
[package]: https://www.npmjs.com/package/beaver-logger

Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* @flow */
/* eslint import/no-commonjs: off */

module.exports = {
extends: [ '@commitlint/config-conventional' ]
};
56 changes: 50 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,54 @@
"webpack": "babel-node --config-file ./node_modules/grumbler-scripts/config/.babelrc-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --display-optimization-bailout --progress",
"test": "npm run lint && npm run flow-typed && npm run flow && npm run karma",
"build": "npm run test && npm run babel && npm run webpack",
"release": "./publish.sh",
"release:patch": "./publish.sh patch",
"release:minor": "./publish.sh minor",
"release:major": "./publish.sh major",
"clean": "rimraf dist coverage",
"reinstall": "rimraf flow-typed && rimraf node_modules && npm install && flow-typed install",
"prepublishOnly": "npm run babel-server",
"postpublish": "git checkout server"
"postpublish": "git checkout server",
"prepare": "husky install",
"prerelease": "npm run clean && npm run build && git add dist && git commit -m 'ci: check in dist folder' || echo 'Nothing to distribute'",
"release": "standard-version",
"postrelease": "git push && git push --follow-tags && npm publish"
},
"standard-version": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "chore",
"hidden": false
},
{
"type": "docs",
"hidden": false
},
{
"type": "style",
"hidden": false
},
{
"type": "refactor",
"hidden": false
},
{
"type": "perf",
"hidden": false
},
{
"type": "test",
"hidden": false
},
{
"type": "ci",
"hidden": true
}
]
},
"repository": {
"type": "git",
Expand All @@ -48,9 +88,13 @@
],
"readmeFilename": "README.md",
"devDependencies": {
"@commitlint/cli": "^16.2.1",
"@commitlint/config-conventional": "^16.2.1",
"flow-bin": "0.135.0",
"grumbler-scripts": "^3",
"grumbler-scripts": "^5.0.3",
"husky": "^7.0.4",
"mocha": "^3.5.3",
"standard-version": "^9.3.2",
"sync-browser-mocks": "^1.0.44"
},
"dependencies": {
Expand Down
27 changes: 0 additions & 27 deletions publish.sh

This file was deleted.

3 changes: 2 additions & 1 deletion server/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* @flow */
/* eslint import/no-commonjs: off */

module.exports = {
'extends': require.resolve('grumbler-scripts/config/.eslintrc-node')
};
};