Skip to content

Preparation work for modularization / library-based approach#4629

Merged
tdonohue merged 58 commits into
DSpace:mainfrom
4Science:task/main/DURACOM-327
Nov 10, 2025
Merged

Preparation work for modularization / library-based approach#4629
tdonohue merged 58 commits into
DSpace:mainfrom
4Science:task/main/DURACOM-327

Conversation

@atarix83
Copy link
Copy Markdown
Contributor

@atarix83 atarix83 commented Aug 7, 2025

References

Description

This PR refactors and reorganizes the codebase to support a future migration to NX. The migration itself is not included in this PR—this is a preparatory step to make the transition smoother and more maintainable.

Instructions for Reviewers

This PR focuses on architectural improvements and code cleanup. The goal is to isolate core logic and reduce inter-module dependencies, paving the way for a modular NX-based structure.

Although the PR may appear large, most of the changes are due to updated import paths for core, config, and utils, which have been simplified to reflect how these modules will be used as libraries after the NX migration.

The guiding principle behind this refactoring is that each library (core, config, utils) should be fully isolated, with no dependencies on other parts of the application. This ensures a clean separation of concerns and aligns with NX architectural best practices.

List of changes in this PR:

  • Isolated core, config, and utils folders by removing dependencies between those "modules" and other parts of the application
  • Moved notifications and correlationId state into the core state
  • Reorganized classes and files to reflect a clearer modular structure
  • Simplified import paths for core, config, and utils to reflect how they will be used as libraries after the NX migration
  • General code cleanup and removal of circular dependencies

How to test this PR:

  • Ensure the application builds and runs correctly
  • Verify that notifications and correlationId functionalities are still working as expected
  • Check that there are no unnecessary dependencies between modules
  • Evaluate how well the different parts of the application have been isolated
  • Identify any remaining classes or logic that should be moved into core, config, or utils to complete the modularization

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

FrancescoMolinaro and others added 30 commits July 22, 2025 15:10
…nvironment import to injection token in core
…ACOM-327

# Conflicts:
#	src/app/core/provide-core.ts
#	src/app/submission/sections/section-coar-notify/submission-coar-notify-workspaceitem.model.ts
@atarix83 atarix83 requested review from tdonohue and ybnd August 29, 2025 11:12
@github-actions
Copy link
Copy Markdown

Hi @atarix83,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

…ACOM-327

# Conflicts:
#	src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.spec.ts
#	src/app/shared/dso-selector/modal-wrappers/create-collection-parent-selector/create-collection-parent-selector.component.ts
#	src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.spec.ts
#	src/app/shared/dso-selector/modal-wrappers/create-community-parent-selector/create-community-parent-selector.component.ts
#	src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.spec.ts
#	src/app/shared/dso-selector/modal-wrappers/edit-collection-selector/edit-collection-selector.component.ts
#	src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.spec.ts
#	src/app/shared/dso-selector/modal-wrappers/edit-community-selector/edit-community-selector.component.ts
@artlowel
Copy link
Copy Markdown
Member

artlowel commented Oct 2, 2025

@atarix83 My feedback, as discussed in today's meeting:

  • It's currently a bit arbitrary where guards, resolvers, and route paths are located. A few are in the core library, but most are still in app. I ran into a problem with this for endUserAgreementGuard, which is in the core library, but needs paths from info-routes.ts, which is in app.

    • In my opinion it makes the most sense to keep all guards, resolvers and path definitions in app for the moment, until we can split it up further. That way core contains things like models and services, i.e. the very low level stuff, while things that are related to actually rendering the web app stay in app for now. Eventually they can ofcourse move to a separate library.
  • src/app/core/auth/models/normalized-auth-status.model.ts is empty

  • CorrelationIdService contains a console.log

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 9, 2025

Hi @atarix83,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue tdonohue changed the title Preparation work for NX migration Preparation work for modularization / library-based approach Oct 23, 2025
…ACOM-327

# Conflicts:
#	src/app/shared/form/builder/parsers/field-parser.ts
Copy link
Copy Markdown
Member

@artlowel artlowel left a comment

Choose a reason for hiding this comment

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

Thanks @atarix83!

@github-project-automation github-project-automation Bot moved this from 👀 Under Review to 👍 Reviewer Approved in DSpace 10.0 Release Nov 7, 2025
Copy link
Copy Markdown
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @atarix83 ! I gave this a re-review today, and tested as much of the application as I could. The code looks good and I couldn't find any issues.

@tdonohue tdonohue merged commit bf72132 into DSpace:main Nov 10, 2025
15 checks passed
@github-project-automation github-project-automation Bot moved this from 👍 Reviewer Approved to ✅ Done in DSpace 10.0 Release Nov 10, 2025
@tdonohue tdonohue mentioned this pull request Nov 10, 2025
12 tasks
@alexandrevryghem
Copy link
Copy Markdown
Member

I noticed this PR isn't working in dev mode. It seems to impact ts-node scripts that use tsconfig.ts-node.json with the new import statements

@tdonohue
Copy link
Copy Markdown
Member

@atarix83 : Could you or someone on your team look into @alexandrevryghem 's report above? I can verify that it appears npm run start:dev no longer works properly with this PR in place. I had concentrated my testing on production mode (npm start). It appears we overlooked testing developer mode more thoroughly

@atarix83
Copy link
Copy Markdown
Contributor Author

@alexandrevryghem @tdonohue we'll take a look

@AndreaBarbasso
Copy link
Copy Markdown
Contributor

@alexandrevryghem, @tdonohue, I opened #4809 and the linked #4810 PR to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

7 participants