MCPcopy Create free account
hub / github.com/code100x/mobile-magic / onFileUpdate

Function onFileUpdate

mobile-magic/apps/worker/os.ts:12–29  ·  view source on GitHub ↗
(filePath: string, fileContent: string, projectId: string, promptId: string, type: "NEXTJS" | "REACT_NATIVE")

Source from the content-addressed store, hash-verified

10
11
12export async function onFileUpdate(filePath: string, fileContent: string, projectId: string, promptId: string, type: "NEXTJS" | "REACT_NATIVE") {
13 await prismaClient.action.create({
14 data: {
15 projectId,
16 promptId,
17 content: `Updated file ${filePath}`
18 },
19 });
20
21 RelayWebsocket.getInstance().send(JSON.stringify({
22 event: "admin",
23 data: {
24 type: "update-file",
25 content: fileContent,
26 path: `${getBaseWorkerDir(type)}/${filePath}`
27 }
28 }))
29}
30
31export async function onShellCommand(shellCommand: string, projectId: string, promptId: string) {
32 //npm run build && npm run start

Callers 1

index.tsFile · 0.90

Calls 3

getBaseWorkerDirFunction · 0.85
sendMethod · 0.80
getInstanceMethod · 0.80

Tested by

no test coverage detected