better-commits 1.20.0-cli-flags → 1.20.1-temp.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 (71) hide show
  1. package/dist/branch.js +1 -1
  2. package/dist/{chunk-SIF4LZUS.js → chunk-LPU7O52G.js} +1 -1
  3. package/dist/chunk-QPUTIRGU.js +245 -0
  4. package/dist/index.js +2 -2
  5. package/dist/init.js +1 -1
  6. package/package.json +7 -1
  7. package/readme.md +141 -173
  8. package/.better-commits.json +0 -52
  9. package/.github/workflows/publish.yml +0 -34
  10. package/.github/workflows/test.yml +0 -27
  11. package/.opencode/package-lock.json +0 -115
  12. package/.opencode/plans/cli-args.md +0 -182
  13. package/.prettierignore +0 -5
  14. package/.prettierrc +0 -1
  15. package/.svelte-kit/ambient.d.ts +0 -289
  16. package/.svelte-kit/generated/client/app.js +0 -28
  17. package/.svelte-kit/generated/client/matchers.js +0 -1
  18. package/.svelte-kit/generated/client/nodes/0.js +0 -1
  19. package/.svelte-kit/generated/client/nodes/1.js +0 -1
  20. package/.svelte-kit/tsconfig.json +0 -49
  21. package/0001-feat-branch-124-update-worktrees-feature.patch +0 -316
  22. package/dist/chunk-OFJCRS3N.js +0 -4
  23. package/docs/ai-skills.yaml +0 -48
  24. package/docs/clack.md +0 -143
  25. package/docs/valibot.md +0 -228
  26. package/src/args.test.ts +0 -102
  27. package/src/args.ts +0 -106
  28. package/src/branch-args.test.ts +0 -72
  29. package/src/branch-args.ts +0 -106
  30. package/src/branch-help.ts +0 -114
  31. package/src/branch.ts +0 -95
  32. package/src/git.ts +0 -60
  33. package/src/help.ts +0 -131
  34. package/src/index.test.ts +0 -7
  35. package/src/index.ts +0 -100
  36. package/src/init.ts +0 -25
  37. package/src/prompts/branch-checkout.prompt.ts +0 -36
  38. package/src/prompts/branch-confirm.prompt.ts +0 -134
  39. package/src/prompts/branch-description.prompt.ts +0 -37
  40. package/src/prompts/branch-runnable.ts +0 -13
  41. package/src/prompts/branch-ticket.prompt.ts +0 -41
  42. package/src/prompts/branch-type.prompt.ts +0 -43
  43. package/src/prompts/branch-user.prompt.ts +0 -50
  44. package/src/prompts/branch-version.prompt.ts +0 -41
  45. package/src/prompts/commit-body.prompt.ts +0 -57
  46. package/src/prompts/commit-confirm.prompt.ts +0 -119
  47. package/src/prompts/commit-footer.prompt.ts +0 -195
  48. package/src/prompts/commit-scope.prompt.ts +0 -73
  49. package/src/prompts/commit-status.prompt.ts +0 -75
  50. package/src/prompts/commit-ticket.prompt.ts +0 -82
  51. package/src/prompts/commit-title.prompt.ts +0 -98
  52. package/src/prompts/commit-type.prompt.ts +0 -93
  53. package/src/prompts/runnable.ts +0 -13
  54. package/src/utils/build-branch.test.ts +0 -141
  55. package/src/utils/build-branch.ts +0 -46
  56. package/src/utils/build-commit-string.test.ts +0 -253
  57. package/src/utils/build-commit-string.ts +0 -158
  58. package/src/utils/commit-title-size.ts +0 -24
  59. package/src/utils/infer.test.ts +0 -83
  60. package/src/utils/infer.ts +0 -114
  61. package/src/utils/messages.ts +0 -25
  62. package/src/utils/no-interactive-branch-validation.test.ts +0 -170
  63. package/src/utils/no-interactive-validation.test.ts +0 -174
  64. package/src/utils/no-interactive-validation.ts +0 -190
  65. package/src/utils.ts +0 -219
  66. package/src/valibot-consts.ts +0 -114
  67. package/src/valibot-state.test.ts +0 -48
  68. package/src/valibot-state.ts +0 -265
  69. package/tsconfig.json +0 -15
  70. package/tsup.config.ts +0 -12
  71. package/vitest.config.ts +0 -8
package/src/utils.ts DELETED
@@ -1,219 +0,0 @@
1
- import * as p from "@clack/prompts";
2
- import { execSync } from "child_process";
3
- import fs from "fs";
4
- import { homedir } from "os";
5
- import color from "picocolors";
6
- import { InferOutput, ValiError, parse } from "valibot";
7
- import { Config } from "./valibot-state";
8
- import { V_BRANCH_ACTIONS } from "./valibot-consts";
9
- import { flags } from "./args";
10
- import Configstore from "configstore";
11
-
12
- export const CONFIG_FILE_NAME = ".better-commits.json";
13
- export const SPACE_TO_SELECT = `${color.dim("(<space> to select)")}`;
14
- export const A_FOR_ALL = `${color.dim(
15
- "(<space> to select, <a> to select all)",
16
- )}`;
17
- export const OPTIONAL_PROMPT = `${color.dim("(optional)")}`;
18
- export const COMMIT_FOOTER_OPTIONS = [
19
- {
20
- value: "closes",
21
- label: "closes <issue/ticket>",
22
- hint: "Attempts to infer ticket from branch",
23
- },
24
- {
25
- value: "trailer",
26
- label: "trailer",
27
- hint: "Appends trailer based on commit type",
28
- },
29
- {
30
- value: "breaking-change",
31
- label: "breaking change",
32
- hint: "Add breaking change",
33
- },
34
- { value: "deprecated", label: "deprecated", hint: "Add deprecated change" },
35
- { value: "custom", label: "custom", hint: "Add a custom footer" },
36
- ];
37
- export const BRANCH_ACTION_OPTIONS: {
38
- value: InferOutput<typeof V_BRANCH_ACTIONS>;
39
- label: string;
40
- hint?: string;
41
- }[] = [
42
- { value: "branch", label: "Branch" },
43
- { value: "worktree", label: "Worktree" },
44
- ];
45
-
46
- export const NOOP_PROMPT_CACHE = {
47
- get: () => "",
48
- set: (key: string, value: string) => {},
49
- clear: () => {},
50
- } as unknown as Configstore;
51
-
52
- export type ConfigSource = "repository" | "global" | "none";
53
-
54
- export type LoadedSetup = {
55
- config: InferOutput<typeof Config>;
56
- config_source: ConfigSource;
57
- };
58
-
59
- /* LOAD */
60
- export function load_setup(
61
- cli_name = " better-commits ",
62
- git_args = flags.git_args,
63
- ): LoadedSetup {
64
- console.clear();
65
- p.intro(`${color.bgCyan(color.black(cli_name))}`);
66
-
67
- let global_config = null;
68
- const home_path = get_default_config_path();
69
- if (fs.existsSync(home_path)) {
70
- global_config = read_config_from_path(home_path);
71
- }
72
-
73
- const root = get_git_root(git_args);
74
- const root_path = `${root}/${CONFIG_FILE_NAME}`;
75
- if (fs.existsSync(root_path)) {
76
- p.log.step("Reading from Repository Config");
77
- const repo_config = read_config_from_path(root_path);
78
- return {
79
- config: global_config
80
- ? {
81
- ...repo_config,
82
- overrides: global_config.overrides.shell
83
- ? global_config.overrides
84
- : repo_config.overrides,
85
- confirm_with_editor: global_config.confirm_with_editor,
86
- cache_last_value: global_config.cache_last_value,
87
- }
88
- : repo_config,
89
- config_source: "repository",
90
- };
91
- }
92
-
93
- if (global_config) {
94
- p.log.step("Reading from Global Config");
95
- return {
96
- config: global_config,
97
- config_source: "global",
98
- };
99
- }
100
-
101
- const default_config = parse(Config, {});
102
- p.log.step(
103
- "Config not found. Generating default .better-commit.json at $HOME",
104
- );
105
- fs.writeFileSync(home_path, JSON.stringify(default_config, null, 4));
106
- return {
107
- config: default_config,
108
- config_source: "none",
109
- };
110
- }
111
-
112
- function read_config_from_path(config_path: string) {
113
- let res = null;
114
- try {
115
- res = JSON.parse(fs.readFileSync(config_path, "utf8"));
116
- } catch (err) {
117
- p.log.error("Invalid JSON file. Exiting.\n" + err);
118
- process.exit(0);
119
- }
120
-
121
- return validate_config(res);
122
- }
123
-
124
- function validate_config(config: unknown): InferOutput<typeof Config> {
125
- try {
126
- return parse(Config, config);
127
- } catch (err: any) {
128
- if (err instanceof ValiError) {
129
- const first_issue_path = err.issues[0].path ?? [];
130
- const dot_path = first_issue_path
131
- .map((item: { key?: unknown }) => item.key)
132
- .filter(
133
- (key: unknown): key is string | number =>
134
- typeof key === "string" || typeof key === "number",
135
- )
136
- .join(".");
137
- p.log.error(
138
- `Invalid Configuration: ${color.red(dot_path)}\n` + err.message,
139
- );
140
- }
141
- process.exit(0);
142
- }
143
- }
144
- /* END LOAD */
145
-
146
- /*
147
- rev-parse will fail in a --bare repository root
148
- */
149
- export function get_git_root(git_args = flags.git_args): string {
150
- let path = ".";
151
- try {
152
- path = execSync(`git ${git_args} rev-parse --show-toplevel`)
153
- .toString()
154
- .trim();
155
- } catch (err) {
156
- p.log.warn(
157
- "Could not find git root. If in a --bare repository, ignore this warning.",
158
- );
159
- }
160
- return path;
161
- }
162
-
163
- export function get_default_config_path(): string {
164
- return homedir() + "/" + CONFIG_FILE_NAME;
165
- }
166
-
167
- export function get_package_version(): string {
168
- try {
169
- const package_json = JSON.parse(
170
- fs.readFileSync(new URL("../package.json", import.meta.url), "utf8"),
171
- ) as { version?: string };
172
-
173
- return package_json.version ?? "unknown";
174
- } catch {
175
- return "unknown";
176
- }
177
- }
178
-
179
- export function addNewLine(arr: string[], i: number) {
180
- return i === arr.length - 1 ? "" : "\n";
181
- }
182
-
183
- export function clean_commit_title(title: string): string {
184
- const title_trimmed = title.trim();
185
- const remove_period = title_trimmed.endsWith(".");
186
- if (remove_period) {
187
- return title_trimmed.substring(0, title_trimmed.length - 1).trim();
188
- }
189
- return title.trim();
190
- }
191
-
192
- export function get_value_from_cache(
193
- config_store: Configstore,
194
- key: string,
195
- ): string {
196
- try {
197
- return config_store.get(key) ?? "";
198
- } catch (err) {
199
- p.log.warn(
200
- `Could not access ${key} from cache. Check that "~/.config" exists. Set "cache_last_value" to false to disable.`,
201
- );
202
- }
203
-
204
- return "";
205
- }
206
-
207
- export function set_value_cache(
208
- config_store: Configstore,
209
- key: string,
210
- value: string,
211
- ): void {
212
- try {
213
- config_store.set(key, value);
214
- } catch (err) {
215
- p.log.warn(
216
- `Could not access ${key} from cache. Check that "~/.config" exists. Set "cache_last_value" to false to disable.`,
217
- );
218
- }
219
- }
@@ -1,114 +0,0 @@
1
- import * as v from "valibot";
2
-
3
- export const CUSTOM_SCOPE_KEY: "custom" = "custom";
4
- export const FOOTER_OPTION_VALUES: v.InferOutput<typeof V_FOOTER_OPTIONS>[] = [
5
- "closes",
6
- "trailer",
7
- "breaking-change",
8
- "deprecated",
9
- "custom",
10
- ];
11
- export const V_BRANCH_ACTIONS = v.picklist(["branch", "worktree"]);
12
- export const V_FOOTER_OPTIONS = v.picklist([
13
- "closes",
14
- "trailer",
15
- "breaking-change",
16
- "deprecated",
17
- "custom",
18
- ]);
19
- export const V_BRANCH_FIELDS = v.picklist([
20
- "user",
21
- "version",
22
- "type",
23
- "ticket",
24
- "description",
25
- ]);
26
- export const V_BRANCH_CONFIG_FIELDS = v.picklist([
27
- "branch_user",
28
- "branch_version",
29
- "branch_type",
30
- "branch_ticket",
31
- "branch_description",
32
- ]);
33
- export const BRANCH_ORDER_DEFAULTS: v.InferOutput<typeof V_BRANCH_FIELDS>[] = [
34
- "user",
35
- "version",
36
- "type",
37
- "ticket",
38
- "description",
39
- ];
40
-
41
- export const DEFAULT_SCOPE_OPTIONS = [
42
- { value: "app", label: "app" },
43
- { value: "shared", label: "shared" },
44
- { value: "server", label: "server" },
45
- { value: "tools", label: "tools" },
46
- { value: "", label: "none" },
47
- ];
48
-
49
- export const DEFAULT_TYPE_OPTIONS = [
50
- {
51
- value: "feat",
52
- label: "feat",
53
- hint: "A new feature",
54
- emoji: "🌟",
55
- trailer: "Changelog: feature",
56
- },
57
- {
58
- value: "fix",
59
- label: "fix",
60
- hint: "A bug fix",
61
- emoji: "🐛",
62
- trailer: "Changelog: fix",
63
- },
64
- {
65
- value: "docs",
66
- label: "docs",
67
- hint: "Documentation only changes",
68
- emoji: "📚",
69
- trailer: "Changelog: documentation",
70
- },
71
- {
72
- value: "refactor",
73
- label: "refactor",
74
- hint: "A code change that neither fixes a bug nor adds a feature",
75
- emoji: "🔨",
76
- trailer: "Changelog: refactor",
77
- },
78
- {
79
- value: "perf",
80
- label: "perf",
81
- hint: "A code change that improves performance",
82
- emoji: "🚀",
83
- trailer: "Changelog: performance",
84
- },
85
- {
86
- value: "test",
87
- label: "test",
88
- hint: "Adding missing tests or correcting existing tests",
89
- emoji: "🚨",
90
- trailer: "Changelog: test",
91
- },
92
- {
93
- value: "build",
94
- label: "build",
95
- hint: "Changes that affect the build system or external dependencies",
96
- emoji: "🚧",
97
- trailer: "Changelog: build",
98
- },
99
- {
100
- value: "ci",
101
- label: "ci",
102
- hint: "Changes to our CI configuration files and scripts",
103
- emoji: "🤖",
104
- trailer: "Changelog: ci",
105
- },
106
- {
107
- value: "chore",
108
- label: "chore",
109
- hint: "Other changes that do not modify src or test files",
110
- emoji: "🧹",
111
- trailer: "Changelog: chore",
112
- },
113
- { value: "", label: "none" },
114
- ];
@@ -1,48 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { ValiError, parse } from "valibot";
3
- import { Config } from "./valibot-state";
4
-
5
- describe("Config", () => {
6
- it("parses a defaulted config from empty input", () => {
7
- const config = parse(Config, {});
8
-
9
- expect(config.commit_type.initial_value).toBe("feat");
10
- expect(config.commit_scope.initial_value).toBe("app");
11
- expect(config.commit_type.options.length).toBeGreaterThan(0);
12
- expect(config.commit_scope.options.length).toBeGreaterThan(0);
13
- });
14
-
15
- it("adds the custom scope option when custom_scope is enabled", () => {
16
- const config = parse(Config, {
17
- commit_scope: {
18
- custom_scope: true,
19
- initial_value: "custom",
20
- options: [{ value: "app", label: "app" }],
21
- },
22
- });
23
-
24
- expect(config.commit_scope.options.map((option) => option.value)).toContain(
25
- "custom",
26
- );
27
- });
28
-
29
- it("rejects commit_type.initial_value values outside options", () => {
30
- expect(() =>
31
- parse(Config, {
32
- commit_type: {
33
- initial_value: "unknown",
34
- options: [{ value: "feat", label: "feat" }],
35
- },
36
- }),
37
- ).toThrowError(ValiError);
38
-
39
- expect(() =>
40
- parse(Config, {
41
- commit_type: {
42
- initial_value: "unknown",
43
- options: [{ value: "feat", label: "feat" }],
44
- },
45
- }),
46
- ).toThrow(/must exist in options/);
47
- });
48
- });
@@ -1,265 +0,0 @@
1
- import * as v from "valibot";
2
- import {
3
- BRANCH_ORDER_DEFAULTS,
4
- CUSTOM_SCOPE_KEY,
5
- DEFAULT_SCOPE_OPTIONS,
6
- DEFAULT_TYPE_OPTIONS,
7
- FOOTER_OPTION_VALUES,
8
- V_BRANCH_ACTIONS,
9
- V_BRANCH_FIELDS,
10
- V_FOOTER_OPTIONS,
11
- } from "./valibot-consts";
12
-
13
- const CommitTypeConfig = v.pipe(
14
- v.optional(
15
- v.object({
16
- enable: v.optional(v.boolean(), true),
17
- initial_value: v.optional(v.string(), "feat"),
18
- max_items: v.optional(v.pipe(v.number(), v.minValue(1)), 20),
19
- infer_type_from_branch: v.optional(v.boolean(), true),
20
- append_emoji_to_label: v.optional(v.boolean(), false),
21
- append_emoji_to_commit: v.optional(v.boolean(), false),
22
- emoji_commit_position: v.optional(
23
- v.picklist(["Start", "After-Colon"]),
24
- "Start",
25
- ),
26
- options: v.optional(
27
- v.array(
28
- v.object({
29
- value: v.string(),
30
- label: v.optional(v.string()),
31
- hint: v.optional(v.string()),
32
- emoji: v.optional(v.pipe(v.string(), v.emoji())),
33
- trailer: v.optional(v.string()),
34
- }),
35
- ),
36
- DEFAULT_TYPE_OPTIONS,
37
- ),
38
- }),
39
- {},
40
- ),
41
- v.rawCheck(({ dataset, addIssue }) => {
42
- if (
43
- dataset.typed &&
44
- !dataset.value.options.some(
45
- (option) => option.value === dataset.value.initial_value,
46
- )
47
- ) {
48
- addIssue({
49
- message: `Type: initial_value "${dataset.value.initial_value}" must exist in options`,
50
- });
51
- }
52
- }),
53
- v.transform((value) => ({
54
- ...value,
55
- options: value.options.map((option) => ({
56
- ...option,
57
- label:
58
- option.emoji && value.append_emoji_to_label
59
- ? `${option.emoji} ${option.label}`
60
- : option.label,
61
- })),
62
- })),
63
- );
64
-
65
- const CommitScopeConfig = v.pipe(
66
- v.optional(
67
- v.object({
68
- enable: v.optional(v.boolean(), true),
69
- custom_scope: v.optional(v.boolean(), false),
70
- max_items: v.optional(v.pipe(v.number(), v.minValue(1)), 20),
71
- initial_value: v.optional(v.string(), "app"),
72
- options: v.optional(
73
- v.array(
74
- v.object({
75
- value: v.string(),
76
- label: v.optional(v.string()),
77
- hint: v.optional(v.string()),
78
- }),
79
- ),
80
- DEFAULT_SCOPE_OPTIONS,
81
- ),
82
- }),
83
- {},
84
- ),
85
- v.rawCheck(({ dataset, addIssue }) => {
86
- if (!dataset.typed) return;
87
-
88
- const option_values = dataset.value.options.map((option) => option.value);
89
- if (dataset.value.custom_scope) option_values.push(CUSTOM_SCOPE_KEY);
90
-
91
- if (!option_values.includes(dataset.value.initial_value)) {
92
- addIssue({
93
- message: `Scope: initial_value "${dataset.value.initial_value}" must exist in options`,
94
- });
95
- }
96
- }),
97
- v.transform((value) => {
98
- const option_values = value.options.map((option) => option.value);
99
- if (value.custom_scope && !option_values.includes(CUSTOM_SCOPE_KEY)) {
100
- return {
101
- ...value,
102
- options: [
103
- ...value.options,
104
- {
105
- label: CUSTOM_SCOPE_KEY,
106
- value: CUSTOM_SCOPE_KEY,
107
- hint: "Write a custom scope",
108
- },
109
- ],
110
- };
111
- }
112
-
113
- return value;
114
- }),
115
- );
116
-
117
- export const Config = v.object({
118
- check_status: v.optional(v.boolean(), true),
119
- commit_type: CommitTypeConfig,
120
- commit_scope: CommitScopeConfig,
121
- check_ticket: v.optional(
122
- v.object({
123
- infer_ticket: v.optional(v.boolean(), true),
124
- confirm_ticket: v.optional(v.boolean(), true),
125
- add_to_title: v.optional(v.boolean(), true),
126
- append_hashtag: v.optional(v.boolean(), false),
127
- prepend_hashtag: v.optional(
128
- v.picklist(["Never", "Always", "Prompt"]),
129
- "Never",
130
- ),
131
- surround: v.optional(v.picklist(["", "()", "[]", "{}"]), ""),
132
- title_position: v.optional(
133
- v.picklist(["start", "end", "before-colon", "beginning"]),
134
- "start",
135
- ),
136
- }),
137
- {},
138
- ),
139
- commit_title: v.optional(
140
- v.object({
141
- max_size: v.optional(v.pipe(v.number(), v.minValue(1)), 70),
142
- }),
143
- {},
144
- ),
145
- commit_body: v.optional(
146
- v.object({
147
- enable: v.optional(v.boolean(), true),
148
- required: v.optional(v.boolean(), false),
149
- split_by_period: v.optional(v.boolean(), false),
150
- }),
151
- {},
152
- ),
153
- commit_footer: v.optional(
154
- v.object({
155
- enable: v.optional(v.boolean(), true),
156
- initial_value: v.optional(v.array(V_FOOTER_OPTIONS), []),
157
- options: v.optional(v.array(V_FOOTER_OPTIONS), FOOTER_OPTION_VALUES),
158
- }),
159
- {},
160
- ),
161
- breaking_change: v.optional(
162
- v.object({
163
- add_exclamation_to_title: v.optional(v.boolean(), true),
164
- }),
165
- {},
166
- ),
167
- cache_last_value: v.optional(v.boolean(), true),
168
- confirm_with_editor: v.optional(v.boolean(), false),
169
- confirm_commit: v.optional(v.boolean(), true),
170
- print_commit_output: v.optional(v.boolean(), true),
171
- branch_pre_commands: v.optional(v.array(v.string()), []),
172
- branch_post_commands: v.optional(v.array(v.string()), []),
173
- worktree_pre_commands: v.optional(v.array(v.string()), []),
174
- worktree_post_commands: v.optional(v.array(v.string()), []),
175
- branch_user: v.optional(
176
- v.object({
177
- enable: v.optional(v.boolean(), true),
178
- required: v.optional(v.boolean(), false),
179
- separator: v.optional(v.picklist(["/", "-", "_"]), "/"),
180
- }),
181
- {},
182
- ),
183
- branch_type: v.optional(
184
- v.object({
185
- enable: v.optional(v.boolean(), true),
186
- separator: v.optional(v.picklist(["/", "-", "_"]), "/"),
187
- }),
188
- {},
189
- ),
190
- branch_version: v.optional(
191
- v.object({
192
- enable: v.optional(v.boolean(), false),
193
- required: v.optional(v.boolean(), false),
194
- separator: v.optional(v.picklist(["/", "-", "_"]), "/"),
195
- }),
196
- {},
197
- ),
198
- branch_ticket: v.optional(
199
- v.object({
200
- enable: v.optional(v.boolean(), true),
201
- required: v.optional(v.boolean(), false),
202
- separator: v.optional(v.picklist(["/", "-", "_"]), "-"),
203
- }),
204
- {},
205
- ),
206
- branch_description: v.optional(
207
- v.object({
208
- max_length: v.optional(v.pipe(v.number(), v.minValue(1)), 70),
209
- separator: v.optional(v.picklist(["", "/", "-", "_"]), ""),
210
- }),
211
- {},
212
- ),
213
- branch_action_default: v.optional(V_BRANCH_ACTIONS, "branch"),
214
- branch_order: v.optional(v.array(V_BRANCH_FIELDS), BRANCH_ORDER_DEFAULTS),
215
- enable_worktrees: v.optional(v.boolean(), true),
216
- worktrees: v.optional(
217
- v.object({
218
- enable: v.optional(v.boolean(), true),
219
- base_path: v.optional(v.string(), ".."),
220
- folder_template: v.optional(
221
- v.string(),
222
- "{{repo_name}}-{{ticket}}-{{branch_description}}",
223
- ),
224
- }),
225
- {},
226
- ),
227
- overrides: v.optional(
228
- v.object({
229
- shell: v.optional(v.string()),
230
- }),
231
- {},
232
- ),
233
- });
234
-
235
- export const COMMIT_STATE_ENTRIES = {
236
- type: v.optional(v.string(), ""),
237
- scope: v.optional(v.string(), ""),
238
- title: v.optional(v.string(), ""),
239
- body: v.optional(v.string(), ""),
240
- closes: v.optional(v.string(), ""),
241
- ticket: v.optional(v.string(), ""),
242
- breaking_title: v.optional(v.string(), ""),
243
- breaking_body: v.optional(v.string(), ""),
244
- deprecates: v.optional(v.string(), ""),
245
- deprecates_title: v.optional(v.string(), ""),
246
- deprecates_body: v.optional(v.string(), ""),
247
- custom_footer: v.optional(v.string(), ""),
248
- trailer: v.optional(v.string(), ""),
249
- };
250
-
251
- export const CommitState = v.optional(v.object(COMMIT_STATE_ENTRIES), {});
252
-
253
- export const BRANCH_STATE_ENTRIES = {
254
- user: v.optional(v.string(), ""),
255
- type: v.optional(v.string(), ""),
256
- ticket: v.optional(v.string(), ""),
257
- description: v.optional(v.string(), ""),
258
- version: v.optional(v.string(), ""),
259
- checkout: v.optional(V_BRANCH_ACTIONS, "branch"),
260
- };
261
-
262
- export const BranchState = v.optional(
263
- v.object(BRANCH_STATE_ENTRIES),
264
- {},
265
- );
package/tsconfig.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "ESNext",
4
- "target": "ESNext",
5
- "declaration": true,
6
- "moduleResolution": "bundler",
7
- "emitDeclarationOnly": true,
8
- "strict": true,
9
- "esModuleInterop": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "allowJs": true,
12
- "types": ["node"]
13
- },
14
- "exclude": ["dist", "node_modules", ".svelte-kit", ".opencode"]
15
- }
package/tsup.config.ts DELETED
@@ -1,12 +0,0 @@
1
- import { defineConfig } from "tsup";
2
-
3
- export default defineConfig([
4
- {
5
- entry: ["./src/index.ts", "./src/branch.ts", "./src/init.ts"],
6
- clean: true,
7
- format: ["esm"],
8
- minify: true,
9
- dts: false,
10
- outDir: "./dist",
11
- },
12
- ]);
package/vitest.config.ts DELETED
@@ -1,8 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
-
3
- export default defineConfig({
4
- test: {
5
- environment: "node",
6
- include: ["src/**/*.test.ts"],
7
- },
8
- });