-
Notifications
You must be signed in to change notification settings - Fork 497
Refactor core, utils and config as libraries using angular's built-in tools #4783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
artlowel
wants to merge
54
commits into
DSpace:main
Choose a base branch
from
atmire:ng-workspace-poc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… inside core, fix paths with /src/app/core
…nvironment import to injection token in core
…utils in config folder
…ACOM-327 # Conflicts: # src/app/core/provide-core.ts # src/app/submission/sections/section-coar-notify/submission-coar-notify-workspaceitem.model.ts
…een core and app classes
…y between core and app classes
…tween core and app classes
…en core and app classes
…re and app classes
…tween core and app
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
Description
This PR builds on #4629
Here's a compare view
Generated libraries
Converted
@dspace/core,@dspace/config, and@dspace/utilsTypeScript path mappings into Angular libraries using:Moved the corresponding code into the
libfolder of each new library.Public APIs
public-api.ts, defining what can be imported externally.Eventually we will want it to watch for changes so it adds new files when you create them.
Import and path updates
Updated all imports in the main app to use each library’s public API.
For example,
import { Process } from '@dspace/core/processes/process.model'becomesimport { Process } from '@dspace/core'.Updated library paths in
tsconfig.jsonto point directly to the public APIs rather than built outputs.This ensures that code changes in any library are immediately reflected in development mode.
This also works for production, though we may later build the libraries separately to speed up prod builds when no library code has changed.
Bugfixes
Building and testing
npm run start,npm run start:dev, and similar.Unit tests currently fail due to imports that moved. I did not spend more time fixing these in case we decide not to proceed with this approach.
Custom lib poc
I added a custom library on top of this PR to test how that would work. You can find that code at atmire:ng-workspace-poc-with-custom-lib
Here's a compare view with this PR