@cullit/config 1.7.0 → 1.9.2
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/index.d.ts +21 -1
- package/dist/index.js +32 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -25,8 +25,26 @@ interface PublishTarget {
|
|
|
25
25
|
channel?: string;
|
|
26
26
|
webhookUrl?: string;
|
|
27
27
|
path?: string;
|
|
28
|
+
format?: OutputFormat;
|
|
29
|
+
templateProfile?: string;
|
|
30
|
+
sectionOrder?: string[];
|
|
28
31
|
[key: string]: unknown;
|
|
29
32
|
}
|
|
33
|
+
interface TemplateProfile {
|
|
34
|
+
name: string;
|
|
35
|
+
format?: OutputFormat;
|
|
36
|
+
sectionOrder?: string[];
|
|
37
|
+
includeContributors?: boolean;
|
|
38
|
+
includeMetadata?: boolean;
|
|
39
|
+
summaryPrefix?: string;
|
|
40
|
+
}
|
|
41
|
+
interface TemplateConfig {
|
|
42
|
+
default?: string;
|
|
43
|
+
sectionOrder?: string[];
|
|
44
|
+
includeContributors?: boolean;
|
|
45
|
+
includeMetadata?: boolean;
|
|
46
|
+
summaryPrefix?: string;
|
|
47
|
+
}
|
|
30
48
|
interface JiraConfig {
|
|
31
49
|
domain: string;
|
|
32
50
|
email?: string;
|
|
@@ -66,6 +84,8 @@ interface CullConfig {
|
|
|
66
84
|
ai: AIConfig;
|
|
67
85
|
source: SourceConfig;
|
|
68
86
|
publish: PublishTarget[];
|
|
87
|
+
template?: TemplateConfig;
|
|
88
|
+
templates?: TemplateProfile[];
|
|
69
89
|
repos?: RepoSource[];
|
|
70
90
|
jira?: JiraConfig;
|
|
71
91
|
linear?: LinearConfig;
|
|
@@ -83,4 +103,4 @@ interface CullConfig {
|
|
|
83
103
|
*/
|
|
84
104
|
declare function loadConfig(cwdOrPath?: string): CullConfig;
|
|
85
105
|
|
|
86
|
-
export { type AIConfig, type AIProvider, type Audience, type BitbucketConfig, type ConfluenceConfig, type CullConfig, type EnrichmentType, type GitLabConfig, type JiraConfig, type LinearConfig, type NotionConfig, type OpenClawConfig, type OutputFormat, type PublishTarget, type PublisherType, type RepoSource, type SourceConfig, type Tone, loadConfig };
|
|
106
|
+
export { type AIConfig, type AIProvider, type Audience, type BitbucketConfig, type ConfluenceConfig, type CullConfig, type EnrichmentType, type GitLabConfig, type JiraConfig, type LinearConfig, type NotionConfig, type OpenClawConfig, type OutputFormat, type PublishTarget, type PublisherType, type RepoSource, type SourceConfig, type TemplateConfig, type TemplateProfile, type Tone, loadConfig };
|
package/dist/index.js
CHANGED
|
@@ -143,6 +143,7 @@ function resolveEnvVars(obj) {
|
|
|
143
143
|
return obj;
|
|
144
144
|
}
|
|
145
145
|
function mergeWithDefaults(parsed) {
|
|
146
|
+
const normalizedTemplates = normalizeTemplateProfiles(parsed.templates);
|
|
146
147
|
return {
|
|
147
148
|
ai: {
|
|
148
149
|
...DEFAULT_CONFIG.ai,
|
|
@@ -153,6 +154,8 @@ function mergeWithDefaults(parsed) {
|
|
|
153
154
|
...parsed.source || {}
|
|
154
155
|
},
|
|
155
156
|
publish: normalizePublishTargets(parsed.publish || DEFAULT_CONFIG.publish),
|
|
157
|
+
template: normalizeTemplateConfig(parsed.template),
|
|
158
|
+
...normalizedTemplates.length ? { templates: normalizedTemplates } : {},
|
|
156
159
|
jira: parsed.jira,
|
|
157
160
|
linear: parsed.linear,
|
|
158
161
|
openclaw: parsed.openclaw,
|
|
@@ -202,9 +205,38 @@ function normalizePublishTargets(targets) {
|
|
|
202
205
|
normalized.databaseId = t.database_id;
|
|
203
206
|
delete normalized["database_id"];
|
|
204
207
|
}
|
|
208
|
+
if (t.template_profile && !t.templateProfile) {
|
|
209
|
+
normalized.templateProfile = t.template_profile;
|
|
210
|
+
delete normalized["template_profile"];
|
|
211
|
+
}
|
|
212
|
+
if (Array.isArray(t.section_order) && !t.sectionOrder) {
|
|
213
|
+
normalized.sectionOrder = t.section_order;
|
|
214
|
+
delete normalized["section_order"];
|
|
215
|
+
}
|
|
205
216
|
return normalized;
|
|
206
217
|
});
|
|
207
218
|
}
|
|
219
|
+
function normalizeTemplateConfig(template) {
|
|
220
|
+
if (!template || typeof template !== "object" || Array.isArray(template)) return void 0;
|
|
221
|
+
return {
|
|
222
|
+
default: typeof template.default === "string" ? template.default : void 0,
|
|
223
|
+
sectionOrder: Array.isArray(template.sectionOrder) ? template.sectionOrder : Array.isArray(template.section_order) ? template.section_order : void 0,
|
|
224
|
+
includeContributors: typeof template.includeContributors === "boolean" ? template.includeContributors : typeof template.include_contributors === "boolean" ? template.include_contributors : void 0,
|
|
225
|
+
includeMetadata: typeof template.includeMetadata === "boolean" ? template.includeMetadata : typeof template.include_metadata === "boolean" ? template.include_metadata : void 0,
|
|
226
|
+
summaryPrefix: typeof template.summaryPrefix === "string" ? template.summaryPrefix : typeof template.summary_prefix === "string" ? template.summary_prefix : void 0
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
function normalizeTemplateProfiles(templates) {
|
|
230
|
+
if (!Array.isArray(templates)) return [];
|
|
231
|
+
return templates.filter((t) => t && typeof t === "object" && typeof t.name === "string").map((t) => ({
|
|
232
|
+
name: t.name,
|
|
233
|
+
format: typeof t.format === "string" ? t.format : void 0,
|
|
234
|
+
sectionOrder: Array.isArray(t.sectionOrder) ? t.sectionOrder : Array.isArray(t.section_order) ? t.section_order : void 0,
|
|
235
|
+
includeContributors: typeof t.includeContributors === "boolean" ? t.includeContributors : typeof t.include_contributors === "boolean" ? t.include_contributors : void 0,
|
|
236
|
+
includeMetadata: typeof t.includeMetadata === "boolean" ? t.includeMetadata : typeof t.include_metadata === "boolean" ? t.include_metadata : void 0,
|
|
237
|
+
summaryPrefix: typeof t.summaryPrefix === "string" ? t.summaryPrefix : typeof t.summary_prefix === "string" ? t.summary_prefix : void 0
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
208
240
|
export {
|
|
209
241
|
loadConfig
|
|
210
242
|
};
|