Skip to content

feat: glob-based copy_to_workspace for fixture seeding - #8

Merged
devzeebo merged 3 commits into
mainfrom
feat/copy-to-workspace
Aug 30, 2026
Merged

feat: glob-based copy_to_workspace for fixture seeding#8
devzeebo merged 3 commits into
mainfrom
feat/copy-to-workspace

Conversation

@devzeebo

@devzeebo devzeebo commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds copy_to_workspace(workspace, globs, options?) so specs can seed the temp workspace from fixture globs instead of one-off writeFile calls (#6).
  • Globs resolve from the current Vitest spec directory (overridable with from); optional base strips a matching path prefix. Empty globs and base mismatches throw before copying.
  • Documents the helper in the README and covers preserve-structure, strip-base, multi-glob, nested dirs, errors, and default from.

Test plan

  • pnpm test — unit suite including copy_to_workspace cases
  • Confirm a given step can copy fixtures/** into this.workspace without passing from
  • Confirm base: "fixtures/*" drops the first two path segments
  • Confirm a non-matching glob and a non-matching base throw and leave the workspace empty

@devzeebo devzeebo linked an issue Aug 30, 2026 that may be closed by this pull request
8 tasks

@devzeebo devzeebo left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes from review: destination collisions are skipped silently, from is cwd-resolved (README example is misleading), empty globs is a no-op, destinations are not confined to workspace, Vitest is a static optional-peer import, and glob expansion walks the entire from tree. Error tests also do not assert that nothing was copied. Fixing these on the branch next.

Comment thread src/given/copy_to_workspace.ts Outdated
Comment thread src/given/copy_to_workspace.ts Outdated
Comment thread src/given/copy_to_workspace.ts Outdated
Comment thread src/given/copy_to_workspace.ts
Comment thread src/given/copy_to_workspace.ts
Comment thread src/given/copy_to_workspace.ts Outdated
Comment thread src/given/copy_to_workspace.spec.ts
Comment thread README.md Outdated
@devzeebo devzeebo closed this Aug 30, 2026
@devzeebo devzeebo reopened this Aug 30, 2026
@devzeebo
devzeebo merged commit f70532f into main Aug 30, 2026
6 checks passed
@devzeebo
devzeebo deleted the feat/copy-to-workspace branch August 30, 2026 15:23
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.

Glob-based copy helpers for seeding the workspace from fixtures

1 participant