mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-13 11:41:31 +00:00
Build modified streamline images
The official image from streamline does not currently work for the arm64 platform. As a temporary measure, the source code and docker build scripts have been lifted from the official images and are used to build locally. Some additional modifications are made to reduce overall image size, these are documented in docker/README.md
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
import fs from 'fs/promises';
|
||||
import path from 'path';
|
||||
|
||||
async function collectModuleAssetsPaths(paths, modulesPath) {
|
||||
modulesPath = path.join(__dirname, modulesPath);
|
||||
|
||||
const moduleStatusesPath = path.join(__dirname, 'modules_statuses.json');
|
||||
|
||||
try {
|
||||
// Read module_statuses.json
|
||||
const moduleStatusesContent = await fs.readFile(moduleStatusesPath, 'utf-8');
|
||||
const moduleStatuses = JSON.parse(moduleStatusesContent);
|
||||
|
||||
// Read module directories
|
||||
const moduleDirectories = await fs.readdir(modulesPath);
|
||||
|
||||
for (const moduleDir of moduleDirectories) {
|
||||
if (moduleDir === '.DS_Store') {
|
||||
// Skip .DS_Store directory
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if the module is enabled (status is true)
|
||||
if (moduleStatuses[moduleDir] === true) {
|
||||
const viteConfigPath = path.join(modulesPath, moduleDir, 'vite.config.js');
|
||||
const stat = await fs.stat(viteConfigPath);
|
||||
|
||||
if (stat.isFile()) {
|
||||
// Import the module-specific Vite configuration
|
||||
const moduleConfig = await import(viteConfigPath);
|
||||
|
||||
if (moduleConfig.paths && Array.isArray(moduleConfig.paths)) {
|
||||
paths.push(...moduleConfig.paths);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error reading module statuses or module configurations: ${error}`);
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
export default collectModuleAssetsPaths;
|
||||
Reference in New Issue
Block a user