Skip to content

Commit 1b74ee6

Browse files
committed
Refactor commit message utilities into a dedicated features directory
- create `apps/editor/src/features/commit-messages` and move shared logic there
1 parent ed2688a commit 1b74ee6

7 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎apps/editor/src/commands/generate-commit-message-command/generate-commit-message-command.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import {
66
get_repository_for_commit
77
} from '../../utils/git-repository-utils'
88
import { display_token_count } from '../../utils/display-token-count'
9-
import { get_commit_message_api_configuration } from './utils/get-commit-message-config'
10-
import { build_commit_message_prompt } from './utils/build-commit-message-prompt'
11-
import { generate_commit_message_with_api } from './utils/generate-commit-message-with-api'
9+
import {
10+
get_commit_message_api_configuration,
11+
build_commit_message_prompt,
12+
generate_commit_message_with_api
13+
} from '@/features/commit-messages'
1214
import { t } from '@/i18n'
1315
import axios from 'axios'
1416
import { PromptsForCommitMessagesUtils } from '../../utils/prompts-for-commit-messages-utils'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from './utils/build-commit-message-prompt'
2+
export * from './utils/generate-commit-message-with-api'
3+
export * from './utils/get-commit-message-config'
4+
export * from './utils/strip-wrapping-quotes'

apps/editor/src/commands/generate-commit-message-command/utils/build-commit-message-prompt.ts renamed to apps/editor/src/features/commit-messages/utils/build-commit-message-prompt.ts

File renamed without changes.

apps/editor/src/commands/generate-commit-message-command/utils/generate-commit-message-with-api.ts renamed to apps/editor/src/features/commit-messages/utils/generate-commit-message-with-api.ts

File renamed without changes.

apps/editor/src/commands/generate-commit-message-command/utils/get-commit-message-config.ts renamed to apps/editor/src/features/commit-messages/utils/get-commit-message-config.ts

File renamed without changes.

apps/editor/src/commands/generate-commit-message-command/utils/strip-wrapping-quotes.ts renamed to apps/editor/src/features/commit-messages/utils/strip-wrapping-quotes.ts

File renamed without changes.

‎apps/editor/src/utils/git-repository-utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export type GitRepository = {
2020
show: (ref: string, path: string) => Promise<string>
2121
}
2222

23-
export const get_all_git_repositories = (): GitRepository[] | null => {
23+
const get_all_git_repositories = (): GitRepository[] | null => {
2424
const git_extension = vscode.extensions.getExtension('vscode.git')
2525
if (!git_extension) {
2626
vscode.window.showErrorMessage(

0 commit comments

Comments
 (0)