mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-24 22:48:06 +00:00
f7bf437dcf
As noted in #30714, and to make the Minimum Release Age page a "one-stop-shop", we can generate the documentation accordingly. Using an orange "maybe" for support helps nudge folks to checking which registry they're using, and noting that it still doesn't necessarily work, even if the Datasource supports it. Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
import { getDatasources } from '../../lib/modules/datasource/index.ts';
|
|
import { readFile, updateFile } from '../utils/index.ts';
|
|
import { getDisplayName, replaceContent } from './utils.ts';
|
|
|
|
export async function generateDatasourceReleaseTimestampSupportForMinimumReleaseAge(
|
|
dist: string,
|
|
): Promise<void> {
|
|
const datasources = getDatasources();
|
|
|
|
let tableContent = '| Datasource | Supports release timestamp? | Notes |\n';
|
|
tableContent += '| :-- | :-: | :-- |\n';
|
|
|
|
for (const [datasource, definition] of datasources) {
|
|
const displayName = getDisplayName(datasource, definition);
|
|
const { releaseTimestampSupport, releaseTimestampNote } = definition;
|
|
const supported = releaseTimestampSupport
|
|
? '🟠<br>Maybe<sup>1</sup>'
|
|
: '❌';
|
|
tableContent += `| [${displayName}](../modules/datasource/${datasource}/index.md) | ${supported} | ${releaseTimestampNote ?? ''} |\n`;
|
|
}
|
|
|
|
tableContent +=
|
|
'\n<sup>1</sup> Whether release timestamps are actually available depends on the registry you use - check [Which registries support release timestamps?](#which-registries-support-release-timestamps).\n';
|
|
|
|
let content = await readFile(
|
|
'docs/usage/key-concepts/minimum-release-age.md',
|
|
);
|
|
content = replaceContent(
|
|
content,
|
|
`${tableContent}\n`,
|
|
'<!-- Autogenerate datasourceReleaseTimestampSupport -->',
|
|
);
|
|
await updateFile(`${dist}/key-concepts/minimum-release-age.md`, content);
|
|
}
|