Skip to content

Commit

Permalink
chore: install and configure commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycalleri committed Dec 5, 2023
1 parent 5fa2edf commit ee5fd27
Show file tree
Hide file tree
Showing 5 changed files with 629 additions and 12 deletions.
28 changes: 16 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@

## Installation

* `git clone <repository-url>`
* `cd ember-autofocus-modifier`
* `pnpm install`
- `git clone <repository-url>`
- `cd ember-autofocus-modifier`
- `pnpm install`

## Conventional Commits

This repository enforces conventional commits through Git hooks and `commitlint`. Thus, your commits must follow the [Conventional Commits spec](https://www.conventionalcommits.org/en/v1.0.0/) and `@commitlint/config-conventional` [rules](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#rules).

## Linting

* `pnpm lint`
* `pnpm lint:fix`
- `pnpm lint`
- `pnpm lint:fix`

## Building the addon

* `cd ember-autofocus-modifier`
* `pnpm build`
- `cd ember-autofocus-modifier`
- `pnpm build`

## Running tests

* `cd test-app`
* `pnpm test` – Runs the test suite on the current Ember version
- `cd test-app`
- `pnpm test` – Runs the test suite on the current Ember version

## Running the test application

* `cd test-app`
* `pnpm start`
* Visit the test application at [http://localhost:4200](http://localhost:4200).
- `cd test-app`
- `pnpm start`
- Visit the test application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).
9 changes: 9 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";

module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"body-leading-blank": [2, "always"],
"footer-leading-blank": [2, "always"],
},
};
4 changes: 4 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
commit-msg:
commands:
commitlint:
run: pnpm commitlint --edit $1
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@
"lint:fix": "pnpm --filter '*' lint:fix",
"lint:types": "pnpm --filter '*' lint:types",
"prepare": "pnpm build",
"postinstall": "lefthook install",
"start": "concurrently 'pnpm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "pnpm --filter ember-autofocus-modifier start",
"start:test-app": "pnpm --filter test-app start",
"test": "pnpm --filter '*' test"
},
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@release-it-plugins/lerna-changelog": "^6.0.0",
"@release-it-plugins/workspaces": "^4.0.0",
"concurrently": "^8.2.1",
"lefthook": "^1.5.5",
"prettier": "^3.0.3",
"release-it": "^15.11.0"
},
Expand Down
Loading

0 comments on commit ee5fd27

Please sign in to comment.