MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / resolveCommitMessage

Function resolveCommitMessage

packages/bumpy/src/core/commit-message.ts:10–30  ·  view source on GitHub ↗
(
  config: string | undefined,
  plan: ReleasePlan,
  rootDir: string,
)

Source from the content-addressed store, hash-verified

8
9/** Resolve the commit message from config, falling back to the default */
10export async function resolveCommitMessage(
11 config: string | undefined,
12 plan: ReleasePlan,
13 rootDir: string,
14): Promise<string> {
15 if (!config) return defaultCommitMessage(plan);
16
17 // Paths starting with "./" or "../" are treated as module paths
18 if (config.startsWith('./') || config.startsWith('../')) {
19 const fnPath = resolve(rootDir, config);
20 const mod = await import(fnPath);
21 const fn = mod.default ?? mod;
22 if (typeof fn !== 'function') {
23 throw new Error(`versionCommitMessage module "${config}" must export a function`);
24 }
25 return fn(plan);
26 }
27
28 // Otherwise it's a static message
29 return config;
30}

Callers 3

versionCommandFunction · 0.90
autoPublishFunction · 0.90
createVersionPrFunction · 0.90

Calls 1

defaultCommitMessageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…