Add app source and tests

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
alvocool
2026-10-11 10:15:30 +03:00
parent 7e246255c2
commit 38881d1fe1
135 changed files with 21057 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import '../../../comms/Comms.dart' show LogLine;
import '../application/ServiceConfig.dart';
import '../application/StepTracker.dart';
import 'BuildService.dart';
import 'ConnectFileStorage.dart';
import 'WebArchive.dart';
/// The one concrete [ConnectFileStorage]. Owns the [BuildService] and delegates
/// archiving to [WebArchive]; holds no state of its own beyond the builder.
class FileStorage implements ConnectFileStorage {
final BuildService _builder = BuildService();
@override
bool get buildSupported => BuildService.supported;
@override
Stream<LogLine> get buildLogs => _builder.logs;
@override
Stream<List<DeployStep>> get buildStepStream => _builder.stepStream;
@override
Future<BuildResult> build(ServiceConfig service) => _builder.build(service);
@override
Future<BuildResult> buildWeb(ServiceConfig service) =>
_builder.buildWeb(service);
@override
void cancelBuild() => _builder.cancel();
@override
Future<Uint8List> readArtifact(String path) => File(path).readAsBytes();
@override
Future<bool> artifactExists(String path) => File(path).exists();
@override
Future<(Uint8List, int)> packageWeb(String directoryPath) =>
// Packaging a large static tree blocks long enough to drop frames, so it
// runs on a background isolate.
compute(packageWebDir, directoryPath);
}