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

Function seedVault

tooling/scripts/perf-desktop-runtime.mjs:204–241  ·  view source on GitHub ↗
(vaultRoot, count)

Source from the content-addressed store, hash-verified

202}
203
204async function seedVault(vaultRoot, count) {
205 const inbox = join(vaultRoot, 'inbox')
206 const quick = join(vaultRoot, 'quick')
207 const archive = join(vaultRoot, 'archive')
208 const trash = join(vaultRoot, 'trash')
209 await Promise.all([
210 mkdir(inbox, { recursive: true }),
211 mkdir(quick, { recursive: true }),
212 mkdir(archive, { recursive: true }),
213 mkdir(trash, { recursive: true })
214 ])
215
216 const files = []
217 for (let index = 0; index < count; index += 1) {
218 const id = formatIndex(index)
219 const topic = index % 20
220 const sprint = index % 13
221 const title = `Perf Note ${id} Topic ${topic}`
222 const body = `# ${title}
223
224This is a synthetic desktop runtime benchmark note for ZenNotes.
225It contains searchable token desktop-runtime-benchmark-${id} and shared topic-${topic}.
226
227## Details
228
229- Index: ${index}
230- Topic: ${topic}
231- Sprint: ${sprint}
232- Status: ${index % 3 === 0 ? 'active' : 'reference'}
233
234The body is intentionally modest so note-open timing measures app overhead more than disk throughput.
235
236#perf #topic-${topic} #sprint-${sprint}
237${largeNoteLines > 0 && index === Math.min(count - 1, largeNoteIndex) ? largeNoteBody(largeNoteLines, id) : ''}`
238 files.push([join(inbox, `${id} - topic-${topic}.md`), body])
239 }
240 await writeFilesInBatches(files)
241}
242
243async function seedUserData(userDataRoot, vaultRoot) {
244 await mkdir(userDataRoot, { recursive: true })

Callers 1

mainFunction · 0.70

Calls 3

formatIndexFunction · 0.70
largeNoteBodyFunction · 0.70
writeFilesInBatchesFunction · 0.70

Tested by

no test coverage detected