chore: add missing typecheck scripts to all packages#593
chore: add missing typecheck scripts to all packages#593softmarshmallow merged 2 commits intomainfrom
Conversation
- Add 'typecheck: tsc --noEmit' to 12 packages that had tsconfig.json but no typecheck script: grida-canvas-cg, grida-canvas-color, grida-canvas-pixelgrid, grida-canvas-ruler, grida-canvas-transparency-grid, grida-cmath, grida-mixed-properties, grida-tokens, grida-tree, lib/treearray, react-p-queue, desktop - Add tsconfig.json + typecheck script to 3 packages with TypeScript sources but no tsconfig: grida-canvas-bitmap, grida-canvas-tailwind, database - Fix existing tsconfig.json files to use consistent settings (target: es2020, module: esnext, moduleResolution: bundler, skipLibCheck: true) matching the project-wide convention used in working packages Co-authored-by: Universe <universe@grida.co>
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds TypeScript type-checking across the monorepo by introducing Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
database/tsconfig.json (1)
1-12: Suggested merge-time validation sequence.Given this new
databasetypecheck entrypoint, run the full prebuild + typecheck chain once before merge to avoid order-related false failures.Based on learnings: Build shared packages and wasm bundle before running repository-wide typecheck:
pnpm turbo build --filter="./packages/*"andpnpm turbo build --filter grida/canvas-wasm.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@database/tsconfig.json` around lines 1 - 12, Add a pre-merge validation step that builds shared packages and the wasm bundle before running the full repository typecheck to avoid order-related false failures for the new database typecheck entrypoint; specifically run `pnpm turbo build --filter="./packages/*"` and `pnpm turbo build --filter grida/canvas-wasm` (or add these two commands to the existing prebuild/typecheck pipeline) so the shared packages and wasm artifacts are produced prior to running the repo-wide typecheck that includes the new database entrypoint.packages/grida-canvas-bitmap/tsconfig.json (1)
7-8: RedundantnoImplicitAnyoption.
strict: truealready enablesnoImplicitAny(along with other strict checks). You can remove line 7 to match the other package configs in this PR.🧹 Proposed simplification
"esModuleInterop": true, - "noImplicitAny": true, "strict": true,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/grida-canvas-bitmap/tsconfig.json` around lines 7 - 8, Remove the redundant "noImplicitAny" compiler option from tsconfig.json since "strict": true already enables it; update the JSON by deleting the "noImplicitAny": true entry so only "strict": true remains (ensure trailing commas and JSON validity are preserved).packages/grida-canvas-tailwind/tsconfig.json (1)
7-8: RedundantnoImplicitAnyoption.Same as
grida-canvas-bitmap—strict: truealready includesnoImplicitAny. Consider removing for consistency with other package configs.🧹 Proposed simplification
"esModuleInterop": true, - "noImplicitAny": true, "strict": true,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/grida-canvas-tailwind/tsconfig.json` around lines 7 - 8, Remove the redundant "noImplicitAny" compiler option from the tsconfig (it is already implied by "strict": true); locate the "noImplicitAny": true entry in the tsconfig.json alongside "strict": true and delete that property so the file matches other packages like grida-canvas-bitmap and avoids duplicate configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@database/tsconfig.json`:
- Around line 1-12: Add a pre-merge validation step that builds shared packages
and the wasm bundle before running the full repository typecheck to avoid
order-related false failures for the new database typecheck entrypoint;
specifically run `pnpm turbo build --filter="./packages/*"` and `pnpm turbo
build --filter grida/canvas-wasm` (or add these two commands to the existing
prebuild/typecheck pipeline) so the shared packages and wasm artifacts are
produced prior to running the repo-wide typecheck that includes the new database
entrypoint.
In `@packages/grida-canvas-bitmap/tsconfig.json`:
- Around line 7-8: Remove the redundant "noImplicitAny" compiler option from
tsconfig.json since "strict": true already enables it; update the JSON by
deleting the "noImplicitAny": true entry so only "strict": true remains (ensure
trailing commas and JSON validity are preserved).
In `@packages/grida-canvas-tailwind/tsconfig.json`:
- Around line 7-8: Remove the redundant "noImplicitAny" compiler option from the
tsconfig (it is already implied by "strict": true); locate the "noImplicitAny":
true entry in the tsconfig.json alongside "strict": true and delete that
property so the file matches other packages like grida-canvas-bitmap and avoids
duplicate configuration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b352077a-81d4-4fac-b6ee-0a3f9b5702d2
📒 Files selected for processing (28)
database/package.jsondatabase/tsconfig.jsondesktop/package.jsonpackages/grida-canvas-bitmap/package.jsonpackages/grida-canvas-bitmap/tsconfig.jsonpackages/grida-canvas-cg/package.jsonpackages/grida-canvas-cg/tsconfig.jsonpackages/grida-canvas-color/package.jsonpackages/grida-canvas-color/tsconfig.jsonpackages/grida-canvas-pixelgrid/package.jsonpackages/grida-canvas-pixelgrid/tsconfig.jsonpackages/grida-canvas-ruler/package.jsonpackages/grida-canvas-ruler/tsconfig.jsonpackages/grida-canvas-tailwind/package.jsonpackages/grida-canvas-tailwind/tsconfig.jsonpackages/grida-canvas-transparency-grid/package.jsonpackages/grida-canvas-transparency-grid/tsconfig.jsonpackages/grida-cmath/package.jsonpackages/grida-cmath/tsconfig.jsonpackages/grida-mixed-properties/package.jsonpackages/grida-mixed-properties/tsconfig.jsonpackages/grida-tokens/package.jsonpackages/grida-tokens/tsconfig.jsonpackages/grida-tree/package.jsonpackages/grida-tree/tsconfig.jsonpackages/lib/treearray/package.jsonpackages/react-p-queue/package.jsonpackages/react-p-queue/tsconfig.json
…ing Node built-ins grida-cmath and react-p-queue both import from the 'assert' Node.js built-in. Changing moduleResolution to 'bundler' and restricting types to ['vitest/globals'] broke tsup's DTS build because @types/node was excluded from the types lookup. Fix: - Revert moduleResolution to 'node' for both packages - Add 'node' to the types array so @types/node is included alongside vitest/globals - Remove strict:true from react-p-queue (no strict mode in original) Co-authored-by: Universe <universe@grida.co>
Summary
Adds missing
typecheckscripts to allpackage.jsonfiles in the monorepo that were lacking them, ensuringturbo typecheckcovers the full workspace consistently.Packages with existing
tsconfig.json— addedtypecheckscript only@grida/cgpackages/grida-canvas-cg@grida/colorpackages/grida-canvas-color@grida/pixel-gridpackages/grida-canvas-pixelgrid@grida/rulerpackages/grida-canvas-ruler@grida/transparency-gridpackages/grida-canvas-transparency-grid@grida/cmathpackages/grida-cmath@grida/mixed-propertiespackages/grida-mixed-properties@grida/tokenspackages/grida-tokens@grida/treepackages/grida-treetreearraypackages/lib/treearrayreact-p-queuepackages/react-p-queuedesktopdesktop/(not in pnpm workspace; script added for local use)Packages without
tsconfig.json— createdtsconfig.json+ addedtypecheckscript@grida/bitmappackages/grida-canvas-bitmap@grida/tailwindcsspackages/grida-canvas-tailwind@app/databasedatabase/tsconfig.jsonfixesExisting tsconfigs were updated to match the project-wide convention (
target: es2020,module: esnext,moduleResolution: bundler,skipLibCheck: true,types: ["vitest/globals"]), with two important exceptions:@grida/cmathandreact-p-queuebothimport assert from "assert"(Node.js built-in). These keepmoduleResolution: nodeand usetypes: ["vitest/globals", "node"]so@types/nodeis available to bothtscandtsup's DTS worker.Skipped (intentionally)
crates/grida-canvas,crates/math2— Rust crate CI wrappers, no TypeScript sourceslibrary/shapes— plain JS bundlerpackages/grida-canvas-tailwind-colors— CSS/JSON data package with Deno generation scriptspackages/grida-canvas-react-timeline— empty placeholder packageapps/docs— Docusaurus app using Babel for TS transpilationTesting
pnpm turbo build --filter='./packages/*'— 16 packages, all successfulpnpm turbo typecheck --filter='./packages/*' --filter='./database' --filter='./packages/lib/*'— 25 packages, all successfulSummary by CodeRabbit