Inheritables: refactor, harden#250
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the “inheritables” resource model by centralizing resource definitions in the shared types module, tightening type safety, and simplifying getInheritable to derive the served filename from a single source of truth.
Changes:
- Added a shared
resourcesmap plusResourceType/InheritableResourcestypes in@/types. - Updated ingest logic to use the shared resource definitions and hardened types around
dbhandling. - Simplified
getInheritableto return/{matchedPath}/{resourceFile}based onResourceType.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| types/index.ts | Adds shared resources definition and related types used across ingest and API layers. |
| ingest/updatePaths.ts | Updates imports to consume InheritableResources from @/types. |
| ingest/inheritables.ts | Removes local resource definitions and uses the shared resources map for discovery. |
| api/content.ts | Hardens getInheritable to accept ResourceType and constructs URLs via shared resource metadata. |
Comments suppressed due to low confidence (1)
api/content.ts:55
return { ... }is over-indented ingetMetadata, which makes the block hard to read and may violate formatting rules.
return {
title, description,
...icon ? {icons: {icon}} : {}
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f59a601 to
5eb4577
Compare
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.
getInheritable