You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rfcs/0006-local-dependency-resolution.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,16 +46,12 @@ It should be possible to use local copies of selected dependencies, while others
46
46
47
47
A new kind of configuration file should be introduced, allowing to define "UI5 Workspaces". In a first step, and to address the key purpose of this RFC, this configuration shall allow for influencing the dependency resolution when working with a UI5 project.
48
48
49
-
For this, it should be possible to define locations at which UI5 Tooling will look for a dependency first, before falling back to the regular dependency resolution:
49
+
For this, it should be possible to define locations at which UI5 Tooling will look for a dependency first, before falling back to the regular dependency resolution.
50
50
51
-

52
-
53
-
Without any workspace configuration, dependencies of the openui5-sample-app are retrieved from the npm registry, stored in a central directory on the file system and used from there.
51
+
**Examples:**
54
52
55
53
------
56
54
57
-

58
-
59
55
**ui5-workspace.yaml**
60
56
```yaml
61
57
specVersion: workspace/1.0
@@ -66,11 +62,11 @@ dependencyManagement:
66
62
- ../openui5/src/sap.ui.core
67
63
```
68
64
69
-
By configuring an additional resolution path, pointing to the directory of the sap.ui.core package within the OpenUI5 development repository, that package will be used instead of the one retrieved from the npm repository.
65
+
By configuring an additional resolution path, pointing to the directory of the sap.ui.core package within the OpenUI5 development repository, that package will be used instead of the one retrieved from the npm repository:
70
66
71
-
------
67
+

72
68
73
-

69
+
------
74
70
75
71
**ui5-workspace.yaml**
76
72
```yaml
@@ -84,6 +80,14 @@ dependencyManagement:
84
80
85
81
For resolving all modules in OpenUI5, it should be enough to provide a path to the root directory. UI5 Tooling shall then use the [npm workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces) configuration in the [package.json](https://github.com/SAP/openui5/blob/b74d3c2f153d7a23a2c9b914280b14b7289d7880/package.json#L128) to resolve all libraries located in the repository. Alternatively, a dedicated `ui5.workspaces` configuration in the package.json can be used.
86
82
83
+

84
+
85
+
------
86
+
87
+
For reference, this is how a standard dependency resolution, without a workspace configuration looks like. Dependencies of the openui5-sample-app are retrieved from the npm registry, stored in a central directory on the file system and used from there:
88
+
89
+

90
+
87
91
------
88
92
89
93
Since every workspace configuration is identifiable by a name, multiple workspaces can be configured in the same file:
@@ -106,6 +110,8 @@ dependencyManagement:
106
110
- ../openui5
107
111
```
108
112
113
+
------
114
+
109
115
Workspace names should be restricted in a reasonable matter (max length, only selected special characters). In addition, there shall be reserved names with special functionality:
110
116
* `default`: This workspace should always be used, even if no `--workspace` parameter is provided to the CLI
111
117
* `dev`: This workspace should always be used **unless**:
0 commit comments