mirror of
https://github.com/unraid/api.git
synced 2026-01-03 15:09:48 -06:00
- **New Features** - Created a dynamic plugin system for the API to enable community augmentation of GraphQL, CLI, and Cron functionalities capabilities. - Included an example plugin under `packages/unraid-api-plugin-health` that adds a new graphql query for API health checks. - Added `rc.unraid-api` commands for backing up, restoring, and installing production dependencies, streamlining maintenance and deployment. - Improved dependency vendoring by bundling a versioned pnpm store (instead of `node_modules`). Versioning will allow users to add plugins to a specific api release without requiring an internet connection on subsequent reboots. - **Chores** - Upgraded build workflows and versioning processes to ensure more reliable artifact handling and production packaging.
41 lines
997 B
TypeScript
41 lines
997 B
TypeScript
import conventionalChangelog from "conventional-changelog";
|
|
|
|
import { PluginEnv } from "../cli/setup-plugin-environment";
|
|
|
|
export const getStagingChangelogFromGit = async ({
|
|
pluginVersion,
|
|
tag,
|
|
}: Pick<PluginEnv, "pluginVersion" | "tag">): Promise<string> => {
|
|
try {
|
|
const changelogStream = conventionalChangelog(
|
|
{
|
|
preset: "conventionalcommits",
|
|
},
|
|
{
|
|
version: pluginVersion,
|
|
},
|
|
tag
|
|
? {
|
|
from: "origin/main",
|
|
to: "HEAD",
|
|
}
|
|
: {},
|
|
undefined,
|
|
tag
|
|
? {
|
|
headerPartial: `## [${tag}](https://github.com/unraid/api/${tag})\n\n`,
|
|
}
|
|
: undefined
|
|
);
|
|
let changelog = "";
|
|
for await (const chunk of changelogStream) {
|
|
changelog += chunk;
|
|
}
|
|
// Encode HTML entities using the 'he' library
|
|
return changelog ?? "";
|
|
} catch (err) {
|
|
console.log('Non-fatal error: Failed to get changelog from git:', err);
|
|
return tag;
|
|
}
|
|
};
|