Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Normalize line endings to LF for all text files (abapGit + tooling expect LF)
* text=auto eol=lf
*.abap text eol=lf
*.xml text eol=lf
*.json text eol=lf
*.jsonc text eol=lf
*.md text eol=lf
*.mjs text eol=lf
*.js text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
46 changes: 46 additions & 0 deletions .github/abaplint/abap_cloud.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"global": {
"files": "/../../src/**/*.*"
},
"dependencies": [
{
"url": "https://github.com/abapedia/steampunk-2305-api-intersect-702",
"folder": "/deps",
"files": "/src/**/*.*"
},
{
"url": "https://github.com/abap2UI5/abap2UI5",
"folder": "/abap2UI5",
"files": "/src/**/*.*"
},
{
"url": "https://github.com/abap2UI5-addons/popups",
"folder": "/popups",
"files": "/src/**/*.*"
},
{
"url": "https://github.com/abap2xlsx/abap2xlsx",
"folder": "/abap2xlsx",
"files": "/src/**/*.*"
}
],
"syntax": {
"version": "Cloud",
"errorNamespace": "."
},
"rules": {
"downport": true,
"begin_end_names": true,
"check_ddic": true,
"check_include": true,
"check_syntax": true,
"global_class": true,
"definitions_top": false,
"implement_methods": true,
"method_implemented_twice": true,
"parser_error": true,
"superclass_final": true,
"unknown_types": true,
"xml_consistency": true
}
}
63 changes: 63 additions & 0 deletions .github/abaplint/rename.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"global": {
"files": "/../../src/**/*.*"
},
"dependencies": [
{
"url": "https://github.com/abapedia/steampunk-2305-api-intersect-702",
"folder": "/deps",
"files": "/src/**/*.*"
},
{
"url": "https://github.com/abap2UI5/abap2UI5",
"folder": "/abap2UI5",
"files": "/src/**/*.*"
},
{
"url": "https://github.com/abap2UI5-addons/popups",
"folder": "/popups",
"files": "/src/**/*.*"
},
{
"url": "https://github.com/abap2xlsx/abap2xlsx",
"folder": "/abap2xlsx",
"files": "/src/**/*.*"
}
],
"rename": {
"output": "output",
"patterns": [
{
"type": "CLAS|INTF|TABL",
"oldName": "z2ui5_(.*)",
"newName": "zabap2ui5_$1"
}
]
},
"syntax": {
"version": "v750",
"errorNamespace": "."
},
"rules": {
"allowed_object_types": {
"allowed": [
"CLAS",
"DEVC",
"INTF",
"TABL"
]
},
"allowed_object_naming": true,
"begin_end_names": true,
"check_ddic": true,
"check_include": true,
"check_syntax": true,
"global_class": true,
"implement_methods": true,
"method_implemented_twice": true,
"parser_error": true,
"superclass_final": true,
"unknown_types": true,
"xml_consistency": true
}
}
26 changes: 26 additions & 0 deletions .github/workflows/ABAP_CLOUD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ABAP_CLOUD

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

concurrency:
group: ABAP_CLOUD-${{ github.ref }}
cancel-in-progress: true

jobs:
ABAP_CLOUD:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'npm'
- run: npm ci
- run: npx abaplint .github/abaplint/abap_cloud.jsonc
26 changes: 26 additions & 0 deletions .github/workflows/ABAP_STANDARD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ABAP_STANDARD

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

concurrency:
group: ABAP_STANDARD-${{ github.ref }}
cancel-in-progress: true

jobs:
ABAP_STANDARD:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'npm'
- run: npm ci
- run: npx abaplint ./abaplint.jsonc
101 changes: 101 additions & 0 deletions .github/workflows/build_rename.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: build_rename

# Renames all artifacts to a chosen namespace and pushes the result to
# the branch rename_<name>, e.g. rename_zmyui5 - ready to pull with
# abapGit for a parallel installation in the same SAP system. The
# renaming itself is the plain abaplint rename with the checked-in
# config .github/abaplint/rename.json (placeholder "zabap2ui5"); this
# workflow only sets the chosen name in the config and stores the
# result. Re-running with the same name updates the branch to the
# current main state; without content changes nothing is pushed. The
# main commit is carried as second parent so GitHub shows the branch as
# "ahead" instead of "behind" main.

on:
workflow_dispatch:
inputs:
namespace:
description: "New namespace (max. 9 characters), e.g. ZMYUI5"
required: true
type: string
default: zabap2ui5

permissions:
contents: write

concurrency:
group: build_rename-${{ inputs.namespace }}
cancel-in-progress: false

jobs:
build_rename:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
NAMESPACE: ${{ inputs.namespace }}
steps:
# validate the input and derive the branch name before building
- name: Derive branch name
run: |
if ! printf '%s' "$NAMESPACE" | grep -Eq '^[A-Za-z][A-Za-z0-9_]{0,8}$'; then
echo "::error::Invalid namespace '$NAMESPACE' (letter + letters/digits/underscore, max. 9 characters)"
exit 1
fi
ns=$(printf '%s' "$NAMESPACE" | tr '[:upper:]' '[:lower:]')
if [ "$ns" = "z2ui5" ]; then
echo "::error::Namespace '$NAMESPACE' is the original namespace - nothing to rename"
exit 1
fi
echo "NS=$ns" >> "$GITHUB_ENV"
echo "BRANCH=rename_$ns" >> "$GITHUB_ENV"
echo "Building branch: rename_$ns"

- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'npm'
- run: npm ci

# set the chosen name in the rename config and run the abaplint
# rename; it writes the renamed sources to
# .github/abaplint/output/<workspace path>/src
- name: Rename to ${{ inputs.namespace }}
run: |
sed "s/zabap2ui5/$NS/g" .github/abaplint/rename.json > .github/abaplint/rename_run.json
npx abaplint .github/abaplint/rename_run.json --rename

# branch content: the renamed src tree plus the abapGit descriptor
# and the license
- name: Assemble branch content
run: |
src=$(find .github/abaplint/output -type d -name src | head -n 1)
if [ -z "$src" ]; then
echo "::error::no renamed src folder found under .github/abaplint/output"
exit 1
fi
out=".github/out/$BRANCH"
rm -rf "$out"
mkdir -p "$out"
cp -r "$src" "$out/src"
cp LICENSE "$out/"
cp .abapgit.xml "$out/"

- name: Push renamed branch
run: |
b="$BRANCH"
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git fetch origin "$b" --depth 1 2>/dev/null || true
parent=$(git rev-parse -q --verify "refs/remotes/origin/$b" || true)
index="$RUNNER_TEMP/index-$b"
rm -f "$index"
(cd ".github/out/$b" && GIT_DIR="$GITHUB_WORKSPACE/.git" GIT_WORK_TREE=. GIT_INDEX_FILE="$index" git add -A)
tree=$(GIT_INDEX_FILE="$index" git write-tree)
if [ -n "$parent" ] && [ "$(git rev-parse "$parent^{tree}")" = "$tree" ]; then
echo "$b: no changes"
exit 0
fi
commit=$(git commit-tree "$tree" ${parent:+-p "$parent"} -p "$GITHUB_SHA" -m "build: $b from $GITHUB_SHA")
git push origin "$commit:refs/heads/$b"
echo "$b: pushed $commit"
26 changes: 26 additions & 0 deletions .github/workflows/rename_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: renaming

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

concurrency:
group: rename_test-${{ github.ref }}
cancel-in-progress: true

jobs:
rename_test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'npm'
- run: npm ci
- run: npm run rename
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
output
.github/out/
.github/abaplint/output/
.github/abaplint/rename_run.json
67 changes: 67 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# AGENTS.md — AI Assistant Guide for abap2UI5 table-content-loader

> This file follows the cross-tool AGENTS.md convention and is the single
> agent instruction file of this repository — Claude Code reads `AGENTS.md`
> natively, there is no separate `CLAUDE.md`.

## Project Overview

Upload, edit and download table content (JSON, CSV, XLSX) for
[abap2UI5](https://github.com/abap2UI5/abap2UI5) (`z2ui5_cl_tcl_*`).

**Language:** English — all code, comments, commit messages, PRs, issues and
documentation must be in English.

## Package Structure

| Package | Content |
|---|---|
| `src/` | App classes `z2ui5_cl_tcl_app_00` … `_06` |
| `src/01/z2ui5_cl_tcl_xlsx_api` | XLSX helper |
| `src/z2ui5_cl_tcl_context` | Vendored utility copy — **see below** |

## The Utility Copy Principle

`z2ui5_cl_tcl_context` is a **trimmed, renamed copy** of the abap2UI5 utility
class (`z2ui5_cl_util` in the core), carrying only the methods this addon uses
(conv/itab/json/xml/rtti helpers) plus the private helpers and char constants
those need. The app calls `z2ui5_cl_tcl_context=>…`, never `z2ui5_cl_util=>…`
directly. This keeps the install dependency-free (abapGit has no dependency
management). The core and the other addons use the same pattern. When a new
utility method is needed, copy it from the core utility class (with its private
helpers) into the context copy rather than adding a dependency.

## Dependencies

Installed alongside via abapGit; declared in the abaplint configs:

* [abap2UI5](https://github.com/abap2UI5/abap2UI5)
* [popups](https://github.com/abap2UI5-addons/popups)
* [abap2xlsx](https://github.com/abap2xlsx/abap2xlsx)

## Security

This is a developer tool. It reads from and writes to any table the user names,
without an authorization check of its own (the Z/Y namespace hint on write is
only a warning, not enforced). Before using it beyond a development system, add
your own `AUTHORITY-CHECK`s and restrict who may run the app.

## Coding Style

Follows the abap2UI5 core conventions (see its
[AGENTS.md](https://github.com/abap2UI5/abap2UI5/blob/main/AGENTS.md)): Clean
ABAP with Hungarian prefixes, backtick string literals, string templates
(`|…{ }…|`) instead of `&&`.

## Validation

Run `npx abaplint` before considering changes complete (config `abaplint.jsonc`,
0 issues expected). CI:

* `ABAP_STANDARD` / `ABAP_CLOUD` — lint against Standard ABAP and ABAP Cloud
* `renaming` (`rename_test.yaml`) — namespace-rename check
* `build_rename` — manual workflow that pushes a namespace-renamed branch
`rename_<name>` for a parallel install

There is no 702 downport: the abap2xlsx dependency has no `702` branch.
All `.abap`/`.xml`/config files are LF-only (`.gitattributes` enforces it).
Loading