MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / startDesktopRuntime

Function startDesktopRuntime

tooling/scripts/perf-desktop-runtime.mjs:275–302  ·  view source on GitHub ↗
({ debugPort, userDataRoot, disablePersistedMetaCache, appPath })

Source from the content-addressed store, hash-verified

273}
274
275function startDesktopRuntime({ debugPort, userDataRoot, disablePersistedMetaCache, appPath }) {
276 const runtimePath = appPath ? packagedAppExecutablePath(appPath) : electronPath
277 const runtimeArgs = appPath
278 ? [`--remote-debugging-port=${debugPort}`, '--js-flags=--expose-gc']
279 : [`--remote-debugging-port=${debugPort}`, '--js-flags=--expose-gc', desktopOutMain]
280 const child = spawn(runtimePath, runtimeArgs, {
281 cwd: repoRoot,
282 env: {
283 ...process.env,
284 ELECTRON_DISABLE_SECURITY_WARNINGS: '1',
285 ZEN_PERF: '1',
286 ZENNOTES_USER_DATA_PATH: userDataRoot,
287 ...(disablePersistedMetaCache ? { ZEN_PERF_DISABLE_PERSISTED_META_CACHE: '1' } : {})
288 },
289 stdio: ['ignore', 'pipe', 'pipe']
290 })
291 let log = ''
292 child.stdout.on('data', (chunk) => {
293 log = appendBounded(log, chunk)
294 })
295 child.stderr.on('data', (chunk) => {
296 log = appendBounded(log, chunk)
297 })
298 return {
299 child,
300 log: () => log
301 }
302}
303
304class CdpClient {
305 constructor(webSocketUrl) {

Callers 1

mainFunction · 0.85

Calls 3

appendBoundedFunction · 0.70
onMethod · 0.45

Tested by

no test coverage detected