@redpanda-data/docs-extensions-and-macros 4.10.4 → 4.10.6
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/package.json
CHANGED
package/tools/bundle-openapi.js
CHANGED
|
@@ -28,21 +28,15 @@ function normalizeTag(tag) {
|
|
|
28
28
|
throw new Error('Invalid version format: tag cannot be empty');
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
// Handle dev branch
|
|
32
|
-
if (tag === 'dev') {
|
|
33
|
-
return 'dev';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
31
|
// Remove 'v' prefix if present
|
|
37
32
|
const normalized = tag.startsWith('v') ? tag.slice(1) : tag;
|
|
38
|
-
|
|
39
33
|
// Validate semantic version format
|
|
40
34
|
const semverPattern = /^\d+\.\d+\.\d+(-[\w\.-]+)?(\+[\w\.-]+)?$/;
|
|
41
|
-
if (
|
|
42
|
-
|
|
35
|
+
if (semverPattern.test(normalized)) {
|
|
36
|
+
return normalized;
|
|
43
37
|
}
|
|
44
|
-
|
|
45
|
-
return
|
|
38
|
+
// If not a valid semver, treat as branch name and return as-is
|
|
39
|
+
return tag;
|
|
46
40
|
}
|
|
47
41
|
|
|
48
42
|
/**
|
|
@@ -59,22 +53,20 @@ function getMajorMinor(version) {
|
|
|
59
53
|
throw new Error('Version must be a non-empty string');
|
|
60
54
|
}
|
|
61
55
|
|
|
62
|
-
if (
|
|
63
|
-
|
|
56
|
+
// Only process if valid semver, else return as-is (branch name)
|
|
57
|
+
const semverPattern = /^\d+\.\d+\.\d+(-[\w\.-]+)?(\+[\w\.-]+)?$/;
|
|
58
|
+
if (!semverPattern.test(version)) {
|
|
59
|
+
return version;
|
|
64
60
|
}
|
|
65
|
-
|
|
66
61
|
const parts = version.split('.');
|
|
67
62
|
if (parts.length < 2) {
|
|
68
63
|
throw new Error(`Invalid version format: ${version}. Expected X.Y.Z format`);
|
|
69
64
|
}
|
|
70
|
-
|
|
71
65
|
const major = parseInt(parts[0], 10);
|
|
72
66
|
const minor = parseInt(parts[1], 10);
|
|
73
|
-
|
|
74
67
|
if (isNaN(major) || isNaN(minor)) {
|
|
75
68
|
throw new Error(`Major and minor versions must be numbers: ${version}`);
|
|
76
69
|
}
|
|
77
|
-
|
|
78
70
|
return `${major}.${minor}`;
|
|
79
71
|
}
|
|
80
72
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const AUTOGEN_NOTICE = '// This content is autogenerated. Do not edit manually. To override descriptions, use the doc-tools CLI with the --overrides option: https://redpandadata.atlassian.net/wiki/spaces/DOC/pages/1396244485/Review+Redpanda+configuration+properties\n';
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
const fs = require('fs');
|
|
@@ -144,7 +145,7 @@ function generatePropertyPartials(properties, partialsDir) {
|
|
|
144
145
|
const selectedTemplate = type === 'topic' ? topicTemplate : propertyTemplate;
|
|
145
146
|
const content = props.map(p => selectedTemplate(p)).join('\n');
|
|
146
147
|
const filename = `${type}-properties.adoc`;
|
|
147
|
-
|
|
148
|
+
fs.writeFileSync(path.join(propertiesPartialsDir, filename), AUTOGEN_NOTICE + content, 'utf8');
|
|
148
149
|
console.log(`✅ Generated ${filename} (${props.length} properties)`);
|
|
149
150
|
totalCount += props.length;
|
|
150
151
|
});
|
|
@@ -183,7 +184,7 @@ function generateDeprecatedDocs(properties, outputDir) {
|
|
|
183
184
|
: path.join(outputDir, 'partials', 'deprecated', 'deprecated-properties.adoc');
|
|
184
185
|
|
|
185
186
|
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
186
|
-
fs.writeFileSync(outputPath, output, 'utf8');
|
|
187
|
+
fs.writeFileSync(outputPath, AUTOGEN_NOTICE + output, 'utf8');
|
|
187
188
|
console.log(`✅ Generated ${outputPath}`);
|
|
188
189
|
return deprecatedProperties.length;
|
|
189
190
|
}
|
|
@@ -211,7 +212,7 @@ function generateTopicPropertyMappings(properties, partialsDir) {
|
|
|
211
212
|
const hbs = handlebars.compile(hbsSource);
|
|
212
213
|
const rendered = hbs({ topicProperties });
|
|
213
214
|
const mappingsOut = path.join(partialsDir, 'topic-property-mappings.adoc');
|
|
214
|
-
fs.writeFileSync(mappingsOut, rendered, 'utf8');
|
|
215
|
+
fs.writeFileSync(mappingsOut, AUTOGEN_NOTICE + rendered, 'utf8');
|
|
215
216
|
console.log(`✅ Generated ${mappingsOut}`);
|
|
216
217
|
return topicProperties.length;
|
|
217
218
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{{#with examples}}
|
|
2
|
-
// This content is autogenerated. Do not edit manually.
|
|
2
|
+
// This content is autogenerated. Do not edit manually. To override descriptions, use the doc-tools CLI with the --overrides option: https://redpandadata.atlassian.net/wiki/spaces/DOC/pages/1247543314/Generate+reference+docs+for+Redpanda+Connect
|
|
3
3
|
|
|
4
4
|
== Examples
|
|
5
5
|
|