abapgit-agent 1.11.2 → 1.11.3
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/abap/CLAUDE.md +13 -3
- package/abap/guidelines/objects.md +3 -0
- package/package.json +1 -1
- package/src/commands/init.js +40 -0
package/abap/CLAUDE.md
CHANGED
|
@@ -54,7 +54,7 @@ abapgit-agent ref --topic sql
|
|
|
54
54
|
abapgit-agent ref --list-topics
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
### 2. Read `.abapGitAgent` for Folder Location
|
|
57
|
+
### 2. Read `.abapGitAgent` for Folder Location and Naming Conventions
|
|
58
58
|
|
|
59
59
|
**Before creating ANY ABAP object file, you MUST read `.abapGitAgent` to determine the correct folder.**
|
|
60
60
|
|
|
@@ -67,6 +67,15 @@ The folder is configured in `.abapGitAgent` (property: `folder`):
|
|
|
67
67
|
- If `folder` is `/src/` → files go in `src/` (e.g., `src/zcl_my_class.clas.abap`)
|
|
68
68
|
- If `folder` is `/abap/` → files go in `abap/` (e.g., `abap/zcl_my_class.clas.abap`)
|
|
69
69
|
|
|
70
|
+
**Also check naming conventions before creating any new object:**
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
1. Check guidelines/objects.local.md ← project-specific overrides (if file exists)
|
|
74
|
+
2. Fall back to guidelines/objects.md ← default Z/Y prefix conventions
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`objects.local.md` is created by `abapgit-agent init` and is never overwritten by updates — it holds project-specific prefixes (e.g. `YCL_` instead of `ZCL_`).
|
|
78
|
+
|
|
70
79
|
---
|
|
71
80
|
|
|
72
81
|
### 3. Create XML Metadata / Local Classes
|
|
@@ -122,7 +131,7 @@ abapgit-agent pull --files src/zif_my_intf.intf.abap,src/zcl_my_class.clas.abap
|
|
|
122
131
|
|
|
123
132
|
---
|
|
124
133
|
|
|
125
|
-
### 5.
|
|
134
|
+
### 5. Local Helper / Test-Double Classes
|
|
126
135
|
|
|
127
136
|
→ See `guidelines/object-creation.md` for local class setup (`locals_def.abap` / `locals_imp.abap`)
|
|
128
137
|
|
|
@@ -367,7 +376,8 @@ Detailed guidelines are available in the `guidelines/` folder:
|
|
|
367
376
|
| `guidelines/testing.md` | Unit Testing (including CDS) |
|
|
368
377
|
| `guidelines/cds.md` | CDS Views |
|
|
369
378
|
| `guidelines/classes.md` | ABAP Classes and Objects |
|
|
370
|
-
| `guidelines/objects.md` | Object Naming Conventions |
|
|
379
|
+
| `guidelines/objects.md` | Object Naming Conventions (defaults) |
|
|
380
|
+
| `guidelines/objects.local.md` | **Project** Naming Conventions — overrides `objects.md` (created by `init`, never overwritten) |
|
|
371
381
|
| `guidelines/json.md` | JSON Handling |
|
|
372
382
|
| `guidelines/abapgit.md` | abapGit XML Metadata Templates |
|
|
373
383
|
| `guidelines/unit-testable-code.md` | Unit Testable Code Guidelines (Dependency Injection) |
|
|
@@ -8,6 +8,9 @@ grand_parent: ABAP Development
|
|
|
8
8
|
|
|
9
9
|
# ABAP Object Naming Conventions
|
|
10
10
|
|
|
11
|
+
> **Project-specific overrides**: Add your naming conventions to `guidelines/objects.local.md`.
|
|
12
|
+
> That file is never overwritten by `abapgit-agent init --update` and is searched by the `ref` command.
|
|
13
|
+
|
|
11
14
|
**Searchable keywords**: naming convention, Z prefix, namespace, object type, CLAS, INTF, PROG, TABL, DDLS
|
|
12
15
|
|
|
13
16
|
## TOPICS IN THIS FILE
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -43,6 +43,11 @@ async function copyGuidelinesFolder(srcPath, destPath, overwrite = false) {
|
|
|
43
43
|
|
|
44
44
|
for (const file of files) {
|
|
45
45
|
if (file.endsWith('.md')) {
|
|
46
|
+
// Never overwrite *.local.md files — these are project-specific customisations
|
|
47
|
+
if (file.endsWith('.local.md')) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
46
51
|
const srcFile = pathModule.join(srcPath, file);
|
|
47
52
|
const destFile = pathModule.join(destPath, file);
|
|
48
53
|
|
|
@@ -396,6 +401,41 @@ Examples:
|
|
|
396
401
|
} else {
|
|
397
402
|
console.log(`⚠️ guidelines/ already exists, skipped`);
|
|
398
403
|
}
|
|
404
|
+
|
|
405
|
+
// Create objects.local.md stub if not already present
|
|
406
|
+
const localNamingPath = pathModule.join(guidelinesDestPath, 'objects.local.md');
|
|
407
|
+
if (!fs.existsSync(localNamingPath)) {
|
|
408
|
+
const localNamingStub = `---
|
|
409
|
+
nav_order: 8
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
# Project Naming Conventions (Override)
|
|
413
|
+
|
|
414
|
+
This file overrides \`guidelines/objects.md\` for this project.
|
|
415
|
+
It is **never overwritten** by \`abapgit-agent init --update\` — safe to customise.
|
|
416
|
+
|
|
417
|
+
Searched by the \`ref\` command alongside all other guidelines.
|
|
418
|
+
|
|
419
|
+
## Naming Conventions
|
|
420
|
+
|
|
421
|
+
Uncomment and edit the rows that differ from the defaults in \`guidelines/objects.md\`:
|
|
422
|
+
|
|
423
|
+
| Object Type | Prefix | Example |
|
|
424
|
+
|---|---|---|
|
|
425
|
+
| Class | ZCL_ | ZCL_MY_CLASS |
|
|
426
|
+
| Interface | ZIF_ | ZIF_MY_INTERFACE |
|
|
427
|
+
| Program | Z | ZMY_PROGRAM |
|
|
428
|
+
| Package | $ | $MY_PACKAGE |
|
|
429
|
+
| Table | Z | ZMY_TABLE |
|
|
430
|
+
| CDS View | ZC_ | ZC_MY_VIEW |
|
|
431
|
+
| CDS Entity | ZE_ | ZE_MY_ENTITY |
|
|
432
|
+
| Data Element | Z | ZMY_ELEMENT |
|
|
433
|
+
| Structure | Z | ZMY_STRUCTURE |
|
|
434
|
+
| Table Type | Z | ZMY_TABLE_TYPE |
|
|
435
|
+
`;
|
|
436
|
+
fs.writeFileSync(localNamingPath, localNamingStub);
|
|
437
|
+
console.log(`✅ Created guidelines/objects.local.md (project naming conventions)`);
|
|
438
|
+
}
|
|
399
439
|
} else {
|
|
400
440
|
console.log(`⚠️ guidelines folder not found in abap/ directory`);
|
|
401
441
|
}
|