[object Object]

← back to Microsite Engine

chore: lint, refactor, v0.2.1 (session close)

e01e000cb1337070eefc3f93645b5a2ce3ef7e80 · 2026-07-17 09:33:50 -0700 · Steve

- fix: delete-draft now also removes the orphaned <slug>.heroes.json companion
- refactor: drop dead static <option> (boot() fills #typeAdd); simplify
  wireTokenDatalist prefix slice (prefix.slice(0,-1))
- behavior verified unchanged in headless Chrome

Files touched

Diff

commit e01e000cb1337070eefc3f93645b5a2ce3ef7e80
Author: Steve <steve@designerwallcoverings.com>
Date:   Fri Jul 17 09:33:50 2026 -0700

    chore: lint, refactor, v0.2.1 (session close)
    
    - fix: delete-draft now also removes the orphaned <slug>.heroes.json companion
    - refactor: drop dead static <option> (boot() fills #typeAdd); simplify
      wireTokenDatalist prefix slice (prefix.slice(0,-1))
    - behavior verified unchanged in headless Chrome
---
 package.json      | 2 +-
 public/index.html | 4 ++--
 server.js         | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/package.json b/package.json
index dfde731..110a0c1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "microsite-engine",
-  "version": "0.2.0",
+  "version": "0.2.1",
   "private": true,
   "description": "Config-generator dashboard that drives the dw-domain-fleet — preview a niche live against the real catalog, emit a deploy-ready sites/<slug>.json. Never writes the live fleet, never deploys.",
   "main": "server.js",
diff --git a/public/index.html b/public/index.html
index 03a191f..ce21ec5 100644
--- a/public/index.html
+++ b/public/index.html
@@ -100,7 +100,7 @@
     <input id="neg" placeholder="type to search… commercial" autocomplete="off" list="negList">
     <datalist id="negList"></datalist>
     <label>Product types</label>
-    <select id="typeAdd"><option value="">+ add a product type…</option></select>
+    <select id="typeAdd"></select>
     <div class="chips" id="typeChips"></div>
 
     <div class="section-title">Look</div>
@@ -226,7 +226,7 @@ function wireTokenDatalist(input, list, vocab){
     const cut = val.lastIndexOf(',');
     const prefix = cut >= 0 ? val.slice(0, cut+1) : '';
     const typed  = val.slice(cut+1).trim().toLowerCase();
-    const chosen = new Set(val.slice(0, cut>=0?cut:0).split(',').map(s=>s.trim().toLowerCase()).filter(Boolean));
+    const chosen = new Set(prefix.slice(0,-1).split(',').map(s=>s.trim().toLowerCase()).filter(Boolean));
     const spacer = cut >= 0 ? ' ' : '';
     list.innerHTML = vocab
       .filter(v => !chosen.has(v.toLowerCase()))
diff --git a/server.js b/server.js
index 2df68b3..bb302a8 100644
--- a/server.js
+++ b/server.js
@@ -264,6 +264,7 @@ const server = http.createServer(async (req, res) => {
       const drafts = loadDrafts().filter(d => d.slug !== slug);
       saveDrafts(drafts);
       try { fs.unlinkSync(path.join(OUTPUT, slug + '.json')); } catch {}
+      try { fs.unlinkSync(path.join(OUTPUT, slug + '.heroes.json')); } catch {}
       return json(res, 200, { ok: true });
     }
     return send(res, 404, 'text/plain', 'not found');

← 92c9d7e auto-save: 2026-07-17T09:16:00 (2 files) — public/index.html  ·  back to Microsite Engine  ·  auto-save: 2026-07-17T10:16:09 (2 files) — public/index.html ad0025e →