From 429f1fd2ae321a933a005ad71bd12e0b0e4c0544 Mon Sep 17 00:00:00 2001 From: MK Date: Wed, 5 Aug 2026 14:03:36 +0800 Subject: [PATCH 1/3] feat: migrate toolchain to Vite+ Replace split vite/vitest/oxlint/oxfmt tooling with vite-plus 0.2.7 via vp migrate. - Bump apps/web to Vite 8.2.0, resolved through the new pnpm catalog to the Rolldown-powered @voidzero-dev/vite-plus-core build - Consolidate .oxlintrc.json into the new root vite.config.ts - Rewrite vitest imports to vite-plus/test in 56 files, switch package scripts to vp lint / vp fmt / vp test run - Reformat 319 files with the bundled Oxfmt 0.62, which now also formats Markdown - Keep husky + gitleaks pre-commit hooks; vp hook setup skipped - Leave type-aware linting off in the root config: it reports 88 pre-existing findings and its suggested rootDir fix would break the apps/api build, which compiles workspace packages via tsconfig paths --- .agents/skills/migrate-radix-to-base/SKILL.md | 10 +- .../migrate-radix-to-base/class-mapping.md | 44 +- .../migrate-radix-to-base/consumer-props.md | 58 +- .../migrate-radix-to-base/disclosure.md | 310 ++-- .../migrate-radix-to-base/display-misc.md | 318 ++-- .../migrate-radix-to-base/form-controls.md | 390 ++--- .agents/skills/migrate-radix-to-base/menus.md | 410 ++--- .../skills/migrate-radix-to-base/overlays.md | 482 ++--- .../universal-patterns.md | 167 +- .../migrate-radix-to-base/wrapper-shapes.md | 11 +- .agents/skills/shadcn/SKILL.md | 2 +- .agents/skills/shadcn/cli.md | 14 +- .agents/skills/shadcn/customization.md | 11 +- .agents/skills/shadcn/rules/base-vs-radix.md | 6 +- .agents/skills/shadcn/rules/chat.md | 4 +- .agents/skills/shadcn/rules/composition.md | 62 +- .agents/skills/shadcn/rules/forms.md | 16 +- .agents/skills/shadcn/rules/icons.md | 14 +- .agents/skills/shadcn/rules/styling.md | 5 +- .gitleaks.toml | 5 +- .oxlintrc.json | 19 - CONTRIBUTING.md | 12 +- README.md | 48 +- api/openapi.json | 1547 ++++------------- apps/api/package.json | 5 +- apps/api/src/lib/admin-governance.ts | 23 +- apps/api/src/lib/db.ts | 302 ++-- apps/api/src/lib/mail-template.tsx | 7 +- apps/api/src/lib/message.ts | 18 +- apps/api/src/lib/moderation-scan.ts | 157 +- apps/api/src/lib/moderation.ts | 12 +- apps/api/src/lib/penalty.ts | 21 +- apps/api/src/lib/redis.ts | 4 +- apps/api/src/lib/score.ts | 4 +- apps/api/src/lib/turnstile.ts | 6 +- apps/api/src/load-env.ts | 9 +- apps/api/src/middleware/auth.ts | 7 +- apps/api/src/middleware/ip-ban.ts | 9 +- apps/api/src/middleware/rate-limit.ts | 22 +- apps/api/src/routes/admin.ts | 1189 +++++++++++-- apps/api/src/routes/auth.ts | 821 +++++++-- apps/api/src/routes/collect.ts | 151 +- apps/api/src/routes/community.ts | 88 +- apps/api/src/routes/message.ts | 156 +- apps/api/src/routes/reply.ts | 153 +- apps/api/src/routes/topic.ts | 37 +- apps/api/src/routes/user.ts | 352 +++- apps/api/src/routes/zone.ts | 11 +- apps/api/test/admin-pagination.test.ts | 20 +- apps/api/test/admin-topic-filters.test.ts | 2 +- apps/api/test/audit-events.test.ts | 17 +- apps/api/test/format.test.ts | 17 +- apps/api/test/health.test.ts | 6 +- apps/api/test/ip-ban-rules.test.ts | 2 +- apps/api/test/mail-template.test.ts | 28 +- apps/api/test/mdrender-query.test.ts | 2 +- apps/api/test/message-rendering.test.ts | 6 +- apps/api/test/moderation-helpers.test.ts | 2 +- apps/api/test/public-identities.test.ts | 10 +- apps/api/test/reply-data-consistency.test.ts | 45 +- .../test/reply-postgres-integration.test.ts | 26 +- apps/api/test/roles-permissions.test.ts | 14 +- apps/api/test/rss-source.test.ts | 2 +- apps/api/test/runtime-config.test.ts | 58 +- apps/api/test/topic-edit-contract.test.ts | 2 +- apps/api/test/topic-list-visibility.test.ts | 44 +- apps/api/test/topic-reply-repair.test.ts | 38 +- apps/api/test/user-detail-contract.test.ts | 11 +- apps/api/vitest.config.ts | 2 +- apps/web/app/components/AdminLayout.tsx | 104 +- apps/web/app/components/AdminPage.tsx | 47 +- apps/web/app/components/AuthShell.tsx | 8 +- apps/web/app/components/CNodeLogo.tsx | 24 +- apps/web/app/components/CommandPalette.tsx | 35 +- apps/web/app/components/Form.tsx | 67 +- apps/web/app/components/JobCardGrid.tsx | 8 +- apps/web/app/components/JobFilterBar.tsx | 20 +- apps/web/app/components/JobMetaForm.tsx | 25 +- apps/web/app/components/Layout.tsx | 59 +- apps/web/app/components/MarkdownEditor.tsx | 79 +- apps/web/app/components/MarkdownView.tsx | 24 +- apps/web/app/components/PageShell.tsx | 106 +- apps/web/app/components/Pagination.tsx | 24 +- apps/web/app/components/ScrollTopButton.tsx | 4 +- apps/web/app/components/Sidebar.tsx | 43 +- apps/web/app/components/TopicList.tsx | 8 +- apps/web/app/components/TurnstileWidget.tsx | 20 +- .../web/app/components/UserIdentityBadges.tsx | 6 +- apps/web/app/components/ui/alert-dialog.tsx | 85 +- apps/web/app/components/ui/alert.tsx | 35 +- apps/web/app/components/ui/avatar.tsx | 54 +- apps/web/app/components/ui/badge.tsx | 27 +- apps/web/app/components/ui/button.tsx | 21 +- apps/web/app/components/ui/card.tsx | 47 +- apps/web/app/components/ui/checkbox.tsx | 17 +- apps/web/app/components/ui/command.tsx | 77 +- apps/web/app/components/ui/dialog.tsx | 82 +- apps/web/app/components/ui/dropdown-menu.tsx | 102 +- apps/web/app/components/ui/empty.tsx | 40 +- apps/web/app/components/ui/field.tsx | 112 +- apps/web/app/components/ui/input-group.tsx | 90 +- apps/web/app/components/ui/input.tsx | 12 +- apps/web/app/components/ui/item.tsx | 73 +- apps/web/app/components/ui/label.tsx | 10 +- apps/web/app/components/ui/native-select.tsx | 42 +- apps/web/app/components/ui/pagination.tsx | 43 +- apps/web/app/components/ui/radio-group.tsx | 16 +- apps/web/app/components/ui/select.tsx | 71 +- apps/web/app/components/ui/separator.tsx | 18 +- apps/web/app/components/ui/sheet.tsx | 61 +- apps/web/app/components/ui/sidebar.tsx | 293 ++-- apps/web/app/components/ui/skeleton.tsx | 6 +- apps/web/app/components/ui/sonner.tsx | 42 +- apps/web/app/components/ui/spinner.tsx | 16 +- apps/web/app/components/ui/table.tsx | 61 +- apps/web/app/components/ui/tabs.tsx | 33 +- apps/web/app/components/ui/textarea.tsx | 10 +- apps/web/app/components/ui/toggle-group.tsx | 38 +- apps/web/app/components/ui/toggle.tsx | 16 +- apps/web/app/components/ui/tooltip.tsx | 32 +- apps/web/app/hooks/use-async-action.ts | 4 +- apps/web/app/hooks/use-mobile.ts | 22 +- apps/web/app/hooks/use-unsaved-changes.tsx | 10 +- apps/web/app/lib/api-client.ts | 5 +- apps/web/app/lib/brand.ts | 5 +- apps/web/app/lib/markdown-headings.ts | 5 +- apps/web/app/lib/seo.ts | 8 +- apps/web/app/lib/topic-action-presentation.ts | 13 +- apps/web/app/lib/upload-client.ts | 5 +- apps/web/app/root.tsx | 19 +- apps/web/app/routes/_index.tsx | 105 +- apps/web/app/routes/about.tsx | 240 ++- apps/web/app/routes/active_account.tsx | 40 +- apps/web/app/routes/admin/_index.tsx | 147 +- apps/web/app/routes/admin/audit.tsx | 218 ++- apps/web/app/routes/admin/bans.tsx | 497 ++++-- apps/web/app/routes/admin/keywords.tsx | 143 +- apps/web/app/routes/admin/mod.tsx | 286 ++- apps/web/app/routes/admin/reports.tsx | 108 +- apps/web/app/routes/admin/settings.tsx | 273 +-- apps/web/app/routes/admin/tabs.tsx | 131 +- apps/web/app/routes/admin/topics.tsx | 394 +++-- apps/web/app/routes/admin/users.tsx | 375 ++-- apps/web/app/routes/admin/zones.tsx | 152 +- apps/web/app/routes/api.tsx | 13 +- apps/web/app/routes/auth.github.new.tsx | 161 +- apps/web/app/routes/auth.github.no-email.tsx | 24 +- apps/web/app/routes/auth.github.tsx | 4 +- apps/web/app/routes/my.messages.tsx | 87 +- apps/web/app/routes/reply.$id.edit.tsx | 60 +- apps/web/app/routes/reset_pass.tsx | 70 +- apps/web/app/routes/rss.tsx | 12 +- apps/web/app/routes/search.tsx | 39 +- apps/web/app/routes/search_pass.tsx | 66 +- apps/web/app/routes/setting.tsx | 104 +- apps/web/app/routes/signin.tsx | 47 +- apps/web/app/routes/signup.tsx | 217 +-- apps/web/app/routes/stars.tsx | 38 +- apps/web/app/routes/topic.$tid.edit.tsx | 93 +- apps/web/app/routes/topic.$tid.tsx | 462 +++-- apps/web/app/routes/topic.create.tsx | 119 +- .../web/app/routes/user.$name.collections.tsx | 24 +- apps/web/app/routes/user.$name.replies.tsx | 25 +- apps/web/app/routes/user.$name.topics.tsx | 24 +- apps/web/app/routes/user.$name.tsx | 240 ++- apps/web/app/routes/users.top100.tsx | 6 +- apps/web/app/styles/typeset.css | 131 +- apps/web/package.json | 7 +- apps/web/public/openapi.json | 1547 ++++------------- apps/web/tests/AboutPage.test.tsx | 59 +- .../AdminDestructiveConfirmations.test.tsx | 290 ++- apps/web/tests/AdminModeration.test.tsx | 66 +- apps/web/tests/AdminUrlState.test.tsx | 44 +- apps/web/tests/AdminUsersActions.test.ts | 34 +- apps/web/tests/AsyncFeedback.test.tsx | 13 +- apps/web/tests/AuthFormAccessibility.test.tsx | 2 +- apps/web/tests/DesignSystemGovernance.test.ts | 16 +- apps/web/tests/LayoutNavigation.test.tsx | 145 +- apps/web/tests/MarkdownEditor.test.tsx | 11 +- apps/web/tests/MarkdownView.test.tsx | 41 +- apps/web/tests/MessageSummary.test.ts | 2 +- apps/web/tests/Messages.test.tsx | 19 +- apps/web/tests/Pagination.test.tsx | 12 +- apps/web/tests/PostMutationNavigation.test.ts | 38 +- .../tests/PrimitiveMigrationBaseline.test.tsx | 17 +- apps/web/tests/RoutesConfig.test.ts | 6 +- apps/web/tests/RssRoute.test.ts | 12 +- apps/web/tests/Seo.test.ts | 33 +- apps/web/tests/SettingGithubLinking.test.tsx | 11 +- apps/web/tests/SharedPrimitives.test.tsx | 43 +- apps/web/tests/Sidebar.test.tsx | 29 +- apps/web/tests/ThemeContrast.test.ts | 11 +- apps/web/tests/ThemeSystem.test.ts | 2 +- apps/web/tests/ThemeTokens.test.ts | 39 +- .../web/tests/TopicActionPresentation.test.ts | 44 +- apps/web/tests/TopicActions.test.tsx | 29 +- apps/web/tests/TopicAuthorCard.test.tsx | 45 +- apps/web/tests/TopicAuthorLoader.test.ts | 37 +- apps/web/tests/TopicEditEntry.test.ts | 2 +- apps/web/tests/UnsavedChanges.test.tsx | 15 +- apps/web/tests/UserProfileHero.test.tsx | 32 +- apps/web/tests/ZoneJobsSsr.test.tsx | 19 +- apps/web/tsconfig.json | 3 +- apps/web/vite.config.ts | 4 +- apps/web/vitest.config.ts | 2 +- deployment/docker-compose.yml | 6 +- deployment/scripts/smoke-api-contract.ts | 95 +- docs/architecture.md | 58 +- docs/content-moderation.md | 48 +- docs/conventions.md | 78 +- docs/database.md | 46 +- docs/design-system.md | 36 +- docs/development.md | 68 +- docs/openspec-governance.md | 34 +- .../specs/admin-dashboard/spec.md | 4 + .../specs/comment-reply-experience/spec.md | 3 + .../specs/content-lifecycle/spec.md | 4 + .../specs/topic-pin-management/spec.md | 4 + .../specs/user-management/spec.md | 3 + .../specs/content-moderation/spec.md | 2 + .../specs/moderation-scan-jobs/spec.md | 8 + .../specs/api-contract/spec.md | 5 + .../specs/content-lifecycle/spec.md | 5 + .../specs/home-sidebar-information/spec.md | 4 + .../specs/user-management/spec.md | 8 + .../specs/user-profile-experience/spec.md | 4 + .../specs/moderation-scan-jobs/spec.md | 8 + .../proposal.md | 2 + .../specs/admin-dashboard/spec.md | 5 + .../specs/admin-list-pagination/spec.md | 11 + .../specs/secret-scanning/spec.md | 7 + .../specs/admin-dashboard/spec.md | 13 + .../specs/anti-spam/spec.md | 3 + .../specs/content-moderation/spec.md | 7 + .../specs/moderation-scan-jobs/spec.md | 8 + .../proposal.md | 2 + .../specs/admin-dashboard/spec.md | 4 + .../specs/topic-pin-management/spec.md | 8 + .../legacy-web-url-parity.md | 98 +- .../specs/web-ui-markdown/spec.md | 11 + .../specs/admin-dashboard/spec.md | 12 + .../specs/anti-spam/spec.md | 15 + .../specs/api-contract/spec.md | 4 + .../specs/auth/spec.md | 13 + .../specs/content-moderation/spec.md | 4 + .../specs/layout-templates/spec.md | 4 + .../specs/production-ops/spec.md | 8 + .../specs/rate-limiting/spec.md | 4 + .../specs/user-management/spec.md | 5 + .../specs/web-ui-forms/spec.md | 5 + .../specs/container-image-delivery/spec.md | 9 + .../spec.md | 12 + .../specs/immutable-image-release/spec.md | 9 + .../specs/postgres-first-dev-runtime/spec.md | 8 + .../production-deployment-governance/spec.md | 9 + .../specs/production-health-version/spec.md | 9 + .../specs/public-api-documentation/spec.md | 20 + .../specs/release-verification-gates/spec.md | 6 + .../specs/secret-scanning/spec.md | 3 + .../web-api-contract-integration/spec.md | 9 + .../2026-07-29-add-jobs-zone/design.md | 34 +- .../2026-07-29-add-jobs-zone/proposal.md | 2 + .../spec.md | 26 + .../production-deployment-governance/spec.md | 16 + .../specs/public-api-documentation/spec.md | 18 + .../design.md | 5 + .../specs/api-contract/spec.md | 5 + .../specs/public-api-documentation/spec.md | 29 + .../web-api-contract-integration/spec.md | 12 + .../design.md | 12 +- .../specs/api-test-infrastructure/spec.md | 6 + .../design.md | 14 +- .../specs/admin-dashboard/spec.md | 10 + .../specs/content-lifecycle/spec.md | 5 + .../specs/content-moderation/spec.md | 6 + .../design.md | 36 +- .../specs/admin-dashboard/spec.md | 11 + .../specs/user-management/spec.md | 4 + .../specs/openspec-change-governance/spec.md | 19 + .../design.md | 42 +- .../specs/web-async-action/spec.md | 4 +- .../design.md | 6 +- .../specs/admin-dashboard/spec.md | 5 + .../specs/user-management/spec.md | 9 + .../admin-mutation-matrix.md | 46 +- .../2026-08-02-harden-web-ui-system/design.md | 18 +- .../baseline-audit.md | 108 +- .../design.md | 48 +- .../specs/agent-owned-ui-acceptance/spec.md | 4 + .../specs/layout-templates/spec.md | 11 + .../web-design-system-governance/spec.md | 8 + .../specs/web-ui-components/spec.md | 11 + .../specs/web-ui-forms/spec.md | 3 + .../specs/web-ui-markdown/spec.md | 9 + .../specs/web-ui-theme/spec.md | 8 + .../design.md | 12 +- .../spec.md | 4 + .../specs/postgres-first-dev-runtime/spec.md | 5 + .../runtime-environment-contract/spec.md | 21 + .../design.md | 24 +- .../design.md | 18 +- .../specs/container-image-delivery/spec.md | 4 + .../spec.md | 4 + .../production-deployment-governance/spec.md | 4 + .../specs/production-ops/spec.md | 4 + openspec/config.yaml | 4 +- openspec/specs/admin-dashboard/spec.md | 53 +- openspec/specs/admin-list-pagination/spec.md | 13 + openspec/specs/admin-tab-management/spec.md | 3 + openspec/specs/admin-zone-management/spec.md | 3 + .../specs/agent-owned-ui-acceptance/spec.md | 6 + openspec/specs/anti-spam/spec.md | 21 + openspec/specs/api-contract/spec.md | 16 + .../specs/api-test-infrastructure/spec.md | 6 + openspec/specs/at-mention/spec.md | 4 +- openspec/specs/auth/spec.md | 16 + openspec/specs/brand-identity/spec.md | 2 + .../specs/comment-reply-experience/spec.md | 5 + .../compose-migration-operations/spec.md | 14 + .../specs/container-image-delivery/spec.md | 12 + openspec/specs/content-lifecycle/spec.md | 17 + openspec/specs/content-moderation/spec.md | 22 + openspec/specs/database-change-safety/spec.md | 3 + .../spec.md | 29 + .../spec.md | 8 + .../specs/feedback-command-system/spec.md | 2 + .../specs/home-sidebar-information/spec.md | 6 + .../specs/immutable-image-release/spec.md | 12 + openspec/specs/jobs-detail-card/spec.md | 3 + openspec/specs/jobs-structured-fields/spec.md | 3 + openspec/specs/jobs-zone/spec.md | 3 + openspec/specs/layout-templates/spec.md | 17 + openspec/specs/messaging/spec.md | 3 + openspec/specs/moderation-scan-jobs/spec.md | 22 +- openspec/specs/navigation-shell/spec.md | 2 + .../specs/openspec-change-governance/spec.md | 19 + .../specs/postgres-first-dev-runtime/spec.md | 17 + .../production-deployment-governance/spec.md | 28 + .../specs/production-health-version/spec.md | 13 +- openspec/specs/production-ops/spec.md | 13 + .../specs/public-api-documentation/spec.md | 30 + openspec/specs/rate-limiting/spec.md | 7 + .../specs/release-verification-gates/spec.md | 10 +- .../runtime-environment-contract/spec.md | 24 + openspec/specs/scoring/spec.md | 4 +- openspec/specs/secret-scanning/spec.md | 13 + openspec/specs/seo/spec.md | 4 +- openspec/specs/session-management/spec.md | 4 +- .../specs/staged-mongo-pg-cutover/spec.md | 12 + .../specs/topic-detail-experience/spec.md | 2 + openspec/specs/topic-pin-management/spec.md | 15 +- openspec/specs/user-management/spec.md | 28 + .../specs/user-profile-experience/spec.md | 6 + openspec/specs/user-roles/spec.md | 3 + .../web-api-contract-integration/spec.md | 15 + openspec/specs/web-async-action/spec.md | 4 +- .../web-design-system-governance/spec.md | 11 + openspec/specs/web-ui-components/spec.md | 13 + openspec/specs/web-ui-forms/spec.md | 10 + openspec/specs/web-ui-markdown/spec.md | 11 + openspec/specs/web-ui-state/spec.md | 2 + openspec/specs/web-ui-theme/spec.md | 10 + package.json | 10 +- packages/db/src/load-env.ts | 9 +- packages/db/src/schema/moderation_scan.ts | 17 +- packages/db/src/seed.ts | 9 +- packages/db/src/topic-reply-repair.ts | 16 +- packages/shared/src/message-summary.ts | 5 +- packages/shared/src/runtime-config.ts | 8 +- pnpm-lock.yaml | 1162 +++++++++---- pnpm-workspace.yaml | 21 +- scripts/env.test.ts | 10 +- scripts/env.ts | 5 +- scripts/migrate-mongo-to-pg.ts | 116 +- scripts/reconcile-migration.ts | 40 +- scripts/repair-topic-reply-aggregates.ts | 2 +- tsconfig.base.json | 9 +- vite.config.ts | 33 + wiki/README.md | 12 +- wiki/business-rules.md | 270 +-- wiki/community-rules.md | 174 +- wiki/legacy-behavior.md | 266 +-- wiki/migration-background.md | 192 +- 383 files changed, 13854 insertions(+), 9106 deletions(-) delete mode 100644 .oxlintrc.json create mode 100644 vite.config.ts diff --git a/.agents/skills/migrate-radix-to-base/SKILL.md b/.agents/skills/migrate-radix-to-base/SKILL.md index 5eb5dc5..cc173ce 100644 --- a/.agents/skills/migrate-radix-to-base/SKILL.md +++ b/.agents/skills/migrate-radix-to-base/SKILL.md @@ -42,7 +42,7 @@ transforming, and record gaps in the report. fetch base variants directly by URL instead (`https://ui.shadcn.com/r/styles/base-'; const mail = await buildReplyNotifyMail(title, content, "https://cnodejs.org/topic/1?a=1&b=2"); - expect(mail.html).toContain("<script>alert("title")</script> & discussion"); + expect(mail.html).toContain( + "<script>alert("title")</script> & discussion", + ); expect(mail.html).toContain("<img src=x onerror="alert(1)">"); expect(mail.html.includes("