MCPcopy Index your code
hub / github.com/tinyplex/tinybase / prepareBundledResults

Function prepareBundledResults

test/unit/documentation.test.ts:459–609  ·  view source on GitHub ↗
(
  files: {[path: string]: string},
  entryPath: string,
)

Source from the content-addressed store, hash-verified

457 ).js.code;
458
459const 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
467const 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
488export * from 'svelte';
489
490export 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') {

Callers 1

Calls 1

buildFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…