remove the generic operations class, just go with git operations

8eaecc836900be5206cd8a1fb9e9db43c799112f

Tucker McKnight <tucker@pangolin.lan> | Mon Nov 17 2025

remove the generic operations class, just go with git operations
main.ts:7
Before
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' }
After
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' }
main.ts:181
Before
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) => {
After
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) => {
src/vcses/operations.ts:1
Before
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
After

















⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣