
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
@breadboard-ai/build-code
Advanced tools
Convert TypeScript functions to Breadboard runJavascript components
Converts TypeScript functions to Breadboard runJavascript
components. Code is
bundled and schema is automaticaly generated from TypeScript types.
Install:
npm i @breadboard-ai/build-code
Create a module with the following exports:
Inputs
Outputs
run
For example, the file src/js-components/is-foo.ts
:
export interface Inputs {
str: string;
}
export interface Outputs {
isFoo: boolean;
}
export const run = ({ str }: Inputs): Outputs => {
return { isFoo: strIsFoo(str) };
};
// Note that this function is outside the scope of `run`. This would
// normally be a problem with the the standard Breadboard `code`
// function, but it's OK here because we bundle! Imports work too.
function strIsFoo(str: string): boolean {
return str === "foo";
}
Use the build-code
binary:
{
"scripts": {
"generate:js-components": "build-code --tsconfig=./tsconfig.json --out=./src/generated ./src/js-components/*.ts"
}
}
Import the generated module, which in this case will be at
src/generated/is-foo.ts
, and use it with the Breadboard Build API. The
module will contain a strongly-typed function based on the name of the
source module:
import { isFoo } from "./generated/is-foo.js";
import { input, board } from "@breadboard-ai/build";
const str = input();
const isFooInst = isFoo({ str });
export const myBoard = board({
inputs: { str },
outputs: { isFoo: isFooInst.outputs.isFoo },
});
Upon serialization to BGL, a runJavascript
component will be created
with bundled code and automatically generated schemas:
{
"nodes": {
"id": "runJavascript-0",
"type": "runJavascript",
"configuration": {
"raw": true,
"name": "run",
"code": "export const run = ({ str }) => {\n return { isFoo: strIsFoo(str) };\n};\n\nfunction strIsFoo(str) {\n return str === \"foo\";\n}\n",
"inputSchema": {
"type": "object",
"properties": {
"str": {
"type": "string"
}
},
"required": ["str"],
"additionalProperties": false
},
"outputSchema": {
"type": "object",
"properties": {
"isFoo": {
"type": "boolean"
}
},
"required": ["isFoo"],
"additionalProperties": false
}
}
}
}
FAQs
Convert TypeScript functions to Breadboard runJavascript components
The npm package @breadboard-ai/build-code receives a total of 14 weekly downloads. As such, @breadboard-ai/build-code popularity was classified as not popular.
We found that @breadboard-ai/build-code demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.