WEBDEV-8510: Migrate metadata-service into elements#54
Open
jbuckner wants to merge 4 commits into
Open
Conversation
Moves @internetarchive/metadata-service into src/services/metadata-service/. Rewrites field-parsers / iaux-item-metadata / result-type imports to the in-tree @src/* paths landed by WEBDEV-8507, WEBDEV-8508, WEBDEV-8509. The MetadataServiceErrorType enum became a const object to satisfy erasableSyntaxOnly. Tests ported to vitest; default-backend tests restore window.fetch via afterEach instead of inline try/finally. The mock-response-generator helper was inlined into the test file (reduced to a single small function) to avoid shipping a test helper in the published dist. Also brings in src/types/result.ts from WEBDEV-8508 since this branch is stacked on 8509 (which is stacked on 8507) — when 8508 lands first, this commit's result.ts becomes a no-op via rebase. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…rate-metadata-service
The migrated metadata-service test mocks declared interface params (identifier/keypath, fetch input) they don't use. The source repo silenced this via eslint-disable, but elements' tsc build has noUnusedParameters on and TS6133 isn't covered by that eslint comment. Prefix the intentionally unused params with _ so the build passes while keeping the mock signatures. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Add an interactive `metadata-service-story` built on the shared `story-template`. It performs a live fetch against the archive.org metadata API via `MetadataService.default`, exercising `fetchMetadata` and `fetchMetadataValue` and rendering the `Result` (a modeled `MetadataResponse`, or a `MetadataServiceError`). Broaden the demo `app-root.ts` glob to `../src/**/*-story.ts` so stories outside `elements`/`labs` are auto-discovered. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move
@internetarchive/metadata-serviceintosrc/services/metadata-service/— terminal node of the consolidation chain.Stacked on #53 (→ #51); effectively needs field-parsers + item-metadata + result-type in tree. The
src/types/result.tshere collapses to a no-op once #52 lands.result-type→@src/types/result, item-metadata barrel → individual@src/models/....metadata-service-error.ts:enum→const … as const(string values unchanged, equality checks still pass).No runtime change; build + tests green. QA-waived (code move).
WEBDEV-8510