-
Notifications
You must be signed in to change notification settings - Fork 67
docs: add WorkflowReadableStreamOptions to start api reference #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d5b7d4f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| #### WorkflowReadableStreamOptions | ||
|
|
||
| <TSDoc | ||
| definition={generateDefinition({ | ||
| code: ` | ||
| import type { WorkflowReadableStreamOptions } from 'workflow/api'; | ||
| export default WorkflowReadableStreamOptions;` | ||
| })} | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WorkflowReadableStreamOptions documentation section is incorrectly placed under the "Returns" section, but it's not actually a return type of start(). It's a parameter type for the Run.getReadable() method, so it should be documented elsewhere or repositioned.
View Details
📝 Patch Details
diff --git a/docs/content/docs/api-reference/workflow-api/start.mdx b/docs/content/docs/api-reference/workflow-api/start.mdx
index 62de19f..72a339d 100644
--- a/docs/content/docs/api-reference/workflow-api/start.mdx
+++ b/docs/content/docs/api-reference/workflow-api/start.mdx
@@ -51,16 +51,6 @@ export default Run;`
showSections={['returns']}
/>
-#### WorkflowReadableStreamOptions
-
-<TSDoc
-definition={generateDefinition({
- code: `
-import type { WorkflowReadableStreamOptions } from 'workflow/api';
-export default WorkflowReadableStreamOptions;`
-})}
-/>
-
## Good to Know
* The `start()` function is used in runtime/non-workflow contexts to programmatically trigger workflow executions.
@@ -89,3 +79,17 @@ const run = await start(myWorkflow, ['arg1', 'arg2'], { // [!code highlight]
deploymentId: 'custom-deployment-id' // [!code highlight]
}); // [!code highlight]
```
+
+## Type Reference
+
+### WorkflowReadableStreamOptions
+
+Used when calling [`Run.getReadable()`](/docs/api-reference/workflow-api/start#getReadable) on the returned `Run` object to configure the readable stream:
+
+<TSDoc
+definition={generateDefinition({
+ code: `
+import type { WorkflowReadableStreamOptions } from 'workflow/api';
+export default WorkflowReadableStreamOptions;`
+})}
+/>
Analysis
Incorrectly placed WorkflowReadableStreamOptions documentation under Returns section
What fails: Documentation for WorkflowReadableStreamOptions is placed under the "Returns" section of start() function documentation, implying it's a return type of start(), when it's actually a parameter type for Run.getReadable(options: WorkflowReadableStreamOptions)
How to reproduce:
- Navigate to docs/content/docs/api-reference/workflow-api/start.mdx
- View the documentation -
WorkflowReadableStreamOptionsis listed under "Returns" after theRunclass documentation - This suggests to developers that
WorkflowReadableStreamOptionsis returned bystart(), which is incorrect
Current behavior: start() returns a Run object. The WorkflowReadableStreamOptions type is only used as a parameter when calling the Run.getReadable() method, not as a return type.
Expected behavior: Documentation should make clear that WorkflowReadableStreamOptions is a parameter type for Run methods, not a return type of start(). Moved documentation to new "Type Reference" section after examples to clarify its relationship to the Run.getReadable() method.
Fix: Removed WorkflowReadableStreamOptions from the Returns section and added it to a new "Type Reference" section at the end of the documentation with clarification that it's used when calling Run.getReadable().
docs were missing
WorkflowReadableStreamOptionsin start page.also export type
WorkflowReadableStreamOptionsfromworkflow/api