Skip to content

Commit 5926d77

Browse files
committed
ProjectGraph: Update JSDoc
1 parent 5641ed9 commit 5926d77

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

rfcs/0009-ui5-project-refactoring.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,34 +89,48 @@ A rooted, directed graph representing a UI5 project, its dependencies and availa
8989
To be discussed: Should `ProjectGraph` have a `graphVersion`? Potentially equal to the version of ui5-project? This would allow ui5-builder and ui5-server to ensure compatibility with the provided `ProjectGraph` instance.
9090

9191
```js
92-
/**
92+
/**
9393
* @public
9494
* @param {object} parameters Parameters
9595
* @param {string} parameters.rootProjectName Root project name
9696
*/
9797
constructor({rootProjectName}) {}
9898

9999
/**
100+
* Get the root project of the graph
101+
*
100102
* @public
101103
* @returns {module:@ui5/project.specification.Project} Root project
102104
*/
103105
getRoot() {}
104106

105107
/**
108+
* Add a project to the graph
109+
*
106110
* @public
107111
* @param {module:@ui5/project.specification.Project} project Project which should be added to the graph
108112
* @param {boolean} [ignoreDuplicates=false] Whether an error should be thrown when a duplicate project is added
109113
*/
110114
addProject(project, ignoreDuplicates) {}
111115

112116
/**
117+
* Retrieve a single project from the dependency graph
118+
*
113119
* @public
114120
* @param {string} projectName Name of the project to retrieve
115121
* @returns {module:@ui5/project.specification.project|undefined}
116122
* project instance or undefined if the project is unknown to the graph
117123
*/
118124
getProject(projectName) {}
119125

126+
/**
127+
* Get all projects as a nested array containing pairs of project name and -instance.
128+
*
129+
* @public
130+
* @returns {Array<Array<string,module:@ui5/project.specifications.Project>>}
131+
*/
132+
getAllProjects() {}
133+
120134
/**
121135
* @public
122136
* @param {module:@ui5/project.specification.Extension} extension Extension which should be available in the graph
@@ -131,6 +145,14 @@ addExtension(extension) {}
131145
*/
132146
getExtension(extensionName) {}
133147

148+
/**
149+
* Get all extensions as a nested array containing pairs of extension name and -instance.
150+
*
151+
* @public
152+
* @returns {Array<Array<string,module:@ui5/project.specifications.Extension>>}
153+
*/
154+
getAllExtensions() {}
155+
134156
/**
135157
* Declare a dependency from one project in the graph to another
136158
*
@@ -150,12 +172,25 @@ declareDependency(fromProjectName, toProjectName) {}
150172
declareOptionalDependency(fromProjectName, toProjectName) {}
151173

152174
/**
175+
* Get all direct dependencies of a project as an array of project names
176+
*
153177
* @public
154178
* @param {string} projectName Name of the project to retrieve the dependencies of
155179
* @returns {string[]} Project names of the given project's dependencies
156180
*/
157181
getDependencies(projectName) {}
158182

183+
/**
184+
* Checks whether a dependency is optional or not.
185+
* Currently only used in tests.
186+
*
187+
* @private
188+
* @param {string} fromProjectName Name of the depending project
189+
* @param {string} toProjectName Name of project on which the other depends
190+
* @returns {boolean} True if the dependency is currently optional
191+
*/
192+
isOptionalDependency(fromProjectName, toProjectName) {
193+
159194
/**
160195
* Transforms any optional dependencies declared in the graph to non-optional dependency, if the target
161196
* can already be reached from the root project.

0 commit comments

Comments
 (0)