How adedoyin-emmanuel/tsfluent works
Project type and purpose
• This is an open-source TypeScript library (“tsfluent”) providing a fluent, type-safe Result/ResultAsync API for handling success/failure, metadata, and async operations.
• It’s not a client/server app but a reusable package that compiles to JS, ships on npm, and integrates with CI/CD.
File structure
• Top-level config & tooling:
• .github/workflows/ci.yml & publish.yml – CI for testing, linting, and npm publish
• .husky/pre-push – git hooks
• commitlint.config.* – commit message enforcement
• tsconfig.json, package.json, bun.lock, .npmignore – build & packaging config
• src/ holds the actual library modules:
• src/index.ts – public API exports
• src/result.ts – core Result<T, TContext> implementation
• src/result-async.ts – async counterpart, builds on core
• src/@types/result.ts – shared types/interfaces (IError, IResultMetadata, etc.)
• src/utils/async-utils.ts – retry, timeout, combine helpers
• src/utils/result-extensions.ts – extra methods that augment Result/ResultAsync
• tests/ – unit tests exercising each module.
README for additional insights
• API Reference outlines the public interface and module responsibilities.
• Usage examples demonstrate how core & async modules interoperate and how metadata/context flows through.