Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

OmkarBansod02
Copy link
Contributor

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 the workflows/index.ts file with proper export statements and ensures semicolons are added by using Prettier with semi: true.

Testing

Tested by verifying that the Prettier formatting with semi: true correctly adds semicolons to export statements, which ensures compatibility with the verbatimModuleSyntax: true setting in tsconfig.json.

Screenshot 2025-03-09 022950

Related Issues

Fixes #2849

Copy link

codesandbox bot commented Mar 8, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

changeset-bot bot commented Mar 8, 2025

⚠️ No Changeset found

Latest commit: abdb760

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

Copy link

vercel bot commented Mar 8, 2025

@OmkarBansod02 is attempting to deploy a commit to the Mastra Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

promptless bot commented Mar 8, 2025

✅ No documentation updates required.

@za01br
Copy link
Contributor

za01br commented Mar 10, 2025

@TheIsrael1

@@ -461,6 +473,12 @@ export const writeCodeSample = async (

try {
await writeCodeSampleForComponents(llmProvider, component, destPath, importComponents);
Copy link
Contributor

@TheIsrael1 TheIsrael1 Mar 11, 2025

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

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.

Mastra CLI: Expected a semicolon in workflows/index.ts
4 participants