-
-
Notifications
You must be signed in to change notification settings - Fork 12
refactor(orm): consolidate kysely dialects under /dialects exports #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis PR removes the standalone Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🔇 Additional comments (3)
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 |
|
I'll analyze this and get back to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the kysely dialects architecture by consolidating them under the @zenstackhq/orm package's /dialects exports, removing the standalone @zenstackhq/kysely-sql-js package.
Key Changes:
- Moved sql.js dialect implementation from a separate package (
packages/dialects/sql.js) into the main ORM package underpackages/orm/src/dialects/sql.js/ - Added new dialect export paths for sqlite, postgres, and sql.js under
@zenstackhq/orm/dialects/* - Added sql.js as an optional peer dependency in the ORM package
Reviewed Changes
Copilot reviewed 17 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Added sql.js version to the catalog for dependency management |
| pnpm-lock.yaml | Updated lockfile with sql.js dependencies and resolved package references |
| packages/orm/tsup.config.ts | Added build entries for the three dialect exports (sqlite, postgres, sql.js) |
| packages/orm/src/dialects/sqlite.ts | Re-exports SqliteDialect from kysely for convenience |
| packages/orm/src/dialects/postgres.ts | Re-exports PostgresDialect from kysely for convenience |
| packages/orm/src/dialects/sql.js/index.ts | Main export file for sql.js dialect with attribution comment |
| packages/orm/src/dialects/sql.js/types.ts | TypeScript type definitions for SqlJsDialectConfig |
| packages/orm/src/dialects/sql.js/dialect.ts | SqlJsDialect class implementation with SQLite adapters |
| packages/orm/src/dialects/sql.js/driver.ts | SqlJsDriver implementation for connection and transaction management |
| packages/orm/src/dialects/sql.js/connection.ts | SqlJsConnection implementation for query execution |
| packages/orm/package.json | Added dialect export paths and sql.js as optional peer dependency |
| packages/dialects/sql.js/* | Removed standalone package files (package.json, configs, tests, README) |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (17)
packages/dialects/sql.js/README.md(0 hunks)packages/dialects/sql.js/eslint.config.js(0 hunks)packages/dialects/sql.js/package.json(0 hunks)packages/dialects/sql.js/src/index.ts(0 hunks)packages/dialects/sql.js/test/getting-started/database.ts(0 hunks)packages/dialects/sql.js/test/getting-started/person-repository.test.ts(0 hunks)packages/dialects/sql.js/test/getting-started/person-repository.ts(0 hunks)packages/dialects/sql.js/test/getting-started/types.ts(0 hunks)packages/dialects/sql.js/tsconfig.json(0 hunks)packages/dialects/sql.js/tsup.config.ts(0 hunks)packages/dialects/sql.js/vitest.config.ts(0 hunks)packages/orm/package.json(2 hunks)packages/orm/src/dialects/postgres.ts(1 hunks)packages/orm/src/dialects/sql.js/index.ts(1 hunks)packages/orm/src/dialects/sqlite.ts(1 hunks)packages/orm/tsup.config.ts(1 hunks)pnpm-workspace.yaml(1 hunks)
💤 Files with no reviewable changes (11)
- packages/dialects/sql.js/test/getting-started/database.ts
- packages/dialects/sql.js/README.md
- packages/dialects/sql.js/eslint.config.js
- packages/dialects/sql.js/src/index.ts
- packages/dialects/sql.js/tsup.config.ts
- packages/dialects/sql.js/tsconfig.json
- packages/dialects/sql.js/test/getting-started/person-repository.ts
- packages/dialects/sql.js/package.json
- packages/dialects/sql.js/test/getting-started/types.ts
- packages/dialects/sql.js/test/getting-started/person-repository.test.ts
- packages/dialects/sql.js/vitest.config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Agent
- GitHub Check: claude-review
- GitHub Check: build-test (20.x, sqlite)
- GitHub Check: build-test (20.x, postgresql)
🔇 Additional comments (9)
packages/orm/src/dialects/sql.js/index.ts (2)
1-2: Good practice: Attributing the original source.The comment properly credits the original author and repository.
3-4: No issues found—referenced modules exist.The verification confirms that both
dialect.tsandtypes.tsfiles exist in thepackages/orm/src/dialects/sql.js/directory. The exports in lines 3-4 correctly reference these files.packages/orm/tsup.config.ts (2)
8-9: LGTM: SQLite and Postgres dialect entries configured correctly.The build entries for SQLite and Postgres dialects follow a clean pattern and align with the package.json exports.
10-10: Output file naming is intentional and correct.The double
.jsextension (dist/dialects/sql.js.js) is intentional and matches the package.json exports. This only applies to thedialects/sql.jsentry because the source directory is namedsql.js(the library name), whereas other entries (dialects/sqlite,dialects/postgres) follow standard naming. The package.json exports are already configured to reference these double-extension paths, confirming the convention is intentional and consistent.packages/orm/package.json (2)
39-58: LGTM: SQLite and Postgres dialect exports configured correctly.The export paths for SQLite and Postgres dialects follow the standard dual-module pattern (ESM/CJS) and align with the tsup build configuration.
59-67: Confirm the sql.js output file naming is intentional.The export paths reference files with double extensions (e.g.,
sql.js.js,sql.js.cjs). While this matches the tsup configuration on line 10 of tsup.config.ts, the naming is unconventional. Verify this is the intended output structure.pnpm-workspace.yaml (1)
20-20: The sql.js version ^1.13.0 is the latest stable release (v1.13.0 released March 15, 2025), and the semver range specification is appropriate. No compatibility concerns identified.packages/orm/src/dialects/postgres.ts (1)
1-1: No issues found.Kysely v0.28.8 exports both
PostgresDialectandPostgresDialectConfigas named exports from the main package, so the re-export in postgres.ts is correct and consistent with the library's documented API.packages/orm/src/dialects/sqlite.ts (1)
1-1: Kysely exports verified.Both SqliteDialect and SqliteDialectConfig are exported from 'kysely' in v0.28. The re-export pattern is correct and follows the documented API.
|
Claude finished @ymc9's task —— View job Pull Request ReviewThis PR consolidates the standalone Todo List
✅ Overall Assessment: Good Consolidation with Minor IssuesThe refactoring achieves its goal of simplifying the package structure by removing the standalone sql.js dialect package and consolidating it into the main ORM package. The approach is architecturally sound and follows good practices. 🔧 Code Quality & Best PracticesExcellent:
Good:
|

Summary by CodeRabbit
New Features
Chores