Преглед на файлове

整理melos脚本,去除无用的约束布局

liukai преди 4 месеца
родител
ревизия
44f658e0ce

+ 26 - 0
app/pubspec_overrides.yaml

@@ -0,0 +1,26 @@
+# melos_managed_dependency_overrides: cpt_auth,cpt_job,cpt_labour,cpt_report,cs_resources,domain,initializer,plugin_basic,plugin_platform,router,shared,widgets
+dependency_overrides:
+  cpt_auth:
+    path: ../packages/cpt_auth
+  cpt_job:
+    path: ../packages/cpt_job
+  cpt_labour:
+    path: ../packages/cpt_labour
+  cpt_report:
+    path: ../packages/cpt_report
+  cs_resources:
+    path: ../packages/cs_resources
+  domain:
+    path: ../packages/cs_domain
+  initializer:
+    path: ../packages/cs_initializer
+  plugin_basic:
+    path: ../packages/cs_plugin_basic
+  plugin_platform:
+    path: ../packages/cs_plugin_platform
+  router:
+    path: ../packages/cs_router
+  shared:
+    path: ../packages/cs_shared
+  widgets:
+    path: ../packages/cs_widgets

+ 39 - 12
melos.yaml

@@ -1,14 +1,14 @@
 name: YYHotel-Business-ER
 packages:
-  - "app/**"
-  - "packages/cs_domain/**"
-  - "packages/cs_initializer/**"
-  - "packages/cs_plugin_basic/**"
-  - "packages/cs_plugin_platform/**"
-  - "packages/cs_resources/**"
-  - "packages/cs_router/**"
-  - "packages/cs_shared/**"
-  - "packages/cs_widgets/**"
+  - "app/"
+  - "packages/cs_domain/"
+  - "packages/cs_resources/"
+  - "packages/cs_router/"
+  - "packages/cs_shared/"
+  - "packages/cs_widgets/"
+  - "packages/cs_plugin_basic/"
+  - "packages/cs_plugin_platform/"
+  - "packages/cs_initializer/"
   - "packages/cpt_auth/"
   - "packages/cpt_job/"
   - "packages/cpt_labour/"
@@ -26,13 +26,40 @@ scripts:
     run: melos exec -- "flutter analyze"
     description: Run `flutter analyze` in all packages
 
-  pub_get:
+  pub_get_all:
     run: dart pub global run melos exec --flutter "flutter pub get"
-    description: pub get
+    description: 在每个子组件中运行 flutter pub get,用来获取和安装这些包的所有依赖
 
   build_all:
     run: dart pub global run melos exec --depends-on="build_runner" "flutter packages pub run build_runner build --delete-conflicting-outputs"
-    description: build_runner build all modules
+    description: 依赖了 build_runner 的组件执行 build_runner build 命令,用于自动生成JSON序列化、Freezed类等
+
+  clean_all:
+    run: melos exec -- "flutter clean"
+    description: Run `flutter clean` in all packages
+
+  clean_app:
+    run: cd "$MELOS_ROOT_PATH/app" && flutter clean
+    description: Run `flutter clean` in app module
+
+  run_app:
+    run: cd "$MELOS_ROOT_PATH/app" && flutter run
+    description: 运行App模块.
+
+  run_app2:
+    run: melos exec --scope="app" -- "flutter run"
+    description: 运行App模块方式2.
+
+  build_apk:
+    run: cd "$MELOS_ROOT_PATH/app" && flutter build apk
+    description: 编译安卓Release的APK格式安装包.
+
+  resource_get:
+    run: |
+      cd "$MELOS_ROOT_PATH/packages/cs_domain/" && flutter pub get
+      melos exec --scope="cs_resources" -- "flutter pub get"
+      cd "$MELOS_ROOT_PATH/packages/cs_widgets/" && flutter pub get
+    description: 更新实体和资源模块
 
   format:
     run: melos exec -- "flutter format . --set-exit-if-changed"

+ 16 - 0
packages/cpt_auth/pubspec_overrides.yaml

@@ -0,0 +1,16 @@
+# melos_managed_dependency_overrides: cs_resources,domain,plugin_basic,plugin_platform,router,shared,widgets
+dependency_overrides:
+  cs_resources:
+    path: ../cs_resources
+  domain:
+    path: ../cs_domain
+  plugin_basic:
+    path: ../cs_plugin_basic
+  plugin_platform:
+    path: ../cs_plugin_platform
+  router:
+    path: ../cs_router
+  shared:
+    path: ../cs_shared
+  widgets:
+    path: ../cs_widgets

+ 16 - 0
packages/cpt_job/pubspec_overrides.yaml

@@ -0,0 +1,16 @@
+# melos_managed_dependency_overrides: cs_resources,domain,plugin_basic,plugin_platform,router,shared,widgets
+dependency_overrides:
+  cs_resources:
+    path: ../cs_resources
+  domain:
+    path: ../cs_domain
+  plugin_basic:
+    path: ../cs_plugin_basic
+  plugin_platform:
+    path: ../cs_plugin_platform
+  router:
+    path: ../cs_router
+  shared:
+    path: ../cs_shared
+  widgets:
+    path: ../cs_widgets

+ 16 - 0
packages/cpt_labour/pubspec_overrides.yaml

@@ -0,0 +1,16 @@
+# melos_managed_dependency_overrides: cs_resources,domain,plugin_basic,plugin_platform,router,shared,widgets
+dependency_overrides:
+  cs_resources:
+    path: ../cs_resources
+  domain:
+    path: ../cs_domain
+  plugin_basic:
+    path: ../cs_plugin_basic
+  plugin_platform:
+    path: ../cs_plugin_platform
+  router:
+    path: ../cs_router
+  shared:
+    path: ../cs_shared
+  widgets:
+    path: ../cs_widgets

+ 16 - 0
packages/cpt_report/pubspec_overrides.yaml

@@ -0,0 +1,16 @@
+# melos_managed_dependency_overrides: cs_resources,domain,plugin_basic,plugin_platform,router,shared,widgets
+dependency_overrides:
+  cs_resources:
+    path: ../cs_resources
+  domain:
+    path: ../cs_domain
+  plugin_basic:
+    path: ../cs_plugin_basic
+  plugin_platform:
+    path: ../cs_plugin_platform
+  router:
+    path: ../cs_router
+  shared:
+    path: ../cs_shared
+  widgets:
+    path: ../cs_widgets

+ 10 - 0
packages/cs_domain/pubspec_overrides.yaml

@@ -0,0 +1,10 @@
+# melos_managed_dependency_overrides: cs_resources,plugin_platform,shared,widgets
+dependency_overrides:
+  cs_resources:
+    path: ../cs_resources
+  plugin_platform:
+    path: ../cs_plugin_platform
+  shared:
+    path: ../cs_shared
+  widgets:
+    path: ../cs_widgets

+ 16 - 0
packages/cs_initializer/pubspec_overrides.yaml

@@ -0,0 +1,16 @@
+# melos_managed_dependency_overrides: cs_resources,domain,plugin_basic,plugin_platform,router,shared,widgets
+dependency_overrides:
+  cs_resources:
+    path: ../cs_resources
+  domain:
+    path: ../cs_domain
+  plugin_basic:
+    path: ../cs_plugin_basic
+  plugin_platform:
+    path: ../cs_plugin_platform
+  router:
+    path: ../cs_router
+  shared:
+    path: ../cs_shared
+  widgets:
+    path: ../cs_widgets

+ 14 - 0
packages/cs_plugin_basic/pubspec_overrides.yaml

@@ -0,0 +1,14 @@
+# melos_managed_dependency_overrides: cs_resources,domain,plugin_platform,router,shared,widgets
+dependency_overrides:
+  cs_resources:
+    path: ../cs_resources
+  domain:
+    path: ../cs_domain
+  plugin_platform:
+    path: ../cs_plugin_platform
+  router:
+    path: ../cs_router
+  shared:
+    path: ../cs_shared
+  widgets:
+    path: ../cs_widgets

+ 8 - 0
packages/cs_plugin_platform/pubspec_overrides.yaml

@@ -0,0 +1,8 @@
+# melos_managed_dependency_overrides: cs_resources,shared,widgets
+dependency_overrides:
+  cs_resources:
+    path: ../cs_resources
+  shared:
+    path: ../cs_shared
+  widgets:
+    path: ../cs_widgets

+ 1 - 1
packages/cs_widgets/lib/widget_export.dart

@@ -1,4 +1,4 @@
-export 'package:flutter_constraintlayout/flutter_constraintlayout.dart';
+// export 'package:flutter_constraintlayout/flutter_constraintlayout.dart';
 export 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
 export 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
 export 'package:sticky_headers/sticky_headers.dart';

+ 1 - 1
packages/cs_widgets/pubspec.yaml

@@ -44,7 +44,7 @@ dependencies:
   easy_refresh: ^3.3.4
 
   # 约束布局  https://github.com/hackware1993/Flutter_ConstraintLayout/blob/master/README_CN.md
-  flutter_constraintlayout: ^1.7.0-stable
+#  flutter_constraintlayout: ^1.7.0-stable
 
   ## 列表悬停  https://github.com/fluttercommunity/flutter_sticky_headers
   sticky_headers: ^0.3.0

+ 6 - 0
packages/cs_widgets/pubspec_overrides.yaml

@@ -0,0 +1,6 @@
+# melos_managed_dependency_overrides: cs_resources,shared
+dependency_overrides:
+  cs_resources:
+    path: ../cs_resources
+  shared:
+    path: ../cs_shared