BREAKING CHANGE(tapbundle_serverside): Rename Node-specific tapbundle module to tapbundle_serverside and migrate server-side utilities

This commit is contained in:
2025-11-19 21:43:15 +00:00
parent 3ab5550cb8
commit 41d7c1ce49
13 changed files with 59 additions and 23 deletions

View File

@@ -0,0 +1,20 @@
import * as plugins from './plugins.js';
import * as paths from './paths.js';
export const fileUrls = {
dockerAlpineImage: 'https://code.foss.global/testassets/docker/raw/branch/main/alpine.tar',
}
export class TestFileProvider {
public async getDockerAlpineImageAsLocalTarball(): Promise<string> {
const filePath = plugins.path.join(paths.testFilesDir, 'alpine.tar')
// fetch the docker alpine image
const response = await plugins.smartrequest.SmartRequest.create()
.url(fileUrls.dockerAlpineImage)
.get();
await plugins.smartfile.fs.ensureDir(paths.testFilesDir);
const buffer = Buffer.from(await response.arrayBuffer());
await plugins.smartfile.memory.toFs(buffer, filePath);
return filePath;
}
}