Improve documentation and start making some config fields as optional

9ff2f245867762b5e7484b354813432a5781e547

Tucker McKnight <tucker@pangolin.lan> | Sun Jul 12 2026

Improve documentation and start making some config fields as optional
js_templates/helpers/nav.ts:109
Before
108
109
110
111
112
113

      return `${refPath(refName, refType)}/commits.xml`
    },
    homepageButtons: args.reposConfig.repos[args.currentRepoName].defaultTemplateConfiguration?.homepageButtons || []
  }
}
After
108
109
110
111
112
113

      return `${refPath(refName, refType)}/commits.xml`
    },
    homepageButtons: args.reposConfig.repos[args.currentRepoName].defaultTemplate?.homepageButtons || []
  }
}
js_templates/index.ts:7
Before
6
7
8
9
10
11
  const pageContent = m('div', {class: "container"}, [
    m('div', {class: "row my-3"},
      m('div', {class: "col"},
        m('h1', data.reposConfig.defaultTemplateConfiguration?.allRepositoriesPageTitle || "All Repositories")
      )
    ),
    m('div', {class: "row d-flex flex-wrap"},
After
6
7
8
9
10
11
  const pageContent = m('div', {class: "container"}, [
    m('div', {class: "row my-3"},
      m('div', {class: "col"},
        m('h1', data.reposConfig.defaultTemplate?.allRepositoriesPageTitle || "All Repositories")
      )
    ),
    m('div', {class: "row d-flex flex-wrap"},
js_templates/index.ts:30
Before
29
30
31
32
33
34
                  class: "mx-1 my-2 btn btn-outline-secondary shadow-none dropdown-toggle clone-popover-btn",
                  'data-copy-text': repo.cloneUrl
                }, 'Clone'),
                (data.reposConfig.repos[repo.name].defaultTemplateConfiguration?.homepageButtons || []).map((button) => {
                  return m('a', {
                    class: "mx-1 my-2 btn btn-outline-secondary shadow-none",
                    href: button.url,
After
29
30
31
32
33
34
                  class: "mx-1 my-2 btn btn-outline-secondary shadow-none dropdown-toggle clone-popover-btn",
                  'data-copy-text': repo.cloneUrl
                }, 'Clone'),
                (data.reposConfig.repos[repo.name].defaultTemplate?.homepageButtons || []).map((button) => {
                  return m('a', {
                    class: "mx-1 my-2 btn btn-outline-secondary shadow-none",
                    href: button.url,
main.ts:32
Before
31
32
33
34
35
36
  const validator = ajv.compile(ConfigSchema)
  const valid = validator(reposConfiguration)
  if (!valid) {
    throw new Error(validator.errors.map(error => `config object at ${error.instancePath.replaceAll("/", ".")}: ${error.message}`).join("\n"))
  }

  return async ({directories}) => {
After
31
32
33
34
35
36
  const validator = ajv.compile(ConfigSchema)
  const valid = validator(reposConfiguration)
  if (!valid) {
    throw new Error(validator.errors.map(error => `config object at ${error.instancePath.replaceAll("/", ".")}: ${error.message}\n${Object.values(error.params).toString()}`).join("\n"))
  }

  return async ({directories}) => {
schemas/ReposConfiguration.json:6
Before
5
6
7


8
9
      "additionalProperties": false,
      "properties": {
        "branches": {
⁣
⁣
          "items": {
            "anyOf": [
              {
After
5
6
7
8
9
10
11
      "additionalProperties": false,
      "properties": {
        "branches": {
          "default": "branches: ['**']",
          "description": "The list of branches to pull from the source repo, making them available in the public repo. If you have some branches in your source repo (that is, the one specified in `location`,) and you don't want those branches to have a snapshot of their current files available, then do not list those branches in this field. Glob patterns can be used here. By default, pulls all available branches from the source repo.",
          "items": {
            "anyOf": [
              {
schemas/ReposConfiguration.json:60
Before
59
60
61


62
63
64
65
66
          "type": "array"
        },
        "defaultBranch": {
⁣
⁣
          "type": "string"
        },
        "defaultTemplateConfiguration": {
          "additionalProperties": false,
          "properties": {
            "homepageButtons": {
After
59
60
61
62
63
64
65
66
67
68
          "type": "array"
        },
        "defaultBranch": {
          "default": "'main', 'master', or 'develop', determined by looking for one of those branches",
          "description": "The default branch for the repository. If this field is not set, Repo Viewer will automatically try `main`, `master`, and `develop`, in that order. Set a `defaultBranch` value if your default branch is not one of those.",
          "type": "string"
        },
        "defaultTemplate": {
          "additionalProperties": false,
          "properties": {
            "homepageButtons": {
schemas/ReposConfiguration.json:133
Before
132
133
134
135
136
137
138
139
140
        }
      },
      "required": [
        "location",
        "defaultBranch",
        "branches",
        "tags"
      ],
      "type": "object"
    },
After
132
133
134
135



136
137
        }
      },
      "required": [
        "location"
⁣
⁣
⁣
      ],
      "type": "object"
    },
schemas/ReposConfiguration.json:167
Before
166
167
168
169
170
171
172
173
            "description": "An object containing the configuration for your repositories. Each key in this object is a repository name, and the value has several config options for that repository. The required config options describe the path to the repository and which branches should be pulled. See the specific definition of  {@link  GitConfig }  for more details about what goes in these configuration objects."
          },
          "type": "object"
        },
        "useDefaultTemplate": {
          "type": "boolean"
        }
      },
      "required": [
After
166
167
168
169



170
            "description": "An object containing the configuration for your repositories. Each key in this object is a repository name, and the value has several config options for that repository. The required config options describe the path to the repository and which branches should be pulled. See the specific definition of  {@link  GitConfig }  for more details about what goes in these configuration objects."
          },
          "type": "object"
        }
⁣
⁣
⁣
      },
      "required": [
src/configTypes.ts:64
Before
63
64
65
66
67
68
    copyFrom: string,
    copyTo: string,
  }[],
  defaultTemplateConfiguration?: {
    homepageButtons: Array<{
      url: string,
      text: string,
After
63
64
65
66
67
68
    copyFrom: string,
    copyTo: string,
  }[],
  defaultTemplate?: {
    homepageButtons: Array<{
      url: string,
      text: string,