@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.
Files changed (3) hide show
  1. package/README.md +189 -136
  2. package/bin/changelog +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,216 +1,269 @@
1
1
  # Changelog
2
2
 
3
- Simple changelog management for projects using [semantic versioning](https://semver.org/) and git.
3
+ Git-based changelog manager for JavaScript, Python, and Go projects using [semantic versioning](https://semver.org/) and git.
4
4
 
5
- ## Example
5
+ ## Usage
6
6
 
7
- ### Add
7
+ ```shell
8
+ $ changelog help
8
9
 
9
- Add a changelog entry describing a set of changes.
10
+ Git-based changelog manager for JavaScript, Python, and Go projects.
10
11
 
11
- ```bash
12
- changelog add
13
- ```
14
-
15
- ![changelog add](docs/images/changelog-add.gif)
12
+ Usage:
13
+ changelog [command]
16
14
 
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.
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
- > [!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`.
24
+ Flags:
25
+ --cwd string project directory for changelog. (default ".")
26
+ -h, --help help for changelog
27
+ --verbose enable verbose logging.
21
28
 
22
- ### Apply
29
+ Use "changelog [command] --help" for more information about a command.
30
+ ```
23
31
 
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.
32
+ ## Init
25
33
 
26
- ```bash
27
- changelog apply
34
+ ```shell
35
+ changelog init
28
36
  ```
29
37
 
30
- ![changelog apply](docs/images/changelog-apply.gif)
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
- The resulting `CHANGELOG.md` file.
85
+ ```
33
86
 
34
- ```md
35
- ## 0.2.0
87
+ ### `changelogTemplate.hbs`
36
88
 
37
- ### Minor Changes
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
- Running `git tag` shows that a new tag, `v0.2.0` has been applied.
97
+ ### Major Changes
43
98
 
44
- ## Features
99
+ {{#each majorChanges}}
100
+ - {{shortSha}}: {{description}}
101
+ {{/each}}
102
+ {{/if}}
103
+ {{#if minorChanges}}
45
104
 
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.
105
+ ### Minor Changes
49
106
 
50
- ## TODO
107
+ {{#each minorChanges}}
108
+ - {{shortSha}}: {{description}}
109
+ {{/each}}
110
+ {{/if}}
111
+ {{#if patchChanges}}
51
112
 
52
- - Add support for prereleases
53
- - Add support for monorepos
54
- - Add support for other version file formats (yaml, toml, etc.)
113
+ ### Patch Changes
55
114
 
56
- ## Install
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
- ### Binaries
123
+ **Available Variables**
65
124
 
66
- #### Windows
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
- ```powershell
69
- curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 | pwsh -Command -
70
- ```
134
+ ## Add
71
135
 
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.
136
+ ```shell
137
+ changelog add
138
+ ```
73
139
 
74
- Running the installer with additional flags:
140
+ ![changelog add](docs/images/changelog-add.gif)
75
141
 
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
- ```
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
- #### Linux/Darwin
144
+ Example changelog entry:
83
145
 
84
- ```bash
85
- curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash
146
+ ```
147
+ ---
148
+ change: "major"
149
+ ---
150
+ A major change.
86
151
  ```
87
152
 
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.
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
- Running the installer with additional flags:
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
- ```bash
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
- ### From Source with [Go](https://go.dev/)
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
- go install github.com/dworthen/changelog@latest
168
+ changelog apply
100
169
  ```
101
170
 
102
- ## Getting Started
103
-
104
- Within a project directory, run `changelog init`.
171
+ ![changelog apply](docs/images/changelog-apply.gif)
105
172
 
106
- ### 1. Current Version
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
- ![changelog version](docs/images/changelog-version.png)
175
+ ## TODO
109
176
 
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.
177
+ - Add support for prereleases
111
178
 
112
- ### 2. Commit changelog entries
179
+ ## Install
113
180
 
114
- ![changelog commit entries](docs/images/changelog-commit-entries.png)
181
+ ### NPM
115
182
 
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.
183
+ https://www.npmjs.com/package/@d-dev/changelog
117
184
 
118
- If no, then `changelog add` creates a changelog entry but does not commit the files or run any git commands.
185
+ ```shell
186
+ npm install @d-dev/changelog
187
+ # or globally
188
+ npm install @d-dev/changelog -g
189
+ ```
119
190
 
120
- ### 3. Commit changelog apply
191
+ ### Python
121
192
 
122
- ![changelog commit apply](docs/images/changelog-commit-apply.png)
193
+ https://pypi.org/project/changesets/
123
194
 
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`.
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
- ### 4. Tag commit (not presented if previous answer == No)
202
+ ### Golang
127
203
 
128
- ![changelog tag](docs/images/changelog-tag.png)
204
+ https://pkg.go.dev/github.com/dworthen/changelog
129
205
 
130
- If yes, `changelog apply` tags the commit created. This option is ignored if the answer to the previous question is No.
206
+ With go version `1.24.x` you can add the package as a tool to your project with
131
207
 
132
- ### 5. Tag format (not presented if either of the previous two answers == No)
208
+ ```shell
209
+ go get -tool github.com/dworthen/changelog@latest
210
+ ```
133
211
 
134
- ![changelog tag format](docs/images/changelog-tag-format.png)
212
+ and use with
135
213
 
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.
214
+ ```shell
215
+ go tool changelog help
216
+ ```
137
217
 
138
- ### 6. Version files
218
+ Prior to 1.24
139
219
 
140
- ![changelog version files](docs/images/changelog-version-files.png)
220
+ ```
221
+ go install github.com/dworthen/changelog
222
+ ```
141
223
 
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.
224
+ ### Binaries
143
225
 
144
- > [!WARNING]
145
- > Currently, only JSON files are supported.
226
+ #### Windows
146
227
 
147
- ### Config
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
- `changelog init` creates a `.changelog` directory and the following two files.
230
+ ```powershell
231
+ curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 | pwsh -Command -
232
+ ```
150
233
 
151
- **config.json**
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
- Describes the config the `init` command walks through.
236
+ Running the installer with additional flags:
154
237
 
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
- }
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
- **changelogTemplate.hbs**
244
+ #### Linux/Darwin
180
245
 
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.
246
+ ```bash
247
+ curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash
248
+ ```
182
249
 
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.
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
- ```md
191
- ## {{version}}
192
- {{#if majorChanges}}
193
-
194
- ### Major Changes
252
+ Running the installer with additional flags:
195
253
 
196
- {{#each majorChanges}}
197
- - {{shortSha}}: {{description}}
198
- {{~/each}}
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
- ### Minor Changes
258
+ ### Prebuilt Binaries
203
259
 
204
- {{#each minorChanges}}
205
- - {{shortSha}}: {{description}}
206
- {{~/each}}
207
- {{/if}}
208
- {{#if patchChanges}}
260
+ https://github.com/dworthen/changelog/releases
209
261
 
210
- ### Patch Changes
262
+ ### From Source with [Go](https://go.dev/)
211
263
 
212
- {{#each patchChanges}}
213
- - {{shortSha}}: {{description}}
214
- {{/each}}
215
- {{~/if}}
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-dev/changelog-darwin-arm64",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "author": "Derek Worthen <worthend.derek@gmail.com>",
6
6
  "license": "MIT",