Skip to content

Commit 89e2c4e

Browse files
authored
chore(ui): align prettier across all three UI workspaces and enforce it in the ui:lint chain (#8193)
Root cause of the #8182 docs mangling: prettier coverage differed between what 'npm run format' would rewrite locally and what CI checked (nothing). Now the three UI workspaces agree everywhere: - .prettierignore in every workspace covers the generated artifacts (openapi.json, routeTree.gen.ts, dist, CHANGELOG.md) and — deliberately — content/docs: prettier's mdx pass reformats the template-literal code inside <CodeBlock code={`...`}> attributes, destroying embedded YAML/compose indentation. Docs mdx stays formatter-free. - One mechanical reformat brings every remaining file to prettier-clean. - Each workspace gains format:check, wired into the root ui:lint chain that CI's validate job and npm run test:ci already run — local format runs and CI now enforce the identical surface, so drift of this class cannot land silently again.
1 parent 46d7877 commit 89e2c4e

52 files changed

Lines changed: 1207 additions & 670 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
dist
3+
.output
4+
.vinxi
5+
package-lock.json
6+
routeTree.gen.ts

apps/loopover-miner-ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"typecheck": "tsc --noEmit",
1313
"lint": "eslint .",
1414
"test": "vitest run --coverage",
15-
"format": "prettier --write ."
15+
"format": "prettier --write .",
16+
"format:check": "prettier --check ."
1617
},
1718
"dependencies": {
1819
"@loopover/ui-kit": ">=0.1.0 <2.0.0",

apps/loopover-ui/.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ pnpm-lock.yaml
66
package-lock.json
77
bun.lock
88
routeTree.gen.ts
9+
# Generated -- regenerated by npm run ui:openapi; formatting churn only creates drift-check noise.
10+
public/openapi.json
11+
# Hand-authored docs content: prettier's mdx pass reformats the template-literal code inside
12+
# <CodeBlock code={`...`}> attributes, destroying embedded YAML/compose indentation (#8182 fallout,
13+
# repaired once already). Docs mdx is deliberately formatter-free.
14+
content/docs

apps/loopover-ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"typecheck": "tsc --noEmit",
2020
"lint": "eslint .",
2121
"test": "vitest run",
22-
"format": "prettier --write ."
22+
"format": "prettier --write .",
23+
"format:check": "prettier --check ."
2324
},
2425
"dependencies": {
2526
"@loopover/ui-kit": ">=0.1.0 <2.0.0",

apps/loopover-ui/src/chat-ui-primitives-audit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ against the four primitives #6230 will eventually need. No code changes accompan
3737
- **`apps/loopover-ui/src/components/site/command-palette.tsx`** (`CommandPalette`) has the only
3838
bare `<input>` + live-filtered scrollable `<ul>` combination in the app (⌘K-triggered, `Escape`
3939
closes it, results navigate on click). It's close to "text input driving a list," but it is a
40-
*search-and-navigate* palette, not a composer: there's no `onKeyDown` handling for `Enter` at all
40+
_search-and-navigate_ palette, not a composer: there's no `onKeyDown` handling for `Enter` at all
4141
(results are selected by click, not by keyboard submit), no multi-line/auto-grow textarea, and no
4242
concept of "submit this text as a message." A submit-on-Enter composer would need to be built new,
4343
informed by this file's open/close and keyboard-listener patterns rather than by reusing its input.
@@ -61,11 +61,11 @@ against the four primitives #6230 will eventually need. No code changes accompan
6161
- **A live streaming-text consumer.** Grepping `apps/loopover-ui/src` for
6262
`EventSource|ReadableStream|text/event-stream|streaming` returns exactly one hit outside this
6363
audit: a comment in `apps/loopover-ui/src/lib/analytics-proxy.ts` explaining that the analytics
64-
proxy buffers its (tiny) request body specifically so it does *not* need a streaming/duplex
64+
proxy buffers its (tiny) request body specifically so it does _not_ need a streaming/duplex
6565
request — i.e. the one file that mentions "streaming" is explicitly the case of avoiding it. There
6666
is no code anywhere in the app that consumes an `EventSource`, a `fetch` response's `ReadableStream`
6767
body, or a `text/event-stream` response today. `animated-terminal.tsx` (above) is the closest
68-
*rendering* precedent, but it has no real stream to consume from.
68+
_rendering_ precedent, but it has no real stream to consume from.
6969
- **A chat-bubble / message-list component.** Nothing pairs an avatar, a role-colored bubble, and a
7070
timestamp into a reusable per-message unit. `audit-feed.tsx`'s table rows are the nearest list
7171
pattern, but as noted above they're tabular, not conversational.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"ui:kit:build": "npm run build --workspace @loopover/ui-kit",
6161
"ui:build": "npm run ui:kit:build && turbo run build --filter=@loopover/engine && npm run ui:openapi && npm run extension:build && npm run miner-extension:build && npm --workspace @loopover/ui run build && npm --workspace @loopover/ui-miner run build",
6262
"ui:preview": "npm run ui:build && wrangler dev --config apps/loopover-ui/dist/server/wrangler.json --ip 127.0.0.1 --port 4173 --local",
63-
"ui:lint": "npm run ui:kit:build && npm --workspace @loopover/ui run lint && npm --workspace @loopover/ui-miner run lint",
63+
"ui:lint": "npm run ui:kit:build && npm --workspace @loopover/ui-kit run format:check && npm --workspace @loopover/ui run format:check && npm --workspace @loopover/ui run lint && npm --workspace @loopover/ui-miner run format:check && npm --workspace @loopover/ui-miner run lint",
6464
"ui:typecheck": "npm run ui:kit:build && npm --workspace @loopover/ui run typecheck && npm --workspace @loopover/ui-miner run typecheck",
6565
"preui:test": "npm run check-node-version",
6666
"ui:test": "npm run ui:kit:build && npm --workspace @loopover/ui run test && npm --workspace @loopover/ui-miner run test && npm --workspace @loopover/miner-extension run test",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
CHANGELOG.md

packages/loopover-ui-kit/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
"scripts": {
4545
"build": "tsc -p tsconfig.json",
4646
"typecheck": "tsc -p tsconfig.json --noEmit",
47-
"test": "vitest run"
47+
"test": "vitest run",
48+
"format": "prettier --write .",
49+
"format:check": "prettier --check ."
4850
},
4951
"peerDependencies": {
5052
"react": "^19.2.7",

packages/loopover-ui-kit/src/components/accordion.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const AccordionItem = React.forwardRef<
1010
React.ElementRef<typeof AccordionPrimitive.Item>,
1111
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
1212
>(({ className, ...props }, ref) => (
13-
<AccordionPrimitive.Item ref={ref} className={cn("border-b", className)} {...props} />
13+
<AccordionPrimitive.Item
14+
ref={ref}
15+
className={cn("border-b", className)}
16+
{...props}
17+
/>
1418
));
1519
AccordionItem.displayName = "AccordionItem";
1620

packages/loopover-ui-kit/src/components/alert-dialog.tsx

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,29 @@ const AlertDialogContent = React.forwardRef<
4343
));
4444
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
4545

46-
const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
47-
<div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...props} />
46+
const AlertDialogHeader = ({
47+
className,
48+
...props
49+
}: React.HTMLAttributes<HTMLDivElement>) => (
50+
<div
51+
className={cn(
52+
"flex flex-col space-y-2 text-center sm:text-left",
53+
className,
54+
)}
55+
{...props}
56+
/>
4857
);
4958
AlertDialogHeader.displayName = "AlertDialogHeader";
5059

51-
const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
60+
const AlertDialogFooter = ({
61+
className,
62+
...props
63+
}: React.HTMLAttributes<HTMLDivElement>) => (
5264
<div
53-
className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
65+
className={cn(
66+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
67+
className,
68+
)}
5469
{...props}
5570
/>
5671
);
@@ -78,13 +93,18 @@ const AlertDialogDescription = React.forwardRef<
7893
{...props}
7994
/>
8095
));
81-
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
96+
AlertDialogDescription.displayName =
97+
AlertDialogPrimitive.Description.displayName;
8298

8399
const AlertDialogAction = React.forwardRef<
84100
React.ElementRef<typeof AlertDialogPrimitive.Action>,
85101
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
86102
>(({ className, ...props }, ref) => (
87-
<AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />
103+
<AlertDialogPrimitive.Action
104+
ref={ref}
105+
className={cn(buttonVariants(), className)}
106+
{...props}
107+
/>
88108
));
89109
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
90110

@@ -94,7 +114,11 @@ const AlertDialogCancel = React.forwardRef<
94114
>(({ className, ...props }, ref) => (
95115
<AlertDialogPrimitive.Cancel
96116
ref={ref}
97-
className={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)}
117+
className={cn(
118+
buttonVariants({ variant: "outline" }),
119+
"mt-2 sm:mt-0",
120+
className,
121+
)}
98122
{...props}
99123
/>
100124
));

0 commit comments

Comments
 (0)