fix(studio): remove runtime ui ts-nocheck directives#27
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
📝 WalkthroughWalkthroughThis PR systematically removes TypeScript suppression directives ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/studio/src/lib/runtime-ui/app/admin/environments-page.tsx (1)
86-100:⚠️ Potential issue | 🟡 MinorTrim and normalize the slug before persisting it.
The current guard accepts whitespace-only values, and the raw slug can be stored with spaces or mixed casing even though it is rendered as a path segment. Normalizing before the early return keeps the created environment identifiers usable.
Suggested fix
const handleCreateEnvironment = () => { - if (!newEnv.name || !newEnv.slug) return; + const name = newEnv.name.trim(); + const slug = newEnv.slug.trim().toLowerCase().replace(/\s+/g, "-"); + + if (!name || !slug) return; const env: EnvironmentCard = { id: `env-${Date.now()}`, - name: newEnv.name, - slug: newEnv.slug, - description: newEnv.description, + name, + slug, + description: newEnv.description.trim(), isProduction: false, color: "#6b7280", documentCount: 0, lastPublished: null, };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/studio/src/lib/runtime-ui/app/admin/environments-page.tsx` around lines 86 - 100, The slug is not being normalized or trimmed before validation and persistence in handleCreateEnvironment, which allows whitespace-only or improperly-cased slugs to be accepted; trim and normalize newEnv.slug (e.g., const normalized = newEnv.slug.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_.]/g, "").replace(/-+/g, "-").replace(/(^-+|-+$)/g, "")), use the normalized value for the early return check (if (!newEnv.name || !normalized) return;), and assign env.slug = normalized before calling setEnvironments([...environments, env]); reference newEnv, env, handleCreateEnvironment, and setEnvironments when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/studio/src/lib/runtime-ui/app/admin/environments-page.tsx`:
- Around line 86-100: The slug is not being normalized or trimmed before
validation and persistence in handleCreateEnvironment, which allows
whitespace-only or improperly-cased slugs to be accepted; trim and normalize
newEnv.slug (e.g., const normalized =
newEnv.slug.trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-_.]/g,
"").replace(/-+/g, "-").replace(/(^-+|-+$)/g, "")), use the normalized value for
the early return check (if (!newEnv.name || !normalized) return;), and assign
env.slug = normalized before calling setEnvironments([...environments, env]);
reference newEnv, env, handleCreateEnvironment, and setEnvironments when making
the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: eec96120-2e7a-4002-be28-4f8c411b38be
📒 Files selected for processing (43)
packages/studio/src/lib/runtime-ui/app/admin/api-page.tsxpackages/studio/src/lib/runtime-ui/app/admin/content/[type]/page.tsxpackages/studio/src/lib/runtime-ui/app/admin/content/page.tsxpackages/studio/src/lib/runtime-ui/app/admin/environments-page.tsxpackages/studio/src/lib/runtime-ui/app/admin/layout.tsxpackages/studio/src/lib/runtime-ui/app/admin/login-page.tsxpackages/studio/src/lib/runtime-ui/app/admin/media-page.tsxpackages/studio/src/lib/runtime-ui/app/admin/page.tsxpackages/studio/src/lib/runtime-ui/app/admin/settings-page.tsxpackages/studio/src/lib/runtime-ui/app/admin/trash-page.tsxpackages/studio/src/lib/runtime-ui/app/admin/users-page.tsxpackages/studio/src/lib/runtime-ui/app/admin/workflows-page.tsxpackages/studio/src/lib/runtime-ui/components/coming-soon.tsxpackages/studio/src/lib/runtime-ui/components/editor/editor-sidebar.tsxpackages/studio/src/lib/runtime-ui/components/editor/tiptap-editor.tsxpackages/studio/src/lib/runtime-ui/components/layout/app-sidebar.tsxpackages/studio/src/lib/runtime-ui/components/layout/page-header.tsxpackages/studio/src/lib/runtime-ui/components/mdcms-logo.tsxpackages/studio/src/lib/runtime-ui/components/ui/avatar.tsxpackages/studio/src/lib/runtime-ui/components/ui/badge.tsxpackages/studio/src/lib/runtime-ui/components/ui/button.tsxpackages/studio/src/lib/runtime-ui/components/ui/calendar.tsxpackages/studio/src/lib/runtime-ui/components/ui/card.tsxpackages/studio/src/lib/runtime-ui/components/ui/checkbox.tsxpackages/studio/src/lib/runtime-ui/components/ui/collapsible.tsxpackages/studio/src/lib/runtime-ui/components/ui/dropdown-menu.tsxpackages/studio/src/lib/runtime-ui/components/ui/input.tsxpackages/studio/src/lib/runtime-ui/components/ui/label.tsxpackages/studio/src/lib/runtime-ui/components/ui/pagination.tsxpackages/studio/src/lib/runtime-ui/components/ui/popover.tsxpackages/studio/src/lib/runtime-ui/components/ui/scroll-area.tsxpackages/studio/src/lib/runtime-ui/components/ui/select.tsxpackages/studio/src/lib/runtime-ui/components/ui/separator.tsxpackages/studio/src/lib/runtime-ui/components/ui/switch.tsxpackages/studio/src/lib/runtime-ui/components/ui/table.tsxpackages/studio/src/lib/runtime-ui/components/ui/tabs.tsxpackages/studio/src/lib/runtime-ui/components/ui/textarea.tsxpackages/studio/src/lib/runtime-ui/components/ui/tooltip.tsxpackages/studio/src/lib/runtime-ui/lib/mock-data.tspackages/studio/src/lib/runtime-ui/lib/utils.tspackages/studio/src/lib/runtime-ui/pages/content-page.tsxpackages/studio/src/lib/runtime-ui/pages/content-type-page.tsxpackages/studio/src/lib/runtime-ui/style-installer.test.ts
💤 Files with no reviewable changes (3)
- packages/studio/src/lib/runtime-ui/lib/utils.ts
- packages/studio/src/lib/runtime-ui/components/ui/collapsible.tsx
- packages/studio/src/lib/runtime-ui/app/admin/page.tsx
Summary
@ts-nocheckdirectives frompackages/studio/src/lib/runtime-ui.jsrelative ESM imports required by the Studio runtime UI undernodenextTest Plan
bun x --bun tsc --project packages/studio/tsconfig.lib.json --noEmitbun test packages/studio/srcbun run typecheckSummary by CodeRabbit