-
Notifications
You must be signed in to change notification settings - Fork 495
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
Fix: Add semicolons to generated workflows/index.ts file #2854
base: main
Are you sure you want to change the base?
Fix: Add semicolons to generated workflows/index.ts file #2854
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
@OmkarBansod02 is attempting to deploy a commit to the Mastra Team on Vercel. A member of the Team first needs to authorize it. |
✅ No documentation updates required. |
@@ -461,6 +473,12 @@ export const writeCodeSample = async ( | |||
|
|||
try { | |||
await writeCodeSampleForComponents(llmProvider, component, destPath, importComponents); |
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.
Hi, I believe we already handle the workflow component and write to workflows/index.ts
down the tree in writeCodeSampleForComponents
Issue
When using a tsconfig.json with
verbatimModuleSyntax: true
, the CLI generates a workflows/index.ts file without semicolons, causing TypeScript errors with the message "Expected a semicolon in workflows/index.ts".Fix
This PR adds a dedicated function
writeWorkflowIndexSample
that generates theworkflows/index.ts
file with proper export statements and ensures semicolons are added by using Prettier withsemi: true
.Testing
Tested by verifying that the Prettier formatting with
semi: true
correctly adds semicolons to export statements, which ensures compatibility with theverbatimModuleSyntax: true
setting in tsconfig.json.Related Issues
Fixes #2849