Skip to content

upgrade/dependencies#26

Merged
w01fgang merged 6 commits intomainfrom
upgrade/dependencies
Feb 1, 2026
Merged

upgrade/dependencies#26
w01fgang merged 6 commits intomainfrom
upgrade/dependencies

Conversation

@w01fgang
Copy link
Copy Markdown
Contributor

@w01fgang w01fgang commented Nov 16, 2025

  • chore(tsconfig): Run type check on tests.
  • 🔧 use tsup to build the lib
  • docs(changeset): Use tsup to build the library
  • ⬆️ upgrade dependencies
  • chore: Apply prettier formatting and fix test after dependency upgrade

Summary by CodeRabbit

  • New Features

    • Added static method for filtering error types in error handling workflows.
    • Enhanced type-level validation and inference for breadcrumb configuration, enabling more flexible and type-safe breadcrumb capture.
  • Chores

    • Updated build system to use tsup for improved build pipeline.
    • Consolidated and updated development dependencies.
    • Improved test mocking and mock cleanup patterns.

✏️ Tip: You can customize this high-level summary in your review settings.

w01fgang and others added 5 commits October 12, 2025 16:30
Signed-off-by: w01fgang <sumin@unix-center.ru>
Signed-off-by: w01fgang <sumin@unix-center.ru>
Applied consistent Prettier formatting across the entire codebase following the dependency upgrade to Vitest v4. Fixed a test expectation in flexible-breadcrumbs.test.ts where the transform function was updated but the assertion wasn't updated to match.

Changes:
- Applied Prettier formatting to all source files
- Fixed test assertion to match transform output (priority vs param2_value)
- All tests pass (71 tests across 2 test suites)
- No security vulnerabilities detected

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 16, 2025

Walkthrough

The pull request modernizes the build pipeline from a custom multi-step process to tsup-based compilation, introduces tuple-aware breadcrumb type validation, relocates the TryResult type to public exports, adds a new static method to the Try class, and applies widespread formatting improvements across the codebase. Dependency tooling is updated with tsup, type-fest, and newer TypeScript and Vitest versions.

Changes

Cohort / File(s) Summary
Build Configuration & Tooling
package.json, tsup.config.ts, tsconfig.json, vite.config.ts, .github/workflows/ci.yml
Introduces new tsup-based build config with shared ESM/CJS settings, updates build scripts (added build:watch), replaces npm publish dependency setup, removes peerDependenciesMeta, updates devDependencies with tsup and type-fest, adjusts tsconfig exclude patterns to include test files, adds coverage configuration.
Type System Enhancements
src/utils/types.ts
Adds comprehensive tuple-aware breadcrumb validation system with new internal types (ExtractStringKeys, KeyArrayFor, BreadcrumbConfigTuple, IsTuple, TupleBreadcrumbExtractors, GenericBreadcrumbExtractor, ValidateKeys, etc.). Updates BreadcrumbConfig, BreadcrumbExtractor, and VariadicBreadcrumbTransformers to use conditional types for tuple vs non-tuple arguments, enabling richer compile-time validation.
Core Type Declarations
src/core/Try.ts, src/core/index.ts, src/core/reporter.ts
Minor formatting adjustments to constructor signature and breadcrumbs overloads without behavioral change; adds trailing newline to reporter.ts.
Public Export Relocation
src/nextjs/index.ts
Adds static method throwThroughErrorTypes delegating to CoreTry, relocates TryResult type export from core import to explicit re-export from '../core/Try', minor generic parameter formatting adjustments.
Platform-Specific Indices
src/browser/index.ts, src/node/index.ts, src/utils/index.ts
Formatting adjustments in JSDoc blocks and export statements; adds trailing newlines without behavioral changes.
Reporters and Error Handling
src/adapters/browser/reporter.ts, src/adapters/node/reporter.ts, src/nextjs/SentryReporter.ts, src/utils/error-reporter.ts, src/utils/transformers.ts
Reformatting across function signatures and conditional expressions (multi-line parameter lists, trailing commas, indentation); no logic or control flow changes; preserves error reporting and breadcrumb behavior.
Test Suite Updates
src/__tests__/Try.test.ts, src/__tests__/flexible-breadcrumbs.test.ts
Shifts Try import to default export pattern, adds vi.clearAllMocks in afterEach blocks, relocates TryResult type import to package root, refactors breadcrumb transformer usage with explicit transform functions and type-casting for invalid indices, adds new "Type safety" test section for multi-parameter extraction validation.
Examples
examples/comprehensive-examples.ts, examples/custom-reporter.ts
Populates bound method properties in UserRepository constructor to demonstrate safe method binding with Try wrappers, updates string literal quoting style in .report calls from escaped single quotes to unescaped double quotes, applies formatting improvements with additional parentheses and trailing commas.
Release Documentation
.changeset/cold-olives-cry.md
Adds changeset file documenting patch release for @power-rent/try-catch with note to build using tsup.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Hopping through types with tuples so tight,
Tsup builds the future, formatting feels right,
Exports take flight, from root they now gleam,
A modern toolkit fulfilling the dream!
The breadcrumbs are smarter, the pipeline runs clean—
The finest refactor this rabbit has seen! 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 34.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The PR title 'upgrade/dependencies' is too vague and generic. While it relates to dependency updates mentioned in the PR objectives, the changeset is significantly broader and includes substantial refactoring: switching the build system to tsup, restructuring tsconfig for test type-checking, adding new TypeScript utility types for tuple-aware breadcrumbs, reformatting code extensively with Prettier, and exporting TryResult type from the root. The title fails to capture these major architectural changes and only hints at one aspect of the PR. Consider a more descriptive title that reflects the main structural changes, such as 'Migrate build system to tsup and enhance breadcrumb typing' or 'Refactor build pipeline with tsup and improve type safety for breadcrumbs'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch upgrade/dependencies

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@w01fgang w01fgang force-pushed the upgrade/dependencies branch from e5eec5a to a3ba85e Compare January 31, 2026 17:56
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jan 31, 2026

Quality Gate Passed Quality Gate passed

Issues
0 New issues
23 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.6% Duplication on New Code

See analysis details on SonarQube Cloud

@w01fgang w01fgang marked this pull request as ready for review January 31, 2026 17:58
@w01fgang w01fgang merged commit a7cd12a into main Feb 1, 2026
5 checks passed
@w01fgang w01fgang deleted the upgrade/dependencies branch February 1, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant