Skip to content

Inheritables: refactor, harden#250

Merged
janezd merged 1 commit into
biolab:masterfrom
janezd:refactor-inheritables
Jun 16, 2026
Merged

Inheritables: refactor, harden#250
janezd merged 1 commit into
biolab:masterfrom
janezd:refactor-inheritables

Conversation

@janezd

@janezd janezd commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
  • Move type definitions to shared module
  • Harden type definitions
  • Simplify and harden getInheritable

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 resources map plus ResourceType/InheritableResources types in @/types.
  • Updated ingest logic to use the shared resource definitions and hardened types around db handling.
  • Simplified getInheritable to return /{matchedPath}/{resourceFile} based on ResourceType.

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 in getMetadata, 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.

Comment thread types/index.ts
Comment thread types/index.ts
Comment thread ingest/updatePaths.ts Outdated
Comment thread ingest/inheritables.ts Outdated
@janezd janezd force-pushed the refactor-inheritables branch from f59a601 to 5eb4577 Compare June 16, 2026 13:17
@janezd janezd merged commit 91f4451 into biolab:master Jun 16, 2026
1 check passed
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.

2 participants