|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## What This Repo Does |
| 6 | + |
| 7 | +Generates SDKs for Aspose.BarCode Cloud REST API across 8 languages using OpenAPI Generator. Each SDK lives in a git submodule under `submodules/`. Templates and configs in `codegen/` control what gets generated. |
| 8 | + |
| 9 | +## Code Generation Pipeline |
| 10 | + |
| 11 | +``` |
| 12 | +spec/aspose-barcode-cloud.json (OpenAPI 3.0 spec) |
| 13 | + + codegen/config-<lang>.json (per-language config: versions, package names, URLs) |
| 14 | + + codegen/Templates/<lang>/*.mustache (customized mustache templates) |
| 15 | + → codegen/Tools/openapi-generator-cli.jar |
| 16 | + → codegen/.generated/<lang>/ (temp output) |
| 17 | + → submodules/<lang>/ (final SDK code) |
| 18 | + → make after-gen (formatting, linting, example insertion) |
| 19 | +``` |
| 20 | + |
| 21 | +Template variable reference: config JSON keys become `{{varName}}` in mustache templates. Original upstream templates are at https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/ |
| 22 | + |
| 23 | +## Key Commands |
| 24 | + |
| 25 | +```bash |
| 26 | +make sdk # Generate ALL SDKs |
| 27 | +make <lang> # Generate one SDK: android, dart, dotnet, go, java, node, php, python |
| 28 | +make update # Fetch latest API spec from Aspose Cloud |
| 29 | +make format # Format Python scripts with Black (line-length=120) |
| 30 | +``` |
| 31 | + |
| 32 | +Inside each `submodules/<lang>/`: |
| 33 | +```bash |
| 34 | +make test # Run SDK tests |
| 35 | +make after-gen # Post-generation: format, lint, insert examples, add deprecation warnings |
| 36 | +``` |
| 37 | + |
| 38 | +## Workflow for Changing SDK Code |
| 39 | + |
| 40 | +Per `Agents.md` — this is the required workflow: |
| 41 | + |
| 42 | +1. Make changes in the SDK submodule (`submodules/<lang>/`) |
| 43 | +2. Run `make test` in the submodule to verify |
| 44 | +3. Update the corresponding mustache template in `codegen/Templates/<lang>/` |
| 45 | +4. Stage your submodule changes, then run `make <lang>` from the repo root |
| 46 | +5. Verify there are no unstaged changes in the submodule (generated code must match your changes) |
| 47 | +6. Fix templates if generated code diverges |
| 48 | +7. Do NOT commit or push — only stage changes |
| 49 | + |
| 50 | +## Directory Mapping |
| 51 | + |
| 52 | +| Template dir | Config file | Submodule | Generator name | |
| 53 | +|------------------------------|-------------------------------|-----------------------|-----------------| |
| 54 | +| `codegen/Templates/android/` | `codegen/config-android.json` | `submodules/android/` | android | |
| 55 | +| `codegen/Templates/csharp/` | `codegen/config-dotnet.json` | `submodules/dotnet/` | csharp-netcore | |
| 56 | +| `codegen/Templates/dart/` | `codegen/config-dart.json` | `submodules/dart/` | dart | |
| 57 | +| `codegen/Templates/go/` | `codegen/config-go.json` | `submodules/go/` | go | |
| 58 | +| `codegen/Templates/java/` | `codegen/config-java.json` | `submodules/java/` | java | |
| 59 | +| `codegen/Templates/nodejs/` | `codegen/config-node.json` | `submodules/node/` | typescript-node | |
| 60 | +| `codegen/Templates/php/` | `codegen/config-php.json` | `submodules/php/` | php | |
| 61 | +| `codegen/Templates/python/` | `codegen/config-python.json` | `submodules/python/` | python | |
| 62 | + |
| 63 | +Note: template dir names don't always match submodule names (e.g., `csharp` vs `dotnet`, `nodejs` vs `node`). |
| 64 | + |
| 65 | +## Post-Generation Processing |
| 66 | + |
| 67 | +Large API files get split into per-request classes using Python helpers in `codegen/Tools/`: |
| 68 | +- `split-java-file.py`, `split-cs-file.py`, `split-php-file.py` |
| 69 | + |
| 70 | +Each language's `after-gen` runs: auto-formatting, example insertion (`scripts/insert-example.bash`), deprecation warning injection, and documentation formatting. |
| 71 | + |
| 72 | +## Release Process |
| 73 | + |
| 74 | +1. `./scripts/start-release.bash` — creates release branches, bumps versions in all `config-*.json` |
| 75 | +2. `make sdk` — regenerate all SDKs |
| 76 | +3. Push PRs, review, merge to main |
| 77 | +4. Tag releases as `vYY.MM`, publish to package registries |
| 78 | + |
| 79 | +Version format: `YY.MM.patch` (Go uses `4.YYMM.patch`, Dart uses `4.YY.MM`). Version updates are handled by `scripts/new-version.py`. |
| 80 | + |
| 81 | +## Requirements |
| 82 | + |
| 83 | +Java runtime (for openapi-generator-cli.jar), Python 3 (for scripts, Black formatter), Bash (WSL on Windows). Each SDK needs its own toolchain for `make test` / `make after-gen`. |
0 commit comments