-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Open
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
Goal
Enable safe cleanup of leftover template files when switching between templates by introducing a manifest that tracks template-owned files.
Scope
- Define a
TemplateFilesproperty (or similar) in the template's sync metadata to store a list of relative paths for template-owned files - Templates are responsible for declaring their own manifest; the CLI reads it but does not generate it
- Implement manifest comparison logic during
SwitchTemplateAsyncto identify files that exist in the old template but not in the new one - Add an opt-in flag (e.g.,
--clean-leftoversor--clean) to the switch template command to enable deletion of orphaned template files - Respect existing
EntryModelPoliciesto ensure user content directories are never deleted - Gracefully handle templates without a manifest (older versions): cleanup is not possible, warn the user
Outcome
Users who switch templates will have the option to get a clean result without manually hunting down and removing obsolete files from the previous template. The default behavior remains safe (no deletion), preserving backward compatibility.
Notes
- The manifest is template-owned: each template declares which files belong to it
- If either the old or new template lacks a manifest, cleanup cannot be performed safely and the CLI should inform the user
- Consider whether the manifest should track file hashes to detect user modifications to template files (future enhancement)
- Related code:
ProjectService.SwitchTemplateAsync,KeystoneSyncModel,EntryModelPolicies.ExcludeUserContent
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request