Skip to content

Commit

Permalink
Perf: migrate packages to Dart workspace
Browse files Browse the repository at this point in the history
- Migrated the packages to Dart’s recently introduced “workspaces” feature. This significantly improves development resource usage and forces us to resolve version conflicts before publishing.
https://dart.dev/tools/pub/workspaces

- Bump all packages to their first beta version. A release will follow shortly
  • Loading branch information
CharlVS committed Dec 24, 2024
1 parent e51e758 commit b19bcd9
Show file tree
Hide file tree
Showing 20 changed files with 153 additions and 1,853 deletions.
57 changes: 11 additions & 46 deletions packages/komodo_coins/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,27 @@
name: komodo_coins
description: "A package for fetching managing Komodo Platform coin configuration data storage, runtime updates, and queries."
version: 0.0.1
description: "A package for fetching managing Komodo Platform coin configuration
data storage, runtime updates, and queries."
version: 0.1.0
homepage: "komodoplatform.com"

environment:
sdk: ^3.5.3
flutter: ">=1.17.0"
sdk: ^3.6.0

resolution: workspace

dependencies:
equatable: ^2.0.5
flutter:
sdk: flutter
http: ^1.2.2
# meta:
meta: ^1.15.0

komodo_defi_types:
path: ../komodo_defi_types
komodo_defi_types: ^0.1.0

# meta:
meta: ^1.15.0

dev_dependencies:
flutter_lints: ^4.0.0
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
very_good_analysis: ^6.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
# flutter:

# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.dev/to/asset-from-package
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images

# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.dev/to/font-from-package
21 changes: 10 additions & 11 deletions packages/komodo_defi_framework/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,32 @@ homepage: https://komodoplatform.com
publish_to: "none"

environment:
sdk: '>=3.3.0 <4.0.0'
# Minimum Flutter version is set quite high for build transformer capabilities.
# If this is too high for your project, this can be lowered by commenting out
# the following line and running the build transformer manually via CLI.
flutter: '>=3.22.0'
sdk: ^3.6.0

resolution: workspace

dependencies:
aws_client: ^0.6.0
# aws_client: ^0.6.0
ffi: ^2.1.2
flutter:
sdk: flutter
flutter_web_plugins:
sdk: flutter
http: ^1.2.2
komodo_wallet_build_transformer:
path: ../komodo_wallet_build_transformer
komodo_defi_types:
path: ../komodo_defi_types

# === First-party packages
komodo_defi_types: ^0.1.0
komodo_wallet_build_transformer: ^0.1.0
# ========================

logging: ^1.2.0
path: any
path_provider: ^2.1.4
plugin_platform_interface: ^2.0.2
web: ^1.1.0



path: any
dev_dependencies:
build_runner: ^2.4.11
# build_web_compilers: ^4.0.10
Expand Down
22 changes: 6 additions & 16 deletions packages/komodo_defi_local_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,23 @@ name: komodo_defi_local_auth
description: A package responsible for managing and abstracting out an
authentication service on top of the API's methods
version: 0.1.0+1
publish_to: none

environment:
sdk: ^3.4.0
flutter: ^3.22.0
sdk: ^3.6.0

resolution: workspace

dependencies:
flutter:
sdk: flutter
flutter_bloc: ^8.1.6
flutter_secure_storage: ^9.2.2

komodo_defi_framework:
path: ../komodo_defi_framework
komodo_defi_framework: ^0.1.0

komodo_defi_rpc_methods:
path: ../komodo_defi_rpc_methods
komodo_defi_rpc_methods: ^0.1.0

komodo_defi_types:
path: ../komodo_defi_types
komodo_defi_types: ^0.1.0

local_auth: ^2.3.0
mutex: ^3.1.0
Expand All @@ -32,10 +29,3 @@ dev_dependencies:
sdk: flutter
mocktail: ^1.0.4
very_good_analysis: ^6.0.0

dependency_overrides:
flutter_secure_storage_web:
git:
url: https://github.com/mogol/flutter_secure_storage.git
ref: develop
path: flutter_secure_storage_web
9 changes: 4 additions & 5 deletions packages/komodo_defi_rpc_methods/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ name: komodo_defi_rpc_methods
description: A package containing the RPC methods and responses for the Komodo DeFi Framework API
homepage: https://github.com/KomodoPlatform/komodo-defi-sdk-flutter
version: 0.1.0+1
publish_to: 'none'


environment:
sdk: ^3.4.0
sdk: ^3.6.0

resolution: workspace

dependencies:
collection: ^1.18.0
decimal: ^3.0.2
equatable: ^2.0.5
komodo_defi_types:
path: ../komodo_defi_types
komodo_defi_types: ^0.1.0

meta: ^1.15.0
path: any
Expand Down
24 changes: 8 additions & 16 deletions packages/komodo_defi_sdk/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ publish_to: 'none'
version: 0.1.0

environment:
sdk: '>=3.4.4 <4.0.0'
sdk: ^3.6.0

resolution: workspace

dependencies:
decimal: ^3.0.2
Expand All @@ -13,30 +15,20 @@ dependencies:
flutter_bloc: ^8.1.6
flutter_secure_storage: ^9.2.2

komodo_defi_sdk:
path: ../

komodo_defi_types:
path: ../../komodo_defi_types
komodo_defi_sdk: ^0.1.0
komodo_defi_types: ^0.1.0

dev_dependencies:
flutter_lints: ^3.0.0
flutter_lints: ^4.0.0
flutter_test:
sdk: flutter

very_good_analysis: ^6.0.0

flutter_web_plugins:
sdk: flutter

js: any

dependency_overrides:
flutter_secure_storage_web:
git:
url: https://github.com/mogol/flutter_secure_storage.git
ref: develop
path: flutter_secure_storage_web
very_good_analysis: ^6.0.0

flutter:
uses-material-design: true
27 changes: 8 additions & 19 deletions packages/komodo_defi_sdk/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ version: 0.1.0+1
publish_to: 'none'

environment:
sdk: ^3.4.0
flutter: '>=3.22.0 <3.25.0'
sdk: ^3.6.0

resolution: workspace

dependencies:

Expand All @@ -23,16 +24,11 @@ dependencies:
sdk: flutter
flutter_secure_storage: ^9.2.2

komodo_coins:
path: ../komodo_coins
komodo_defi_framework:
path: ../komodo_defi_framework
komodo_defi_local_auth:
path: ../komodo_defi_local_auth
komodo_defi_rpc_methods:
path: ../komodo_defi_rpc_methods
komodo_defi_types:
path: ../komodo_defi_types
komodo_coins: ^0.1.0
komodo_defi_framework: ^0.1.0
komodo_defi_local_auth: ^0.1.0
komodo_defi_rpc_methods: ^0.1.0
komodo_defi_types: ^0.1.0

mutex: ^3.1.0
shared_preferences: ^2.3.2
Expand All @@ -43,13 +39,6 @@ dev_dependencies:
test: ^1.25.2
very_good_analysis: ^6.0.0

dependency_overrides:
flutter_secure_storage_web:
git:
url: https://github.com/mogol/flutter_secure_storage.git
ref: develop
path: flutter_secure_storage_web

# TODO: Move to a separate sub-package?
# flutter:
# assets:
Expand Down
17 changes: 9 additions & 8 deletions packages/komodo_defi_types/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
name: komodo_defi_types
description: A shared library for common types used in the Komodo DeFi Framework.
version: 0.0.1
version: 0.1.0
repository: https://github.com/KomodoPlatform/komodo-defi-sdk-flutter/
publish_to: 'none'

environment:
sdk: ^3.4.4
# TODO: Consider a different approach to fetching the BIP-0039 wordlist besides
# including it as an asset. This will allow us to drop Flutter as a
# dependency and keep it pure Dart.
flutter: '>=3.22.0 <3.25.0'
sdk: ^3.6.0

resolution: workspace

dependencies:

decimal: ^3.0.2
equatable: ^2.0.5
# TODO: Consider a different approach to fetching the BIP-0039 wordlist besides
# including it as an asset. This will allow us to drop Flutter as a
# dependency and keep it pure Dart.
flutter:
sdk: flutter
komodo_defi_rpc_methods:
path: ../komodo_defi_rpc_methods

komodo_defi_rpc_methods: ^0.1.0

meta: any
dev_dependencies:
Expand Down
5 changes: 3 additions & 2 deletions packages/komodo_symbol_converter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: komodo_symbol_converter
description: A lightweight package to convert fiat/crypto prices and charts
version: 0.1.0+1
publish_to: none

environment:
sdk: ^3.4.0
sdk: ^3.6.0

resolution: workspace

dev_dependencies:
mocktail: ^1.0.4
Expand Down
6 changes: 3 additions & 3 deletions packages/komodo_ui/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: komodo_ui
description: A high-level widget catalog relevant to building Flutter UI apps which consume Komodo DeFi Framework
version: 0.1.0+1
publish_to: none

environment:
sdk: ^3.4.0
flutter: ^3.22.0
sdk: ^3.6.0

resolution: workspace

dependencies:
flutter:
Expand Down
1 change: 1 addition & 0 deletions packages/komodo_ui/widgetbook/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions packages/komodo_ui/widgetbook/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions packages/komodo_ui/widgetbook/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
Loading

0 comments on commit b19bcd9

Please sign in to comment.