Skip to content

ProjectCommit

Represents a single commit from a GitHub repository. Commits are fetched for github and hybrid project types when the commits option is configured.

Definition

tsx
interface ProjectCommit {
  message: string
  date: string
  url: string
  author?: ProjectCommitAuthor
}

Properties

PropertyTypeRequiredDescription
messagestringYesFull commit message
datestringYesCommit date (ISO 8601)
urlstringYesLink to view the commit on GitHub
authorProjectCommitAuthorNoCommit author information

ProjectCommitAuthor

tsx
interface ProjectCommitAuthor {
  name?: string
  email?: string
}
PropertyTypeRequiredDescription
namestringNoAuthor display name (GitHub username or committer name)
emailstringNoAuthor email address. Reserved for future use — currently never populated by the normalisation process

Fetching Commits

Commits must be explicitly enabled in your configuration:

Global Default

tsx
import { defineProjects } from '@manningworks/projex'

export const projects = defineProjects([
  {
    id: 'my-project',
    type: 'github',
    repo: 'user/repo',
    status: 'active',
  },
], { commits: 5 })  // Fetch 5 most recent commits for all GitHub/hybrid projects

Per-Project Override

tsx
export const projects = defineProjects([
  {
    id: 'project-a',
    type: 'github',
    repo: 'user/repo-a',
    status: 'active',
    commits: 10,   // Override: fetch 10 commits
  },
  {
    id: 'project-b',
    type: 'github',
    repo: 'user/repo-b',
    status: 'active',
    commits: 0,     // Disable commits for this project
  },
  {
    id: 'project-c',
    type: 'github',
    repo: 'user/repo-c',
    status: 'active',
    // Uses global default
  },
], { commits: 5 })

Commits Value Behavior

ValueBehavior
0No commits fetched
1100Fetch that many recent commits
> 100Clamped to 100 (with warning)
< 0Clamped to 0 (with warning)
undefinedUses global default from defineProjects options

Display

Commits are displayed by the CommitList component:

tsx
import { CommitList } from '@manningworks/projex'

<CommitList commits={project.commits} />

Or via ProjectView.Commits:

tsx
<ProjectView.Commits project={project} />

Message Truncation

Commit messages over 100 characters are truncated with an ellipsis in the CommitList component:

tsx
// Full message: "feat: add support for YouTube channel data fetching with automatic subscriber and view count normalization"
// Displayed: "feat: add support for YouTube channel data fetching with automatic subscriber and view count normaliz..."

Data Attributes

AttributeDescription
data-projex-commit-listCommit list container
data-projex-commitIndividual commit item
data-projex-commit-messageCommit message (truncated if > 100 chars)
data-projex-commit-dateCommit date
data-projex-commit-linkLink to view commit on GitHub
data-projex-commit-authorAuthor name

Rate Limiting

Commit fetching uses the GitHub API. Each project with commits enabled makes one API call.

AuthRate LimitProjects × Commits
Unauthenticated60/hr~60 projects with commits
GITHUB_TOKEN5000/hr~5000 projects with commits

For portfolios with many GitHub projects, set GITHUB_TOKEN to avoid rate limits.