Skip to content

Commit

Permalink
[BREAKING] Make '@ui5/builder' an optional peerDependency
Browse files Browse the repository at this point in the history
This decoupling allows the use of @ui5/project without having to install
@ui5/builder with all its transitive dependencies in cases where no
build functionality is required. An example for that is UI5 linter.

BREAKING CHANGE:
Consumers of the Node.js API that make use of the ProjectGraph#build
method need to declare a dependency to '@ui5/builder' in their
respective package.json. The package manager should ensure that the
version fullfills the range specified in the package.json of
'@ui5/project'.
  • Loading branch information
RandomByte committed Jun 7, 2024
1 parent a085232 commit cb2e99d
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 18 deletions.
8 changes: 7 additions & 1 deletion lib/graph/ProjectGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,13 @@ class ProjectGraph {

async _getTaskRepository() {
if (!this._taskRepository) {
this._taskRepository = await import("@ui5/builder/internal/taskRepository");
try {
this._taskRepository = await import("@ui5/builder/internal/taskRepository");
} catch (err) {
throw new Error(
`Failed to load task repository. Missing dependency to '@ui5/builder'? ` +
`Error: ${err.message}`);
}
}
return this._taskRepository;
}
Expand Down
Loading

0 comments on commit cb2e99d

Please sign in to comment.