@redpanda-data/docs-extensions-and-macros 4.12.1 โ 4.12.3
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/bin/doc-tools.js +354 -89
- package/extensions/algolia-indexer/generate-index.js +43 -27
- package/package.json +1 -1
- package/tools/property-extractor/Makefile +63 -8
- package/tools/property-extractor/README.adoc +973 -621
- package/tools/property-extractor/compare-properties.js +10 -6
- package/tools/property-extractor/generate-handlebars-docs.js +9 -6
- package/tools/property-extractor/property_extractor.py +93 -10
- package/tools/property-extractor/templates/topic-property-mappings.hbs +6 -1
- package/tools/property-extractor/templates/topic-property.hbs +1 -1
- package/tools/property-extractor/topic_property_extractor.py +269 -65
- package/tools/redpanda-connect/README.adoc +736 -0
- package/tools/redpanda-connect/helpers/renderConnectFields.js +73 -29
- package/tools/redpanda-connect/helpers/renderLeafField.js +10 -3
- package/tools/redpanda-connect/helpers/renderYamlList.js +7 -2
- package/tools/redpanda-connect/helpers/toYaml.js +8 -3
- package/tools/redpanda-connect/report-delta.js +64 -2
|
@@ -27,7 +27,10 @@ TREE_SITTER := npx tree-sitter
|
|
|
27
27
|
# Output directory configuration (can be overridden by environment variables)
|
|
28
28
|
OUTPUT_AUTOGENERATED_DIR ?= $(REPO_ROOT)/modules/reference
|
|
29
29
|
OUTPUT_ASCIIDOC_DIR ?= $(OUTPUT_AUTOGENERATED_DIR)/pages
|
|
30
|
-
|
|
30
|
+
# Always save versioned JSON files to attachments directory
|
|
31
|
+
OUTPUT_JSON_DIR ?= $(OUTPUT_AUTOGENERATED_DIR)/attachments
|
|
32
|
+
# Diff JSON files are saved to overrides directory (if OVERRIDES is specified)
|
|
33
|
+
OUTPUT_DIFF_DIR ?= $(if $(OVERRIDES),$(or $(dir $(OVERRIDES)),$(OUTPUT_AUTOGENERATED_DIR)/attachments),$(OUTPUT_AUTOGENERATED_DIR)/attachments)
|
|
31
34
|
OUTPUT_PARTIALS_DIR ?= $(OUTPUT_AUTOGENERATED_DIR)/partials
|
|
32
35
|
|
|
33
36
|
# --- Main build: venv, fetch code, build parser, extract & docgen ---
|
|
@@ -61,7 +64,7 @@ venv: $(TOOL_ROOT)/requirements.txt
|
|
|
61
64
|
fi; \
|
|
62
65
|
echo "๐ Upgrading pip and installing requirements..."; \
|
|
63
66
|
$(VENV)/bin/pip install --upgrade pip --quiet; \
|
|
64
|
-
$(VENV)/bin/pip install --no-cache-dir -r
|
|
67
|
+
$(VENV)/bin/pip install --no-cache-dir -r $< --quiet;
|
|
65
68
|
|
|
66
69
|
# --- Clean out all generated state ---
|
|
67
70
|
clean:
|
|
@@ -120,20 +123,70 @@ generate-docs: node-deps
|
|
|
120
123
|
@echo "๐ Copying properties JSON files to $(OUTPUT_JSON_DIR)โฆ"
|
|
121
124
|
@if [ -f "$(TOOL_ROOT)/gen/$(TAG)-properties.json" ]; then \
|
|
122
125
|
echo " Source: $(TOOL_ROOT)/gen/$(TAG)-properties.json"; \
|
|
123
|
-
echo " Target: $(OUTPUT_JSON_DIR)
|
|
124
|
-
cp "$(TOOL_ROOT)/gen/$(TAG)-properties.json" "$(OUTPUT_JSON_DIR)/" && \
|
|
125
|
-
echo " โ
Successfully copied
|
|
126
|
-
{ echo " โ Failed to copy
|
|
127
|
-
if [ -f "$(OUTPUT_JSON_DIR)
|
|
128
|
-
echo " ๐ Verification: Target file exists and has $$(wc -c < "$(OUTPUT_JSON_DIR)
|
|
126
|
+
echo " Target: $(OUTPUT_JSON_DIR)/redpanda-properties-$(TAG).json"; \
|
|
127
|
+
cp "$(TOOL_ROOT)/gen/$(TAG)-properties.json" "$(OUTPUT_JSON_DIR)/redpanda-properties-$(TAG).json" && \
|
|
128
|
+
echo " โ
Successfully copied redpanda-properties-$(TAG).json" || \
|
|
129
|
+
{ echo " โ Failed to copy redpanda-properties-$(TAG).json"; exit 1; }; \
|
|
130
|
+
if [ -f "$(OUTPUT_JSON_DIR)/redpanda-properties-$(TAG).json" ]; then \
|
|
131
|
+
echo " ๐ Verification: Target file exists and has $$(wc -c < "$(OUTPUT_JSON_DIR)/redpanda-properties-$(TAG).json") bytes"; \
|
|
129
132
|
else \
|
|
130
133
|
echo " โ Verification failed: Target file does not exist"; exit 1; \
|
|
131
134
|
fi; \
|
|
132
135
|
else \
|
|
133
136
|
echo " โ ๏ธ Source file $(TOOL_ROOT)/gen/$(TAG)-properties.json not found, skipping copy"; \
|
|
134
137
|
fi
|
|
138
|
+
@echo "๐งน Cleaning up old versioned JSON files (keeping only 2 most recent)โฆ"
|
|
139
|
+
@cd "$(OUTPUT_JSON_DIR)" && \
|
|
140
|
+
ls -t redpanda-properties-*.json 2>/dev/null | tail -n +3 | while read file; do \
|
|
141
|
+
echo " Removing old file: $$file"; \
|
|
142
|
+
rm -f "$$file"; \
|
|
143
|
+
done || true
|
|
135
144
|
@echo "โ
Docs generated at $(OUTPUT_AUTOGENERATED_DIR)"
|
|
136
145
|
|
|
146
|
+
# --- Compare two property files and generate a diff report ---
|
|
147
|
+
# Usage: make compare OLD_TAG=v25.2.1 NEW_TAG=v25.2.9 OVERRIDES=path/to/overrides.json
|
|
148
|
+
# This will compare the two versions and save the diff to the overrides directory
|
|
149
|
+
compare:
|
|
150
|
+
@if [ -z "$(OLD_TAG)" ] || [ -z "$(NEW_TAG)" ]; then \
|
|
151
|
+
echo "โ Error: Both OLD_TAG and NEW_TAG must be specified"; \
|
|
152
|
+
echo " Usage: make compare OLD_TAG=v25.2.1 NEW_TAG=v25.2.9 OVERRIDES=path/to/overrides.json"; \
|
|
153
|
+
exit 1; \
|
|
154
|
+
fi
|
|
155
|
+
@if [ -z "$(OVERRIDES)" ]; then \
|
|
156
|
+
echo "โ Error: OVERRIDES must be specified to determine where to save the diff"; \
|
|
157
|
+
echo " Usage: make compare OLD_TAG=v25.2.1 NEW_TAG=v25.2.9 OVERRIDES=path/to/overrides.json"; \
|
|
158
|
+
exit 1; \
|
|
159
|
+
fi
|
|
160
|
+
@if [ ! -f "$(OUTPUT_JSON_DIR)/redpanda-properties-$(OLD_TAG).json" ]; then \
|
|
161
|
+
echo "โ Error: Old properties file not found: $(OUTPUT_JSON_DIR)/redpanda-properties-$(OLD_TAG).json"; \
|
|
162
|
+
exit 1; \
|
|
163
|
+
fi
|
|
164
|
+
@if [ ! -f "$(OUTPUT_JSON_DIR)/redpanda-properties-$(NEW_TAG).json" ]; then \
|
|
165
|
+
echo "โ Error: New properties file not found: $(OUTPUT_JSON_DIR)/redpanda-properties-$(NEW_TAG).json"; \
|
|
166
|
+
exit 1; \
|
|
167
|
+
fi
|
|
168
|
+
@echo "Comparing $(OLD_TAG) โ $(NEW_TAG)"
|
|
169
|
+
@echo " Diff will be saved to: $(OUTPUT_DIFF_DIR)"
|
|
170
|
+
@cd $(TOOL_ROOT) && \
|
|
171
|
+
node compare-properties.js \
|
|
172
|
+
"$(OUTPUT_JSON_DIR)/redpanda-properties-$(OLD_TAG).json" \
|
|
173
|
+
"$(OUTPUT_JSON_DIR)/redpanda-properties-$(NEW_TAG).json" \
|
|
174
|
+
$(OLD_TAG) \
|
|
175
|
+
$(NEW_TAG) \
|
|
176
|
+
"$(OUTPUT_DIFF_DIR)" \
|
|
177
|
+
"redpanda-property-changes-$(OLD_TAG)-to-$(NEW_TAG).json"
|
|
178
|
+
@echo "โ
Diff saved to $(OUTPUT_DIFF_DIR)/redpanda-property-changes-$(OLD_TAG)-to-$(NEW_TAG).json"
|
|
179
|
+
@$(MAKE) cleanup-diffs OVERRIDES="$(OVERRIDES)"
|
|
180
|
+
|
|
181
|
+
# --- Helper target to cleanup old diff files ---
|
|
182
|
+
cleanup-diffs:
|
|
183
|
+
@echo "๐งน Cleaning up old diff JSON files (keeping only 2 most recent)โฆ"
|
|
184
|
+
@cd "$(OUTPUT_DIFF_DIR)" && \
|
|
185
|
+
ls -t redpanda-property-changes-*.json 2>/dev/null | tail -n +3 | while read file; do \
|
|
186
|
+
echo " Removing old file: $$file"; \
|
|
187
|
+
rm -f "$$file"; \
|
|
188
|
+
done || true
|
|
189
|
+
|
|
137
190
|
# --- Debug helper to print all the key paths/vars ---
|
|
138
191
|
check:
|
|
139
192
|
@echo "MODULE_ROOT: $(MODULE_ROOT)"
|
|
@@ -142,6 +195,8 @@ check:
|
|
|
142
195
|
@echo "TREESITTER: $(TREESITTER_DIR)"
|
|
143
196
|
@echo "VENV: $(VENV)"
|
|
144
197
|
@echo "PYTHON: $(PYTHON)"
|
|
198
|
+
@echo "OVERRIDES: $(OVERRIDES)"
|
|
145
199
|
@echo "OUTPUT_ASCIIDOC_DIR: $(OUTPUT_ASCIIDOC_DIR)"
|
|
146
200
|
@echo "OUTPUT_JSON_DIR: $(OUTPUT_JSON_DIR)"
|
|
201
|
+
@echo "OUTPUT_DIFF_DIR: $(OUTPUT_DIFF_DIR)"
|
|
147
202
|
@echo "OUTPUT_AUTOGENERATED_DIR: $(OUTPUT_AUTOGENERATED_DIR)"
|