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
7 changed files with 3771 additions and 792 deletions

View file

@ -3,7 +3,7 @@
# repository root (the build context), where the workspace's root pubspec and lockfile
# live:
#
# docker build -f halkyon_learn_curator/Dockerfile .
# docker build -f apps/learn/halkyon_learn_curator/Dockerfile .
#
# A container of its own beside the server (deploy/compose.yaml, decided 2026-10-09):
# the curator (AGPL) never enters the server's image or process, and a conversion
@ -13,17 +13,14 @@
FROM dart:3.13.4 AS build
WORKDIR /app
COPY pubspec.yaml pubspec.lock ./
COPY halkyon_learn_curator halkyon_learn_curator
COPY tool/workspace_only.sh tool/
COPY apps/learn/halkyon_learn_curator apps/learn/halkyon_learn_curator
# The workspace root with only the curator package, as the server's Dockerfile does it
# with the server's. The check fails the build loudly if the member list changes shape.
RUN sed -i -e '/^ - halkyon_learn_client$/d' -e '/^ - halkyon_learn_flutter$/d' \
-e '/^ - halkyon_learn_server$/d' pubspec.yaml \
&& grep -q '^ - halkyon_learn_curator$' pubspec.yaml \
&& ! grep -q -e 'halkyon_learn_client' -e 'halkyon_learn_flutter' \
-e 'halkyon_learn_server' pubspec.yaml
# with the server's.
RUN sh tool/workspace_only.sh apps/learn/halkyon_learn_curator
RUN dart pub get
WORKDIR /app/halkyon_learn_curator
WORKDIR /app/apps/learn/halkyon_learn_curator
RUN dart build cli --target bin/curate.dart --output build
# ── Runtime stage ─────────────────────────────────────────────────────────────────
@ -38,8 +35,8 @@ RUN apt-get update \
&& rm -rf /usr/share/mecab/dic/ipadic /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/halkyon_learn_curator/build/bundle/ ./
COPY --from=build /app/halkyon_learn_curator/data/ data/
COPY --from=build /app/apps/learn/halkyon_learn_curator/build/bundle/ ./
COPY --from=build /app/apps/learn/halkyon_learn_curator/data/ data/
# An unprivileged user of its own: user ID 10001, shared with neither the containers
# of PostgreSQL and the server (999) nor the CI runner on the host (61000). The folder

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

View file

@ -18,7 +18,7 @@ The collection holds, on purpose:
A second deck (`anki_furigana*.apkg`) has a note type that shows its
Reading through Anki's furigana filter, and the same text in its Expression.
Run from the repository root, in a virtual environment with Anki's package:
Run from apps/learn, in a virtual environment with Anki's package:
python3 -m venv /tmp/anki && /tmp/anki/bin/pip install anki==26.9.3
/tmp/anki/bin/python tool/anki/make_fixtures.py

View file

@ -2,9 +2,10 @@
"""Makes the app's icons for every platform from its own, the kingfisher on white
(halkyon_learn_flutter/assets/icon/halkyon_icon.png).
- The snap's, snap/gui/halkyon-learn.png (512 x 512 pixels, the Snap Store's size),
which the Store and the desktop file show as they are: the picture with rounded
corners, as other apps' white tiles have (radius 142.222 of 512, about 28 %).
- The snap's, snap/gui/halkyon-learn.png at the repository's root (512 x 512
pixels, the Snap Store's size), which the Store and the desktop file show as they
are: the picture with rounded corners, as other apps' white tiles have (radius
142.222 of 512, about 28 %).
- Through flutter_launcher_icons, configured in the app's pubspec: Android's adaptive
icon and its older square one, iOS's, macOS's (the rounded tile on Apple's grid,
824 of 1024 pixels) and Windows' (the rounded tile).
@ -19,7 +20,7 @@ The derived images it hands to the tool go to halkyon_learn_flutter/build/icons/
which git ignores. The rounded corners' mask is drawn at four times the size and
scaled down, so their edges are smooth.
Run from the repository root with Python 3 and Pillow (python3-pil on Ubuntu), the
Run from apps/learn with Python 3 and Pillow (python3-pil on Ubuntu), the
app's dependencies fetched:
python3 tool/app_icons.py
@ -33,7 +34,7 @@ from PIL import Image, ImageDraw
APP = Path("halkyon_learn_flutter")
SOURCE = APP / "assets/icon/halkyon_icon.png"
DERIVED = APP / "build/icons"
SNAP_ICON = Path("snap/gui/halkyon-learn.png")
SNAP_ICON = Path("../../snap/gui/halkyon-learn.png")
WINDOWS_ICON = APP / "windows/runner/resources/app_icon.ico"
IOS_PROJECT = APP / "ios/Runner.xcodeproj/project.pbxproj"
RADIUS = 142.222 / 512

View file

@ -12,7 +12,7 @@ is an approximation, not survey-accurate data.
Each region is named by its ISO 3166-2 code (JP-01 ... JP-47), with Natural
Earth's English and Japanese names.
Run from the repository root with Python 3 and no other packages:
Run from apps/learn with Python 3 and no other packages:
python3 tool/maps/japan_prefectures.py

View file

@ -24,7 +24,7 @@ borders still meet; only islands under 0.001 square degrees are dropped
about 100 m. Each region keeps Natural Earth's label point, where the app
marks a region too small to tap.
Run from the repository root with Python 3 and no other packages:
Run from apps/learn with Python 3 and no other packages:
python3 tool/maps/world_countries.py