Skip to content

Commit 092899d

Browse files
committed
fixed view on github and report issue buttons
1 parent 79b1f50 commit 092899d

File tree

4 files changed

+45
-32
lines changed

4 files changed

+45
-32
lines changed

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"permissions": {
33
"allow": [
44
"Bash(npm:*)",
5-
"Bash(npx:*)"
5+
"Bash(npx:*)",
6+
"Bash(node:*)"
67
]
78
}
89
}

scripts/fetch-modules.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,19 @@ function cloneOrUpdateRepo(repo) {
5656
execSync(`git clone --depth 1 "${repo.url}" "${repoPath}"`, { stdio: 'pipe' });
5757
}
5858

59-
return repoPath;
59+
// Detect default branch name
60+
let defaultBranch = 'main';
61+
try {
62+
const ref = execSync('git symbolic-ref refs/remotes/origin/HEAD', {
63+
cwd: repoPath,
64+
stdio: 'pipe',
65+
}).toString().trim();
66+
defaultBranch = ref.replace('refs/remotes/origin/', '');
67+
} catch {
68+
// fallback to 'main'
69+
}
70+
71+
return { repoPath, defaultBranch };
6072
}
6173

6274
/**
@@ -85,7 +97,7 @@ function findMetaFiles(dir, files = []) {
8597
/**
8698
* Parse a meta.yml file and extract module information
8799
*/
88-
function parseMetaFile(metaPath, repo, type) {
100+
function parseMetaFile(metaPath, repo, type, defaultBranch) {
89101
try {
90102
const content = readFileSync(metaPath, 'utf-8');
91103
const meta = parseYaml(content);
@@ -104,7 +116,7 @@ function parseMetaFile(metaPath, repo, type) {
104116

105117
// Build GitHub URL to the module directory
106118
const repoBaseUrl = repo.url.replace(/\.git$/, '');
107-
const repository = `${repoBaseUrl}/tree/main/${relativePath}`;
119+
const repository = `${repoBaseUrl}/tree/${defaultBranch}/${relativePath}`;
108120

109121
// Process tools (may be array of objects with tool name as key)
110122
let tools = [];
@@ -203,7 +215,7 @@ function matchesKeywordFilter(module, repo) {
203215
/**
204216
* Process a repository and extract all modules/subworkflows
205217
*/
206-
function processRepository(repo) {
218+
function processRepository(repo, defaultBranch) {
207219
const repoPath = join(REPOS_DIR, repo.name);
208220
const modules = [];
209221

@@ -213,7 +225,7 @@ function processRepository(repo) {
213225
console.log(` Found ${moduleMetaFiles.length} modules`);
214226

215227
for (const metaPath of moduleMetaFiles) {
216-
const module = parseMetaFile(metaPath, repo, 'module');
228+
const module = parseMetaFile(metaPath, repo, 'module', defaultBranch);
217229
if (module && matchesKeywordFilter(module, repo)) {
218230
modules.push(module);
219231
}
@@ -225,7 +237,7 @@ function processRepository(repo) {
225237
console.log(` Found ${subworkflowMetaFiles.length} subworkflows`);
226238

227239
for (const metaPath of subworkflowMetaFiles) {
228-
const subworkflow = parseMetaFile(metaPath, repo, 'subworkflow');
240+
const subworkflow = parseMetaFile(metaPath, repo, 'subworkflow', defaultBranch);
229241
if (subworkflow && matchesKeywordFilter(subworkflow, repo)) {
230242
modules.push(subworkflow);
231243
}
@@ -251,8 +263,8 @@ async function main() {
251263
console.log(`Processing ${repo.label} (${repo.name}):`);
252264

253265
try {
254-
cloneOrUpdateRepo(repo);
255-
const modules = processRepository(repo);
266+
const { defaultBranch } = cloneOrUpdateRepo(repo);
267+
const modules = processRepository(repo, defaultBranch);
256268
allModules.push(...modules);
257269
console.log(` Total: ${modules.length} items\n`);
258270
} catch (error) {

src/data/modules.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "module",
77
"source": "nf-core",
88
"sourceLabel": "nf-core",
9-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/basicpy",
9+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/basicpy",
1010
"keywords": [
1111
"illumiation_correction",
1212
"background_correction",
@@ -43,7 +43,7 @@
4343
"type": "module",
4444
"source": "nf-core",
4545
"sourceLabel": "nf-core",
46-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/bftools/showinf",
46+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/bftools/showinf",
4747
"keywords": [
4848
"metadata",
4949
"ome-tif",
@@ -1260,7 +1260,7 @@
12601260
"type": "module",
12611261
"source": "nf-core",
12621262
"sourceLabel": "nf-core",
1263-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/bioformats2raw",
1263+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/bioformats2raw",
12641264
"keywords": [
12651265
"zarr",
12661266
"ome-ngff",
@@ -1399,7 +1399,7 @@
13991399
"type": "module",
14001400
"source": "nf-core",
14011401
"sourceLabel": "nf-core",
1402-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/cellpose",
1402+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/cellpose",
14031403
"keywords": [
14041404
"segmentation",
14051405
"image",
@@ -1966,7 +1966,7 @@
19661966
"type": "module",
19671967
"source": "nf-core",
19681968
"sourceLabel": "nf-core",
1969-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/deepcell/mesmer",
1969+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/deepcell/mesmer",
19701970
"keywords": [
19711971
"imaging",
19721972
"spatial_omics",
@@ -2778,7 +2778,7 @@
27782778
"type": "module",
27792779
"source": "nf-core",
27802780
"sourceLabel": "nf-core",
2781-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/mcstaging/imc2mc",
2781+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/mcstaging/imc2mc",
27822782
"keywords": [
27832783
"imaging",
27842784
"ome-tif",
@@ -2815,7 +2815,7 @@
28152815
"type": "module",
28162816
"source": "nf-core",
28172817
"sourceLabel": "nf-core",
2818-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/mcstaging/macsima2mc",
2818+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/mcstaging/macsima2mc",
28192819
"keywords": [
28202820
"imaging",
28212821
"ome-tif",
@@ -2855,7 +2855,7 @@
28552855
"type": "module",
28562856
"source": "nf-core",
28572857
"sourceLabel": "nf-core",
2858-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/mcstaging/phenoimager2mc",
2858+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/mcstaging/phenoimager2mc",
28592859
"keywords": [
28602860
"imaging",
28612861
"registration",
@@ -2893,7 +2893,7 @@
28932893
"type": "module",
28942894
"source": "nf-core",
28952895
"sourceLabel": "nf-core",
2896-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/metaspace/converter",
2896+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/metaspace/converter",
28972897
"keywords": [
28982898
"anndata",
28992899
"spatialdata",
@@ -3006,7 +3006,7 @@
30063006
"type": "module",
30073007
"source": "nf-core",
30083008
"sourceLabel": "nf-core",
3009-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/mindagap/duplicatefinder",
3009+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/mindagap/duplicatefinder",
30103010
"keywords": [
30113011
"imaging",
30123012
"resolve_bioscience",
@@ -3042,7 +3042,7 @@
30423042
"type": "module",
30433043
"source": "nf-core",
30443044
"sourceLabel": "nf-core",
3045-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/mindagap/mindagap",
3045+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/mindagap/mindagap",
30463046
"keywords": [
30473047
"imaging",
30483048
"resolve_bioscience",
@@ -3131,7 +3131,7 @@
31313131
"type": "module",
31323132
"source": "nf-core",
31333133
"sourceLabel": "nf-core",
3134-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/molkartgarage/clahe",
3134+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/molkartgarage/clahe",
31353135
"keywords": [
31363136
"clahe",
31373137
"image_processing",
@@ -3624,7 +3624,7 @@
36243624
"type": "module",
36253625
"source": "nf-core",
36263626
"sourceLabel": "nf-core",
3627-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/pretextsnapshot",
3627+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/pretextsnapshot",
36283628
"keywords": [
36293629
"pretext",
36303630
"image",
@@ -3664,7 +3664,7 @@
36643664
"type": "module",
36653665
"source": "nf-core",
36663666
"sourceLabel": "nf-core",
3667-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/raw2ometiff",
3667+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/raw2ometiff",
36683668
"keywords": [
36693669
"ome",
36703670
"tiff",
@@ -3956,7 +3956,7 @@
39563956
"type": "module",
39573957
"source": "nf-core",
39583958
"sourceLabel": "nf-core",
3959-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/spaceranger/count",
3959+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/spaceranger/count",
39603960
"keywords": [
39613961
"align",
39623962
"count",
@@ -4694,7 +4694,7 @@
46944694
"type": "module",
46954695
"source": "nf-core",
46964696
"sourceLabel": "nf-core",
4697-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/spotiflow",
4697+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/spotiflow",
46984698
"keywords": [
46994699
"imaging",
47004700
"image",
@@ -4904,7 +4904,7 @@
49044904
"type": "module",
49054905
"source": "nf-core",
49064906
"sourceLabel": "nf-core",
4907-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/stardist",
4907+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/stardist",
49084908
"keywords": [
49094909
"stardist",
49104910
"segmentation",
@@ -4946,7 +4946,7 @@
49464946
"type": "subworkflow",
49474947
"source": "nf-core",
49484948
"sourceLabel": "nf-core",
4949-
"repository": "https://github.com/nf-core/modules/tree/main/subworkflows/nf-core/tiff_segmentation_vpt",
4949+
"repository": "https://github.com/nf-core/modules/tree/master/subworkflows/nf-core/tiff_segmentation_vpt",
49504950
"keywords": [
49514951
"segmentation",
49524952
"imaging",
@@ -5119,7 +5119,7 @@
51195119
"type": "module",
51205120
"source": "nf-core",
51215121
"sourceLabel": "nf-core",
5122-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/vizgenpostprocessing/compiletilesegmentation",
5122+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/vizgenpostprocessing/compiletilesegmentation",
51235123
"keywords": [
51245124
"vpt",
51255125
"vizgen",
@@ -5169,7 +5169,7 @@
51695169
"type": "module",
51705170
"source": "nf-core",
51715171
"sourceLabel": "nf-core",
5172-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/vizgenpostprocessing/preparesegmentation",
5172+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/vizgenpostprocessing/preparesegmentation",
51735173
"keywords": [
51745174
"vpt",
51755175
"vizgen",
@@ -5218,7 +5218,7 @@
52185218
"type": "module",
52195219
"source": "nf-core",
52205220
"sourceLabel": "nf-core",
5221-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/vizgenpostprocessing/runsegmentationontile",
5221+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/vizgenpostprocessing/runsegmentationontile",
52225222
"keywords": [
52235223
"vpt",
52245224
"vizgen",
@@ -5267,7 +5267,7 @@
52675267
"type": "module",
52685268
"source": "nf-core",
52695269
"sourceLabel": "nf-core",
5270-
"repository": "https://github.com/nf-core/modules/tree/main/modules/nf-core/xeniumranger/import-segmentation",
5270+
"repository": "https://github.com/nf-core/modules/tree/master/modules/nf-core/xeniumranger/import-segmentation",
52715271
"keywords": [
52725272
"spatial",
52735273
"segmentation",

src/pages/modules/[slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ const displayName = org ? `${org}/${module.name}` : module.name;
373373
</a>
374374

375375
<a
376-
href={`${module.repository}/issues`}
376+
href={`${module.repository.replace(/\/tree\/.*$/, '')}/issues`}
377377
target="_blank"
378378
rel="noopener noreferrer"
379379
class="inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 transition-colors"

0 commit comments

Comments
 (0)