mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat: init renderer server (#8088)
This commit is contained in:
@@ -18,16 +18,17 @@ const test = ava as TestFn<{
|
||||
}>;
|
||||
|
||||
function initTestStaticFiles(staticPath: string) {
|
||||
mkdirSync(path.join(staticPath, 'admin'), { recursive: true });
|
||||
const files = {
|
||||
'index.html': `<!DOCTYPE html><html><body>AFFiNE</body><script src="main.js"/></html>`,
|
||||
'main.js': `const name = 'affine'`,
|
||||
'admin/index.html': `<!DOCTYPE html><html><body>AFFiNE Admin</body><script src="/admin/main.js"/></html>`,
|
||||
'admin/main.js': `const name = 'affine-admin'`,
|
||||
'selfhost/index.html': `<!DOCTYPE html><html><body>AFFiNE</body><script src="main.js"/></html>`,
|
||||
'selfhost/main.js': `const name = 'affine'`,
|
||||
'admin/selfhost/index.html': `<!DOCTYPE html><html><body>AFFiNE Admin</body><script src="/admin/main.js"/></html>`,
|
||||
'admin/selfhost/main.js': `const name = 'affine-admin'`,
|
||||
};
|
||||
|
||||
for (const [filename, content] of Object.entries(files)) {
|
||||
writeFileSync(path.join(staticPath, filename), content);
|
||||
const filePath = path.join(staticPath, filename);
|
||||
mkdirSync(path.dirname(filePath), { recursive: true });
|
||||
writeFileSync(filePath, content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user