[object Object]

← back to Dw Signup Fulfillment

chore: lint + refactor golive-preflight (query-preserve, visible write-fail, crash guard), v0.1.4 (session close)

5b98c35d58f512eda463ad3e73c26e43e74e6828 · 2026-08-14 14:01:45 -0700 · steve

Files touched

Diff

commit 5b98c35d58f512eda463ad3e73c26e43e74e6828
Author: steve <steve@designerwallcoverings.com>
Date:   Fri Aug 14 14:01:45 2026 -0700

    chore: lint + refactor golive-preflight (query-preserve, visible write-fail, crash guard), v0.1.4 (session close)
---
 package.json                | 2 +-
 scripts/golive-preflight.js | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/package.json b/package.json
index 708417a..2118c05 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "dw-signup-fulfillment",
-  "version": "0.1.3",
+  "version": "0.1.4",
   "private": true,
   "description": "DW signup/sample/rep fulfillment: retail gift-code + trade approval + rep round-robin. DRY_RUN by default.",
   "type": "commonjs",
diff --git a/scripts/golive-preflight.js b/scripts/golive-preflight.js
index 28e1fff..54a9a9b 100644
--- a/scripts/golive-preflight.js
+++ b/scripts/golive-preflight.js
@@ -23,7 +23,7 @@ function getJSON(url, headers) {
   return new Promise((resolve) => {
     let u;
     try { u = new URL(url); } catch (e) { return resolve({ status: 0, error: e.message }); }
-    const req = http.request({ hostname: u.hostname, port: u.port || 80, path: u.pathname, method: 'GET', headers }, (res) => {
+    const req = http.request({ hostname: u.hostname, port: u.port || 80, path: u.pathname + (u.search || ''), method: 'GET', headers }, (res) => {
       let d = ''; res.on('data', (c) => (d += c));
       res.on('end', () => resolve({ status: res.statusCode, body: d.slice(0, 200) }));
     });
@@ -79,7 +79,10 @@ async function main() {
 
   const worst = checks.some((c) => c.level === 'FAIL') ? 'FAIL' : checks.some((c) => c.level === 'WARN') ? 'WARN' : 'PASS';
   const out = { skill: 'dw-signup-golive-preflight', verdict: worst, status: worst, checked_at: new Date().toISOString(), checks };
-  try { fs.mkdirSync(path.join(__dirname, '..', 'data'), { recursive: true }); fs.writeFileSync(path.join(__dirname, '..', 'data', 'latest.json'), JSON.stringify(out, null, 2)); } catch (e) {}
+  try {
+    fs.mkdirSync(path.join(__dirname, '..', 'data'), { recursive: true });
+    fs.writeFileSync(path.join(__dirname, '..', 'data', 'latest.json'), JSON.stringify(out, null, 2));
+  } catch (e) { console.error('WARNING: could not write data/latest.json:', e.message); }
 
   console.log(`\nOption C go-live preflight — verdict: ${worst}\n`);
   for (const c of checks) console.log(`  ${c.level === 'PASS' ? '✅' : c.level === 'WARN' ? '🟠' : '❌'} ${c.name.padEnd(18)} ${c.detail}`);
@@ -87,4 +90,4 @@ async function main() {
   console.log('wrote data/latest.json');
   process.exit(worst === 'FAIL' ? 1 : 0);
 }
-main();
+main().catch((e) => { console.error('Preflight crashed:', e.message); process.exit(2); });

← d292c26 DEPLOY.md: point pre-flight at golive-preflight.js + link th  ·  back to Dw Signup Fulfillment  ·  auto-data-snapshot: 2026-08-14T14:26:13 (1 data files) — pac aa70472 →