@d-dev/changelog-darwin-x64 0.3.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.
Files changed (3) hide show
  1. package/README.md +269 -1
  2. package/bin/changelog +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1 +1,269 @@
1
- # Changelog2
1
+ # Changelog
2
+
3
+ Git-based changelog manager for JavaScript, Python, and Go projects using [semantic versioning](https://semver.org/) and git.
4
+
5
+ ## Usage
6
+
7
+ ```shell
8
+ $ changelog help
9
+
10
+ Git-based changelog manager for JavaScript, Python, and Go projects.
11
+
12
+ Usage:
13
+ changelog [command]
14
+
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
23
+
24
+ Flags:
25
+ --cwd string project directory for changelog. (default ".")
26
+ -h, --help help for changelog
27
+ --verbose enable verbose logging.
28
+
29
+ Use "changelog [command] --help" for more information about a command.
30
+ ```
31
+
32
+ ## Init
33
+
34
+ ```shell
35
+ changelog init
36
+ ```
37
+
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
84
+
85
+ ```
86
+
87
+ ### `changelogTemplate.hbs`
88
+
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:
92
+
93
+ ```
94
+ ## {{version}}
95
+ {{#if majorChanges}}
96
+
97
+ ### Major Changes
98
+
99
+ {{#each majorChanges}}
100
+ - {{shortSha}}: {{description}}
101
+ {{/each}}
102
+ {{/if}}
103
+ {{#if minorChanges}}
104
+
105
+ ### Minor Changes
106
+
107
+ {{#each minorChanges}}
108
+ - {{shortSha}}: {{description}}
109
+ {{/each}}
110
+ {{/if}}
111
+ {{#if patchChanges}}
112
+
113
+ ### Patch Changes
114
+
115
+ {{#each patchChanges}}
116
+ - {{shortSha}}: {{description}}
117
+ {{/each}}
118
+ {{/if}}
119
+
120
+
121
+ ```
122
+
123
+ **Available Variables**
124
+
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
133
+
134
+ ## Add
135
+
136
+ ```shell
137
+ changelog add
138
+ ```
139
+
140
+ ![changelog add](docs/images/changelog-add.gif)
141
+
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.
143
+
144
+ Example changelog entry:
145
+
146
+ ```
147
+ ---
148
+ change: "major"
149
+ ---
150
+ A major change.
151
+ ```
152
+
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.
154
+
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`.
157
+
158
+ ## Apply
159
+
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`.
166
+
167
+ ```bash
168
+ changelog apply
169
+ ```
170
+
171
+ ![changelog apply](docs/images/changelog-apply.gif)
172
+
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.
174
+
175
+ ## TODO
176
+
177
+ - Add support for prereleases
178
+
179
+ ## Install
180
+
181
+ ### NPM
182
+
183
+ https://www.npmjs.com/package/@d-dev/changelog
184
+
185
+ ```shell
186
+ npm install @d-dev/changelog
187
+ # or globally
188
+ npm install @d-dev/changelog -g
189
+ ```
190
+
191
+ ### Python
192
+
193
+ https://pypi.org/project/changesets/
194
+
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
+ ```
201
+
202
+ ### Golang
203
+
204
+ https://pkg.go.dev/github.com/dworthen/changelog
205
+
206
+ With go version `1.24.x` you can add the package as a tool to your project with
207
+
208
+ ```shell
209
+ go get -tool github.com/dworthen/changelog@latest
210
+ ```
211
+
212
+ and use with
213
+
214
+ ```shell
215
+ go tool changelog help
216
+ ```
217
+
218
+ Prior to 1.24
219
+
220
+ ```
221
+ go install github.com/dworthen/changelog
222
+ ```
223
+
224
+ ### Binaries
225
+
226
+ #### Windows
227
+
228
+ Requires the newer [powershell core](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5).
229
+
230
+ ```powershell
231
+ curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 | pwsh -Command -
232
+ ```
233
+
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.
235
+
236
+ Running the installer with additional flags:
237
+
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
242
+ ```
243
+
244
+ #### Linux/Darwin
245
+
246
+ ```bash
247
+ curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash
248
+ ```
249
+
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.
251
+
252
+ Running the installer with additional flags:
253
+
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
+ ```
257
+
258
+ ### Prebuilt Binaries
259
+
260
+ https://github.com/dworthen/changelog/releases
261
+
262
+ ### From Source with [Go](https://go.dev/)
263
+
264
+ ```bash
265
+ git clone https://github.com/dworthen/changelog.git
266
+ cd changelog
267
+ go mod tidy
268
+ go build ./main.go
269
+ ```
package/bin/changelog CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-dev/changelog-darwin-x64",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "author": "Derek Worthen <worthend.derek@gmail.com>",
6
6
  "license": "MIT",