Skip to content

WEBDEV-8509: Migrate iaux-item-metadata into elements#53

Open
jbuckner wants to merge 2 commits into
WEBDEV-8507-migrate-field-parsersfrom
WEBDEV-8509-migrate-item-metadata
Open

WEBDEV-8509: Migrate iaux-item-metadata into elements#53
jbuckner wants to merge 2 commits into
WEBDEV-8507-migrate-field-parsersfrom
WEBDEV-8509-migrate-item-metadata

Conversation

@jbuckner
Copy link
Copy Markdown
Collaborator

@jbuckner jbuckner commented May 27, 2026

Summary

Moves @internetarchive/iaux-item-metadata into src/models/item-metadata/ per WEBDEV-8506 / #50. Item metadata models (File, Review, Metadata, SpeechMusicASREntry, Task) plus their field wrappers (BooleanField, ByteField, DurationField, ListField, etc.).

⚠️ Stacked on #51 (WEBDEV-8507-migrate-field-parsers) because the field-parsers must be in tree before item-metadata can import { BooleanParser } from '@src/parsers/...'. Base will auto-rebase to main when #51 merges.

Changes

  • src/models/item-metadata/ — 5 top-level models (file, metadata, review, speech-music-asr-entry, task).
  • src/models/item-metadata/metadata-fields/MetadataField base class plus 9 typed field wrappers (boolean, byte, date, duration, list, mediatype, number, page-progression, string).
  • Import rewrites — every @internetarchive/field-parsers import points at the in-tree @src/parsers/field-types/... path. Barrel imports of multiple parsers became one explicit import per parser (clearer + tree-shake-friendly). FieldParserInterface now imports from @src/parsers/field-parser-interface.
  • package.json — adds typescript-memoize as a runtime dependency (used by @Memoize() decorators on MetadataField accessors).
  • Tests — 11 test files ported to vitest, colocated with sources. The metadata.test.ts addeddate test was rewritten to use setUTCHours/... so it matches the Z-suffixed ISO timestamp regardless of the runner's local timezone (the old test relied on the wtr runner being in UTC).

Verification

  • npm run build
  • npm run test ✓ — 272 tests pass (61 new across item-metadata)
  • npm run circular

Order in the migration chain

  • Blocked by WEBDEV-8507 / #51 (field-parsers).
  • Blocks WEBDEV-8510 (metadata-service, which constructs Metadata / File / Review models).

Test plan

  • Build green
  • All tests pass (61 new)
  • No circular deps
  • Reviewer: confirm the multi-import-per-parser pattern reads OK in file.ts and list.ts (the two files that previously pulled multiple symbols from the barrel)
  • Reviewer: confirm typescript-memoize belongs in dependencies (it's used at runtime by @Memoize() decorators), not devDependencies

🤖 Generated with Claude Code

Moves @internetarchive/iaux-item-metadata models into
src/models/item-metadata/. Field-parser imports rewritten to
@src/parsers/* (the in-tree paths landed by WEBDEV-8507). Adds
typescript-memoize as a runtime dependency.

The addeddate test was using local-time setters to compare against
a UTC-suffixed ISO timestamp; switched to setUTCHours/etc so the
test isn't TZ-dependent under Vitest's browser provider.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

PR Preview Action v1.8.1

🚀 View preview at
https://internetarchive.github.io/elements/pr/pr-53/

Built to branch ghpages at 2026-05-28 21:00 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant