Skip to content

Conversation

@klkucaj
Copy link
Contributor

@klkucaj klkucaj commented Jan 27, 2025

Description:
This refactor standardizes the use of the moduleAlias field by consolidating it within the TypeDefinition structure. The moduleAlias field, which was already present, has been updated with additional checks and logic to improve its functionality across the codebase. The field has been removed from all other definitions to simplify and centralize its usage.

Changes include:

  • Consolidated the moduleAlias field into TypeDefinition.
  • Updated the moduleAlias getter to include new checks:
    • Added conditions to handle _projectRef and _packageRef prefixes.
  • Removed moduleAlias from all other related definitions.
  • Updated relevant references and usages to align with the new structure.

Why this change?

  • Ensures a single source of truth for the moduleAlias field.
  • Improves code maintainability and reduces redundancy.

Closes: #3131

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

If you need help, consider asking for advice on the discussion board.

Breaking changes

If you have done any breaking changes, make sure to outline them here, so that they can be included in the notes for the next release.

@Isakdl Isakdl self-requested a review January 27, 2025 16:06
Copy link
Collaborator

@Isakdl Isakdl left a comment

Choose a reason for hiding this comment

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

LGTM, just one little nit!

@Isakdl Isakdl self-requested a review January 28, 2025 08:32
@Isakdl Isakdl merged commit a035af7 into serverpod:main Jan 28, 2025
67 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate Incorrect Module Alias Assignment in parseType for Models from Other Modules

2 participants