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
+23-16Lines changed: 23 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,12 +48,10 @@ A new kind of configuration file should be introduced, allowing to define "UI5 W
48
48
49
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
-
**Examples:**
51
+
#### Example: Overwrite Resolution of a Single Library
52
52
53
-
------
54
-
55
-
**ui5-workspace.yaml**
56
53
```yaml
54
+
# ui5-workspace.yaml
57
55
specVersion: workspace/1.0
58
56
metadata:
59
57
name: local-core
@@ -66,10 +64,10 @@ By configuring an additional resolution path, pointing to the directory of the s
66
64
67
65

68
66
69
-
------
67
+
#### Example: Overwrite Resolution of a Multiple Libraries
70
68
71
-
**ui5-workspace.yaml**
72
69
```yaml
70
+
# ui5-workspace.yaml
73
71
specVersion: workspace/1.0
74
72
metadata:
75
73
name: local-openui5
@@ -78,22 +76,31 @@ dependencyManagement:
78
76
- path: ../openui5
79
77
```
80
78
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.
79
+
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, an equivalent`ui5.workspaces` configuration in the package.json can be used. If a `ui5.workspaces` configuration is found, the standard npm workspace configuration shall be ignored.
82
80
83
81

84
82
85
-
------
83
+
```jsonc
84
+
// package.json in OpenUI5 repository root directory
85
+
{
86
+
"name": "openui5",
87
+
// [...]
88
+
"workspaces": [
89
+
"src/!(testsuite-utils)"
90
+
]
91
+
}
92
+
```
93
+
94
+
#### Example: Standard Dependency Resolution
86
95
87
96
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
97
89
98

90
99
91
-
------
100
+
#### Example: Multiple Workspace Configurations
92
101
93
102
Since every workspace configuration is identifiable by a name, multiple workspaces can be configured in the same file:
94
103
95
-
**Example:**
96
-
97
104
```yaml
98
105
specVersion: workspace/1.0
99
106
metadata:
@@ -110,13 +117,13 @@ dependencyManagement:
110
117
- path: ../openui5
111
118
```
112
119
113
-
------
120
+
#### Workspace Names
114
121
115
122
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:
116
123
* `default`: This workspace should always be used, even if no `--workspace` parameter is provided to the CLI
117
-
* `dev`: This workspace should always be used **unless**:
118
-
- there is a `default` workspace configured
119
-
- a production or CI environment is detected: **TODO: How?**
124
+
* _~`dev`: This workspace should always be used **unless**:~_
125
+
- _~there is a `default` workspace configured~_
126
+
- _~a production or CI environment is detected: **TODO: How?**~_
120
127
121
128
### Key Design Decisions
122
129
@@ -131,7 +138,7 @@ Workspace names should be restricted in a reasonable matter (max length, only se
131
138
**Dependency resolution configuration**
132
139
1. All paths must point to a directory
133
140
1. Symlinks are followed
134
-
1. (Optional) Dependency resolution paths must be relative paths. Absolute paths, or paths relative to the home directory (`~`), are not allowed. This is to ensure that workspace configuration files are easy to share and to reduce the change of them containing private information like usernames or large directory hierarchies.
141
+
1. (Optional) Dependency resolution paths must be relative paths. Absolute paths, or paths relative to the home directory (`~`), are not allowed. This is to ensure that workspace configuration files are easy to share and to reduce the chance of them containing private information like usernames or large directory hierarchies.
0 commit comments