-
Audit input directories
- Confirm absolute paths for
Trait FilesandTrait Files Oldrelative to the repo root. - List their subdirectory structures to ensure the comparison covers the nested
Sprites/tree.
- Confirm absolute paths for
-
Design comparison strategy
- Normalize relative paths from each root so matches account for identical subfolder layouts.
- Decide whether to include non-file entries (e.g., directories, hidden files) or filter by extensions such as
.png.
-
Implement diff script
- Create a TypeScript Node script (e.g.,
scripts/compare-traits.ts) that recursively walks both directories usingfs/promises. - Store file inventories in
Set<string>collections keyed by relative path forTrait FilesandTrait Files Old. - Compute differences to highlight files missing from the new folder (present only in the old set); optionally include the inverse diff for completeness.
- Provide a CLI interface to override directory paths, defaulting to the two trait folders.
- Create a TypeScript Node script (e.g.,
-
Output results
- Log missing file paths grouped by subdirectory to the console and optionally write them to a timestamped report (e.g.,
reports/trait-mismatch.json) for auditing. - Exit with a non-zero status if missing files are detected, enabling CI integration.
- Log missing file paths grouped by subdirectory to the console and optionally write them to a timestamped report (e.g.,
-
Validation
- Dry run the script locally and verify it detects representative missing files by temporarily removing known assets.
- Document usage in
READMEor within the script header comment for future reference.
- Should the script ignore specific file types or metadata files (e.g.,
.DS_Store, JSON manifests), or should it diff every filesystem entry?
Yeah you can ignore DS_STORE and metadata.
- Do you only need the list of files missing from
Trait Files, or should the script also flag files that exist only in the new folder?
Both, missing and new ones.
- Is a console report sufficient, or would you prefer the script to emit a structured file (JSON/CSV) for downstream tooling?
A JSON export would be great.