Skip to content

Commit

Permalink
Merge branch 'master' into seqerakit-docs-port
Browse files Browse the repository at this point in the history
  • Loading branch information
llewellyn-sl authored Nov 25, 2024
2 parents 8fd5458 + 64bf313 commit 99dacc7
Show file tree
Hide file tree
Showing 8 changed files with 544 additions and 471 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ internal/tmp

# Local Netlify folder
.netlify

# OSS repo clones
multiqc_docs/multiqc_repo
wave_docs/wave_repo
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "wave_docs/wave_repo"]
path = wave_docs/wave_repo
url = https://github.com/seqeralabs/wave
[submodule "multiqc_docs/multiqc_repo"]
path = multiqc_docs/multiqc_repo
url = https://github.com/MultiQC/MultiQC
62 changes: 62 additions & 0 deletions internal/fetch-docs-oss.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import git from "simple-git";
import fs from "fs-extra";
import "dotenv/config";
import path from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const repositories = [
{
name: 'multiqc',
url: 'https://github.com/MultiQC/MultiQC.git',
path: path.join(__dirname, "..", "multiqc_docs", "multiqc_repo")
},
{
name: 'wave',
url: 'https://github.com/seqeralabs/wave.git',
path: path.join(__dirname, "..", "wave_docs", "wave_repo")
}
];

// Function to clone or update a repository
async function cloneOrUpdateRepo({ name, url, path: repoPath }) {
const exists = await fs.pathExists(repoPath + "/.git");

try {
if (exists) {
console.log(`${name}: Cloned repo already exists, will pull latest changes`);
await git(repoPath).pull();
console.log(`✅ ${name}: Pulled latest changes`);
} else {
console.log(`${name}: Cloning into ${repoPath}`);
await git().clone(url, repoPath);
console.log(`✅ ${name}: Cloned`);
}
} catch (error) {
console.error(`❌ Error processing ${repo.name}:`);
console.error(error.message);
if (exists) {
console.error(`Try removing the directory: ${repoPath}`);
}
// Exit with error code 1 to stop any subsequent npm scripts
process.exit(1);
}

return git(repoPath);
}

// Clone/update all repositories
async function processRepositories() {
for (const repo of repositories) {
try {
await cloneOrUpdateRepo(repo);
} catch (error) {
console.error(`❌ Error processing ${repo.name}:`, error);
}
}
}

// Execute
processRepositories().catch(console.error);
1 change: 0 additions & 1 deletion multiqc_docs/multiqc_repo
Submodule multiqc_repo deleted from d66055
913 changes: 461 additions & 452 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"prestart": "npm run fetch-docs-oss",
"start": "docusaurus start",
"dev": "npm run start",
"prebuild": "npm run fetch-docs-oss",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
Expand All @@ -15,15 +17,16 @@
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc",
"fetch-docs": "node internal/fetch-docs.mjs",
"fetch-docs-oss": "node internal/fetch-docs-oss.mjs",
"sanitize-existing": "node internal/sanitize-existing.mjs",
"markdownlint": "markdownlint-cli2 'platform_versioned_docs/**/*.mdx' 'wave_docs/**/*.mdx' 'fusion_docs/**/*.mdx' --config .markdownlint-cli2.cjs"
},
"dependencies": {
"@docusaurus/core": "^3.6.0",
"@docusaurus/faster": "^3.5.2",
"@docusaurus/plugin-google-gtag": "^3.6.0",
"@docusaurus/plugin-google-tag-manager": "^3.6.0",
"@docusaurus/preset-classic": "^3.6.0",
"@docusaurus/core": "^3.6.1",
"@docusaurus/faster": "^3.6.1",
"@docusaurus/plugin-google-gtag": "^3.6.1",
"@docusaurus/plugin-google-tag-manager": "^3.6.1",
"@docusaurus/preset-classic": "^3.6.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1",
"docusaurus-remark-plugin-tab-blocks": "^3.1.0",
Expand Down
15 changes: 9 additions & 6 deletions src/theme/DocSidebar/Desktop/ProductSwitcher/VersionSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,18 @@ const VersionSwitcher = ({ isOpen, setIsOpen }) => {
})}
>
{items?.map((version) => (
<Link
<div
key={version.name}
to={`${version.path}${urlSuffix}`} // Append the suffix to the version path
className={styles.item}
onClick={() => handleSelectVersion(version.name)}
>
v{version.label}{" "}
{version.label === versions[0].label ? " (current)" : ""}
</Link>
<Link
to={`${version.path}${urlSuffix}`} // Append the suffix to the version path
className={styles.item}
>
v{version.label}{" "}
{version.label === versions[0].label ? " (current)" : ""}
</Link>
</div>
))}
</div>
)}
Expand Down
1 change: 0 additions & 1 deletion wave_docs/wave_repo
Submodule wave_repo deleted from 080d5c

0 comments on commit 99dacc7

Please sign in to comment.