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.ts may 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
Related Issues
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:
index.tsmay be left empty or invalidProposed Behavior
When a move operation leaves the source project with no remaining exports:
export {}to the source project's entry point (index.ts)Example
Before move:
After moving lib/util.ts to lib-b:
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
export {}to source project's entry pointRelated Issues