Skip to content

Commit 494fc72

Browse files
committed
chore(boilerplate): Initial commit
0 parents  commit 494fc72

File tree

10 files changed

+219
-0
lines changed

10 files changed

+219
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test & Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Use Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 24.4.1
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Run tests with coverage
24+
run: npm run test
25+
26+
- name: Upload coverage reports to Codecov
27+
uses: codecov/codecov-action@v5
28+
with:
29+
token: ${{ secrets.CODECOV_TOKEN }}
30+
publish:
31+
needs: [test]
32+
permissions:
33+
contents: write
34+
issues: write
35+
pull-requests: write
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
41+
- name: Use Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: 24.4.1
45+
46+
- name: Install dependencies
47+
run: npm install
48+
49+
- name: Run Semantic Release
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
run: npx semantic-release

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Node dependencies
2+
node_modules/
3+
4+
# Build
5+
dist/
6+
7+
# Coverage Test
8+
coverage/
9+
10+
# Lock files
11+
package-lock.json

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.github/
2+
src/
3+
tsconfig.json
4+
*.test.ts
5+
*.ts
6+
*.tsx

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Rizqy Fahmi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Introduction
2+
3+
[![npm version](https://img.shields.io/npm/v/commitlint-plugin-prevenger.svg)](https://npmjs.com/package/commitlint-plugin-prevenger)
4+
[![npm downloads](https://img.shields.io/npm/dt/commitlint-plugin-prevenger.svg)](https://npmjs.com/package/commitlint-plugin-prevenger)
5+
[![License](https://img.shields.io/github/license/rizqyfahmi/commitlint-plugin-prevenger.svg)](https://github.com/rizqyfahmi/commitlint-plugin-prevenger/blob/master/LICENSE)
6+
[![codecov](https://codecov.io/gh/rizqyfahmi/commitlint-plugin-prevenger/branch/master/graph/badge.svg)](https://codecov.io/gh/rizqyfahmi/commitlint-plugin-prevenger)
7+
8+
Make your git commit message much more elegant
9+
10+
## Installation
11+
12+
```bash
13+
npm i commitlint-plugin-prevenger --save-dev
14+
```
15+
16+
## Usage
17+
```javascript
18+
module.exports = {
19+
plugins: ["commitlint-plugin-prevenger"],
20+
rules: {
21+
"commitlint-plugin-prevenger/selective-scope": [
22+
2,
23+
"always",
24+
["^core$"]
25+
]
26+
}
27+
}
28+
```

jest.config.cjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'node',
4+
collectCoverage: true,
5+
collectCoverageFrom: ['src/rules/**/*.ts'],
6+
coverageThreshold: {
7+
global: {
8+
branches: 100,
9+
functions: 100,
10+
lines: 100,
11+
statements: 100
12+
}
13+
}
14+
}

package.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "commitlint-plugin-prevenger",
3+
"version": "1.0.0",
4+
"main": "dist/index.js",
5+
"scripts": {
6+
"test": "jest --coverage",
7+
"build": "tsc"
8+
},
9+
"files": [
10+
"dist/",
11+
"README.md",
12+
"LICENSE"
13+
],
14+
"repository": {
15+
"type": "git",
16+
"url": "git+https://github.com/rizqyfahmi/commitlint-plugin-prevenger.git"
17+
},
18+
"keywords": [
19+
"commitlint",
20+
"commitlintplugin",
21+
"commitlint-plugin"
22+
],
23+
"author": "Ahmad Yulia Rizqy Fahmi <https://github.com/rizqyfahmi>",
24+
"license": "MIT",
25+
"bugs": {
26+
"url": "https://github.com/rizqyfahmi/commitlint-plugin-prevenger/issues"
27+
},
28+
"homepage": "https://github.com/rizqyfahmi/commitlint-plugin-prevenger#readme",
29+
"description": "A Commitlint plugin that is containing some toolkits for checking the commit message",
30+
"devDependencies": {
31+
"@commitlint/types": "^19.8.1",
32+
"@semantic-release/changelog": "^6.0.3",
33+
"@semantic-release/commit-analyzer": "^13.0.1",
34+
"@semantic-release/git": "^10.0.1",
35+
"@semantic-release/github": "^11.0.3",
36+
"@semantic-release/npm": "^12.0.2",
37+
"@semantic-release/release-notes-generator": "^14.0.3",
38+
"@types/conventional-commits-parser": "^5.0.1",
39+
"@types/jest": "^30.0.0",
40+
"jest": "^29.7.0",
41+
"semantic-release": "^24.2.7",
42+
"ts-jest": "^29.4.0",
43+
"ts-node": "^10.9.2",
44+
"typescript": "^5.8.3"
45+
}
46+
}

release.config.cjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
branches: ["master"],
3+
plugins: [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/changelog",
8+
{
9+
changelogFile: "CHANGELOG.md"
10+
}
11+
],
12+
"@semantic-release/npm",
13+
"@semantic-release/github",
14+
[
15+
"@semantic-release/git",
16+
{
17+
assets: ["package.json", "CHANGELOG.md"],
18+
message:
19+
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
20+
}
21+
]
22+
]
23+
}

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const plugin = {
2+
rules: {}
3+
}
4+
5+
export default plugin;

tsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2019",
4+
"module": "CommonJS",
5+
"outDir": "dist",
6+
"declaration": true,
7+
"strict": true,
8+
"esModuleInterop": true,
9+
"skipLibCheck": true
10+
},
11+
"include": ["src"]
12+
}

0 commit comments

Comments
 (0)