From bd9ea7a909136088e561a69db62d37307cebe284 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Tue, 3 Oct 2023 16:37:42 +0200 Subject: [PATCH 1/3] chore(file_icons): Move font from fonts/ to assets/ Signed-off-by: jld3103 --- packages/file_icons/{fonts => assets}/seti.ttf | Bin packages/file_icons/bin/file_icons.dart | 8 ++++---- packages/file_icons/pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename packages/file_icons/{fonts => assets}/seti.ttf (100%) diff --git a/packages/file_icons/fonts/seti.ttf b/packages/file_icons/assets/seti.ttf similarity index 100% rename from packages/file_icons/fonts/seti.ttf rename to packages/file_icons/assets/seti.ttf diff --git a/packages/file_icons/bin/file_icons.dart b/packages/file_icons/bin/file_icons.dart index cea7b274..e9924d37 100644 --- a/packages/file_icons/bin/file_icons.dart +++ b/packages/file_icons/bin/file_icons.dart @@ -17,9 +17,9 @@ void main() { } void copyFont() { - final fontsDir = Directory('fonts'); - if (!fontsDir.existsSync()) { - fontsDir.createSync(); + final assetsDir = Directory('assets'); + if (!assetsDir.existsSync()) { + assetsDir.createSync(); } File( p.join( @@ -29,7 +29,7 @@ void copyFont() { 'seti', 'seti.ttf', ), - ).copySync(p.join('fonts', 'seti.ttf')); + ).copySync(p.join(assetsDir.path, 'seti.ttf')); } void generateData() { diff --git a/packages/file_icons/pubspec.yaml b/packages/file_icons/pubspec.yaml index ff513503..5ded88cc 100644 --- a/packages/file_icons/pubspec.yaml +++ b/packages/file_icons/pubspec.yaml @@ -20,4 +20,4 @@ flutter: fonts: - family: Seti fonts: - - asset: fonts/seti.ttf + - asset: assets/seti.ttf From f32336c8eef3b2a0910d37e09732edb49edd87be Mon Sep 17 00:00:00 2001 From: jld3103 Date: Tue, 3 Oct 2023 16:42:24 +0200 Subject: [PATCH 2/3] refactor(tool): Use melos to query packages Signed-off-by: jld3103 --- tool/build-app.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tool/build-app.sh b/tool/build-app.sh index c3509dbf..5b4b83f6 100755 --- a/tool/build-app.sh +++ b/tool/build-app.sh @@ -3,6 +3,18 @@ set -euxo pipefail cd "$(dirname "$0")/.." source tool/common.sh +function get_mount_paths_dir() { + dir="$1" + mapfile -t packages < <(melos list --parsable --relative --dir-exists="$dir") + echo "${packages[@]/%//$dir}" +} + +function get_mount_paths_file() { + file="$1" + mapfile -t packages < <(melos list --parsable --relative --file-exists="$file") + echo "${packages[@]/%//$file}" +} + targets=("linux/arm64" "linux/amd64") target="$1" @@ -29,8 +41,14 @@ if [[ "$target" == "linux/arm64" ]] || [[ "$target" == "linux/amd64" ]]; then -f "tool/build/Dockerfile.$os" \ ./tool/build + paths=(packages/app/{pubspec.lock,linux,build}) + mapfile -O "${#paths[@]}" -t paths < <(get_mount_paths_dir "lib") + mapfile -O "${#paths[@]}" -t paths < <(get_mount_paths_dir "assets") + mapfile -O "${#paths[@]}" -t paths < <(get_mount_paths_file "pubspec.yaml") + mapfile -O "${#paths[@]}" -t paths < <(get_mount_paths_file "pubspec_overrides.yaml") + run_args=() - for path in packages/{app,dynamite/dynamite_runtime,file_icons,neon_lints,nextcloud,sort_box}/{lib,pubspec.yaml} packages/neon/*/{assets,lib,pubspec.yaml,pubspec_overrides.yaml} packages/file_icons/fonts packages/nextcloud/pubspec_overrides.yaml packages/app/{pubspec_overrides.yaml,assets,build,linux}; do + for path in ${paths[*]}; do run_args+=(-v "$(pwd)/$path:/src/$path") done mkdir -p "packages/app/build" From bf9bc36733d7a7f24751e42c7f597b3872cbbd65 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Tue, 3 Oct 2023 18:18:16 +0200 Subject: [PATCH 3/3] chore(docs): Remove outdated step when adding a new package Signed-off-by: jld3103 --- docs/workflows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflows.md b/docs/workflows.md index ff1a8576..ee89f7fe 100644 --- a/docs/workflows.md +++ b/docs/workflows.md @@ -7,4 +7,4 @@ If you need to add a new package to the Neon project please make sure to execute 2. Make sure to activate our strict linting by adding it to the package. 3. Regenerate the dependency overrides by executing `melos bootstrap`. 4. Add a Symlink to our main [license](../LICENSE). -5. Update [commitlint.yaml](../commitlint.yaml) and [tool/build-app.sh](../tool/build-app.sh) by adding the new package name. +5. Update [commitlint.yaml](../commitlint.yaml) by adding the new package name.