Skip to content

Commit 8a83dca

Browse files
committed
[INTERNAL] README: Move documentation to UI5 Tooling repository
Related to SAP/ui5-tooling#160
1 parent 493a1b8 commit 8a83dca

File tree

3 files changed

+4
-633
lines changed

3 files changed

+4
-633
lines changed

README.md

Lines changed: 2 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -10,178 +10,8 @@
1010
[![Dependency Status](https://david-dm.org/SAP/ui5-project/master.svg)](https://david-dm.org/SAP/ui5-project/master)
1111
[![devDependency Status](https://david-dm.org/SAP/ui5-project/master/dev-status.svg)](https://david-dm.org/SAP/ui5-project/master#info=devDependencies)
1212

13-
**⌨️ CLI reference can be found [here!](https://github.com/SAP/ui5-cli#cli-usage)**
14-
15-
## Configuration
16-
See [Configuration](docs/Configuration.md).
17-
18-
## Normalizer
19-
The purpose of the normalizer is to collect dependency information and to enrich it with project configuration (both done in [generateProjectTree](https://sap.github.io/ui5-tooling/module-@ui5_project.normalizer.html#.generateProjectTree)).
20-
21-
[Translators](#translators) are used to collect dependency information. The [Project Preprocessor](#project-preprocessor) enriches this dependency information with project configuration, typically from a `ui5.yaml` file. A development server and build process can use this information to locate project and dependency resources.
22-
23-
If you want to retrieve the project dependency graph without any configuration, you may use use the [generateDependencyTree](https://sap.github.io/ui5-tooling/module-@ui5_project.normalizer.html#.generateDependencyTree) API.
24-
25-
## Translators
26-
Translators collect recursively all dependencies on a package manager specific layer and return information about them in a well-defined tree structure.
27-
28-
**Tree structure as returned by a Translator:**
29-
````json
30-
{
31-
"id": "projectA",
32-
"version": "1.0.0",
33-
"path": "/absolute/path/to/projectA",
34-
"dependencies": [
35-
{
36-
"id": "projectB",
37-
"version": "1.0.0",
38-
"path": "/path/to/projectB",
39-
"dependencies": [
40-
{
41-
"id": "projectD",
42-
"path": "/path/to/different/projectD"
43-
}
44-
]
45-
},
46-
{
47-
"id": "projectD",
48-
"version": "1.0.0",
49-
"path": "/path/to/projectD"
50-
},
51-
{
52-
"id": "myStaticServerTool",
53-
"version": "1.0.0",
54-
"path": "/path/to/some/dependency"
55-
}
56-
]
57-
}
58-
````
59-
This dependency tree can be used as input for the [Project Preprocessor](#project-preprocessor):
60-
61-
### npm Translator
62-
The npm translator is currently the default translator and looks for dependencies defined in the `package.json` file of a certain project. `dependencies`, `devDepedencies`, and [napa dependencies](https://github.com/shama/napa) (Git repositories which don't have a `package.json` file) are located via the Node.js module resolution logic.
63-
64-
### Static Translator
65-
*This translator is currently intended for testing purposes only.*
66-
67-
Can be used to supply the full dependency information of a project in a single structured file.
68-
69-
**Example: `projectDependencies.yaml`**
70-
````yaml
71-
---
72-
id: testsuite
73-
version: ""
74-
path: "./"
75-
dependencies:
76-
- id: sap.f
77-
version: ""
78-
path: "../sap.f"
79-
- id: sap.m
80-
version: ""
81-
path: "../sap.m"
82-
````
83-
84-
This can be used via `ui5 serve -b static:/path/to/projectDependencies.yaml`
85-
86-
## Project Preprocessor
87-
Enhances a given dependency tree based on a projects [configuration](docs/Configuration.md).
88-
89-
**Enhanced dependency tree structure as returned by the Project Preprocessor:**
90-
````json
91-
{
92-
"id": "projectA",
93-
"version": "1.0.0",
94-
"path": "/absolute/path/to/projectA",
95-
"specVersion": "0.1",
96-
"type": "application",
97-
"metadata": {
98-
"name": "sap.projectA",
99-
"copyright": "Some copyright ${currentYear}"
100-
},
101-
"resources": {
102-
"configuration": {
103-
"paths": {
104-
"webapp": "app"
105-
}
106-
},
107-
"pathMappings": {
108-
"/": "app"
109-
}
110-
},
111-
"dependencies": [
112-
{
113-
"id": "projectB",
114-
"version": "1.0.0",
115-
"path": "/path/to/projectB",
116-
"specVersion": "0.1",
117-
"type": "library",
118-
"metadata": {
119-
"name": "sap.ui.projectB"
120-
},
121-
"resources": {
122-
"configuration": {
123-
"paths": {
124-
"src": "src",
125-
"test": "test"
126-
}
127-
},
128-
"pathMappings": {
129-
"/resources/": "src",
130-
"/test-resources/": "test"
131-
}
132-
},
133-
"dependencies": [
134-
{
135-
"id": "projectD",
136-
"version": "1.0.0",
137-
"path": "/path/to/different/projectD",
138-
"specVersion": "0.1",
139-
"type": "library",
140-
"metadata": {
141-
"name": "sap.ui.projectD"
142-
},
143-
"resources": {
144-
"configuration": {
145-
"paths": {
146-
"src": "src/main/uilib",
147-
"test": "src/test"
148-
}
149-
},
150-
"pathMappings": {
151-
"/resources/": "src/main/uilib",
152-
"/test-resources/": "src/test"
153-
}
154-
},
155-
"dependencies": []
156-
}
157-
]
158-
},
159-
{
160-
"id": "projectD",
161-
"version": "1.0.0",
162-
"path": "/path/to/projectD",
163-
"specVersion": "0.1",
164-
"type": "library",
165-
"metadata": {
166-
"name": "sap.ui.projectD"
167-
},
168-
"resources": {
169-
"configuration": {
170-
"paths": {
171-
"src": "src/main/uilib",
172-
"test": "src/test"
173-
}
174-
},
175-
"pathMappings": {
176-
"/resources/": "src/main/uilib",
177-
"/test-resources/": "src/test"
178-
}
179-
},
180-
"dependencies": []
181-
}
182-
]
183-
}
184-
````
13+
## Documentation
14+
Can be found here: [sap.github.io/ui5-tooling](https://sap.github.io/ui5-tooling/pages/Project/)
18515

18616
## Contributing
18717
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-tooling/blob/master/CONTRIBUTING.md).

docs/BuildExtensibility.md

Lines changed: 1 addition & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,2 @@
1-
![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-tooling/master/docs/images/UI5_logo_wide.png)
2-
31
# UI5 Build Extensibility
4-
5-
The UI5 Build Extensibility enables a developer to enhance the build process of any UI5 project. In addition to the [standard task list](https://github.com/SAP/ui5-builder/blob/master/README.md#tasks), custom tasks can be created.
6-
7-
## Configuration of the Custom Build Process
8-
9-
You can configure your build process with additional build task. The custom tasks can be defined in the project [configuration](https://github.com/SAP/ui5-project/blob/master/README.md#configuration) within the `ui5.yaml` file.
10-
11-
In the below example, when building the library `my.library` the `babel` task will be executed before the standard task `generateComponentPreload`. Another custom task called `generateMarkdownFiles` is then executed immediatly after the standard task `uglify`.
12-
13-
### Example: Configuration of project 'my.library'
14-
15-
````yaml
16-
---
17-
# In this example configuration two custom tasks are defined: 'babel' and 'generateMarkdownFiles'.
18-
specVersion: "1.0"
19-
type: library
20-
metadata:
21-
name: my.library
22-
builder:
23-
customTasks:
24-
- name: babel
25-
beforeTask: generateComponentPreload
26-
- name: generateMarkdownFiles
27-
afterTask: uglify
28-
configuration:
29-
color: blue
30-
````
31-
32-
### Example: Connect multiple custom tasks
33-
34-
You can also connect multiple custom task with each other. Please be aware that the order of your definitions is important. You have to make sure that the task is defined before you reference it as `beforeTask` or `afterTask`.
35-
36-
````yaml
37-
---
38-
# In this example 'myCustomTask2' gets executed after 'myCustomTask1'.
39-
specVersion: "1.0"
40-
type: library
41-
metadata:
42-
name: my.library
43-
builder:
44-
customTasks:
45-
- name: myCustomTask1
46-
beforeTask: generateComponentPreload
47-
- name: myCustomTask2
48-
afterTask: myCustomTask1
49-
````
50-
51-
## Custom Task Extension
52-
53-
A custom task extension consists of a `ui5.yaml` and a [task implementation](#task-implementation). It can be a standalone module or part of an existing UI5 project.
54-
55-
### Example: ui5.yaml
56-
57-
````yaml
58-
---
59-
specVersion: "1.0"
60-
kind: extension
61-
type: task
62-
metadata:
63-
name: generateMarkdownFiles
64-
task:
65-
path: lib/tasks/generateMarkdownFiles.js
66-
````
67-
68-
Task extensions can be **standalone modules** which are handled as dependencies.
69-
70-
On the other hand you can implement a task extension as **part of your UI5 project**. In that case, the configuration of the extension is part of your project configuration inside the `ui5.yaml` as shown below.
71-
72-
The task extension will then be automatically collected and processed during the processing of the project.
73-
74-
### Example: Custom Task Extension defined in UI5 project
75-
76-
````yaml
77-
# ui5.yaml configuration for the above example
78-
79-
specVersion: "1.0"
80-
kind: project
81-
type: library
82-
metadata:
83-
name: my.library
84-
builder:
85-
customTasks:
86-
- name: generateMarkdownFiles
87-
afterTask: uglify
88-
configuration:
89-
color: blue
90-
---
91-
# Task extension as part of your project
92-
specVersion: "1.0"
93-
kind: extension
94-
type: task
95-
metadata:
96-
name: generateMarkdownFiles
97-
task:
98-
path: lib/tasks/generateMarkdownFiles.js
99-
````
100-
101-
## Task Implementation
102-
103-
A custom task implementation needs to return a function with the following signature:
104-
105-
````javascript
106-
/**
107-
* Custom task example
108-
*
109-
* @param {Object} parameters Parameters
110-
* @param {module:@ui5/fs.DuplexCollection} parameters.workspace DuplexCollection to read and write files
111-
* @param {module:@ui5/fs.AbstractReader} parameters.dependencies Reader or Collection to read dependency files
112-
* @param {Object} parameters.options Options
113-
* @param {string} parameters.options.projectName Project name
114-
* @param {string} [parameters.options.configuration] Task configuration if given in ui5.yaml
115-
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
116-
*/
117-
module.exports = async function({workspace, dependencies, options}) {
118-
// [...]
119-
};
120-
````
121-
122-
The following code snippets shows an example how a task implementation could look like:
123-
124-
### Example: lib/tasks/generateMarkdownFiles.js
125-
126-
````javascript
127-
// Task implementation
128-
const markdownGenerator = require("./markdownGenerator");
129-
130-
module.exports = async function({workspace, dependencies, options}) {
131-
const textResources = await workspace.byGlob("**/*.txt");
132-
const markdownResources = await markdownGenerator({
133-
resources: textResources
134-
});
135-
await Promise.all(markdownResources.map((resource) => {
136-
return workspace.write(resource);
137-
}));
138-
};
139-
````
2+
This documentation moved to a new place: [sap.github.io/ui5-tooling/pages/extensibility/CustomTasks/](https://sap.github.io/ui5-tooling/pages/extensibility/CustomTasks/)

0 commit comments

Comments
 (0)