@redpanda-data/docs-extensions-and-macros 5.51.0 → 5.51.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/mcp/CLI_INTERFACE.adoc
CHANGED
|
@@ -379,7 +379,7 @@ Test categories:
|
|
|
379
379
|
If a breaking change to the CLI is necessary:
|
|
380
380
|
|
|
381
381
|
. Update the CLI with the breaking change
|
|
382
|
-
.
|
|
382
|
+
. Mark the pull request as breaking with `!` after its type, for example `feat(cli)!: rename --tag to --ref`, so release-please cuts a major release
|
|
383
383
|
. Update the MCP server to handle both old and new interfaces (if possible)
|
|
384
384
|
. Update the CLI contract tests to verify the new interface
|
|
385
385
|
. Update this document with the new contract
|
package/mcp/DEVELOPMENT.adoc
CHANGED
|
@@ -487,17 +487,13 @@ All CLI commands have:
|
|
|
487
487
|
=== Before releasing
|
|
488
488
|
|
|
489
489
|
. Run all tests: `npm run test:mcp`
|
|
490
|
-
. Update version in `package.json`
|
|
491
490
|
. Update link:USER_GUIDE.adoc[USER_GUIDE.adoc] with any changes
|
|
492
491
|
. Test manually with Claude Code
|
|
493
492
|
. Check that setup command works: `npx doc-tools setup-mcp`
|
|
494
493
|
|
|
495
494
|
=== Publishing
|
|
496
495
|
|
|
497
|
-
.
|
|
498
|
-
. Tag the release: `git tag -a v1.2.3 -m "Release 1.2.3"`
|
|
499
|
-
. Push with tags: `git push --tags`
|
|
500
|
-
. Publish to npm: `npm publish`
|
|
496
|
+
Do not change the version, tag, or run `npm publish` by hand. Give your pull request a conventional-commit title (`feat(mcp): ...` or `fix(mcp): ...`). After it merges, release-please adds it to the open release pull request, and merging that pull request tags and publishes the release. See the Releases section of link:../CONTRIBUTING.adoc[CONTRIBUTING.adoc].
|
|
501
497
|
|
|
502
498
|
=== After releasing
|
|
503
499
|
|
package/package.json
CHANGED
|
@@ -2848,14 +2848,20 @@ async function generateRpkDocs(options = {}) {
|
|
|
2848
2848
|
// Build subcommands with correct xref paths
|
|
2849
2849
|
// Filter out excluded and asPartial subcommands — excluded have no file,
|
|
2850
2850
|
// asPartial ones live in the partials directory with no linkable xref.
|
|
2851
|
+
// The exception is a parent that is itself asPartial: its partial is
|
|
2852
|
+
// included by a stub in the component that publishes the whole subtree
|
|
2853
|
+
// (rpk sql in cloud-docs, rpk ai in adp-docs), so relative xrefs to its
|
|
2854
|
+
// children resolve there, the same way rpk cloud partials link.
|
|
2851
2855
|
// rpk cloud and rpk security secret rows stay in the table: their pages
|
|
2852
2856
|
// are routed to the cloud partials directory and published by
|
|
2853
2857
|
// cloud-docs, so the xref below links across to the cloud component
|
|
2854
2858
|
// instead of dropping the row (which hid the subcommand entirely).
|
|
2859
|
+
const parentIsPartial = shouldUsePartialDir(resolvedOverrides, commandPath)
|
|
2855
2860
|
const subcommands = (command.commands || [])
|
|
2856
2861
|
.filter(sub => {
|
|
2857
2862
|
const subPath = `${commandPath} ${sub.name}`
|
|
2858
|
-
return !shouldExcludeCommand(resolvedOverrides, subPath) &&
|
|
2863
|
+
return !shouldExcludeCommand(resolvedOverrides, subPath) &&
|
|
2864
|
+
(parentIsPartial || !shouldUsePartialDir(resolvedOverrides, subPath))
|
|
2859
2865
|
})
|
|
2860
2866
|
.map(sub => {
|
|
2861
2867
|
const subPath = `${commandPath} ${sub.name}`
|
|
@@ -1137,15 +1137,21 @@ const WHATS_NEW_EXCLUDED_SUBTREES = ['rpk ai']
|
|
|
1137
1137
|
|
|
1138
1138
|
/**
|
|
1139
1139
|
* Return a copy of diffData without entries under the excluded subtrees.
|
|
1140
|
+
* Commands marked asPartial in the overrides are dropped too: they render
|
|
1141
|
+
* only as partials single-sourced into another component (for example,
|
|
1142
|
+
* rpk sql for Redpanda SQL in Cloud), so they are not Self-Managed changes.
|
|
1140
1143
|
* Only the published What's-new block filters; diff reports and PR
|
|
1141
1144
|
* summaries keep the full picture.
|
|
1142
1145
|
* @param {Object} diffData - Diff from generateRpkDiff
|
|
1143
1146
|
* @param {string[]} [excluded] - Command-path prefixes to drop
|
|
1147
|
+
* @param {Object} [overridesData] - rpk overrides; asPartial subtrees are dropped
|
|
1144
1148
|
* @returns {Object} Filtered copy
|
|
1145
1149
|
*/
|
|
1146
|
-
function filterDiffForWhatsNew(diffData, excluded = WHATS_NEW_EXCLUDED_SUBTREES) {
|
|
1150
|
+
function filterDiffForWhatsNew(diffData, excluded = WHATS_NEW_EXCLUDED_SUBTREES, overridesData = null) {
|
|
1151
|
+
const resolved = overridesData ? resolveReferences(overridesData, overridesData) : null
|
|
1147
1152
|
const outside = (cmdPath) => !excluded.some(prefix =>
|
|
1148
|
-
cmdPath === prefix || (typeof cmdPath === 'string' && cmdPath.startsWith(prefix + ' ')))
|
|
1153
|
+
cmdPath === prefix || (typeof cmdPath === 'string' && cmdPath.startsWith(prefix + ' '))) &&
|
|
1154
|
+
!(resolved && typeof cmdPath === 'string' && shouldUsePartialDir(resolved, cmdPath))
|
|
1149
1155
|
const details = diffData.details || {}
|
|
1150
1156
|
const filteredDetails = { ...details }
|
|
1151
1157
|
for (const key of ['newCommands', 'newlyDeprecatedCommands', 'removedCommands', 'descriptionChanges']) {
|
|
@@ -1167,7 +1173,28 @@ function updateWhatsNewFile(diffData, whatsNewPath, version, options = {}) {
|
|
|
1167
1173
|
...options
|
|
1168
1174
|
})
|
|
1169
1175
|
|
|
1176
|
+
const startMarker = `// AUTOGEN-RPK-CHANGES ${version} START`
|
|
1177
|
+
const endMarker = `// AUTOGEN-RPK-CHANGES ${version} END`
|
|
1178
|
+
const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
1179
|
+
|
|
1170
1180
|
if (!whatsNewContent) {
|
|
1181
|
+
// A re-run for a version that now has nothing to publish (for example,
|
|
1182
|
+
// every change was filtered out as asPartial) must remove that version's
|
|
1183
|
+
// earlier block, or the page keeps publishing what the filter excluded.
|
|
1184
|
+
if (fs.existsSync(whatsNewPath)) {
|
|
1185
|
+
const existing = fs.readFileSync(whatsNewPath, 'utf8')
|
|
1186
|
+
if (existing.includes(startMarker)) {
|
|
1187
|
+
const blockRe = new RegExp(`\\n*${escapeRe(startMarker)}[\\s\\S]*?${escapeRe(endMarker)}\\n*`)
|
|
1188
|
+
let updated = existing.replace(blockRe, '\n\n')
|
|
1189
|
+
// Drop the section heading too if the block was all it held, so no
|
|
1190
|
+
// empty heading is left on the page.
|
|
1191
|
+
const emptySectionRe = new RegExp(`^${escapeRe(sectionHeading)}[^\\n]*\\n\\s*(?=^== |(?![\\s\\S]))`, 'm')
|
|
1192
|
+
updated = updated.replace(emptySectionRe, '')
|
|
1193
|
+
fs.writeFileSync(whatsNewPath, updated.replace(/\s*$/, '\n'), 'utf8')
|
|
1194
|
+
console.log(`Removed ${version} block from what's-new file (no changes left to publish): ${whatsNewPath}`)
|
|
1195
|
+
return
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1171
1198
|
console.log('No Redpanda CLI changes to add to what\'s new')
|
|
1172
1199
|
return
|
|
1173
1200
|
}
|
|
@@ -1187,11 +1214,8 @@ function updateWhatsNewFile(diffData, whatsNewPath, version, options = {}) {
|
|
|
1187
1214
|
// Redpanda CLI section instead of being dropped. Writers can edit or
|
|
1188
1215
|
// remove blocks freely; the automation only ever touches content between
|
|
1189
1216
|
// its own markers for the same version label.
|
|
1190
|
-
const startMarker = `// AUTOGEN-RPK-CHANGES ${version} START`
|
|
1191
|
-
const endMarker = `// AUTOGEN-RPK-CHANGES ${version} END`
|
|
1192
1217
|
const sectionBody = whatsNewContent.replace(/^== [^\n]*\n+/, '')
|
|
1193
1218
|
const block = `${startMarker}\n${sectionBody.trimEnd()}\n${endMarker}`
|
|
1194
|
-
const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
1195
1219
|
|
|
1196
1220
|
if (existingContent.includes(startMarker)) {
|
|
1197
1221
|
// Replace this version's existing block (idempotent re-runs)
|
|
@@ -2145,7 +2169,7 @@ async function handleRpkDocsGeneration(options = {}) {
|
|
|
2145
2169
|
|
|
2146
2170
|
// Update what's-new file if requested
|
|
2147
2171
|
if (whatsNewPath) {
|
|
2148
|
-
updateWhatsNewFile(filterDiffForWhatsNew(diffData), whatsNewPath, rpkVersion, { linkable: makeLinkablePredicate(overridesData), hasSubcommands: makeSubcommandPredicate(tree) })
|
|
2172
|
+
updateWhatsNewFile(filterDiffForWhatsNew(diffData, WHATS_NEW_EXCLUDED_SUBTREES, overridesData), whatsNewPath, rpkVersion, { linkable: makeLinkablePredicate(overridesData), hasSubcommands: makeSubcommandPredicate(tree) })
|
|
2149
2173
|
}
|
|
2150
2174
|
} else {
|
|
2151
2175
|
console.warn(`Warning: Could not load previous version ${diffVersion} for diff`)
|
|
@@ -2467,7 +2491,7 @@ async function handleRpkDocsGeneration(options = {}) {
|
|
|
2467
2491
|
|
|
2468
2492
|
// Update what's-new file if requested
|
|
2469
2493
|
if (whatsNewPath) {
|
|
2470
|
-
updateWhatsNewFile(filterDiffForWhatsNew(diffData), whatsNewPath, rpkVersion, { linkable: makeLinkablePredicate(overridesData), hasSubcommands: makeSubcommandPredicate(tree) })
|
|
2494
|
+
updateWhatsNewFile(filterDiffForWhatsNew(diffData, WHATS_NEW_EXCLUDED_SUBTREES, overridesData), whatsNewPath, rpkVersion, { linkable: makeLinkablePredicate(overridesData), hasSubcommands: makeSubcommandPredicate(tree) })
|
|
2471
2495
|
}
|
|
2472
2496
|
} else {
|
|
2473
2497
|
console.warn(`Warning: Could not load previous version ${diffVersion} for diff`)
|