Skip to content

Commit

Permalink
chore(repo): Use melos for monorepo dev (#113)
Browse files Browse the repository at this point in the history
Adds `melos` configuration for managing package linking and development.
  • Loading branch information
dnys1 committed Apr 14, 2024
1 parent 3ec2ccf commit ec2c2b8
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 20 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/celest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ jobs:
with:
channel: stable
cache: true
- name: Setup Melos
run: dart pub global activate melos
- name: Get Packages
working-directory: packages/celest
run: dart pub get && dart pub get --directory=example/celest
run: melos bootstrap
- name: Analyze
working-directory: packages/celest
run: dart analyze --fatal-infos --fatal-warnings
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/celest_auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ jobs:
with:
channel: stable
cache: true
- name: Setup Melos
run: dart pub global activate melos
- name: Get Packages
working-directory: packages/celest_auth
run: dart pub get && dart pub get --directory=example/celest
run: melos bootstrap
- name: Analyze
working-directory: packages/celest_auth
run: dart analyze --fatal-infos --fatal-warnings
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/celest_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.0
with:
cache: true
- name: Setup Melos
run: dart pub global activate melos
- name: Get Packages
working-directory: packages/celest_core
run: dart pub get
run: melos bootstrap
- name: Analyze
working-directory: packages/celest_core
run: dart analyze
Expand All @@ -41,9 +42,10 @@ jobs:
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.0
with:
cache: true
- name: Setup Melos
run: dart pub global activate melos
- name: Get Packages
working-directory: packages/celest_core
run: dart pub get
run: melos bootstrap
- name: Test
working-directory: packages/celest_core
run: dart test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
doc/api/
**/doc/api/
pubspec_overrides.yaml
pubspec.lock

## RUST ##
# will have compiled files and executables
Expand Down
19 changes: 19 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: celest_dev

packages:
- examples/**
- packages/**
ignore:
- "examples/**/celest"
- "packages/**/example/celest"

ide:
intellij:
enabled: false

command:
bootstrap:
hooks:
# To avoid package name conflicts (all Celest backends are named the same currently),
# run the pub get step for the backend folders separate from the main bootstrap.
post: melos exec --dir-exists=celest -- dart pub get --directory=celest
12 changes: 12 additions & 0 deletions packages/celest/example/celest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ dependencies:
celest_core: ^0.2.0
http: ">=0.13.0 <2.0.0"

dependency_overrides:
celest:
path: ../../
celest_auth:
path: ../../../celest_auth
celest_core:
path: ../../../celest_core
corks_cedar:
path: ../../../corks_cedar
native_storage:
path: ../../../native/storage

dev_dependencies:
lints: ^3.0.0
test: ^1.24.0
12 changes: 12 additions & 0 deletions packages/celest/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ dependencies:
flutter:
sdk: flutter

dependency_overrides:
celest:
path: ../
celest_auth:
path: ../../celest_auth
celest_core:
path: ../../celest_core
corks_cedar:
path: ../../corks_cedar
native_storage:
path: ../../native/storage

dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
2 changes: 2 additions & 0 deletions packages/celest_auth/example/celest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ dependency_overrides:
path: ../../
celest_core:
path: ../../../celest_core
corks_cedar:
path: ../../../corks_cedar
native_storage:
path: ../../../native/storage

Expand Down
2 changes: 0 additions & 2 deletions packages/celest_auth/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ dependencies:
flutter_state_notifier: ^1.0.0

dependency_overrides:
cedar:
path: ../../cedar
celest:
path: ../../celest
celest_auth:
Expand Down
6 changes: 0 additions & 6 deletions packages/celest_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ dependencies:
shelf_router: ^1.1.4
stream_transform: ^2.1.0

dependency_overrides:
celest_core:
path: ../celest_core
native_storage:
path: ../native/storage

dev_dependencies:
build_runner: ^2.4.8
built_value_generator: ^8.9.1
Expand Down
4 changes: 0 additions & 4 deletions packages/celest_core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ dependencies:
path: ^1.9.0
native_storage: ^0.1.0

dependency_overrides:
native_storage:
path: ../native/storage

dev_dependencies:
lints: ^3.0.0
test: ^1.24.0
9 changes: 9 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: celest_dev
publish_to: none

environment:
sdk: ^3.3.0
flutter: ">=3.19.0"

dev_dependencies:
melos: ^5.3.0

0 comments on commit ec2c2b8

Please sign in to comment.