Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
matthoffner committed Dec 10, 2023
1 parent 360e1dc commit d963314
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions example/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { createEsbuilder } from "../../dist/esm/esbuild";
const [esbuild] = createEsbuilder();

const examples = [
"Compile and run a TypeScript file that creates an interactive to-do list with add, remove, and toggle completion functionalities."
"Create a JavaScript function that finds the highest number in an array.",
"Develop a simple JSX component that takes in a user's name as a prop and displays a personalized greeting.",
"Build a simple TypeScript function that adds two numbers together and includes type checking.",
"Create a basic TSX React component for a ToDo item, it should have properties for the task name and a boolean to represent if it is completed or not, and should render accordingly."
];

export default function Chat() {
Expand All @@ -36,10 +39,8 @@ export default function Chat() {
let result;
let entryPoint = parsedFunctionCallArguments.entryPoint || "index.js";

const compiledResult = esbuild({ rawCode: parsedFunctionCallArguments.rawCode, entryPoint });
const compiledResult = await esbuild({ rawCode: parsedFunctionCallArguments.rawCode, entryPoint });
result = JSON.stringify(compiledResult);

console.log(result);

return {
messages: [
Expand Down

0 comments on commit d963314

Please sign in to comment.