Skip to content

Commit 890d750

Browse files
authored
chore: upgrade Vite+ to 1.2.0 (#11)
Upgrade the workspace to Vite+ 1.2.0 and its bundled Vitest 5 toolchain. Preserve existing test and build entry points, format generated OpenAPI output, and record the migration in OpenSpec.
1 parent b78c315 commit 890d750

69 files changed

Lines changed: 1774 additions & 2307 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/cnode-docs/SKILL.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ Keep repository documentation concise, current, safe, and owned by one source.
99

1010
## Choose The Owner
1111

12-
| Content | Location |
13-
| --- | --- |
14-
| Generated API reference asset | `apps/web/public/openapi.json` |
15-
| Runtime, data, and design-system architecture | `docs/arch/` |
16-
| Business rules, community governance, and legacy knowledge | `docs/biz/` |
17-
| Deployment guide, example configuration, Compose, and operator helpers | `docs/deployment/` |
18-
| Project overview | `README.md` |
19-
| Agent boundaries and skill triggers | `AGENTS.md` |
20-
| Contributor workflow | `CONTRIBUTING.md` |
21-
| Vulnerability reporting | `SECURITY.md` |
22-
| App-specific setup and commands | `apps/*/README.md` |
12+
| Content | Location |
13+
| ---------------------------------------------------------------------- | ------------------------------ |
14+
| Generated API reference asset | `apps/web/public/openapi.json` |
15+
| Runtime, data, and design-system architecture | `docs/arch/` |
16+
| Business rules, community governance, and legacy knowledge | `docs/biz/` |
17+
| Deployment guide, example configuration, Compose, and operator helpers | `docs/deployment/` |
18+
| Project overview | `README.md` |
19+
| Agent boundaries and skill triggers | `AGENTS.md` |
20+
| Contributor workflow | `CONTRIBUTING.md` |
21+
| Vulnerability reporting | `SECURITY.md` |
22+
| App-specific setup and commands | `apps/*/README.md` |
2323

2424
Do not create `README.md` or `index.md` inside `docs/`. Do not recreate top-level `wiki/`, `api/`, or `deployment/` documentation domains.
2525

‎.agents/skills/migrate-radix-to-base/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ transforming, and record gaps in the report.
4242
fetch base variants directly by URL instead
4343
(`https://ui.shadcn.com/r/styles/base-<style>/<component>.json`).
4444
3. PRISTINE wrappers, whole-project mode: `shadcn add <component>
45-
--overwrite` delivers the base variant with the project's exact
45+
--overwrite` delivers the base variant with the project's exact
4646
icon/font/preset resolution. Never bulk `--all --overwrite`; go
4747
component by component, or you drown in unrelated registry version
4848
drift. PROGRESSIVE mode: never use `--overwrite` (it destroys the

‎.agents/skills/migrate-radix-to-base/wrapper-shapes.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ class existed; the open styling was previously data-[state=open]).
9494
- Drop the radix `position` prop entirely; expose `alignItemWithTrigger`
9595
(default true) picked from Positioner.Props, `sideOffset = 4`.
9696
- Item anatomy: `ItemText` FIRST with `cn-select-item-text shrink-0
97-
whitespace-nowrap`, then `ItemIndicator render={<span
98-
className="cn-select-item-indicator" />}`.
97+
whitespace-nowrap`, then `ItemIndicator render={<span
98+
className="cn-select-item-indicator" />}`.
9999
- Scroll arrows get `top-0 w-full` / `bottom-0 w-full`; List has no classes.
100100

101101
## Accordion animation placement

‎apps/api/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vitest/

‎apps/api/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test": "vp test run",
1111
"worker:moderation": "tsx src/bootstrap.ts moderation-worker",
1212
"typecheck": "tsc --noEmit",
13-
"gen:openapi": "tsx scripts/gen-openapi.ts"
13+
"gen:openapi": "tsx scripts/gen-openapi.ts && vp -C ../.. fmt apps/web/public/openapi.json"
1414
},
1515
"dependencies": {
1616
"@cnode/db": "workspace:*",

‎apps/api/test/account-auth-policy.test.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ describe("inactive account authentication policy", () => {
162162
);
163163

164164
expect(response.status).toBe(302);
165-
expect(response.headers.get("location")).toContain(
166-
"/resend_activation?error=account_inactive",
167-
);
165+
expect(response.headers.get("location")).toContain("/resend_activation?error=account_inactive");
168166
expect(response.headers.get("set-cookie")).toContain("github_oauth_state=");
169167
expect(updateGithubInfo).not.toHaveBeenCalled();
170168
expect(response.headers.get("set-cookie")).not.toContain("node_club=");

‎apps/api/test/telemetry-sanitize.test.ts‎

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import {
55
SimpleSpanProcessor,
66
} from "@opentelemetry/sdk-trace-base";
77
import { describe, expect, test } from "vite-plus/test";
8-
import {
9-
isBlockedTelemetryAttribute,
10-
SanitizingSpanProcessor,
11-
} from "../src/telemetry/sanitize";
8+
import { isBlockedTelemetryAttribute, SanitizingSpanProcessor } from "../src/telemetry/sanitize";
129

1310
describe("telemetry span sanitization", () => {
1411
test.each([
@@ -48,9 +45,7 @@ describe("telemetry span sanitization", () => {
4845
test("removes sensitive span, event, and link values before export", async () => {
4946
const exporter = new InMemorySpanExporter();
5047
const provider = new BasicTracerProvider({
51-
spanProcessors: [
52-
new SanitizingSpanProcessor(new SimpleSpanProcessor(exporter)),
53-
],
48+
spanProcessors: [new SanitizingSpanProcessor(new SimpleSpanProcessor(exporter))],
5449
});
5550
const tracer = provider.getTracer("sanitize-test");
5651
const sensitive = "fixture-private-value";
@@ -60,26 +55,29 @@ describe("telemetry span sanitization", () => {
6055
traceFlags: 1,
6156
});
6257

63-
tracer.startSpan("safe-operation", {
64-
attributes: {
65-
"http.request.method": "POST",
66-
"http.request.header.authorization": sensitive,
67-
"request.body": sensitive,
68-
"db.statement": `select '${sensitive}'`,
69-
"db.query.parameters": sensitive,
70-
"url.full": `https://example.com/path?token=${sensitive}`,
71-
},
72-
links: [
73-
{
74-
context: trace.getSpanContext(linkedContext)!,
75-
attributes: { "session.token": sensitive },
58+
tracer
59+
.startSpan("safe-operation", {
60+
attributes: {
61+
"http.request.method": "POST",
62+
"http.request.header.authorization": sensitive,
63+
"request.body": sensitive,
64+
"db.statement": `select '${sensitive}'`,
65+
"db.query.parameters": sensitive,
66+
"url.full": `https://example.com/path?token=${sensitive}`,
7667
},
77-
],
78-
}).addEvent("failure", {
79-
"exception.type": "Error",
80-
"exception.message": sensitive,
81-
"exception.stacktrace": sensitive,
82-
}).end();
68+
links: [
69+
{
70+
context: trace.getSpanContext(linkedContext)!,
71+
attributes: { "session.token": sensitive },
72+
},
73+
],
74+
})
75+
.addEvent("failure", {
76+
"exception.type": "Error",
77+
"exception.message": sensitive,
78+
"exception.stacktrace": sensitive,
79+
})
80+
.end();
8381
await provider.forceFlush();
8482

8583
const finishedSpan = exporter.getFinishedSpans()[0]!;

‎apps/web/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vitest/

‎apps/web/app/components/Sidebar.tsx‎

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "./ui/card";
55
import { Button } from "./ui/button";
66
import { Skeleton } from "./ui/skeleton";
77
import { Avatar, AvatarFallback, AvatarImage } from "./ui/avatar";
8-
import {
9-
Item,
10-
ItemContent,
11-
ItemDescription,
12-
ItemGroup,
13-
ItemMedia,
14-
ItemTitle,
15-
} from "./ui/item";
8+
import { Item, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle } from "./ui/item";
169
import { TimeAgo } from "./TimeAgo";
1710
import { getAvatarFallback, getAvatarUrl, getTabLabel } from "~/lib/brand";
1811
import { ArrowUpRight, Handshake, MessageCircle, Trophy } from "lucide-react";
@@ -112,34 +105,34 @@ function LatestReplies({ replies }: { replies: SidebarData["latest_replies"] })
112105
</CardHeader>
113106
<CardContent>
114107
<ItemGroup>
115-
{replies.map((reply) => {
116-
const author = reply.author;
117-
return (
118-
<Item
119-
key={reply.id}
120-
render={<Link to={`/topic/${reply.topic_id}#${reply.id}`} />}
121-
variant="muted"
122-
size="xs"
123-
>
124-
<ItemMedia>
125-
<Avatar className="size-8">
126-
<AvatarImage
127-
src={getAvatarUrl(author?.avatar_url, 32)}
128-
alt={author?.loginname || "CNode"}
129-
/>
130-
<AvatarFallback>{getAvatarFallback(author?.loginname)}</AvatarFallback>
131-
</Avatar>
132-
</ItemMedia>
133-
<ItemContent>
134-
<ItemTitle className="line-clamp-2 w-full text-xs">{reply.topic_title}</ItemTitle>
135-
<ItemDescription>
136-
{author?.loginname || "社区成员"} ·{" "}
137-
{reply.create_at ? <TimeAgo date={reply.create_at} /> : null}
138-
</ItemDescription>
139-
</ItemContent>
140-
</Item>
141-
);
142-
})}
108+
{replies.map((reply) => {
109+
const author = reply.author;
110+
return (
111+
<Item
112+
key={reply.id}
113+
render={<Link to={`/topic/${reply.topic_id}#${reply.id}`} />}
114+
variant="muted"
115+
size="xs"
116+
>
117+
<ItemMedia>
118+
<Avatar className="size-8">
119+
<AvatarImage
120+
src={getAvatarUrl(author?.avatar_url, 32)}
121+
alt={author?.loginname || "CNode"}
122+
/>
123+
<AvatarFallback>{getAvatarFallback(author?.loginname)}</AvatarFallback>
124+
</Avatar>
125+
</ItemMedia>
126+
<ItemContent>
127+
<ItemTitle className="line-clamp-2 w-full text-xs">{reply.topic_title}</ItemTitle>
128+
<ItemDescription>
129+
{author?.loginname || "社区成员"} ·{" "}
130+
{reply.create_at ? <TimeAgo date={reply.create_at} /> : null}
131+
</ItemDescription>
132+
</ItemContent>
133+
</Item>
134+
);
135+
})}
143136
</ItemGroup>
144137
</CardContent>
145138
</Card>
@@ -164,8 +157,13 @@ function NoReplyTopics({ topics }: { topics: SidebarData["no_reply_topics"] }) {
164157
<ItemContent>
165158
<ItemTitle className="line-clamp-2 w-full text-xs">{t.title}</ItemTitle>
166159
<ItemDescription>
167-
<span>{getTabLabel(t.tab)}</span>
168-
{t.create_at ? <> · <TimeAgo date={t.create_at} /></> : null}
160+
<span>{getTabLabel(t.tab)}</span>
161+
{t.create_at ? (
162+
<>
163+
{" "}
164+
· <TimeAgo date={t.create_at} />
165+
</>
166+
) : null}
169167
</ItemDescription>
170168
</ItemContent>
171169
</Item>

‎apps/web/app/components/cnpm/DepsView.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ export function DepsView({ manifest, version }: { manifest: RegistryManifest; ve
5858
{entries.map(([pkg, spec]) => (
5959
<TableRow key={pkg}>
6060
<TableCell>
61-
<Link
62-
to={`/cnpm/pkg/${pkg}`}
63-
className="text-foreground hover:text-primary"
64-
>
61+
<Link to={`/cnpm/pkg/${pkg}`} className="text-foreground hover:text-primary">
6562
{pkg}
6663
</Link>
6764
</TableCell>

0 commit comments

Comments
 (0)