Skip to content

feat(api): add manifest field to CopyResult for lightweight file list#97

Merged
gregpriday merged 1 commit into
developfrom
feature/issue-90-surface-included-file-list
Feb 26, 2026
Merged

feat(api): add manifest field to CopyResult for lightweight file list#97
gregpriday merged 1 commit into
developfrom
feature/issue-90-surface-included-file-list

Conversation

@gregpriday
Copy link
Copy Markdown
Owner

Summary

Adds a manifest field to CopyResult — a lightweight Array<{ path, size }> that lets programmatic API consumers (e.g. Canopy/Electron integrations) display file breakdowns without retaining full file content in memory.

Closes #90

Changes Made

  • types/index.d.ts — adds ManifestEntry interface and manifest: ManifestEntry[] to CopyResult with full JSDoc and usage examples
  • src/api/copy.js — derives manifest via files.map() in both the dry-run and normal code paths; adds @typedef ManifestEntry and updates CopyResult JSDoc
  • tests/unit/api/copy.test.js — 8 new tests covering manifest shape, parity with result.files, dry-run, file filtering, and zero-result edge case
  • tests/types/api.test.ts — adds compile-time type assertions for ManifestEntry

Design Notes

  • manifest is always populated (required, not optional) — consistent with it being available in every code path
  • Shape is { path: string, size: number } — no content, absolutePath, or other heavy fields
  • O(n) projection over the existing files array — negligible overhead
  • result.files is unchanged (backwards compatible)

- Add ManifestEntry interface (path + size, no content) to types/index.d.ts
- Add manifest: ManifestEntry[] to CopyResult — always populated in both
  normal and dry-run paths
- Derive manifest via files.map() in src/api/copy.js (O(n) projection,
  no content retained)
- Add JSDoc @typedef ManifestEntry and update CopyResult docs with
  usage examples
- Add 8 manifest tests to tests/unit/api/copy.test.js covering shape,
  parity with files, dry-run, filtering, and zero-result edge case
- Add ManifestEntry type assertions to tests/types/api.test.ts
@gregpriday gregpriday merged commit 8829a3f into develop Feb 26, 2026
11 of 15 checks passed
@gregpriday gregpriday deleted the feature/issue-90-surface-included-file-list branch February 26, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Surface included file list in CopyResult for programmatic API consumers

1 participant