Skip to content

Commit

Permalink
Merge branch 'buildfixes' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Dec 15, 2024
2 parents 759ffca + 27de7cc commit 0672df4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Binary file modified bun.lockb
Binary file not shown.
7 changes: 5 additions & 2 deletions lib/components/RunFrameWithApi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { useRunFrameStore, selectCurrentFileMap } from "./store"
import type { RunFrameWithApiProps } from "./types"

const guessEntrypoint = (files: string[]) =>
files.find((file) => file.includes("entrypoint.")) ??
files.find((file) => file.includes("index.")) ??
files.find((file) => file.includes("main.")) ??
files.find((file) => file.endsWith(".tsx"))

export const RunFrameWithApi = ({ apiBaseUrl }: RunFrameWithApiProps) => {
Expand All @@ -23,9 +26,9 @@ export const RunFrameWithApi = ({ apiBaseUrl }: RunFrameWithApiProps) => {
return () => stopPolling()
}, [startPolling, stopPolling])

const entrypoint = guessEntrypoint(Object.keys(fsMap))
const entrypoint = guessEntrypoint(Object.keys(fsMap)) ?? "entrypoint.tsx"

if (!entrypoint) {
if (!fsMap[entrypoint]) {
return <div>No entrypoint found for Run Frame!</div>
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"class-variance-authority": "^0.7.1",
"playwright": "^1.49.1",
"react": "18",
"react-cosmos": "^6.2.1",
"react-dom": "18",
Expand Down
6 changes: 5 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export default defineConfig({
},
},
define: {
global: {},
global: {
process: {
env: {},
},
},
},
root: ".",
publicDir: "public",
Expand Down

0 comments on commit 0672df4

Please sign in to comment.