@sleekcms/sync 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/setup-site.js +8 -10
  2. package/package.json +1 -1
@@ -145,8 +145,11 @@ async function walkFiles(viewsDir) {
145
145
  * Push local edits via /save_files. Server enforces save order.
146
146
  *
147
147
  * Skip: file mtime matches cache → don't read, don't push.
148
- * After save, only overwrite the local file if its mtime is unchanged from
149
- * when we read it otherwise a newer local edit is pending and we'd clobber it.
148
+ * The server replies with success/error per file only it never echoes back a
149
+ * normalized copy, so local files are never rewritten on save. A failed save is
150
+ * recorded in sync-errors.log; a successful save clears that file's entry.
151
+ * Server-side normalization (resolved image objects, JSON frontmatter, entry
152
+ * refs, etc.) is reflected locally only on a full re-fetch.
150
153
  */
151
154
  async function pushLocalChanges(viewsDir, fileMap, apiBase, token) {
152
155
  const changes = [];
@@ -190,14 +193,9 @@ async function pushLocalChanges(viewsDir, fileMap, apiBase, token) {
190
193
  continue;
191
194
  }
192
195
  delete errors[c.rel];
193
- const finalContent = r.content ?? c.content;
194
- let finalMtime = c.stat.mtimeMs;
195
- const currentStat = await fs_extra_1.default.stat(c.full);
196
- if (currentStat.mtimeMs === c.stat.mtimeMs && finalContent !== c.content) {
197
- await fs_extra_1.default.outputFile(c.full, finalContent);
198
- finalMtime = (await fs_extra_1.default.stat(c.full)).mtimeMs;
199
- }
200
- fileMap[c.rel] = { mtimeMs: finalMtime };
196
+ // Record the mtime we pushed. The local file is left exactly as the
197
+ // user wrote it — we don't rewrite it with a server-normalized copy.
198
+ fileMap[c.rel] = { mtimeMs: c.stat.mtimeMs };
201
199
  console.log(`✅ ${c.prior ? "Updated" : "Created"} ${c.rel}`);
202
200
  pushed++;
203
201
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sleekcms/sync",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Edit SleekCMS sites locally — models, content, templates, images — with live two-way sync and AI agent support.",
5
5
  "keywords": [
6
6
  "sleekcms",