-
Notifications
You must be signed in to change notification settings - Fork 150
Allow "use step" functions to be defined outside of the app directory #708
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
Draft
TooTallNate
wants to merge
4
commits into
main
Choose a base branch
from
12-30-allow_use_step_functions_to_be_defined_outside_of_the_app_directory
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+130
−52
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| "@workflow/sveltekit": patch | ||
| "@workflow/builders": patch | ||
| "@workflow/astro": patch | ||
| "@workflow/nitro": patch | ||
| "@workflow/next": patch | ||
| --- | ||
|
|
||
| Build steps bundle in a two-pass process for "standalone" and "Vercel Build Output API" modes |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| /** | ||
| * This is a utility function from outside the workbench app directory. | ||
| * This is a step function from outside the workbench app directory. | ||
| * It is used to test that esbuild can resolve tsconfig path aliases. | ||
| * Note: This is NOT a step function - it's a regular function that gets called | ||
| * from within a step to verify path alias imports work correctly. | ||
| */ | ||
| export function pathsAliasHelper(): string { | ||
| return 'pathsAliasHelper'; | ||
| export async function pathsAliasStep(): Promise<string> { | ||
| 'use step'; | ||
| return 'pathsAliasStep'; | ||
| } |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
Missing error check for esbuild output when creating steps bundle in-memory. The TypeScript overload promises a non-optional
outputContent: string, but the implementation can returnundefined, which will cause runtime errors in the second build pass.View Details
📝 Patch Details
Analysis
Missing error check for esbuild output in createStepsBundle
What fails: The
createStepsBundle()method inbase-builder.tshas TypeScript overloads that promise a non-optionaloutputContent: stringwhen theoutfileparameter is omitted, but the implementation can returnundefined, violating the type contract. This causes the callers instandalone.tsandvercel-build-output-api.tsto use theoutputContentdirectly in esbuild'sstdin.contentswithout null-checking, creating a type-safety issue.How to reproduce:
createStepsBundle()without theoutfileparameter (as done instandalone.tsline 54 andvercel-build-output-api.tsline 59)outputContent: string!writeToFile && stepsResult.outputFiles?.[0] ? stepsResult.outputFiles[0].text : undefinedstepsResult.outputFilesis empty or falsy,outputContentbecomesundefined, violating the contractResult: TypeScript incorrectly allows
undefinedto be passed wherestringis required by the overload contract. While esbuild should always populateoutputFileswhenwrite: falsesucceeds, the lack of explicit error checking creates a defensive programming gap.Expected: The code should validate that
outputFilesexists and is non-empty before extracting content, similar to the error check increateWorkflowsBundle()at line 548-550:Fix: Added explicit error check in
createStepsBundle()at line 393-397 to ensureoutputFilesexists whenwriteToFileis false, making the type contract enforceable.