Skip to content

Commit 714a194

Browse files
authored
refactor(ui): migrate from golden_toolkit -> alchemist (#2070)
Co-authored-by: xsahil03x <xsahil03x@users.noreply.github.com>
1 parent e2f0177 commit 714a194

File tree

164 files changed

+1335
-1792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+1335
-1792
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: update_goldens
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
update_goldens:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: 🚫 Ensure branch is not master
10+
if: ${{ github.event.inputs.branch == 'master' || github.event.inputs.branch == 'origin/master'}}
11+
run: |
12+
echo "Updating goldens on 'master' branch is prohibited."
13+
exit 1
14+
15+
- name: 📚 Checkout branch
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.event.inputs.branch }}
19+
20+
- name: 🐦 Install Flutter
21+
uses: subosito/flutter-action@v2
22+
with:
23+
flutter-version: "3.x"
24+
channel: stable
25+
cache: true
26+
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
27+
28+
- name: 📦 Install Tools
29+
run: flutter pub global activate melos
30+
31+
- name: 🔧 Bootstrap Workspace
32+
run: melos bootstrap --verbose
33+
34+
- name: 🖼️ Update Goldens
35+
working-directory: packages/stream_chat_flutter
36+
continue-on-error: true
37+
run: |
38+
flutter test --tags golden --update-goldens
39+
40+
- name: 📤 Commit Changes
41+
id: commit_changes
42+
uses: stefanzweifel/git-auto-commit-action@v5
43+
with:
44+
commit_message: "chore: Update Goldens"
45+
commit_user_name: github-actions[bot]
46+
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com

.gitignore

Lines changed: 98 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,118 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
16
.DS_Store
27
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
.project
12+
.classpath
13+
.settings
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
319
.idea/
20+
21+
# VS Code related
422
.vscode/
5-
**/lcov.info
6-
coverage
23+
24+
# Flutter/Dart/Pub related
25+
.dart_tool/
26+
.flutter-plugins
27+
.flutter-plugins-dependencies
728
.packages
29+
.pub-cache/
830
.pub/
9-
.dart_tool/
31+
build/
32+
coverage/
33+
coverage_helper_test.dart
34+
**/doc/api/
1035
pubspec.lock
1136
pubspec_overrides.yaml
1237
flutter_export_environment.sh
38+
generated_plugin_registrant.*
39+
GeneratedPluginRegistrant.*
1340

14-
examples/all_plugins/pubspec.yaml
41+
# Android related
42+
**/android/**/gradle-wrapper.jar
43+
**/android/.gradle
44+
**/android/captures/
45+
**/android/gradlew
46+
**/android/gradlew.bat
47+
**/android/local.properties
48+
**/android/**/GeneratedPluginRegistrant.java
1549

16-
Podfile
50+
# iOS/XCode related
51+
**/ios/**/*.mode1v3
52+
**/ios/**/*.mode2v3
53+
**/ios/**/*.moved-aside
54+
**/ios/**/*.pbxuser
55+
**/ios/**/*.perspectivev3
56+
**/ios/**/*sync/
57+
**/ios/**/.sconsign.dblite
58+
**/ios/**/.tags*
59+
**/ios/**/.vagrant/
60+
**/ios/**/DerivedData/
61+
**/ios/**/Icon?
62+
**/ios/**/Pods/
63+
**/ios/**/.symlinks/
64+
**/ios/**/profile
65+
**/ios/**/xcuserdata
66+
**/ios/.generated/
67+
**/ios/Flutter/App.framework
68+
**/ios/Flutter/Flutter.framework
69+
**/ios/Flutter/Flutter.podspec
70+
**/ios/Flutter/Generated.xcconfig
71+
**/ios/Flutter/app.flx
72+
**/ios/Flutter/app.zip
73+
**/ios/Flutter/flutter_assets/
74+
**/ios/Flutter/flutter_export_environment.sh
75+
**/ios/ServiceDefinitions.json
76+
**/ios/Runner/GeneratedPluginRegistrant.*
1777
Podfile.lock
18-
Pods/
19-
.symlinks/
20-
**/Flutter/App.framework/
21-
**/Flutter/ephemeral/
22-
**/Flutter/Flutter.framework/
23-
**/Flutter/Generated.xcconfig
24-
**/Flutter/flutter_assets/
25-
26-
ServiceDefinitions.json
27-
xcuserdata/
28-
**/DerivedData/
29-
30-
local.properties
31-
keystore.properties
78+
79+
# Exceptions to iOS rules
80+
!**/ios/**/default.mode1v3
81+
!**/ios/**/default.mode2v3
82+
!**/ios/**/default.pbxuser
83+
!**/ios/**/default.perspectivev3
84+
85+
# Generated files
86+
*.dart.js
87+
*.info.json
88+
*.js
89+
*.js_
90+
*.js.deps
91+
*.js.map
92+
**/lcov.info
93+
94+
# Other ignored files
95+
google-services.json
96+
.melos_tool/
97+
.packages/flutter_widgets/example/ios/Flutter/.last_build_id
98+
.packages/dart_client/example/ios/Flutter/.last_build_id
99+
.packages/dart_client/example/ios/Runner.xcodeproj/project.pbxproj
100+
101+
# Ignore FVM
102+
**/.fvm
103+
104+
# Gradle related
32105
.gradle/
33106
gradlew
34107
gradlew.bat
35108
gradle-wrapper.jar
36-
.flutter-plugins-dependencies
37-
*.iml
38-
39-
generated_plugin_registrant.dart
40-
GeneratedPluginRegistrant.h
41-
GeneratedPluginRegistrant.m
42-
GeneratedPluginRegistrant.java
43-
GeneratedPluginRegistrant.swift
44-
build/
45-
.flutter-plugins
46-
47-
.project
48-
.classpath
49-
.settings
50-
**/.fvm
51109

52-
.melos_tool/
53-
/packages/flutter_widgets/example/ios/Flutter/.last_build_id
54-
/packages/dart_client/example/ios/Flutter/.last_build_id
55-
/packages/dart_client/example/ios/Runner.xcodeproj/project.pbxproj
110+
# Non-CI golden files and failures
111+
**/test/**/goldens/**/*.*
112+
**/test/**/failures/**/*.*
113+
!**/test/**/goldens/ci/*.*
56114

57115
# Exceptions to the above rules
58116
!/pubspec.lock
117+
!**/example/web/sql-wasm.js
118+
!**/example/web/sql-wasm.wasm

melos.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ packages:
66

77
command:
88
bootstrap:
9+
# It seems so that running "pub get" in parallel has some issues (like
10+
# https://github.com/dart-lang/pub/issues/3404). Disabling this feature
11+
# makes the CI much more stable.
12+
runPubGetInParallel: false
913
# Dart and Flutter environment used in the project.
1014
environment:
1115
sdk: ^3.5.4
@@ -72,12 +76,12 @@ command:
7276

7377
# List of all the dev_dependencies used in the project.
7478
dev_dependencies:
79+
alchemist: ^0.11.0
7580
build_runner: ^2.4.9
7681
drift_dev: ^2.22.1
7782
fake_async: ^1.3.1
7883
faker_dart: ^0.2.1
7984
freezed: ^2.4.2
80-
golden_toolkit: ^0.15.0
8185
json_serializable: ^6.7.1
8286
mocktail: ^1.0.0
8387
path: ^1.8.3

packages/stream_chat_flutter/.gitignore

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '12.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
33+
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35+
# target 'RunnerTests' do
36+
# inherit! :search_paths
37+
# end
38+
end
39+
40+
post_install do |installer|
41+
installer.pods_project.targets.each do |target|
42+
flutter_additional_ios_build_settings(target)
43+
end
44+
end

0 commit comments

Comments
 (0)