Skip to content

GregoireF/utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@GregoireF/utils

A TypeScript monorepo of zero-dependency utility libraries and shared configs, used across personal and professional projects. Built to demonstrate industrial-grade practices: strict types, 100% test coverage, automated versioning, and supply-chain security.

CI CodeQL OpenSSF Scorecard Renovate License: MIT


Packages

Utilities

Package Version Coverage Description
@gregoiref/result version coverage Result<T, E> discriminated union — type-safe error handling without exceptions
@gregoiref/ts-utils version coverage Advanced TypeScript generics: deepMerge, pick, groupBy, memoize, and more
@gregoiref/env-validator version coverage Type-safe environment validation without Zod or dotenv
@gregoiref/http-client version coverage Typed fetch wrapper with interceptors, timeout, and Result-based error handling
@gregoiref/logger version coverage Structured JSON logger with pluggable transports
@gregoiref/date version coverage Date helpers (format, diff, add, clamp) without date-fns or Moment

Shared configs

Package Description
@gregoiref/tsconfig Strict TypeScript configs — base, node, dom, astro, nuxt
@gregoiref/biome-config Biome lint + format for TypeScript projects
@gregoiref/vitest-config Vitest setup with 100% coverage thresholds
@gregoiref/commitlint-config Commitlint config with emoji support
@gregoiref/cz-config cz-git config with 12 emoji types
@gregoiref/changeset-config Changesets config factory for TypeScript monorepos

Combined usage

The packages are designed to compose. A typical service layer uses three or four together:

import { createHttpClient } from '@gregoiref/http-client'
import { createLogger }     from '@gregoiref/logger'
import { isOk }             from '@gregoiref/result'

const logger = createLogger({ level: 'info', context: { service: 'users' } })
const client = createHttpClient({ baseUrl: 'https://api.example.com', timeout: 5000 })

const result = await client.get<User>('/users/42')

if (isOk(result)) {
  logger.info('User fetched', { name: result.value.data.name })
} else {
  logger.error('Fetch failed', { status: result.error.status })
}

See docs/getting-started.md for five full patterns: HTTP services, env bootstrap, data pipelines, date formatting, and child loggers.


Why not just use X?

Alternative Why this instead
axios Wraps fetch with a 5 kB runtime dep; @gregoiref/http-client is a thin typed shell — the only runtime dep is @gregoiref/result from this same monorepo
zod Brings 15 kB for runtime validation; @gregoiref/env-validator covers the env-only use case at zero cost
neverthrow A fine library — this exists to stay in the monorepo and use no external deps
date-fns Comprehensive but heavy; @gregoiref/date covers the 20% of operations that handle 80% of cases

Documentation

Document Description
docs/getting-started.md Five cross-package usage patterns — HTTP services, env bootstrap, pipelines, dates, child loggers
CHANGELOG.md Cross-package release overview with links to individual changelogs
TRACKING.md Architecture decisions, phase history, and known risks
IDEA.md Package backlog — validated, in-progress, and published status

Installation

Packages are published to GitHub Packages under the @gregoiref scope. Add the registry to your .npmrc:

@gregoiref:registry=https://npm.pkg.github.com

Then install any package:

pnpm add @gregoiref/result
pnpm add @gregoiref/ts-utils
pnpm add @gregoiref/http-client

Development

git clone https://github.com/GregoireF/utils.git
cd utils
pnpm install

# Lint + typecheck + test across all packages
pnpm turbo run check

# Build all packages
pnpm turbo run build

# Run tests with coverage
pnpm turbo run test

# Interactive guided commit (Conventional Commits + emoji)
pnpm commit

Stack

Tool Role
pnpm workspaces Package manager — hoisted deps, workspace protocol
Turborepo Task orchestration with remote cache and dependsOn graph
TypeScript Strictest compiler flags (exactOptionalPropertyTypes, noUncheckedIndexedAccess)
Biome Unified lint + format — replaces ESLint + Prettier
Vitest Unit tests with v8 coverage, 100% threshold enforced
Changesets Per-package semver versioning + automatic CHANGELOG
Renovate Automated dependency updates with SHA pinning + auto-merge
CodeQL Static security analysis (security-extended query suite)
OSSF Scorecard Open-source security posture scoring
Jazzer.js Coverage-guided fuzzing — weekly CI + 3 fuzz targets
size-limit Bundle size budget enforced on every PR
Dependency Review Blocks high-severity CVEs and GPL/AGPL deps on PRs

Contributing

See CONTRIBUTING.md. Open an issue before writing significant code.
For security vulnerabilities, see SECURITY.md — do not open a public issue.

Canary releases are published daily to GitHub Packages under the canary dist-tag (1.0.0-canary.<date>.<sha>). Install with pnpm add @gregoiref/result@canary.


Author

@GregoireF


License

MIT

About

Shared utilities and tooling.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors