Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Jan 8, 2026

Improved Type Safety for Flow Steps and Skippable Dependencies

This PR enhances the type system for Flow steps and skippable dependencies:

  1. Refactored ExtractFlowSteps to return step slugs as keys, and introduced a new StepOutput<> utility type to get the output type from a specific step.

  2. Updated type tests to use the new StepOutput<> type for accessing step output types, providing a clearer and more consistent API.

  3. Added comprehensive compile-time error tests for skippable dependencies to ensure TypeScript correctly rejects invalid patterns:

    • Direct property access on optional dependencies without null checks
    • Proper handling of dependencies with whenUnmet: 'skip' and retriesExhausted: 'skip' options
    • Type safety for mixed dependencies (required and optional)
    • Type checking for array and map steps with skip modes

These changes improve the developer experience by providing better type safety and clearer error messages when working with potentially skipped steps in flows.

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

⚠️ No Changeset found

Latest commit: 6be7361

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Jan 8, 2026

View your CI Pipeline Execution ↗ for commit 6be7361

Command Status Duration Result
nx run edge-worker:test:integration ✅ Succeeded 3m 46s View ↗
nx run client:e2e ✅ Succeeded 1m 8s View ↗
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 3s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 25s View ↗
nx run cli:e2e ✅ Succeeded 4s View ↗
nx run edge-worker:e2e ✅ Succeeded 41s View ↗
nx run core:pgtap ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-11 19:45:04 UTC

@jumski jumski force-pushed the 01-06-fix_step_array_map_overloads_to_use_topts_intersection_pattern_for_skippability_detection branch from bb09b62 to 6be7361 Compare January 11, 2026 19:26
@jumski jumski force-pushed the 01-06-add_stepmeta_type_structure_for_skippable_deps_tracking branch from 14ed89d to af7d04a Compare January 11, 2026 19:26
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.

2 participants