BROKEN HERE, add patches template. Breaks getLocation somehow?

c69df816cee2eb0e74eed142f43eaca6c730ce22

Tucker McKnight <tucker.mcknight@gmail.com> | Sun Aug 31 2025

BROKEN HERE, add patches template. Breaks getLocation somehow?
main.ts:4
Before
3
4
5

6
7
import repos from './src/repos.ts'
import branches from './src/branches.ts'
import flatFiles from './src/flatFiles.ts'
⁣
import {getLocation} from './src/helpers.ts'
import repoOperations from './src/vcses/operations.ts'
After
3
4
5
6
7
8
import repos from './src/repos.ts'
import branches from './src/branches.ts'
import flatFiles from './src/flatFiles.ts'
import paginatedPatches from './src/paginatedPatches.ts'
import {getLocation} from './src/helpers.ts'
import repoOperations from './src/vcses/operations.ts'
main.ts:16
Before
15
16
17



18
19



20
21

  const reposData = await repos(reposConfiguration)
  const reposPath = reposConfiguration.path || "/repos"
⁣
⁣
⁣
  eleventyConfig.addGlobalData("reposPath", reposPath)

⁣
⁣
⁣
  eleventyConfig.addFilter("getFileName", (filePath) => {
    const pathParts = filePath.split("/")
    return pathParts[pathParts.length - 1]
After
15
16
17
18
19
20
21
22
23
24
25
26
27

  const reposData = await repos(reposConfiguration)
  const reposPath = reposConfiguration.path || "/repos"

  eleventyConfig.addGlobalData("repos", reposData)
  eleventyConfig.addGlobalData("reposConfig", reposConfiguration)
  eleventyConfig.addGlobalData("reposPath", reposPath)

  const branchesData = branches(reposData)
  eleventyConfig.addGlobalData("branches", branchesData)

  eleventyConfig.addFilter("getFileName", (filePath) => {
    const pathParts = filePath.split("/")
    return pathParts[pathParts.length - 1]
main.ts:171
Before
170
171
172



173
174
  })

  eleventyConfig.addAsyncFilter("getReadMe", async (repoName, branchName) => {
⁣
⁣
⁣
    const location = getLocation(reposConfiguration, branchName, repoName)
    const config = reposConfiguration.repos[repoName]
    let command = ''
After
170
171
172
173
174
175
176
177
  })

  eleventyConfig.addAsyncFilter("getReadMe", async (repoName, branchName) => {
    console.log("getreadme")
    console.log(branchName)
    console.log(repoName)
    const location = getLocation(reposConfiguration, branchName, repoName)
    const config = reposConfiguration.repos[repoName]
    let command = ''
main.ts:205
Before
204
205
206
207
208
209

  // BRANCHES.NJK
  const branchesTemplate = fsImport.readFileSync(`${__dirname}/templates/branches.njk`).toString()
  const branchesData = branches(reposData)
  eleventyConfig.addTemplate(
    'repos/branches.njk',
    topLayoutPartial + branchesTemplate + bottomLayoutPartial,
After
204
205
206

207
208

  // BRANCHES.NJK
  const branchesTemplate = fsImport.readFileSync(`${__dirname}/templates/branches.njk`).toString()
⁣
  eleventyConfig.addTemplate(
    'repos/branches.njk',
    topLayoutPartial + branchesTemplate + bottomLayoutPartial,
main.ts:295
Before
294
295
296

297
298
        size: 1,
        alias: "branch",
      },
⁣
      permalink: (data) => {
        const repoName = data.branch.repoName
        const branchName = data.branch.branchName
After
294
295
296
297
298
299
        size: 1,
        alias: "branch",
      },
      branches: branchesData,
      permalink: (data) => {
        const repoName = data.branch.repoName
        const branchName = data.branch.branchName
main.ts:309
Before
After
src/flatPatches.ts:0
Before
















⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
After
-1
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
let cachedFlatPatches = null

export default async (repos) => {
  if (cachedFlatPatches !== null) { return cachedFlatPatches }

  cachedFlatPatches = Object.keys(repos).flatMap((repoName) => {
    return Object.keys(repos[repoName].branches).flatMap((branchName) => {
      return repos[repoName].branches[branchName].patches.map((patch) => {
        return {
          patch,
          branchName,
          repoName,
        }
      })
    })
  })

  return cachedFlatPatches
}
src/helpers.ts:137
Before
136
137
138

139
140
}

const getLocation = (reposConfig: any, branchName: string, repoName: string): string => {
⁣
  const config = reposConfig.repos[repoName]
  if (config._type === "darcs") {
    return config.branches[branchName].location
After
136
137
138
139
140
141
}

const getLocation = (reposConfig: any, branchName: string, repoName: string): string => {
  console.log(repoName)
  const config = reposConfig.repos[repoName]
  if (config._type === "darcs") {
    return config.branches[branchName].location