feat(dashboard): align contracts and production build

This commit is contained in:
jjbrunton committed 2026-08-08 14:58:27 +01:00
1 parent 69d560d5c5
commit d6d29badcd
9 files changed
+189 -48

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
import fs from 'node:fs';
import path from 'node:path';
export interface DashboardAssets {
directory: string;
indexFile: string;
isLegacy: boolean;
}
export type FileExists = (filePath: string) => boolean;
export function resolveDashboardAssets(
workspaceDirectory: string,
fileExists: FileExists = fs.existsSync,
): DashboardAssets {
const reactDirectory = path.join(workspaceDirectory, 'apps', 'dashboard', 'dist');
const reactIndexFile = path.join(reactDirectory, 'index.html');
if (fileExists(reactIndexFile)) {
return {
directory: reactDirectory,
indexFile: reactIndexFile,
isLegacy: false,
};
}
const legacyDirectory = path.join(workspaceDirectory, 'public');
return {
directory: legacyDirectory,
indexFile: path.join(legacyDirectory, 'index.html'),
isLegacy: true,
};
}