Files
PeachDeployments/lib/Peach/about/internal/file/ConnectFileStorage.dart
alvocool 38881d1fe1 Add app source and tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 10:15:30 +03:00

39 lines
1.4 KiB
Dart

import 'dart:typed_data';
import '../../../comms/Comms.dart' show LogLine;
import '../application/ServiceConfig.dart';
import '../application/StepTracker.dart';
import 'BuildService.dart';
/// Local-side file work: building the artifact to ship, reading it into
/// memory, and packing a web build into a single archive. Kept behind an
/// interface so a ViewModel reaches it through the same [DataManager] as
/// everything else.
abstract class ConnectFileStorage {
/// True on desktop, where local builds can run.
bool get buildSupported;
/// Build log lines and step progress, for the console and step list.
Stream<LogLine> get buildLogs;
Stream<List<DeployStep>> get buildStepStream;
/// Compiles [service]'s project and locates the produced jar.
Future<BuildResult> build(ServiceConfig service);
/// Compiles [service]'s web project and locates its static output directory.
Future<BuildResult> buildWeb(ServiceConfig service);
/// Cancels a build in flight.
void cancelBuild();
/// Reads a local artifact into memory, ready to upload.
Future<Uint8List> readArtifact(String path);
/// True when [path] exists on this machine.
Future<bool> artifactExists(String path);
/// Packs a directory of static files into gzipped tar bytes, returning the
/// archive and the number of files it contains. Runs off the UI isolate.
Future<(Uint8List, int)> packageWeb(String directoryPath);
}