Moved import/export event types and schemas to common#3110
Open
fredrikekelund wants to merge 4 commits intotrunkfrom
Open
Moved import/export event types and schemas to common#3110fredrikekelund wants to merge 4 commits intotrunkfrom
fredrikekelund wants to merge 4 commits intotrunkfrom
Conversation
Collaborator
📊 Performance Test ResultsComparing 8d11952 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
gcsecsey
approved these changes
Apr 17, 2026
Contributor
gcsecsey
left a comment
There was a problem hiding this comment.
Thanks for working on this @fredrikekelund! The refactor looks good to me overall, I added a non-blocking comment.
When testing import and export, everything still works as before. 👍
| Export | Import |
|---|---|
![]() |
![]() |
| } as const; | ||
|
|
||
| export const backupExtractProgressEventDataSchema = z.object( { | ||
| progress: z.number().optional(), |
Contributor
There was a problem hiding this comment.
Claude pointed out that progress wasn't optional in the old interface, and all call sites still provide it. We could use z.number() here.
1 task
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.


Related issues
How AI was used in this PR
For creating the type definitions that mapped import/export events to payload types, for the
ImportExportEventEmitterimplementation (including refactoring the classes that extend it), and for refactoringimport-manager.tsandexport-manager.tsto return event emitters instead of taking an event handler function as an argument.Proposed Changes
This is the first step towards refactoring Studio to depend on the CLI for import/export.
This PR adds Zod schemas (and inferred types) that map import/export event names to payload definitions. These are stored in
tools/commonso they're accessible to both the CLI and Studio.I'll be using these schemas to parse import/export events received in Studio over IPC from the CLI.
Testing Instructions
npm run cli:buildnode apps/cli/dist/cli/main.mjs export --path PATH_TO_SITEand ensure the command completes successfullynode apps/cli/dist/cli/main.mjs import --path PATH_TO_SITE IMPORT_FILEand ensure the command completes successfullyPre-merge Checklist