Ensure tauri prebuild installs UI workspace deps

This commit is contained in:
Shantur Rathore
2025-11-27 19:40:36 +00:00
parent 69cd3cf545
commit 940216d98b

View File

@@ -17,6 +17,8 @@ const serverInstallCommand =
"npm install --omit=dev --ignore-scripts --workspaces=false --package-lock=false --install-strategy=shallow --fund=false --audit=false"
const serverDevInstallCommand =
"npm ci --workspace @neuralnomads/codenomad --include-workspace-root=false --install-strategy=nested --fund=false --audit=false"
const uiDevInstallCommand =
"npm ci --workspace @codenomad/ui --include-workspace-root=false --install-strategy=nested --fund=false --audit=false"
const envWithRootBin = {
...process.env,
@@ -33,6 +35,8 @@ const braceExpansionPath = path.join(
"package.json",
)
const viteBinPath = path.join(uiRoot, "node_modules", ".bin", "vite")
function ensureServerBuild() {
const distPath = path.join(serverRoot, "dist")
const publicPath = path.join(serverRoot, "public")
@@ -97,6 +101,19 @@ function ensureServerDependencies() {
})
}
function ensureUiDevDependencies() {
if (fs.existsSync(viteBinPath)) {
return
}
console.log("[prebuild] ensuring ui build dependencies...")
execSync(uiDevInstallCommand, {
cwd: workspaceRoot,
stdio: "inherit",
env: envWithRootBin,
})
}
function copyServerArtifacts() {
fs.rmSync(serverDest, { recursive: true, force: true })
fs.mkdirSync(serverDest, { recursive: true })
@@ -133,6 +150,7 @@ function copyUiLoadingAssets() {
}
ensureServerDevDependencies()
ensureUiDevDependencies()
ensureServerBuild()
ensureUiBuild()
ensureServerDependencies()