(
files: {[path: string]: string},
entryPath: string,
)
| 457 | ).js.code; |
| 458 | |
| 459 | const prepareBundledResults = async ( |
| 460 | files: {[path: string]: string}, |
| 461 | entryPath: string, |
| 462 | ): Promise<Results> => { |
| 463 | const allFiles: {[path: string]: string} = { |
| 464 | ...files, |
| 465 | [DOCS_SVELTE_SHIM_PATH]: `import * as Svelte from 'svelte'; |
| 466 | |
| 467 | const getContextValue = (props = {}) => [ |
| 468 | props.store, |
| 469 | props.storesById, |
| 470 | props.metrics, |
| 471 | props.metricsById, |
| 472 | props.indexes, |
| 473 | props.indexesById, |
| 474 | props.relationships, |
| 475 | props.relationshipsById, |
| 476 | props.queries, |
| 477 | props.queriesById, |
| 478 | props.checkpoints, |
| 479 | props.checkpointsById, |
| 480 | props.persister, |
| 481 | props.persistersById, |
| 482 | props.synchronizer, |
| 483 | props.synchronizersById, |
| 484 | undefined, |
| 485 | undefined, |
| 486 | ]; |
| 487 | |
| 488 | export * from 'svelte'; |
| 489 | |
| 490 | export const mount = (component, options = {}) => { |
| 491 | const context = new Map(options.context ?? []); |
| 492 | if (!context.has('${TINYBASE_CONTEXT_KEY}')) { |
| 493 | context.set('${TINYBASE_CONTEXT_KEY}', getContextValue(options.props)); |
| 494 | } |
| 495 | const instance = Svelte.mount(component, { |
| 496 | ...options, |
| 497 | context, |
| 498 | }); |
| 499 | Svelte.flushSync(); |
| 500 | return { |
| 501 | destroy: () => Svelte.flushSync(() => Svelte.unmount(instance)), |
| 502 | }; |
| 503 | };`, |
| 504 | }; |
| 505 | const result = await build({ |
| 506 | bundle: true, |
| 507 | entryPoints: [entryPath], |
| 508 | format: 'cjs', |
| 509 | platform: 'node', |
| 510 | write: false, |
| 511 | plugins: [ |
| 512 | { |
| 513 | name: 'docs-virtual', |
| 514 | setup(build) { |
| 515 | build.onResolve({filter: /.*/}, (args) => { |
| 516 | if (args.kind === 'entry-point') { |
no test coverage detected
searching dependent graphs…