Skip to content

Commit bcdc99f

Browse files
committed
Layouting changes
1 parent 25ce952 commit bcdc99f

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

rfcs/0006-local-dependency-resolution.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ A new kind of configuration file should be introduced, allowing to define "UI5 W
4848

4949
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.
5050

51-
**Examples:**
51+
#### Example: Overwrite Resolution of a Single Library
5252

53-
------
54-
55-
**ui5-workspace.yaml**
5653
```yaml
54+
# ui5-workspace.yaml
5755
specVersion: workspace/1.0
5856
metadata:
5957
name: local-core
@@ -66,10 +64,10 @@ By configuring an additional resolution path, pointing to the directory of the s
6664
6765
![Workspace configuration for using local version of a single library](./resources/0006-workspace-setup/Workspace_Configuration_Single_Lib.svg)
6866
69-
------
67+
#### Example: Overwrite Resolution of a Multiple Libraries
7068
71-
**ui5-workspace.yaml**
7269
```yaml
70+
# ui5-workspace.yaml
7371
specVersion: workspace/1.0
7472
metadata:
7573
name: local-openui5
@@ -78,22 +76,31 @@ dependencyManagement:
7876
- path: ../openui5
7977
```
8078
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.
8280

8381
![Workspace configuration for using local version of all OpenUI5 libraries](./resources/0006-workspace-setup/Workspace_Configuration_All_OpenUI5.svg)
8482

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
8695

8796
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:
8897

8998
![Standard dependency resolution without workspace configuration](./resources/0006-workspace-setup/Standard_Dependency_Resolution.svg)
9099

91-
------
100+
#### Example: Multiple Workspace Configurations
92101

93102
Since every workspace configuration is identifiable by a name, multiple workspaces can be configured in the same file:
94103

95-
**Example:**
96-
97104
```yaml
98105
specVersion: workspace/1.0
99106
metadata:
@@ -110,13 +117,13 @@ dependencyManagement:
110117
- path: ../openui5
111118
```
112119

113-
------
120+
#### Workspace Names
114121

115122
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:
116123
* `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?**~_
120127

121128
### Key Design Decisions
122129

@@ -131,7 +138,7 @@ Workspace names should be restricted in a reasonable matter (max length, only se
131138
**Dependency resolution configuration**
132139
1. All paths must point to a directory
133140
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.
135142

136143
### UI5 CLI Enhancements
137144

0 commit comments

Comments
 (0)