Skip to content

Packages folder

The packages folder holds only code that must be code, shared across the Studio's Startups as pnpm packages.

PropertyValue
Pathpackages/
HoldsImplementation
Kindfolder
Leadersgit-first
TeamEngineering Team
Written byChange.merge
Compiled bySoftwareBuilder

Example

packages/business-days/index.ts in a Startup repository.

packages/business-days/index.ts
/** The nth business day of a month, skipping weekends. */
export function businessDay(year: number, month: number, n: number): Date {
  const day = new Date(Date.UTC(year, month, 1))
  let count = 0
  while (true) {
    const weekday = day.getUTCDay()
    if (weekday !== 0 && weekday !== 6 && ++count === n) return day
    day.setUTCDate(day.getUTCDate() + 1)
  }
}

Generates

SoftwareBuilder compiles it into these records, Verbs and routes.

KindWhat
RecordsImplementation
VerbsNone.
RoutesNone.