Date: 2026-09-04 00:35
Summary: Added missing client-only PDF scene tool pages, fixed devlog build ENOENT, and updated i18n descriptions so lint:seo / verify:tool pass.
Visibility: people
项目:PDF 工具页补齐与校验修复
[question]
User asked to re-initiate/redo PDF tool briefs and recreate the PDF tools in /tools/* following the PDF keyword planner doc, including strengthening IG and matching user intent, then implement tools automatically until all PDF tools were created.
[try to solve]
Context
verify:tool and npm run lint:seo started failing after earlier partial generation: some tool pages were missing in src/pages/, the build:site devlogs step crashed with an ENOENT during cleanup, and SEO validation rejected tool meta descriptions that didn’t contain required “process/example” keywords per language.
Process
- Identified which tool slugs had catalog/i18n but lacked the corresponding
src/pages/*Page.tsmodule. - Implemented missing client-side pages for the “PDF scene” set:
combine-files-into-one-pdfconvert-html-to-pdfadd-text-to-pdf-filewrite-pdf-document-onlinecheck-pdf-a-compliancecompare-two-pdfsmake-pdf-flipbookprint-pdf
- Fixed
scripts/build-site.mjsdevlog cleanup to ignoreENOENTduring concurrent/rep run of orphan-file cleanup. - Updated
src/site/i18n/tools/*/{lang}.tstool*_descriptionstrings (and then rannpm run merge:tools) to satisfyscripts/validate-tool-seo.mjs:- Ensure descriptions include at least one keyword from the per-language keyword list.
- Ensure meta description length meets
MIN_DESCRIPTION_LENGTH(>= 120).
- Adjusted
check-pdf-a-compliancepage to define and call an explicitloadSample()wrapper (required by the prerender “tool-page HTML smoke” gate). - Re-ran
npm run lint:seoand thennpm run verify:toolfor key slugs, usingCROSS_TOOL_UPDATE=1once because the isolation gate detects cross-tool i18n edits.
Root cause / analysis
- Missing tool page modules caused
verify:toolwiring failures when prerendering tools. scripts/build-site.mjsusedfs.unlink()on expected devlog HTML cleanup targets without guarding for concurrent runs, producingENOENTand aborting site build.- SEO validation (
validate-tool-seo.mjs) checks per-language meta descriptions for required keyword presence and minimum length; the auto-generated*_descriptionstrings for some PDF tools (and a few adjacent tools) did not meet these constraints. - The
check-pdf-a-compliancesmoke test expects a literalloadSample()function name in client script; the first implementation only ran sample generation viamakeSamplePdf()without the required wrapper. - Tool isolation failure occurred when running
verify:toolafter updating multiple tools’ i18n; the gate requiresCROSS_TOOL_UPDATE=1for that situation.
Solution
- Added 8 missing tool page files under
src/pages/(client-side, local processing only) and ensured export names match tool-catalog shards. - Patched
scripts/build-site.mjsto ignoreENOENTwhen deleting orphan devlog HTML. - Strengthened tool meta descriptions via i18n shard edits, then regenerated merged dictionaries with
npm run merge:tools. - Updated
checkPdfACompliancePage.tsto include an explicitloadSample()function and call it on load, matching smoke tests. - Ensured
lint:seoexits cleanly and verified tool pages withverify:tool(withCROSS_TOOL_UPDATE=1).
Notes / boundaries
- This round only fully implemented the “PDF scene tool” subset (10/22 slugs): remaining PDF slugs listed in the planner still require tool-catalog shards, i18n, icons, and page implementations.
- The PDF/A compliance “check” page is intentionally a lightweight client-side heuristic checker, not a full verifier.
[actions]
- Updated:
src/pages/combineFilesIntoOnePdfPage.ts - Updated:
src/pages/convertHtmlToPdfPage.ts - Updated:
src/pages/addTextToPdfFilePage.ts - Updated:
src/pages/writePdfDocumentOnlinePage.ts - Updated:
src/pages/checkPdfACompliancePage.ts - Updated:
src/pages/compareTwoPdfsPage.ts - Updated:
src/pages/makePdfFlipbookPage.ts - Updated:
src/pages/printPdfPage.ts - Updated:
scripts/build-site.mjs - Updated:
src/site/tool-catalog.d/check-pdf-a-compliance.json - Updated:
src/site/i18n/tools/**/{lang}.ts(tool*_descriptionkeyword/length fixes) - Ran:
npm run merge:tools - Ran:
npm run lint:seo - Ran:
npm run verify:tool -- --slug=<tool>