diff --git a/deploy/nginx.conf b/deploy/nginx.conf index aa9b213..1ff1f2a 100644 --- a/deploy/nginx.conf +++ b/deploy/nginx.conf @@ -8,7 +8,7 @@ server { if ($videoreg_legacy != "") { return 308 $videoreg_legacy; } add_header X-Content-Type-Options nosniff always; add_header Referrer-Policy strict-origin-when-cross-origin always; - add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'" always; + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' https://mc.yandex.ru https://yastatic.net; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://mc.yandex.ru; font-src 'self'; connect-src 'self' https://mc.yandex.ru; frame-src 'self' blob: https://mc.yandex.ru; object-src 'none'; base-uri 'self'; frame-ancestors 'self'" always; location /api/ { return 404; } location ~ /showcase/?$ { return 404; } location /_next/static/ { expires 1y; add_header Cache-Control "public, immutable"; } diff --git a/deploy/serve-local.py b/deploy/serve-local.py index 75573bc..1833dcf 100644 --- a/deploy/serve-local.py +++ b/deploy/serve-local.py @@ -9,6 +9,11 @@ import re ROOT = Path(__file__).resolve().parents[1] OUT = ROOT / 'web-front/out' +CSP_MATCH = re.search(r'add_header Content-Security-Policy "([^"]+)"', (ROOT / 'deploy/nginx.conf').read_text()) +if not CSP_MATCH: + raise RuntimeError('Preview requires the actual deployment CSP') +CONTENT_SECURITY_POLICY = CSP_MATCH.group(1) + def resolve_public(root: Path, request_path: str): @@ -37,6 +42,12 @@ def legacy_destination(request_path: str): class Handler(SimpleHTTPRequestHandler): + def end_headers(self): + self.send_header('Content-Security-Policy', CONTENT_SECURITY_POLICY) + self.send_header('X-Content-Type-Options', 'nosniff') + self.send_header('Referrer-Policy', 'strict-origin-when-cross-origin') + super().end_headers() + def __init__(self, *args, **kwargs): super().__init__(*args, directory=str(OUT), **kwargs) diff --git a/docs/design-system/evidence/.gitkeep b/docs/design-system/evidence/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/design-system/fsd-graph.json b/docs/design-system/fsd-graph.json new file mode 100644 index 0000000..863cad7 --- /dev/null +++ b/docs/design-system/fsd-graph.json @@ -0,0 +1,425 @@ +{ + "scope": "Active technical-library FSD graph; inactive legacy catalog shared->entities debt preserved, no runtime cycle inferred", + "activeSourceFiles": 58, + "FSDModules": 52, + "edges": [ + { + "from": "fsd/entities/article/index.ts", + "to": "fsd/entities/article/model.ts", + "import": "./model" + }, + { + "from": "fsd/entities/article/index.ts", + "to": "fsd/entities/article/model.ts", + "import": "./model" + }, + { + "from": "fsd/entities/article/model.ts", + "to": "content/v2-articles.json", + "import": "@/content/v2-articles.json" + }, + { + "from": "fsd/entities/article/model.ts", + "to": "content/v2-community.json", + "import": "@/content/v2-community.json" + }, + { + "from": "fsd/entities/article/model.ts", + "to": "content/v2-link-approvals.json", + "import": "@/content/v2-link-approvals.json" + }, + { + "from": "fsd/features/analytics/index.tsx", + "to": "fsd/shared/config/index.ts", + "import": "@/fsd/shared/config" + }, + { + "from": "fsd/features/frame-gallery/index.ts", + "to": "fsd/features/frame-gallery/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/features/frame-gallery/ui.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/features/library-search/index.ts", + "to": "fsd/features/library-search/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/features/library-search/ui.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/features/library-search/ui.tsx", + "to": "fsd/shared/config/index.ts", + "import": "@/fsd/shared/config" + }, + { + "from": "fsd/features/page-preview/index.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/features/recording-estimate/index.ts", + "to": "fsd/features/recording-estimate/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/features/recording-estimate/ui.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/features/theme-choice/index.tsx", + "to": "fsd/shared/lib/index.ts", + "import": "@/fsd/shared/lib" + }, + { + "from": "fsd/pages/about/index.ts", + "to": "fsd/pages/about/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/pages/article/index.ts", + "to": "fsd/pages/article/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/pages/article/ui.tsx", + "to": "fsd/widgets/article-reader/index.ts", + "import": "@/fsd/widgets/article-reader" + }, + { + "from": "fsd/pages/article/ui.tsx", + "to": "fsd/entities/article/index.ts", + "import": "@/fsd/entities/article" + }, + { + "from": "fsd/pages/community/index.ts", + "to": "fsd/pages/community/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/pages/community/ui.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/pages/community/ui.tsx", + "to": "fsd/entities/article/index.ts", + "import": "@/fsd/entities/article" + }, + { + "from": "fsd/pages/home/index.ts", + "to": "fsd/pages/home/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/pages/home/ui.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/pages/home/ui.tsx", + "to": "fsd/entities/article/index.ts", + "import": "@/fsd/entities/article" + }, + { + "from": "fsd/pages/library/index.ts", + "to": "fsd/pages/library/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/pages/library/ui.tsx", + "to": "fsd/entities/article/index.ts", + "import": "@/fsd/entities/article" + }, + { + "from": "fsd/pages/library/ui.tsx", + "to": "fsd/features/library-search/index.ts", + "import": "@/fsd/features/library-search" + }, + { + "from": "fsd/pages/not-found/index.ts", + "to": "fsd/pages/not-found/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/pages/not-found/ui.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/pages/recording-tool/index.ts", + "to": "fsd/pages/recording-tool/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/pages/recording-tool/ui.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/pages/recording-tool/ui.tsx", + "to": "fsd/features/recording-estimate/index.ts", + "import": "@/fsd/features/recording-estimate" + }, + { + "from": "fsd/pages/services/index.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/pages/ui-kit/index.tsx", + "to": "fsd/entities/article/index.ts", + "import": "@/fsd/entities/article" + }, + { + "from": "fsd/pages/ui-kit/index.tsx", + "to": "fsd/features/library-search/index.ts", + "import": "@/fsd/features/library-search" + }, + { + "from": "fsd/pages/ui-kit/index.tsx", + "to": "fsd/features/recording-estimate/index.ts", + "import": "@/fsd/features/recording-estimate" + }, + { + "from": "fsd/pages/ui-kit/index.tsx", + "to": "fsd/features/theme-choice/index.tsx", + "import": "@/fsd/features/theme-choice" + }, + { + "from": "fsd/pages/ui-kit/index.tsx", + "to": "fsd/features/page-preview/index.tsx", + "import": "@/fsd/features/page-preview" + }, + { + "from": "fsd/pages/ui-kit/index.tsx", + "to": "fsd/widgets/article-reader/index.ts", + "import": "@/fsd/widgets/article-reader" + }, + { + "from": "fsd/pages/ui-kit/index.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/pages/ui-kit/index.tsx", + "to": "fsd/shared/config/index.ts", + "import": "@/fsd/shared/config" + }, + { + "from": "fsd/pages/ui-kit/index.tsx", + "to": "fsd/pages/ui-kit/reference.ts", + "import": "./reference" + }, + { + "from": "fsd/shared/config/index.ts", + "to": "fsd/shared/config/analytics.ts", + "import": "./analytics" + }, + { + "from": "fsd/shared/config/index.ts", + "to": "fsd/shared/config/design-tokens.json", + "import": "./design-tokens.json" + }, + { + "from": "fsd/shared/lib/index.ts", + "to": "fsd/shared/lib/theme.ts", + "import": "./theme" + }, + { + "from": "fsd/widgets/article-reader/index.ts", + "to": "fsd/widgets/article-reader/ui.tsx", + "import": "./ui" + }, + { + "from": "fsd/widgets/article-reader/index.ts", + "to": "fsd/widgets/article-reader/parts.tsx", + "import": "./parts" + }, + { + "from": "fsd/widgets/article-reader/parts.tsx", + "to": "fsd/features/frame-gallery/index.ts", + "import": "@/fsd/features/frame-gallery" + }, + { + "from": "fsd/widgets/article-reader/parts.tsx", + "to": "fsd/entities/article/index.ts", + "import": "@/fsd/entities/article" + }, + { + "from": "fsd/widgets/article-reader/parts.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/widgets/article-reader/ui.tsx", + "to": "fsd/entities/article/index.ts", + "import": "@/fsd/entities/article" + }, + { + "from": "fsd/widgets/article-reader/ui.tsx", + "to": "fsd/widgets/article-reader/parts.tsx", + "import": "./parts" + }, + { + "from": "fsd/widgets/site-shell/index.tsx", + "to": "fsd/shared/ui/index.tsx", + "import": "@/fsd/shared/ui" + }, + { + "from": "fsd/widgets/site-shell/index.tsx", + "to": "fsd/features/analytics/index.tsx", + "import": "@/fsd/features/analytics" + }, + { + "from": "fsd/widgets/site-shell/index.tsx", + "to": "fsd/features/theme-choice/index.tsx", + "import": "@/fsd/features/theme-choice" + }, + { + "from": "app/[...slug]/page.tsx", + "to": "fsd/entities/article/index.ts", + "import": "@/fsd/entities/article" + }, + { + "from": "app/[...slug]/page.tsx", + "to": "fsd/pages/article/index.ts", + "import": "@/fsd/pages/article" + }, + { + "from": "app/about/page.tsx", + "to": "fsd/pages/about/index.ts", + "import": "@/fsd/pages/about" + }, + { + "from": "app/community/page.tsx", + "to": "fsd/pages/community/index.ts", + "import": "@/fsd/pages/community" + }, + { + "from": "app/health/ready/route.ts", + "to": "fsd/entities/article/index.ts", + "import": "@/fsd/entities/article" + }, + { + "from": "app/layout.tsx", + "to": "fsd/widgets/site-shell/index.tsx", + "import": "@/fsd/widgets/site-shell" + }, + { + "from": "app/layout.tsx", + "to": "fsd/shared/styles/tokens.css", + "import": "@/fsd/shared/styles/tokens.css" + }, + { + "from": "app/layout.tsx", + "to": "fsd/shared/styles/library.css", + "import": "@/fsd/shared/styles/library.css" + }, + { + "from": "app/library/Search.tsx", + "to": "fsd/features/library-search/index.ts", + "import": "@/fsd/features/library-search" + }, + { + "from": "app/library/page.tsx", + "to": "fsd/pages/library/index.ts", + "import": "@/fsd/pages/library" + }, + { + "from": "app/not-found.tsx", + "to": "fsd/pages/not-found/index.ts", + "import": "@/fsd/pages/not-found" + }, + { + "from": "app/page.tsx", + "to": "fsd/pages/home/index.ts", + "import": "@/fsd/pages/home" + }, + { + "from": "app/privacy/page.tsx", + "to": "fsd/pages/services/index.tsx", + "import": "@/fsd/pages/services" + }, + { + "from": "app/sources/page.tsx", + "to": "fsd/pages/services/index.tsx", + "import": "@/fsd/pages/services" + }, + { + "from": "app/tools/recording-time/Calculator.tsx", + "to": "fsd/features/recording-estimate/index.ts", + "import": "@/fsd/features/recording-estimate" + }, + { + "from": "app/tools/recording-time/page.tsx", + "to": "fsd/pages/recording-tool/index.ts", + "import": "@/fsd/pages/recording-tool" + }, + { + "from": "app/ui-kit/page.tsx", + "to": "fsd/pages/ui-kit/index.tsx", + "import": "@/fsd/pages/ui-kit" + } + ], + "sharedComponentRealConsumers": { + "Button": [ + "fsd/features/frame-gallery/ui.tsx", + "fsd/features/library-search/ui.tsx" + ], + "Input": [ + "fsd/features/library-search/ui.tsx", + "fsd/features/recording-estimate/ui.tsx" + ], + "Select": [ + "fsd/features/library-search/ui.tsx", + "fsd/features/page-preview/index.tsx" + ], + "ContentCard": [ + "fsd/features/library-search/ui.tsx", + "fsd/pages/community/ui.tsx", + "fsd/pages/home/ui.tsx" + ], + "StateMessage": [ + "fsd/features/library-search/ui.tsx", + "fsd/pages/not-found/ui.tsx" + ], + "Field": [ + "fsd/features/recording-estimate/ui.tsx" + ], + "ActionLink": [ + "fsd/pages/home/ui.tsx", + "fsd/pages/not-found/ui.tsx" + ], + "ImageFigure": [ + "fsd/pages/home/ui.tsx", + "fsd/widgets/article-reader/parts.tsx" + ], + "Notice": [ + "fsd/pages/home/ui.tsx", + "fsd/widgets/article-reader/parts.tsx" + ], + "CodeBlock": [ + "fsd/pages/recording-tool/ui.tsx", + "fsd/widgets/article-reader/parts.tsx" + ], + "ResourceLink": [ + "fsd/pages/services/index.tsx", + "fsd/widgets/article-reader/parts.tsx" + ], + "DataTable": [ + "fsd/widgets/article-reader/parts.tsx" + ], + "Brand": [ + "fsd/widgets/site-shell/index.tsx" + ] + }, + "errors": [] +} diff --git a/docs/releases/implemented/source-equivalence.json b/docs/releases/implemented/source-equivalence.json new file mode 100644 index 0000000..4e0550c --- /dev/null +++ b/docs/releases/implemented/source-equivalence.json @@ -0,0 +1,11 @@ +{ + "priorLocalSourceCommit": "6065b113dd3538496b7263884212b1f50ec22faf", + "appSourceManifestSha256": "49d620236b5997bf151a3194ba808fb123b1c7bcbab910229425f1a895746537", + "sameAppSourceFiles": 91, + "mismatches": [], + "sourceBytesIdentical": true, + "scope": "Application, verification input and native asset source equivalence only; not a full creative acceptance", + "analyticsEnabled": false, + "historicalRestorationComplete": false, + "unresolvedHistoricalTargets": 119 +} diff --git a/package.json b/package.json index 81f36ce..235a45c 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "ingestion:export-catalog": "node --experimental-strip-types ingestion/src/exportCatalog.ts", "ingestion:smoke-yandex": "node --experimental-strip-types ingestion/src/smokeFetchYandexMarket.ts", "ingestion:smoke-mvideo": "node --experimental-strip-types ingestion/src/smokeFetchMvideo.ts", - "ci:quality": "npm run typecheck && npm test && npm run build" + "ci:quality": "npm run typecheck && npm test && npm run check:design-system && npm run build", + "check:design-system": "node scripts/design-system/check-fsd.mjs" }, "dependencies": { "next": "16.2.4", diff --git a/scripts/design-system/check-fsd.mjs b/scripts/design-system/check-fsd.mjs new file mode 100644 index 0000000..a8edd2c --- /dev/null +++ b/scripts/design-system/check-fsd.mjs @@ -0,0 +1,25 @@ +/** Audit the actually imported UI graph, public APIs, layers and real consumers. */ +import ts from 'typescript'; +import { readdir,readFile,stat,writeFile } from 'node:fs/promises'; +import { resolve,relative,dirname,sep } from 'node:path'; +const root=resolve('web-front/src'), fsd=resolve(root,'fsd'), app=resolve(root,'app'); +async function files(dir){let all=[];for(const d of await readdir(dir,{withFileTypes:true})){const p=resolve(dir,d.name);if(d.isDirectory())all.push(...await files(p));else if(/\.(ts|tsx)$/.test(p)&&!p.endsWith('.test.ts'))all.push(p);}return all;} +async function exists(p){try{return (await stat(p)).isFile();}catch{return false;}} +async function target(owner,name){let stem;if(name.startsWith('@/'))stem=resolve(root,name.slice(2));else if(name.startsWith('.'))stem=resolve(dirname(owner),name);else return null;for(const p of [stem,...['.ts','.tsx','.json','.css'].map(x=>stem+x),...['index.ts','index.tsx'].map(x=>resolve(stem,x))])if(await exists(p))return p;return null;} +const paths=[...await files(fsd),...await files(app)],info=new Map(),errors=[],edges=[]; +const levels={app:6,pages:5,widgets:4,features:3,entities:2,shared:1}; +function owner(p){if(p.startsWith(app+sep))return {layer:'app',slice:'app'};const [layer,slice]=relative(fsd,p).split(sep);return {layer,slice};} +for(const path of paths){const code=await readFile(path,'utf8'),ast=ts.createSourceFile(path,code,ts.ScriptTarget.Latest,true),imports=[]; + for(const node of ast.statements){if((ts.isImportDeclaration(node)||ts.isExportDeclaration(node))&&node.moduleSpecifier&&ts.isStringLiteral(node.moduleSpecifier)){const name=node.moduleSpecifier.text,to=await target(path,name);imports.push({name,to,names:ts.isImportDeclaration(node)&&node.importClause?.namedBindings&&ts.isNamedImports(node.importClause.namedBindings)?node.importClause.namedBindings.elements.map(x=>x.name.text):[]});}} + const from=owner(path);if((from.layer==='shared'||from.layer==='entities')&&ast.statements.some(n=>ts.isExpressionStatement(n)&&ts.isStringLiteral(n.expression)&&n.expression.text==='use client'))errors.push({kind:'client-boundary-in-shared/entity',file:relative(root,path)}); + for(const imp of imports){if(imp.name==='@/content/library')errors.push({kind:'compatibility-cycle-risk',file:relative(root,path)});if(!imp.to)continue;if(imp.to.startsWith(fsd+sep)){const dest=owner(imp.to);if(levels[dest.layer]>levels[from.layer]||(dest.layer===from.layer&&dest.slice!==from.slice&&from.layer!=='app'))errors.push({kind:'upward/lateral-import',from:relative(root,path),to:relative(root,imp.to)});if(imp.name.startsWith('@/fsd/')&&!(dest.layer==='shared'&&imp.to.endsWith('.css'))&&!/^index\.tsx?$/.test(imp.to.split(sep).at(-1)))errors.push({kind:'slice-public-api-bypass',from:relative(root,path),import:imp.name});}edges.push({from:relative(root,path),to:relative(root,imp.to),import:imp.name});} + info.set(path,{imports,ast}); +} +const active=new Set();async function visit(p){if(active.has(p))return;active.add(p);for(const imp of info.get(p)?.imports??[])if(imp.to)await visit(imp.to);} +for(const p of await files(app))await visit(p); +const consumers={};for(const [path,data] of info){if(!active.has(path)||path.includes('/pages/ui-kit/'))continue;for(const imp of data.imports)if(imp.name==='@/fsd/shared/ui')for(const name of imp.names)(consumers[name]??=[]).push(relative(root,path));} +const ui=info.get(resolve(fsd,'shared/ui/index.tsx'));const exports=ui.ast.statements.filter(n=>ts.isFunctionDeclaration(n)&&n.modifiers?.some(m=>m.kind===ts.SyntaxKind.ExportKeyword)).map(n=>n.name.text); +for(const name of exports)if(!consumers[name]?.length)errors.push({kind:'shared-ui-without-real-page-consumer',component:name}); +if(await exists(resolve(root,'pages/index.tsx')))errors.push({kind:'accidental-next-pages-router'}); +const report={scope:'Active technical-library FSD graph; inactive legacy catalog shared->entities debt preserved, no runtime cycle inferred',activeSourceFiles:active.size,FSDModules:info.size,edges,sharedComponentRealConsumers:consumers,errors}; +await writeFile('docs/design-system/fsd-graph.json',JSON.stringify(report,null,2)+'\n');console.log(JSON.stringify({activeFiles:active.size,modules:info.size,sharedComponents:exports.length,errors}));if(errors.length)process.exitCode=1; diff --git a/scripts/design-system/check-preservation.py b/scripts/design-system/check-preservation.py new file mode 100644 index 0000000..b6b1f0c --- /dev/null +++ b/scripts/design-system/check-preservation.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 +"""Compare original corpus, anchors and binary payload against published R3.""" +from pathlib import Path +import hashlib,json,subprocess,sys +sys.path.insert(0,str(Path('scripts/rebuild-v2/vendor').resolve())) +from bs4 import BeautifulSoup +root=Path('.');out=root/'web-front/out';checks=[] +def check(kind,path,ok): + checks.append(dict(kind=kind,path=path,same=bool(ok))) +def digest(data):return hashlib.sha256(data).hexdigest() +for name in ['web-front/src/content/v2-articles.json','web-front/src/content/v2-community.json','deploy/legacy-map.conf','deploy/legacy-routes.json','deploy/legacy-matchers.json']: + check('immutable-source/legacy',name,(root/name).read_bytes()==subprocess.check_output(['git','show','6405a8d:'+name])) +public=subprocess.check_output(['git','ls-tree','-r','--name-only','6405a8d','--','web-front/public'],text=True).splitlines() +for name in public: + relative=name.removeprefix('web-front/public/');before=subprocess.check_output(['git','show','6405a8d:'+name]);check('original-public-source-bytes',relative,digest((root/name).read_bytes())==digest(before));check('original-public-export-bytes',relative,(out/relative).is_file()and digest((out/relative).read_bytes())==digest(before)) +articles=json.loads((root/'web-front/src/content/v2-articles.json').read_text())+json.loads((root/'web-front/src/content/v2-community.json').read_text()) +for article in articles: + path=article['path'];soup=BeautifulSoup((out/(path.lstrip('/')+'.html')).read_bytes(),'html.parser');body=soup.select_one('article.article-body');check('real-reader',path,body is not None) + if body is None:continue + for i,s in enumerate(article['sections']): + section=body.find('section',id='section-'+str(i));key=path+'#section-'+str(i);check('anchor-and-toc',key,section is not None and soup.find('a',href='#section-'+str(i))is not None) + if section is None:continue + check('exact-heading',key,section.h2.get_text()==s['heading']);check('exact-paragraphs',key,[p.get_text()for p in section.find_all('p',recursive=False)]==s['paragraphs']) + if s.get('list'):check('exact-list',key,[n.get_text()for n in section.find('ol').find_all('li')]==s['list']) + if s.get('note'):check('exact-note',key,section.select_one('.reading-note').get_text()==s['note']) + if s.get('code'):check('exact-code',key,section.find('code').get_text()==s['code']) + if s.get('table'): + t=s['table'];table=section.find('table');check('exact-table-caption',key,table.caption.get_text()==t['caption']);check('exact-table-headers',key,[c.get_text()for c in table.thead.find_all('th')]==t['head']);check('exact-table-cells',key,[[c.get_text()for c in row.find_all(['th','td'])]for row in table.tbody.find_all('tr')]==t['rows']) + if s.get('figure'):f=s['figure'];check('exact-figure/caption',key,section.find('img',src=f['src'])is not None and section.find('figcaption').get_text()==f['caption']) + for link in s.get('links',[]):a=section.find('a',href=link['href']);check('exact-resource-link',key+' '+link['href'],a is not None and a.get_text()==link['label']+' ↗') + for frame in s.get('gallery',[])[:6]:check('original-frame/name',key+' '+frame['filename'],section.find('img',src=frame['src'])is not None and frame['filename']in section.get_text()) + check('exact-related-targets',path,[a['href']for a in body.select('.related-reading a')]==article['related']) +x=dict(scope='Actual rendered historical body/anchors/related and all original public bytes; brand/UI utility additions excluded from historical count',baselineCommit='6405a8d',sourceCommit=json.loads((out/'health/ready').read_text())['metadata']['commitSha'],originalArticles=len(articles),originalPublicFiles=len(public),checks=checks,failures=[x for x in checks if not x['same']],newUtilityRoutes=['/sources','/privacy','/ui-kit'],fullHistoricalRestorationAccepted=False) +(root/'docs/design-system/evidence/preservation.json').write_text(json.dumps(x,ensure_ascii=False,indent=2)+'\n');print(json.dumps(dict(checks=len(checks),failures=x['failures'],originalArticles=len(articles),originalPublicFiles=len(public)),ensure_ascii=False));raise SystemExit(1 if x['failures']else 0) diff --git a/scripts/rebuild-v2/check-built.py b/scripts/rebuild-v2/check-built.py index 7bd2b63..4642c6c 100644 --- a/scripts/rebuild-v2/check-built.py +++ b/scripts/rebuild-v2/check-built.py @@ -236,12 +236,23 @@ def active_source_files(): continue candidates = [stem, *[Path(str(stem) + suffix) for suffix in (".ts", ".tsx", ".js", ".jsx", ".json", ".css")], stem / "index.ts", stem / "index.tsx"] pending.extend(p for p in candidates if p.is_file()) + # Framework icon conventions and first-party public code/branding have no + # import edge, but still belong to the exact source identity. + seen.update((ROOT / "web-front/public").glob("*.js")) + seen.update(p for p in (ROOT / "web-front/public/brand").rglob("*") if p.is_file()) + seen.update(p for pattern in ("icon.*", "favicon.ico", "apple-icon.*") for p in (src / "app").glob(pattern) if p.is_file()) + # Hash the actual build/check inputs too; they are not browser destinations. + seen.update(ROOT / name for name in ("package.json", "package-lock.json", "tsconfig.json", "web-front/next.config.ts", "scripts/design-system/check-fsd.mjs", "scripts/rebuild-v2/check-built.py", "scripts/rebuild-v2/decode-raster-sharp.mjs", "scripts/rebuild-v2/check-raster-sharp.mjs")) return sorted(seen) def source_occurrences(files): occurrences = [] for path in files: + if not (path.is_relative_to(ROOT / "web-front/src") or path.is_relative_to(ROOT / "web-front/public")): + continue # Build/check tooling is hash-bound, not an active web reference. + if path.suffix.lower() not in (".ts", ".tsx", ".js", ".jsx", ".css", ".json", ".svg"): + continue # Binary sources are hash-bound; never decode them as text. text = path.read_text() relative = path.relative_to(ROOT).as_posix() if path.suffix == ".json": diff --git a/scripts/rebuild-v2/check-raster-sharp.mjs b/scripts/rebuild-v2/check-raster-sharp.mjs index 74c868d..c5df6dd 100644 --- a/scripts/rebuild-v2/check-raster-sharp.mjs +++ b/scripts/rebuild-v2/check-raster-sharp.mjs @@ -16,6 +16,20 @@ try { assert.equal(report.results[0].width, 64); assert.equal(report.results[0].height, 32); assert.equal(report.results[1].valid, false, 'Truncated PNG must fail, not be skipped or treated as metadata-only pass'); + const frames = await Promise.all([16, 32, 48].map(size => sharp({ create: { width: size, height: size, channels: 4, background: '#17382f' } }).png().toBuffer())); + const directory = Buffer.alloc(6 + frames.length * 16); directory.writeUInt16LE(1, 2); directory.writeUInt16LE(frames.length, 4); + let offset = directory.length; + frames.forEach((frame, i) => { const at = 6 + i * 16; directory[at] = [16,32,48][i]; directory[at+1] = [16,32,48][i]; directory.writeUInt16LE(1,at+4);directory.writeUInt16LE(32,at+6);directory.writeUInt32LE(frame.length,at+8);directory.writeUInt32LE(offset,at+12);offset += frame.length; }); + const ico = Buffer.concat([directory,...frames]); + await writeFile(join(root,'all-frames.ico'),ico); + await writeFile(join(root,'truncated-directory.ico'),ico.subarray(0,24)); + const bounds=Buffer.from(ico);bounds.writeUInt32LE(0xffffffff,18);await writeFile(join(root,'bad-bounds.ico'),bounds); + const overlap=Buffer.from(ico);overlap.writeUInt32LE(directory.length,34);await writeFile(join(root,'overlap.ico'),overlap); + const corrupt=Buffer.from(ico);corrupt[directory.length+frames[0].length]=0;await writeFile(join(root,'bad-middle-frame.ico'),corrupt); + const icons=await decodeBatch({root,files:['all-frames.ico','truncated-directory.ico','bad-bounds.ico','overlap.ico','bad-middle-frame.ico']}); + assert.equal(icons.results[0].valid,true);assert.deepEqual(icons.results[0].frames.map(f=>[f.width,f.height]),[[16,16],[32,32],[48,48]]); + assert.ok(icons.results.slice(1).every(f=>f.valid===false),'Every corrupt directory/member must fail the full ICO'); + process.stdout.write(JSON.stringify({test:'all-ICO-frames-and-corruption',status:'passed',results:icons.results})+'\n'); process.stdout.write(JSON.stringify({ test: 'full-raster-decode-positive-and-corruption', status: 'passed', results: report.results }) + '\n'); } finally { await rm(root, { recursive: true, force: true }); diff --git a/scripts/rebuild-v2/decode-raster-sharp.mjs b/scripts/rebuild-v2/decode-raster-sharp.mjs index 0a6d90b..b5bca6c 100644 --- a/scripts/rebuild-v2/decode-raster-sharp.mjs +++ b/scripts/rebuild-v2/decode-raster-sharp.mjs @@ -1,12 +1,32 @@ /** Fully decode all raster pixels with npm-lockfile-pinned sharp; no network. */ import sharp from 'sharp'; -import { realpath } from 'node:fs/promises'; +import { realpath, readFile } from 'node:fs/promises'; import { resolve, sep } from 'node:path'; import { fileURLToPath } from 'node:url'; sharp.cache(false); sharp.concurrency(1); +/** Decode every PNG-backed ICO directory member, not just its largest frame. */ +export async function decodeIco(bytes) { + if (bytes.length < 6 || bytes.length > 25 * 1024 * 1024 || bytes.readUInt16LE(0) !== 0 || bytes.readUInt16LE(2) !== 1) throw new Error('Invalid ICO header'); + const count = bytes.readUInt16LE(4), ranges = [], frames = []; + if (count < 1 || count > 64 || bytes.length < 6 + count * 16) throw new Error('Invalid ICO directory'); + for (let i = 0; i < count; i++) { + const at = 6 + i * 16, width = bytes[at] || 256, height = bytes[at + 1] || 256; + const size = bytes.readUInt32LE(at + 8), offset = bytes.readUInt32LE(at + 12), end = offset + size; + if (size < 8 || offset < 6 + count * 16 || end > bytes.length || ranges.some(([a, b]) => offset < b && end > a)) throw new Error('Invalid ICO member bounds/overlap'); + ranges.push([offset, end]); + const png = bytes.subarray(offset, end); + if (!png.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))) throw new Error('ICO member must be PNG-backed; unsupported DIB is not skipped'); + const image = sharp(png, { failOn: 'error', limitInputPixels: 65536 }); + const { info } = await image.raw().toBuffer({ resolveWithObject: true }); + if (info.width !== width || info.height !== height) throw new Error('ICO directory/pixels dimension mismatch'); + frames.push({ width, height, decodedBytes: info.size }); + } + return { width: Math.max(...frames.map(f => f.width)), height: Math.max(...frames.map(f => f.height)), format: 'ico', pages: count, decodedBytes: frames.reduce((n, f) => n + f.decodedBytes, 0), frames }; +} + export async function decodeBatch({ root, files }) { if (sharp.versions.sharp !== '0.34.5') { throw new Error(`Expected lockfile sharp0.34.5, found ${sharp.versions.sharp}`); @@ -20,6 +40,11 @@ export async function decodeBatch({ root, files }) { try { const candidate = await realpath(resolve(boundary, file)); if (!candidate.startsWith(boundary + sep)) throw new Error('Raster path outside public root'); + if (candidate.toLowerCase().endsWith('.ico')) { + const decoded = await decodeIco(await readFile(candidate)); + results.push({ file, type: 'raster', valid: true, ...decoded, decoder: `sharp${sharp.versions.sharp}/all-ICO-PNG-frames` }); + continue; + } const image = sharp(candidate, { failOn: 'error', animated: true, limitInputPixels: 64000000 }); const metadata = await image.metadata(); // metadata() alone is insufficient: force actual decode of every pixel. diff --git a/web-front/public/brand/icon-dark-16.png b/web-front/public/brand/icon-dark-16.png new file mode 100644 index 0000000..896693e Binary files /dev/null and b/web-front/public/brand/icon-dark-16.png differ diff --git a/web-front/public/brand/icon-dark-16.svg b/web-front/public/brand/icon-dark-16.svg new file mode 100644 index 0000000..8d4b96d --- /dev/null +++ b/web-front/public/brand/icon-dark-16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-front/public/brand/icon-dark-180.png b/web-front/public/brand/icon-dark-180.png new file mode 100644 index 0000000..18772cf Binary files /dev/null and b/web-front/public/brand/icon-dark-180.png differ diff --git a/web-front/public/brand/icon-dark-32.png b/web-front/public/brand/icon-dark-32.png new file mode 100644 index 0000000..1a5610c Binary files /dev/null and b/web-front/public/brand/icon-dark-32.png differ diff --git a/web-front/public/brand/icon-dark-32.svg b/web-front/public/brand/icon-dark-32.svg new file mode 100644 index 0000000..d32fa89 --- /dev/null +++ b/web-front/public/brand/icon-dark-32.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-front/public/brand/icon-dark-48.png b/web-front/public/brand/icon-dark-48.png new file mode 100644 index 0000000..6c67c60 Binary files /dev/null and b/web-front/public/brand/icon-dark-48.png differ diff --git a/web-front/public/brand/icon-dark-48.svg b/web-front/public/brand/icon-dark-48.svg new file mode 100644 index 0000000..059e02c --- /dev/null +++ b/web-front/public/brand/icon-dark-48.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-front/public/brand/icon-dark-512.png b/web-front/public/brand/icon-dark-512.png new file mode 100644 index 0000000..8800a69 Binary files /dev/null and b/web-front/public/brand/icon-dark-512.png differ diff --git a/web-front/public/brand/icon-light-16.png b/web-front/public/brand/icon-light-16.png new file mode 100644 index 0000000..896693e Binary files /dev/null and b/web-front/public/brand/icon-light-16.png differ diff --git a/web-front/public/brand/icon-light-16.svg b/web-front/public/brand/icon-light-16.svg new file mode 100644 index 0000000..8d4b96d --- /dev/null +++ b/web-front/public/brand/icon-light-16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-front/public/brand/icon-light-180.png b/web-front/public/brand/icon-light-180.png new file mode 100644 index 0000000..18772cf Binary files /dev/null and b/web-front/public/brand/icon-light-180.png differ diff --git a/web-front/public/brand/icon-light-32.png b/web-front/public/brand/icon-light-32.png new file mode 100644 index 0000000..1a5610c Binary files /dev/null and b/web-front/public/brand/icon-light-32.png differ diff --git a/web-front/public/brand/icon-light-32.svg b/web-front/public/brand/icon-light-32.svg new file mode 100644 index 0000000..d32fa89 --- /dev/null +++ b/web-front/public/brand/icon-light-32.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-front/public/brand/icon-light-48.png b/web-front/public/brand/icon-light-48.png new file mode 100644 index 0000000..6c67c60 Binary files /dev/null and b/web-front/public/brand/icon-light-48.png differ diff --git a/web-front/public/brand/icon-light-48.svg b/web-front/public/brand/icon-light-48.svg new file mode 100644 index 0000000..059e02c --- /dev/null +++ b/web-front/public/brand/icon-light-48.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-front/public/brand/icon-light-512.png b/web-front/public/brand/icon-light-512.png new file mode 100644 index 0000000..8800a69 Binary files /dev/null and b/web-front/public/brand/icon-light-512.png differ diff --git a/web-front/public/brand/logo-dark.svg b/web-front/public/brand/logo-dark.svg new file mode 100644 index 0000000..e5bb78d --- /dev/null +++ b/web-front/public/brand/logo-dark.svg @@ -0,0 +1 @@ +Videoregvideoreg \ No newline at end of file diff --git a/web-front/public/brand/logo-light.svg b/web-front/public/brand/logo-light.svg new file mode 100644 index 0000000..8b3011a --- /dev/null +++ b/web-front/public/brand/logo-light.svg @@ -0,0 +1 @@ +Videoregvideoreg \ No newline at end of file diff --git a/web-front/public/brand/mark.svg b/web-front/public/brand/mark.svg new file mode 100644 index 0000000..d32fa89 --- /dev/null +++ b/web-front/public/brand/mark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web-front/public/brand/touch-dark.svg b/web-front/public/brand/touch-dark.svg new file mode 100644 index 0000000..3e91d0f --- /dev/null +++ b/web-front/public/brand/touch-dark.svg @@ -0,0 +1 @@ +Videoreg — кадр СВК \ No newline at end of file diff --git a/web-front/public/brand/touch-light.svg b/web-front/public/brand/touch-light.svg new file mode 100644 index 0000000..3e91d0f --- /dev/null +++ b/web-front/public/brand/touch-light.svg @@ -0,0 +1 @@ +Videoreg — кадр СВК \ No newline at end of file diff --git a/web-front/public/metrika.js b/web-front/public/metrika.js new file mode 100644 index 0000000..254e35b --- /dev/null +++ b/web-front/public/metrika.js @@ -0,0 +1,79 @@ +/* Videoreg analytics: one existing counter, public hosts only, no query payloads. */ +(function () { + "use strict"; + if (!/^(www\.)?videoreg\.ru$/.test(window.location.hostname) || window.__videoregMetrika) return; + window.__videoregMetrika = true; + var counter = 109268682; + window.ym = window.ym || function () { (window.ym.a = window.ym.a || []).push(arguments); }; + window.ym.l = Number(new Date()); + var tag = document.createElement("script"); + tag.async = true; + tag.src = "https://mc.yandex.ru/metrika/tag.js"; + document.head.appendChild(tag); + window.ym(counter, "init", { + webvisor: false, clickmap: true, trackLinks: true, + accurateTrackBounce: true, trackHash: false + }); + function goal(name, params) { window.ym(counter, "reachGoal", name, params); } + var problems = new Set(); + function problem(kind) { + if (problems.has(kind)) return; + problems.add(kind); + goal("content_problem", { problem: kind }); + } + // Only actual, enabled document/ZIP downloads; a click does not imply success. + document.addEventListener("click", function (event) { + var link = event.target instanceof Element ? event.target.closest("a[href]") : null; + if (!link || event.defaultPrevented || link.getAttribute("aria-disabled") === "true") return; + var url = new URL(link.href, window.location.href); + if (url.origin !== window.location.origin) return; + if (/^\/(manuals|download)\//.test(url.pathname) && /\.(pdf|zip)$/i.test(url.pathname)) goal("download_click"); + if (link.closest(".related-reading")) goal("related_content_click"); + var queryInput = document.querySelector("#library-query"); + if (link.closest(".search-results") && queryInput && queryInput.value.trim()) goal("search_used"); + }); + document.addEventListener("keydown", function (event) { + if (event.key === "Enter" && !event.isComposing && !event.repeat && event.target.id === "library-query" && event.target.value.trim()) goal("search_used"); + }); + document.addEventListener("videoreg:search-zero-results", function () { goal("search_zero_results"); }); + function fragment() { + var id; + try { id = decodeURIComponent(window.location.hash.slice(1).split(":~:")[0]); } catch (_) { return; } + if (id && !document.getElementById(id) && !document.getElementsByName(id).length) problem("missing_fragment"); + } + function imageFailed(image) { + if (image instanceof HTMLImageElement && image.closest("main") && image.getAttribute("src")) problem("image_failed"); + } + document.addEventListener("error", function (event) { imageFailed(event.target); }, true); + if (document.querySelector("main.not-found")) problem("not_found"); + document.querySelectorAll("main img").forEach(function (image) { + if (image.complete && image.naturalWidth === 0) imageFailed(image); + }); + if (document.readyState === "complete") fragment(); + else window.addEventListener("load", fragment, { once: true }); + window.addEventListener("hashchange", fragment); + + var article = document.querySelector("article.article-body"); + if (!article) return; + var visibleMs = 0, depth = 0, sent = false, last = performance.now(); + var active = document.visibilityState === "visible" && document.hasFocus(); + function sample() { + var now = performance.now(); + var nextActive = document.visibilityState === "visible" && document.hasFocus(); + // Conservative cap avoids counting background/throttled gaps as reading. + if (active && nextActive) visibleMs += Math.min(now - last, 1500); + last = now; active = nextActive; + if (nextActive) { + var rect = article.getBoundingClientRect(); + if (rect.height > 0) depth = Math.max(depth, Math.min(1, (window.innerHeight - rect.top) / rect.height)); + } + if (!sent && visibleMs >= 60000 && depth >= 0.75) { + sent = true; goal("engaged_read"); clearInterval(timer); + } + } + var timer = setInterval(sample, 1000); + window.addEventListener("scroll", sample, { passive: true }); + window.addEventListener("focus", sample); + window.addEventListener("blur", sample); + document.addEventListener("visibilitychange", sample); +})(); diff --git a/web-front/public/theme.js b/web-front/public/theme.js new file mode 100644 index 0000000..154e64e --- /dev/null +++ b/web-front/public/theme.js @@ -0,0 +1,39 @@ +/* Blocking, same-origin bootstrap: keep this before body paint. */ +(function () { + 'use strict'; + var key = 'videoreg-theme'; + var root = document.documentElement; + var media = typeof window.matchMedia === 'function' ? window.matchMedia('(prefers-color-scheme: dark)') : null; + function valid(value) { return value === 'light' || value === 'dark' || value === 'system'; } + function read() { try { var value = localStorage.getItem(key); return valid(value) ? value : 'system'; } catch (_) { return 'system'; } } + var choice = read(); + function apply() { + var resolved = choice === 'system' ? (media && media.matches ? 'dark' : 'light') : choice; + root.dataset.theme = resolved; + root.dataset.themeChoice = choice; + root.style.colorScheme = resolved; + window.dispatchEvent(new CustomEvent('videoreg:theme-change')); + } + window.videoregTheme = { + get: function () { return choice; }, + set: function (value) { + if (!valid(value)) return; + choice = value; + try { localStorage.setItem(key, choice); } catch (_) { /* Session choice still works. */ } + apply(); + } + }; + function osChanged() { if (choice === 'system') apply(); } + if (media) { + if (media.addEventListener) media.addEventListener('change', osChanged); + else if (media.addListener) media.addListener(osChanged); + } + window.addEventListener('storage', function (event) { + if (event.key !== key && event.key !== null) return; + // Ignore sessionStorage events; inaccessible storage must not break rendering. + try { if (event.storageArea && event.storageArea !== localStorage) return; } catch (_) { return; } + choice = read(); + apply(); + }); + apply(); +}()); diff --git a/web-front/src/app/[...slug]/page.tsx b/web-front/src/app/[...slug]/page.tsx index 0d11855..6633d95 100644 --- a/web-front/src/app/[...slug]/page.tsx +++ b/web-front/src/app/[...slug]/page.tsx @@ -1,172 +1,16 @@ import { notFound } from "next/navigation"; -import FrameGallery from "@/components/FrameGallery"; -import { articles, findArticle } from "@/content/library"; +import { articles, findArticle } from "@/fsd/entities/article"; +import { ArticlePage } from "@/fsd/pages/article"; export const dynamicParams = false; -export function generateStaticParams() { - return articles.map((a) => ({ slug: a.path.slice(1).split("/") })); -} -export async function generateMetadata({ - params, -}: { - params: Promise<{ slug: string[] }>; -}) { +export function generateStaticParams() { return articles.map(a => ({ slug: a.path.slice(1).split("/") })); } +export async function generateMetadata({ params }: { params: Promise<{ slug: string[] }> }) { const { slug } = await params; const a = findArticle("/" + slug.join("/")); return { title: a?.title, description: a?.summary }; } -const dimensions: Record = { - "/archive-media/svk006-front.jpg": [800, 528], - "/archive-media/early-kit.jpg": [640, 551], - "/archive-media/viewer-map.jpg": [1259, 850], - "/archive-media/certificate.jpg": [200, 282], - "/archive-media/installation-interior.jpg": [200, 150], - "/archive-media/installation-block.jpg": [200, 150], - "/diagrams/svk-signal-chain.svg": [440, 870], - "/diagrams/svk-road-guard.svg": [440, 815], - "/diagrams/svk-fleet-channels.svg": [440, 1015], -}; -export default async function Page({ - params, -}: { - params: Promise<{ slug: string[] }>; -}) { +export default async function Page({ params }: { params: Promise<{ slug: string[] }> }) { const { slug } = await params; - const a = findArticle("/" + slug.join("/")); - if (!a) notFound(); - return ( -
-
- - ← К библиотеке - -

- {a.category} / {a.date} -

-

{a.title}

-

{a.summary}

-
-
- -
- {a.sections.map((s, i) => ( -
-

{s.heading}

- {s.paragraphs.map((p) => ( -

{p}

- ))} - {s.list && ( -
    - {s.list.map((v) => ( -
  1. {v}
  2. - ))} -
- )} - {s.note && } - {s.code && ( -
-                  {s.code}
-                
- )} - {s.table && ( -
- - - - - {s.table.head.map((h) => ( - - ))} - - - - {s.table.rows.map((row, j) => ( - - {row.map((value, k) => - k === 0 ? ( - - ) : ( - - ), - )} - - ))} - -
{s.table.caption}
- {h} -
- {value} - {value}
-
- )} - {s.figure && ( -
- - {s.figure.alt} - -
{s.figure.caption}
-
- )} - {s.gallery && }{" "} - {s.links && ( - - )} -
- ))} - -
-
-
- ); + const article = findArticle("/" + slug.join("/")); + if (!article) notFound(); + return ; } diff --git a/web-front/src/app/about/page.tsx b/web-front/src/app/about/page.tsx index 37db70e..73bbcc5 100644 --- a/web-front/src/app/about/page.tsx +++ b/web-front/src/app/about/page.tsx @@ -1,44 +1,3 @@ +import { AboutPage } from "@/fsd/pages/about"; export const metadata = { title: "О технической библиотеке" }; -export default function About() { - return ( -
-

VIDEOREG

-

Библиотека систем СВК

-

- Устройство, эксплуатация и чтение записи — без витрины продаж. -

-

- Здесь доступны отобранные технические материалы, пять полных PDF-документов - и подборки кадров. Это не полный архив всех прежних страниц и файлов - videoreg.ru. Ограничения неполных подборок и недоступных файлов указаны - непосредственно в соответствующем материале. -

-

Для кого эти материалы

-

- Для владельца старого блока СВК, которому нужна инструкция своего - поколения, таблица камер или объяснение покадровой записи. Отдельные - материалы помогают понять устройство ранних автомобильных систем - регистрации. -

-

Сначала модель и редакция

-

- Страницы разных лет относятся к разным аппаратным версиям. Даты у - материалов помогают различать поколения. Указанные там камеры, носители - и параметры не являются универсальной рекомендацией для современного - оборудования. -

-

Как пользоваться

-

- Начните с устройства системы, затем откройте инструкцию подходящего - блока. Для поиска конкретной ошибки или камеры используйте поиск по - полным текстам. Исходные PDF открываются внутри сайта; программы и - прошивки автоматически не запускаются. -

-
- Устройство СВК → - Материалы и поиск → - Документы → -
-
- ); -} +export default AboutPage; diff --git a/web-front/src/app/community/page.tsx b/web-front/src/app/community/page.tsx index 70ed39e..c163885 100644 --- a/web-front/src/app/community/page.tsx +++ b/web-front/src/app/community/page.tsx @@ -1,32 +1,3 @@ -import { articles } from "@/content/library"; +import { CommunityPage } from "@/fsd/pages/community"; export const metadata = { title: "Технические разборы СВК" }; -export default function Page() { - return ( -
-

ЭКСПЛУАТАЦИЯ / РАЗБОРЫ

-

- Проблема и условия, -
в которых она возникла. -

-

- Два разбора из обсуждений владельцев СВК. Частный опыт не превращён в - обещание совместимости любого оборудования. -

-
- {articles - .filter((a) => a.path.startsWith("/community/")) - .map((a) => ( - - Обсуждение · {a.date} -

{a.title}

-

{a.summary}

- ↗ -
- ))} -
-

- Также: ответы по конструкции и настройке → -

-
- ); -} +export default CommunityPage; diff --git a/web-front/src/app/favicon.ico b/web-front/src/app/favicon.ico new file mode 100644 index 0000000..7ea3f7d Binary files /dev/null and b/web-front/src/app/favicon.ico differ diff --git a/web-front/src/app/health/ready/route.ts b/web-front/src/app/health/ready/route.ts index 22180c6..c7f81d5 100644 --- a/web-front/src/app/health/ready/route.ts +++ b/web-front/src/app/health/ready/route.ts @@ -1,4 +1,4 @@ import { NextResponse } from 'next/server'; -import { articles } from '@/content/library'; +import { articles } from '@/fsd/entities/article'; export const dynamic='force-static'; export async function GET(){return NextResponse.json({status:'ok',service:'videoreg-web',edition:'rebuild-v2-limited',restorationComplete:false,articles:articles.length,metadata:{commitSha:process.env.COMMIT_SHA??'local-v2'}})} diff --git a/web-front/src/app/icon.svg b/web-front/src/app/icon.svg index 16a9de7..80c5f60 100644 --- a/web-front/src/app/icon.svg +++ b/web-front/src/app/icon.svg @@ -1 +1 @@ - \ No newline at end of file +Videoreg — покадровая запись СВК \ No newline at end of file diff --git a/web-front/src/app/layout.tsx b/web-front/src/app/layout.tsx index 83e7865..ba06017 100644 --- a/web-front/src/app/layout.tsx +++ b/web-front/src/app/layout.tsx @@ -1,53 +1,13 @@ import type { Metadata } from "next"; -import "./library.css"; +import { SiteShell } from "@/fsd/widgets/site-shell"; +import "@/fsd/shared/styles/tokens.css"; +import "@/fsd/shared/styles/library.css"; export const metadata: Metadata = { metadataBase: new URL("https://videoreg.ru"), - title: { - default: "Videoreg — техническая библиотека СВК", - template: "%s · Videoreg", - }, - description: - "Устройство видеорегистраторов СВК, оригинальные инструкции, таблицы камер и работа с покадровой записью JPEG.", + title: { default: "Videoreg — техническая библиотека СВК", template: "%s · Videoreg" }, + description: "Устройство видеорегистраторов СВК, оригинальные инструкции, таблицы камер и работа с покадровой записью JPEG.", + icons: { icon: [{ url: "/brand/icon-light-32.png", sizes: "32x32", type: "image/png" }, { url: "/brand/icon-light-512.png", sizes: "512x512", type: "image/png" }], apple: [{ url: "/brand/icon-light-180.png", sizes: "180x180", type: "image/png" }] } }; export default function Layout({ children }: { children: React.ReactNode }) { - return ( - - - - Перейти к содержимому - -
- - videoregТЕХНИЧЕСКАЯ БИБЛИОТЕКА - - - СВК / JPEG / FLASH -
- {children} - - - - ); + return