Skip to content

Commit fc1ee2f

Browse files
committed
Add prettierrc and reformat project with new prettier config
Closes #14
1 parent cb757d7 commit fc1ee2f

16 files changed

+194
-120
lines changed

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tabWidth": 2,
3+
"singleQuote": true,
4+
"useTabs": false,
5+
"printWidth": 80
6+
}

app/components/catalyst/fieldset.tsx

+44-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
import * as Headless from '@headlessui/react'
2-
import clsx from 'clsx'
3-
import type React from 'react'
1+
import * as Headless from '@headlessui/react';
2+
import clsx from 'clsx';
3+
import type React from 'react';
44

5-
export function Fieldset({ className, ...props }: { className?: string } & Omit<Headless.FieldsetProps, 'className'>) {
5+
export function Fieldset({
6+
className,
7+
...props
8+
}: { className?: string } & Omit<Headless.FieldsetProps, 'className'>) {
69
return (
710
<Headless.Fieldset
811
{...props}
9-
className={clsx(className, '[&>*+[data-slot=control]]:mt-6 [&>[data-slot=text]]:mt-1')}
12+
className={clsx(
13+
className,
14+
'[&>*+[data-slot=control]]:mt-6 [&>[data-slot=text]]:mt-1'
15+
)}
1016
/>
11-
)
17+
);
1218
}
1319

14-
export function Legend({ className, ...props }: { className?: string } & Omit<Headless.LegendProps, 'className'>) {
20+
export function Legend({
21+
className,
22+
...props
23+
}: { className?: string } & Omit<Headless.LegendProps, 'className'>) {
1524
return (
1625
<Headless.Legend
1726
data-slot="legend"
@@ -21,14 +30,26 @@ export function Legend({ className, ...props }: { className?: string } & Omit<He
2130
'text-base/6 font-semibold text-zinc-950 data-[disabled]:opacity-50 sm:text-sm/6 dark:text-white'
2231
)}
2332
/>
24-
)
33+
);
2534
}
2635

27-
export function FieldGroup({ className, ...props }: React.ComponentPropsWithoutRef<'div'>) {
28-
return <div data-slot="control" {...props} className={clsx(className, 'space-y-8')} />
36+
export function FieldGroup({
37+
className,
38+
...props
39+
}: React.ComponentPropsWithoutRef<'div'>) {
40+
return (
41+
<div
42+
data-slot="control"
43+
{...props}
44+
className={clsx(className, 'space-y-8')}
45+
/>
46+
);
2947
}
3048

31-
export function Field({ className, ...props }: { className?: string } & Omit<Headless.FieldProps, 'className'>) {
49+
export function Field({
50+
className,
51+
...props
52+
}: { className?: string } & Omit<Headless.FieldProps, 'className'>) {
3253
return (
3354
<Headless.Field
3455
{...props}
@@ -42,10 +63,13 @@ export function Field({ className, ...props }: { className?: string } & Omit<Hea
4263
'[&>[data-slot=label]]:font-medium'
4364
)}
4465
/>
45-
)
66+
);
4667
}
4768

48-
export function Label({ className, ...props }: { className?: string } & Omit<Headless.LabelProps, 'className'>) {
69+
export function Label({
70+
className,
71+
...props
72+
}: { className?: string } & Omit<Headless.LabelProps, 'className'>) {
4973
return (
5074
<Headless.Label
5175
data-slot="label"
@@ -55,7 +79,7 @@ export function Label({ className, ...props }: { className?: string } & Omit<Hea
5579
'select-none text-base/6 text-zinc-950 data-[disabled]:opacity-50 sm:text-sm/6 dark:text-white'
5680
)}
5781
/>
58-
)
82+
);
5983
}
6084

6185
export function Description({
@@ -71,7 +95,7 @@ export function Description({
7195
'text-base/6 text-zinc-500 data-[disabled]:opacity-50 sm:text-sm/6 dark:text-zinc-400'
7296
)}
7397
/>
74-
)
98+
);
7599
}
76100

77101
export function ErrorMessage({
@@ -82,7 +106,10 @@ export function ErrorMessage({
82106
<Headless.Description
83107
data-slot="error"
84108
{...props}
85-
className={clsx(className, 'text-base/6 text-red-600 data-[disabled]:opacity-50 sm:text-sm/6 dark:text-red-500')}
109+
className={clsx(
110+
className,
111+
'text-base/6 text-red-600 data-[disabled]:opacity-50 sm:text-sm/6 dark:text-red-500'
112+
)}
86113
/>
87-
)
114+
);
88115
}

app/components/catalyst/select.tsx

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
import * as Headless from '@headlessui/react'
2-
import clsx from 'clsx'
3-
import React, { forwardRef } from 'react'
1+
import * as Headless from '@headlessui/react';
2+
import clsx from 'clsx';
3+
import React, { forwardRef } from 'react';
44

55
export const Select = forwardRef(function Select(
6-
{ className, multiple, ...props }: { className?: string } & Omit<Headless.SelectProps, 'className'>,
6+
{
7+
className,
8+
multiple,
9+
...props
10+
}: { className?: string } & Omit<Headless.SelectProps, 'className'>,
711
ref: React.ForwardedRef<HTMLSelectElement>
812
) {
913
return (
@@ -58,11 +62,21 @@ export const Select = forwardRef(function Select(
5862
aria-hidden="true"
5963
fill="none"
6064
>
61-
<path d="M5.75 10.75L8 13L10.25 10.75" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round" />
62-
<path d="M10.25 5.25L8 3L5.75 5.25" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round" />
65+
<path
66+
d="M5.75 10.75L8 13L10.25 10.75"
67+
strokeWidth={1.5}
68+
strokeLinecap="round"
69+
strokeLinejoin="round"
70+
/>
71+
<path
72+
d="M10.25 5.25L8 3L5.75 5.25"
73+
strokeWidth={1.5}
74+
strokeLinecap="round"
75+
strokeLinejoin="round"
76+
/>
6377
</svg>
6478
</span>
6579
)}
6680
</span>
67-
)
68-
})
81+
);
82+
});

app/components/catalyst/text.tsx

+31-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
import clsx from 'clsx'
2-
import { Link } from './link'
1+
import clsx from 'clsx';
2+
import { Link } from './link';
33

4-
export function Text({ className, ...props }: React.ComponentPropsWithoutRef<'p'>) {
4+
export function Text({
5+
className,
6+
...props
7+
}: React.ComponentPropsWithoutRef<'p'>) {
58
return (
69
<p
710
data-slot="text"
811
{...props}
9-
className={clsx(className, 'text-base/6 text-zinc-500 sm:text-sm/6 dark:text-zinc-400')}
12+
className={clsx(
13+
className,
14+
'text-base/6 text-zinc-500 sm:text-sm/6 dark:text-zinc-400'
15+
)}
1016
/>
11-
)
17+
);
1218
}
1319

14-
export function TextLink({ className, ...props }: React.ComponentPropsWithoutRef<typeof Link>) {
20+
export function TextLink({
21+
className,
22+
...props
23+
}: React.ComponentPropsWithoutRef<typeof Link>) {
1524
return (
1625
<Link
1726
{...props}
@@ -20,14 +29,25 @@ export function TextLink({ className, ...props }: React.ComponentPropsWithoutRef
2029
'text-zinc-950 underline decoration-zinc-950/50 data-[hover]:decoration-zinc-950 dark:text-white dark:decoration-white/50 dark:data-[hover]:decoration-white'
2130
)}
2231
/>
23-
)
32+
);
2433
}
2534

26-
export function Strong({ className, ...props }: React.ComponentPropsWithoutRef<'strong'>) {
27-
return <strong {...props} className={clsx(className, 'font-medium text-zinc-950 dark:text-white')} />
35+
export function Strong({
36+
className,
37+
...props
38+
}: React.ComponentPropsWithoutRef<'strong'>) {
39+
return (
40+
<strong
41+
{...props}
42+
className={clsx(className, 'font-medium text-zinc-950 dark:text-white')}
43+
/>
44+
);
2845
}
2946

30-
export function Code({ className, ...props }: React.ComponentPropsWithoutRef<'code'>) {
47+
export function Code({
48+
className,
49+
...props
50+
}: React.ComponentPropsWithoutRef<'code'>) {
3151
return (
3252
<code
3353
{...props}
@@ -36,5 +56,5 @@ export function Code({ className, ...props }: React.ComponentPropsWithoutRef<'co
3656
'rounded border border-zinc-950/10 bg-zinc-950/[2.5%] px-0.5 text-sm font-medium text-zinc-950 sm:text-[0.8125rem] dark:border-white/20 dark:bg-white/5 dark:text-white'
3757
)}
3858
/>
39-
)
59+
);
4060
}

app/components/catalyst/textarea.tsx

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
import * as Headless from '@headlessui/react'
2-
import clsx from 'clsx'
3-
import React, { forwardRef } from 'react'
1+
import * as Headless from '@headlessui/react';
2+
import clsx from 'clsx';
3+
import React, { forwardRef } from 'react';
44

55
export const Textarea = forwardRef(function Textarea(
66
{
77
className,
88
resizable = true,
99
...props
10-
}: { className?: string; resizable?: boolean } & Omit<Headless.TextareaProps, 'className'>,
10+
}: { className?: string; resizable?: boolean } & Omit<
11+
Headless.TextareaProps,
12+
'className'
13+
>,
1114
ref: React.ForwardedRef<HTMLTextAreaElement>
1215
) {
1316
return (
@@ -50,5 +53,5 @@ export const Textarea = forwardRef(function Textarea(
5053
])}
5154
/>
5255
</span>
53-
)
54-
})
56+
);
57+
});

app/components/pipeline/nodes/NodeFrame.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,14 @@ export function NodeFrame({
109109
{children}
110110
</div>
111111
{error && (
112-
<div className="flex items-center justify-between bg-red-400 dark:bg-red-700 rounded-xl rounded-t-none py-1 px-2">
112+
<div
113+
className={clsx([
114+
'flex items-center justify-between',
115+
'bg-red-400 dark:bg-red-700',
116+
'rounded-xl rounded-t-none',
117+
'py-1 px-2',
118+
])}
119+
>
113120
<NodeError error={error} />
114121
</div>
115122
)}

app/entry.client.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* For more information, see https://remix.run/file-conventions/entry.client
55
*/
66

7-
import { RemixBrowser } from "@remix-run/react";
8-
import { startTransition, StrictMode } from "react";
9-
import { hydrateRoot } from "react-dom/client";
7+
import { RemixBrowser } from '@remix-run/react';
8+
import { startTransition, StrictMode } from 'react';
9+
import { hydrateRoot } from 'react-dom/client';
1010

1111
startTransition(() => {
1212
hydrateRoot(

app/entry.server.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
* For more information, see https://remix.run/file-conventions/entry.server
55
*/
66

7-
import { PassThrough } from "node:stream";
7+
import { PassThrough } from 'node:stream';
88

9-
import type { AppLoadContext, EntryContext } from "@remix-run/node";
10-
import { createReadableStreamFromReadable } from "@remix-run/node";
11-
import { RemixServer } from "@remix-run/react";
12-
import { isbot } from "isbot";
13-
import { renderToPipeableStream } from "react-dom/server";
9+
import type { AppLoadContext, EntryContext } from '@remix-run/node';
10+
import { createReadableStreamFromReadable } from '@remix-run/node';
11+
import { RemixServer } from '@remix-run/react';
12+
import { isbot } from 'isbot';
13+
import { renderToPipeableStream } from 'react-dom/server';
1414

1515
const ABORT_DELAY = 5_000;
1616

@@ -24,7 +24,7 @@ export default function handleRequest(
2424
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2525
loadContext: AppLoadContext
2626
) {
27-
return isbot(request.headers.get("user-agent") || "")
27+
return isbot(request.headers.get('user-agent') || '')
2828
? handleBotRequest(
2929
request,
3030
responseStatusCode,
@@ -59,7 +59,7 @@ function handleBotRequest(
5959
const body = new PassThrough();
6060
const stream = createReadableStreamFromReadable(body);
6161

62-
responseHeaders.set("Content-Type", "text/html");
62+
responseHeaders.set('Content-Type', 'text/html');
6363

6464
resolve(
6565
new Response(stream, {
@@ -109,7 +109,7 @@ function handleBrowserRequest(
109109
const body = new PassThrough();
110110
const stream = createReadableStreamFromReadable(body);
111111

112-
responseHeaders.set("Content-Type", "text/html");
112+
responseHeaders.set('Content-Type', 'text/html');
113113

114114
resolve(
115115
new Response(stream, {

examples/compare.json

+4-10
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@
4949
}
5050
]
5151
},
52-
"connectsTo": [
53-
"extract-features"
54-
],
52+
"connectsTo": ["extract-features"],
5553
"expanded": true
5654
},
5755
"output": {
@@ -128,9 +126,7 @@
128126
"type": "llm",
129127
"input": "doc",
130128
"prompt": "You are tasked with extracting product features from the following text description. Carefully read the provided document and identify the key characteristics, attributes, and functionalities of the product being described. Consider aspects such as size, color, material, unique selling points, and any other relevant features. Present your findings in a clear and organized manner, using bullet points or a list format to ensure readability. Focus on extracting only the essential features without any additional commentary or unrelated information. Please process the document now.",
131-
"connectsTo": [
132-
"compare-features"
133-
],
129+
"connectsTo": ["compare-features"],
134130
"expanded": true
135131
},
136132
{
@@ -140,9 +136,7 @@
140136
"type": "llm",
141137
"input": "aggregate-results",
142138
"prompt": "Please analyze the text document to identify and extract the features of all products mentioned. Once the features are extracted, compare these features across all products by identifying similarities and differences. Summarize your findings in a clear, structured format, using bullet points for easy readability. Ensure to focus on key aspects such as functionality, design, pricing, and unique attributes of each product. Highlight any noteworthy distinctions and commonalities to provide a comprehensive overview.",
143-
"connectsTo": [
144-
"output_0"
145-
],
139+
"connectsTo": ["output_0"],
146140
"expanded": true
147141
}
148142
],
@@ -175,4 +169,4 @@
175169
}
176170
}
177171
]
178-
}
172+
}

0 commit comments

Comments
 (0)