📦 deps(thirdparty): update snapshots
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
@@ -12,6 +13,30 @@ import sync_repo_metadata
|
||||
from update_readme import configure_utf8_output, load_metadata, apply_metadata
|
||||
|
||||
|
||||
CURRENT_CORE_PUBLIC_COPY_FILES = [
|
||||
"README.md",
|
||||
"docs/users/aas-core.md",
|
||||
"docs/users/usage.md",
|
||||
"apps/web-app/index.html",
|
||||
"apps/web-app/public/llms.txt",
|
||||
"apps/web-app/public/manifest.webmanifest",
|
||||
"apps/web-app/public/site.webmanifest",
|
||||
"apps/web-app/scripts/prerender-routes.js",
|
||||
"apps/web-app/src/pages/Home.tsx",
|
||||
"apps/web-app/src/utils/seo.ts",
|
||||
]
|
||||
|
||||
STALE_CORE_COPY_PATTERNS = [
|
||||
("Core recommender copy", r"\bDiscover\. Recommend\. Validate\. Preview\."),
|
||||
("Core recommender copy", r"\bdiscover,\s*recommend,\s*validat"),
|
||||
("Core recommender copy", r"\brecommending,\s*validating,\s*and\s*planning"),
|
||||
("Core recommender copy", r"\brecommend\s+and\s+plan\s+exact\s+stacks"),
|
||||
("Core recommender copy", r"\bskill recommendation and stack review\b"),
|
||||
("Core recommender copy", r"\bReview what AAS Core recommended\b"),
|
||||
("obsolete catalog count fallback", r"\bHOME_CATALOG_COUNT_FALLBACK\s*=\s*1935\b"),
|
||||
]
|
||||
|
||||
|
||||
def _read_text(path: Path) -> str:
|
||||
return path.read_text(encoding="utf-8")
|
||||
|
||||
@@ -101,11 +126,26 @@ def _find_manifest_issues(root: Path) -> list[str]:
|
||||
return issues
|
||||
|
||||
|
||||
def _find_current_core_public_copy_issues(root: Path) -> list[str]:
|
||||
issues: list[str] = []
|
||||
for relative_path in CURRENT_CORE_PUBLIC_COPY_FILES:
|
||||
path = root / relative_path
|
||||
if not path.is_file():
|
||||
continue
|
||||
content = _read_text(path)
|
||||
for label, pattern in STALE_CORE_COPY_PATTERNS:
|
||||
if re.search(pattern, content, flags=re.IGNORECASE):
|
||||
issues.append(f"{relative_path} contains stale {label}")
|
||||
break
|
||||
return issues
|
||||
|
||||
|
||||
def find_local_consistency_issues(base_dir: str | Path) -> list[str]:
|
||||
root = Path(base_dir)
|
||||
metadata = load_metadata(str(root))
|
||||
issues: list[str] = []
|
||||
issues.extend(_find_manifest_issues(root))
|
||||
issues.extend(_find_current_core_public_copy_issues(root))
|
||||
|
||||
package_json = json.loads(_read_text(root / "package.json"))
|
||||
if package_json.get("description") != _package_expected_description(metadata):
|
||||
|
||||
Reference in New Issue
Block a user