-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
When the move-file generator moves the last exported file from a source project, the source project's index file can become empty or have only an empty export. The generator should handle this case by ensuring the source project has a valid TypeScript module even when empty.
Current Behavior
After moving the last/only exported file from a source project:
- The source project's
index.tsmay be left empty or invalid - This can cause TypeScript compilation errors
- Build tools may fail on the now-empty project
Proposed Behavior
When a move operation leaves the source project with no remaining exports:
- Write
export {}to the source project's entry point (index.ts) - This creates a valid TypeScript module even when empty
- Prevents compilation/build errors
Example
Before move:
// lib-a/src/index.ts
export * from './lib/util';After moving lib/util.ts to lib-b:
// lib-a/src/index.ts
export {};Context
Discovered during implementation of e2e test scenarios in #333. The MOVE-SMALL scenario moves a file between libraries and exposes this edge case.
Acceptance Criteria
- Generator detects when source project has no remaining exports
- Generator writes
export {}to source project's entry point - Source project remains valid TypeScript module
- Builds succeed for both source and target projects
- Add test case for this scenario
Related Issues
- Parent: Adopt new end-to-end test plan #319 - Adopt new end-to-end test plan
- Discovered in: test(e2e): implement basic move scenarios #333 - Implement basic move scenarios
Metadata
Metadata
Assignees
Labels
No labels