Files
nanakura dc26878386
CI / Lint (push) Canceled after 0s
CI / Build Test (stage-web) (push) Canceled after 0s
CI / Build Test (ui-loading-screens) (push) Canceled after 0s
CI / Build Test (ui-transitions) (push) Canceled after 0s
CI / Unit Test (push) Canceled after 0s
CI / Type Check (push) Canceled after 0s
CI / Check Provenance (push) Canceled after 0s
Sync Labels / sync-labels (push) Successful in 1m43s
chore: prune unused apps and services for the moeka fork
- Remove stage-tamagotchi, stage-pocket, server, and engine workspaces with their workflows, addons, and docs
- Switch the toolchain from pnpm to bun, replace lockfiles with bun.lock
- Rewrite remaining product references to Moeka
2026-09-14 16:40:49 +07:00

25 lines
1.3 KiB
TypeScript

import type { AudioInputPreflightContext } from '../../../src/types'
import { resolve } from 'node:path'
import { loadEnv } from 'vite'
import { findWorkspaceRoot } from '../../../src/setup/find-workspace-root'
/** Loads Vite test-mode environment files and applies the environment of the current case. */
export async function loadCaseEnvironment(
environment: AudioInputPreflightContext['env'],
): Promise<Record<string, string | undefined>> {
const repositoryRoot = findWorkspaceRoot(import.meta.dirname)
if (!repositoryRoot)
throw new Error(`Unable to find the workspace root from ${import.meta.dirname}`)
const repositoryEnvironment = loadEnv('test', repositoryRoot, '')
// Shared Provider development variables live in stage-ui. These values override repository files.
const stageUiEnvironment = loadEnv('test', resolve(repositoryRoot, 'packages/stage-ui'), '')
// Audio case credentials belong to this package. These values override shared Provider variables.
const testingAudioEnvironment = loadEnv('test', resolve(repositoryRoot, 'packages/testing-audio'), '')
// The case process has the highest priority so that CI and shell values override local files.
return { ...repositoryEnvironment, ...stageUiEnvironment, ...testingAudioEnvironment, ...environment }
}