build: Melos, a Dart check and every path for the single repository

- Melos 8.9 as the root's dev dependency, with scripts across the
  workspace (analyze, test:dart, test:flutter, generate, check) and its
  filters (--diff, --include-dependents); cli_util overridden to 0.5.2
  for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
  its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
  own files, analysis, the tools' tests, then every package's tests
  through Melos (--changed-since=<commit> for only what changed and what
  depends on it). tool/pre-push is the hook: the signature check, then
  the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
  need (tool/workspace_only.sh); compose, the deploy's migration test,
  the snap, the release script, the editor's launch files and Learn's
  asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
  snap, F-Droid listing, release uploads); the AGPL packages carry the
  licence's own text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-19 20:39:09 +02:00
commit af1dbee509
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 3771 additions and 792 deletions

View file

@ -1,7 +1,7 @@
# The server image. Built from the repository root (the build context), because the
# workspace's root pubspec and lockfile live there:
#
# docker build -f halkyon_learn_server/Dockerfile .
# docker build -f apps/learn/halkyon_learn_server/Dockerfile .
#
# Based on Serverpod's template, with three changes: Dart 3.13 (our SDK floor), an
# Ubuntu 24.04 runtime instead of alpine + Dart's minimal glibc runtime (same
@ -12,21 +12,18 @@
FROM dart:3.13.4 AS build
WORKDIR /app
COPY pubspec.yaml pubspec.lock ./
COPY halkyon_learn_server halkyon_learn_server
COPY tool/workspace_only.sh tool/
COPY apps/learn/halkyon_learn_server apps/learn/halkyon_learn_server
COPY packages/halkyon_base_server packages/halkyon_base_server
# The workspace root with only the server package: neither the client package nor the
# curator is needed to build the server, and the Flutter app would need Flutter.
# Everything else stays as the repository has it, above all the dependency overrides,
# which bring the server our fork of the offline sync package (fetched with the git
# the Dart image has). The check fails the build loudly if the root's member list
# changes shape.
RUN sed -i -e '/^ - halkyon_learn_client$/d' -e '/^ - halkyon_learn_flutter$/d' \
-e '/^ - halkyon_learn_curator$/d' pubspec.yaml \
&& grep -q '^ - halkyon_learn_server$' pubspec.yaml \
&& ! grep -q -e 'halkyon_learn_client' -e 'halkyon_learn_flutter' \
-e 'halkyon_learn_curator' pubspec.yaml
# The workspace root with only the server and the module it builds on: neither the
# other apps nor the client packages are needed to build the server, and the Flutter
# packages would need Flutter. Everything else stays as the repository has it, above
# all the dependency overrides, which bring the server our fork of the offline sync
# package (fetched with the git the Dart image has).
RUN sh tool/workspace_only.sh apps/learn/halkyon_learn_server packages/halkyon_base_server
RUN dart pub get
WORKDIR /app/halkyon_learn_server
WORKDIR /app/apps/learn/halkyon_learn_server
RUN dart build cli --target bin/main.dart --output build
RUN mv build/bundle/bin/main build/bundle/bin/server
RUN mkdir -p config migrations
@ -48,12 +45,12 @@ ENV serverid=default
ENV logging=normal
ENV role=monolith
COPY --from=build /app/halkyon_learn_server/build/bundle/ ./
COPY --from=build /app/halkyon_learn_server/config/ config/
COPY --from=build /app/halkyon_learn_server/migrations/ migrations/
COPY --from=build /app/apps/learn/halkyon_learn_server/build/bundle/ ./
COPY --from=build /app/apps/learn/halkyon_learn_server/config/ config/
COPY --from=build /app/apps/learn/halkyon_learn_server/migrations/ migrations/
# Mozilla's Public Suffix List, for the Jellyfin server the instance suggests.
COPY --from=build /app/halkyon_learn_server/data/ data/
COPY --from=build /app/halkyon_learn_server/lib/src/generated/protocol.yaml lib/src/generated/protocol.yaml
COPY --from=build /app/apps/learn/halkyon_learn_server/data/ data/
COPY --from=build /app/apps/learn/halkyon_learn_server/lib/src/generated/protocol.yaml lib/src/generated/protocol.yaml
# The server needs no root rights (it listens on 8080 and writes only into the
# repositories folder), so it runs as an unprivileged system user. The folder is the

View file

@ -7,7 +7,7 @@ import 'package:halkyon_learn_server/src/instance/app_compatibility.dart';
/// to the people who use the instance (AGPL-3.0-or-later for the app,
/// SSPL-1.0 for the server).
const upstreamSourceCodeUrl =
'https://code.halkyon.app/project-halkyon/halkyon_learn';
'https://code.halkyon.app/project-halkyon/halkyon';
/// How Halkyon Learn sets halkyon_base up (ADR 0014), the module giving every
/// Halkyon server its sign-in, the account and its deletion, the pruning and