@d-dev/changelog-darwin-x64 0.4.0 → 1.0.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.
Files changed (4) hide show
  1. package/README.md +106 -154
  2. package/bin/changelog +0 -0
  3. package/index.js +9 -5
  4. package/package.json +11 -24
package/README.md CHANGED
@@ -1,216 +1,168 @@
1
- # Changelog
1
+ # changelog
2
2
 
3
- Simple changelog management for projects using [semantic versioning](https://semver.org/) and git.
3
+ Changelog is a CLI tool for managing changelogs. Individual changelog entries are stored as files, eliminating merge conflicts and enabling CI enforcement.
4
4
 
5
- ## Example
5
+ [Full documentation](https://dworthen.github.io/changelog)
6
6
 
7
- ### Add
7
+ ## Installation
8
8
 
9
- Add a changelog entry describing a set of changes.
9
+ <!-- tabs:start -->
10
10
 
11
- ```bash
12
- changelog add
13
- ```
14
-
15
- ![changelog add](docs/images/changelog-add.gif)
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
11
+ #### **npm**
23
12
 
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.
13
+ Install globally:
25
14
 
26
15
  ```bash
27
- changelog apply
28
- ```
29
-
30
- ![changelog apply](docs/images/changelog-apply.gif)
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.
16
+ npm install -g @d-dev/changelog
40
17
  ```
41
18
 
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
19
+ Or as a dev dependency:
59
20
 
21
+ ```bash
22
+ npm install -D @d-dev/changelog
60
23
  ```
61
- npm install @d-dev/changelog -g
62
- ```
63
-
64
- ### Binaries
65
24
 
66
- #### Windows
25
+ Or run with `npx`
67
26
 
68
- ```powershell
69
- curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 | pwsh -Command -
27
+ ```bash
28
+ npx @d-dev/changelog
70
29
  ```
71
30
 
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.
31
+ #### **PyPI**
73
32
 
74
- Running the installer with additional flags:
33
+ Install with pip:
75
34
 
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
35
+ ```bash
36
+ pip install changesets
80
37
  ```
81
38
 
82
- #### Linux/Darwin
39
+ Install with uv.
83
40
 
84
41
  ```bash
85
- curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash
42
+ uv tool install changesets
86
43
  ```
87
44
 
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:
45
+ Or as a dev dependency
91
46
 
92
47
  ```bash
93
- curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash -s -- --force --tag v0.0.1 --to ~/bin
48
+ uv add --dev changesets
94
49
  ```
95
50
 
96
- ### From Source with [Go](https://go.dev/)
51
+ Or run directly with uvx (no install required):
97
52
 
98
53
  ```bash
99
- go install github.com/dworthen/changelog@latest
54
+ uvx --from changesets changelog <command>
100
55
  ```
101
56
 
102
- ## Getting Started
57
+ #### **GitHub Releases**
103
58
 
104
- Within a project directory, run `changelog init`.
59
+ Download pre-built binaries from [GitHub Releases](https://github.com/dworthen/changelog/releases).
105
60
 
106
- ### 1. Current Version
61
+ Available platforms:
107
62
 
108
- ![changelog version](docs/images/changelog-version.png)
63
+ | Platform | Architecture |
64
+ | ------------ | ------------ |
65
+ | Linux | x64, arm64 |
66
+ | Linux (musl) | x64, arm64 |
67
+ | macOS | x64, arm64 |
68
+ | Windows | x64 |
109
69
 
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.
70
+ <!-- tabs:end -->
111
71
 
112
- ### 2. Commit changelog entries
72
+ ## Initialize
113
73
 
114
- ![changelog commit entries](docs/images/changelog-commit-entries.png)
74
+ Run `changelog init` in your project root to set up the `.changelog` directory:
115
75
 
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
- ![changelog commit apply](docs/images/changelog-commit-apply.png)
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
- ![changelog tag](docs/images/changelog-tag.png)
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)
76
+ ```bash
77
+ changelog init
78
+ ```
133
79
 
134
- ![changelog tag format](docs/images/changelog-tag-format.png)
80
+ You'll be prompted for:
135
81
 
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.
82
+ ```
83
+ ? Current version: 0.1.0
84
+ ? Changelog file path: CHANGELOG.md
85
+ ? Main git branch: main
86
+ Enter post-apply commands (leave blank to finish):
87
+ ? Post-apply command: npm install
88
+ ? Post-apply command (1 added):
89
+ ✓ Initialized .changelog directory
90
+ ```
137
91
 
138
- ### 6. Version files
92
+ This creates the following structure:
139
93
 
140
- ![changelog version files](docs/images/changelog-version-files.png)
94
+ ```
95
+ .changelog/
96
+ ├── config.yaml
97
+ ├── next/
98
+ │ └── .gitkeep
99
+ ├── releases/
100
+ │ └── .gitkeep
101
+ └── templates/
102
+ ├── header.md
103
+ ├── body.eta
104
+ └── footer.md
105
+ ```
141
106
 
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.
107
+ ## Add an Entry
143
108
 
144
- > [!WARNING]
145
- > Currently, only JSON files are supported.
109
+ When you make a notable change, run `changelog add`:
146
110
 
147
- ### Config
111
+ ```bash
112
+ changelog add
113
+ ```
148
114
 
149
- `changelog init` creates a `.changelog` directory and the following two files.
115
+ Select a change type and provide a description:
150
116
 
151
- **config.json**
117
+ ```
118
+ ? Change type: Add - Add a new feature. Minor version bump.
119
+ ? Description: Support for YAML configuration files
120
+ ✓ Added changelog entry: .changelog/next/1740000000000.yaml
121
+ ✓ Updated CHANGELOG.md
122
+ ```
152
123
 
153
- Describes the config the `init` command walks through.
124
+ A YAML file is created in `.changelog/next/`:
154
125
 
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
- }
126
+ ```yaml
127
+ timestamp: 1740000000000
128
+ type: Add
129
+ description: Support for YAML configuration files
177
130
  ```
178
131
 
179
- **changelogTemplate.hbs**
132
+ The changelog file is automatically regenerated with an **Unreleased** section so you can preview changes at any time.
180
133
 
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.
134
+ ## Apply a Release
182
135
 
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.
136
+ When you're ready to release, run `changelog apply`:
189
137
 
190
- ```md
191
- ## {{version}}
192
- {{#if majorChanges}}
138
+ ```bash
139
+ changelog apply
140
+ ```
193
141
 
194
- ### Major Changes
142
+ This computes the version bump, creates the release, and updates your project:
195
143
 
196
- {{#each majorChanges}}
197
- - {{shortSha}}: {{description}}
198
- {{~/each}}
199
- {{/if}}
200
- {{#if minorChanges}}
144
+ ```
145
+ Updated version in package.json to 0.2.0
146
+ ✓ Applied version 0.2.0
147
+ ✓ Updated CHANGELOG.md
148
+ Running post-apply command: npm install
149
+ ? Commit changes and tag the commit? Yes
150
+ ✓ Committed and tagged version 0.2.0
151
+ ```
201
152
 
202
- ### Minor Changes
153
+ The version bump is determined by the change types present:
203
154
 
204
- {{#each minorChanges}}
205
- - {{shortSha}}: {{description}}
206
- {{~/each}}
207
- {{/if}}
208
- {{#if patchChanges}}
155
+ | Change Types | Bump |
156
+ | -------------- | ----- |
157
+ | Change, Remove | Major |
158
+ | Add, Deprecate | Minor |
159
+ | Fix | Patch |
160
+ | Internal | None |
209
161
 
210
- ### Patch Changes
162
+ After applying, push the commit and tag:
211
163
 
212
- {{#each patchChanges}}
213
- - {{shortSha}}: {{description}}
214
- {{/each}}
215
- {{~/if}}
164
+ ```bash
165
+ git push origin main --follow-tags
216
166
  ```
167
+
168
+ [Full documentation](https://dworthen.github.io/changelog)
package/bin/changelog CHANGED
Binary file
package/index.js CHANGED
@@ -1,7 +1,11 @@
1
- import path from "node:path";
2
1
 
3
- export default function run() {
4
- const dirname = import.meta.dirname;
5
- const bin = path.join(dirname, "bin", "changelog");
6
- return bin;
2
+ import { join } from "node:path";
3
+ import { existsSync } from "node:fs";
4
+
5
+ export function getBinPath() {
6
+ const binPath = join(import.meta.dirname, "bin", "changelog");
7
+ if (!existsSync(binPath)) {
8
+ throw new Error(`Binary not found at expected path: ${binPath}`);
9
+ }
10
+ return binPath;
7
11
  }
package/package.json CHANGED
@@ -1,39 +1,26 @@
1
1
  {
2
2
  "name": "@d-dev/changelog-darwin-x64",
3
- "version": "0.4.0",
4
- "type": "module",
5
- "author": "Derek Worthen <worthend.derek@gmail.com>",
3
+ "version": "1.0.0",
4
+ "description": "A CLI tool for managing changelogs in your project",
6
5
  "license": "MIT",
7
- "repository": "github:dworthen/changelog",
8
- "description": "Git-based changelog manager for JavaScript, Python, and Go projects.",
9
- "keywords": [
10
- "changelog",
11
- "git",
12
- "javascript",
13
- "python",
14
- "go"
15
- ],
16
- "main": "index.js",
6
+ "type": "module",
17
7
  "exports": {
18
8
  ".": {
19
9
  "import": "./index.js"
20
10
  },
21
11
  "./package.json": "./package.json"
22
12
  },
13
+ "files": [
14
+ "package.json",
15
+ "index.js",
16
+ "README.md",
17
+ "LICENSE",
18
+ "bin"
19
+ ],
23
20
  "os": [
24
21
  "darwin"
25
22
  ],
26
23
  "cpu": [
27
24
  "x64"
28
- ],
29
- "files": [
30
- "package.json",
31
- "README.md",
32
- "license",
33
- "bin",
34
- "index.js"
35
- ],
36
- "scripts": {
37
- "test": "echo \"Error: no test specified\" && exit 1"
38
- }
25
+ ]
39
26
  }