From 59a2a7c9d91f17a3f59ffad7a8f366322fab2ae4 Mon Sep 17 00:00:00 2001 From: Divyanshu Bhargava Date: Mon, 2 Mar 2026 00:39:23 +0530 Subject: [PATCH 1/3] refactor: convert stac_logger to a pure Dart package by removing Flutter dependencies and replacing Flutter-specific logging utilities. --- packages/stac_cli/pubspec.lock | 26 ------------- packages/stac_logger/lib/src/log_web.dart | 31 +++++++++++----- packages/stac_logger/pubspec.yaml | 45 +---------------------- 3 files changed, 24 insertions(+), 78 deletions(-) diff --git a/packages/stac_cli/pubspec.lock b/packages/stac_cli/pubspec.lock index 7dd8bdbc5..fc7505afc 100644 --- a/packages/stac_cli/pubspec.lock +++ b/packages/stac_cli/pubspec.lock @@ -241,11 +241,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - flutter: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" frontend_server_client: dependency: transitive description: @@ -358,14 +353,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.12.19" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" - url: "https://pub.dev" - source: hosted - version: "0.13.0" meta: dependency: transitive description: @@ -462,11 +449,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.0" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" source_gen: dependency: transitive description: @@ -601,14 +583,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b - url: "https://pub.dev" - source: hosted - version: "2.2.0" vm_service: dependency: transitive description: diff --git a/packages/stac_logger/lib/src/log_web.dart b/packages/stac_logger/lib/src/log_web.dart index bd2057b27..19bff30d5 100644 --- a/packages/stac_logger/lib/src/log_web.dart +++ b/packages/stac_logger/lib/src/log_web.dart @@ -1,8 +1,21 @@ -import 'package:flutter/foundation.dart'; import 'package:stac_logger/src/log_interface.dart'; LogInterface createLogger() => LogWeb.instance; +/// Whether the app is running in debug mode. +/// +/// This is a pure Dart equivalent of Flutter's `kDebugMode`. +/// It evaluates to `true` when assertions are enabled (debug mode) +/// and `false` in release/profile mode. +final bool _kDebugMode = () { + var isDebug = false; + assert(() { + isDebug = true; + return true; + }()); + return isDebug; +}(); + /// Web/WASM-compatible implementation of LogInterface class LogWeb implements LogInterface { LogWeb._(); @@ -12,29 +25,29 @@ class LogWeb implements LogInterface { @override void d(dynamic message) { - if (kDebugMode) { - debugPrint('[DEBUG] $message'); + if (_kDebugMode) { + print('[DEBUG] $message'); } } @override void i(dynamic message) { - if (kDebugMode) { - debugPrint('[INFO] $message'); + if (_kDebugMode) { + print('[INFO] $message'); } } @override void w(dynamic message) { - if (kDebugMode) { - debugPrint('[WARNING] $message'); + if (_kDebugMode) { + print('[WARNING] $message'); } } @override void e(dynamic message) { - if (kDebugMode) { - debugPrint('[ERROR] $message'); + if (_kDebugMode) { + print('[ERROR] $message'); } } } diff --git a/packages/stac_logger/pubspec.yaml b/packages/stac_logger/pubspec.yaml index 22f994116..abd3de983 100644 --- a/packages/stac_logger/pubspec.yaml +++ b/packages/stac_logger/pubspec.yaml @@ -6,51 +6,10 @@ repository: https://github.com/StacDev/stac/tree/dev/packages/stac_logger environment: sdk: ^3.8.1 - flutter: ">=1.17.0" dependencies: - flutter: - sdk: flutter logger: ^2.5.0 dev_dependencies: - flutter_test: - sdk: flutter - flutter_lints: ^5.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 + test: ^1.24.0 + lints: ^6.0.0 From fe38253d1957a6243f9bd820d42815ec90bb3534 Mon Sep 17 00:00:00 2001 From: Divyanshu Bhargava Date: Mon, 2 Mar 2026 00:40:18 +0530 Subject: [PATCH 2/3] ci: Temporarily disable GitHub Release creation step for testing in workflow. --- .github/workflows/stac_cli_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stac_cli_release.yml b/.github/workflows/stac_cli_release.yml index 9c2ddc88d..bee7e04ef 100644 --- a/.github/workflows/stac_cli_release.yml +++ b/.github/workflows/stac_cli_release.yml @@ -146,7 +146,7 @@ jobs: name: Create GitHub Release and upload assets runs-on: ubuntu-latest needs: build - if: ${{ success() }} + if: false # Temporarily disabled for testing steps: - name: Checkout uses: actions/checkout@v4 From dda3e49efdd5fbe588548adf13ddf8acd8d57e7a Mon Sep 17 00:00:00 2001 From: Divyanshu Bhargava Date: Mon, 2 Mar 2026 00:45:16 +0530 Subject: [PATCH 3/3] ci: re-enable GitHub Release creation and asset upload in workflow --- .github/workflows/stac_cli_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stac_cli_release.yml b/.github/workflows/stac_cli_release.yml index bee7e04ef..9c2ddc88d 100644 --- a/.github/workflows/stac_cli_release.yml +++ b/.github/workflows/stac_cli_release.yml @@ -146,7 +146,7 @@ jobs: name: Create GitHub Release and upload assets runs-on: ubuntu-latest needs: build - if: false # Temporarily disabled for testing + if: ${{ success() }} steps: - name: Checkout uses: actions/checkout@v4