Skip to content

Commit 44d2e92

Browse files
authored
melos #12: general cleanup (#3142)
* Add melos setup and check only set up Dart for now * Update * Update] * Update] * Update * Update * Update * Fix CHANGELOG * Update gitignore * Fix symlink in CHANGELOG * Add logging to melos * Update * Update * Update * Update * Add dio to packages * Update workflow * Update * Update * Update * Update * Update * Add hive to packages * Update * Add file to packages * Add link to packages * Update * Update * Update * Update * Fix test * Fix test * Fix test * Fix test * Fix test * Add flutter to packages * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Clean up * Updaet * Updaet * Update
1 parent 9da64c1 commit 44d2e92

File tree

13 files changed

+174
-100
lines changed

13 files changed

+174
-100
lines changed

.craft.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ targets:
88
# See https://github.com/getsentry/sentry-dart/pull/2113 for more context
99
skipValidation: true
1010
packages:
11-
dart:
12-
flutter:
13-
logging:
14-
dio:
15-
file:
16-
sqflite:
17-
hive:
18-
drift:
19-
isar:
20-
link:
21-
firebase_remote_config:
11+
packages/dart:
12+
packages/flutter:
13+
packages/logging:
14+
packages/dio:
15+
packages/file:
16+
packages/sqflite:
17+
packages/hive:
18+
packages/drift:
19+
packages/isar:
20+
packages/link:
21+
packages/firebase_remote_config:
2222
- name: github
2323
- name: registry
2424
sdks:

.github/workflows/e2e_dart.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
- "!**/*.md"
1010
- "!**/class-diagram.svg"
1111
- ".github/workflows/e2e_dart.yml"
12-
- '.github/workflows/analyze.yml'
13-
- "dart/**"
12+
- ".github/workflows/analyze.yml"
13+
- "packages/dart/**"
1414
- "e2e_test/**"
1515

1616
env:

.github/workflows/metrics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
paths:
66
- .github/workflows/metrics.yml
7-
- dart/**
7+
- packages/dart/**
88
- packages/flutter/**
99
- metrics/**
1010
- "!**/*.md"

.github/workflows/min_version_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- "!**/*.md"
1010
- "!**/class-diagram.svg"
1111
- ".github/workflows/min_version_test.yml"
12-
- "dart/**"
12+
- "packages/dart/**"
1313
- "packages/flutter/**"
1414
- "min_version_test/**"
1515

@@ -57,7 +57,7 @@ jobs:
5757

5858
- uses: ruby/setup-ruby@472790540115ce5bd69d399a020189a8c87d641f # pin@v1.247.0
5959
with:
60-
ruby-version: '3.1.2' # https://github.com/flutter/flutter/issues/109385#issuecomment-1212614125
60+
ruby-version: "3.1.2" # https://github.com/flutter/flutter/issues/109385#issuecomment-1212614125
6161

6262
- name: Uninstall existing CocoaPods and install globally
6363
run: |

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ pubspec.lock
2222
Podfile.lock
2323

2424
.gradle
25-
flutter/.gradle
25+
packages/flutter/.gradle

CONTRIBUTING.md

Lines changed: 88 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,99 @@
1-
### Dart
1+
# Contributing to Sentry Dart & Flutter
22

3-
All you need is the [sentry-dart](https://github.com/getsentry/sentry-dart/tree/main/dart). The `sentry` package doesn't depend on the Flutter SDK.
3+
Thank you for your interest in contributing to Sentry's Dart and Flutter SDKs! This guide will help
4+
you get started.
45

5-
### Flutter
6+
## Prerequisites
67

7-
All you need is the [sentry-flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter) and `sentry-dart` as stated above.
8+
### Required Tools
89

9-
The SDK currently supports Android, iOS, and Web. We build the example app for these targets on 3 platforms: Windows, macOS, and Linux.
10-
This is to make sure you'd be able to contribute to this project if you're using any of these operating systems.
10+
* **Dart SDK** - Required for all packages
11+
* **Flutter SDK** - Required for `sentry-flutter` and Flutter integrations
12+
* **[melos](https://melos.invertase.dev/)** - For managing the monorepo
1113

12-
We also run CI against the Flutter `stable` and `beta` channels, so you should be able to build it if you're in one of those.
14+
## Environment Setup
1315

14-
The Flutter SDK has our Native SDKs embedded if you wish to learn more about them, they sit at:
16+
### 1. Install melos
1517

16-
[sentry-java](https://github.com/getsentry/sentry-java) for the Android integration.
17-
[sentry-cocoa](https://github.com/getsentry/sentry-cocoa) for the Apple integration.
18-
[sentry-native](https://github.com/getsentry/sentry-native) for the Android NDK integration.
18+
```bash
19+
dart pub global activate melos
20+
```
1921

20-
### Dependencies
22+
### 2. Bootstrap the project
2123

22-
* The Dart SDK (if you want to change `sentry-dart`)
23-
* The Flutter SDK (if you want to change `sentry-dart` or `sentry-flutter`)
24-
* Android: Android SDK (`sentry-java`) with NDK (`sentry-native`): The example project includes C++.
25-
* iOS: Cocoa SDK (`sentry-cocoa`), you'll need a Mac with Xcode installed.
26-
* Web: No additional dependencies.
24+
At the repository root, run:
2725

28-
### Static Code Analysis, Tests, Formatting, Pub Score and Dry publish
26+
```bash
27+
melos bootstrap
28+
```
2929

30-
* Dart/Flutter
31-
* Execute `./tool/presubmit.sh` within the `dart` and `flutter` folders
32-
* Swift/CocoaPods
33-
* Use `swiftlint` and `pod lib lint`
34-
* Kotlin
35-
* Use `ktlint` and `detekt`
30+
If you're using [fvm](https://fvm.app/), specify the SDK path:
31+
32+
```bash
33+
melos bootstrap --sdk-path=/Users/user/fvm/default/
34+
```
35+
36+
## Project Structure
37+
38+
### Core SDKs
39+
40+
* **[packages/dart](https://github.com/getsentry/sentry-dart/tree/main/packages/dart)** - Core Dart
41+
SDK (`sentry` package)
42+
* **[packages/flutter](https://github.com/getsentry/sentry-dart/tree/main/packages/flutter)** -
43+
Flutter SDK (`sentry_flutter` package)
44+
45+
### Integration Packages
46+
47+
Located under `packages/`, we maintain integrations for popular Dart/Flutter libraries:
48+
49+
* **sentry_dio** - HTTP client integration for [dio](https://pub.dev/packages/dio)
50+
* **sentry_logging** - Integration for the [logging](https://pub.dev/packages/logging) package
51+
* **sentry_sqflite** - Integration for [sqflite](https://pub.dev/packages/sqflite) database
52+
* **sentry_drift** - Integration for [drift](https://pub.dev/packages/drift) database
53+
* **sentry_hive** - Integration for [hive](https://pub.dev/packages/hive) database
54+
* **sentry_isar** - Integration for [isar](https://pub.dev/packages/isar) database
55+
* **sentry_file** - File I/O operations integration
56+
* **sentry_link** - GraphQL integration via [gql_link](https://pub.dev/packages/gql_link)
57+
* **sentry_firebase_remote_config** - Integration
58+
for [firebase_remote_config](https://pub.dev/packages/firebase_remote_config)
59+
60+
## Platform Support
61+
62+
The Flutter SDK supports the following platforms:
63+
64+
* Android
65+
* iOS
66+
* macOS
67+
* Linux
68+
* Windows
69+
* Web
70+
71+
We test the example app on Windows, macOS, and Linux to ensure cross-platform compatibility. CI runs
72+
against Flutter `stable` and `beta` channels.
73+
74+
## Native SDK Dependencies
75+
76+
The Flutter SDK embeds platform-specific native SDKs:
77+
78+
* **Android**: [sentry-java](https://github.com/getsentry/sentry-java) (via
79+
Gradle) + [sentry-native](https://github.com/getsentry/sentry-native) for NDK
80+
* **iOS/macOS**: [sentry-cocoa](https://github.com/getsentry/sentry-cocoa) (via CocoaPods/SPM)
81+
* **Linux/Windows**: [sentry-native](https://github.com/getsentry/sentry-native) (bundled in
82+
`packages/flutter/sentry-native/`)
83+
* **Web**: [sentry-javascript](https://github.com/getsentry/sentry-javascript) (loaded via CDN)
84+
85+
[//]: # (TODO: buenaflor - properly set up precommit hooks)
86+
[//]: # (### Static Code Analysis, Tests, Formatting, Pub Score and Dry publish)
87+
88+
[//]: # ()
89+
[//]: # (* Dart/Flutter)
90+
91+
[//]: # ( * Execute `./tool/presubmit.sh` within the `dart` and `flutter` folders)
92+
93+
[//]: # (* Swift/CocoaPods)
94+
95+
[//]: # ( * Use `swiftlint` and `pod lib lint`)
96+
97+
[//]: # (* Kotlin)
98+
99+
[//]: # ( * Use `ktlint` and `detekt`)

0 commit comments

Comments
 (0)