Skip to content

fix: move export serialization to template-store.js#192

Open
JuliaKalder wants to merge 1 commit into
mainfrom
fix/issue-127
Open

fix: move export serialization to template-store.js#192
JuliaKalder wants to merge 1 commit into
mainfrom
fix/issue-127

Conversation

@JuliaKalder
Copy link
Copy Markdown
Owner

Summary

Moves the export payload schema construction out of the UI layer (options/options.js) into a dedicated exportTemplates() service function in modules/template-store.js.

Changes

  • Added exportTemplates() async function to modules/template-store.js that serialises the export payload with version, schemaVersion, exportedAt, and templates fields, including field sanitization (strips internal-only fields like id, usageCount, lastUsedAt, etc.)
  • Updated handleExport() in options/options.js to call exportTemplates() — DOM/download logic stays in UI layer
  • Replaced EXPORT_FORMAT_VERSION import in options.js with exportTemplates

Testing

  • Ran existing test suite (pre-existing failures on main are unrelated to this change)
  • Export format is unchanged; only the location of the serialization logic has moved

Fixes #127

Adds exportTemplates() to modules/template-store.js, consolidating the
export payload schema (version, schemaVersion, exportedAt, templates) and
field sanitization into the service layer. handleExport() in options.js
now delegates to exportTemplates() and only handles DOM/download logic.

Fixes #127
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.

[LOW] Export payload serialization schema embedded in options.js UI layer instead of template-store.js

1 participant