Skip to content

Commit c7f4170

Browse files
committed
cleanup
1 parent 483af13 commit c7f4170

File tree

8 files changed

+48
-20
lines changed

8 files changed

+48
-20
lines changed

apps/template-nextjs/Components/GraphImage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ function getImageUrl(src: string | undefined | Blob) {
1010
export function GraphImage(
1111
props: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>,
1212
) {
13+
// biome-ignore lint/a11y/useAltText: should be provided with the props
1314
return <img {...props} src={getImageUrl(props.src)} />;
1415
}

apps/template-nextjs/Components/Space/PrivateSpace.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function PrivateSpace() {
3737
return (
3838
<div className="flex items-center justify-center min-h-screen">
3939
<div className="text-center">
40-
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"></div>
40+
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4" />
4141
<p className="text-muted-foreground">Loading space...</p>
4242
</div>
4343
</div>
@@ -51,7 +51,7 @@ function PrivateSpace() {
5151
setProjectDescription('');
5252
};
5353

54-
const publishToPublicSpace = async (project: Project) => {
54+
const publishToPublicSpace = async (project: typeof Project) => {
5555
if (!selectedSpace) {
5656
alert('No space selected');
5757
return;
@@ -191,6 +191,7 @@ function PrivateSpace() {
191191
fill="none"
192192
viewBox="0 0 24 24"
193193
stroke="currentColor"
194+
aria-hidden="true"
194195
>
195196
<path
196197
strokeLinecap="round"

apps/template-nextjs/Components/Space/PublicSpace.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ function PublicSpace() {
7373
<p className="text-sm text-gray-600 mb-2 line-clamp-2">{project.description}</p>
7474
)}
7575

76-
{/* Project xUrl */}
77-
{project.xUrl && (
76+
{/* Project x */}
77+
{project.x && (
7878
<a
79-
href={project.xUrl}
79+
href={project.x}
8080
target="_blank"
8181
rel="noopener noreferrer"
8282
className="text-sm text-blue-600 hover:text-blue-800 transition-colors duration-200 flex items-center gap-1"
8383
>
84-
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
84+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
8585
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
8686
</svg>
8787
View on X
@@ -99,7 +99,13 @@ function PublicSpace() {
9999
{isPending === false && projects.length === 0 && (
100100
<div className="text-center py-16">
101101
<div className="w-24 h-24 bg-gradient-to-br from-blue-100 to-purple-100 rounded-full flex items-center justify-center mx-auto mb-6">
102-
<svg className="w-12 h-12 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
102+
<svg
103+
className="w-12 h-12 text-blue-400"
104+
fill="none"
105+
stroke="currentColor"
106+
viewBox="0 0 24 24"
107+
aria-hidden="true"
108+
>
103109
<path
104110
strokeLinecap="round"
105111
strokeLinejoin="round"

apps/template-nextjs/app/explore-public-knowledge/projects/page.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ export default function ExploreProjectsPage() {
3131
<div className="max-w-md mx-auto mb-8">
3232
<div className="relative">
3333
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
34-
<svg className="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
34+
<svg
35+
className="h-5 w-5 text-gray-400"
36+
fill="none"
37+
stroke="currentColor"
38+
viewBox="0 0 24 24"
39+
aria-hidden="true"
40+
>
3541
<path
3642
strokeLinecap="round"
3743
strokeLinejoin="round"
@@ -81,14 +87,14 @@ export default function ExploreProjectsPage() {
8187

8288
{project.description && <p className="text-sm text-gray-600 mb-2 line-clamp-2">{project.description}</p>}
8389

84-
{project.xUrl && (
90+
{project.x && (
8591
<a
86-
href={project.xUrl}
92+
href={project.x}
8793
target="_blank"
8894
rel="noopener noreferrer"
8995
className="text-sm text-blue-600 hover:text-blue-800 transition-colors duration-200 flex items-center gap-1"
9096
>
91-
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
97+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9298
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
9399
</svg>
94100
View on X
@@ -104,7 +110,13 @@ export default function ExploreProjectsPage() {
104110
{isPending === false && projects.length === 0 && (
105111
<div className="text-center py-16">
106112
<div className="w-24 h-24 bg-gradient-to-br from-blue-100 to-purple-100 rounded-full flex items-center justify-center mx-auto mb-6">
107-
<svg className="w-12 h-12 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
113+
<svg
114+
className="w-12 h-12 text-blue-400"
115+
fill="none"
116+
stroke="currentColor"
117+
viewBox="0 0 24 24"
118+
aria-hidden="true"
119+
>
108120
<path
109121
strokeLinecap="round"
110122
strokeLinejoin="round"

apps/template-vite-react/src/routes/private-space/$space-id.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function PrivateSpace() {
4242
return (
4343
<div className="flex items-center justify-center min-h-screen">
4444
<div className="text-center">
45-
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"></div>
45+
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4" />
4646
<p className="text-muted-foreground">Loading space...</p>
4747
</div>
4848
</div>
@@ -171,6 +171,7 @@ function PrivateSpace() {
171171
fill="none"
172172
viewBox="0 0 24 24"
173173
stroke="currentColor"
174+
aria-hidden="true"
174175
>
175176
<path
176177
strokeLinecap="round"

apps/template-vite-react/src/routes/public-space/$space-id.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function PublicSpace() {
8585
rel="noopener noreferrer"
8686
className="text-sm text-blue-600 hover:text-blue-800 transition-colors duration-200 flex items-center gap-1"
8787
>
88-
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
88+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
8989
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
9090
</svg>
9191
View on X
@@ -103,7 +103,13 @@ function PublicSpace() {
103103
{isPending === false && projects.length === 0 && (
104104
<div className="text-center py-16">
105105
<div className="w-24 h-24 bg-gradient-to-br from-blue-100 to-purple-100 rounded-full flex items-center justify-center mx-auto mb-6">
106-
<svg className="w-12 h-12 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
106+
<svg
107+
className="w-12 h-12 text-blue-400"
108+
fill="none"
109+
stroke="currentColor"
110+
viewBox="0 0 24 24"
111+
aria-hidden="true"
112+
>
107113
<path
108114
strokeLinecap="round"
109115
strokeLinejoin="round"

docs/docs/query-public-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const mapping: Mapping.Mapping = {
9999
properties: {
100100
name: Id('a126ca53-0c8e-48d5-b888-82c734c38935'),
101101
description: Id('9b1f76ff-9711-404c-861e-59dc3fa7d037'),
102-
xUrl: Id('0d625978-4b3c-4b57-a86f-de45c997c73c'),
102+
x: Id('0d625978-4b3c-4b57-a86f-de45c997c73c'),
103103
},
104104
},
105105
};
@@ -141,8 +141,8 @@ export default function ProjectsExample() {
141141
{project.description && (
142142
<p>Description: {project.description}</p>
143143
)}
144-
{project.xUrl && (
145-
<a href={project.xUrl} target="_blank" rel="noopener noreferrer">
144+
{project.x && (
145+
<a href={project.x} target="_blank" rel="noopener noreferrer">
146146
View on X
147147
</a>
148148
)}

packages/hypergraph/src/entity/create.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ import type { DocumentContent, DocumentRelation, Entity } from './types.js';
1212
/**
1313
* Type utility to transform relation fields to accept string arrays instead of their typed values
1414
* This specifically targets Type.Relation fields which are arrays of objects
15+
* Relations can be provided as string arrays or left out completely (optional)
1516
*/
1617
type WithRelationsAsStringArrays<T> = {
1718
[K in keyof T]: T[K] extends readonly (infer U)[]
1819
? U extends object
19-
? string[]
20+
? string[] | undefined
2021
: T[K]
2122
: T[K] extends (infer U)[]
2223
? U extends object
23-
? string[]
24+
? string[] | undefined
2425
: T[K]
2526
: T[K];
2627
};

0 commit comments

Comments
 (0)