itube-specs 0.0.1003 → 0.0.1004

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.
@@ -0,0 +1,32 @@
1
+ # Что сделать в сайтах после обновления слоя
2
+
3
+ Только то, что каждый сайт должен сделать у себя после `npm run spec`: объявить новую сущность, поправить
4
+ свою логику, удалить файлы, переехавшие в слой. Описание изменений слоя — в истории git, не здесь.
5
+
6
+ Сайт после `npm run spec` видит записи между своей прошлой и новой версией:
7
+ `node node_modules/itube-specs/scripts/site-updates.mjs`.
8
+
9
+ Пишет тот, кто меняет слой, в том же коммите. Новые записи — сверху, в секцию `## Unreleased` (одна на все
10
+ коммиты до бампа); `npm run patch` сам проставит ей номер версии. Формат пункта: что сделать и где,
11
+ кому именно (всем / сайтам с N), что будет, если не сделать.
12
+
13
+ ## 0.0.1001 — 2026-10-06
14
+
15
+ - **Всем:** удалить свои `public/img/model-placeholder-{portrait,square}.{webp,avif}` и
16
+ `model-placeholder-female-*`, если есть. Заглушки моделей теперь в слое
17
+ (`public/img/model-placeholder/<niche>-<theme>-<shape>`), старые пути слой больше не запрашивает.
18
+ Свой вариант картинки — файлом с тем же новым путём в `public/` сайта.
19
+
20
+ ## 0.0.1000 — 2026-10-06
21
+
22
+ - **Сайтам с несколькими нишами, у которых ниша в URL не равна её коду** (`/gays` вместо `/gay`): одна
23
+ константа слагов → `nicheSlugs` в `app.config.ts` и `slugs` в `addNicheAliases` (`NEW_SITE_CHECKLIST.md` §3a).
24
+ Остальным — ничего.
25
+
26
+ ## 0.0.999 — 2026-10-06
27
+
28
+ - **Всем:** флага нет в `config/feature-flags.config.ts` — фича выключена, дефолтов у слоя нет. Перечислить
29
+ все флаги явно по карте в `NEW_SITE_CHECKLIST.md` §4. Заглушки без бекенда (`FeatureFollowEnabled`,
30
+ `FeatureHistoryEnabled`, `FeatureFavoritesEnabled`, `FeatureWatchLaterEnabled`, `FeatureLiveEnabled`) — на
31
+ боевом сайте включать только осознанно; при выключенном флаге их страницы отдают 404.
32
+ - **Всем:** `FeatureMomentsEnabled` и `SponsoredEnabled` слой не читает — можно убрать.
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.1003",
4
+ "version": "0.0.1004",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
8
8
  "prepublishOnly": "npm install && npx nuxi prepare",
9
9
  "patch": "npm version patch",
10
+ "version": "node scripts/site-updates-release.mjs && git add SITE_UPDATES.md",
10
11
  "lint": "eslint . --max-warnings=0",
11
12
  "lint:fix": "eslint . --fix",
12
13
  "lint:css": "stylelint \"**/*.{scss,vue}\" --max-warnings=0 --allow-empty-input",
@@ -80,6 +81,8 @@
80
81
  "i18n/locales/",
81
82
  "scripts/i18n-check.mjs",
82
83
  "scripts/i18n-sheet.mjs",
84
+ "scripts/site-updates.mjs",
85
+ "SITE_UPDATES.md",
83
86
  "nuxt.config.ts",
84
87
  "DOCS/"
85
88
  ],
@@ -0,0 +1,46 @@
1
+ // Для сайта, после `npm run spec`: печатает записи SITE_UPDATES.md слоя, вышедшие после версии,
2
+ // которая стояла в закоммиченном package.json сайта. Запуск из корня сайта.
3
+ // Явно: `node node_modules/itube-specs/scripts/site-updates.mjs <старая-версия>`.
4
+
5
+ import { execSync } from 'node:child_process';
6
+ import { existsSync, readFileSync } from 'node:fs';
7
+
8
+ const FILE = 'node_modules/itube-specs/SITE_UPDATES.md';
9
+
10
+ const toParts = version => version.replace(/^[^\d]*/, '').split('.').map(Number);
11
+ const isNewer = (a, b) => {
12
+ const [x, y] = [toParts(a), toParts(b)];
13
+ for (let i = 0; i < 3; i++) if ((x[i] || 0) !== (y[i] || 0)) return (x[i] || 0) > (y[i] || 0);
14
+ return false;
15
+ };
16
+
17
+ function previousVersion() {
18
+ if (process.argv[2]) return process.argv[2];
19
+ try {
20
+ const pkg = JSON.parse(execSync('git show HEAD:package.json', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }));
21
+ return pkg.dependencies?.['itube-specs'] || pkg.devDependencies?.['itube-specs'] || '';
22
+ }
23
+ catch {
24
+ return '';
25
+ }
26
+ }
27
+
28
+ if (!existsSync(FILE)) process.exit(0);
29
+
30
+ const from = previousVersion();
31
+ const installed = JSON.parse(readFileSync('node_modules/itube-specs/package.json', 'utf8')).version;
32
+
33
+ const sections = readFileSync(FILE, 'utf8').split(/^(?=## )/m).filter(part => part.startsWith('## '));
34
+ const pending = sections.filter((section) => {
35
+ const version = section.match(/^## (\d+\.\d+\.\d+)/)?.[1];
36
+ return version && (!from || isNewer(version, from)) && !isNewer(version, installed);
37
+ });
38
+
39
+ if (!pending.length) {
40
+ console.log(`site-updates: ${from || '?'} → ${installed}, действий для сайта нет.`);
41
+ process.exit(0);
42
+ }
43
+
44
+ console.log(`\nsite-updates: ${from || '?'} → ${installed}. Что сделать в этом сайте (от старых к новым):\n`);
45
+ console.log(pending.reverse().map(section => section.trim()).join('\n\n'));
46
+ console.log('');