changesets 0.2.0__tar.gz → 0.4.0__tar.gz

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.
@@ -0,0 +1,232 @@
1
+ Metadata-Version: 2.4
2
+ Name: changesets
3
+ Version: 0.4.0
4
+ Summary: Git-based changelog manager for JavaScript, Python, and Go projects.
5
+ Project-URL: Repository, https://github.com/dworthen/changelog
6
+ Author-email: Derek Worthen <worthend.derek@gmail.com>
7
+ License-Expression: MIT
8
+ Requires-Python: >=3.11
9
+ Requires-Dist: changesets-darwin-arm64==0.4.0; sys_platform == 'darwin' and platform_machine == 'arm64'
10
+ Requires-Dist: changesets-darwin-x64==0.4.0; sys_platform == 'darwin' and platform_machine == 'x86_64'
11
+ Requires-Dist: changesets-linux-arm64==0.4.0; sys_platform == 'linux' and platform_machine == 'aarch64'
12
+ Requires-Dist: changesets-linux-x64==0.4.0; sys_platform == 'linux' and platform_machine == 'x86_64'
13
+ Requires-Dist: changesets-win32-arm64==0.4.0; sys_platform == 'win32' and platform_machine == 'ARM64'
14
+ Requires-Dist: changesets-win32-x64==0.4.0; sys_platform == 'win32' and platform_machine == 'AMD64'
15
+ Description-Content-Type: text/markdown
16
+
17
+ # Changelog
18
+
19
+ Simple changelog management for projects using [semantic versioning](https://semver.org/) and git.
20
+
21
+ ## Example
22
+
23
+ ### Add
24
+
25
+ Add a changelog entry describing a set of changes.
26
+
27
+ ```bash
28
+ changelog add
29
+ ```
30
+
31
+ ![changelog add](docs/images/changelog-add.gif)
32
+
33
+ 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.
34
+
35
+ > [!NOTE]
36
+ > 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`.
37
+
38
+ ### Apply
39
+
40
+ 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.
41
+
42
+ ```bash
43
+ changelog apply
44
+ ```
45
+
46
+ ![changelog apply](docs/images/changelog-apply.gif)
47
+
48
+ The resulting `CHANGELOG.md` file.
49
+
50
+ ```md
51
+ ## 0.2.0
52
+
53
+ ### Minor Changes
54
+
55
+ - a07c8dd: Describe a minor change.
56
+ ```
57
+
58
+ Running `git tag` shows that a new tag, `v0.2.0` has been applied.
59
+
60
+ ## Features
61
+
62
+ - Store and track changelog descriptions per commit
63
+ - Apply changelog entries to `CHANGELOG.md`
64
+ - Sync version fields in specified JSON files such as the version field in a package.json file.
65
+
66
+ ## TODO
67
+
68
+ - Add support for prereleases
69
+ - Add support for monorepos
70
+ - Add support for other version file formats (yaml, toml, etc.)
71
+
72
+ ## Install
73
+
74
+ ### NPM
75
+
76
+ ```
77
+ npm install @d-dev/changelog -g
78
+ ```
79
+
80
+ ### Binaries
81
+
82
+ #### Windows
83
+
84
+ ```powershell
85
+ curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 | pwsh -Command -
86
+ ```
87
+
88
+ 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.
89
+
90
+ Running the installer with additional flags:
91
+
92
+ ```powershell
93
+ curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.ps1 -o install.ps1 &&
94
+ pwsh -File install.ps1 -force -tag v0.0.1 -to ~/bin &&
95
+ rm install.ps1
96
+ ```
97
+
98
+ #### Linux/Darwin
99
+
100
+ ```bash
101
+ curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash
102
+ ```
103
+
104
+ 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.
105
+
106
+ Running the installer with additional flags:
107
+
108
+ ```bash
109
+ curl -sSfL https://raw.githubusercontent.com/dworthen/changelog/main/scripts/install.sh | bash -s -- --force --tag v0.0.1 --to ~/bin
110
+ ```
111
+
112
+ ### From Source with [Go](https://go.dev/)
113
+
114
+ ```bash
115
+ go install github.com/dworthen/changelog@latest
116
+ ```
117
+
118
+ ## Getting Started
119
+
120
+ Within a project directory, run `changelog init`.
121
+
122
+ ### 1. Current Version
123
+
124
+ ![changelog version](docs/images/changelog-version.png)
125
+
126
+ 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.
127
+
128
+ ### 2. Commit changelog entries
129
+
130
+ ![changelog commit entries](docs/images/changelog-commit-entries.png)
131
+
132
+ 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.
133
+
134
+ If no, then `changelog add` creates a changelog entry but does not commit the files or run any git commands.
135
+
136
+ ### 3. Commit changelog apply
137
+
138
+ ![changelog commit apply](docs/images/changelog-commit-apply.png)
139
+
140
+ `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`.
141
+
142
+ ### 4. Tag commit (not presented if previous answer == No)
143
+
144
+ ![changelog tag](docs/images/changelog-tag.png)
145
+
146
+ If yes, `changelog apply` tags the commit created. This option is ignored if the answer to the previous question is No.
147
+
148
+ ### 5. Tag format (not presented if either of the previous two answers == No)
149
+
150
+ ![changelog tag format](docs/images/changelog-tag-format.png)
151
+
152
+ 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.
153
+
154
+ ### 6. Version files
155
+
156
+ ![changelog version files](docs/images/changelog-version-files.png)
157
+
158
+ 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.
159
+
160
+ > [!WARNING]
161
+ > Currently, only JSON files are supported.
162
+
163
+ ### Config
164
+
165
+ `changelog init` creates a `.changelog` directory and the following two files.
166
+
167
+ **config.json**
168
+
169
+ Describes the config the `init` command walks through.
170
+
171
+ ```json
172
+ {
173
+ "version": "1.0.0",
174
+ "bumpFiles": [
175
+ {
176
+ "file": "package.json",
177
+ "path": "version"
178
+ },
179
+ {
180
+ "file": "some-json-file.json",
181
+ "path": "path.to.nested"
182
+ }
183
+ ],
184
+ "onAdd": {
185
+ "commitFiles": true
186
+ },
187
+ "onApply": {
188
+ "commitFiles": true,
189
+ "tagCommit": true,
190
+ "tagFormat": "v{{version}}"
191
+ }
192
+ }
193
+ ```
194
+
195
+ **changelogTemplate.hbs**
196
+
197
+ 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.
198
+
199
+ - **version**: The new project version after `changelog apply` finishes.
200
+ - **oldVersion**: The previous project version prior to `changelog apply`.
201
+ - **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.
202
+ - **sha**: The full git commit hash for the change.
203
+ - **shortSha**: The short git commit hash for the change.
204
+ - **description**: Changelog description.
205
+
206
+ ```md
207
+ ## {{version}}
208
+ {{#if majorChanges}}
209
+
210
+ ### Major Changes
211
+
212
+ {{#each majorChanges}}
213
+ - {{shortSha}}: {{description}}
214
+ {{~/each}}
215
+ {{/if}}
216
+ {{#if minorChanges}}
217
+
218
+ ### Minor Changes
219
+
220
+ {{#each minorChanges}}
221
+ - {{shortSha}}: {{description}}
222
+ {{~/each}}
223
+ {{/if}}
224
+ {{#if patchChanges}}
225
+
226
+ ### Patch Changes
227
+
228
+ {{#each patchChanges}}
229
+ - {{shortSha}}: {{description}}
230
+ {{/each}}
231
+ {{~/if}}
232
+ ```
@@ -0,0 +1,216 @@
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
+ ![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
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
+ ![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.
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
+ ![changelog version](docs/images/changelog-version.png)
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
+ ![changelog commit entries](docs/images/changelog-commit-entries.png)
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
+ ![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)
133
+
134
+ ![changelog tag format](docs/images/changelog-tag-format.png)
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
+ ![changelog version files](docs/images/changelog-version-files.png)
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
+ ```
@@ -1,18 +1,18 @@
1
1
  [project]
2
2
  name = "changesets"
3
- version = "0.2.0"
3
+ version = "0.4.0"
4
4
  description = "Git-based changelog manager for JavaScript, Python, and Go projects."
5
5
  license = "MIT"
6
6
  readme = "README.md"
7
7
  authors = [{ name = "Derek Worthen", email = "worthend.derek@gmail.com" }]
8
8
  requires-python = ">=3.11"
9
9
  dependencies = [
10
- "changesets-win32-x64==0.2.0; sys_platform == 'win32' and platform_machine == 'AMD64'",
11
- "changesets-win32-arm64==0.2.0; sys_platform == 'win32' and platform_machine == 'ARM64'",
12
- "changesets-linux-x64==0.2.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
13
- "changesets-linux-arm64==0.2.0; sys_platform == 'linux' and platform_machine == 'aarch64'",
14
- "changesets-darwin-x64==0.2.0; sys_platform == 'darwin' and platform_machine == 'x86_64'",
15
- "changesets-darwin-arm64==0.2.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
10
+ "changesets-win32-x64==0.4.0; sys_platform == 'win32' and platform_machine == 'AMD64'",
11
+ "changesets-win32-arm64==0.4.0; sys_platform == 'win32' and platform_machine == 'ARM64'",
12
+ "changesets-linux-x64==0.4.0; sys_platform == 'linux' and platform_machine == 'x86_64'",
13
+ "changesets-linux-arm64==0.4.0; sys_platform == 'linux' and platform_machine == 'aarch64'",
14
+ "changesets-darwin-x64==0.4.0; sys_platform == 'darwin' and platform_machine == 'x86_64'",
15
+ "changesets-darwin-arm64==0.4.0; sys_platform == 'darwin' and platform_machine == 'arm64'",
16
16
  ]
17
17
 
18
18
  [project.urls]
@@ -23,4 +23,4 @@ requires = ["hatchling"]
23
23
  build-backend = "hatchling.build"
24
24
 
25
25
  [project.scripts]
26
- changelog = 'py_changelog.__init__:run'
26
+ changelog = 'changesets.__init__:run'
changesets-0.2.0/PKG-INFO DELETED
@@ -1,17 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: changesets
3
- Version: 0.2.0
4
- Summary: Git-based changelog manager for JavaScript, Python, and Go projects.
5
- Project-URL: Repository, https://github.com/dworthen/changelog
6
- Author-email: Derek Worthen <worthend.derek@gmail.com>
7
- License-Expression: MIT
8
- Requires-Python: >=3.11
9
- Requires-Dist: changesets-darwin-arm64==0.2.0; sys_platform == 'darwin' and platform_machine == 'arm64'
10
- Requires-Dist: changesets-darwin-x64==0.2.0; sys_platform == 'darwin' and platform_machine == 'x86_64'
11
- Requires-Dist: changesets-linux-arm64==0.2.0; sys_platform == 'linux' and platform_machine == 'aarch64'
12
- Requires-Dist: changesets-linux-x64==0.2.0; sys_platform == 'linux' and platform_machine == 'x86_64'
13
- Requires-Dist: changesets-win32-arm64==0.2.0; sys_platform == 'win32' and platform_machine == 'ARM64'
14
- Requires-Dist: changesets-win32-x64==0.2.0; sys_platform == 'win32' and platform_machine == 'AMD64'
15
- Description-Content-Type: text/markdown
16
-
17
- # Changelog2
@@ -1 +0,0 @@
1
- # Changelog2
File without changes
File without changes