feat(api): add manifest field to CopyResult for lightweight file list#97
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
manifestfield toCopyResult— a lightweightArray<{ 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— addsManifestEntryinterface andmanifest: ManifestEntry[]toCopyResultwith full JSDoc and usage examplessrc/api/copy.js— derivesmanifestviafiles.map()in both the dry-run and normal code paths; adds@typedef ManifestEntryand updatesCopyResultJSDoctests/unit/api/copy.test.js— 8 new tests covering manifest shape, parity withresult.files, dry-run, file filtering, and zero-result edge casetests/types/api.test.ts— adds compile-time type assertions forManifestEntryDesign Notes
manifestis always populated (required, not optional) — consistent with it being available in every code path{ path: string, size: number }— nocontent,absolutePath, or other heavy fieldsfilesarray — negligible overheadresult.filesis unchanged (backwards compatible)