Files snapshot from new-commit-view

./src/configTypes.ts

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
90eb8e Tucker McKnight
b8a3bb Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
b8a3bb Tucker McKnight
e00eff Tucker McKnight
b8a3bb Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
927e7a Tucker McKnight
237651 Tucker McKnight
b8a3bb Tucker McKnight
b8a3bb Tucker McKnight
927e7a Tucker McKnight
927e7a Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
927e7a Tucker McKnight
927e7a Tucker McKnight
b8a3bb Tucker McKnight
e00eff Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
927e7a Tucker McKnight
927e7a Tucker McKnight
e00eff Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
612263 Tucker McKnight
0dfdda Tucker McKnight
90eb8e Tucker McKnight
0dfdda Tucker McKnight
612263 Tucker McKnight
b8a3bb Tucker McKnight
e00eff Tucker McKnight
e00eff Tucker McKnight
b8a3bb Tucker McKnight
927e7a Tucker McKnight
927e7a Tucker McKnight
b8a3bb Tucker McKnight
b8a3bb Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
9ff2f2 Tucker McKnight
b8a3bb Tucker McKnight
b8a3bb Tucker McKnight
005a06 Tucker McKnight
afc1fa Tucker McKnight
afc1fa Tucker McKnight
afc1fa Tucker McKnight
afc1fa Tucker McKnight
073785 Tucker McKnight
9ff2f2 Tucker McKnight
073785 Tucker McKnight
073785 Tucker McKnight
073785 Tucker McKnight
073785 Tucker McKnight
073785 Tucker McKnight
073785 Tucker McKnight
b8a3bb Tucker McKnight
/** @ignore **/
export type ReposConfigurationWithDefaultsApplied = ReposConfiguration & {
  path: string,
  repos: {
    [repoName: string]: GitConfigWithDefaultsApplied
  },
  defaultTemplate: {
    enabled: boolean,
    allRepositoriesPageTitle: string,
    colors: {
      languageGraph: Array<any>,
    }
  }
}

/** @ignore **/
export type GitConfigWithDefaultsApplied = GitConfig & {
  defaultBranch: string,
  branches: Array<any>,
  tags: Array<any>,
  languageExtensions: Object,
  defaultTemplate: {
    homepageButtons: Array<any>
  }
}

/**
 The ReposConfiguration object contains information about your local repositories,
 like their name and location on your local filesystem. Add repositories to this
 configuration object to make a static site for them.
 
 You will also need to set the {@link ReposConfiguration.baseUrl} to the URL of your
 live website.
 @example
 const config: ReposConfiguration = {
   baseUrl: "https://repos.tuckerm.us",
   repos: {
     "My Git Project": {
       defaultBranch: 'main',
       branches: ['main', 'develop']
     },
   },
 }
 */
export type ReposConfiguration = {
  repos: {
    /**
     *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.
     */
    [repoName: string]: GitConfig
  },
  /**
   * The root URL where this website will be. E.g.: https://blog.example.com/repos.
   * This URL will be used when a clone or pull command is being shown on your site.
   * Unlike on a regular Build Awesome site, this needs to be explicitly defined,
   * since the `git clone` URL cannot be a relative link; Repo Viewer needs to know
   * your domain name in order to know what the `git clone` URL should be.
   * @example baseUrl: "https://repos.tuckerm.us"
   */
  baseUrl: string,
  /**
   * The path to put the cloned repositories in. Repositories will be cloned from
   * their source `location` to the `path` folder inside of your site's output folder.
   * For example, `_site/repos/my-git-repo.git`.
   * @default path: "/repos"
   * @example path: "/repos"
   */
  path?: string,
  /**
   * Some configuration options for the default template included with this plugin.
   */
  defaultTemplate?: {
    /**
     Whether or not the default template should be used. If `true`, will generate
     the type of HTML pages seen at https://tuckerm.us/repos.
     @default true
    */
    enabled?: boolean,
    allRepositoriesPageTitle?: string,
    colors?: {
      languageGraph?: Array<{light: string, dark?: string}>,
    },
  },
}

export type GitConfig = {
  /* The absolute path to the repository.
   * @example location: "/home/alice/projects/git_repo"
   */
  location: string,
  description?: string,
  /**
   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.
   @default 'main', 'master', or 'develop', determined by looking for one of those branches
   @example defaultBranch: 'main'
  */
  defaultBranch?: string,
  /**
   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.
   @example branches: [
     'main',
     'release-candidate',
     {
       pattern: 'develop/*',
       max: 50,
       compareTo: 'release-candidate'
     },
     'features/**'
   ]
   @default branches: ['**']
  */
  branches?: Array<string | {pattern: string, max?: number, compareTo?: string, description?: string}>,
  /**
   The list of tags to fetch from the source repo, making them available
   in the public repo. If you have some tags in your source repo (that is,
   the one specified in `location`,) and you don't want those tags to have
   a snapshot of their files available, then do not list those tags
   in this field. Glob patterns can be used here. By default, pulls all available
   tags from the source repo.

   You may give either an exact name of the tag, a glob pattern (like `releases/**`),
   or an object. If you want to limit the number of tags that are shown (e.g. to
   avoid generating HTML pages for very old releases), use the object. The object
   contains two keys: `pattern` and `max`, where `pattern` is a glob pattern for
   matching a tag name, and `max` is how many tags should be fetched matching
   that name. Older tags beyond the max number will be ignored.
   @type Array<string>
   @example tags: ['v1.*', 'v2.*', {pattern: 'releases/**', max: 100}]
   @default tags: ['**']
  */
  tags?: Array<string | {pattern: string, max: number}>,
  languageExtensions?: {
    [fileExtension: string]: string
  },
  buildSteps?: {
    command: string,
    copyFrom: string,
    copyTo: string,
  }[],
  defaultTemplate?: {
    homepageButtons: Array<{
      url: string,
      text: string,
      newTab?: boolean,
    }>
  },
}