@abaplint/transpiler-cli 2.13.100 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -1
- package/build/bundle.js +923 -235
- package/build/types.d.ts +6 -0
- package/package.json +3 -3
- package/schema.json +42 -0
- package/tsconfig.tsbuildinfo +1 -0
package/README.md
CHANGED
|
@@ -6,4 +6,92 @@ Transpiler CLI
|
|
|
6
6
|
|
|
7
7
|
Call `abap_transpile` on the command line, see example in
|
|
8
8
|
|
|
9
|
-
https://github.com/larshp/abap-advent-2020/blob/main/package.json#L8
|
|
9
|
+
https://github.com/larshp/abap-advent-2020/blob/main/package.json#L8
|
|
10
|
+
|
|
11
|
+
## Output layout
|
|
12
|
+
|
|
13
|
+
The CLI writes generated project files into `output_folder/project/`. All
|
|
14
|
+
`input_folder` entries belong to the same project, including an array of source
|
|
15
|
+
folders. Original ABAP sources stay in their input directories.
|
|
16
|
+
|
|
17
|
+
Each ABAP library gets its own folder under `output_folder`. The folder name is
|
|
18
|
+
the repository basename from `url` (without a trailing slash or `.git`), or the
|
|
19
|
+
basename of `folder` for a local-only library. Set `libs[].name` to override it:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"input_folder": ["src", "extra"],
|
|
24
|
+
"output_folder": "output",
|
|
25
|
+
"libs": [
|
|
26
|
+
{"url": "https://github.com/open-abap/open-abap-core"},
|
|
27
|
+
{"folder": "./deps/utilities", "name": "utilities"}
|
|
28
|
+
],
|
|
29
|
+
"write_unit_tests": true,
|
|
30
|
+
"write_source_map": true,
|
|
31
|
+
"options": {"addCommonJS": true}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
output/
|
|
37
|
+
init.mjs
|
|
38
|
+
_init.mjs
|
|
39
|
+
_top.mjs
|
|
40
|
+
index.mjs
|
|
41
|
+
_unit_open.mjs
|
|
42
|
+
project/
|
|
43
|
+
zapp.prog.mjs
|
|
44
|
+
zapp.prog.mjs.map
|
|
45
|
+
open-abap-core/
|
|
46
|
+
...
|
|
47
|
+
utilities/
|
|
48
|
+
...
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Names must be valid single directory names on Windows and POSIX. Names are
|
|
52
|
+
unique without regard to case, and `project` is reserved. A conflicting derived
|
|
53
|
+
name needs an explicit `libs[].name`. Duplicate ABAP objects across libraries
|
|
54
|
+
are rejected by default; a project object replaces a library object of the same type/name.
|
|
55
|
+
|
|
56
|
+
Class locals, test classes, function groups, MIME data, and
|
|
57
|
+
source maps follow their owning object. Source maps include ABAP source content,
|
|
58
|
+
including libraries loaded from temporary Git checkouts. Imports and registered
|
|
59
|
+
MIME filenames reference the new paths.
|
|
60
|
+
|
|
61
|
+
Shared initialization scripts and test runners remain at the output root.
|
|
62
|
+
Run programs with `node output/project/zapp.prog.mjs`; run project unit tests
|
|
63
|
+
with `node output/index.mjs`. When migrating from flat output, rebuild a clean
|
|
64
|
+
generated output directory and update scripts that reference individual
|
|
65
|
+
modules or assets. The CLI does not remove old generated files or unrelated
|
|
66
|
+
files automatically.
|
|
67
|
+
|
|
68
|
+
The transpiler library retains flat output unless its caller supplies an output
|
|
69
|
+
folder map as the third argument to `Transpiler.run()`. This layout is enabled
|
|
70
|
+
automatically by the CLI.
|
|
71
|
+
|
|
72
|
+
## Duplicate dependencies
|
|
73
|
+
|
|
74
|
+
By default, two libraries defining the same ABAP object (type and name) cause
|
|
75
|
+
an `Ambiguous dependency object` error. To keep existing dependency repositories
|
|
76
|
+
and skip later copies, set this top-level option in `abap_transpile.json`:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"skip_duplicate_dependencies": true
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The first library in `libs` containing an object wins. Every file of that
|
|
85
|
+
object in later libraries is skipped, including metadata, class locals, and
|
|
86
|
+
binary assets. The CLI warns once per skipped object per library, naming the
|
|
87
|
+
selected library. Imports, output folders, and source maps use the selected
|
|
88
|
+
copy. Project objects still take precedence over dependencies, and shared
|
|
89
|
+
`package.devc.xml` metadata keeps its existing behavior.
|
|
90
|
+
|
|
91
|
+
Library order now affects generated output. Different definitions can change
|
|
92
|
+
DDIC types, available methods, and runtime behavior, or cause syntax errors in
|
|
93
|
+
code expecting the skipped version. This option does not check that copies are
|
|
94
|
+
equivalent or suppress syntax checking. Put the intended provider first and
|
|
95
|
+
run your application's tests. For selective control, use `libs[].exclude_filter`
|
|
96
|
+
to exclude only the unwanted object's files instead. Use a clean generated
|
|
97
|
+
output directory when changing providers, since old output is not removed.
|