-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #433 from hpi-studyu/dev
release(v2.6.1): Dart 3, Offline Mode, and more...
- Loading branch information
Showing
617 changed files
with
99,662 additions
and
17,124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: '3' | ||
name: 'studyu' | ||
|
||
services: | ||
autodocs: | ||
image: ghcr.io/k1low/tbls | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
command: | ||
- doc | ||
- --force | ||
- postgres://postgres:${POSTGRES_PASSWORD}@supabase-db:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable | ||
- output | ||
working_dir: /work | ||
volumes: | ||
- ${DB_DOCS_DEST}:/work/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'core': | ||
- 'core/**/*' | ||
'designer_v2': | ||
- 'designer_v2/**/*' | ||
'app': | ||
- 'app/**/*' | ||
'flutter_common': | ||
- 'flutter_common/**/*' | ||
'dependencies': | ||
- '**/pubspec.yaml' | ||
- '**/pubspec.lock' | ||
'documentation': | ||
- 'docs/**/*' | ||
- '**/*.md' | ||
'docker': | ||
- 'docker/**/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
# repo root at ../.. from this file's directory | ||
root=$(realpath $(dirname $(realpath $0))/../..) | ||
|
||
docs_dir="$root/docs/uml" | ||
|
||
# find directories whose umls need updates ------------------------------------- | ||
# regenerating all umls every time is too slow | ||
|
||
# find latest commit that updated uml diagrams (or use initial commit) | ||
prev_update="$(git log -n 1 --pretty=format:%H -- "$docs_dir")" | ||
[[ -z "$prev_update" ]] && prev_update="$(git rev-list --max-parents=0 HEAD)" | ||
|
||
# associative array, keys will be all directories whose uml has to be | ||
# regenerated | ||
declare -A dirty | ||
# get all directories that have changed since prev_update | ||
for changed in $(git diff --name-only $prev_update \ | ||
| grep --extended-regexp '(flutter_common|core|designer_v2|app)/lib/.*\.dart' \ | ||
| xargs dirname \ | ||
| sort --unique \ | ||
); do | ||
# set changed dir as dirty for all parents until we reach lib | ||
while [[ -n $(grep --extended-regexp '[^/]*/lib' <<< "$changed") ]]; do | ||
dirty[$changed]=1 | ||
changed="$(dirname "$changed")" | ||
done | ||
done | ||
|
||
# generate needed umls --------------------------------------------------------- | ||
|
||
# temporary file for uml data | ||
tmpf=$(mktemp) | ||
|
||
# iterate keys of dirty | ||
for d in "${!dirty[@]}"; do | ||
out="$docs_dir/$d/uml.svg" | ||
# remove old uml if it exists | ||
rm -rf "$out" | ||
# skip to next if directory doesn't exist (i.e. git diff showed it because | ||
# it was deleted | ||
test -d "$root/$d" || continue | ||
|
||
echo "Generating diagram for $d" | ||
|
||
# ensure destination dir extists | ||
mkdir -p $(dirname "$out") | ||
|
||
# go to package dir, i.e. first path component | ||
cd "$root/$(cut -d/ -f1 <<< "$d")" | ||
# uml generator gets confused with generated files so we have to remove | ||
# them | ||
find . -type f -name '*.g.dart' -exec rm {} \; | ||
|
||
# generate uml & svg | ||
dart pub global run dcdg \ | ||
--exclude=State --exclude=StatefulWidget --exclude=StatelessWidget \ | ||
-b nomnoml \ | ||
-s "$(cut -d/ -f2- <<< "$d")" \ | ||
> $tmpf | ||
npx --yes nomnoml "$tmpf" "$out" | ||
|
||
# get deleted generated files back from git | ||
git checkout HEAD -- . | ||
done | ||
|
||
# remove temporary file | ||
rm "$tmpf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Generate database docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
- '!dev' | ||
- '!main' | ||
paths: | ||
- 'database/**' | ||
- 'docker/supabase/**' | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-db-docs | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
generate-docs: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate documentation | ||
env: | ||
POSTGRES_PORT: 5432 | ||
POSTGRES_PASSWORD: your-super-secret-and-long-postgres-password | ||
POSTGRES_DB: postgres | ||
DB_DOCS_DEST: ${{ github.workspace }}/docs/database | ||
run: | | ||
docker compose -f docker/supabase/docker-compose-db.yml -f .github/docker/db-docs.yml up --abort-on-container-exit | ||
- name: Commit documentation | ||
run: | | ||
git config --global user.name "StudyU Documenter" | ||
git config --global user.email "studyu-documenter" | ||
git add --all | ||
git commit -m 'docs: update database documentation' || true | ||
git push |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.