@d-dev/changelog-darwin-x64 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -1
- package/bin/changelog +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1,216 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Simple changelog management for projects using [semantic versioning](https://semver.org/) and git.
|
|
4
|
+
|
|
5
|
+
## Example
|
|
6
|
+
|
|
7
|
+
### Add
|
|
8
|
+
|
|
9
|
+
Add a changelog entry describing a set of changes.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
changelog add
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
This creates a timestamped file in the `.changelog` directory ready to be added to source control and applied at a later time. Depending on how changelog is configured, the `add` command also adds the timestamped file to the git staging area and then commit all staged files using the provided description as the commit message.
|
|
18
|
+
|
|
19
|
+
> [!NOTE]
|
|
20
|
+
> As a best practice, commit the timestamp file with the set of files the changelog entry describes. For example, run `git add <FILES...>` prior to running `changelog add`.
|
|
21
|
+
|
|
22
|
+
### Apply
|
|
23
|
+
|
|
24
|
+
The apply command gathers previously created change descriptions from the `.changelog` directory and prepends the descriptions to the `CHANGELOG.md` file. The command also bumps semantic version numbers in specified files.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
changelog apply
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
The resulting `CHANGELOG.md` file.
|
|
33
|
+
|
|
34
|
+
```md
|
|
35
|
+
## 0.2.0
|
|
36
|
+
|
|
37
|
+
### Minor Changes
|
|
38
|
+
|
|
39
|
+
- a07c8dd: Describe a minor change.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Running `git tag` shows that a new tag, `v0.2.0` has been applied.
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- Store and track changelog descriptions per commit
|
|
47
|
+
- Apply changelog entries to `CHANGELOG.md`
|
|
48
|
+
- Sync version fields in specified JSON files such as the version field in a package.json file.
|
|
49
|
+
|
|
50
|
+
## TODO
|
|
51
|
+
|
|
52
|
+
- Add support for prereleases
|
|
53
|
+
- Add support for monorepos
|
|
54
|
+
- Add support for other version file formats (yaml, toml, etc.)
|
|
55
|
+
|
|
56
|
+
## Install
|
|
57
|
+
|
|
58
|
+
### NPM
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
npm install @d-dev/changelog -g
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Binaries
|
|
65
|
+
|
|
66
|
+
#### Windows
|
|
67
|
+
|
|
68
|
+
```powershell
|
|
69
|
+
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 | pwsh -Command -
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This will install `changelog` to `~/bin`, be sure to export the location in the user or machine `$PATH` or use the `-to` flag to specify a download location.
|
|
73
|
+
|
|
74
|
+
Running the installer with additional flags:
|
|
75
|
+
|
|
76
|
+
```powershell
|
|
77
|
+
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 -o install.ps1 &&
|
|
78
|
+
pwsh -File install.ps1 -force -tag v0.0.1 -to ~/bin &&
|
|
79
|
+
rm install.ps1
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Linux/Darwin
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This will install `changelog` to `~/bin`, be sure to export the location in the user `$PATH or use the `-to` flag to specify a download location.
|
|
89
|
+
|
|
90
|
+
Running the installer with additional flags:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash -s -- --force --tag v0.0.1 --to ~/bin
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### From Source with [Go](https://go.dev/)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
go install github.com/dworthen/changelog@latest
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Getting Started
|
|
103
|
+
|
|
104
|
+
Within a project directory, run `changelog init`.
|
|
105
|
+
|
|
106
|
+
### 1. Current Version
|
|
107
|
+
|
|
108
|
+

|
|
109
|
+
|
|
110
|
+
Specifies the current version of the project. This version is tracked by `changelog` and considered the source of truth for project version. The version is bumped accordingly when `changelog` applies updates. The bumped version is then used to update specified version files. More on version files below.
|
|
111
|
+
|
|
112
|
+
### 2. Commit changelog entries
|
|
113
|
+
|
|
114
|
+

|
|
115
|
+
|
|
116
|
+
If yes, `changelog add` creates a changelog entry, adds the file to the git staging area and then commits all staged files using the changelog description as the commit message. If using this option, be sure to run `git add <FILES...>` prior to running `changelog add` to associate the new changelog entry with the files it describes.
|
|
117
|
+
|
|
118
|
+
If no, then `changelog add` creates a changelog entry but does not commit the files or run any git commands.
|
|
119
|
+
|
|
120
|
+
### 3. Commit changelog apply
|
|
121
|
+
|
|
122
|
+

|
|
123
|
+
|
|
124
|
+
`changelog apply` updates `CHANGELOG.md` and associated version files. If yes, then `changelog apply` will commit the changed files using the commit description `chore: apply changelog`.
|
|
125
|
+
|
|
126
|
+
### 4. Tag commit (not presented if previous answer == No)
|
|
127
|
+
|
|
128
|
+

|
|
129
|
+
|
|
130
|
+
If yes, `changelog apply` tags the commit created. This option is ignored if the answer to the previous question is No.
|
|
131
|
+
|
|
132
|
+
### 5. Tag format (not presented if either of the previous two answers == No)
|
|
133
|
+
|
|
134
|
+

|
|
135
|
+
|
|
136
|
+
Specify the tag to apply. This string is evaluated using handlebars and has access to the new version. Defaults to `v{{version}}`. This option is ignored if either of the previous two answers is No.
|
|
137
|
+
|
|
138
|
+
### 6. Version files
|
|
139
|
+
|
|
140
|
+

|
|
141
|
+
|
|
142
|
+
Specify JSON files containing fields that should match the project version. The JSON path can point to a nested field using dot notation. After `changelog apply` bumps the current package version it updates all the specified JSON files and fields.
|
|
143
|
+
|
|
144
|
+
> [!WARNING]
|
|
145
|
+
> Currently, only JSON files are supported.
|
|
146
|
+
|
|
147
|
+
### Config
|
|
148
|
+
|
|
149
|
+
`changelog init` creates a `.changelog` directory and the following two files.
|
|
150
|
+
|
|
151
|
+
**config.json**
|
|
152
|
+
|
|
153
|
+
Describes the config the `init` command walks through.
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"version": "1.0.0",
|
|
158
|
+
"bumpFiles": [
|
|
159
|
+
{
|
|
160
|
+
"file": "package.json",
|
|
161
|
+
"path": "version"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"file": "some-json-file.json",
|
|
165
|
+
"path": "path.to.nested"
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"onAdd": {
|
|
169
|
+
"commitFiles": true
|
|
170
|
+
},
|
|
171
|
+
"onApply": {
|
|
172
|
+
"commitFiles": true,
|
|
173
|
+
"tagCommit": true,
|
|
174
|
+
"tagFormat": "v{{version}}"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**changelogTemplate.hbs**
|
|
180
|
+
|
|
181
|
+
A handlebars file describing the template to use when adding entries to `CHANGELOG.md`. Users have full control of how the changelog entries are formatted. The following handlebars variables are available.
|
|
182
|
+
|
|
183
|
+
- **version**: The new project version after `changelog apply` finishes.
|
|
184
|
+
- **oldVersion**: The previous project version prior to `changelog apply`.
|
|
185
|
+
- **patchChanges|minorChanges|majorChanges**: A list of changes grouped by the level of change (patch, minor, or major). The variable is available if there is a change of that type present in the current update, otherwise its null.
|
|
186
|
+
- **sha**: The full git commit hash for the change.
|
|
187
|
+
- **shortSha**: The short git commit hash for the change.
|
|
188
|
+
- **description**: Changelog description.
|
|
189
|
+
|
|
190
|
+
```md
|
|
191
|
+
## {{version}}
|
|
192
|
+
{{#if majorChanges}}
|
|
193
|
+
|
|
194
|
+
### Major Changes
|
|
195
|
+
|
|
196
|
+
{{#each majorChanges}}
|
|
197
|
+
- {{shortSha}}: {{description}}
|
|
198
|
+
{{~/each}}
|
|
199
|
+
{{/if}}
|
|
200
|
+
{{#if minorChanges}}
|
|
201
|
+
|
|
202
|
+
### Minor Changes
|
|
203
|
+
|
|
204
|
+
{{#each minorChanges}}
|
|
205
|
+
- {{shortSha}}: {{description}}
|
|
206
|
+
{{~/each}}
|
|
207
|
+
{{/if}}
|
|
208
|
+
{{#if patchChanges}}
|
|
209
|
+
|
|
210
|
+
### Patch Changes
|
|
211
|
+
|
|
212
|
+
{{#each patchChanges}}
|
|
213
|
+
- {{shortSha}}: {{description}}
|
|
214
|
+
{{/each}}
|
|
215
|
+
{{~/if}}
|
|
216
|
+
```
|
package/bin/changelog
CHANGED
|
Binary file
|