Skip to content

Conversation

@carlbrugger
Copy link
Contributor

Overview

This PR introduces a new plugin for reconfiguring existing Flatfile spaces by updating existing workbooks and creating new ones as needed.

Key Features

  • Smart Workbook Matching: Matches workbook configurations to existing workbooks by name
  • Update Existing: Updates matched workbooks with new configurations instead of creating duplicates
  • Create New: Creates new workbooks for unmatched configurations
  • Space Management: Updates space settings and maintains workbook order
  • Progress Tracking: Provides detailed progress updates during reconfiguration
  • Callback Support: Supports post-reconfiguration callbacks for custom logic

Architecture

The plugin follows the same patterns as plugin-space-configure but focuses on reconfiguration rather than initial setup.

Test Coverage

  • Unit Tests: Workbook matching logic with 6 comprehensive test cases
  • E2E Tests: Initial space configuration, workbook reconfiguration scenarios, new workbook creation, space settings updates, callback function execution, workbook order maintenance

All tests pass successfully, confirming the plugin is ready for production use.

- Add new plugin for reconfiguring existing Flatfile spaces
- Supports updating existing workbooks by name matching
- Creates new workbooks for unmatched configurations
- Maintains space settings and workbook order
- Includes comprehensive e2e and unit tests
- Follows same patterns as space-configure plugin

Amp-Thread: https://ampcode.com/threads/T-b676df3e-c4b9-4113-81c9-e6dfe80ddd97
Co-authored-by: Amp <amp@ampcode.com>
@promptless
Copy link

promptless bot commented Jul 7, 2025

📝 Documentation updates detected!

New suggestion: Add comprehensive documentation for @flatfile/plugin-space-reconfigure plugin

carlbrugger and others added 6 commits July 14, 2025 20:58
- Add workbook deletion for workbooks not in new configuration
- Add sheet matching utility for future sheet-level operations
- Update workbook matching to track deletions
- Add comprehensive tests for deletion scenarios
- Update README to document deletion behavior
- Ensure proper cleanup of removed workbooks during reconfiguration

Amp-Thread: https://ampcode.com/threads/T-b676df3e-c4b9-4113-81c9-e6dfe80ddd97
Co-authored-by: Amp <amp@ampcode.com>
- Add document matching utility to match by title
- Implement document update, delete, and create operations
- Add comprehensive document CRUD tests (8 test cases)
- Update e2e tests with document CRUD scenarios
- Handle case where no documents in config (deletes all existing)
- Update README with document CRUD documentation and examples
- Ensure setupFactory is authoritative source of truth for documents

Amp-Thread: https://ampcode.com/threads/T-b676df3e-c4b9-4113-81c9-e6dfe80ddd97
Co-authored-by: Amp <amp@ampcode.com>
- Add test for maintainWorkbookOrder with workbook deletions
- Add comprehensive test for complete space reconfiguration with all resource types
- Add test for empty configuration (delete everything scenario)
- Ensure workbook order is maintained correctly when workbooks are deleted
- Test integration between workbook and document CRUD operations
- Cover edge cases like empty workbooks and documents arrays
- Verify space settings updates work with resource deletions

Amp-Thread: https://ampcode.com/threads/T-b676df3e-c4b9-4113-81c9-e6dfe80ddd97
Co-authored-by: Amp <amp@ampcode.com>
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.

3 participants