Skip to content

feat(stac): re-export stac_core through stac package#455

Merged
divyanshub024 merged 2 commits intodevfrom
dv/core-dx
Feb 27, 2026
Merged

feat(stac): re-export stac_core through stac package#455
divyanshub024 merged 2 commits intodevfrom
dv/core-dx

Conversation

@divyanshub024
Copy link
Member

@divyanshub024 divyanshub024 commented Feb 27, 2026

Users no longer need to depend on both stac and stac_core. The stac package now fully re-exports stac_core via stac.dart and provides a separate stac_core.dart entry point for pure-Dart files processed by the Stac CLI without requiring the Flutter SDK.

Description

  • Re-export all of stac_core through package:stac/stac.dart, replacing the previous show StacTheme-only export. Users now only need to depend on the stac package.
  • Add package:stac/stac_core.dart as a pure-Dart entry point for stac/ screen and theme files processed by the Stac CLI without the Flutter SDK.
  • Export StacOptions from the stac_core barrel (core.dart) so it no longer requires a direct sub-path import.
  • Remove stac_core as a direct dependency from example apps (movie_app, stac_gallery) and migrate their imports.
  • Remove redundant stac_core imports from internal parser files that already import stac.dart.

Migration

  • Replace import 'package:stac_core/stac_core.dart' with import 'package:stac/stac_core.dart' in stac/ screen files (pure Dart, no Flutter).
  • Replace import 'package:stac_core/...' with import 'package:stac/stac.dart' in lib/ Flutter files.
  • Remove stac_core from your pubspec.yaml dependencies.

Test plan

  • Verify movie_app builds and runs correctly on iOS/Android
  • Verify stac_gallery builds and runs correctly
  • Verify Stac CLI can process screen files that import package:stac/stac_core.dart
  • Confirm no remaining direct stac_core imports in example apps

Related Issues

Closes #451

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Code refactor
  • Build configuration change
  • Documentation
  • Chore

Summary by CodeRabbit

  • New Features

    • Added a pure-Dart entry point to enable CLI processing without requiring the Flutter SDK.
  • Refactor

    • Unified package imports across the codebase for more consistent usage.
    • Cleaned up example project dependency declarations to remove obsolete references.

Users no longer need to depend on both stac and stac_core. The stac
package now fully re-exports stac_core via stac.dart and provides a
separate stac_core.dart entry point for pure-Dart files processed by
the Stac CLI without requiring the Flutter SDK.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b3a24c and 5af7375.

📒 Files selected for processing (2)
  • examples/movie_app/lib/widgets/movie_carousel/movie_carousel.dart
  • examples/movie_app/stac/app_theme.dart
🚧 Files skipped from review as they are similar to previous changes (2)
  • examples/movie_app/stac/app_theme.dart
  • examples/movie_app/lib/widgets/movie_carousel/movie_carousel.dart

📝 Walkthrough

Walkthrough

Adds a pure-Dart stac_core.dart entry point inside the stac package, fully re-exports stac_core from stac, and updates example apps and many parser/framework files to use the consolidated package:stac imports and drop direct stac_core dependencies. (50 words)

Changes

Cohort / File(s) Summary
Example Pubspecs
examples/movie_app/pubspec.yaml, examples/stac_gallery/pubspec.yaml
Removed explicit stac_core dependency entries from example manifests.
Example Import Updates
examples/movie_app/lib/default_stac_options.dart, examples/movie_app/lib/widgets/movie_carousel/movie_carousel.dart, examples/movie_app/stac/app_theme.dart, examples/movie_app/stac/detail_screen.dart, examples/movie_app/stac/home_screen.dart, examples/movie_app/stac/onboarding_screen.dart
Replaced direct stac_core imports with consolidated package:stac/package:stac/stac_core.dart imports.
stac package entrypoints & exports
packages/stac/lib/stac.dart, packages/stac/lib/stac_core.dart
Widened stac.dart to fully re-export stac_core; added new pure‑Dart stac_core.dart entry-point inside the stac package.
stac_core public barrel
packages/stac_core/lib/core/core.dart
Added stac_options.dart to the public exports of the core barrel.
Parser & framework import cleanup
packages/stac/lib/src/framework/stac_service.dart, packages/stac/lib/src/parsers/.../*_parser.dart (many parser files listed in diff)
Removed now-unnecessary package:stac_core/... import lines across parser and framework files; no logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • Potatomonsta

Poem

🐰 I hopped through barrels, tidy and bright,
Swapped many imports to one shining light.
One stac to rule them, no duplicate chore—
A carrot for clarity, and room to explore! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: re-exporting stac_core through the stac package to simplify the public API surface.
Linked Issues check ✅ Passed All coding requirements from #451 are met: full re-export of stac_core from stac.dart, removal of stac_core as a direct dependency from example apps, addition of pure-Dart entry point stac_core.dart, and StacOptions export in core.dart.
Out of Scope Changes check ✅ Passed All changes are aligned with #451 objectives: removing stac_core direct dependency, re-exporting through stac, and providing pure-Dart entry points. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dv/core-dx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
examples/movie_app/lib/widgets/movie_carousel/movie_carousel.dart (1)

2-2: Use package:stac/stac.dart for consistency with the rest of the Flutter app.

All other files in the movie_app import from package:stac/stac.dart (main.dart, default_stac_options.dart, and movie_carousel_parser.dart), while this file uses package:stac/stac_core.dart. Aligning this import with the rest of the app maintains consistency across the Flutter application.

♻️ Suggested change
-import 'package:stac/stac_core.dart';
+import 'package:stac/stac.dart';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/movie_app/lib/widgets/movie_carousel/movie_carousel.dart` at line 2,
Replace the inconsistent import in movie_carousel.dart: change the current
import of package:stac/stac_core.dart to package:stac/stac.dart so it matches
other app files (e.g., main.dart, default_stac_options.dart,
movie_carousel_parser.dart); update the import statement in the top of
movie_carousel.dart accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@examples/movie_app/lib/widgets/movie_carousel/movie_carousel.dart`:
- Line 2: Replace the inconsistent import in movie_carousel.dart: change the
current import of package:stac/stac_core.dart to package:stac/stac.dart so it
matches other app files (e.g., main.dart, default_stac_options.dart,
movie_carousel_parser.dart); update the import statement in the top of
movie_carousel.dart accordingly.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d090ea and 4b3a24c.

⛔ Files ignored due to path filters (2)
  • examples/movie_app/pubspec.lock is excluded by !**/*.lock
  • examples/stac_gallery/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (26)
  • examples/movie_app/lib/default_stac_options.dart
  • examples/movie_app/lib/widgets/movie_carousel/movie_carousel.dart
  • examples/movie_app/pubspec.yaml
  • examples/movie_app/stac/app_theme.dart
  • examples/movie_app/stac/detail_screen.dart
  • examples/movie_app/stac/home_screen.dart
  • examples/movie_app/stac/onboarding_screen.dart
  • examples/stac_gallery/pubspec.yaml
  • packages/stac/lib/src/framework/stac_service.dart
  • packages/stac/lib/src/parsers/actions/stac_set_value/stac_set_value_action_parser.dart
  • packages/stac/lib/src/parsers/core/stac_action_parser.dart
  • packages/stac/lib/src/parsers/core/stac_widget_parser.dart
  • packages/stac/lib/src/parsers/foundation/decoration/stac_box_decoration_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_app_bar/stac_app_bar_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_badge/stac_badge_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_container/stac_container_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_image/stac_image_parser_io.dart
  • packages/stac/lib/src/parsers/widgets/stac_image/stac_image_parser_stub.dart
  • packages/stac/lib/src/parsers/widgets/stac_image/stac_image_parser_web.dart
  • packages/stac/lib/src/parsers/widgets/stac_inkwell/stac_inkwell_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_tool_tip/stac_tool_tip_parser.dart
  • packages/stac/lib/stac.dart
  • packages/stac/lib/stac_core.dart
  • packages/stac_core/lib/core/core.dart
💤 Files with no reviewable changes (14)
  • packages/stac/lib/src/parsers/widgets/stac_app_bar/stac_app_bar_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_image/stac_image_parser_io.dart
  • packages/stac/lib/src/parsers/foundation/decoration/stac_box_decoration_parser.dart
  • packages/stac/lib/src/parsers/core/stac_widget_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_container/stac_container_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_tool_tip/stac_tool_tip_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_inkwell/stac_inkwell_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_switch/stac_switch_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_image/stac_image_parser_stub.dart
  • packages/stac/lib/src/parsers/widgets/stac_linear_progress_indicator/stac_linear_progress_indicator_parser.dart
  • packages/stac/lib/src/parsers/widgets/stac_image/stac_image_parser_web.dart
  • packages/stac/lib/src/parsers/widgets/stac_badge/stac_badge_parser.dart
  • packages/stac/lib/src/parsers/core/stac_action_parser.dart
  • packages/stac/lib/src/parsers/actions/stac_set_value/stac_set_value_action_parser.dart

…heme

- Changed import from 'package:stac/stac_core.dart' to 'package:stac/stac.dart' in movie_carousel.dart.
- Updated import from 'package:stac/stac.dart' to 'package:stac/stac_core.dart' in app_theme.dart to reflect recent re-exports.
@Potatomonsta Potatomonsta self-requested a review February 27, 2026 14:46
@divyanshub024 divyanshub024 merged commit 752f9a6 into dev Feb 27, 2026
6 checks passed
@divyanshub024 divyanshub024 deleted the dv/core-dx branch February 27, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DX] Eliminate the need for developers to install stac_core separately

2 participants