mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
feat(i18n): per-entity content, per-group UI, page manifests (spec-v4-data-organization)
- split content.json -> content/{profile,skills,experience,projects}.json and
ui.json -> 14 feature-group files (vi+en); index.ts merges both trees and
asserts the merge against the group lists; merged CONTENT verified
byte-identical against pre-split baseline dumps
- src/data/pages/*.json: 8 per-route manifests + pages.ts loader +
PageId/PageManifestClaim/PageManifest types; validate.ts rules 1-4 (unknown
entity, unknown ui group, unresolvable field path, orphan text field,
missing manifest) - all five rejects verified by a throwaway harness
- draft.ts: data-driven registry of the 12 writable documents (4 structure +
8 text); describeField() names the per-entity file; smoke-draft fixtures
follow the new registry (8/8)
- EditBar: 'appears on' page annotations computed from the manifests
- remove JsonPanel.tsx + panel labels (inline-editing task 8); docs: AGENTS.md
Data Layer / Live Edit Mode / Component Structure, v4 spec progress tables
This commit is contained in:
1 parent
dad5f3edd7
commit
939260e4fb
69 files changed
+1816
-1596
No files matched your search
+32
-13
@@ -1,23 +1,42 @@
|
||||
// CLI over the shared validator (spec-v4 §3.6): the CI build gate and, from
|
||||
// Phase 3 on, the save gate. A malformed content document fails here with
|
||||
// exact document paths, so the last good deploy stays live.
|
||||
// CLI over the shared validator (spec-v4 §3.6, spec-v4-data-organization §5.1):
|
||||
// the CI build gate and, from Phase 3 on, the save gate. A malformed content
|
||||
// or manifest document fails here with exact file paths, so the last good
|
||||
// deploy stays live.
|
||||
import { experiences } from '../src/data/experience';
|
||||
import { profile } from '../src/data/profile';
|
||||
import { projects } from '../src/data/projects';
|
||||
import { skillGroups } from '../src/data/skills';
|
||||
import contentEnJson from '../src/i18n/locales/en/content.json';
|
||||
import contentViJson from '../src/i18n/locales/vi/content.json';
|
||||
import experienceEnJson from '../src/i18n/locales/en/content/experience.json';
|
||||
import experienceViJson from '../src/i18n/locales/vi/content/experience.json';
|
||||
import profileEnJson from '../src/i18n/locales/en/content/profile.json';
|
||||
import profileViJson from '../src/i18n/locales/vi/content/profile.json';
|
||||
import projectsEnJson from '../src/i18n/locales/en/content/projects.json';
|
||||
import projectsViJson from '../src/i18n/locales/vi/content/projects.json';
|
||||
import skillsEnJson from '../src/i18n/locales/en/content/skills.json';
|
||||
import skillsViJson from '../src/i18n/locales/vi/content/skills.json';
|
||||
import { UI } from '../src/i18n';
|
||||
import type { ContentEn, ContentVi } from '../src/i18n/dict-types';
|
||||
import { collectContentIssues } from '../src/i18n/validate';
|
||||
import { collectContentIssues, collectManifestIssues } from '../src/i18n/validate';
|
||||
|
||||
const contentVi: ContentVi = contentViJson;
|
||||
const contentEn: ContentEn = contentEnJson;
|
||||
const contentVi: ContentVi = {
|
||||
profile: profileViJson,
|
||||
skills: skillsViJson,
|
||||
experience: experienceViJson,
|
||||
projects: projectsViJson,
|
||||
};
|
||||
const contentEn: ContentEn = {
|
||||
profile: profileEnJson,
|
||||
skills: skillsEnJson,
|
||||
experience: experienceEnJson,
|
||||
projects: projectsEnJson,
|
||||
};
|
||||
|
||||
const issues = collectContentIssues(
|
||||
{ profile, skills: skillGroups, experience: experiences, projects },
|
||||
contentVi,
|
||||
contentEn,
|
||||
);
|
||||
const structures = { profile, skills: skillGroups, experience: experiences, projects };
|
||||
|
||||
const issues = [
|
||||
...collectContentIssues(structures, contentVi, contentEn),
|
||||
...collectManifestIssues(structures, contentVi, contentEn, Object.keys(UI.vi)),
|
||||
];
|
||||
|
||||
if (issues.length > 0) {
|
||||
console.error(`content validation failed (${issues.length} issue(s)):`);
|
||||
|
||||
Reference in new issue
Block a user