mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-11 22:53:00 +00:00
Importing them from the environment form component pulled headlessui Disclosure into the automation form, which the automations-new test mocks without it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
19 lines
856 B
TypeScript
19 lines
856 B
TypeScript
import { EnvironmentProvider, type Environment } from "@qltysh/fabro-api-client";
|
|
|
|
// Providers a managed environment can be created with. `local` is a reserved,
|
|
// in-memory environment, never a managed-environment provider, so it is never
|
|
// offered. The provider is fixed at creation time and cannot be changed.
|
|
export const CREATABLE_PROVIDERS = [
|
|
EnvironmentProvider.DOCKER,
|
|
EnvironmentProvider.DAYTONA,
|
|
] as const;
|
|
|
|
// Whether a server-managed environment can back Git-targeted work such as
|
|
// automations: only the clone-based (creatable) providers qualify.
|
|
export function isCloneBasedEnvironment(environment: Environment): boolean {
|
|
return (CREATABLE_PROVIDERS as readonly string[]).includes(environment.provider);
|
|
}
|
|
|
|
export function providerLabel(provider: string): string {
|
|
return provider.charAt(0).toUpperCase() + provider.slice(1);
|
|
}
|