Skip to content

Commit 04cf235

Browse files
committed
docs: create project's documentation
1 parent b80d365 commit 04cf235

File tree

7 files changed

+301
-237
lines changed

7 files changed

+301
-237
lines changed

README.md

Lines changed: 8 additions & 237 deletions
Original file line numberDiff line numberDiff line change
@@ -27,254 +27,25 @@
2727

2828
## Intro
2929

30-
**perfekt** is a release, changelog and versioning manager. It is easy to use and doesn't require any configuration to get it up and running.
30+
**perfekt** is a release, changelog and versioning manager. It's easy to use and doesn't require any configuration to get it up and running.
3131

32-
## Installation
32+
## Convention
3333

34-
`npm i -g perfekt`
34+
For **perfekt** to run with its full power, your project must follow the [conventional commits](https://www.conventionalcommits.org) specification, this allows it to know the type of changes introduced in a given commit.
3535

36-
Installing **perfekt** globally is recommended as this will allow you to conveniently use it on different projects.
36+
If your project doesn't do it yet, you can start any time as there is no need for rewriting any git history, simply create an initial release which will contain all of the _unconventional_ commits and after that start naming your commits accordingly.
3737

38-
If you'd like to use it as a git hook or integrate it into your CI/CD you can also install it locally.
39-
40-
## Prerequisites
41-
42-
For **perfekt** to run with its full power, your project must follow [conventional commits](https://www.conventionalcommits.org) specification, this makes it possible to know what type of changes were introduced in a given commit and categorize it.
43-
44-
If your project is not following this convention, you can start any time as there is no need to rewrite the git history, simply create an initial release that will contain all the "legacy" commits and after that start naming your commits accordingly.
38+
If for some reason you can't follow the convention for your commits' names, you can still use **perfekt** but you will lose some of the features, like grouping the commits by type or ability to automatically determine the next release version based on unreleased changes using `new` keyword in the `perfekt release new` command, about which you can read more [here](https://lekterable.github.io/perfekt/#/documentation?id=release).
4539

4640
## Getting started
4741

48-
How to get started, depends mostly on your needs and also on your project's state.
49-
50-
If you're not interested in executing a release, and just want to generate a changelog, go to [changelog documentation](#changelog)
51-
52-
If your project is fairly new, go ahead and start with the [new projects section](#new-projects), if it is in development for some time already AND it has a lot (and I mean A LOT) of commits, proceed to the [old projects section](#old-projects).
53-
54-
### New projects
55-
56-
For the new projects, all you need to do is to make sure that you don't have any leftover git tags that could cause a problem, to confirm that, run:
57-
58-
`git tag`
59-
60-
If the output is empty, you should be able to run:
61-
62-
`perfekt release <version>`
63-
64-
where `<version>` is the version of your new release
65-
66-
refer to [release documentation](#release) for more information
67-
68-
### Old projects
69-
70-
For the projects that have a long-existing git history, which could potentially make the process time out, you can use:
71-
72-
`perfekt release <version> --from <commit>`
73-
74-
where `<version>` is the version of your new release and `<commit>` is the hash of the last commit that should **NOT** be the part of the release.
75-
76-
after this, you can start referring to [new projects section](#new-projects) when executing future releases.
77-
78-
## Documentation
79-
80-
For the list of available commands you can always run:
81-
82-
`perfekt help`
83-
84-
### `init` [WIP]
85-
86-
Usage: `perfekt init [options]`
87-
88-
Starts an initialization process and generates an empty configuration file.
89-
90-
Options:
91-
92-
`-h, --help` - display help for command
93-
94-
### `release`
95-
96-
Usage: `perfekt release [options] <version>`
97-
98-
Executes a release
99-
100-
This will:
101-
102-
- Update the version in your `package.json` and `package-lock.json`
103-
- Generate and save the [changelog](#changelog) using passed `version`
104-
- Create a release commit with the changes in your `package.json`, `package-lock.json` and `CHANGELOG.md`
105-
- Create a git tag
106-
107-
Options:
108-
109-
`-h, --help` - display help for command
110-
111-
`--from <commit>` - SHA of the last commit which will **NOT** be included in this release
112-
113-
Arguments:
114-
115-
`version` - _(required)_ version which will be used while executing the release. You can use `major`, `minor` and `patch` instead of a specific version number to bump it or `new` to make **perfekt** determine the version for you automatically based on the unreleased changes.
116-
117-
### `changelog`
118-
119-
Usage: `perfekt changelog [options] [version]`
120-
121-
Generates changelog
122-
123-
This will:
124-
125-
- Look for the latest git tag
126-
- if found transform unreleased into a release and append with the previous changelog
127-
- if **NOT**, try to generate a new changelog for the whole history
128-
- Output changelog in the console, if you want to save it in the `CHANGELOG.md` file use `--write` option
129-
130-
Options:
131-
132-
`-h, --help` - display help for command
133-
134-
`--write` - write the output to file
135-
136-
`--root` - generate changelog for the entire history
137-
138-
`--from <commit>` - SHA of the last commit which will **NOT** be included in this changelog
139-
140-
Arguments:
141-
142-
`version` - _(optional)_ version which will be used for generating the changelog, fallbacks to [unreleased format](#unreleasedHeader) if not passed
143-
144-
## Configuration
145-
146-
**perfekt's** huge advantage is it's configurability.
147-
148-
See [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) for more details on what configuration formats are supported.
149-
150-
Default config looks like this:
151-
152-
```json
153-
{
154-
"unreleasedHeader": "# Latest",
155-
"releaseHeader": "# %version%",
156-
"breakingHeader": "## BREAKING",
157-
"groups": [
158-
{
159-
"name": "## Features",
160-
"change": "minor",
161-
"aliases": ["feat", "feature"]
162-
},
163-
{
164-
"name": "## Fixes",
165-
"change": "patch",
166-
"aliases": ["fix"]
167-
}
168-
],
169-
"miscFormat": "## Misc",
170-
"lineFormat": "- %message% %hash%",
171-
"ignoredScopes": ["changelog"]
172-
}
173-
```
174-
175-
### `unreleasedHeader`
176-
177-
Format of the unreleased-block header in the generated changelog
178-
179-
Placeholders:
180-
181-
none
182-
183-
Default:
184-
185-
`# Latest`
186-
187-
### `breakingHeader`
188-
189-
Format of the breaking changes header in the generated changelog
190-
191-
Placeholders:
192-
193-
none
194-
195-
Default:
196-
197-
`## BREAKING`
198-
199-
### `releaseHeader`
200-
201-
Format of the release header in the generated changelog
202-
203-
Placeholders:
204-
205-
`%version%` - release version
206-
207-
Default:
208-
209-
`# %version%`
210-
211-
### `groups`
212-
213-
Used to define how commits should be grouped inside of the release block.
214-
215-
Each object is a separate group, e.g:
216-
217-
```json
218-
{
219-
"name": "## Features",
220-
"change": "minor",
221-
"types": ["feat", "feature"]
222-
}
223-
```
224-
225-
The `name` property will be used as the group's header in changelog, `change` is needed to determine the release type when using `new` as a release version and the `types` array contains all commit types which should be associated with that group.
226-
227-
All commits with unmatched types will become a part of the `Misc` group.
228-
229-
> commit type comes from: `type(scope?): message`
230-
231-
Default:
232-
233-
`[ { name: '## Features', change: 'minor', types: ['feat', 'feature'] }, { name: '## Fixes', change: 'patch', types: ['fix'] } ]`
234-
235-
> change can be either `major`, `minor` or `patch`
236-
237-
> `Breaking` and `Misc` groups correspond to `major` and `patch` changes respectively.
238-
239-
### `miscFormat`
240-
241-
Format of the miscellaneous header in the generated changelog
242-
243-
Placeholders:
244-
245-
none
246-
247-
Default:
248-
249-
`## Misc`
250-
251-
### `lineFormat`
252-
253-
Format of the individual lines in the generated changelog
254-
255-
Placeholders:
256-
257-
`%message%` - commit message
258-
259-
`%hash%` - abbreviated (8-digit long) commit hash
260-
261-
`%HASH%` - full commit hash
262-
263-
Default:
264-
265-
`- %message% %hash%`
266-
267-
### `ignoredScopes`
268-
269-
Array of scopes which will be ignored while generating a changelog
270-
271-
Default:
42+
For a quick introduction and set up instructions head to the [getting started](https://lekterable.github.io/perfekt/#/getting-started.md) section.
27243

273-
`['changelog']`
44+
You can also view the entire documentation online at [lekterable.github.io/perfekt](https://lekterable.github.io/perfekt)
27445

27546
## Badge
27647

277-
Want to let everyone know that your project is under a _**perfekt**_ management?
48+
Would you like to let the whole world know that your project is under the _**perfekt**_ management?
27849

27950
[![management: perfekt👌](https://img.shields.io/badge/management-perfekt👌-red.svg?style=flat-square)](https://github.com/lekterable/perfekt)
28051

docs/.nojekyll

Whitespace-only changes.

docs/_sidebar.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- [Intro](/)
2+
- [Getting started](getting-started.md)
3+
- [Documentation](documentation.md)
4+
- [Configuration](configuration.md)

0 commit comments

Comments
 (0)