@abapify/adt-diff 0.0.0 → 0.3.6
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 +69 -1
- package/package.json +49 -3
package/README.md
CHANGED
|
@@ -1,3 +1,71 @@
|
|
|
1
1
|
# @abapify/adt-diff
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Diff CLI plugin for [`adt-cli`](https://github.com/abapify/adt-cli). Compares
|
|
4
|
+
local abapGit-serialised files (`*.clas.xml`, `*.tabl.xml`, …) against the
|
|
5
|
+
current source in a connected SAP system and prints a coloured unified diff.
|
|
6
|
+
Any object type supported by `@abapify/adt-plugin-abapgit` can be compared.
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/@abapify/adt-diff)
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm i @abapify/adt-diff
|
|
14
|
+
# or
|
|
15
|
+
bun add @abapify/adt-diff
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Register the command in `adt.config.ts`:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
// adt.config.ts
|
|
24
|
+
export default {
|
|
25
|
+
commands: ['@abapify/adt-diff/commands/diff'],
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then diff one or more files, or scan the whole abapGit repo in the working
|
|
30
|
+
directory:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Diff specific files
|
|
34
|
+
adt diff zcl_myclass.clas.xml ztab.tabl.xml
|
|
35
|
+
|
|
36
|
+
# Glob patterns
|
|
37
|
+
adt diff "*.tabl.xml" --context 5
|
|
38
|
+
|
|
39
|
+
# Scan the whole repo, ignoring unchanged objects
|
|
40
|
+
adt diff --package ZMY_PACKAGE
|
|
41
|
+
|
|
42
|
+
# Compare ADK-rendered source instead of raw XML (TABL only)
|
|
43
|
+
adt diff zmy_table.tabl.xml --source
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The package also exposes a small TABL-to-CDS DDL utility that is independent
|
|
47
|
+
of the diff command:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { tablXmlToCdsDdl, buildCdsDdl } from '@abapify/adt-diff';
|
|
51
|
+
|
|
52
|
+
const ddl = tablXmlToCdsDdl(xmlString);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Role in the monorepo
|
|
56
|
+
|
|
57
|
+
- CLI plugin loaded by `@abapify/adt-cli`; it owns the `diff` command only.
|
|
58
|
+
- Uses `@abapify/adk` to render local XML back to source and
|
|
59
|
+
`@abapify/adt-plugin-abapgit` to resolve filenames to ADT object URIs.
|
|
60
|
+
- Read-only: it never locks, writes, or imports objects. For round-tripping
|
|
61
|
+
objects into and out of the system, see `@abapify/adt-export` and the
|
|
62
|
+
relevant ADK save flow.
|
|
63
|
+
|
|
64
|
+
## Related
|
|
65
|
+
|
|
66
|
+
- [abapify/adt-cli monorepo](https://github.com/abapify/adt-cli)
|
|
67
|
+
- [Full docs](https://adt-cli.netlify.app)
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abapify/adt-diff",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
|
|
3
|
+
"version": "0.3.6",
|
|
4
|
+
"description": "Diff CLI plugin for adt-cli - compare local serialized files against SAP remote source",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./dist/index.mjs",
|
|
11
|
+
"types": "./dist/index.d.mts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./dist/index.mjs",
|
|
14
|
+
"./commands/diff": "./dist/commands/diff.mjs",
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"sap",
|
|
23
|
+
"adt",
|
|
24
|
+
"abap",
|
|
25
|
+
"diff",
|
|
26
|
+
"compare",
|
|
27
|
+
"abapgit"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@abapify/adk": "0.3.6",
|
|
31
|
+
"@abapify/adt-contracts": "0.3.6",
|
|
32
|
+
"@abapify/adt-plugin": "0.3.6",
|
|
33
|
+
"@abapify/adt-plugin-abapgit": "0.3.6",
|
|
34
|
+
"chalk": "^5.6.2",
|
|
35
|
+
"diff": "^8.0.3",
|
|
36
|
+
"fast-xml-parser": "^5.5.5"
|
|
37
|
+
},
|
|
38
|
+
"module": "./dist/index.mjs",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@abapify/adt-fixtures": "0.3.6"
|
|
41
|
+
},
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/abapify/adt-cli.git",
|
|
45
|
+
"directory": "packages/adt-diff"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/abapify/adt-cli/tree/main/packages/adt-diff#readme",
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/abapify/adt-cli/issues"
|
|
50
|
+
}
|
|
51
|
+
}
|