MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / addFile

Function addFile

packages/ui-default/backendlib/builder.ts:112–118  ·  view source on GitHub ↗
(name: string, content: string)

Source from the content-addressed store, hash-verified

110 }
111 }
112 function addFile(name: string, content: string) {
113 vfs[name] = content;
114 hashes[name] = sha1(content).substring(0, 8);
115 logger.info('+ %s-%s: %s', name, hashes[name].substring(0, 6), size(content.length));
116 newFiles.push(name);
117 totalSize += content.length;
118 }
119 for (const m of lazyModules) {
120 const name = basename(m).split('.')[0];
121 const { outputFiles } = await build(`window.lazyModuleResolver['${name}'](require('${relative(tmp, m).replace(/\\/g, '\\\\')}'))`);

Callers 2

buildUIFunction · 0.85
registerFunction · 0.85

Calls 4

sha1Function · 0.85
sizeFunction · 0.85
infoMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected