Skip to content

Latest commit

History

60 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

@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.

CICodeQLOpenSSF ScorecardDependabotLicense: MIT


Packages

Utilities

PackageVersionCoverageDescription
@gregoiref/resultversioncoverageResult<T, E> discriminated union — type-safe error handling without exceptions
@gregoiref/ts-utilsversioncoverageAdvanced TypeScript generics: deepMerge, pick, groupBy, memoize, and more
@gregoiref/env-validatorversioncoverageType-safe environment validation without Zod or dotenv
@gregoiref/http-clientversioncoverageTyped fetch wrapper with interceptors, timeout, and Result-based error handling
@gregoiref/loggerversioncoverageStructured JSON logger with pluggable transports
@gregoiref/dateversioncoverageDate helpers (format, diff, add, clamp) without date-fns or Moment
@gregoiref/cryptoversionWeb Crypto API utilities — hashing, HMAC, AES-GCM, PBKDF2, random tokens

Shared configs

PackageDescription
@gregoiref/tsconfigStrict TypeScript configs — base, node, dom, astro, nuxt
@gregoiref/biome-configBiome lint + format for TypeScript projects
@gregoiref/vitest-configVitest setup with 100% coverage thresholds
@gregoiref/commitlint-configCommitlint config with emoji support
@gregoiref/cz-configcz-git config with 12 emoji types
@gregoiref/changeset-configChangesets 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'constlogger=createLogger({level: 'info',context: {service: 'users'}})constclient=createHttpClient({baseUrl: 'https://api.example.com',timeout: 5000})constresult=awaitclient.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?

AlternativeWhy this instead
axiosWraps 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
zodBrings 15 kB for runtime validation; @gregoiref/env-validator covers the env-only use case at zero cost
neverthrowA fine library — this exists to stay in the monorepo and use no external deps
date-fnsComprehensive but heavy; @gregoiref/date covers the 20% of operations that handle 80% of cases

Documentation

DocumentDescription
docs/getting-started.mdFive cross-package usage patterns — HTTP services, env bootstrap, pipelines, dates, child loggers
CHANGELOG.mdCross-package release overview with links to individual changelogs
TRACKING.mdArchitecture decisions, phase history, and known risks
IDEA.mdPackage 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

ToolRole
pnpm workspacesPackage manager — hoisted deps, workspace protocol
TurborepoTask orchestration with remote cache and dependsOn graph
TypeScriptStrictest compiler flags (exactOptionalPropertyTypes, noUncheckedIndexedAccess)
BiomeUnified lint + format — replaces ESLint + Prettier
VitestUnit tests with v8 coverage, 100% threshold enforced
ChangesetsPer-package semver versioning + automatic CHANGELOG
DependabotAutomated dependency updates (GitHub Actions + npm) with SHA pinning + auto-merge
CodeQLStatic security analysis (security-extended query suite)
OSSF ScorecardOpen-source security posture scoring
Jazzer.jsCoverage-guided fuzzing — weekly CI + 3 fuzz targets
size-limitBundle size budget enforced on every PR
Dependency ReviewBlocks 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

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages