Tucker McKnight <tucker@pangolin.lan> | Mon Nov 17 2025
remove the generic operations class, just go with git operations
6 7 8 9 10 11
import flatPatches from './src/flatPatches.ts'
import paginatedPatches, {type PatchPage} from './src/paginatedPatches.ts'
import {getLocation} from './src/helpers.ts'
import repoOperations from './src/vcses/operations.ts'
import {ReposConfiguration} from './src/configTypes.ts'
import {Ajv} from 'ajv'
import ConfigSchema from './schemas/ReposConfiguration.json' with { type: 'json' }6 7 8 9 10 11
import flatPatches from './src/flatPatches.ts'
import paginatedPatches, {type PatchPage} from './src/paginatedPatches.ts'
import {getLocation} from './src/helpers.ts'
import * as operations from './src/vcses/git/operations.ts'
import {ReposConfiguration} from './src/configTypes.ts'
import {Ajv} from 'ajv'
import ConfigSchema from './schemas/ReposConfiguration.json' with { type: 'json' }180 181 182 183 184 185 186 187
return ""
}
const config = reposConfiguration.repos[repo]
const location = getLocation(reposConfiguration, repo)
return repoOperations[config._type].getFileLastTouchInfo(branch, filename, location)
})
eleventyConfig.addFilter("isDirectory", (filename: string, repoName: string, branchName: string) => {180 181 182 183 184 185 186
return ""
}
const location = getLocation(reposConfiguration, repo)
return operations.getFileLastTouchInfo(branch, filename, location)
})
eleventyConfig.addFilter("isDirectory", (filename: string, repoName: string, branchName: string) => {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import {
getFileList as getGitFileList,
getFileLastTouchInfo as getGitFileLastTouchInfo,
} from './git/operations.ts'
type RepoOperationsType = {
[vcs: string]: {
getFileList: (repoName: string, branchName: string, repoLocation: string) => Promise<Array<string>>,
getFileLastTouchInfo: (branchName: string, filename: string, repoLocation: string) => Promise<Array<{sha: string, author: string}>>,
}
}
const repoOperations: RepoOperationsType = {
git: {
getFileList: getGitFileList,
getFileLastTouchInfo: getGitFileLastTouchInfo,
},
}
export default repoOperations