@releasekit/notes 0.3.0-next.4 → 0.3.1
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/README.md +2 -0
- package/dist/{aggregator-JZ3VUZKP.js → aggregator-XJ2EILO3.js} +2 -2
- package/dist/{chunk-TSLTZ26C.js → chunk-DCQ32FVH.js} +5 -3
- package/dist/chunk-E4454SIS.js +243 -0
- package/dist/{chunk-QUBVC5LF.js → chunk-ENAWZXFG.js} +559 -146
- package/dist/cli.d.ts +5 -0
- package/dist/cli.js +134 -111
- package/dist/index.d.ts +8 -219
- package/dist/index.js +9 -12
- package/package.json +14 -12
- package/dist/chunk-QCF6V2IY.js +0 -135
- package/dist/cli.cjs +0 -1939
- package/dist/cli.d.cts +0 -1
- package/dist/index.cjs +0 -1866
- package/dist/index.d.cts +0 -219
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,135 +1,146 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
EXIT_CODES,
|
|
4
3
|
NotesError,
|
|
5
4
|
getDefaultConfig,
|
|
6
5
|
getExitCode,
|
|
7
6
|
loadConfig,
|
|
8
|
-
|
|
7
|
+
parseVersionOutput,
|
|
9
8
|
runPipeline,
|
|
10
9
|
saveAuth
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import
|
|
10
|
+
} from "./chunk-ENAWZXFG.js";
|
|
11
|
+
import {
|
|
12
|
+
EXIT_CODES,
|
|
13
|
+
error,
|
|
14
|
+
info,
|
|
15
|
+
readPackageVersion,
|
|
16
|
+
setLogLevel,
|
|
17
|
+
setQuietMode,
|
|
18
|
+
success
|
|
19
|
+
} from "./chunk-E4454SIS.js";
|
|
13
20
|
|
|
14
21
|
// src/cli.ts
|
|
15
22
|
import * as fs from "fs";
|
|
16
23
|
import * as readline from "readline";
|
|
17
|
-
import {
|
|
24
|
+
import { fileURLToPath } from "url";
|
|
18
25
|
import { Command } from "commander";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
config
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
config.output = getDefaultConfig().output;
|
|
31
|
-
}
|
|
32
|
-
if (options.regenerate) {
|
|
33
|
-
config.updateStrategy = "regenerate";
|
|
34
|
-
}
|
|
35
|
-
if (options.template) {
|
|
36
|
-
config.templates = { ...config.templates, path: options.template };
|
|
37
|
-
}
|
|
38
|
-
if (options.engine) {
|
|
39
|
-
config.templates = { ...config.templates, engine: options.engine };
|
|
40
|
-
}
|
|
41
|
-
if (options.llm === false) {
|
|
42
|
-
info("LLM processing disabled via --no-llm flag");
|
|
43
|
-
delete config.llm;
|
|
44
|
-
} else if (options.llmProvider || options.llmModel || options.llmBaseUrl || options.llmTasks) {
|
|
45
|
-
config.llm = config.llm ?? { provider: "openai-compatible", model: "" };
|
|
46
|
-
if (options.llmProvider) config.llm.provider = options.llmProvider;
|
|
47
|
-
if (options.llmModel) config.llm.model = options.llmModel;
|
|
48
|
-
if (options.llmBaseUrl) config.llm.baseURL = options.llmBaseUrl;
|
|
49
|
-
if (options.llmTasks) {
|
|
50
|
-
const taskNames = options.llmTasks.split(",").map((t) => t.trim());
|
|
51
|
-
config.llm.tasks = {
|
|
52
|
-
enhance: taskNames.includes("enhance"),
|
|
53
|
-
summarize: taskNames.includes("summarize"),
|
|
54
|
-
categorize: taskNames.includes("categorize"),
|
|
55
|
-
releaseNotes: taskNames.includes("release-notes") || taskNames.includes("releaseNotes")
|
|
56
|
-
};
|
|
26
|
+
function createNotesCommand() {
|
|
27
|
+
const cmd = new Command("notes").description(
|
|
28
|
+
"Generate changelogs with LLM-powered enhancement and flexible templating"
|
|
29
|
+
);
|
|
30
|
+
cmd.command("generate", { isDefault: true }).description("Generate changelog from input data").option("-i, --input <file>", "Input file (default: stdin)").option("-o, --output <spec>", "Output spec (format:file)", collectOutputs, []).option("-t, --template <path>", "Template file or directory").option("-e, --engine <engine>", "Template engine (handlebars|liquid|ejs)").option("--monorepo <mode>", "Monorepo mode (root|packages|both)").option("--llm-provider <provider>", "LLM provider").option("--llm-model <model>", "LLM model").option("--llm-base-url <url>", "LLM base URL (for openai-compatible provider)").option("--llm-tasks <tasks>", "Comma-separated LLM tasks").option("--no-llm", "Disable LLM processing").option("--target <package>", "Filter to a specific package name").option("--config <path>", "Config file path").option("--dry-run", "Preview without writing").option("--regenerate", "Regenerate entire changelog").option("-v, --verbose", "Increase verbosity", increaseVerbosity, 0).option("-q, --quiet", "Suppress non-error output").action(async (options) => {
|
|
31
|
+
setVerbosity(options.verbose);
|
|
32
|
+
if (options.quiet) setQuietMode(true);
|
|
33
|
+
try {
|
|
34
|
+
const config = loadConfig(process.cwd(), options.config);
|
|
35
|
+
if (options.output.length > 0) {
|
|
36
|
+
config.output = options.output;
|
|
57
37
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
info(`LLM base URL: ${config.llm.baseURL}`);
|
|
38
|
+
if (config.output.length === 0) {
|
|
39
|
+
config.output = getDefaultConfig().output;
|
|
61
40
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
info(`LLM tasks: ${taskList}`);
|
|
41
|
+
if (options.regenerate) {
|
|
42
|
+
config.updateStrategy = "regenerate";
|
|
65
43
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
44
|
+
if (options.template) {
|
|
45
|
+
config.templates = { ...config.templates, path: options.template };
|
|
46
|
+
}
|
|
47
|
+
if (options.engine) {
|
|
48
|
+
config.templates = { ...config.templates, engine: options.engine };
|
|
49
|
+
}
|
|
50
|
+
if (options.llm === false) {
|
|
51
|
+
info("LLM processing disabled via --no-llm flag");
|
|
52
|
+
delete config.llm;
|
|
53
|
+
} else if (options.llmProvider || options.llmModel || options.llmBaseUrl || options.llmTasks) {
|
|
54
|
+
config.llm = config.llm ?? { provider: "openai-compatible", model: "" };
|
|
55
|
+
if (options.llmProvider) config.llm.provider = options.llmProvider;
|
|
56
|
+
if (options.llmModel) config.llm.model = options.llmModel;
|
|
57
|
+
if (options.llmBaseUrl) config.llm.baseURL = options.llmBaseUrl;
|
|
58
|
+
if (options.llmTasks) {
|
|
59
|
+
const taskNames = options.llmTasks.split(",").map((t) => t.trim());
|
|
60
|
+
config.llm.tasks = {
|
|
61
|
+
enhance: taskNames.includes("enhance"),
|
|
62
|
+
summarize: taskNames.includes("summarize"),
|
|
63
|
+
categorize: taskNames.includes("categorize"),
|
|
64
|
+
releaseNotes: taskNames.includes("release-notes") || taskNames.includes("releaseNotes")
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
info(`LLM configured: ${config.llm.provider}${config.llm.model ? ` (${config.llm.model})` : ""}`);
|
|
68
|
+
if (config.llm.baseURL) {
|
|
69
|
+
info(`LLM base URL: ${config.llm.baseURL}`);
|
|
70
|
+
}
|
|
71
|
+
const taskList = Object.entries(config.llm.tasks || {}).filter(([, enabled]) => enabled).map(([name]) => name).join(", ");
|
|
72
|
+
if (taskList) {
|
|
73
|
+
info(`LLM tasks: ${taskList}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
let inputJson;
|
|
77
|
+
if (options.input) {
|
|
78
|
+
inputJson = fs.readFileSync(options.input, "utf-8");
|
|
79
|
+
} else {
|
|
80
|
+
inputJson = await readStdin();
|
|
81
|
+
}
|
|
82
|
+
const input = parseVersionOutput(inputJson);
|
|
83
|
+
if (options.target) {
|
|
84
|
+
const before = input.packages.length;
|
|
85
|
+
input.packages = input.packages.filter((p) => p.packageName === options.target);
|
|
86
|
+
if (input.packages.length === 0) {
|
|
87
|
+
info(`No changelog found for package "${options.target}" (had ${before} package(s))`);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
info(`Filtered to package: ${options.target}`);
|
|
80
91
|
}
|
|
81
|
-
|
|
92
|
+
if (options.monorepo) {
|
|
93
|
+
config.monorepo = { ...config.monorepo, mode: options.monorepo };
|
|
94
|
+
}
|
|
95
|
+
await runPipeline(input, config, options.dryRun ?? false);
|
|
96
|
+
if (options.dryRun) {
|
|
97
|
+
info("Dry run complete - no files were written");
|
|
98
|
+
} else {
|
|
99
|
+
success("Changelog generation complete");
|
|
100
|
+
}
|
|
101
|
+
} catch (err) {
|
|
102
|
+
handleError(err);
|
|
82
103
|
}
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
});
|
|
105
|
+
cmd.command("init").description("Create default configuration file").option("-f, --force", "Overwrite existing config").action((options) => {
|
|
106
|
+
const configPath = "releasekit.config.json";
|
|
107
|
+
if (fs.existsSync(configPath) && !options.force) {
|
|
108
|
+
error(`Config file already exists at ${configPath}. Use --force to overwrite.`);
|
|
109
|
+
process.exit(EXIT_CODES.GENERAL_ERROR);
|
|
85
110
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
111
|
+
const defaultConfig = {
|
|
112
|
+
$schema: "https://releasekit.dev/schema.json",
|
|
113
|
+
notes: {
|
|
114
|
+
output: [{ format: "markdown", file: "CHANGELOG.md" }],
|
|
115
|
+
updateStrategy: "prepend"
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
fs.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2), "utf-8");
|
|
119
|
+
success(`Created config file at ${configPath}`);
|
|
120
|
+
});
|
|
121
|
+
cmd.command("auth <provider>").description("Configure API key for an LLM provider").option("--key <key>", "API key (omit to be prompted)").action(async (provider, options) => {
|
|
122
|
+
let apiKey;
|
|
123
|
+
if (options.key) {
|
|
124
|
+
apiKey = options.key;
|
|
89
125
|
} else {
|
|
90
|
-
|
|
126
|
+
apiKey = await promptSecret(`Enter API key for ${provider}: `);
|
|
91
127
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
96
|
-
program.command("init").description("Create default configuration file").option("-f, --force", "Overwrite existing config").action((options) => {
|
|
97
|
-
const configPath = "releasekit.config.json";
|
|
98
|
-
if (fs.existsSync(configPath) && !options.force) {
|
|
99
|
-
error(`Config file already exists at ${configPath}. Use --force to overwrite.`);
|
|
100
|
-
process.exit(EXIT_CODES.GENERAL_ERROR);
|
|
101
|
-
}
|
|
102
|
-
const defaultConfig = {
|
|
103
|
-
$schema: "https://releasekit.dev/schema.json",
|
|
104
|
-
notes: {
|
|
105
|
-
output: [{ format: "markdown", file: "CHANGELOG.md" }],
|
|
106
|
-
updateStrategy: "prepend"
|
|
128
|
+
if (!apiKey.trim()) {
|
|
129
|
+
error("API key cannot be empty");
|
|
130
|
+
process.exit(EXIT_CODES.GENERAL_ERROR);
|
|
107
131
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
error("API key cannot be empty");
|
|
121
|
-
process.exit(EXIT_CODES.GENERAL_ERROR);
|
|
122
|
-
}
|
|
123
|
-
saveAuth(provider, apiKey.trim());
|
|
124
|
-
success(`API key saved for ${provider}`);
|
|
125
|
-
});
|
|
126
|
-
program.command("providers").description("List available LLM providers").action(() => {
|
|
127
|
-
info("Available LLM providers:");
|
|
128
|
-
console.log(" openai - OpenAI (GPT models)");
|
|
129
|
-
console.log(" anthropic - Anthropic (Claude models)");
|
|
130
|
-
console.log(" ollama - Ollama (local models)");
|
|
131
|
-
console.log(" openai-compatible - Any OpenAI-compatible endpoint");
|
|
132
|
-
});
|
|
132
|
+
saveAuth(provider, apiKey.trim());
|
|
133
|
+
success(`API key saved for ${provider}`);
|
|
134
|
+
});
|
|
135
|
+
cmd.command("providers").description("List available LLM providers").action(() => {
|
|
136
|
+
info("Available LLM providers:");
|
|
137
|
+
console.log(" openai - OpenAI (GPT models)");
|
|
138
|
+
console.log(" anthropic - Anthropic (Claude models)");
|
|
139
|
+
console.log(" ollama - Ollama (local models)");
|
|
140
|
+
console.log(" openai-compatible - Any OpenAI-compatible endpoint");
|
|
141
|
+
});
|
|
142
|
+
return cmd;
|
|
143
|
+
}
|
|
133
144
|
function collectOutputs(value, previous) {
|
|
134
145
|
const parts = value.split(":");
|
|
135
146
|
const format = parts[0] ?? "markdown";
|
|
@@ -171,4 +182,16 @@ function handleError(err) {
|
|
|
171
182
|
error(err instanceof Error ? err.message : String(err));
|
|
172
183
|
process.exit(EXIT_CODES.GENERAL_ERROR);
|
|
173
184
|
}
|
|
174
|
-
|
|
185
|
+
var isMain = (() => {
|
|
186
|
+
try {
|
|
187
|
+
return process.argv[1] ? fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url) : false;
|
|
188
|
+
} catch {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
})();
|
|
192
|
+
if (isMain) {
|
|
193
|
+
createNotesCommand().name("releasekit-notes").version(readPackageVersion(import.meta.url)).parse();
|
|
194
|
+
}
|
|
195
|
+
export {
|
|
196
|
+
createNotesCommand
|
|
197
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,219 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
interface RetryOptions {
|
|
10
|
-
maxAttempts?: number;
|
|
11
|
-
initialDelay?: number;
|
|
12
|
-
maxDelay?: number;
|
|
13
|
-
backoffFactor?: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type ChangelogType = 'added' | 'changed' | 'deprecated' | 'removed' | 'fixed' | 'security';
|
|
17
|
-
interface ChangelogEntry {
|
|
18
|
-
type: ChangelogType;
|
|
19
|
-
description: string;
|
|
20
|
-
issueIds?: string[];
|
|
21
|
-
scope?: string;
|
|
22
|
-
originalType?: string;
|
|
23
|
-
breaking?: boolean;
|
|
24
|
-
}
|
|
25
|
-
interface PackageChangelog {
|
|
26
|
-
packageName: string;
|
|
27
|
-
version: string;
|
|
28
|
-
previousVersion: string | null;
|
|
29
|
-
revisionRange: string;
|
|
30
|
-
repoUrl: string | null;
|
|
31
|
-
date: string;
|
|
32
|
-
entries: ChangelogEntry[];
|
|
33
|
-
}
|
|
34
|
-
type InputSource = 'package-versioner' | 'conventional-changelog' | 'git-log' | 'manual';
|
|
35
|
-
interface ChangelogInput {
|
|
36
|
-
source: InputSource;
|
|
37
|
-
packages: PackageChangelog[];
|
|
38
|
-
metadata?: {
|
|
39
|
-
repoUrl?: string;
|
|
40
|
-
defaultBranch?: string;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
interface EnhancedData {
|
|
44
|
-
entries: ChangelogEntry[];
|
|
45
|
-
summary?: string;
|
|
46
|
-
categories?: Record<string, ChangelogEntry[]>;
|
|
47
|
-
releaseNotes?: string;
|
|
48
|
-
}
|
|
49
|
-
interface TemplateContext {
|
|
50
|
-
packageName: string;
|
|
51
|
-
version: string;
|
|
52
|
-
previousVersion: string | null;
|
|
53
|
-
date: string;
|
|
54
|
-
repoUrl: string | null;
|
|
55
|
-
entries: ChangelogEntry[];
|
|
56
|
-
compareUrl?: string;
|
|
57
|
-
enhanced?: EnhancedData;
|
|
58
|
-
}
|
|
59
|
-
interface DocumentContext {
|
|
60
|
-
project: {
|
|
61
|
-
name: string;
|
|
62
|
-
repoUrl?: string;
|
|
63
|
-
};
|
|
64
|
-
versions: TemplateContext[];
|
|
65
|
-
unreleased?: TemplateContext;
|
|
66
|
-
compareUrls?: Record<string, string>;
|
|
67
|
-
}
|
|
68
|
-
interface LLMOptions {
|
|
69
|
-
timeout?: number;
|
|
70
|
-
maxTokens?: number;
|
|
71
|
-
temperature?: number;
|
|
72
|
-
}
|
|
73
|
-
interface ScopeRules {
|
|
74
|
-
allowed?: string[];
|
|
75
|
-
caseSensitive?: boolean;
|
|
76
|
-
invalidScopeAction?: 'remove' | 'keep' | 'fallback';
|
|
77
|
-
fallbackScope?: string;
|
|
78
|
-
}
|
|
79
|
-
interface ScopeConfig {
|
|
80
|
-
mode?: 'restricted' | 'packages' | 'none' | 'unrestricted';
|
|
81
|
-
rules?: ScopeRules;
|
|
82
|
-
}
|
|
83
|
-
interface LLMPromptOverrides {
|
|
84
|
-
enhance?: string;
|
|
85
|
-
categorize?: string;
|
|
86
|
-
enhanceAndCategorize?: string;
|
|
87
|
-
summarize?: string;
|
|
88
|
-
releaseNotes?: string;
|
|
89
|
-
}
|
|
90
|
-
interface LLMPromptsConfig {
|
|
91
|
-
instructions?: LLMPromptOverrides;
|
|
92
|
-
templates?: LLMPromptOverrides;
|
|
93
|
-
}
|
|
94
|
-
interface LLMCategory {
|
|
95
|
-
name: string;
|
|
96
|
-
description: string;
|
|
97
|
-
scopes?: string[];
|
|
98
|
-
}
|
|
99
|
-
interface LLMConfig {
|
|
100
|
-
provider: string;
|
|
101
|
-
model: string;
|
|
102
|
-
baseURL?: string;
|
|
103
|
-
apiKey?: string;
|
|
104
|
-
options?: LLMOptions;
|
|
105
|
-
concurrency?: number;
|
|
106
|
-
retry?: RetryOptions;
|
|
107
|
-
tasks?: {
|
|
108
|
-
summarize?: boolean;
|
|
109
|
-
enhance?: boolean;
|
|
110
|
-
categorize?: boolean;
|
|
111
|
-
releaseNotes?: boolean;
|
|
112
|
-
};
|
|
113
|
-
categories?: LLMCategory[];
|
|
114
|
-
style?: string;
|
|
115
|
-
scopes?: ScopeConfig;
|
|
116
|
-
prompts?: LLMPromptsConfig;
|
|
117
|
-
}
|
|
118
|
-
type OutputFormat = 'markdown' | 'github-release' | 'json';
|
|
119
|
-
interface OutputConfig {
|
|
120
|
-
format: OutputFormat;
|
|
121
|
-
file?: string;
|
|
122
|
-
options?: Record<string, unknown>;
|
|
123
|
-
templates?: TemplateConfig;
|
|
124
|
-
}
|
|
125
|
-
type MonorepoMode = 'root' | 'packages' | 'both';
|
|
126
|
-
interface MonorepoConfig {
|
|
127
|
-
mode?: MonorepoMode;
|
|
128
|
-
rootPath?: string;
|
|
129
|
-
packagesPath?: string;
|
|
130
|
-
}
|
|
131
|
-
type UpdateStrategy = 'prepend' | 'regenerate';
|
|
132
|
-
type TemplateEngine = 'handlebars' | 'liquid' | 'ejs';
|
|
133
|
-
interface TemplateConfig {
|
|
134
|
-
path?: string;
|
|
135
|
-
engine?: TemplateEngine;
|
|
136
|
-
}
|
|
137
|
-
interface Config {
|
|
138
|
-
input?: {
|
|
139
|
-
source?: string;
|
|
140
|
-
file?: string;
|
|
141
|
-
};
|
|
142
|
-
output: OutputConfig[];
|
|
143
|
-
monorepo?: MonorepoConfig;
|
|
144
|
-
templates?: TemplateConfig;
|
|
145
|
-
llm?: LLMConfig;
|
|
146
|
-
updateStrategy?: UpdateStrategy;
|
|
147
|
-
}
|
|
148
|
-
interface CompleteOptions {
|
|
149
|
-
maxTokens?: number;
|
|
150
|
-
temperature?: number;
|
|
151
|
-
timeout?: number;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
declare function createTemplateContext(pkg: PackageChangelog): TemplateContext;
|
|
155
|
-
interface PipelineResult {
|
|
156
|
-
/** Per-package rendered markdown keyed by package name. */
|
|
157
|
-
packageNotes: Record<string, string>;
|
|
158
|
-
/** File paths that were written to disk. */
|
|
159
|
-
files: string[];
|
|
160
|
-
}
|
|
161
|
-
declare function runPipeline(input: ChangelogInput, config: Config, dryRun: boolean): Promise<PipelineResult>;
|
|
162
|
-
declare function processInput(inputJson: string, config: Config, dryRun: boolean): Promise<PipelineResult>;
|
|
163
|
-
|
|
164
|
-
declare abstract class NotesError extends ReleaseKitError {
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
declare class InputParseError extends NotesError {
|
|
168
|
-
readonly code = "INPUT_PARSE_ERROR";
|
|
169
|
-
readonly suggestions: string[];
|
|
170
|
-
}
|
|
171
|
-
declare class TemplateError extends NotesError {
|
|
172
|
-
readonly code = "TEMPLATE_ERROR";
|
|
173
|
-
readonly suggestions: string[];
|
|
174
|
-
}
|
|
175
|
-
declare class LLMError extends NotesError {
|
|
176
|
-
readonly code = "LLM_ERROR";
|
|
177
|
-
readonly suggestions: string[];
|
|
178
|
-
}
|
|
179
|
-
declare class GitHubError extends NotesError {
|
|
180
|
-
readonly code = "GITHUB_ERROR";
|
|
181
|
-
readonly suggestions: string[];
|
|
182
|
-
}
|
|
183
|
-
declare class ConfigError extends NotesError {
|
|
184
|
-
readonly code = "CONFIG_ERROR";
|
|
185
|
-
readonly suggestions: string[];
|
|
186
|
-
}
|
|
187
|
-
declare function getExitCode(error: NotesError): number;
|
|
188
|
-
|
|
189
|
-
declare function parsePackageVersioner(json: string): ChangelogInput;
|
|
190
|
-
declare function parsePackageVersionerFile(filePath: string): ChangelogInput;
|
|
191
|
-
declare function parsePackageVersionerStdin(): Promise<ChangelogInput>;
|
|
192
|
-
|
|
193
|
-
interface MonorepoOptions {
|
|
194
|
-
rootPath: string;
|
|
195
|
-
packagesPath: string;
|
|
196
|
-
mode: 'root' | 'packages' | 'both';
|
|
197
|
-
}
|
|
198
|
-
declare function aggregateToRoot(contexts: TemplateContext[]): TemplateContext;
|
|
199
|
-
|
|
200
|
-
declare function writeMonorepoChangelogs(contexts: TemplateContext[], options: MonorepoOptions, config: {
|
|
201
|
-
updateStrategy?: 'prepend' | 'regenerate';
|
|
202
|
-
}, dryRun: boolean): string[];
|
|
203
|
-
declare function detectMonorepo(cwd: string): {
|
|
204
|
-
isMonorepo: boolean;
|
|
205
|
-
packagesPath: string;
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
declare function renderJson(contexts: TemplateContext[]): string;
|
|
209
|
-
declare function writeJson(outputPath: string, contexts: TemplateContext[], dryRun: boolean): void;
|
|
210
|
-
|
|
211
|
-
interface FormatVersionOptions {
|
|
212
|
-
/** Include the package name in the version header (e.g. `## [pkg@1.0.0]`). */
|
|
213
|
-
includePackageName?: boolean;
|
|
214
|
-
}
|
|
215
|
-
declare function formatVersion(context: TemplateContext, options?: FormatVersionOptions): string;
|
|
216
|
-
declare function renderMarkdown(contexts: TemplateContext[], options?: FormatVersionOptions): string;
|
|
217
|
-
declare function writeMarkdown(outputPath: string, contexts: TemplateContext[], config: Config, dryRun: boolean): void;
|
|
218
|
-
|
|
219
|
-
export { NotesError as ChangelogCreatorError, type ChangelogEntry, type ChangelogInput, type ChangelogType, type CompleteOptions, type Config, ConfigError, type DocumentContext, type EnhancedData, GitHubError, InputParseError, type InputSource, type LLMCategory, type LLMConfig, LLMError, type LLMOptions, type LLMPromptOverrides, type LLMPromptsConfig, type MonorepoConfig, type MonorepoMode, NotesError, type OutputConfig, type OutputFormat, type PackageChangelog, type PipelineResult, type RetryOptions, type ScopeConfig, type ScopeRules, type TemplateConfig, type TemplateContext, type TemplateEngine, TemplateError, type UpdateStrategy, aggregateToRoot, createTemplateContext, detectMonorepo, formatVersion, getDefaultConfig, getExitCode, loadConfig, parsePackageVersioner, parsePackageVersionerFile, parsePackageVersionerStdin, processInput, renderJson, renderMarkdown, runPipeline, writeJson, writeMarkdown, writeMonorepoChangelogs };
|
|
1
|
+
export { getDefaultConfig, loadAuth, loadConfig, saveAuth } from './core/config.ts';
|
|
2
|
+
export { PipelineResult, createTemplateContext, processInput, runPipeline } from './core/pipeline.ts';
|
|
3
|
+
export * from './core/types.ts';
|
|
4
|
+
export * from './errors/index.ts';
|
|
5
|
+
export { parseVersionOutput, parseVersionOutputFile, parseVersionOutputStdin } from './input/version-output.ts';
|
|
6
|
+
export { aggregateToRoot, detectMonorepo, writeMonorepoChangelogs } from './monorepo/aggregator.ts';
|
|
7
|
+
export { renderJson, writeJson } from './output/json.ts';
|
|
8
|
+
export { formatVersion, renderMarkdown, writeMarkdown } from './output/markdown.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConfigError,
|
|
3
|
-
EXIT_CODES,
|
|
4
3
|
GitHubError,
|
|
5
4
|
InputParseError,
|
|
6
5
|
LLMError,
|
|
@@ -11,29 +10,27 @@ import {
|
|
|
11
10
|
getExitCode,
|
|
12
11
|
loadAuth,
|
|
13
12
|
loadConfig,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
parseVersionOutput,
|
|
14
|
+
parseVersionOutputFile,
|
|
15
|
+
parseVersionOutputStdin,
|
|
17
16
|
processInput,
|
|
18
17
|
renderJson,
|
|
19
18
|
runPipeline,
|
|
20
19
|
saveAuth,
|
|
21
20
|
writeJson
|
|
22
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ENAWZXFG.js";
|
|
23
22
|
import {
|
|
24
23
|
aggregateToRoot,
|
|
25
24
|
detectMonorepo,
|
|
26
25
|
writeMonorepoChangelogs
|
|
27
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DCQ32FVH.js";
|
|
28
27
|
import {
|
|
29
28
|
formatVersion,
|
|
30
29
|
renderMarkdown,
|
|
31
30
|
writeMarkdown
|
|
32
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-E4454SIS.js";
|
|
33
32
|
export {
|
|
34
|
-
NotesError as ChangelogCreatorError,
|
|
35
33
|
ConfigError,
|
|
36
|
-
EXIT_CODES,
|
|
37
34
|
GitHubError,
|
|
38
35
|
InputParseError,
|
|
39
36
|
LLMError,
|
|
@@ -47,9 +44,9 @@ export {
|
|
|
47
44
|
getExitCode,
|
|
48
45
|
loadAuth,
|
|
49
46
|
loadConfig,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
parseVersionOutput,
|
|
48
|
+
parseVersionOutputFile,
|
|
49
|
+
parseVersionOutputStdin,
|
|
53
50
|
processInput,
|
|
54
51
|
renderJson,
|
|
55
52
|
renderMarkdown,
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@releasekit/notes",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Release notes and changelog generation with LLM-powered enhancement and flexible templating",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.cjs",
|
|
7
6
|
"module": "./dist/index.js",
|
|
8
7
|
"types": "./dist/index.d.ts",
|
|
9
8
|
"exports": {
|
|
@@ -11,10 +10,12 @@
|
|
|
11
10
|
"import": {
|
|
12
11
|
"types": "./dist/index.d.ts",
|
|
13
12
|
"default": "./dist/index.js"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"./cli": {
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./dist/cli.d.ts",
|
|
18
|
+
"default": "./dist/cli.js"
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
},
|
|
@@ -53,9 +54,8 @@
|
|
|
53
54
|
"handlebars": "^4.7.8",
|
|
54
55
|
"liquidjs": "^10.25.0",
|
|
55
56
|
"openai": "^6.27.0",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"@releasekit/core": "0.1.0"
|
|
57
|
+
"smol-toml": "^1.6.1",
|
|
58
|
+
"zod": "^4.3.6"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@biomejs/biome": "^2.4.6",
|
|
@@ -64,14 +64,16 @@
|
|
|
64
64
|
"@vitest/coverage-v8": "^4.1.0",
|
|
65
65
|
"tsup": "^8.5.1",
|
|
66
66
|
"typescript": "^5.9.3",
|
|
67
|
-
"vitest": "^4.1.0"
|
|
67
|
+
"vitest": "^4.1.0",
|
|
68
|
+
"@releasekit/core": "0.0.0",
|
|
69
|
+
"@releasekit/config": "0.0.0"
|
|
68
70
|
},
|
|
69
71
|
"engines": {
|
|
70
72
|
"node": ">=20"
|
|
71
73
|
},
|
|
72
74
|
"scripts": {
|
|
73
|
-
"build": "tsup
|
|
74
|
-
"dev": "tsup
|
|
75
|
+
"build": "tsup",
|
|
76
|
+
"dev": "tsup --watch",
|
|
75
77
|
"clean": "rm -rf dist coverage .turbo",
|
|
76
78
|
"test": "vitest run",
|
|
77
79
|
"test:unit": "vitest run --coverage",
|