|
1 |
| -# Archoleat Repo Template |
2 |
| - |
3 |
| - |
4 |
| - |
5 |
| - |
6 |
| - |
7 |
| - |
8 |
| - |
9 |
| - |
| 1 | +# Commitlint Define Config |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
10 | 12 | 
|
11 | 13 |
|
12 | 14 | ## Table of Contents
|
13 | 15 |
|
14 |
| -- [Getting Started](#getting-started) |
15 |
| -- [Features](#features) |
16 |
| -- [Scripts](#scripts) |
17 |
| -- [Workflows](#workflows) |
18 |
| -- [Prettier](#prettier) |
19 |
| -- [Commitlint, ESM and TypeScript](#commitlint-esm-and-typescript) |
20 |
| -- [Change of Maintainer](#change-of-maintainer) |
| 16 | +- [Installation](#installation) |
| 17 | +- [Usage](#usage) |
21 | 18 | - [Troubleshooting](#troubleshooting)
|
22 | 19 | - [Contributing](#contributing)
|
23 | 20 | - [License](#license)
|
24 | 21 |
|
25 |
| -**Archoleat Repo Template** is a template repository designed for quickly |
26 |
| -starting new projects with pre-configured tools and best development practices. |
27 |
| -This template includes ready-made solutions for integration with: |
28 |
| - |
29 |
| -- **Git**. |
30 |
| -- **GitHub**. |
31 |
| -- **Commitizen**. |
32 |
| -- **Commitlint**. |
33 |
| -- **Conventional Commits**. |
34 |
| -- **Husky & Lint Staged**. |
35 |
| -- **GitHub Actions**. |
36 |
| -- **Semantic Release**. |
37 |
| -- **PNPM**. |
38 |
| -- **CodeQL**. |
39 |
| -- **EditorConfig**. |
40 |
| -- **ESLint**. |
41 |
| -- **Remark**. |
42 |
| -- **Prettier**. |
43 |
| -- **Vitest**. |
44 |
| -- **TypeScript**. |
45 |
| -- **Dependabot**. |
46 |
| - |
47 |
| -> \[!TIP] |
48 |
| -> **A good solution for your business!** |
49 |
| -> |
50 |
| -> Now you don't have to worry about unnecessary costs. |
51 |
| -> Everything is already set up and prepared for you! |
52 |
| -> |
53 |
| -> And also the template is very good for teams, |
54 |
| -> because you can easily standardize projects with this template. |
55 |
| -
|
56 |
| -## Getting Started |
57 |
| - |
58 |
| -1. **Create a Repository**: Use this template |
59 |
| - to create a new repository on GitHub. |
60 |
| - |
61 |
| - > Since this is a **Public Template** you can click the button |
62 |
| - > **Use this template** for a faster and more convenient cloning. |
63 |
| -
|
64 |
| -1. **Clone the Repository**: Clone your new repository to your local machine. |
65 |
| - |
66 |
| -1. **Start Development**: Develop your project, |
67 |
| - making changes according to your project's needs. |
68 |
| - |
69 |
| -1. **Configure GitHub Actions**: Modify GitHub Actions |
70 |
| - settings to fit your requirements. |
71 |
| - |
72 |
| - > **For those unfamiliar with GitHub Actions**, |
73 |
| - > our workflows use |
74 |
| - > [**chain**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run), |
75 |
| - > if you want to add more workflows to this chain, |
76 |
| - > workflows, it won't work, because the chain only supports |
77 |
| - > only three levels, example: `workflow A` > `workflow B` > |
78 |
| - > `workflow C` > `workflow D`, if you add `workflow E` |
79 |
| - > to the chain. it won't work! |
80 |
| -
|
81 |
| -## Features |
82 |
| - |
83 |
| -- **Flexibility**: Easily customizable template to adapt |
84 |
| - to different project types. |
85 |
| - |
86 |
| -- **Git and GitHub Integration**: Pre-configured `.gitignore`, `.gitmodules` |
87 |
| - and `.gitattributes` for efficient work with Git and GitHub. |
88 |
| - |
89 |
| - - **Conventional Commits, Commitlint & Commitizen**: If you don't want |
90 |
| - to think about how to write a commit every time, |
91 |
| - these plugins will help you. |
92 |
| - |
93 |
| - > It will be especially useful for teams that |
94 |
| - > have an ongoing debate about writing commits. |
95 |
| -
|
96 |
| - - **Husky & Lint Staged**: Won't let you submit |
97 |
| - bad code to the repository! |
98 |
| - |
99 |
| -- **Continuous Integration (CI)**: Built-in CI support using GitHub Actions |
100 |
| - for automatic linting, testing and building of your code with each change. |
101 |
| - |
102 |
| - > Also suitable for private repositories! GitHub Actions use |
103 |
| - > **cache**, **timeout-minutes**, **path filters** and **workflow run** |
104 |
| - > to reduce the execution time, which means it will significantly |
105 |
| - > reduce your costs! |
106 |
| -
|
107 |
| - - **Security**: Included **CodeQL** workflow for detecting |
108 |
| - and preventing potential vulnerabilities in your code. |
109 |
| - |
110 |
| - - **Linters**: Help you maintain a consistent code writing style |
111 |
| - and find errors. |
112 |
| - |
113 |
| - > By default **ESLint**, **Prettier**, **Editorconfig Checker** and |
114 |
| - > **Remark** check all files in the project, if you want to change this |
115 |
| - > behavior then go to [`package.json`](package.json) |
116 |
| - > and [`lint-staged.config.js`](lint-staged.config.js) |
117 |
| - > files. |
118 |
| -
|
119 |
| - - **Tests**: Automated testing will help you focus on |
120 |
| - writing better code! |
121 |
| - |
122 |
| - - **Semantic Release**: For those who are tired of writing changelogs |
123 |
| - and thinking about what the next version number will be. |
124 |
| - |
125 |
| -- **TypeScript**: Pre-configured **TypeScript** setup |
126 |
| - for improved reliability and development convenience. |
127 |
| - |
128 |
| -- **Bots**: |
129 |
| - |
130 |
| - - **Dependabot**: No more wasting time updating dependencies! |
131 |
| - |
132 |
| -## Scripts |
133 |
| - |
134 |
| -- `init`: Installs dependencies, **Husky** and update submodules. |
135 |
| - |
136 |
| -- `test`: Runs **Vitest** and the tests in the **specs/** folder. |
137 |
| - |
138 |
| -- `test:coverage`: Runs **Vitest** with **Coverage-V8**. |
139 |
| - |
140 |
| -- `release`: Runs **Semantic Release**. |
141 |
| - |
142 |
| - > Also runs using the [`test.yaml`](.github/workflows/test.yaml) |
143 |
| - > workflow. |
144 |
| -
|
145 |
| -- `lint:editorconfig`: Runs **Editorconfig Checker** and |
146 |
| - checks all files in the project. |
147 |
| - |
148 |
| - > Also runs with the [`editorconfig.yaml`](.github/workflows/editorconfig.yaml) |
149 |
| - > workflow. |
| 22 | +## Installation |
150 | 23 |
|
151 |
| -- `lint:formatting`: Runs **Prettier** with the `--check` flag |
152 |
| - for all files. |
153 |
| - |
154 |
| - > In the [`prettier.yaml`](.github/workflows/prettier.yaml) |
155 |
| - > |
156 |
| - > Also run with a `pre-commit` hook. |
157 |
| -
|
158 |
| -- `lint:md`: Runs **Remark** with the `--quiet` flag and |
159 |
| - checks all **Markdown** files. |
160 |
| - |
161 |
| - > Also runs with the [`markdown.yaml`](.github/workflows/markdown.yaml) |
162 |
| - > workflow. |
163 |
| -
|
164 |
| -- `lint:ts`: Runs **ESLint** with the flag `--fix` |
165 |
| - for all **TypeScript** files. |
166 |
| - |
167 |
| - > Runs with the [`eslint.yaml`](.github/workflows/eslint.yaml) |
168 |
| - > workflow. |
169 |
| - > |
170 |
| - > Also run with a `pre-commit` hook. |
171 |
| -
|
172 |
| -- `prettify`: Runs **Prettier** with the `--write` flag |
173 |
| - for all files. |
174 |
| - |
175 |
| -- `commit`: Runs **Commitlint** to create commits according to |
176 |
| - **Conventional Commits** standards. |
177 |
| - |
178 |
| -## Workflows |
179 |
| - |
180 |
| -- [`codeql.yaml`](.github/workflows/codeql.yaml): |
181 |
| - Checks **TypeScript** for vulnerabilities. |
182 |
| - |
183 |
| -- [`commitlint.yaml`](.github/workflows/commitlint.yaml): |
184 |
| - Checks the commit message according |
185 |
| - to the **Conventional Commits** standard. |
186 |
| - |
187 |
| -- [`create-pull-request.yaml`](.github/workflows/create-pull-request.yaml): |
188 |
| - Automatically creates a **Pull Request** |
189 |
| - when pushing a branch to the repository. |
190 |
| - |
191 |
| -- [`dependabot-auto-merge-pull-request.yaml`](.github/workflows/dependabot-auto-merge-pull-request.yaml): |
192 |
| - Automatically merges dependabot **Pull Requests** to the **main** branch. |
193 |
| - |
194 |
| -- [`editorconfig.yaml`](.github/workflows/editorconfig.yaml): |
195 |
| - Checks all files with **editorconfig-checker**. |
196 |
| - |
197 |
| -- [`eslint.yaml`](.github/workflows/eslint.yaml): |
198 |
| - Checks all **TypeScript** files with **ESLint**. |
199 |
| - |
200 |
| -- [`markdown.yaml`](.github/workflows/markdown.yaml): |
201 |
| - Checks all Markdown files with **remark**. |
202 |
| - |
203 |
| -- [`test.yaml`](.github/workflows/test.yaml): |
204 |
| - Tests all TypeScript files with **Vitest**. |
205 |
| - |
206 |
| -- [`pre-commit.yaml`](.github/workflows/pre-commit.yaml): |
207 |
| - Runs a check on the contents of the **Pull Request** before merging. |
208 |
| - |
209 |
| -- [`prettier.yaml`](.github/workflows/prettier.yaml): |
210 |
| - Checks all files with **Prettier**. |
211 |
| - |
212 |
| -- [`release.yaml`](.github/workflows/release.yaml): Creates release. |
213 |
| - |
214 |
| -- [`semantic-pull-request.yaml`](.github/workflows/semantic-pull-request-title.yaml): |
215 |
| - Validates the **Pull Request** title |
216 |
| - against the **conventional commits** standard. |
217 |
| - |
218 |
| -- [`stale.yaml`](.github/workflows/stale.yaml): |
219 |
| - Removes issues that have not been active for more than 60 days. |
220 |
| - |
221 |
| -## Prettier |
222 |
| - |
223 |
| -> \[!WARNING] |
224 |
| -> You need to install the **Prettier** extension for it to work. |
225 |
| -> |
226 |
| -> You can see all necessary extensions for **Visual Studio Code** in |
227 |
| -> [**.vscode**](https://github.com/archoleat/.vscode/extensions.json). |
228 |
| -
|
229 |
| -> \[!TIP] |
230 |
| -> If you want to change the rules in `prettier.config.js` you can do it |
231 |
| -> in `.editorconfig`, prettier will automatically pick up the rules |
232 |
| -> from editorconfig. |
233 |
| -
|
234 |
| -> \[!NOTE] |
235 |
| -> All **Markdown** and **.\*ignore** files [**ignored**](.prettierignore). |
236 |
| -
|
237 |
| -## Commitlint, ESM and TypeScript |
238 |
| - |
239 |
| -In order for `commitlint.config.ts` to work correctly together |
240 |
| -with the **CI/CD** pipeline, the following code has been added: |
241 |
| - |
242 |
| -```json |
243 |
| -// package.json |
244 |
| -"exports": { |
245 |
| - "./*": "./commitlint.config.ts" |
246 |
| -}, |
| 24 | +```shell |
| 25 | +# pnpm |
| 26 | +pnpm i -D @archoleat/commitlint-define-config |
247 | 27 | ```
|
248 | 28 |
|
249 |
| -```json |
250 |
| -// tsconfig.json |
251 |
| -{ |
252 |
| - "module": "NodeNext", |
253 |
| - "moduleResolution": "NodeNext" |
254 |
| -} |
| 29 | +```shell |
| 30 | +# npm |
| 31 | +npm i -D @archoleat/commitlint-define-config |
255 | 32 | ```
|
256 | 33 |
|
257 |
| -## Change of Maintainer |
| 34 | +```shell |
| 35 | +# yarn |
| 36 | +yarn add -D @archoleat/commitlint-define-config |
| 37 | +``` |
258 | 38 |
|
259 |
| -The following files use the names **Archoleat** and **nikkeyl** by default: |
| 39 | +## Usage |
260 | 40 |
|
261 |
| -- [`CODEOWNERS`](.github/CODEOWNERS). |
262 |
| -- [`package.json`](package.json). |
| 41 | +See [Commitlint Configuration](https://commitlint.js.org/reference/configuration.html). |
263 | 42 |
|
264 |
| -Before using this template, replace this name with your |
265 |
| -name, name of your team or the name of your organization. |
| 43 | +```js |
| 44 | +// commitlint.config.js or commitlint.config.ts |
| 45 | +import { defineConfig } from '@archoleat/commitlint-define-config'; |
266 | 46 |
|
267 |
| -> \[!CAUTION] |
268 |
| -> Don't forget to change your license! |
| 47 | +export default defineConfig({ |
| 48 | + // Your options |
| 49 | +}) |
| 50 | +``` |
269 | 51 |
|
270 | 52 | ## Troubleshooting
|
271 | 53 |
|
|
0 commit comments