Update CLI templates to use Ultracite for linting and formatting#160
Update CLI templates to use Ultracite for linting and formatting#160
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
@proofkit/better-auth
@proofkit/cli
create-proofkit
@proofkit/fmdapi
@proofkit/fmodata
@proofkit/typegen
@proofkit/webviewer
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughMigrates scaffolded apps from Biome to Ultracite for lint/format, adds Ultracite to CLI dependency maps and templates, updates CLI createProject to include package manager placeholder and dev deps, enhances the vite-wv template with TanStack Router and React Query, and applies minor stylistic fixes across several bin files. Changes
Sequence Diagram(s)sequenceDiagram
participant Browser as Browser
participant Main as main.tsx
participant QCP as QueryClientProvider
participant RP as RouterProvider
participant Router as Router (routeTree)
participant QueryPage as QueryDemoPage
Browser->>Main: load app
Main->>QCP: create QueryClient & wrap app
Main->>RP: initialize RouterProvider with router
RP->>Router: provide routeTree (hash history)
Router->>QueryPage: navigate to /query
QueryPage->>QCP: useQuery -> request data
QCP->>QueryPage: return cached/fetched data
QueryPage->>Browser: render loading or data UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 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)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (4)
packages/cli/template/vite-wv/package.json (1)
34-34: Version pinning inconsistency with dependencyVersionMap.Same as in the nextjs-shadcn template—ultracite is pinned exactly as
"7.0.8"here, butdependencyVersionMap.tsuses"^7.0.8". Consider aligning for consistency.Suggested fix
- "ultracite": "7.0.8", + "ultracite": "^7.0.8",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/cli/template/vite-wv/package.json` at line 34, The package.json pins ultracite to "7.0.8" while dependencyVersionMap.ts uses "^7.0.8", causing inconsistency; update one to match the other for consistency (either change the package.json entry "ultracite": "7.0.8" to "ultracite": "^7.0.8", or update dependencyVersionMap.ts to "7.0.8"). Locate the ultracite entry in package.json and the ultracite key in dependencyVersionMap.ts and make their version strings identical across both files.packages/cli/template/nextjs-shadcn/package.json (1)
35-35: Version pinning inconsistency with dependencyVersionMap.The ultracite version here is pinned exactly as
"7.0.8", butdependencyVersionMap.tsuses"^7.0.8"(with caret). Consider aligning them for consistency—either pin exactly in both places or use the caret range in both.Suggested fix to align with dependencyVersionMap
- "ultracite": "7.0.8" + "ultracite": "^7.0.8"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/cli/template/nextjs-shadcn/package.json` at line 35, The ultracite dependency in package.json is pinned as "7.0.8" but dependencyVersionMap.ts uses "^7.0.8", causing inconsistency; update the package.json entry for "ultracite" to use the caret range "^7.0.8" to match dependencyVersionMap.ts (or alternatively change dependencyVersionMap.ts to "7.0.8" if you prefer exact pinning) so both places reference the same version format.packages/cli/src/utils/formatting.ts (1)
19-19: Useconsole.errorfor the failure message.Line [19] emits an error-status message via
console.log; this should go to stderr alongside the caught error.As per coding guidelines, "Remove `console.log`, `debugger`, and `alert` statements from production code".Proposed patch
- console.log("Error formatting files with ultracite"); + console.error("Error formatting files with ultracite");🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/cli/src/utils/formatting.ts` at line 19, Replace the stdout log with an stderr log: locate the error handling in formatting.ts that currently calls console.log("Error formatting files with ultracite") and change it to use console.error so the failure message and any caught error go to stderr (ensure the surrounding catch/error handling still passes the actual error to the logger).packages/cli/template/vite-wv/src/routes/query-demo.tsx (1)
5-5: Extract the artificial delay into a named constant.Line [5] uses a magic number (
180) that would be clearer as a descriptive constant.As per coding guidelines, "Use meaningful variable names instead of magic numbers - extract constants with descriptive names".Proposed patch
+const CONNECTION_HINT_DELAY_MS = 180; + const getConnectionHint = async (): Promise<string> => { - await new Promise((resolve) => setTimeout(resolve, 180)); + await new Promise((resolve) => setTimeout(resolve, CONNECTION_HINT_DELAY_MS)); return "Use fmFetch or generated clients once your FileMaker file is ready."; };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/cli/template/vite-wv/src/routes/query-demo.tsx` at line 5, Replace the magic number 180 used in the artificial delay with a descriptive constant (e.g., ARTIFICIAL_DELAY_MS) and declare it near the top of the module (or directly above the function that contains the await new Promise(...)) so the intent and units are clear; update the await new Promise((resolve) => setTimeout(resolve, 180)) call to use that constant instead (ARTIFICIAL_DELAY_MS) and ensure the constant is const-scoped and documented with a short comment if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/cli/src/utils/formatting.ts`:
- Line 19: Replace the stdout log with an stderr log: locate the error handling
in formatting.ts that currently calls console.log("Error formatting files with
ultracite") and change it to use console.error so the failure message and any
caught error go to stderr (ensure the surrounding catch/error handling still
passes the actual error to the logger).
In `@packages/cli/template/nextjs-shadcn/package.json`:
- Line 35: The ultracite dependency in package.json is pinned as "7.0.8" but
dependencyVersionMap.ts uses "^7.0.8", causing inconsistency; update the
package.json entry for "ultracite" to use the caret range "^7.0.8" to match
dependencyVersionMap.ts (or alternatively change dependencyVersionMap.ts to
"7.0.8" if you prefer exact pinning) so both places reference the same version
format.
In `@packages/cli/template/vite-wv/package.json`:
- Line 34: The package.json pins ultracite to "7.0.8" while
dependencyVersionMap.ts uses "^7.0.8", causing inconsistency; update one to
match the other for consistency (either change the package.json entry
"ultracite": "7.0.8" to "ultracite": "^7.0.8", or update dependencyVersionMap.ts
to "7.0.8"). Locate the ultracite entry in package.json and the ultracite key in
dependencyVersionMap.ts and make their version strings identical across both
files.
In `@packages/cli/template/vite-wv/src/routes/query-demo.tsx`:
- Line 5: Replace the magic number 180 used in the artificial delay with a
descriptive constant (e.g., ARTIFICIAL_DELAY_MS) and declare it near the top of
the module (or directly above the function that contains the await new
Promise(...)) so the intent and units are clear; update the await new
Promise((resolve) => setTimeout(resolve, 180)) call to use that constant instead
(ARTIFICIAL_DELAY_MS) and ensure the constant is const-scoped and documented
with a short comment if needed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7112012f-1768-4dcb-8afb-9672545f962d
📒 Files selected for processing (17)
.changeset/use-ultracite-for-new-app-scripts.md.codex/environments/environment-2.toml.codex/environments/environment.tomlpackages/better-auth/bin/intent.jspackages/cli/src/helpers/createProject.tspackages/cli/src/installers/dependencyVersionMap.tspackages/cli/src/utils/formatting.tspackages/cli/template/nextjs-mantine/package.jsonpackages/cli/template/nextjs-shadcn/package.jsonpackages/cli/template/vite-wv/package.jsonpackages/cli/template/vite-wv/src/App.tsxpackages/cli/template/vite-wv/src/main.tsxpackages/cli/template/vite-wv/src/router.tsxpackages/cli/template/vite-wv/src/routes/query-demo.tsxpackages/fmdapi/bin/intent.jspackages/fmodata/src/cli/commands/query.tspackages/webviewer/bin/intent.js
Summary
ultracite check ./ultracite fix .)ultraciteto default dev dependencies for new shadcn, mantine, and Vite WebViewer projectsultraciteto the CLI dependency version map for consistent version resolutionnpx ultracite fix .instead of@biomejs/biome format --write@biomejs/biometemplate devDependencies where Ultracite now drives lint/formatnextjs-shadcntemplate Ultracite version to7.0.8Testing
pnpm dlx biome check packages/cli/src/helpers/createProject.ts packages/cli/src/installers/dependencyVersionMap.ts packages/cli/src/utils/formatting.ts packages/cli/template/nextjs-mantine/package.json packages/cli/template/nextjs-shadcn/package.json packages/cli/template/vite-wv/package.jsonpnpm run ciSummary by CodeRabbit
New Features
Chores