@abaplint/transpiler-cli 2.13.99 → 2.14.0

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 CHANGED
@@ -6,4 +6,65 @@ 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; 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.