diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c15d80..c777ace 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: env: FLUTTER_VERSION: '3.44.2' - MELOS_VERSION: '6.3.3' + MELOS_VERSION: '8.2.2' jobs: pigeon_contracts: diff --git a/.gitignore b/.gitignore index 40efb0e..e15de5a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,11 +4,10 @@ .packages .pub/ pubspec.lock -# pubspec_overrides.yaml is intentionally tracked: none of the federated -# packages are published to pub.dev yet, so their `^1.0.x` inter-package -# constraints only resolve via these local path overrides. On a clean checkout -# `melos bootstrap` cannot regenerate them (its initial root `pub get` fails -# before any override is written), so CI needs them committed. +# Under Dart pub workspaces (Melos 7+), local packages are linked via the +# root `workspace:` list, not per-package overrides. Melos no longer generates +# these, and `dependency_overrides` are only legal in the workspace root. +pubspec_overrides.yaml build/ local.properties diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 4d49d18..bf8fa47 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -7,7 +7,10 @@ version: 1.0.0+1 publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: - sdk: ">=3.1.0 <4.0.0" + sdk: ">=3.6.0 <4.0.0" + +# Part of the flutter_midi_command pub workspace (see root pubspec `workspace:`). +resolution: workspace dependencies: flutter: diff --git a/example/pubspec_overrides.yaml b/example/pubspec_overrides.yaml deleted file mode 100644 index cb21c84..0000000 --- a/example/pubspec_overrides.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# melos_managed_dependency_overrides: flutter_midi_command_android,flutter_midi_command_linux,flutter_midi_command_web,flutter_midi_command_windows -# Local development overrides: force the example app to build the in-repo -# package sources instead of the published pub.dev versions. Without this, -# `flutter_midi_command_darwin` (and the pigeon platform interface) resolve to -# pub.dev, so native/Swift edits in packages/ never reach the build. -dependency_overrides: - flutter_midi_command: - path: ../ - flutter_midi_command_darwin: - path: ../packages/flutter_midi_command_darwin - flutter_midi_command_ble: - path: ../packages/flutter_midi_command_ble - flutter_midi_command_platform_interface: - path: ../packages/flutter_midi_command_platform_interface - flutter_midi_command_android: - path: ../packages/flutter_midi_command_android - flutter_midi_command_linux: - path: ../packages/flutter_midi_command_linux - flutter_midi_command_web: - path: ../packages/flutter_midi_command_web - flutter_midi_command_windows: - path: ../packages/flutter_midi_command_windows diff --git a/melos.yaml b/melos.yaml deleted file mode 100644 index 5a69517..0000000 --- a/melos.yaml +++ /dev/null @@ -1,58 +0,0 @@ -name: flutter_midi_command_workspace -packages: - - . - - packages/** - - example - -command: - version: - # The root package (flutter_midi_command) shares its CHANGELOG.md with the - # workspace root, so the generated workspace changelog would overwrite the - # package's own changelog. Disable it and keep per-package changelogs only. - workspaceChangelog: false - -scripts: - bootstrap: - run: dart run melos bootstrap - analyze: - run: dart run melos exec --concurrency=1 --ignore=flutter_midi_command_example -- "flutter analyze" - analyze:example: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter analyze" - test: - run: dart run melos exec --dir-exists=test --concurrency=1 --ignore=flutter_midi_command_example --ignore=flutter_midi_command_web -- "flutter test" - test:web:chrome: - run: dart run melos exec --scope=flutter_midi_command_web -- "flutter test --platform chrome" - test:native:android: - run: bash ./example/android/gradlew -p example/android :flutter_midi_command_android:testDebugUnitTest - test:native:darwin: - run: swift package --package-path packages/flutter_midi_command_darwin/darwin/flutter_midi_command_darwin describe - test:native:linux: - run: dart run melos exec --scope=flutter_midi_command_linux -- "flutter test" - test:native:windows: - run: dart run melos exec --scope=flutter_midi_command_windows -- "flutter test" - test:example:integration:android: - run: dart run melos exec --scope=flutter_midi_command_example -- "bash tool/run_android_smoke_test.sh" - test:example:integration:ios: - run: dart run melos exec --scope=flutter_midi_command_example -- "bash tool/run_ios_smoke_test.sh" - test:example:integration:linux: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter test integration_test/smoke_test.dart -d linux" - test:example:integration:macos: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter test integration_test/smoke_test.dart -d macos" - test:example:integration:web: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter test test/smoke_web_test.dart --platform chrome" - test:example:integration:windows: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter test integration_test/smoke_test.dart -d windows" - build:example:android: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build apk --debug --target-platform android-arm64 --android-skip-build-dependency-validation" - build:example:linux: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build linux --debug" - build:example:ios: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build ios --debug --no-codesign" - build:example:macos: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build macos --debug" - build:example:windows: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build windows --debug" - build:example:web: - run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build web --debug" - format: - run: dart run melos exec -- "dart format --set-exit-if-changed ." diff --git a/packages/flutter_midi_command_android/pubspec.yaml b/packages/flutter_midi_command_android/pubspec.yaml index 47772ee..52f6eab 100644 --- a/packages/flutter_midi_command_android/pubspec.yaml +++ b/packages/flutter_midi_command_android/pubspec.yaml @@ -16,6 +16,9 @@ environment: sdk: ">=3.12.0 <4.0.0" flutter: ">=3.44.0" +# Part of the flutter_midi_command pub workspace (see root pubspec `workspace:`). +resolution: workspace + dependencies: flutter: sdk: flutter diff --git a/packages/flutter_midi_command_android/pubspec_overrides.yaml b/packages/flutter_midi_command_android/pubspec_overrides.yaml deleted file mode 100644 index 9252d54..0000000 --- a/packages/flutter_midi_command_android/pubspec_overrides.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# melos_managed_dependency_overrides: flutter_midi_command_platform_interface -dependency_overrides: - flutter_midi_command_platform_interface: - path: ../flutter_midi_command_platform_interface diff --git a/packages/flutter_midi_command_ble/pubspec.yaml b/packages/flutter_midi_command_ble/pubspec.yaml index c941e1c..597b4f4 100644 --- a/packages/flutter_midi_command_ble/pubspec.yaml +++ b/packages/flutter_midi_command_ble/pubspec.yaml @@ -16,6 +16,9 @@ environment: sdk: ">=3.11.4 <4.0.0" flutter: ">=3.24.0" +# Part of the flutter_midi_command pub workspace (see root pubspec `workspace:`). +resolution: workspace + dependencies: flutter: sdk: flutter diff --git a/packages/flutter_midi_command_ble/pubspec_overrides.yaml b/packages/flutter_midi_command_ble/pubspec_overrides.yaml deleted file mode 100644 index 9252d54..0000000 --- a/packages/flutter_midi_command_ble/pubspec_overrides.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# melos_managed_dependency_overrides: flutter_midi_command_platform_interface -dependency_overrides: - flutter_midi_command_platform_interface: - path: ../flutter_midi_command_platform_interface diff --git a/packages/flutter_midi_command_darwin/pubspec.yaml b/packages/flutter_midi_command_darwin/pubspec.yaml index 8dba20d..4b15fd6 100644 --- a/packages/flutter_midi_command_darwin/pubspec.yaml +++ b/packages/flutter_midi_command_darwin/pubspec.yaml @@ -16,6 +16,9 @@ environment: sdk: ">=3.7.0 <4.0.0" flutter: ">=3.24.0" +# Part of the flutter_midi_command pub workspace (see root pubspec `workspace:`). +resolution: workspace + dependencies: flutter: sdk: flutter diff --git a/packages/flutter_midi_command_darwin/pubspec_overrides.yaml b/packages/flutter_midi_command_darwin/pubspec_overrides.yaml deleted file mode 100644 index 9252d54..0000000 --- a/packages/flutter_midi_command_darwin/pubspec_overrides.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# melos_managed_dependency_overrides: flutter_midi_command_platform_interface -dependency_overrides: - flutter_midi_command_platform_interface: - path: ../flutter_midi_command_platform_interface diff --git a/packages/flutter_midi_command_linux/pubspec.yaml b/packages/flutter_midi_command_linux/pubspec.yaml index fe44516..8d72b83 100644 --- a/packages/flutter_midi_command_linux/pubspec.yaml +++ b/packages/flutter_midi_command_linux/pubspec.yaml @@ -16,6 +16,9 @@ environment: sdk: ">=3.7.0 <4.0.0" flutter: ">=3.24.0" +# Part of the flutter_midi_command pub workspace (see root pubspec `workspace:`). +resolution: workspace + dependencies: flutter: sdk: flutter diff --git a/packages/flutter_midi_command_linux/pubspec_overrides.yaml b/packages/flutter_midi_command_linux/pubspec_overrides.yaml deleted file mode 100644 index 9252d54..0000000 --- a/packages/flutter_midi_command_linux/pubspec_overrides.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# melos_managed_dependency_overrides: flutter_midi_command_platform_interface -dependency_overrides: - flutter_midi_command_platform_interface: - path: ../flutter_midi_command_platform_interface diff --git a/packages/flutter_midi_command_platform_interface/pubspec.yaml b/packages/flutter_midi_command_platform_interface/pubspec.yaml index fff4051..00e66eb 100644 --- a/packages/flutter_midi_command_platform_interface/pubspec.yaml +++ b/packages/flutter_midi_command_platform_interface/pubspec.yaml @@ -15,6 +15,9 @@ environment: sdk: ">=3.7.0 <4.0.0" flutter: ">=3.24.0" +# Part of the flutter_midi_command pub workspace (see root pubspec `workspace:`). +resolution: workspace + dependencies: flutter: sdk: flutter diff --git a/packages/flutter_midi_command_web/pubspec.yaml b/packages/flutter_midi_command_web/pubspec.yaml index 8ab2a44..51fa0b6 100644 --- a/packages/flutter_midi_command_web/pubspec.yaml +++ b/packages/flutter_midi_command_web/pubspec.yaml @@ -16,6 +16,9 @@ environment: sdk: ">=3.7.0 <4.0.0" flutter: ">=3.24.0" +# Part of the flutter_midi_command pub workspace (see root pubspec `workspace:`). +resolution: workspace + dependencies: flutter: sdk: flutter diff --git a/packages/flutter_midi_command_web/pubspec_overrides.yaml b/packages/flutter_midi_command_web/pubspec_overrides.yaml deleted file mode 100644 index 9252d54..0000000 --- a/packages/flutter_midi_command_web/pubspec_overrides.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# melos_managed_dependency_overrides: flutter_midi_command_platform_interface -dependency_overrides: - flutter_midi_command_platform_interface: - path: ../flutter_midi_command_platform_interface diff --git a/packages/flutter_midi_command_windows/pubspec.yaml b/packages/flutter_midi_command_windows/pubspec.yaml index 04a23f1..1d9bee3 100644 --- a/packages/flutter_midi_command_windows/pubspec.yaml +++ b/packages/flutter_midi_command_windows/pubspec.yaml @@ -16,6 +16,9 @@ environment: sdk: ">=3.7.0 <4.0.0" flutter: ">=3.24.0" +# Part of the flutter_midi_command pub workspace (see root pubspec `workspace:`). +resolution: workspace + dependencies: flutter: sdk: flutter diff --git a/packages/flutter_midi_command_windows/pubspec_overrides.yaml b/packages/flutter_midi_command_windows/pubspec_overrides.yaml deleted file mode 100644 index 9252d54..0000000 --- a/packages/flutter_midi_command_windows/pubspec_overrides.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# melos_managed_dependency_overrides: flutter_midi_command_platform_interface -dependency_overrides: - flutter_midi_command_platform_interface: - path: ../flutter_midi_command_platform_interface diff --git a/pubspec.yaml b/pubspec.yaml index 9b5d8b7..4a159e5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,6 +17,20 @@ environment: sdk: ">=3.7.0 <4.0.0" flutter: ">=3.24.0" +# Dart pub workspace: local packages are linked from these paths (Melos 7+ uses +# native pub workspaces instead of generated pubspec_overrides.yaml). Globs are +# not supported here, so members are listed explicitly. The root package itself +# is a member via `melos: useRootAsPackage: true` below. +workspace: + - packages/flutter_midi_command_platform_interface + - packages/flutter_midi_command_android + - packages/flutter_midi_command_darwin + - packages/flutter_midi_command_linux + - packages/flutter_midi_command_web + - packages/flutter_midi_command_windows + - packages/flutter_midi_command_ble + - example + dependencies: flutter: sdk: flutter @@ -32,7 +46,7 @@ dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^5.0.0 - melos: ^6.3.2 + melos: ^8.2.2 pigeon: ^22.6.0 # For information on the generic Dart part of this file, see the @@ -58,3 +72,60 @@ flutter: default_package: flutter_midi_command_windows web: default_package: flutter_midi_command_web + +# Melos 7+ config lives here (there is no more melos.yaml). Packages are derived +# from the `workspace:` field above; `useRootAsPackage` adds this root package. +melos: + name: flutter_midi_command_workspace + useRootAsPackage: true + + command: + version: + # The root package (flutter_midi_command) shares its CHANGELOG.md with the + # workspace root, so the generated workspace changelog would overwrite the + # package's own changelog. Disable it and keep per-package changelogs only. + workspaceChangelog: false + + scripts: + analyze: + run: dart run melos exec --concurrency=1 --ignore=flutter_midi_command_example -- "flutter analyze" + analyze:example: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter analyze" + test: + run: dart run melos exec --dir-exists=test --concurrency=1 --ignore=flutter_midi_command_example --ignore=flutter_midi_command_web -- "flutter test" + test:web:chrome: + run: dart run melos exec --scope=flutter_midi_command_web -- "flutter test --platform chrome" + test:native:android: + run: bash ./example/android/gradlew -p example/android :flutter_midi_command_android:testDebugUnitTest + test:native:darwin: + run: swift package --package-path packages/flutter_midi_command_darwin/darwin/flutter_midi_command_darwin describe + test:native:linux: + run: dart run melos exec --scope=flutter_midi_command_linux -- "flutter test" + test:native:windows: + run: dart run melos exec --scope=flutter_midi_command_windows -- "flutter test" + test:example:integration:android: + run: dart run melos exec --scope=flutter_midi_command_example -- "bash tool/run_android_smoke_test.sh" + test:example:integration:ios: + run: dart run melos exec --scope=flutter_midi_command_example -- "bash tool/run_ios_smoke_test.sh" + test:example:integration:linux: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter test integration_test/smoke_test.dart -d linux" + test:example:integration:macos: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter test integration_test/smoke_test.dart -d macos" + test:example:integration:web: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter test test/smoke_web_test.dart --platform chrome" + test:example:integration:windows: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter test integration_test/smoke_test.dart -d windows" + build:example:android: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build apk --debug --target-platform android-arm64 --android-skip-build-dependency-validation" + build:example:linux: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build linux --debug" + build:example:ios: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build ios --debug --no-codesign" + build:example:macos: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build macos --debug" + build:example:windows: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build windows --debug" + build:example:web: + run: dart run melos exec --scope=flutter_midi_command_example -- "flutter build web --debug" + format: + run: dart run melos exec -- "dart format --set-exit-if-changed ." diff --git a/pubspec_overrides.yaml b/pubspec_overrides.yaml deleted file mode 100644 index 401500e..0000000 --- a/pubspec_overrides.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# melos_managed_dependency_overrides: flutter_midi_command_android,flutter_midi_command_darwin,flutter_midi_command_linux,flutter_midi_command_platform_interface,flutter_midi_command_web,flutter_midi_command_windows -dependency_overrides: - flutter_midi_command_android: - path: packages/flutter_midi_command_android - flutter_midi_command_darwin: - path: packages/flutter_midi_command_darwin - flutter_midi_command_linux: - path: packages/flutter_midi_command_linux - flutter_midi_command_platform_interface: - path: packages/flutter_midi_command_platform_interface - flutter_midi_command_web: - path: packages/flutter_midi_command_web - flutter_midi_command_windows: - path: packages/flutter_midi_command_windows