-
-
Notifications
You must be signed in to change notification settings - Fork 103
Add property preprocessors to @fedify/vocab-tools and normalize Link icon/image
#793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dahlia
wants to merge
14
commits into
fedify-dev:main
Choose a base branch
from
dahlia:issue-792-property-preprocessors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,797
−1,797
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1630f55
Add vocabulary property preprocessors to vocab-tools
dahlia 82ec5ea
Normalize Link icon and image values to Image objects
dahlia 469803e
Document property preprocessor changes
dahlia e479455
Expand JSON-LD before preprocessors in property path
dahlia 1db7fb7
Update Node.js and Bun snapshots for preprocessor changes
dahlia bbfe8d0
Use static imports and fix review issues
dahlia 3152298
Guard blank-node IDs in remaining URL construction sites
dahlia cc35832
Resolve relative @id URLs against baseUrl in decoder
dahlia 57eb851
Throw on missing preprocessor module and extract baseUrl
dahlia 6a5265a
Compute resolved URL once for both options.baseUrl and _baseUrl
dahlia 2185439
Add JSDoc to new exported APIs
dahlia 456127f
Note normalizeLinkToImage is exported in CHANGES.md
dahlia 14d24ad
Update Node.js and Bun snapshots for codegen changes
dahlia 0749718
Update Deno snapshot for codegen changes
dahlia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import type { DocumentLoader } from "./docloader.ts"; | ||
| import type { TracerProvider } from "@opentelemetry/api"; | ||
|
|
||
| /** | ||
| * JSON value shape passed to property preprocessors. | ||
| * @since 2.3.0 | ||
| */ | ||
| export type Json = | ||
| | string | ||
| | number | ||
| | boolean | ||
| | null | ||
| | readonly Json[] | ||
| | { readonly [key: string]: Json }; | ||
|
|
||
| /** | ||
| * Runtime context provided to property preprocessors. | ||
| * @since 2.3.0 | ||
| */ | ||
| export interface PropertyPreprocessorContext { | ||
| /** Loader for remote JSON-LD documents. */ | ||
| documentLoader?: DocumentLoader; | ||
| /** Loader for remote JSON-LD contexts. */ | ||
| contextLoader?: DocumentLoader; | ||
| /** OpenTelemetry tracer provider for instrumentation. */ | ||
| tracerProvider?: TracerProvider; | ||
| /** Base URL for resolving relative references. */ | ||
| baseUrl?: URL; | ||
| } | ||
|
|
||
| /** | ||
| * Function signature for schema-configured property preprocessors. | ||
| * | ||
| * Receives an expanded JSON-LD property value and returns a vocabulary | ||
| * object when the value is handled, `undefined` when the value should | ||
| * fall through to the normal range decoder, or an `Error` when the value | ||
| * is recognized but cannot be converted. | ||
| * @since 2.3.0 | ||
| */ | ||
| export type PropertyPreprocessor<T = unknown> = ( | ||
| value: Json, | ||
| context: PropertyPreprocessorContext, | ||
| ) => T | undefined | Error | Promise<T | undefined | Error>; | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.