Skip to content

Commit cb2e99d

Browse files
committed
[BREAKING] Make '@ui5/builder' an optional peerDependency
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'.
1 parent a085232 commit cb2e99d

File tree

3 files changed

+128
-18
lines changed

3 files changed

+128
-18
lines changed

lib/graph/ProjectGraph.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,13 @@ class ProjectGraph {
513513

514514
async _getTaskRepository() {
515515
if (!this._taskRepository) {
516-
this._taskRepository = await import("@ui5/builder/internal/taskRepository");
516+
try {
517+
this._taskRepository = await import("@ui5/builder/internal/taskRepository");
518+
} catch (err) {
519+
throw new Error(
520+
`Failed to load task repository. Missing dependency to '@ui5/builder'? ` +
521+
`Error: ${err.message}`);
522+
}
517523
}
518524
return this._taskRepository;
519525
}

0 commit comments

Comments
 (0)