release-note 0.0.5 → 0.0.7
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/bin.cjs +1 -1
- package/dist/bin.mjs +1 -1
- package/dist/{dist-BKDBZrkD.mjs → dist-CeBX9H5m.mjs} +1 -1
- package/dist/{dist-DGil98Eq.cjs → dist-DS4okU_S.cjs} +1 -1
- package/dist/{generate-BvQfZAwr.cjs → generate-Co3HP4o3.cjs} +48 -26
- package/dist/{generate-CLz75nUt.mjs → generate-DrcKRdlK.mjs} +48 -26
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +19 -3
- package/dist/index.d.mts +19 -3
- package/dist/index.mjs +1 -1
- package/dist/{token-BTkzJW-X.mjs → token-BhSAhkpE.mjs} +1 -1
- package/dist/{token-K-kJmAE8.cjs → token-Cv3WAUe2.cjs} +1 -1
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.cjs");
|
|
3
|
-
const require_generate = require("./generate-
|
|
3
|
+
const require_generate = require("./generate-Co3HP4o3.cjs");
|
|
4
4
|
let node_events = require("node:events");
|
|
5
5
|
let node_child_process = require("node:child_process");
|
|
6
6
|
node_child_process = require_chunk.__toESM(node_child_process, 1);
|
package/dist/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as resolveConfig, t as generateReleaseNote } from "./generate-
|
|
2
|
+
import { C as resolveConfig, t as generateReleaseNote } from "./generate-DrcKRdlK.mjs";
|
|
3
3
|
import { EventEmitter } from "node:events";
|
|
4
4
|
import childProcess from "node:child_process";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as number, D as boolean, E as array, M as record, N as string, O as literal, P as union, S as UnsupportedFunctionalityError, T as any, _ as withUserAgentSuffix, a as convertBase64ToUint8Array, b as InvalidResponseDataError, c as createEventSourceResponseHandler, d as downloadBlob, f as generateId, g as postJsonToApi, h as postFormDataToApi, i as combineHeaders, j as object, k as looseObject, l as createJsonErrorResponseHandler, m as parseProviderOptions, o as convertToBase64, p as isParsableJson, s as convertToFormData, u as createJsonResponseHandler, v as withoutTrailingSlash, w as _enum, x as TooManyEmbeddingValuesForCallError, y as InvalidPromptError } from "./generate-
|
|
1
|
+
import { A as number, D as boolean, E as array, M as record, N as string, O as literal, P as union, S as UnsupportedFunctionalityError, T as any, _ as withUserAgentSuffix, a as convertBase64ToUint8Array, b as InvalidResponseDataError, c as createEventSourceResponseHandler, d as downloadBlob, f as generateId, g as postJsonToApi, h as postFormDataToApi, i as combineHeaders, j as object, k as looseObject, l as createJsonErrorResponseHandler, m as parseProviderOptions, o as convertToBase64, p as isParsableJson, s as convertToFormData, u as createJsonResponseHandler, v as withoutTrailingSlash, w as _enum, x as TooManyEmbeddingValuesForCallError, y as InvalidPromptError } from "./generate-DrcKRdlK.mjs";
|
|
2
2
|
//#region node_modules/.pnpm/@ai-sdk+openai-compatible@2.0.48_zod@4.4.3/node_modules/@ai-sdk/openai-compatible/dist/index.mjs
|
|
3
3
|
function toCamelCase(str) {
|
|
4
4
|
return str.replace(/[_-]([a-z])/g, (g) => g[1].toUpperCase());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-Cek0wNdY.cjs");
|
|
2
|
-
const require_generate = require("./generate-
|
|
2
|
+
const require_generate = require("./generate-Co3HP4o3.cjs");
|
|
3
3
|
//#region node_modules/.pnpm/@ai-sdk+openai-compatible@2.0.48_zod@4.4.3/node_modules/@ai-sdk/openai-compatible/dist/index.mjs
|
|
4
4
|
function toCamelCase(str) {
|
|
5
5
|
return str.replace(/[_-]([a-z])/g, (g) => g[1].toUpperCase());
|
|
@@ -13968,7 +13968,15 @@ config(en_default());
|
|
|
13968
13968
|
var zod_default = external_exports;
|
|
13969
13969
|
//#endregion
|
|
13970
13970
|
//#region src/config/config-schema.ts
|
|
13971
|
-
const
|
|
13971
|
+
const commitSchema = object$1({ commit: string$1() });
|
|
13972
|
+
const tagSchema = object$1({
|
|
13973
|
+
tag: string$1().or(_instanceof(RegExp)),
|
|
13974
|
+
offset: number$1().int().min(0).optional()
|
|
13975
|
+
});
|
|
13976
|
+
const gitCommitTargetSchema = union([tagSchema, object$1({
|
|
13977
|
+
prev: union([tagSchema, commitSchema]),
|
|
13978
|
+
current: union([tagSchema, commitSchema])
|
|
13979
|
+
})]);
|
|
13972
13980
|
const providerOptionsSchema = object$1({
|
|
13973
13981
|
apiUrl: string$1().optional(),
|
|
13974
13982
|
apiKeyEnv: union([string$1(), array$1(string$1())]).optional(),
|
|
@@ -13977,9 +13985,9 @@ const providerOptionsSchema = object$1({
|
|
|
13977
13985
|
options: record(string$1(), unknown()).optional()
|
|
13978
13986
|
});
|
|
13979
13987
|
const generateConfigSchema = object$1({
|
|
13980
|
-
|
|
13988
|
+
target: gitCommitTargetSchema.default({ tag: ".*" }),
|
|
13981
13989
|
model: string$1().min(1),
|
|
13982
|
-
steps: number$1().int().
|
|
13990
|
+
steps: number$1().int().min(5).max(500).optional()
|
|
13983
13991
|
}).extend(providerOptionsSchema.shape);
|
|
13984
13992
|
//#endregion
|
|
13985
13993
|
//#region src/config/resolve-config.ts
|
|
@@ -14024,7 +14032,7 @@ async function resolveProvider(name, options) {
|
|
|
14024
14032
|
if (name === "@ai-sdk/openai-compatible") {
|
|
14025
14033
|
if (!options.apiUrl) throw new Error("\"\"apiUrl\"\" is required for openai-compatible provider");
|
|
14026
14034
|
if (!resolvedApiKey) throw new Error("No API key found in the specified environment variables");
|
|
14027
|
-
const { createOpenAICompatible } = await Promise.resolve().then(() => require("./dist-
|
|
14035
|
+
const { createOpenAICompatible } = await Promise.resolve().then(() => require("./dist-DS4okU_S.cjs"));
|
|
14028
14036
|
return createOpenAICompatible({
|
|
14029
14037
|
name,
|
|
14030
14038
|
apiKey: resolvedApiKey,
|
|
@@ -14044,6 +14052,9 @@ async function resolveProvider(name, options) {
|
|
|
14044
14052
|
}
|
|
14045
14053
|
//#endregion
|
|
14046
14054
|
//#region node_modules/.pnpm/daily-code@1.1.16/node_modules/daily-code/dist/index.mjs
|
|
14055
|
+
function numberClamp(num, min, max) {
|
|
14056
|
+
return Math.min(Math.max(num, min), max);
|
|
14057
|
+
}
|
|
14047
14058
|
function objectPick(obj, keys) {
|
|
14048
14059
|
return keys.reduce((res, key) => {
|
|
14049
14060
|
res[key] = obj[key];
|
|
@@ -14052,11 +14063,11 @@ function objectPick(obj, keys) {
|
|
|
14052
14063
|
}
|
|
14053
14064
|
//#endregion
|
|
14054
14065
|
//#region src/lib/git.ts
|
|
14055
|
-
async function getGitCommitHash(git, target,
|
|
14066
|
+
async function getGitCommitHash(git, target, defaultOffset) {
|
|
14056
14067
|
if ("tag" in target) {
|
|
14057
|
-
const
|
|
14058
|
-
const
|
|
14059
|
-
const matched = tags.filter((tag) =>
|
|
14068
|
+
const offset = target.offset ?? defaultOffset;
|
|
14069
|
+
const targetRegex = target.tag instanceof RegExp ? target.tag : new RegExp(target.tag);
|
|
14070
|
+
const matched = (await git.tags({ "--sort": "-v:refname" })).all.filter((tag) => targetRegex.test(tag));
|
|
14060
14071
|
if (matched.length === 0) throw new Error(`No tags matched pattern: ${target.tag}`);
|
|
14061
14072
|
if (offset < 0 || offset >= matched.length) throw new Error(`Offset ${offset} out of range: only ${matched.length} tag(s) matched pattern ${target.tag}`);
|
|
14062
14073
|
const tag = matched[offset];
|
|
@@ -14066,10 +14077,10 @@ async function getGitCommitHash(git, target, offset = 0) {
|
|
|
14066
14077
|
throw new Error("Invalid target: must contain either \"tag\" or \"commit\"");
|
|
14067
14078
|
}
|
|
14068
14079
|
async function getGitCommitsInfo(git, match) {
|
|
14069
|
-
const
|
|
14070
|
-
const current = await getGitCommitHash(git, match, 0);
|
|
14080
|
+
const prev = await getGitCommitHash(git, "prev" in match ? match.prev : match, 1);
|
|
14081
|
+
const current = await getGitCommitHash(git, "current" in match ? match.current : match, 0);
|
|
14071
14082
|
return [...(await git.log({
|
|
14072
|
-
from:
|
|
14083
|
+
from: prev,
|
|
14073
14084
|
to: current
|
|
14074
14085
|
})).all].map((c) => objectPick(c, [
|
|
14075
14086
|
"hash",
|
|
@@ -19915,7 +19926,7 @@ var require_get_vercel_oidc_token = /* @__PURE__ */ require_chunk.__commonJSMin(
|
|
|
19915
19926
|
err = error;
|
|
19916
19927
|
}
|
|
19917
19928
|
try {
|
|
19918
|
-
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require_token_util())), await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require("./token-
|
|
19929
|
+
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require_token_util())), await Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require("./token-Cv3WAUe2.cjs").default))]);
|
|
19919
19930
|
if (!token || isExpired(getTokenPayload(token), options?.expirationBufferMs)) {
|
|
19920
19931
|
await refreshToken(options);
|
|
19921
19932
|
token = getVercelOidcTokenSync();
|
|
@@ -30805,23 +30816,22 @@ The release notes should be concise, informative, and highlight the key changes,
|
|
|
30805
30816
|
|
|
30806
30817
|
|
|
30807
30818
|
## Output format:
|
|
30808
|
-
- Group related changes together under appropriate headings (e.g., "New Features", "Bug Fixes", "Improvements", "Breaking Changes").
|
|
30809
30819
|
- Use bullet points to list individual changes for better readability.
|
|
30820
|
+
- Group related changes together under appropriate headings (e.g., "New Features", "Bug Fixes", "Improvements", "Breaking Changes").
|
|
30810
30821
|
- If there are breaking changes, clearly indicate them in a separate section and provide guidance on how to adapt to these changes from a user perspective.
|
|
30822
|
+
- DO NOT start with "Here is the notes...", "Here are the changes...", "Let me generate..."; just directly write the content of the release note.
|
|
30811
30823
|
- DO NOT use a top-level title to wrap the content as "Release Note"; just directly write the sections.
|
|
30812
|
-
- DO NOT use --- to separate sections, use ## for headings instead.
|
|
30813
30824
|
- Output ONLY the release note content, with no preamble, explanation, or commentary.
|
|
30825
|
+
- DO NOT use --- to separate sections, use ## for headings instead.
|
|
30814
30826
|
`;
|
|
30815
30827
|
}
|
|
30816
|
-
function
|
|
30817
|
-
return
|
|
30818
|
-
${commits.map((c) => [
|
|
30828
|
+
function buildCommitsMarkdown(commits) {
|
|
30829
|
+
return commits.map((c) => [
|
|
30819
30830
|
`- Commithash: ${c.hash}`,
|
|
30831
|
+
` - > ${c.message.replaceAll("\n", "\n > ")}`,
|
|
30820
30832
|
` - Timestamp: ${c.date}`,
|
|
30821
|
-
` - Author: ${c.author_name} <${c.author_email}
|
|
30822
|
-
|
|
30823
|
-
].join("\n")).join("\n")}
|
|
30824
|
-
`;
|
|
30833
|
+
` - Author: ${c.author_name} <${c.author_email}>`
|
|
30834
|
+
].join("\n")).join("\n\n");
|
|
30825
30835
|
}
|
|
30826
30836
|
//#endregion
|
|
30827
30837
|
//#region src/generate/tools.ts
|
|
@@ -30903,16 +30913,28 @@ function generateTools(git, logger) {
|
|
|
30903
30913
|
//#region src/generate/index.ts
|
|
30904
30914
|
async function generateReleaseNote(cwd, options) {
|
|
30905
30915
|
const git = simpleGit(cwd);
|
|
30906
|
-
const commits = await getGitCommitsInfo(git, options.
|
|
30916
|
+
const commits = await getGitCommitsInfo(git, options.target);
|
|
30917
|
+
if (commits.length < 2) throw new Error(`Not enough commits found between the specified targets to generate release notes. Found ${commits.length} commit(s).`);
|
|
30907
30918
|
const provider = await resolveProvider(options.provider, options);
|
|
30908
30919
|
if (!provider) throw new Error(`Unsupported provider: ${options.provider}`);
|
|
30909
|
-
const
|
|
30920
|
+
const commitsMarkdown = buildCommitsMarkdown(commits);
|
|
30921
|
+
options.logger?.("=".repeat(80));
|
|
30922
|
+
options.logger?.(commitsMarkdown);
|
|
30923
|
+
options.logger?.("=".repeat(80));
|
|
30924
|
+
const steps = options.steps ?? numberClamp((commits.length + 1) * 2, 10, 100);
|
|
30925
|
+
options.logger?.(`Generating with "${options.provider}" using "${options.model}" in ${steps} steps...`);
|
|
30910
30926
|
const result = await generateText({
|
|
30911
30927
|
model: provider(options.model),
|
|
30912
|
-
prompt: buildUserPrompt(commits).trim(),
|
|
30913
|
-
system: buildSystemPrompt(maxSteps).trim(),
|
|
30914
30928
|
tools: generateTools(git, options.logger),
|
|
30915
|
-
stopWhen: stepCountIs(
|
|
30929
|
+
stopWhen: stepCountIs(steps),
|
|
30930
|
+
system: buildSystemPrompt(Math.floor(steps / 1.5)),
|
|
30931
|
+
messages: [{
|
|
30932
|
+
role: "user",
|
|
30933
|
+
content: "Here are the commits related to the release:"
|
|
30934
|
+
}, {
|
|
30935
|
+
role: "user",
|
|
30936
|
+
content: commitsMarkdown.trim()
|
|
30937
|
+
}]
|
|
30916
30938
|
});
|
|
30917
30939
|
return {
|
|
30918
30940
|
commits,
|
|
@@ -13963,7 +13963,15 @@ config(en_default());
|
|
|
13963
13963
|
var zod_default = external_exports;
|
|
13964
13964
|
//#endregion
|
|
13965
13965
|
//#region src/config/config-schema.ts
|
|
13966
|
-
const
|
|
13966
|
+
const commitSchema = object$1({ commit: string$1() });
|
|
13967
|
+
const tagSchema = object$1({
|
|
13968
|
+
tag: string$1().or(_instanceof(RegExp)),
|
|
13969
|
+
offset: number$1().int().min(0).optional()
|
|
13970
|
+
});
|
|
13971
|
+
const gitCommitTargetSchema = union([tagSchema, object$1({
|
|
13972
|
+
prev: union([tagSchema, commitSchema]),
|
|
13973
|
+
current: union([tagSchema, commitSchema])
|
|
13974
|
+
})]);
|
|
13967
13975
|
const providerOptionsSchema = object$1({
|
|
13968
13976
|
apiUrl: string$1().optional(),
|
|
13969
13977
|
apiKeyEnv: union([string$1(), array$1(string$1())]).optional(),
|
|
@@ -13972,9 +13980,9 @@ const providerOptionsSchema = object$1({
|
|
|
13972
13980
|
options: record(string$1(), unknown()).optional()
|
|
13973
13981
|
});
|
|
13974
13982
|
const generateConfigSchema = object$1({
|
|
13975
|
-
|
|
13983
|
+
target: gitCommitTargetSchema.default({ tag: ".*" }),
|
|
13976
13984
|
model: string$1().min(1),
|
|
13977
|
-
steps: number$1().int().
|
|
13985
|
+
steps: number$1().int().min(5).max(500).optional()
|
|
13978
13986
|
}).extend(providerOptionsSchema.shape);
|
|
13979
13987
|
//#endregion
|
|
13980
13988
|
//#region src/config/resolve-config.ts
|
|
@@ -14019,7 +14027,7 @@ async function resolveProvider(name, options) {
|
|
|
14019
14027
|
if (name === "@ai-sdk/openai-compatible") {
|
|
14020
14028
|
if (!options.apiUrl) throw new Error("\"\"apiUrl\"\" is required for openai-compatible provider");
|
|
14021
14029
|
if (!resolvedApiKey) throw new Error("No API key found in the specified environment variables");
|
|
14022
|
-
const { createOpenAICompatible } = await import("./dist-
|
|
14030
|
+
const { createOpenAICompatible } = await import("./dist-CeBX9H5m.mjs");
|
|
14023
14031
|
return createOpenAICompatible({
|
|
14024
14032
|
name,
|
|
14025
14033
|
apiKey: resolvedApiKey,
|
|
@@ -14039,6 +14047,9 @@ async function resolveProvider(name, options) {
|
|
|
14039
14047
|
}
|
|
14040
14048
|
//#endregion
|
|
14041
14049
|
//#region node_modules/.pnpm/daily-code@1.1.16/node_modules/daily-code/dist/index.mjs
|
|
14050
|
+
function numberClamp(num, min, max) {
|
|
14051
|
+
return Math.min(Math.max(num, min), max);
|
|
14052
|
+
}
|
|
14042
14053
|
function objectPick(obj, keys) {
|
|
14043
14054
|
return keys.reduce((res, key) => {
|
|
14044
14055
|
res[key] = obj[key];
|
|
@@ -14047,11 +14058,11 @@ function objectPick(obj, keys) {
|
|
|
14047
14058
|
}
|
|
14048
14059
|
//#endregion
|
|
14049
14060
|
//#region src/lib/git.ts
|
|
14050
|
-
async function getGitCommitHash(git, target,
|
|
14061
|
+
async function getGitCommitHash(git, target, defaultOffset) {
|
|
14051
14062
|
if ("tag" in target) {
|
|
14052
|
-
const
|
|
14053
|
-
const
|
|
14054
|
-
const matched = tags.filter((tag) =>
|
|
14063
|
+
const offset = target.offset ?? defaultOffset;
|
|
14064
|
+
const targetRegex = target.tag instanceof RegExp ? target.tag : new RegExp(target.tag);
|
|
14065
|
+
const matched = (await git.tags({ "--sort": "-v:refname" })).all.filter((tag) => targetRegex.test(tag));
|
|
14055
14066
|
if (matched.length === 0) throw new Error(`No tags matched pattern: ${target.tag}`);
|
|
14056
14067
|
if (offset < 0 || offset >= matched.length) throw new Error(`Offset ${offset} out of range: only ${matched.length} tag(s) matched pattern ${target.tag}`);
|
|
14057
14068
|
const tag = matched[offset];
|
|
@@ -14061,10 +14072,10 @@ async function getGitCommitHash(git, target, offset = 0) {
|
|
|
14061
14072
|
throw new Error("Invalid target: must contain either \"tag\" or \"commit\"");
|
|
14062
14073
|
}
|
|
14063
14074
|
async function getGitCommitsInfo(git, match) {
|
|
14064
|
-
const
|
|
14065
|
-
const current = await getGitCommitHash(git, match, 0);
|
|
14075
|
+
const prev = await getGitCommitHash(git, "prev" in match ? match.prev : match, 1);
|
|
14076
|
+
const current = await getGitCommitHash(git, "current" in match ? match.current : match, 0);
|
|
14066
14077
|
return [...(await git.log({
|
|
14067
|
-
from:
|
|
14078
|
+
from: prev,
|
|
14068
14079
|
to: current
|
|
14069
14080
|
})).all].map((c) => objectPick(c, [
|
|
14070
14081
|
"hash",
|
|
@@ -19910,7 +19921,7 @@ var require_get_vercel_oidc_token = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
19910
19921
|
err = error;
|
|
19911
19922
|
}
|
|
19912
19923
|
try {
|
|
19913
|
-
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_token_util())), await import("./token-
|
|
19924
|
+
const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_token_util())), await import("./token-BhSAhkpE.mjs").then((m) => /* @__PURE__ */ __toESM(m.default))]);
|
|
19914
19925
|
if (!token || isExpired(getTokenPayload(token), options?.expirationBufferMs)) {
|
|
19915
19926
|
await refreshToken(options);
|
|
19916
19927
|
token = getVercelOidcTokenSync();
|
|
@@ -30800,23 +30811,22 @@ The release notes should be concise, informative, and highlight the key changes,
|
|
|
30800
30811
|
|
|
30801
30812
|
|
|
30802
30813
|
## Output format:
|
|
30803
|
-
- Group related changes together under appropriate headings (e.g., "New Features", "Bug Fixes", "Improvements", "Breaking Changes").
|
|
30804
30814
|
- Use bullet points to list individual changes for better readability.
|
|
30815
|
+
- Group related changes together under appropriate headings (e.g., "New Features", "Bug Fixes", "Improvements", "Breaking Changes").
|
|
30805
30816
|
- If there are breaking changes, clearly indicate them in a separate section and provide guidance on how to adapt to these changes from a user perspective.
|
|
30817
|
+
- DO NOT start with "Here is the notes...", "Here are the changes...", "Let me generate..."; just directly write the content of the release note.
|
|
30806
30818
|
- DO NOT use a top-level title to wrap the content as "Release Note"; just directly write the sections.
|
|
30807
|
-
- DO NOT use --- to separate sections, use ## for headings instead.
|
|
30808
30819
|
- Output ONLY the release note content, with no preamble, explanation, or commentary.
|
|
30820
|
+
- DO NOT use --- to separate sections, use ## for headings instead.
|
|
30809
30821
|
`;
|
|
30810
30822
|
}
|
|
30811
|
-
function
|
|
30812
|
-
return
|
|
30813
|
-
${commits.map((c) => [
|
|
30823
|
+
function buildCommitsMarkdown(commits) {
|
|
30824
|
+
return commits.map((c) => [
|
|
30814
30825
|
`- Commithash: ${c.hash}`,
|
|
30826
|
+
` - > ${c.message.replaceAll("\n", "\n > ")}`,
|
|
30815
30827
|
` - Timestamp: ${c.date}`,
|
|
30816
|
-
` - Author: ${c.author_name} <${c.author_email}
|
|
30817
|
-
|
|
30818
|
-
].join("\n")).join("\n")}
|
|
30819
|
-
`;
|
|
30828
|
+
` - Author: ${c.author_name} <${c.author_email}>`
|
|
30829
|
+
].join("\n")).join("\n\n");
|
|
30820
30830
|
}
|
|
30821
30831
|
//#endregion
|
|
30822
30832
|
//#region src/generate/tools.ts
|
|
@@ -30898,16 +30908,28 @@ function generateTools(git, logger) {
|
|
|
30898
30908
|
//#region src/generate/index.ts
|
|
30899
30909
|
async function generateReleaseNote(cwd, options) {
|
|
30900
30910
|
const git = simpleGit(cwd);
|
|
30901
|
-
const commits = await getGitCommitsInfo(git, options.
|
|
30911
|
+
const commits = await getGitCommitsInfo(git, options.target);
|
|
30912
|
+
if (commits.length < 2) throw new Error(`Not enough commits found between the specified targets to generate release notes. Found ${commits.length} commit(s).`);
|
|
30902
30913
|
const provider = await resolveProvider(options.provider, options);
|
|
30903
30914
|
if (!provider) throw new Error(`Unsupported provider: ${options.provider}`);
|
|
30904
|
-
const
|
|
30915
|
+
const commitsMarkdown = buildCommitsMarkdown(commits);
|
|
30916
|
+
options.logger?.("=".repeat(80));
|
|
30917
|
+
options.logger?.(commitsMarkdown);
|
|
30918
|
+
options.logger?.("=".repeat(80));
|
|
30919
|
+
const steps = options.steps ?? numberClamp((commits.length + 1) * 2, 10, 100);
|
|
30920
|
+
options.logger?.(`Generating with "${options.provider}" using "${options.model}" in ${steps} steps...`);
|
|
30905
30921
|
const result = await generateText({
|
|
30906
30922
|
model: provider(options.model),
|
|
30907
|
-
prompt: buildUserPrompt(commits).trim(),
|
|
30908
|
-
system: buildSystemPrompt(maxSteps).trim(),
|
|
30909
30923
|
tools: generateTools(git, options.logger),
|
|
30910
|
-
stopWhen: stepCountIs(
|
|
30924
|
+
stopWhen: stepCountIs(steps),
|
|
30925
|
+
system: buildSystemPrompt(Math.floor(steps / 1.5)),
|
|
30926
|
+
messages: [{
|
|
30927
|
+
role: "user",
|
|
30928
|
+
content: "Here are the commits related to the release:"
|
|
30929
|
+
}, {
|
|
30930
|
+
role: "user",
|
|
30931
|
+
content: commitsMarkdown.trim()
|
|
30932
|
+
}]
|
|
30911
30933
|
});
|
|
30912
30934
|
return {
|
|
30913
30935
|
commits,
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("./chunk-Cek0wNdY.cjs");
|
|
6
|
-
const require_generate = require("./generate-
|
|
6
|
+
const require_generate = require("./generate-Co3HP4o3.cjs");
|
|
7
7
|
//#region src/index.ts
|
|
8
8
|
var src_default = require_generate.generateReleaseNote;
|
|
9
9
|
const releaseNote = require_generate.generateReleaseNote;
|
package/dist/index.d.cts
CHANGED
|
@@ -4759,6 +4759,10 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
|
|
|
4759
4759
|
unwrap(): T;
|
|
4760
4760
|
}
|
|
4761
4761
|
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
4762
|
+
interface ZodCustom<O = unknown, I = unknown> extends _ZodType<$ZodCustomInternals<O, I>>, $ZodCustom<O, I> {
|
|
4763
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
4764
|
+
}
|
|
4765
|
+
declare const ZodCustom: $constructor<ZodCustom>;
|
|
4762
4766
|
//#endregion
|
|
4763
4767
|
//#region node_modules/.pnpm/@ai-sdk+provider-utils@4.0.27_zod@4.4.3/node_modules/@ai-sdk/provider-utils/dist/index.d.ts
|
|
4764
4768
|
/**
|
|
@@ -6420,10 +6424,22 @@ declare global {
|
|
|
6420
6424
|
//#endregion
|
|
6421
6425
|
//#region src/config/config-schema.d.ts
|
|
6422
6426
|
declare const generateConfigSchema: ZodObject<{
|
|
6423
|
-
|
|
6424
|
-
tag: ZodString
|
|
6427
|
+
target: ZodDefault<ZodUnion<readonly [ZodObject<{
|
|
6428
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6429
|
+
offset: ZodOptional<ZodNumber>;
|
|
6425
6430
|
}, $strip>, ZodObject<{
|
|
6426
|
-
|
|
6431
|
+
prev: ZodUnion<readonly [ZodObject<{
|
|
6432
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6433
|
+
offset: ZodOptional<ZodNumber>;
|
|
6434
|
+
}, $strip>, ZodObject<{
|
|
6435
|
+
commit: ZodString;
|
|
6436
|
+
}, $strip>]>;
|
|
6437
|
+
current: ZodUnion<readonly [ZodObject<{
|
|
6438
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6439
|
+
offset: ZodOptional<ZodNumber>;
|
|
6440
|
+
}, $strip>, ZodObject<{
|
|
6441
|
+
commit: ZodString;
|
|
6442
|
+
}, $strip>]>;
|
|
6427
6443
|
}, $strip>]>>;
|
|
6428
6444
|
model: ZodString;
|
|
6429
6445
|
steps: ZodOptional<ZodNumber>;
|
package/dist/index.d.mts
CHANGED
|
@@ -4759,6 +4759,10 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
|
|
|
4759
4759
|
unwrap(): T;
|
|
4760
4760
|
}
|
|
4761
4761
|
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
4762
|
+
interface ZodCustom<O = unknown, I = unknown> extends _ZodType<$ZodCustomInternals<O, I>>, $ZodCustom<O, I> {
|
|
4763
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
4764
|
+
}
|
|
4765
|
+
declare const ZodCustom: $constructor<ZodCustom>;
|
|
4762
4766
|
//#endregion
|
|
4763
4767
|
//#region node_modules/.pnpm/@ai-sdk+provider-utils@4.0.27_zod@4.4.3/node_modules/@ai-sdk/provider-utils/dist/index.d.ts
|
|
4764
4768
|
/**
|
|
@@ -6420,10 +6424,22 @@ declare global {
|
|
|
6420
6424
|
//#endregion
|
|
6421
6425
|
//#region src/config/config-schema.d.ts
|
|
6422
6426
|
declare const generateConfigSchema: ZodObject<{
|
|
6423
|
-
|
|
6424
|
-
tag: ZodString
|
|
6427
|
+
target: ZodDefault<ZodUnion<readonly [ZodObject<{
|
|
6428
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6429
|
+
offset: ZodOptional<ZodNumber>;
|
|
6425
6430
|
}, $strip>, ZodObject<{
|
|
6426
|
-
|
|
6431
|
+
prev: ZodUnion<readonly [ZodObject<{
|
|
6432
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6433
|
+
offset: ZodOptional<ZodNumber>;
|
|
6434
|
+
}, $strip>, ZodObject<{
|
|
6435
|
+
commit: ZodString;
|
|
6436
|
+
}, $strip>]>;
|
|
6437
|
+
current: ZodUnion<readonly [ZodObject<{
|
|
6438
|
+
tag: ZodUnion<[ZodString, ZodCustom<RegExp, RegExp>]>;
|
|
6439
|
+
offset: ZodOptional<ZodNumber>;
|
|
6440
|
+
}, $strip>, ZodObject<{
|
|
6441
|
+
commit: ZodString;
|
|
6442
|
+
}, $strip>]>;
|
|
6427
6443
|
}, $strip>]>>;
|
|
6428
6444
|
model: ZodString;
|
|
6429
6445
|
steps: ZodOptional<ZodNumber>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __commonJSMin } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { n as require_token_util, r as require_token_error } from "./generate-
|
|
2
|
+
import { n as require_token_util, r as require_token_error } from "./generate-DrcKRdlK.mjs";
|
|
3
3
|
//#region node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
4
4
|
var require_token = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.cjs");
|
|
2
|
-
const require_generate = require("./generate-
|
|
2
|
+
const require_generate = require("./generate-Co3HP4o3.cjs");
|
|
3
3
|
//#region node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token.js
|
|
4
4
|
var require_token = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
5
5
|
var __defProp = Object.defineProperty;
|