better-commits 1.14.0 → 1.15.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.
- package/dist/branch.js +1 -1
- package/dist/index.js +5 -1
- package/dist/init.js +1 -1
- package/dist/utils.js +1 -1
- package/dist/zod-state.js +1 -1
- package/package.json +1 -1
- package/readme.md +7 -6
- package/src/index.ts +5 -1
- package/src/zod-state.ts +1 -1
package/dist/branch.js
CHANGED
|
@@ -272,7 +272,7 @@ var Config = import_zod2.z.object({
|
|
|
272
272
|
append_hashtag: import_zod2.z.boolean().default(false),
|
|
273
273
|
prepend_hashtag: import_zod2.z.enum(["Never", "Always", "Prompt"]).default("Never"),
|
|
274
274
|
surround: import_zod2.z.enum(["", "()", "[]", "{}"]).default(""),
|
|
275
|
-
title_position: import_zod2.z.enum(["start", "end", "before-colon"]).default("start")
|
|
275
|
+
title_position: import_zod2.z.enum(["start", "end", "before-colon", "beginning"]).default("start")
|
|
276
276
|
}).default({}),
|
|
277
277
|
commit_title: import_zod2.z.object({
|
|
278
278
|
max_size: import_zod2.z.number().positive().default(70)
|
package/dist/index.js
CHANGED
|
@@ -336,7 +336,7 @@ var Config = import_zod2.z.object({
|
|
|
336
336
|
append_hashtag: import_zod2.z.boolean().default(false),
|
|
337
337
|
prepend_hashtag: import_zod2.z.enum(["Never", "Always", "Prompt"]).default("Never"),
|
|
338
338
|
surround: import_zod2.z.enum(["", "()", "[]", "{}"]).default(""),
|
|
339
|
-
title_position: import_zod2.z.enum(["start", "end", "before-colon"]).default("start")
|
|
339
|
+
title_position: import_zod2.z.enum(["start", "end", "before-colon", "beginning"]).default("start")
|
|
340
340
|
}).default({}),
|
|
341
341
|
commit_title: import_zod2.z.object({
|
|
342
342
|
max_size: import_zod2.z.number().positive().default(70)
|
|
@@ -702,6 +702,10 @@ function build_commit_string(commit_state, config, colorize = false, escape_quot
|
|
|
702
702
|
const close_token = surround.charAt(1);
|
|
703
703
|
title_ticket = `${open_token}${commit_state.ticket}${close_token}`;
|
|
704
704
|
}
|
|
705
|
+
const position_beginning = config.check_ticket.title_position === "beginning";
|
|
706
|
+
if (title_ticket && config.check_ticket.add_to_title && position_beginning) {
|
|
707
|
+
commit_string = `${colorize ? import_picocolors3.default.magenta(title_ticket) : title_ticket} ${commit_string}`;
|
|
708
|
+
}
|
|
705
709
|
const position_before_colon = config.check_ticket.title_position === "before-colon";
|
|
706
710
|
if (title_ticket && config.check_ticket.add_to_title && position_before_colon) {
|
|
707
711
|
const spacing = commit_state.scope || commit_state.type && !config.check_ticket.surround ? " " : "";
|
package/dist/init.js
CHANGED
|
@@ -216,7 +216,7 @@ var Config = import_zod2.z.object({
|
|
|
216
216
|
append_hashtag: import_zod2.z.boolean().default(false),
|
|
217
217
|
prepend_hashtag: import_zod2.z.enum(["Never", "Always", "Prompt"]).default("Never"),
|
|
218
218
|
surround: import_zod2.z.enum(["", "()", "[]", "{}"]).default(""),
|
|
219
|
-
title_position: import_zod2.z.enum(["start", "end", "before-colon"]).default("start")
|
|
219
|
+
title_position: import_zod2.z.enum(["start", "end", "before-colon", "beginning"]).default("start")
|
|
220
220
|
}).default({}),
|
|
221
221
|
commit_title: import_zod2.z.object({
|
|
222
222
|
max_size: import_zod2.z.number().positive().default(70)
|
package/dist/utils.js
CHANGED
|
@@ -142,7 +142,7 @@ var Config = import_zod.z.object({
|
|
|
142
142
|
append_hashtag: import_zod.z.boolean().default(false),
|
|
143
143
|
prepend_hashtag: import_zod.z.enum(["Never", "Always", "Prompt"]).default("Never"),
|
|
144
144
|
surround: import_zod.z.enum(["", "()", "[]", "{}"]).default(""),
|
|
145
|
-
title_position: import_zod.z.enum(["start", "end", "before-colon"]).default("start")
|
|
145
|
+
title_position: import_zod.z.enum(["start", "end", "before-colon", "beginning"]).default("start")
|
|
146
146
|
}).default({}),
|
|
147
147
|
commit_title: import_zod.z.object({
|
|
148
148
|
max_size: import_zod.z.number().positive().default(70)
|
package/dist/zod-state.js
CHANGED
|
@@ -214,7 +214,7 @@ var Config = import_zod2.z.object({
|
|
|
214
214
|
append_hashtag: import_zod2.z.boolean().default(false),
|
|
215
215
|
prepend_hashtag: import_zod2.z.enum(["Never", "Always", "Prompt"]).default("Never"),
|
|
216
216
|
surround: import_zod2.z.enum(["", "()", "[]", "{}"]).default(""),
|
|
217
|
-
title_position: import_zod2.z.enum(["start", "end", "before-colon"]).default("start")
|
|
217
|
+
title_position: import_zod2.z.enum(["start", "end", "before-colon", "beginning"]).default("start")
|
|
218
218
|
}).default({}),
|
|
219
219
|
commit_title: import_zod2.z.object({
|
|
220
220
|
max_size: import_zod2.z.number().positive().default(70)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-commits",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.15.0",
|
|
5
5
|
"description": "A CLI for creating better commits following the conventional commits specification",
|
|
6
6
|
"author": "Erik Verduin (https://github.com/everduin94)",
|
|
7
7
|
"keywords": [
|
package/readme.md
CHANGED
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/Everduin94/better-commits)
|
|
6
6
|
[](https://www.npmjs.com/package/better-commits)
|
|
7
|
-
|
|
8
|
-
<img alt="Issues" src="https://img.shields.io/github/issues/everduin94/better-commits?style=for-the-badge&logo=gitbook&color=cba6f7&logoColor=D9E0EE&labelColor=302D41"></a>
|
|
9
|
-
|
|
7
|
+
[](https://discord.gg/grHVnZwYup)
|
|
10
8
|
</h3>
|
|
11
9
|
|
|
12
10
|
<p align="center">
|
|
@@ -266,8 +264,8 @@ Better-commits (& better-branch) are highly flexible with sane defaults. These o
|
|
|
266
264
|
</details>
|
|
267
265
|
|
|
268
266
|
> [!NOTE]<br>
|
|
269
|
-
> Some properties
|
|
270
|
-
> See *
|
|
267
|
+
> Some properties allow a set of specifc string values
|
|
268
|
+
> - See *config file explanations* for possible values
|
|
271
269
|
|
|
272
270
|
### 🔭 Config File Explanations
|
|
273
271
|
|
|
@@ -307,7 +305,7 @@ Expand to see explanations and possible values
|
|
|
307
305
|
| `check_ticket.add_to_title` | If true add ticket to title |
|
|
308
306
|
| `check_ticket.append_hashtag` | **Deprecated**: see prepend_hashtag |
|
|
309
307
|
| `check_ticket.prepend_hashtag` | "Never" (default), "Prompt", or "Always" |
|
|
310
|
-
| `check_ticket.title_position` | "start" (of description) (default), "end", "before-colon" |
|
|
308
|
+
| `check_ticket.title_position` | "start" (of description) (default), "end", "before-colon", "beginning" (of the entire commit title) |
|
|
311
309
|
| `check_ticket.surround` | "" (default), "[]", "()", "{}" - Wraps ticket in title |
|
|
312
310
|
| `commit_title.max_size` | Max size of title including scope, type, etc... |
|
|
313
311
|
| `commit_body.enable` | If true include body |
|
|
@@ -420,6 +418,9 @@ Setting `confirm_with_editor=true` will allow you to edit/confirm a commit with
|
|
|
420
418
|
- For example, to edit with Neovim: `git config --global core.editor "nvim"`
|
|
421
419
|
- For VS Code, `git config --global core.editor "code -n --wait"`
|
|
422
420
|
|
|
421
|
+
> [!NOTE]<br>
|
|
422
|
+
> Enjoy learning, open source technology, and note-taking? [Join our Discord!](https://discord.gg/grHVnZwYup)
|
|
423
|
+
|
|
423
424
|
You can add this badge to your repository to display that you're using a better-commits repository config
|
|
424
425
|
|
|
425
426
|
| Markdown | Result |
|
package/src/index.ts
CHANGED
|
@@ -268,6 +268,11 @@ function build_commit_string(commit_state: z.infer<typeof CommitState>,
|
|
|
268
268
|
const close_token = surround.charAt(1);
|
|
269
269
|
title_ticket = `${open_token}${commit_state.ticket}${close_token}`
|
|
270
270
|
}
|
|
271
|
+
|
|
272
|
+
const position_beginning = config.check_ticket.title_position === 'beginning';
|
|
273
|
+
if (title_ticket && config.check_ticket.add_to_title && position_beginning) {
|
|
274
|
+
commit_string = `${colorize ? color.magenta(title_ticket) : title_ticket} ${commit_string}`;
|
|
275
|
+
}
|
|
271
276
|
|
|
272
277
|
const position_before_colon = config.check_ticket.title_position === "before-colon"
|
|
273
278
|
if (title_ticket && config.check_ticket.add_to_title && position_before_colon) {
|
|
@@ -343,4 +348,3 @@ function build_commit_string(commit_state: z.infer<typeof CommitState>,
|
|
|
343
348
|
|
|
344
349
|
return commit_string;
|
|
345
350
|
}
|
|
346
|
-
|
package/src/zod-state.ts
CHANGED
|
@@ -99,7 +99,7 @@ export const Config = z
|
|
|
99
99
|
append_hashtag: z.boolean().default(false),
|
|
100
100
|
prepend_hashtag: z.enum(['Never', 'Always', 'Prompt']).default("Never"),
|
|
101
101
|
surround: z.enum(["", "()", "[]", "{}"]).default(""),
|
|
102
|
-
title_position: z.enum(["start", "end", "before-colon"]).default("start"),
|
|
102
|
+
title_position: z.enum(["start", "end", "before-colon", "beginning"]).default("start"),
|
|
103
103
|
})
|
|
104
104
|
.default({}),
|
|
105
105
|
commit_title: z
|