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
69 changes: 69 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Tests

on:
workflow_dispatch:
push:
paths:
- 'tools/cli-fp-gen/**'
- 'tests/**'
- 'src/**'
- '.github/workflows/tests.yml'
pull_request:
paths:
- 'tools/cli-fp-gen/**'
- 'tests/**'
- 'src/**'
- '.github/workflows/tests.yml'

permissions:
contents: read

jobs:
linux:
name: Linux / FPC
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install Free Pascal
run: |
sudo apt-get update
sudo apt-get install -y fp-compiler fp-units-fcl python3
- name: Framework Unit Tests
run: bash tests/run_tests.sh
- name: Generator Unit Tests
run: bash tests/codegen/run_unit_tests.sh
- name: Golden Output Test
run: bash tests/codegen/run_golden_test.sh
- name: Generator Ops Test
run: bash tests/codegen/run_ops_test.sh
- name: Compile Smoke Test
run: bash tests/codegen/run_compile_smoke.sh

windows:
name: Windows / FPC
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Install Free Pascal toolchain
shell: powershell
run: |
choco install lazarus --version=4.0.0 --yes --no-progress
$FpcRoot = 'C:\lazarus\fpc\3.2.2'
$FpcBin = Join-Path $FpcRoot 'bin\x86_64-win64'
$ConsoleRunner = Join-Path $FpcRoot 'units\x86_64-win64\fcl-fpcunit\consoletestrunner.ppu'
if (-not (Test-Path -LiteralPath $ConsoleRunner)) {
throw "Lazarus toolchain is missing FPCUnit console runner: $ConsoleRunner"
}
$FpcBin |
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
& (Join-Path $FpcBin 'fpc.exe') -iV
& (Join-Path $FpcBin 'fpc.exe') -iTP
& (Join-Path $FpcBin 'fpc.exe') -iTO
- name: Framework Unit Tests
shell: powershell
run: powershell -ExecutionPolicy Bypass -File tests\run_tests.ps1
- name: Codegen Test Suite
shell: powershell
run: powershell -ExecutionPolicy Bypass -File tests\codegen\run_all_tests.ps1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ link.res
*.dll
*.so
*.dylib
/tools/cli-fp-gen/cli_fp_gen
/build-temp/

# Backup files
*.bak
Expand All @@ -26,6 +28,7 @@ link.res
# Lazarus specific
backup/
lib/
/packagefiles.xml
*.lrs
*.lrt
*.lps
Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,52 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.0] - 2026-07-27

### Added

- Added `cli-fp-gen`, a standalone scaffold generator for creating `cli-fp`
applications from a versioned `clifp.json` project specification.
- Added `init`, `generate`, `add command`, and `remove command` workflows,
including nested commands, cascade removal, dry-run previews, and controlled
force-overwrite behavior.
- Added generated application entry points, command registries, parameter
registration for every supported parameter kind, and user-owned command
stubs.
- Added a generated-file manifest for safe stale-file cleanup when generated
paths change.
- Added full generator documentation from the main README, including project
layout, file ownership, build instructions, and local verification commands.

### Fixed

- `cli-fp-gen`: Schema version mismatch error message now includes a prompt to check the migration documentation, making it actionable when a future `schemaVersion` is encountered.
- `cli-fp-gen`: `init` now protects an existing `clifp.json` unless `--force` is supplied.
- `cli-fp-gen`: Command names containing path separators are rejected instead of being silently rewritten.
- `cli-fp-gen`: Commands that collapse to the same generated Pascal identifier are rejected with a targeted error.
- `cli-fp-gen`: Reserved Pascal words used as application names now produce valid program identifiers.
- `cli-fp-gen`: Manifest cleanup now uses platform-appropriate path casing and refuses similarly named sibling directories on case-sensitive filesystems.
- `cli-fp-gen`: Manifest cleanup now refuses stale-file paths that traverse Unix symbolic links or Windows reparse points, including directory junctions.
- `cli-fp-gen`: Malformed project specifications now release partially constructed commands and parameters safely.
- Boolean parameter lookups now report defaults as available values, matching the public API contract.

### Improved

- Duplicate command names under the same parent now produce a targeted error
naming the conflicting sibling and parent.
- `--dry-run` help text now includes example output so file operations are clear
before execution.
- `cli-fp-gen`: Command-name validation preserves invalid input so diagnostics can report the original name.
- `cli-fp-gen`: `MakeProgramFileRelPath` is documented to note that the generated `.lpr` filename uses PascalCase, which must be matched exactly in build scripts on case-sensitive filesystems (Linux/macOS).

### Testing

- Added a Windows PowerShell verification path for `cli-fp-gen` in `tests/codegen/run_all_tests.ps1`.
- Added focused FPCUnit coverage for generator naming, validation, malformed-spec error handling, and exception-safe ownership.
- GitHub Actions now runs the framework suite plus generator unit, golden-output, lifecycle, ownership, path-safety, and generated-app compile checks on Linux and Windows.
- Added Unix symbolic-link and Windows directory-junction regression tests for manifest cleanup.
- Code generator documentation now includes both the Bash test scripts and the PowerShell verification command.

## [1.1.6] - 2026-02-21

### Added
Expand Down Expand Up @@ -246,5 +292,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- README with quick start guide
- System requirements and compatibility information

[Unreleased]: https://github.com/ikelaiah/cli-fp/compare/v1.2.0...HEAD
[1.2.0]: https://github.com/ikelaiah/cli-fp/compare/v1.1.6...v1.2.0
[1.0.0]: https://github.com/ikelaiah/cli-fp/releases/tag/v1.0.0

10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ Enhancement suggestions are tracked as GitHub issues. When creating an enhanceme

## Testing

* Run the test suite with `runtests.pas`
* Run the framework test suite with `bash tests/run_tests.sh` on Linux/macOS
or `powershell -ExecutionPolicy Bypass -File tests\run_tests.ps1` on Windows
* Run the code-generator suite with `bash tests/codegen/run_unit_tests.sh`,
`bash tests/codegen/run_golden_test.sh`, `bash tests/codegen/run_ops_test.sh`,
and `bash tests/codegen/run_compile_smoke.sh` on Linux/macOS, or
`powershell -ExecutionPolicy Bypass -File tests\codegen\run_all_tests.ps1`
on Windows
* Add test cases for new functionality
* Ensure existing tests pass

Expand All @@ -72,4 +78,4 @@ Enhancement suggestions are tracked as GitHub issues. When creating an enhanceme
* Feel free to open an issue for discussion
* Contact the maintainers directly

Thank you for your contribution! 🚀
Thank you for your contribution! 🚀
Loading