Skip to content

Commit

Permalink
chore: install and configure commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
poulet42 committed Dec 4, 2023
1 parent 44b5b50 commit 11becb6
Show file tree
Hide file tree
Showing 5 changed files with 556 additions and 17 deletions.
30 changes: 17 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,34 @@

## Installation

* `git clone <repository-url>`
* `cd ember-amount-input`
* `pnpm install`
- `git clone <repository-url>`
- `cd ember-amount-input`
- `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-amount-input`
* `pnpm build`
- `cd ember-amount-input`
- `pnpm build`

## Running tests

* `cd test-app`
* `pnpm test` – Runs the test suite on the current Ember version
* `pnpm test:watch` – Runs the test suite in "watch mode"
- `cd test-app`
- `pnpm test` – Runs the test suite on the current Ember version
- `pnpm test:watch` – Runs the test suite in "watch mode"

## 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 @@ -13,16 +13,20 @@
"lint": "pnpm --filter '*' lint",
"lint:fix": "pnpm --filter '*' lint:fix",
"lint:types": "pnpm --filter '*' lint:types",
"postinstall": "lefthook install",
"prepare": "pnpm build",
"start": "concurrently 'pnpm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "pnpm --filter ember-amount-input 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.2",
"lefthook": "^1.5.5",
"prettier": "^3.1.0",
"release-it": "^16.2.1"
},
Expand Down
Loading

0 comments on commit 11becb6

Please sign in to comment.