Repository navigation
Add createFlow name and run the node:test files - #7
Merged
Merged
Conversation
createFlow({ name }) sets a stable flowName for events, devtools,
OpenTelemetry spans and Sentry tags. It takes precedence over the
adapter name and the action function name, which minifiers can rename
in production builds (an arrow function in `action:` is just "action").
Both examples set it.
tests/core.test.mjs and tests/next.test.mjs were written for node:test
but never ran. npm test, and so CI, now runs them after the main suite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks done
…aude/flow-names # Conflicts: # CHANGELOG.md # scripts/run-tests.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small fixes found while reviewing the project's remaining weak spots.
createFlow({ name })flowNameused to be derived from the adapter name or fromaction.name. That name now ends up in:mutaflow <flowName>);Function names are fragile:
action: (input) => ...is named just"action".The new test confirms the second case.
nametakes precedence over the adapter name and the function name. Without it, the old fallback order still applies. Both examples now set it. The next-app example keeps the same namecreateTodoAction, souseFlowState(events, "createTodoAction")is unchanged.Test files that never ran
tests/core.test.mjsandtests/next.test.mjsare written fornode:test, butnpm testonly ranscripts/run-tests.mjs. Neither file ran locally or in CI. All 5 tests in them pass.npm testnow runsnode --test tests/core.test.mjs tests/next.test.mjsafter the main suite. The files are listed explicitly because Node 20 in the CI matrix does not support glob patterns in--test.Test plan
npm run typecheckfrom a clean buildnpm test: 54/54 in the main suite, including a new flow-name precedence test, plus 5/5node:testexamples/next-app: typecheck andnext buildThis branch is based on
mainand is independent of #6. Both touchtypes.tsandCHANGELOG.md, in different places.🤖 Generated with Claude Code