@d-dev/changelog-darwin-arm64 0.4.0 → 0.4.1
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 +189 -136
- package/bin/changelog +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,216 +1,269 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Git-based changelog manager for JavaScript, Python, and Go projects using [semantic versioning](https://semver.org/) and git.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```shell
|
|
8
|
+
$ changelog help
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Git-based changelog manager for JavaScript, Python, and Go projects.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
changelog
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-

|
|
12
|
+
Usage:
|
|
13
|
+
changelog [command]
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
Available Commands:
|
|
16
|
+
add Add a changelog entry.
|
|
17
|
+
apply Apply changelog entries.
|
|
18
|
+
check Check that the current branch or last commit contains a changelog entry. Useful for CI workflows to enforce the presence of changelog entries.
|
|
19
|
+
help Help about any command
|
|
20
|
+
init Initialize project to use changelog.
|
|
21
|
+
update Update to the latest version of changelog
|
|
22
|
+
version Print the current version of changelog
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
Flags:
|
|
25
|
+
--cwd string project directory for changelog. (default ".")
|
|
26
|
+
-h, --help help for changelog
|
|
27
|
+
--verbose enable verbose logging.
|
|
21
28
|
|
|
22
|
-
|
|
29
|
+
Use "changelog [command] --help" for more information about a command.
|
|
30
|
+
```
|
|
23
31
|
|
|
24
|
-
|
|
32
|
+
## Init
|
|
25
33
|
|
|
26
|
-
```
|
|
27
|
-
changelog
|
|
34
|
+
```shell
|
|
35
|
+
changelog init
|
|
28
36
|
```
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
Walks through creating a `.changelog` directory with the following files.
|
|
39
|
+
|
|
40
|
+
### `config.yaml`
|
|
41
|
+
|
|
42
|
+
Changelog configuration:
|
|
43
|
+
|
|
44
|
+
```yaml
|
|
45
|
+
# Example config.yaml
|
|
46
|
+
|
|
47
|
+
# Current version of the project.
|
|
48
|
+
# This gets bumped, along with the files listed below,
|
|
49
|
+
# when running `changelog apply`
|
|
50
|
+
version: 0.1.0
|
|
51
|
+
changelogFile: CHANGELOG.md # Changelog file to manage
|
|
52
|
+
|
|
53
|
+
# A list of files containing versions to bump when running
|
|
54
|
+
# `changelog apply`.
|
|
55
|
+
# Uses RegExp patterns for matching and replacing the actual version.
|
|
56
|
+
# The RegExp must contain 1 capture group with the version portion to replace.
|
|
57
|
+
# View https://pkg.go.dev/regexp/syntax@go1.24.1 for RegExp syntax
|
|
58
|
+
# Use https://regex101.com/ with GoLang selected to test patterns.
|
|
59
|
+
# Examples for Node package.json and python pyproject.toml below.
|
|
60
|
+
files:
|
|
61
|
+
- path: package.json
|
|
62
|
+
pattern: '"version":\s*"(\d+\.\d+\.\d+)"'
|
|
63
|
+
- path: pyproject.toml
|
|
64
|
+
pattern: 'version\s*=\s*"(\d+\.\d+\.\d+)"'
|
|
65
|
+
|
|
66
|
+
# Configures `changelog add` command
|
|
67
|
+
onAdd:
|
|
68
|
+
# commit staged files + added changelog entry
|
|
69
|
+
# Uses the provided description as the commit message.
|
|
70
|
+
commitFiles: true
|
|
71
|
+
|
|
72
|
+
# Configure `changelog apply` command
|
|
73
|
+
onApply:
|
|
74
|
+
commitFiles: true
|
|
75
|
+
tagCommit: true
|
|
76
|
+
tagFormat: v{{version}}
|
|
77
|
+
# A list of commands to run after bumping version files
|
|
78
|
+
# and before committing and tagging.
|
|
79
|
+
# Often useful to run install/sync commands that may update
|
|
80
|
+
# lock files.
|
|
81
|
+
commands:
|
|
82
|
+
- npm install
|
|
83
|
+
- uv sync
|
|
31
84
|
|
|
32
|
-
|
|
85
|
+
```
|
|
33
86
|
|
|
34
|
-
|
|
35
|
-
## 0.2.0
|
|
87
|
+
### `changelogTemplate.hbs`
|
|
36
88
|
|
|
37
|
-
|
|
89
|
+
A [Handlebars](https://handlebarsjs.com/) template used for adding new entries to the changelog file specified in the `.changelog/config.yaml` file.
|
|
90
|
+
|
|
91
|
+
Default template:
|
|
38
92
|
|
|
39
|
-
- a07c8dd: Describe a minor change.
|
|
40
93
|
```
|
|
94
|
+
## {{version}}
|
|
95
|
+
{{#if majorChanges}}
|
|
41
96
|
|
|
42
|
-
|
|
97
|
+
### Major Changes
|
|
43
98
|
|
|
44
|
-
|
|
99
|
+
{{#each majorChanges}}
|
|
100
|
+
- {{shortSha}}: {{description}}
|
|
101
|
+
{{/each}}
|
|
102
|
+
{{/if}}
|
|
103
|
+
{{#if minorChanges}}
|
|
45
104
|
|
|
46
|
-
|
|
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.
|
|
105
|
+
### Minor Changes
|
|
49
106
|
|
|
50
|
-
|
|
107
|
+
{{#each minorChanges}}
|
|
108
|
+
- {{shortSha}}: {{description}}
|
|
109
|
+
{{/each}}
|
|
110
|
+
{{/if}}
|
|
111
|
+
{{#if patchChanges}}
|
|
51
112
|
|
|
52
|
-
|
|
53
|
-
- Add support for monorepos
|
|
54
|
-
- Add support for other version file formats (yaml, toml, etc.)
|
|
113
|
+
### Patch Changes
|
|
55
114
|
|
|
56
|
-
|
|
115
|
+
{{#each patchChanges}}
|
|
116
|
+
- {{shortSha}}: {{description}}
|
|
117
|
+
{{/each}}
|
|
118
|
+
{{/if}}
|
|
57
119
|
|
|
58
|
-
### NPM
|
|
59
120
|
|
|
60
|
-
```
|
|
61
|
-
npm install @d-dev/changelog -g
|
|
62
121
|
```
|
|
63
122
|
|
|
64
|
-
|
|
123
|
+
**Available Variables**
|
|
65
124
|
|
|
66
|
-
|
|
125
|
+
- version: The new version of the project.
|
|
126
|
+
- oldVersion: The previous version of the project.
|
|
127
|
+
- majorChanges, minorChanges, patchChanges: A list of change descriptions.
|
|
128
|
+
- **Change Description:**
|
|
129
|
+
- Sha: The git Sha associated with the change commit.
|
|
130
|
+
- shortSha: The git short Sha associated with the change commit.
|
|
131
|
+
- change: `patch|minor|major`
|
|
132
|
+
- description: The description of the change
|
|
67
133
|
|
|
68
|
-
|
|
69
|
-
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 | pwsh -Command -
|
|
70
|
-
```
|
|
134
|
+
## Add
|
|
71
135
|
|
|
72
|
-
|
|
136
|
+
```shell
|
|
137
|
+
changelog add
|
|
138
|
+
```
|
|
73
139
|
|
|
74
|
-
|
|
140
|
+

|
|
75
141
|
|
|
76
|
-
|
|
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
|
-
```
|
|
142
|
+
Creates a timestamped `.md` changelog entry file in the `.changelog` directory ready to be added to source control and applied at a later time. The changelog entry contains the type of change (`patch|minor|major`) along with the provided description.
|
|
81
143
|
|
|
82
|
-
|
|
144
|
+
Example changelog entry:
|
|
83
145
|
|
|
84
|
-
```
|
|
85
|
-
|
|
146
|
+
```
|
|
147
|
+
---
|
|
148
|
+
change: "major"
|
|
149
|
+
---
|
|
150
|
+
A major change.
|
|
86
151
|
```
|
|
87
152
|
|
|
88
|
-
|
|
153
|
+
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.
|
|
89
154
|
|
|
90
|
-
|
|
155
|
+
> [!NOTE]
|
|
156
|
+
> 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`.
|
|
91
157
|
|
|
92
|
-
|
|
93
|
-
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash -s -- --force --tag v0.0.1 --to ~/bin
|
|
94
|
-
```
|
|
158
|
+
## Apply
|
|
95
159
|
|
|
96
|
-
|
|
160
|
+
The apply command...
|
|
161
|
+
|
|
162
|
+
- Runs in dry mode by default. The command shows a preview of the changes and ask for confirmation prior to applying any changes.
|
|
163
|
+
- gathers previously created changelog entries from the `.changelog` directory and prepends the info to the `CHANGELOG.md` file according to the `.changelog/changelogTemplate.hbs` template file.
|
|
164
|
+
- Bumps semantic version numbers in specified files according to `.changelog/config.yaml`.
|
|
165
|
+
- run any commands listed in `.changelog/config.yaml`.
|
|
97
166
|
|
|
98
167
|
```bash
|
|
99
|
-
|
|
168
|
+
changelog apply
|
|
100
169
|
```
|
|
101
170
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
Within a project directory, run `changelog init`.
|
|
171
|
+

|
|
105
172
|
|
|
106
|
-
|
|
173
|
+
If `.changelog/config.yaml` is configured to commit and tag files when running `changelog apply` then `git log` and `git tag` should show the commit and associated tag.
|
|
107
174
|
|
|
108
|
-
|
|
175
|
+
## TODO
|
|
109
176
|
|
|
110
|
-
|
|
177
|
+
- Add support for prereleases
|
|
111
178
|
|
|
112
|
-
|
|
179
|
+
## Install
|
|
113
180
|
|
|
114
|
-
|
|
181
|
+
### NPM
|
|
115
182
|
|
|
116
|
-
|
|
183
|
+
https://www.npmjs.com/package/@d-dev/changelog
|
|
117
184
|
|
|
118
|
-
|
|
185
|
+
```shell
|
|
186
|
+
npm install @d-dev/changelog
|
|
187
|
+
# or globally
|
|
188
|
+
npm install @d-dev/changelog -g
|
|
189
|
+
```
|
|
119
190
|
|
|
120
|
-
###
|
|
191
|
+
### Python
|
|
121
192
|
|
|
122
|
-
|
|
193
|
+
https://pypi.org/project/changesets/
|
|
123
194
|
|
|
124
|
-
|
|
195
|
+
```shell
|
|
196
|
+
pip install changesets
|
|
197
|
+
# Or with UV
|
|
198
|
+
uv add changesets --dev
|
|
199
|
+
# package is called changesets but command is still changelog
|
|
200
|
+
```
|
|
125
201
|
|
|
126
|
-
###
|
|
202
|
+
### Golang
|
|
127
203
|
|
|
128
|
-
|
|
204
|
+
https://pkg.go.dev/github.com/dworthen/changelog
|
|
129
205
|
|
|
130
|
-
|
|
206
|
+
With go version `1.24.x` you can add the package as a tool to your project with
|
|
131
207
|
|
|
132
|
-
|
|
208
|
+
```shell
|
|
209
|
+
go get -tool github.com/dworthen/changelog@latest
|
|
210
|
+
```
|
|
133
211
|
|
|
134
|
-
|
|
212
|
+
and use with
|
|
135
213
|
|
|
136
|
-
|
|
214
|
+
```shell
|
|
215
|
+
go tool changelog help
|
|
216
|
+
```
|
|
137
217
|
|
|
138
|
-
|
|
218
|
+
Prior to 1.24
|
|
139
219
|
|
|
140
|
-
|
|
220
|
+
```
|
|
221
|
+
go install github.com/dworthen/changelog
|
|
222
|
+
```
|
|
141
223
|
|
|
142
|
-
|
|
224
|
+
### Binaries
|
|
143
225
|
|
|
144
|
-
|
|
145
|
-
> Currently, only JSON files are supported.
|
|
226
|
+
#### Windows
|
|
146
227
|
|
|
147
|
-
|
|
228
|
+
Requires the newer [powershell core](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5).
|
|
148
229
|
|
|
149
|
-
|
|
230
|
+
```powershell
|
|
231
|
+
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 | pwsh -Command -
|
|
232
|
+
```
|
|
150
233
|
|
|
151
|
-
|
|
234
|
+
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.
|
|
152
235
|
|
|
153
|
-
|
|
236
|
+
Running the installer with additional flags:
|
|
154
237
|
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
-
}
|
|
238
|
+
```powershell
|
|
239
|
+
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 -o install.ps1 &&
|
|
240
|
+
pwsh -File install.ps1 -force -tag v0.0.1 -to ~/bin &&
|
|
241
|
+
rm install.ps1
|
|
177
242
|
```
|
|
178
243
|
|
|
179
|
-
|
|
244
|
+
#### Linux/Darwin
|
|
180
245
|
|
|
181
|
-
|
|
246
|
+
```bash
|
|
247
|
+
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash
|
|
248
|
+
```
|
|
182
249
|
|
|
183
|
-
|
|
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.
|
|
250
|
+
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.
|
|
189
251
|
|
|
190
|
-
|
|
191
|
-
## {{version}}
|
|
192
|
-
{{#if majorChanges}}
|
|
193
|
-
|
|
194
|
-
### Major Changes
|
|
252
|
+
Running the installer with additional flags:
|
|
195
253
|
|
|
196
|
-
|
|
197
|
-
-
|
|
198
|
-
|
|
199
|
-
{{/if}}
|
|
200
|
-
{{#if minorChanges}}
|
|
254
|
+
```bash
|
|
255
|
+
curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash -s -- --force --tag v0.0.1 --to ~/bin
|
|
256
|
+
```
|
|
201
257
|
|
|
202
|
-
###
|
|
258
|
+
### Prebuilt Binaries
|
|
203
259
|
|
|
204
|
-
|
|
205
|
-
- {{shortSha}}: {{description}}
|
|
206
|
-
{{~/each}}
|
|
207
|
-
{{/if}}
|
|
208
|
-
{{#if patchChanges}}
|
|
260
|
+
https://github.com/dworthen/changelog/releases
|
|
209
261
|
|
|
210
|
-
###
|
|
262
|
+
### From Source with [Go](https://go.dev/)
|
|
211
263
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
264
|
+
```bash
|
|
265
|
+
git clone https://github.com/dworthen/changelog.git
|
|
266
|
+
cd changelog
|
|
267
|
+
go mod tidy
|
|
268
|
+
go build ./main.go
|
|
216
269
|
```
|
package/bin/changelog
CHANGED
|
Binary file
|