Plan Your Visit landing page for visit.waterschurch.org
Next.js 16 static export + PHP 8 API for cPanel/Apache hosting. - Location-aware campus finder (IP estimate, optional precise location, ZIP search) - Three-step Plan Your Visit form with separate email/SMS consent - PHP API: validation, anti-spam, rate limiting, SQLite lead store, Mailchimp and Sinch Engage adapters, idempotent retries via cron - Attribution capture (utm_*, gclid/gbraid/wbraid, fbclid, ttclid, twclid) and consent-aware analytics hooks - Vitest and PHP test suites, cPanel deployment script and docs Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Creates dist/visit-waterschurch-<version>-<date>.zip from ./out for upload
|
||||
* through cPanel File Manager (Upload → Extract). Also copies private/.env.example
|
||||
* next to it as a reminder of what must be configured server-side.
|
||||
*/
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { promises as fs } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const OUT = path.join(ROOT, "out");
|
||||
const DIST = path.join(ROOT, "dist");
|
||||
|
||||
const pkg = JSON.parse(await fs.readFile(path.join(ROOT, "package.json"), "utf8"));
|
||||
const stamp = new Date().toISOString().slice(0, 10);
|
||||
await fs.mkdir(DIST, { recursive: true });
|
||||
const zip = path.join(DIST, `visit-waterschurch-${pkg.version}-${stamp}.zip`);
|
||||
await fs.rm(zip, { force: true });
|
||||
// -X strips extended attributes; -r recursive; . includes dot-files (.htaccess)
|
||||
execFileSync("zip", ["-X", "-r", zip, "."], { cwd: OUT, stdio: "inherit" });
|
||||
await fs.copyFile(path.join(ROOT, ".env.example"), path.join(DIST, "env.example.txt"));
|
||||
const size = (await fs.stat(zip)).size;
|
||||
console.log(`package: ${path.relative(ROOT, zip)} (${(size / 1024 / 1024).toFixed(1)} MB)`);
|
||||
Reference in New Issue
Block a user