diff --git a/.craft.yml b/.craft.yml index de509f4f7b..388710aa6e 100644 --- a/.craft.yml +++ b/.craft.yml @@ -8,17 +8,17 @@ targets: # See https://github.com/getsentry/sentry-dart/pull/2113 for more context skipValidation: true packages: - dart: - flutter: - logging: - dio: - file: - sqflite: - hive: - drift: - isar: - link: - firebase_remote_config: + packages/dart: + packages/flutter: + packages/logging: + packages/dio: + packages/file: + packages/sqflite: + packages/hive: + packages/drift: + packages/isar: + packages/link: + packages/firebase_remote_config: - name: github - name: registry sdks: diff --git a/.github/workflows/e2e_dart.yml b/.github/workflows/e2e_dart.yml index ad4a4ab945..ef836a95e5 100644 --- a/.github/workflows/e2e_dart.yml +++ b/.github/workflows/e2e_dart.yml @@ -9,8 +9,8 @@ on: - "!**/*.md" - "!**/class-diagram.svg" - ".github/workflows/e2e_dart.yml" - - '.github/workflows/analyze.yml' - - "dart/**" + - ".github/workflows/analyze.yml" + - "packages/dart/**" - "e2e_test/**" env: diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index 2dd64a0997..0ae30c2679 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -4,7 +4,7 @@ on: push: paths: - .github/workflows/metrics.yml - - dart/** + - packages/dart/** - packages/flutter/** - metrics/** - "!**/*.md" diff --git a/.github/workflows/min_version_test.yml b/.github/workflows/min_version_test.yml index 4852d93911..f15985a699 100644 --- a/.github/workflows/min_version_test.yml +++ b/.github/workflows/min_version_test.yml @@ -9,7 +9,7 @@ on: - "!**/*.md" - "!**/class-diagram.svg" - ".github/workflows/min_version_test.yml" - - "dart/**" + - "packages/dart/**" - "packages/flutter/**" - "min_version_test/**" @@ -57,7 +57,7 @@ jobs: - uses: ruby/setup-ruby@472790540115ce5bd69d399a020189a8c87d641f # pin@v1.247.0 with: - ruby-version: '3.1.2' # https://github.com/flutter/flutter/issues/109385#issuecomment-1212614125 + ruby-version: "3.1.2" # https://github.com/flutter/flutter/issues/109385#issuecomment-1212614125 - name: Uninstall existing CocoaPods and install globally run: | diff --git a/.gitignore b/.gitignore index 2ee4c21264..1df9821de0 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ pubspec.lock Podfile.lock .gradle -flutter/.gradle +packages/flutter/.gradle diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a876255390..f78ce45036 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,35 +1,99 @@ -### Dart +# Contributing to Sentry Dart & Flutter -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. +Thank you for your interest in contributing to Sentry's Dart and Flutter SDKs! This guide will help +you get started. -### Flutter +## Prerequisites -All you need is the [sentry-flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter) and `sentry-dart` as stated above. +### Required Tools -The SDK currently supports Android, iOS, and Web. We build the example app for these targets on 3 platforms: Windows, macOS, and Linux. -This is to make sure you'd be able to contribute to this project if you're using any of these operating systems. +* **Dart SDK** - Required for all packages +* **Flutter SDK** - Required for `sentry-flutter` and Flutter integrations +* **[melos](https://melos.invertase.dev/)** - For managing the monorepo -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. +## Environment Setup -The Flutter SDK has our Native SDKs embedded if you wish to learn more about them, they sit at: +### 1. Install melos -[sentry-java](https://github.com/getsentry/sentry-java) for the Android integration. -[sentry-cocoa](https://github.com/getsentry/sentry-cocoa) for the Apple integration. -[sentry-native](https://github.com/getsentry/sentry-native) for the Android NDK integration. +```bash +dart pub global activate melos +``` -### Dependencies +### 2. Bootstrap the project -* The Dart SDK (if you want to change `sentry-dart`) -* The Flutter SDK (if you want to change `sentry-dart` or `sentry-flutter`) -* Android: Android SDK (`sentry-java`) with NDK (`sentry-native`): The example project includes C++. -* iOS: Cocoa SDK (`sentry-cocoa`), you'll need a Mac with Xcode installed. -* Web: No additional dependencies. +At the repository root, run: -### Static Code Analysis, Tests, Formatting, Pub Score and Dry publish +```bash +melos bootstrap +``` -* Dart/Flutter - * Execute `./tool/presubmit.sh` within the `dart` and `flutter` folders -* Swift/CocoaPods - * Use `swiftlint` and `pod lib lint` -* Kotlin - * Use `ktlint` and `detekt` +If you're using [fvm](https://fvm.app/), specify the SDK path: + +```bash +melos bootstrap --sdk-path=/Users/user/fvm/default/ +``` + +## Project Structure + +### Core SDKs + +* **[packages/dart](https://github.com/getsentry/sentry-dart/tree/main/packages/dart)** - Core Dart + SDK (`sentry` package) +* **[packages/flutter](https://github.com/getsentry/sentry-dart/tree/main/packages/flutter)** - + Flutter SDK (`sentry_flutter` package) + +### Integration Packages + +Located under `packages/`, we maintain integrations for popular Dart/Flutter libraries: + +* **sentry_dio** - HTTP client integration for [dio](https://pub.dev/packages/dio) +* **sentry_logging** - Integration for the [logging](https://pub.dev/packages/logging) package +* **sentry_sqflite** - Integration for [sqflite](https://pub.dev/packages/sqflite) database +* **sentry_drift** - Integration for [drift](https://pub.dev/packages/drift) database +* **sentry_hive** - Integration for [hive](https://pub.dev/packages/hive) database +* **sentry_isar** - Integration for [isar](https://pub.dev/packages/isar) database +* **sentry_file** - File I/O operations integration +* **sentry_link** - GraphQL integration via [gql_link](https://pub.dev/packages/gql_link) +* **sentry_firebase_remote_config** - Integration + for [firebase_remote_config](https://pub.dev/packages/firebase_remote_config) + +## Platform Support + +The Flutter SDK supports the following platforms: + +* Android +* iOS +* macOS +* Linux +* Windows +* Web + +We test the example app on Windows, macOS, and Linux to ensure cross-platform compatibility. CI runs +against Flutter `stable` and `beta` channels. + +## Native SDK Dependencies + +The Flutter SDK embeds platform-specific native SDKs: + +* **Android**: [sentry-java](https://github.com/getsentry/sentry-java) (via + Gradle) + [sentry-native](https://github.com/getsentry/sentry-native) for NDK +* **iOS/macOS**: [sentry-cocoa](https://github.com/getsentry/sentry-cocoa) (via CocoaPods/SPM) +* **Linux/Windows**: [sentry-native](https://github.com/getsentry/sentry-native) (bundled in + `packages/flutter/sentry-native/`) +* **Web**: [sentry-javascript](https://github.com/getsentry/sentry-javascript) (loaded via CDN) + +[//]: # (TODO: buenaflor - properly set up precommit hooks) +[//]: # (### Static Code Analysis, Tests, Formatting, Pub Score and Dry publish) + +[//]: # () +[//]: # (* Dart/Flutter) + +[//]: # ( * Execute `./tool/presubmit.sh` within the `dart` and `flutter` folders) + +[//]: # (* Swift/CocoaPods) + +[//]: # ( * Use `swiftlint` and `pod lib lint`) + +[//]: # (* Kotlin) + +[//]: # ( * Use `ktlint` and `detekt`) diff --git a/README.md b/README.md index a293f7d8ff..447de791d3 100644 --- a/README.md +++ b/README.md @@ -9,23 +9,22 @@ _Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us [**Check out our open positions**](https://sentry.io/careers/)_ -Sentry SDK for Dart and Flutter -=========== +# Sentry SDK for Dart and Flutter [![codecov](https://codecov.io/gh/getsentry/sentry-dart/branch/main/graph/badge.svg?token=J0QX0LPmwy)](https://codecov.io/gh/getsentry/sentry-dart) -| Package | CI status | Likes | Downloads | Analysis | -|------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------| --------- | -------- | -| [![sentry](https://img.shields.io/pub/v/sentry.svg?label=sentry)](https://pub.dev/packages/sentry) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/dart.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/dart.yml) | [![likes](https://img.shields.io/pub/likes/sentry)](https://pub.dev/packages/sentry/score) | [![dm](https://img.shields.io/pub/dm/sentry)](https://pub.dev/packages/sentry/score) | [![pub points](https://img.shields.io/pub/points/sentry)](https://pub.dev/packages/sentry/score) -| [![sentry_flutter](https://img.shields.io/pub/v/sentry_flutter.svg?label=sentry_flutter)](https://pub.dev/packages/sentry_flutter) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/flutter.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/flutter.yml) | [![likes](https://img.shields.io/pub/likes/sentry_flutter)](https://pub.dev/packages/sentry_flutter/score) | [![dm](https://img.shields.io/pub/dm/sentry_flutter)](https://pub.dev/packages/sentry_flutter/score) | [![pub points](https://img.shields.io/pub/points/sentry_flutter)](https://pub.dev/packages/sentry_flutter/score) -| [![sentry_logging](https://img.shields.io/pub/v/sentry_logging.svg?label=sentry_logging)](https://pub.dev/packages/sentry_logging) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/logging.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/logging.yml) | [![likes](https://img.shields.io/pub/likes/sentry_logging)](https://pub.dev/packages/sentry_logging/score) | [![dm](https://img.shields.io/pub/dm/sentry_logging)](https://pub.dev/packages/sentry_logging/score) | [![pub points](https://img.shields.io/pub/points/sentry_logging)](https://pub.dev/packages/sentry_logging/score) -| [![sentry_dio](https://img.shields.io/pub/v/sentry_dio.svg?label=sentry_dio)](https://pub.dev/packages/sentry_dio) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/dio.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/dio.yml) | [![likes](https://img.shields.io/pub/likes/sentry_dio)](https://pub.dev/packages/sentry_dio/score) | [![dm](https://img.shields.io/pub/dm/sentry_dio)](https://pub.dev/packages/sentry_dio/score) | [![pub points](https://img.shields.io/pub/points/sentry_dio)](https://pub.dev/packages/sentry_dio/score) -| [![sentry_link](https://img.shields.io/pub/v/sentry_link.svg?label=sentry_link)](https://pub.dev/packages/sentry_link) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/link.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/link.yml) | [![likes](https://img.shields.io/pub/likes/sentry_link)](https://pub.dev/packages/sentry_link/score) | [![dm](https://img.shields.io/pub/dm/sentry_link)](https://pub.dev/packages/sentry_link/score) | [![pub points](https://img.shields.io/pub/points/sentry_link)](https://pub.dev/packages/sentry_link/score) -| [![sentry_file](https://img.shields.io/pub/v/sentry_file.svg?label=sentry_file)](https://pub.dev/packages/sentry_file) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/file.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/file.yml) | [![likes](https://img.shields.io/pub/likes/sentry_file)](https://pub.dev/packages/sentry_file/score) | [![dm](https://img.shields.io/pub/dm/sentry_file)](https://pub.dev/packages/sentry_file/score) | [![pub points](https://img.shields.io/pub/points/sentry_file)](https://pub.dev/packages/sentry_file/score) -| [![sentry_sqflite](https://img.shields.io/pub/v/sentry_sqflite.svg?label=sentry_sqflite)](https://pub.dev/packages/sentry_sqflite) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/sqflite.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/sqflite.yml) | [![likes](https://img.shields.io/pub/likes/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![dm](https://img.shields.io/pub/dm/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![pub points](https://img.shields.io/pub/points/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) -| [![sentry_drift](https://img.shields.io/pub/v/sentry_drift.svg?label=sentry_drift)](https://pub.dev/packages/sentry_drift) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/drift.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/drift.yml) | [![likes](https://img.shields.io/pub/likes/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![dm](https://img.shields.io/pub/dm/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![pub points](https://img.shields.io/pub/points/sentry_drift)](https://pub.dev/packages/sentry_drift/score) -| [![sentry_hive](https://img.shields.io/pub/v/sentry_hive.svg?label=sentry_hive)](https://pub.dev/packages/sentry_hive) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/hive.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/hive.yml) | [![likes](https://img.shields.io/pub/likes/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![dm](https://img.shields.io/pub/dm/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![pub points](https://img.shields.io/pub/points/sentry_hive)](https://pub.dev/packages/sentry_hive/score) -| [![sentry_isar](https://img.shields.io/pub/v/sentry_isar.svg?label=sentry_isar)](https://pub.dev/packages/sentry_isar) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/isar.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/isar.yml) | [![likes](https://img.shields.io/pub/likes/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![dm](https://img.shields.io/pub/dm/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![pub points](https://img.shields.io/pub/points/sentry_isar)](https://pub.dev/packages/sentry_isar/score) +| Package | CI status | Likes | Downloads | Analysis | +| ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| [![sentry](https://img.shields.io/pub/v/sentry.svg?label=sentry)](https://pub.dev/packages/sentry) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/dart.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/dart.yml) | [![likes](https://img.shields.io/pub/likes/sentry)](https://pub.dev/packages/sentry/score) | [![dm](https://img.shields.io/pub/dm/sentry)](https://pub.dev/packages/sentry/score) | [![pub points](https://img.shields.io/pub/points/sentry)](https://pub.dev/packages/sentry/score) | +| [![sentry_flutter](https://img.shields.io/pub/v/sentry_flutter.svg?label=sentry_flutter)](https://pub.dev/packages/sentry_flutter) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/flutter.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/flutter.yml) | [![likes](https://img.shields.io/pub/likes/sentry_flutter)](https://pub.dev/packages/sentry_flutter/score) | [![dm](https://img.shields.io/pub/dm/sentry_flutter)](https://pub.dev/packages/sentry_flutter/score) | [![pub points](https://img.shields.io/pub/points/sentry_flutter)](https://pub.dev/packages/sentry_flutter/score) | +| [![sentry_logging](https://img.shields.io/pub/v/sentry_logging.svg?label=sentry_logging)](https://pub.dev/packages/sentry_logging) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/logging.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/logging.yml) | [![likes](https://img.shields.io/pub/likes/sentry_logging)](https://pub.dev/packages/sentry_logging/score) | [![dm](https://img.shields.io/pub/dm/sentry_logging)](https://pub.dev/packages/sentry_logging/score) | [![pub points](https://img.shields.io/pub/points/sentry_logging)](https://pub.dev/packages/sentry_logging/score) | +| [![sentry_dio](https://img.shields.io/pub/v/sentry_dio.svg?label=sentry_dio)](https://pub.dev/packages/sentry_dio) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/dio.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/dio.yml) | [![likes](https://img.shields.io/pub/likes/sentry_dio)](https://pub.dev/packages/sentry_dio/score) | [![dm](https://img.shields.io/pub/dm/sentry_dio)](https://pub.dev/packages/sentry_dio/score) | [![pub points](https://img.shields.io/pub/points/sentry_dio)](https://pub.dev/packages/sentry_dio/score) | +| [![sentry_link](https://img.shields.io/pub/v/sentry_link.svg?label=sentry_link)](https://pub.dev/packages/sentry_link) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/link.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/link.yml) | [![likes](https://img.shields.io/pub/likes/sentry_link)](https://pub.dev/packages/sentry_link/score) | [![dm](https://img.shields.io/pub/dm/sentry_link)](https://pub.dev/packages/sentry_link/score) | [![pub points](https://img.shields.io/pub/points/sentry_link)](https://pub.dev/packages/sentry_link/score) | +| [![sentry_file](https://img.shields.io/pub/v/sentry_file.svg?label=sentry_file)](https://pub.dev/packages/sentry_file) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/file.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/file.yml) | [![likes](https://img.shields.io/pub/likes/sentry_file)](https://pub.dev/packages/sentry_file/score) | [![dm](https://img.shields.io/pub/dm/sentry_file)](https://pub.dev/packages/sentry_file/score) | [![pub points](https://img.shields.io/pub/points/sentry_file)](https://pub.dev/packages/sentry_file/score) | +| [![sentry_sqflite](https://img.shields.io/pub/v/sentry_sqflite.svg?label=sentry_sqflite)](https://pub.dev/packages/sentry_sqflite) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/sqflite.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/sqflite.yml) | [![likes](https://img.shields.io/pub/likes/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![dm](https://img.shields.io/pub/dm/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | [![pub points](https://img.shields.io/pub/points/sentry_sqflite)](https://pub.dev/packages/sentry_sqflite/score) | +| [![sentry_drift](https://img.shields.io/pub/v/sentry_drift.svg?label=sentry_drift)](https://pub.dev/packages/sentry_drift) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/drift.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/drift.yml) | [![likes](https://img.shields.io/pub/likes/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![dm](https://img.shields.io/pub/dm/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | [![pub points](https://img.shields.io/pub/points/sentry_drift)](https://pub.dev/packages/sentry_drift/score) | +| [![sentry_hive](https://img.shields.io/pub/v/sentry_hive.svg?label=sentry_hive)](https://pub.dev/packages/sentry_hive) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/hive.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/hive.yml) | [![likes](https://img.shields.io/pub/likes/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![dm](https://img.shields.io/pub/dm/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | [![pub points](https://img.shields.io/pub/points/sentry_hive)](https://pub.dev/packages/sentry_hive/score) | +| [![sentry_isar](https://img.shields.io/pub/v/sentry_isar.svg?label=sentry_isar)](https://pub.dev/packages/sentry_isar) | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/isar.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions/workflows/isar.yml) | [![likes](https://img.shields.io/pub/likes/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![dm](https://img.shields.io/pub/dm/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | [![pub points](https://img.shields.io/pub/points/sentry_isar)](https://pub.dev/packages/sentry_isar/score) | ## Releases @@ -37,7 +36,7 @@ This repo uses the following ways to release SDK updates: ## Usage -For detailed usage, check out the inner [dart](https://github.com/getsentry/sentry-dart/tree/main/dart), [flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter), [logging](https://github.com/getsentry/sentry-dart/tree/main/logging), [dio](https://github.com/getsentry/sentry-dart/tree/main/dio), [file](https://github.com/getsentry/sentry-dart/tree/main/file), [sqflite](https://github.com/getsentry/sentry-dart/tree/main/sqflite), [drift](https://github.com/getsentry/sentry-dart/tree/main/drift), [hive](https://github.com/getsentry/sentry-dart/tree/main/hive) and [isar](https://github.com/getsentry/sentry-dart/tree/main/isar) `README's` or our `Resources` section below. +For detailed usage, check out the inner [dart](https://github.com/getsentry/sentry-dart/tree/main/packages/dart), [flutter](https://github.com/getsentry/sentry-dart/tree/main/packages/flutter), [logging](https://github.com/getsentry/sentry-dart/tree/main/packages/logging), [dio](https://github.com/getsentry/sentry-dart/tree/main/packages/dio), [file](https://github.com/getsentry/sentry-dart/tree/main/packages/file), [sqflite](https://github.com/getsentry/sentry-dart/tree/main/packages/sqflite), [drift](https://github.com/getsentry/sentry-dart/tree/main/packages/drift), [hive](https://github.com/getsentry/sentry-dart/tree/main/packages/hive) and [isar](https://github.com/getsentry/sentry-dart/tree/main/packages/isar) `README's` or our `Resources` section below. ## Blog posts @@ -51,12 +50,12 @@ For detailed usage, check out the inner [dart](https://github.com/getsentry/sent ## Resources -* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) -* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) -* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) -* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/gB6ja9uZuN) -* [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) -* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) +- [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/) +- [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/) +- [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions) +- [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/gB6ja9uZuN) +- [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry) +- [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) ## Apple Privacy Manifest diff --git a/docs/new-package-release-checklist.md b/docs/new-package-release-checklist.md index 0a7cd19821..81b9206af7 100644 --- a/docs/new-package-release-checklist.md +++ b/docs/new-package-release-checklist.md @@ -5,33 +5,35 @@ This page serves as a checklist of what to do when releasing a new package for t ## Release Preparation - [ ] Make sure the project is set up - - [ ] The package only exports the public API - - [ ] The package contains an example folder - - [ ] The package contains a README.md file - - [ ] CI badges show a status - - [ ] The package contains a CHANGELOG.md file (symlink to the root changelog) - - [ ] The package contains a dartdoc_options.yaml file (symlink to the root file) - - [ ] The package contains a LICENSE (default is `MIT`) - - [ ] The package contains a pubspec.yaml file - - [ ] The package contains a analysis_options.yaml file - -- [ ] Update the [Flutter example](https://github.com/getsentry/sentry-dart/tree/main/flutter/example) to use your new package if applicable + + - [ ] The package only exports the public API + - [ ] The package contains an example folder + - [ ] The package contains a README.md file + - [ ] CI badges show a status + - [ ] The package contains a CHANGELOG.md file (symlink to the root changelog) + - [ ] The package contains a dartdoc_options.yaml file (symlink to the root file) + - [ ] The package contains a LICENSE (default is `MIT`) + - [ ] The package contains a pubspec.yaml file + - [ ] The package contains a analysis_options.yaml file + +- [ ] Update the [Flutter example](https://github.com/getsentry/sentry-dart/tree/main/packages/flutter/example) to use your new package if applicable - [ ] Make sure your new package has a `version.dart` in the `lib/src` folder. - - This is used to set the version and package in the `Hub`. See this [example](https://github.com/getsentry/sentry-dart/blob/8609bd8dd7ea572e5d241a59643c7570e5621bda/sqflite/lib/src/sentry_database.dart#L69). - - The version will be updated to the newest version after triggering the release process. + + - This is used to set the version and package in the `Hub`. See this [example](https://github.com/getsentry/sentry-dart/blob/8609bd8dd7ea572e5d241a59643c7570e5621bda/sqflite/lib/src/sentry_database.dart#L69). + - The version will be updated to the newest version after triggering the release process. - [ ] Create a new workflow called `your-package-name.yml` for building and testing the package. - [ ] Excluding `your-package-name.yml`, add the package to the `paths-ignore` section of all package workflow files. - For examples see `sqflite.yml`, `dio.yml` etc... - -- [ ] Add an entry to [diagram.yml](https://github.com/getsentry/sentry-dart/blob/main/.github/workflows/diagrams.yml) for your package. +- [ ] Add an entry to [diagram.yml](https://github.com/getsentry/sentry-dart/blob/main/.github/workflows/diagrams.yml) for your package. - [ ] In the root `.gitignore` file add the package coverage as ignored. The `analyze` workflow will fail in your PR and in the main branch because the package is not released yet and the `pubspec.yaml` is not 'valid' according to the analyzer. This is expected - it will succeed after the release. + - [ ] Make sure the analyze workflow doesn't have other failures, only the one mentioned above. - [ ] **Very important**: add your package to `scripts/bump-version.sh`. @@ -48,7 +50,7 @@ Do these steps in the **correct order** ## After the first release - [ ] Check if package is succesfully released on `pub.dev` -- [ ] Add the package to the Sentry Release Registry +- [ ] Add the package to the Sentry Release Registry - Instructions on how to do this can be found [here](https://github.com/getsentry/sentry-release-registry#adding-new-sdks) - [Example PR](https://github.com/getsentry/sentry-release-registry/pull/136) - [ ] Add an entry to `.craft.yml` for the package in the `registry` section. diff --git a/melos.yaml b/melos.yaml index 4a68f7a054..14ce45a3d8 100644 --- a/melos.yaml +++ b/melos.yaml @@ -1,9 +1,8 @@ name: sentry_dart_workspace packages: - - 'packages/**' - -ignore: - - 'packages/flutter/example/' # ignore it for now + - 'packages/*' + - 'packages/*/*' + - 'packages/*/*/*' ide: intellij: diff --git a/packages/flutter/example/pubspec.yaml b/packages/flutter/example/pubspec.yaml index 7440bd0697..6609b8ffe1 100644 --- a/packages/flutter/example/pubspec.yaml +++ b/packages/flutter/example/pubspec.yaml @@ -36,6 +36,17 @@ dependencies: hive: any # This gets constrained by `sentry_hive` sqlite3_flutter_libs: ^0.5.0 +dependency_overrides: + isar: + version: ^3.1.0 + hosted: https://pub.isar-community.dev/ + isar_flutter_libs: + version: ^3.1.0 + hosted: https://pub.isar-community.dev/ + isar_generator: + version: ^3.1.0 + hosted: https://pub.isar-community.dev/ + dev_dependencies: flutter_lints: ^2.0.0 sentry_dart_plugin: ^3.0.0 diff --git a/packages/flutter/example/pubspec_overrides.yaml b/packages/flutter/example/pubspec_overrides.yaml index 0341e702a3..e76cae4bc5 100644 --- a/packages/flutter/example/pubspec_overrides.yaml +++ b/packages/flutter/example/pubspec_overrides.yaml @@ -1,30 +1,29 @@ -# melos_managed_dependency_overrides: sentry,sentry_dio,sentry_drift,sentry_file,sentry_flutter,sentry_hive,sentry_logging +# melos_managed_dependency_overrides: sentry,sentry_dio,sentry_drift,sentry_file,sentry_flutter,sentry_hive,sentry_isar,sentry_logging,sentry_sqflite,isar,isar_flutter_libs,isar_generator dependency_overrides: sentry: path: ../../dart - sentry_flutter: - path: ../ sentry_dio: path: ../../dio - sentry_logging: - path: ../../logging - sentry_sqflite: - path: ../../sqflite + sentry_drift: + path: ../../drift sentry_file: path: ../../file + sentry_flutter: + path: .. sentry_hive: path: ../../hive - sentry_drift: - path: ../../drift sentry_isar: path: ../../isar - # isar community fork is more stable + sentry_logging: + path: ../../logging + sentry_sqflite: + path: ../../sqflite isar: - version: ^3.1.0 hosted: https://pub.isar-community.dev/ - isar_flutter_libs: version: ^3.1.0 + isar_flutter_libs: hosted: https://pub.isar-community.dev/ - isar_generator: version: ^3.1.0 + isar_generator: hosted: https://pub.isar-community.dev/ + version: ^3.1.0 diff --git a/packages/flutter/scripts/update-js.sh b/packages/flutter/scripts/update-js.sh index a17500a47a..de2a8c6998 100755 --- a/packages/flutter/scripts/update-js.sh +++ b/packages/flutter/scripts/update-js.sh @@ -11,7 +11,7 @@ set -euo pipefail # set-version X – updates the version to X, refreshes integrity hashes and # regenerates the Dart constant file used by the web runtime -VERSION_DART_FILE="$(git rev-parse --show-toplevel)/flutter/lib/src/web/sentry_js_sdk_version.dart" +VERSION_DART_FILE="$(git rev-parse --show-toplevel)/packages/flutter/lib/src/web/sentry_js_sdk_version.dart" get_current_version() { awk -F"'" '/sentryJsSdkVersion/ { print $2 }' "$VERSION_DART_FILE" diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index 4b495014ed..c87b7d733d 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -12,12 +12,12 @@ echo "Bumping version: ${NEW_VERSION}" for pkg in {dart,flutter,logging,dio,file,sqflite,drift,hive,isar,link,firebase_remote_config}; do # Bump version in pubspec.yaml - perl -pi -e "s/^version: .*/version: $NEW_VERSION/" $pkg/pubspec.yaml + perl -pi -e "s/^version: .*/version: $NEW_VERSION/" packages/$pkg/pubspec.yaml # Bump sentry dependency version in pubspec.yaml - perl -pi -e "s/sentry: .*/sentry: $NEW_VERSION/" $pkg/pubspec.yaml + perl -pi -e "s/sentry: .*/sentry: $NEW_VERSION/" packages/$pkg/pubspec.yaml done # Bump version in version.dart -perl -pi -e "s/sdkVersion = '.*'/sdkVersion = '$NEW_VERSION'/" */lib/src/version.dart +perl -pi -e "s/sdkVersion = '.*'/sdkVersion = '$NEW_VERSION'/" packages/*/lib/src/version.dart # Bump version in flutter example -perl -pi -e "s/^version: .*/version: $NEW_VERSION/" flutter/example/pubspec.yaml +perl -pi -e "s/^version: .*/version: $NEW_VERSION/" packages/flutter/example/pubspec.yaml