Skip to content

Add support for use-workflow serialization#172

Open
cramforce wants to merge 5 commits intomainfrom
workflow-serde2
Open

Add support for use-workflow serialization#172
cramforce wants to merge 5 commits intomainfrom
workflow-serde2

Conversation

@cramforce
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
just-bash-website Ready Ready Preview, Comment Mar 29, 2026 8:10pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
just-bash Ignored Ignored Mar 29, 2026 8:10pm

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 29, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

const { Bash } = await import(/* @vite-ignore */ PKG);
// No network config → curl is not registered → "command not found"
const bash = new Bash();
const result = await bash.exec(script);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sidenote: could also make bash serializable so bash.exec works in workflow context? 🤔

const bash = new Bash();
const result = await bash.exec(script);
return {
serialized: bash.toJSON(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if bash is serializable then you can just return it here without .toJSON()

: undefined,
processInfo: options.processInfo,
});
return bash.toJSON();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't have to explicitly do this if bash is serializable

* in the workflow sandbox.
*
* All imports are dynamic to avoid pulling Node.js modules into the workflow bundle.
*/
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is completely avoiding workflow serde and just doing explicit fromJSON and toJSON everywhere

Comment on lines +14 to +24
// Helpers to load Bash/InMemoryFs without static import analysis.
// The @vite-ignore comment prevents esbuild/vite from resolving these
// dynamic imports during the workflow bundle build, which would pull
// Node.js-dependent code into the workflow sandbox.
// ---------------------------------------------------------------------------
// Import just-bash by package name (self-reference via package.json exports).
// The @vite-ignore comment prevents esbuild from statically resolving this
// during the workflow bundle build (which would pull Node.js code into the sandbox).
// At runtime, Node.js resolves "just-bash" via the package.json exports field,
// which points to the built bundle in dist/.
const PKG = "just-bash";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm this also seems like a really weird pattern - node shuoldn't be getting bundled into workflow at all - but it means you do have to implement "use step" on the bash and fs instance methods

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.

2 participants