Skip to content

ProjexProjectInputCompat

A compatibility/utility type that relaxes the strict ProjexProjectInput union to accept partial project configurations. Useful when migrating from untyped configs or building tools that accept flexible input shapes.

Definition

tsx
type ProjexProjectInputCompat = Omit<BaseProjectInput, 'id'> & {
  id: string
  type?: ProjectType
  repo?: string
  package?: string
  slug?: string
}

Purpose

ProjexProjectInputCompat is a flattened, fully-optional variant of the project input types. Unlike ProjexProjectInput (which is a discriminated union requiring type and type-specific fields like repo or package), this type makes all type-specific fields optional.

When to Use

  • Migration: Accepting legacy configuration files where type may not be specified
  • Tooling: Building CLI tools or validators that work with partial project data before the full input is resolved
  • Progressive enhancement: Allowing users to start with minimal config and fill in type-specific details later

When NOT to Use

  • For defineProjects() or normalise() — these require the full ProjexProjectInput discriminated union with a mandatory type field
  • For production project definitions — use ProjexProjectInput for full type safety

Properties

PropertyTypeRequiredDescription
idstringYesUnique identifier
typeProjectTypeNoProject type (optional)
statusProjectStatusYesCurrent status
repostringNoRepository path (GitHub/hybrid)
packagestringNoPackage name (npm/hybrid)
slugstringNoProduct Hunt slug
All BaseProjectInput fieldsVariousNoAll other base properties

Difference from ProjexProjectInput

AspectProjexProjectInputProjexProjectInputCompat
StructureDiscriminated unionSingle flat type
type fieldRequiredOptional
Type-specific fieldsRequired based on typeAll optional
Type safetyFull narrowing by typeNo narrowing
Use with normaliseSupportedNot directly