Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ runs:

- name: Run build runner
shell: bash
run: melos run brb
run: melos run gen

- uses: invertase/github-action-dart-analyzer@v1
with:
Expand All @@ -69,12 +69,11 @@ runs:

- name: Run Test
run: |
melos run test:flutter
melos run test:dart
melos exec --scope="mix" -- flutter test
shell: bash

# - name: Run melos fix
# run: melos run fix
# - name: Run melos lint
# run: melos run lint
# shell: bash

# - name: Run custom_lint
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ jobs:
- name: Setup Melos
uses: bluefireteam/melos-action@v3

- name: Run melos fix
- name: Run lint fixes
run: melos run lint
shell: bash

- name: Dry run package publishing
run: |
if [[ "${{ github.event.inputs.mix_lint }}" == "true" ]]; then
cd packages/mix_lint && dart pub publish --dry-run && cd ../..
Expand Down
125 changes: 45 additions & 80 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ command:
build_runner: ^2.4.9
publish:
hooks:
pre: melos run gen:build
pre: melos run gen

categories:
flutter_projects:
Expand All @@ -34,100 +34,66 @@ categories:
- packages/mix_generator

scripts:
# ANALYSIS
# ANALYSIS & LINTING
analyze:
run: melos run analyze:dart && melos run analyze:dcm
description: Run all static analysis checks.
exec:
failFast: true

analyze:dart:
run: melos exec -c 4 -- dart analyze .
description: Run Dart static analysis checks.

analyze:dcm:
run: melos exec -c 4 -- dcm analyze . --fatal-style --fatal-warnings
description: Run DCM static analysis checks.
packageFilters:
dependsOn: "dart_code_metrics_presets"

lint:fix:all:
run: melos run lint:dart:fix && melos run lint:dcm:fix
description: Run all static analysis checks and apply fixes.

lint:dart:fix:
run: melos exec -- dart fix --apply .
description: Run Dart static analysis checks.

lint:dcm:fix:
run: melos exec -- dcm fix .
description: Run DCM static analysis checks.
packageFilters:
dependsOn: "dart_code_metrics_presets"

gen:watch:
run: melos exec --order-dependents -- dart run build_runner watch --delete-conflicting-outputs
description: Generate code for all packages
packageFilters:
dependsOn: "build_runner"

gen:build:
run: melos run gen:clean && melos run gen:build:flutter && melos run gen:build:dart
description: Generate code for all packages

gen:build:flutter:
run: melos exec --category=flutter_projects --order-dependents -- flutter pub run build_runner build --delete-conflicting-outputs
description: Generate code for Flutter packages
packageFilters:
dependsOn: "build_runner"

gen:build:dart:
run: melos exec --category=dart_projects --order-dependents -- dart run build_runner build --delete-conflicting-outputs
description: Generate code for Dart packages
packageFilters:
dependsOn: "build_runner"

gen:clean:
run: melos run gen:clean:flutter && melos run gen:clean:dart
description: Clean generated code for all packages

gen:clean:flutter:
run: melos exec --category=flutter_projects --order-dependents -- flutter pub run build_runner clean
description: Clean generated code for Flutter packages
packageFilters:
dependsOn: "build_runner"

gen:clean:dart:
run: melos exec --category=dart_projects --order-dependents -- dart run build_runner clean
description: Clean generated code for Dart packages
packageFilters:
dependsOn: "build_runner"
run: |
melos exec -c 4 -- dart analyze . && \
melos exec -c 4 --depends-on="dart_code_metrics_presets" -- dcm analyze . --fatal-style --fatal-warnings
description: Run all static analysis checks (dart + DCM)

lint:
run: |
melos exec --depends-on="dart_code_metrics_presets" -- dcm fix . && \
melos exec -- dart fix --apply && \
melos exec -- dart format .
description: Fix all linting issues and format code

# FORMATTING
format:
run: melos exec -- dart format .
description: Format all Dart files

format:check:
run: melos exec -- dart format --output=none --set-exit-if-changed .
description: Check formatting without applying changes

# TESTING
test:
run: melos run test:flutter && melos run test:dart
description: Run all tests

test:flutter:
run: melos exec --category=flutter_projects -- flutter test
description: Run flutter test
description: Run Flutter tests
packageFilters:
dirExists: test

test:dart:
run: melos exec --category=dart_projects -- dart test
description: Run dart test
description: Run Dart tests
packageFilters:
dirExists: test

test:coverage:
run: melos exec --category=flutter_projects -- flutter test --coverage
description: Run flutter test with coverage
description: Run tests with coverage
packageFilters:
dirExists: test

brb:
run: melos run gen:build

brbc:
run: melos run gen:clean
fix:
run: melos run lint:fix:all
# CODE GENERATION
gen:
run: melos run gen:clean && melos exec --order-dependents --depends-on="build_runner" -- dart run build_runner build --delete-conflicting-outputs
description: Generate code for all packages

gen:watch:
run: melos exec --order-dependents --depends-on="build_runner" -- dart run build_runner watch --delete-conflicting-outputs
description: Watch mode for code generation

gen:clean:
run: melos exec --order-dependents --depends-on="build_runner" -- dart run build_runner clean
description: Clean generated code

# UTILITIES
custom_lint_analyze:
run: melos exec --depends-on="mix_lint" dart pub run custom_lint

Expand All @@ -139,7 +105,6 @@ scripts:
run: ./scripts/verify_changelogs.sh packages
description: Verify that all packages have the same version

# API compatibility checking with dart_apitool
api-check:
run: dart scripts/api_check.dart
description: "Check API compatibility for mix packages (usage: melos run api-check -- [package] [version])"
description: Check API compatibility for mix packages
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ class _MockSpecAttribute extends Style<MockSpec<Map<String, dynamic>>> {
final double? height;

_MockSpecAttribute({
required this.width,
required this.width,
this.height,
super.variants = const [],
super.modifier,
Expand Down
2 changes: 1 addition & 1 deletion packages/mix/test/src/core/style_nested_variants_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class _MockSpecAttribute extends Style<MockSpec<Map<String, dynamic>>> {
final double? height;

_MockSpecAttribute({
required this.width,
required this.width,
this.height,
super.variants = const [],
super.modifier,
Expand Down
6 changes: 5 additions & 1 deletion packages/mix/test/src/specs/icon/icon_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ void main() {
home: Scaffold(
body: Column(
children: [
StyledIcon(spec: const IconSpec(), icon: testIcon, key: styledIconKey),
StyledIcon(
spec: const IconSpec(),
icon: testIcon,
key: styledIconKey,
),
Icon(testIcon, key: iconKey),
],
),
Expand Down
6 changes: 5 additions & 1 deletion packages/mix/test/src/specs/image/image_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ void main() {
home: Scaffold(
body: Column(
children: [
StyledImage(spec: const ImageSpec(), key: styledImageKey, image: imageProvider),
StyledImage(
spec: const ImageSpec(),
key: styledImageKey,
image: imageProvider,
),
Image(key: imageKey, image: imageProvider),
],
),
Expand Down
6 changes: 5 additions & 1 deletion packages/mix/test/src/specs/text/text_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ void main() {
home: Scaffold(
body: Column(
children: [
StyledText(testText, spec: const TextSpec(), key: styledTextKey),
StyledText(
testText,
spec: const TextSpec(),
key: styledTextKey,
),
Text(testText, key: textKey),
],
),
Expand Down
Loading