This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch feature/versioned-offline-docs-bundle
in repository https://gitbox.apache.org/repos/asf/camel-website.git
The following commit(s) were added to
refs/heads/feature/versioned-offline-docs-bundle by this push:
new de4ee2ca CAMEL-23788: include Camel Catalog and YAML DSL schema in
offline bundle
de4ee2ca is described below
commit de4ee2cab7bbbbb9b6647323e9b61bc1bb0b35c8
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Jun 17 16:08:24 2026 +0200
CAMEL-23788: include Camel Catalog and YAML DSL schema in offline bundle
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
.github/workflows/offline-bundle.yml | 2 +-
llms-txt-template.md | 6 ++-
scripts/generate-offline-bundle.js | 73 +++++++++++++++++++++++++++++++++++-
3 files changed, 77 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/offline-bundle.yml
b/.github/workflows/offline-bundle.yml
index 9822eb48..6f39a781 100644
--- a/.github/workflows/offline-bundle.yml
+++ b/.github/workflows/offline-bundle.yml
@@ -54,7 +54,7 @@ jobs:
TITLE="Apache Camel ${{ inputs.camel_version }} — Offline
Documentation"
NOTES="Offline documentation bundle for Apache Camel ${{
inputs.camel_version }}.
- Contains all Markdown files for all connectors/components (350+) and
the user manual.
+ Contains all Markdown documentation for connectors/components (350+)
and the user manual, plus the Camel Catalog (JSON metadata for all components,
data formats, languages) and the YAML DSL canonical JSON Schema.
Download and unzip locally for AI coding agents or environments with
restricted internet access."
diff --git a/llms-txt-template.md b/llms-txt-template.md
index d78b5c09..e539ddc3 100644
--- a/llms-txt-template.md
+++ b/llms-txt-template.md
@@ -13,7 +13,11 @@ For agents or environments with no or restricted internet
access, versioned offl
- [Camel
4.18](https://github.com/apache/camel-website/releases/download/docs-4.18/camel-docs-4.18.zip)
- [Camel
4.14](https://github.com/apache/camel-website/releases/download/docs-4.14/camel-docs-4.14.zip)
-Download the zip matching your Camel version, unzip it locally, and read the
`.md` files from there. Each bundle preserves the site directory structure and
includes all connectors/components (350+) and the user manual.
+Download the zip matching your Camel version, unzip it locally, and read the
files from there. Each bundle includes:
+- All connectors/components documentation (350+ as Markdown)
+- The user manual (Markdown)
+- The Camel Catalog — machine-readable JSON metadata for every component, data
format, language, and EIP (parameters, types, defaults, descriptions)
+- The YAML DSL canonical JSON Schema — the definitive spec for validating and
generating Camel YAML routes (`catalog/schema/camelYamlDsl-canonical.json`)
## Key facts
diff --git a/scripts/generate-offline-bundle.js
b/scripts/generate-offline-bundle.js
index 226d92e2..7de6cefe 100644
--- a/scripts/generate-offline-bundle.js
+++ b/scripts/generate-offline-bundle.js
@@ -3,6 +3,11 @@ const path = require('path');
const { execFileSync } = require('child_process');
const PUBLIC_DIR = 'public';
+const CAMEL_REPO = 'apache/camel';
+const CATALOG_BASE =
'catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog';
+const YAML_SCHEMA_PATH =
'dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl-canonical.json';
+
+const CATALOG_DIRS = ['components', 'dataformats', 'languages', 'models',
'others'];
const VERSION_DIRS = [
'components'
@@ -12,6 +17,63 @@ const SHARED_DIRS = [
'manual'
];
+function fetchCatalogAndSchema(version) {
+ const branch = `camel-${version}.x`;
+ const catalogDir = path.join(PUBLIC_DIR, 'catalog');
+
+ console.log(`\nFetching catalog and YAML DSL schema from
${CAMEL_REPO}@${branch}...`);
+
+ // fetch YAML DSL canonical schema
+ const schemaDir = path.join(catalogDir, 'schema');
+ fs.mkdirSync(schemaDir, { recursive: true });
+ try {
+ const schema = execFileSync('gh', [
+ 'api', `repos/${CAMEL_REPO}/contents/${YAML_SCHEMA_PATH}?ref=${branch}`,
+ '--jq', '.content'
+ ], { encoding: 'utf8' });
+ fs.writeFileSync(
+ path.join(schemaDir, 'camelYamlDsl-canonical.json'),
+ Buffer.from(schema.trim(), 'base64').toString('utf8')
+ );
+ console.log(' Fetched schema/camelYamlDsl-canonical.json');
+ } catch (error) {
+ console.warn(` Could not fetch YAML DSL schema: ${error.message}`);
+ }
+
+ // fetch catalog JSON files for each category
+ for (const dir of CATALOG_DIRS) {
+ const targetDir = path.join(catalogDir, dir);
+ fs.mkdirSync(targetDir, { recursive: true });
+ try {
+ const files = execFileSync('gh', [
+ 'api',
`repos/${CAMEL_REPO}/contents/${CATALOG_BASE}/${dir}?ref=${branch}`,
+ '--jq', '.[].name'
+ ], { encoding: 'utf8' }).trim().split('\n').filter(f =>
f.endsWith('.json'));
+
+ console.log(` Fetching catalog/${dir}/ (${files.length} files)...`);
+
+ for (const file of files) {
+ try {
+ const content = execFileSync('gh', [
+ 'api',
`repos/${CAMEL_REPO}/contents/${CATALOG_BASE}/${dir}/${file}?ref=${branch}`,
+ '--jq', '.content'
+ ], { encoding: 'utf8' });
+ fs.writeFileSync(
+ path.join(targetDir, file),
+ Buffer.from(content.trim(), 'base64').toString('utf8')
+ );
+ } catch {
+ // skip individual file failures silently
+ }
+ }
+ } catch (error) {
+ console.warn(` Could not fetch catalog/${dir}: ${error.message}`);
+ }
+ }
+
+ return fs.existsSync(catalogDir);
+}
+
function main() {
const version = process.argv[2];
if (!version) {
@@ -60,16 +122,23 @@ function main() {
includePaths.push('llms.txt');
}
+ // fetch catalog and YAML DSL schema from the camel repo
+ if (fetchCatalogAndSchema(version)) {
+ includePaths.push('catalog/*');
+ }
+
// remove stale bundle
if (fs.existsSync(bundlePath)) {
fs.unlinkSync(bundlePath);
}
- // build zip: include only .md files from the selected directories, plus
llms.txt
+ // build zip: include .md files from doc dirs, plus .json from catalog, plus
llms.txt
const zipArgs = ['-r', '-q', bundleName, '.'];
for (const p of includePaths) {
if (p === 'llms.txt') {
zipArgs.push('-i', 'llms.txt');
+ } else if (p.startsWith('catalog/')) {
+ zipArgs.push('-i', `${p}.json`);
} else {
zipArgs.push('-i', `${p}.md`);
}
@@ -79,7 +148,7 @@ function main() {
execFileSync('zip', zipArgs, { cwd: PUBLIC_DIR, stdio: 'inherit' });
const sizeMb = (fs.statSync(bundlePath).size / (1024 * 1024)).toFixed(1);
- console.log(`Generated ${bundleName} (${sizeMb} MB)`);
+ console.log(`\nGenerated ${bundleName} (${sizeMb} MB)`);
} catch (error) {
console.error(`Failed to generate ${bundleName}:`, error.message);
process.exit(1);