Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Commit 937d2a1

Browse files
committed
Add content to README files and explain naming in more details as well as the tasks
1 parent a5a3b44 commit 937d2a1

File tree

4 files changed

+37
-7
lines changed

4 files changed

+37
-7
lines changed

src/reporter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This package contains the reporting mechanism.
44
The reporting mechanism is used to:
55
* collect Information about migration entries (findings)
6-
* create a report at the end of a migration/analysis, e.g. to dump it to the console
6+
* create a report at the end of a migration (analysis), e.g. as console dump
77

88
# Contents
99

src/tasks/README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
11
# About
22

33
This package contains tasks.
4-
A task is a procedure which can be executed by the migration tooling and operates on the contents of a source file.
4+
A task is a procedure which can be executed by the migration tooling and operates on the contents of
5+
a source file.
56
The content is parsed into an AST and passed to the task.
6-
It is used to:
7-
* `analyze`: checks the AST and gathers findings and creates an analysis
7+
It performs the following tasks in order:
8+
* `analyze`: checks the AST, gathers findings and creates an analysis
89
* `migrate`: works on the analysis of the AST and modifies it
910

1011
# Contents
1112

1213
It contains Task classes implementing the `Task` interface.
14+
* `addMissingDependencies`: find in the ast code usage where the dependency is missing from the
15+
`sap.ui.define`/`sap.ui.require` dependencies array. Very dynamic approach based on configuration
16+
of:
17+
* `finders` (scans the AST and looks for findings)
18+
* `replacers` (modifies the AST for a given finding)
19+
* `extenders` (manages the dependencies in the `sap.ui.define`/`sap.ui.require` call)
20+
21+
Is used when the replacement is more complex and not a straight forward way,
22+
e.g. such as a renaming or a simple global-call with module call replacement.
23+
* `addRenderers`: checks controls and adds a missing Renderer dependency if required.
24+
Is limited to controls and their renderers
25+
* `amdCleanup`: checks the AMD syntax and if none found wraps all code inside a new sap.ui.define
26+
call. Runs in the beginning before all other tasks (high priority), because the AMD syntax is
27+
required for the dependency handling.
28+
* `fixTypeDependency`: Scans the code for the usage of types, which are defined in the library and
29+
adds a dependency to the library and references the type.
30+
* `replaceGlobals`: Scans the code for global function calls, e.g. `jQuery.sap.log(...)` and
31+
replaces these by a module call.
32+
It handles the dependency and is semi-flexible, which means the dependency handling is static and
33+
the replacements are typical module replacements, but also more complex replacements can be
34+
performed.
35+
* `variableNamePrettifier`: Scans the newly introduced variables (from dependencies) and cleans them
36+
up, if there were naming conflicts variable names are made unique by appending a number,
37+
e.g. `jQuery` and `jQuery0` and when after all tasks were run `jQuery0` remains solely,
38+
this task will replace it with `jQuery`.
39+
It runs after all other tasks (low priority).
1340

1441
## Naming convention
1542

src/util/file/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ It aims to abstract and simplify file handling.
99

1010
## Naming convention
1111

12+
Filter - are used to reduce the elements in a given array. In this package the filters are used to
13+
reduce a set of filesystem files.
1214

13-
14-
## SubFolders

src/util/whitespace/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
This package contains whitespace classes and functionality.
44
It aims to reduce the whitespace noise between 2 strings.
55
Whitespace noise includes changes of whitespace characters.
6-
Whitespace characters are TAB, SPACE and NEWLINE.
6+
Whitespace characters are e.g. TAB, SPACE and NEWLINE.
77

88

99
# Contents
1010

1111

1212
## Naming convention
1313

14+
Strategy - represents an interchangeable way of performing a task. In this folder various strategies
15+
for handling whitespace differences were implemented.
16+
1417

1518

1619
## SubFolders

0 commit comments

Comments
 (0)