Skip to content

Teste#9

Open
jordyfontoura wants to merge 14 commits intodevfrom
main
Open

Teste#9
jordyfontoura wants to merge 14 commits intodevfrom
main

Conversation

@jordyfontoura
Copy link
Owner

@jordyfontoura jordyfontoura commented Nov 26, 2025

📝 Description

🎯 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style update (formatting, renaming)
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvement
  • ✅ Test update
  • 🔧 Build/CI update
  • 🔖 Release / Version update

🔗 Related Issue

Fixes #(issue number)

🧪 Testing

  • All existing tests pass
  • Added new tests for new functionality
  • Manual testing completed

Test Configuration:

  • Node version:
  • TypeScript version:
  • OS:

📋 Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

💻 Code Changes

Added

Changed

Removed

📸 Screenshots / Examples

// Example usage of new feature/fix

🤔 Additional Notes

📚 Documentation

  • README.md updated
  • JSDoc comments added/updated
  • CHANGELOG.md updated
  • Examples added/updated

Thank you for contributing to Tryless! 🎉


Note

Medium Risk
Medium risk because it changes the package’s ESM entrypoints (.mjs/exports) and adjusts resultfy() promise detection to treat any thenable as async, which can affect consumer bundling/runtime behavior and edge-case values.

Overview
CI/CD hardening and speedups. CI is split into parallel lint and typecheck jobs gating a multi-Node (20/22) test matrix, with Playwright browser caching, failure artifact upload, and a final ci-success aggregator for branch protection.

Safer publishing. The publish workflow now validates semver tag format, enforces tag/version match with package/package.json, requires a matching CHANGELOG.md entry, runs typecheck, caches/installs Playwright browsers, and verifies package contents before npm publish.

ESM + API improvements. The package switches ESM output from dist/index.esm.js to dist/index.mjs (Rollup + package.json module/exports updates) and updates e2e imports accordingly; resultfy() now detects thenables via a new isThenable guard (instead of instanceof Promise) and adds tests for PromiseLike/proxy promises. Documentation/metadata are updated (README examples favor resultfy, changelog entries added, version bumped to 1.5.8, keywords/description refreshed).

Written by Cursor Bugbot for commit 60164aa. This will update automatically on new commits. Configure here.

…to use filter for improved dependency management
…ance in error handling and functional programming
…e `resultfy()` for improved readability and best practices
…iseLike objects with improved type guard and test coverage
# Validate semantic versioning format
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?(\+[a-zA-Z0-9.]+)?$ ]]; then
echo "Error: Tag must follow semantic versioning (e.g., v1.0.0)"
exit 1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semver validation rejects valid prerelease tags

Medium Severity

The tag regex in publish.yml does not allow - inside prerelease or build identifiers, so valid SemVer tags like v1.2.3-beta-1 fail validation. This makes Validate tag format reject legitimate release tags and blocks publishing.

Fix in Cursor Fix in Web

run: pnpm --filter tryless lint
- name: Get Playwright version
id: playwright-version
run: echo "version=$(pnpm --filter tryless list @playwright/test --depth=0 --json | jq -r '.[0].version')" >> $GITHUB_OUTPUT
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playwright cache key uses wrong dependency

Medium Severity

The cache key reads @playwright/test version, but package/package.json depends on playwright instead. This makes steps.playwright-version.outputs.version resolve to null, so the browser cache key is not tied to the actual Playwright runtime version.

Additional Locations (1)

Fix in Cursor Fix in Web

): any {
const error = fnError ?? UnknownError;
if (fn instanceof Promise) {
if (isThenable(fn)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direct thenables can still throw synchronously

Low Severity

When resultfy receives a direct thenable, it calls fn.then(...) outside any try/catch. If that then implementation throws synchronously, resultfy throws instead of returning an Err, which breaks the “always return result” behavior for PromiseLike inputs.

Fix in Cursor Fix in Web

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

try {
const result = (fn as (...args: any[]) => any)(...args);
if (result instanceof Promise) {
if (isThenable(result)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resultfy typings mismatch thenable runtime behavior

Medium Severity

resultfy now treats any thenable via isThenable, but its overloads still model only Promise. Calls like resultfy(promiseLike) remain incorrectly typed, and functions returning PromiseLike are typed as synchronous Ok while runtime returns a Promise. This breaks resultfy’s TypeScript contract and can cause incorrect consumer control flow.

Additional Locations (2)

Fix in Cursor Fix in Web

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