Release wave: no data collection, contact by email, deploy from src/

- Remove the request form, consent checkbox, honeypot, success dialog,
  form.js, analytics.js, the Yandex Metrica id and the cookie banner (D23).
- Contact is a mailto card to harveymonsterteam@gmail.com; privacy.html
  rewritten for "no data collected"; Google Fonts replaced by four
  self-hosted WOFF2 files, so the page makes no third-party request.
- Drop `summary` from the case contract: the project dialog shows the case
  body only, the planet plaque uses tagline, and a project without shots
  opens one honest slot instead of three fake ones.
- Restore the original voice and punctuation in 12 cards, strip internal
  wording from published copy, fix stale counts (20 projects, 5 releases).
- Deploy = contents of src/: api/ moved to archive/api/, new release gate
  scripts/check-release.mjs, deploy guide docs/deploy.md.
- Sync docs: AGENTS.md (D23, D8, R4 closed, structure), design/spec.md
  section 10.31, DESIGN.md, PRODUCT.md, INDEX.md, inventory.
This commit is contained in:
FastD committed 2026-11-15 17:34:40 +03:00
1 parent 76e6c2a294
commit 0ac596086a
52 files changed
+475 -660

No files matched your search

+76
View File
@@ -0,0 +1,76 @@
// check-release.mjs — гейт релиза: выгрузка = содержимое src/ и ничего больше.
// Проверяет: локальные пути из index.html и data/*.js существуют внутри src/,
// в поставляемых файлах нет запрещённых ссылок (Work_files, /api, внешние шрифты,
// сборщики аналитики, поля ввода), у скриптов стоит метка версии.
//
// Запуск: node scripts/check-release.mjs [YYYYMMDD]
// Exit 0 — можно выгружать; exit 1 — список нарушений.
import { readFileSync, existsSync, readdirSync, statSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
const SRC = join(ROOT, 'src');
const STAMP = process.argv[2] || '';
const errors = [];
function walk(dir) {
return readdirSync(dir).flatMap((f) => {
const p = join(dir, f);
return statSync(p).isDirectory() ? walk(p) : [p];
});
}
const files = walk(SRC);
const text = files.filter((f) => /\.(html|js|css|md)$/.test(f));
const rel = (f) => f.slice(ROOT.length + 1).replace(/\\/g, '/');
// 1. Запрещённые ссылки в поставляемых файлах.
const BANNED = [
[/Work_files/i, 'ссылка на Work_files (вне docroot)'],
[/contact\.php/i, 'PHP-эндпоинт формы'],
[/HM_YM_ID|mc\.yandex\.ru/i, 'Яндекс.Метрика'],
[/(fonts|ajax)\.googleapis\.com|fonts\.gstatic\.com/i, 'внешние шрифты'],
[/localhost|127\.0\.0\.1/i, 'локальный адрес'],
[/<form\b/i, 'поле ввода / форма'],
];
for (const f of text) {
const body = readFileSync(f, 'utf8');
for (const [re, why] of BANNED) {
if (re.test(body)) errors.push(`${rel(f)}: ${why}`);
}
}
// README в docroot тоже уходит на сервер: путь за пределы src/ оттуда убирается (остальное в них
// законно — команды с 127.0.0.1, имена исходников).
for (const f of files.filter((p) => /\.md$/.test(p))) {
if (/Work_files/i.test(readFileSync(f, 'utf8'))) {
errors.push(`${rel(f)}: ссылка на Work_files (вне docroot)`);
}
}
// 2. Каждый локальный путь страницы и данных существует внутри src/.
const index = readFileSync(join(SRC, 'index.html'), 'utf8');
const paths = new Set();
for (const m of index.matchAll(/(?:href|src)="([^"]+)"/g)) paths.add(m[1]);
for (const f of files.filter((p) => /data[\\/].*\.js$/.test(p))) {
for (const m of readFileSync(f, 'utf8').matchAll(/"(assets\/[^"]+)"/g)) paths.add(m[1]);
}
for (const raw of paths) {
const p = raw.split('?')[0];
if (!p || /^(https?:|mailto:|tel:|#|\/\/|data:)/.test(p)) continue;
const target = join(SRC, p.split('#')[0]);
if (!existsSync(target)) errors.push(`index.html: путь не найден — ${p}`);
}
// 3. Метка версии у скриптов: без неё сервер отдаёт сутки старый js (src/.htaccess, js/css = 1 day).
for (const m of index.matchAll(/<script src="([^"]+\.js)(?:\?v=(\d+))?"/g)) {
if (!m[2]) errors.push(`index.html: нет ?v= у ${m[1]}`);
else if (STAMP && m[2] !== STAMP) errors.push(`index.html: ${m[1]} ?v=${m[2]}, ожидается ${STAMP}`);
}
if (errors.length) {
console.log('FAIL');
for (const e of errors) console.log(' -', e);
process.exit(1);
}
console.log(`PASS: ${files.length} файлов, ${paths.size} путей, метка ${STAMP || 'не проверялась'}; выгрузка = src/`);
+8 -5
View File
@@ -3,16 +3,19 @@
// во вкладке — правки «не видны» до жёсткого reload (Ctrl+Shift+R). Здесь no-store,
// поэтому обычного F5 достаточно.
//
// Запуск: node scripts/dev-server.mjs [порт] (по умолчанию 8765)
// Страница: http://127.0.0.1:8765/src/
// Запуск: node scripts/dev-server.mjs [порт] [корень] (по умолчанию 8765, корень = репозиторий)
// Страница: http://127.0.0.1:8765/src/ · форма деплоя: node scripts/dev-server.mjs 8765 src → http://127.0.0.1:8765/
import { createServer } from 'node:http';
import { createReadStream } from 'node:fs';
import { stat } from 'node:fs/promises';
import { extname, join, normalize } from 'node:path';
import { extname, join, normalize, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const ROOT = fileURLToPath(new URL('..', import.meta.url));
const PORT = Number(process.argv[2]) || 8765;
// Корень можно задать вторым аргументом: так проверяется форма деплоя (docroot = src/).
const ROOT_ARG = process.argv[3];
const ROOT = ROOT_ARG ? resolve(ROOT_ARG) : fileURLToPath(new URL('..', import.meta.url));
const PAGE = ROOT_ARG ? '/' : '/src/';
const TYPES = {
'.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8',
'.css': 'text/css; charset=utf-8', '.json': 'application/json; charset=utf-8',
@@ -38,5 +41,5 @@ createServer(async (req, res) => {
res.end('404');
}
}).listen(PORT, '127.0.0.1', () => {
console.log(`dev (no-cache): http://127.0.0.1:${PORT}/src/`);
console.log(`dev (no-cache): http://127.0.0.1:${PORT}${PAGE}`);
});
+3 -3
View File
@@ -17,7 +17,8 @@ const OUT = join(ROOT, 'src', 'data');
// Supports: scalar `key: value`, inline list `key: [a, b]`,
// block list `key:` + indented `- a` lines, block map `key:` + indented ` sub: v`.
function parseFrontmatter(path) {
const raw = readFileSync(path, 'utf8').replace(/^\uFEFF/, '');
// CRLF → LF on read: смешанные концы строк в content/ иначе уезжают \r в src/data/*.js.
const raw = readFileSync(path, 'utf8').replace(/^\uFEFF/, '').replace(/\r\n/g, '\n');
const m = raw.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
const meta = {};
const body = m ? m[2] : raw;
@@ -156,8 +157,7 @@ function loadProjects() {
images: toList(meta.images).map(sitePath),
media: String(meta.media || ''), // 'portrait' — скриншоты 9:16: карточка и окно дают бокс выше
metrics: (meta.metrics && typeof meta.metrics === 'object') ? meta.metrics : '',
summary: coerce(meta.summary),
tagline: coerce(meta.tagline), // одна строка под заголовком карточки; summary живёт в окне
tagline: coerce(meta.tagline), // одна строка карточки + сводка в плашке планеты (D23)
detail: publicDetail(body),
};
out.push(p);