diff --git a/docusaurus.config.js b/docusaurus.config.js index 75f67728e..63ca03d91 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -270,8 +270,120 @@ export default async function createConfigAsync() { process.env.EXCLUDE_FUSION ? null : docs_fusion, process.env.EXCLUDE_WAVE ? null : docs_wave, - // Disable expensive bundler options. - // https://github.com/facebook/docusaurus/pull/11176 + ['docusaurus-plugin-llms', { + id: 'llms-enterprise', + docsDir: 'platform-enterprise_docs', + llmsTxtFilename: 'llms-enterprise.txt', + title: 'Seqera Platform Enterprise', + description: 'Documentation for Seqera Platform Enterprise.', + rootContent: 'This file contains links to Seqera Platform Enterprise documentation following the llmstxt.org standard.', + generateLLMsTxt: true, + generateLLMsFullTxt: false, + generateMarkdownFiles: true, + includeBlog: false, + excludeImports: true, + removeDuplicateHeadings: true, + ignoreFiles: ['**/tags', '**/tags/**'], + processingBatchSize: 50, + }], + ['docusaurus-plugin-llms', { + id: 'llms-cloud', + docsDir: 'platform-cloud/docs', + llmsTxtFilename: 'llms-cloud.txt', + title: 'Seqera Platform Cloud', + description: 'Documentation for Seqera Platform Cloud.', + rootContent: 'This file contains links to Seqera Platform Cloud documentation following the llmstxt.org standard.', + generateLLMsTxt: true, + generateLLMsFullTxt: false, + generateMarkdownFiles: true, + includeBlog: false, + excludeImports: true, + removeDuplicateHeadings: true, + ignoreFiles: ['**/tags', '**/tags/**'], + processingBatchSize: 50, + }], + ['docusaurus-plugin-llms', { + id: 'llms-api', + docsDir: 'platform-api-docs/docs', + llmsTxtFilename: 'llms-api.txt', + title: 'Seqera Platform API', + description: 'API reference documentation for the Seqera Platform REST API.', + rootContent: 'This file contains links to Seqera Platform API reference documentation following the llmstxt.org standard.', + generateLLMsTxt: true, + generateLLMsFullTxt: false, + generateMarkdownFiles: true, + includeBlog: false, + excludeImports: true, + removeDuplicateHeadings: true, + ignoreFiles: ['**/tags', '**/tags/**'], + processingBatchSize: 50, + }], + ['docusaurus-plugin-llms', { + id: 'llms-cli', + docsDir: 'platform-cli-docs/docs', + llmsTxtFilename: 'llms-cli.txt', + title: 'Seqera Platform CLI', + description: 'Documentation for the Seqera Platform command-line interface.', + rootContent: 'This file contains links to Seqera Platform CLI documentation following the llmstxt.org standard.', + generateLLMsTxt: true, + generateLLMsFullTxt: false, + generateMarkdownFiles: true, + includeBlog: false, + excludeImports: true, + removeDuplicateHeadings: true, + ignoreFiles: ['**/tags', '**/tags/**'], + processingBatchSize: 50, + }], + ['docusaurus-plugin-llms', { + id: 'llms-multiqc', + docsDir: 'multiqc_docs/multiqc_repo/docs/markdown', + llmsTxtFilename: 'llms-multiqc.txt', + title: 'MultiQC', + description: 'Documentation for MultiQC', + rootContent: 'This file contains links to MultiQC documentation following the llmstxt.org standard.', + generateLLMsTxt: true, + generateLLMsFullTxt: false, + generateMarkdownFiles: true, + includeBlog: false, + excludeImports: true, + removeDuplicateHeadings: true, + ignoreFiles: ['**/tags', '**/tags/**'], + processingBatchSize: 50, + }], + ['docusaurus-plugin-llms', { + id: 'llms-fusion', + docsDir: 'fusion_docs', + llmsTxtFilename: 'llms-fusion.txt', + title: 'Fusion', + description: 'Documentation for Fusion.', + rootContent: 'This file contains links to Fusion documentation following the llmstxt.org standard.', + generateLLMsTxt: true, + generateLLMsFullTxt: false, + generateMarkdownFiles: true, + includeBlog: false, + excludeImports: true, + removeDuplicateHeadings: true, + ignoreFiles: ['**/tags', '**/tags/**'], + processingBatchSize: 50, + }], + ['docusaurus-plugin-llms', { + id: 'llms-wave', + docsDir: 'wave_docs/wave_repo/docs', + llmsTxtFilename: 'llms-wave.txt', + title: 'Wave', + description: 'Documentation for Wave.', + rootContent: 'This file contains links to Wave documentation following the llmstxt.org standard.', + generateLLMsTxt: true, + generateLLMsFullTxt: false, + generateMarkdownFiles: true, + includeBlog: false, + excludeImports: true, + removeDuplicateHeadings: true, + ignoreFiles: ['**/tags', '**/tags/**'], + processingBatchSize: 50, + }], + + // Disable expensive bundler options: https://github.com/facebook/docusaurus/pull/11176 function disableExpensiveBundlerOptimizationPlugin() { return { name: 'disable-expensive-bundler-optimizations', diff --git a/internal/fetch-docs-oss.mjs b/internal/fetch-docs-oss.mjs index de3993ed0..beceba842 100644 --- a/internal/fetch-docs-oss.mjs +++ b/internal/fetch-docs-oss.mjs @@ -54,6 +54,7 @@ async function cloneOrUpdateRepo({ name, url, path: repoPath, branch }) { // Clone/update all repositories async function processRepositories() { + console.log("fetch-docs-oss: Pulling or updating docs from os product repositories..."); for (const repo of repositories) { try { await cloneOrUpdateRepo(repo); diff --git a/internal/merge-llms-txt.mjs b/internal/merge-llms-txt.mjs new file mode 100644 index 000000000..7a6e94b44 --- /dev/null +++ b/internal/merge-llms-txt.mjs @@ -0,0 +1,60 @@ +import fs from "fs-extra"; +import path from "path"; +import { fileURLToPath } from "url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const buildDir = path.join(__dirname, "..", "build"); +const outputFile = path.join(buildDir, "llms.txt"); + +const localFiles = [ + "llms-enterprise.txt", + "llms-cloud.txt", + "llms-api.txt", + "llms-cli.txt", + "llms-multiqc.txt", + "llms-fusion.txt", + "llms-wave.txt", +]; + +const remoteFiles = [ + { filename: "llms-nextflow.txt", url: "https://docs-migration.netlify.app/llms-nextflow.txt" }, +]; + +const header = `# Seqera Docs + +> Documentation for Seqera products — Seqera Platform Cloud, Seqera Platform Enterprise, Seqera Platform API, Seqera Platform CLI, Nextflow, MultiQC, Fusion, and Wave. + +This file contains links to all Seqera product documentation following the llmstxt.org standard.`; + +const parts = [header]; + +for (const file of localFiles) { + const filePath = path.join(buildDir, file); + if (await fs.pathExists(filePath)) { + const content = await fs.readFile(filePath, "utf-8"); + parts.push(content.trim()); + console.log(` Merged ${file}`); + } else { + console.warn(` Skipped ${file} (not found)`); + } +} + +for (const { filename, url } of remoteFiles) { + try { + const response = await fetch(url); + if (response.ok) { + const content = await response.text(); + parts.push(content.trim()); + console.log(` Merged ${filename} (from ${url})`); + } else { + console.warn(` Skipped ${filename} (HTTP ${response.status})`); + } + } catch (err) { + console.warn(` Skipped ${filename} (fetch failed: ${err.message})`); + } +} + +await fs.writeFile(outputFile, parts.join("\n\n") + "\n"); +console.log(`\nWrote ${outputFile}`); diff --git a/package-lock.json b/package-lock.json index 970eeb971..65f95aafd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@docusaurus/faster": "^3.9.2", "@rspack/core": "^1.4.11", - "@seqera/docusaurus-preset-seqera": "^1.0.22", + "@seqera/docusaurus-preset-seqera": "^1.0.25", "image-size": "^2.0.2", "postcss-import": "^16.1.1", "postcss-loader": "^8.1.1", @@ -4208,9 +4208,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -4297,9 +4297,9 @@ } }, "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -5785,9 +5785,9 @@ "license": "MIT" }, "node_modules/@seqera/docusaurus-preset-seqera": { - "version": "1.0.22", - "resolved": "https://registry.npmjs.org/@seqera/docusaurus-preset-seqera/-/docusaurus-preset-seqera-1.0.22.tgz", - "integrity": "sha512-QxvZ/HGGPMv8eOdxu+GoS7J0ZvmEszS76bHNfS52vGy+PmEGIlCAClgkG45RhX4zPx4B+gA71+gwTcQ9+C5+Ew==", + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/@seqera/docusaurus-preset-seqera/-/docusaurus-preset-seqera-1.0.25.tgz", + "integrity": "sha512-/pt7JRdP2XBCA0lu6f1eUaAIsEMTJ4T0di9VFs2SxhSx8f+FIaAsOPfaSj51qAOuCDZpNu0JyzmdrvWi5yfEkw==", "license": "Apache-2.0", "dependencies": { "@docusaurus/core": "3.9.2", @@ -5804,8 +5804,9 @@ "@docusaurus/theme-common": "3.9.2", "@docusaurus/theme-search-algolia": "3.9.2", "@docusaurus/types": "3.9.2", - "@seqera/docusaurus-theme-seqera": "1.0.22", + "@seqera/docusaurus-theme-seqera": "1.0.25", "@tailwindcss/oxide": "^4.1.17", + "docusaurus-plugin-llms": "^0.3.0", "docusaurus-plugin-openapi-docs": "^4.5.1", "docusaurus-remark-plugin-tab-blocks": "^3.1.0", "docusaurus-theme-openapi-docs": "^4.5.1", @@ -5824,9 +5825,9 @@ } }, "node_modules/@seqera/docusaurus-theme-seqera": { - "version": "1.0.22", - "resolved": "https://registry.npmjs.org/@seqera/docusaurus-theme-seqera/-/docusaurus-theme-seqera-1.0.22.tgz", - "integrity": "sha512-uwcL2BpbbozSARVaxU0i9O4zaYpxvuqpzJvAYWDoJX9ROasqOthMPZVL6Rf6JTpglexvzaQmmhxDmgSk76/guQ==", + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/@seqera/docusaurus-theme-seqera/-/docusaurus-theme-seqera-1.0.25.tgz", + "integrity": "sha512-f5mFYeZfP7br3qbCl8mN3H7nr0sGOUqvBeOo/1OIgBr44jWnGb9s1A0Y8cDVUldHuN8f9WszhedO2zKdCTo2oA==", "license": "Apache-2.0", "dependencies": { "@docusaurus/core": "3.9.2", @@ -7698,9 +7699,9 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -10294,6 +10295,38 @@ "node": ">=6.0.0" } }, + "node_modules/docusaurus-plugin-llms": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-llms/-/docusaurus-plugin-llms-0.3.0.tgz", + "integrity": "sha512-JuADAJA2fjTv1U4XQUoIu1LyjISDzxFhRK5HbCZiHum4HlmdPwyx8NBXsi+LfdUyjK9acbZgazGsHPhdwEZs0g==", + "license": "MIT", + "dependencies": { + "gray-matter": "^4.0.3", + "minimatch": "^9.0.3", + "yaml": "^2.8.1" + }, + "engines": { + "node": ">=18.0" + }, + "peerDependencies": { + "@docusaurus/core": "^3.0.0" + } + }, + "node_modules/docusaurus-plugin-llms/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/docusaurus-plugin-openapi-docs": { "version": "4.7.1", "resolved": "https://registry.npmjs.org/docusaurus-plugin-openapi-docs/-/docusaurus-plugin-openapi-docs-4.7.1.tgz", @@ -11098,9 +11131,9 @@ } }, "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -11178,9 +11211,9 @@ } }, "node_modules/eslint-plugin-react/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -11301,9 +11334,9 @@ } }, "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -12392,15 +12425,15 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.1.tgz", - "integrity": "sha512-MClCe8IL5nRRmawL6ib/eT4oLyeKMGCghibcDWK+J0hh0Q8kqSdia6BvbRMVk6mPa6WqUa5uR2oxt6C5jd533A==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "license": "BlueOak-1.0.0", "dependencies": { "brace-expansion": "^5.0.2" }, "engines": { - "node": "20 || >=22" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -17654,9 +17687,9 @@ "license": "ISC" }, "node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -23457,15 +23490,15 @@ } }, "node_modules/serve-handler": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.6.tgz", - "integrity": "sha512-x5RL9Y2p5+Sh3D38Fh9i/iQ5ZK+e4xuXRd/pGbM4D13tgo/MGwbttUk8emytcr1YYzBYs+apnUngBDFYfpjPuQ==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.7.tgz", + "integrity": "sha512-CinAq1xWb0vR3twAv9evEU8cNWkXCb9kd5ePAHUKJBkOsUpR1wt/CvGdeca7vqumL1U5cSaeVQ6zZMxiJ3yWsg==", "license": "MIT", "dependencies": { "bytes": "3.0.0", "content-disposition": "0.5.2", "mime-types": "2.1.18", - "minimatch": "3.1.2", + "minimatch": "3.1.5", "path-is-inside": "1.0.2", "path-to-regexp": "3.3.0", "range-parser": "1.2.0" @@ -23482,9 +23515,9 @@ } }, "node_modules/serve-handler/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -24570,15 +24603,14 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.16", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz", - "integrity": "sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==", + "version": "5.3.17", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.17.tgz", + "integrity": "sha512-YR7PtUp6GMU91BgSJmlaX/rS2lGDbAF7D+Wtq7hRO+MiljNmodYvqslzCFiYVAgW+Qoaaia/QUIP4lGXufjdZw==", "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "jest-worker": "^27.4.5", "schema-utils": "^4.3.0", - "serialize-javascript": "^6.0.2", "terser": "^5.31.1" }, "engines": { diff --git a/package.json b/package.json index a059c21e2..d54cb438d 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "dev": "npm run start", "prebuild": "npm run fetch-docs-oss", "build": "docusaurus build", + "postbuild": "node internal/merge-llms-txt.mjs", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", @@ -38,7 +39,7 @@ "dependencies": { "@docusaurus/faster": "^3.9.2", "@rspack/core": "^1.4.11", - "@seqera/docusaurus-preset-seqera": "^1.0.22", + "@seqera/docusaurus-preset-seqera": "^1.0.25", "image-size": "^2.0.2", "postcss-import": "^16.1.1", "postcss-loader": "^8.1.1",