-
-
Notifications
You must be signed in to change notification settings - Fork 28
4.0.0 #398
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
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 89ec8e6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis update modernizes the codebase by upgrading dependencies, switching from Changes
Sequence Diagram(s)sequenceDiagram
participant ESLint
participant SafeQL Plugin
participant Generate Module
participant libpg-query (WASM)
ESLint->>SafeQL Plugin: Lint SQL query in code
SafeQL Plugin->>Generate Module: Call generateSyncE(query, ...)
Generate Module->>libpg-query (WASM): parse(query.text)
libpg-query (WASM)-->>Generate Module: AST
Generate Module-->>SafeQL Plugin: Type info, errors, etc.
SafeQL Plugin-->>ESLint: Lint results
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Docstrings generation was requested by @Newbie012. * #398 (comment) The following files were modified: * `demos/basic-migrations-raw/src/index.ts` * `demos/prisma/src/index.ts` * `demos/prisma/src/prisma.ts-test.ts` * `demos/vercel-postgres/src/setup.ts` * `packages/eslint-plugin/src/rules/check-sql.rule.ts` * `packages/eslint-plugin/src/utils/is-in-editor.ts` * `packages/eslint-plugin/src/workers/check-sql.worker.ts` * `packages/eslint-plugin/src/workers/index.ts` * `packages/generate/src/generate.ts`
|
Note Generated docstrings for this pull request at #399 |
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: 5
♻️ Duplicate comments (1)
demos/prisma/src/prisma.ts-test.ts (1)
1-1: Duplicate: Path alias verification
Same alias change as inindex.ts—ensure@/prisma-clientis correctly configured intsconfig.json.
🧹 Nitpick comments (14)
packages/eslint-plugin/src/utils/is-in-editor.ts (1)
1-1: Review ESLint disable directive scope
Disablingno-constant-binary-expressionat the file level may be too broad. Consider narrowing the disable to the specific constant expression or refactoring to remove thefalse ||prefix.docs/blog/safeql-v5-roadmap.md (2)
33-33: Consider using a proper heading instead of emphasis for the date.The static analysis tool correctly identifies that emphasis (italics) is being used where a heading might be more appropriate for the publication date.
-_December 15, 2024_ +## December 15, 2024
122-122: Improve sentence variety to enhance readability.The static analysis tool identified repetitive sentence beginnings with "I'm" which could affect readability. Consider varying the sentence structure.
-I'm excited about the upcoming changes in SafeQL v5. I believe they will make the library more flexible and powerful. I'm looking forward to hearing your feedback and suggestions. +I'm excited about the upcoming changes in SafeQL v5. These updates will make the library more flexible and powerful. Your feedback and suggestions are always welcome.packages/eslint-plugin/src/rules/ts-fixture/file.ts (1)
1-1: Nit: Correct comment grammar.The comment currently reads “File needs to exists”; update it to “File needs to exist.” for grammatical correctness and clarity.
Apply this diff:
- // File needs to exists + // File needs to exist.demos/vercel-postgres/src/setup.ts (1)
19-19: Validate the connection string before use.
Add a guard to ensureprocess.env.POSTGRES_URLis defined and throw a clear error if not. For example:const url = process.env.POSTGRES_URL; if (!url) throw new Error("POSTGRES_URL is not set"); const client = new pg.Client({ connectionString: url });This prevents confusing runtime errors when the env var is missing.
.changeset/forty-meals-behave.md (1)
6-6: Fix typos in the breaking change description.There are spelling errors in the breaking change description that should be corrected for professional documentation.
-BREAKING: SafeQL now requires the latest minore releases of `libpg-query` which use WASM builds instead of native binaries. This change imporves compatibility across different platforms and eliminates native compilation issues. +BREAKING: SafeQL now requires the latest minor releases of `libpg-query` which use WASM builds instead of native binaries. This change improves compatibility across different platforms and eliminates native compilation issues.demos/big-project/eslint.config.js (1)
6-15: Review flat ESLint configuration
The flat config setup aligns with the new style and applies SafeQL rules. Confirm thatparserOptions.projectService: trueis supported; if not, specifyprojectwith the path(s) to yourtsconfig.json.demos/basic/eslint.config.js (1)
14-19: SafeQL connection configuration
Settingsafeql.configs.connectionswithdatabaseUrlandtargetsis good. You may want to allow overriding the URL via an environment variable for flexibility in CI/local setups.demos/postgresjs-demo/package.json (1)
22-22: Move@types/nodeto devDependencies.
Type definitions are only needed at build time, so relocating@types/nodetodevDependenciesprevents unnecessary production installs.demos/vercel-postgres/package.json (1)
24-24: Move@types/nodeto devDependencies.
Type definitions are only needed during development—shifting@types/nodeintodevDependenciesavoids extra production installs.demos/basic/package.json (1)
22-22: Move@types/nodetodevDependencies.
Type declaration packages are only needed at build time and shouldn’t ship as runtime deps.demos/postgresjs-demo/eslint.config.js (1)
14-20: SafeQL connection config and credentials
Theconnectionsrules are properly set to lint tagged SQL in the demo. To avoid committing credentials and enhance flexibility, consider loading the database URL from an environment variable (e.g.,process.env.DATABASE_URL).packages/generate/src/generate.ts (1)
179-182: Consider refactoring to avoid ESLint disable.The ESLint disable for unused expressions suggests a potential code smell. Consider restructuring this logic to be more explicit.
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions - map.has(table) - ? map.get(table)?.set(column, type) - : map.set(table, new Map([[column, type]])); + if (map.has(table)) { + map.get(table)?.set(column, type); + } else { + map.set(table, new Map([[column, type]])); + }packages/eslint-plugin/src/rules/check-sql.test.ts (1)
1758-1758: Consider a more descriptive test suite name.The test suite name "json(b)" could be more descriptive.
- ruleTester.run("json(b)", rules["check-sql"], { + ruleTester.run("JSON/JSONB type inference", rules["check-sql"], {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
docs/public/safeql-v4-roadmap.jpgis excluded by!**/*.jpgdocs/public/safeql-v5-roadmap.jpgis excluded by!**/*.jpgpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (107)
.changeset/forty-meals-behave.md(1 hunks).eslintrc.json(0 hunks).gitignore(1 hunks).nvmrc(1 hunks)README.md(1 hunks)demos/basic-flat-config/eslint.config.js(1 hunks)demos/basic-flat-config/package.json(1 hunks)demos/basic-flat-config/tsconfig.json(1 hunks)demos/basic-migrations-raw/.eslintrc.json(0 hunks)demos/basic-migrations-raw/.gitignore(1 hunks)demos/basic-migrations-raw/eslint.config.js(1 hunks)demos/basic-migrations-raw/package.json(1 hunks)demos/basic-migrations-raw/src/index.ts(0 hunks)demos/basic-migrations-raw/tsconfig.json(1 hunks)demos/basic-transform-type/.eslintrc.json(0 hunks)demos/basic-transform-type/.gitignore(1 hunks)demos/basic-transform-type/eslint.config.js(1 hunks)demos/basic-transform-type/package.json(2 hunks)demos/basic-transform-type/tsconfig.json(1 hunks)demos/basic/.eslintrc.json(0 hunks)demos/basic/.gitignore(1 hunks)demos/basic/eslint.config.js(1 hunks)demos/basic/package.json(2 hunks)demos/basic/tsconfig.json(1 hunks)demos/big-project/.eslintrc.json(0 hunks)demos/big-project/eslint.config.js(1 hunks)demos/big-project/package.json(2 hunks)demos/big-project/src/test.ts(1 hunks)demos/big-project/tsconfig.json(1 hunks)demos/config-file-flat-config/.gitignore(1 hunks)demos/config-file-flat-config/eslint.config.js(1 hunks)demos/config-file-flat-config/package.json(1 hunks)demos/config-file-flat-config/tsconfig.json(1 hunks)demos/from-config-file/.eslintrc.json(0 hunks)demos/from-config-file/.gitignore(1 hunks)demos/from-config-file/eslint.config.js(1 hunks)demos/from-config-file/package.json(2 hunks)demos/from-config-file/tsconfig.json(1 hunks)demos/multi-connections/.eslintrc.json(0 hunks)demos/multi-connections/.gitignore(1 hunks)demos/multi-connections/eslint.config.js(1 hunks)demos/multi-connections/package.json(1 hunks)demos/multi-connections/tsconfig.json(1 hunks)demos/playground/.eslintrc.json(0 hunks)demos/playground/eslint.config.js(1 hunks)demos/playground/package.json(2 hunks)demos/playground/tsconfig.json(1 hunks)demos/postgresjs-custom-types/.eslintrc.json(0 hunks)demos/postgresjs-custom-types/eslint.config.js(1 hunks)demos/postgresjs-custom-types/package.json(1 hunks)demos/postgresjs-custom-types/tsconfig.json(1 hunks)demos/postgresjs-demo/.eslintrc.json(0 hunks)demos/postgresjs-demo/.gitignore(1 hunks)demos/postgresjs-demo/eslint.config.js(1 hunks)demos/postgresjs-demo/package.json(2 hunks)demos/postgresjs-demo/tsconfig.json(1 hunks)demos/prisma/.eslintrc.json(0 hunks)demos/prisma/.gitignore(1 hunks)demos/prisma/eslint.config.js(1 hunks)demos/prisma/package.json(1 hunks)demos/prisma/prisma/schema.prisma(1 hunks)demos/prisma/src/index.ts(1 hunks)demos/prisma/src/prisma.ts-test.ts(1 hunks)demos/prisma/tsconfig.json(1 hunks)demos/shared/package.json(1 hunks)demos/typeorm/.eslintrc.json(0 hunks)demos/typeorm/eslint.config.js(1 hunks)demos/typeorm/package.json(2 hunks)demos/typeorm/src/data-source.ts(1 hunks)demos/typeorm/tsconfig.json(1 hunks)demos/vercel-postgres/.eslintrc.json(0 hunks)demos/vercel-postgres/eslint.config.js(1 hunks)demos/vercel-postgres/package.json(2 hunks)demos/vercel-postgres/src/setup.ts(2 hunks)demos/vercel-postgres/tsconfig.json(1 hunks)docs/blog/safeql-v5-roadmap.md(4 hunks)docs/guide/getting-started.md(1 hunks)docs/package.json(1 hunks)eslint.config.js(1 hunks)package.json(2 hunks)packages/ast-types/.eslintrc.json(0 hunks)packages/ast-types/package.json(1 hunks)packages/ast-types/src/index.ts(1 hunks)packages/ast-types/tsconfig.json(1 hunks)packages/eslint-plugin/.eslintrc.json(0 hunks)packages/eslint-plugin/build.config.ts(1 hunks)packages/eslint-plugin/package.json(1 hunks)packages/eslint-plugin/src/dirs.ts(0 hunks)packages/eslint-plugin/src/rules/check-sql.rule.ts(2 hunks)packages/eslint-plugin/src/rules/check-sql.test.ts(2 hunks)packages/eslint-plugin/src/rules/ts-fixture/file.ts(1 hunks)packages/eslint-plugin/src/rules/ts-fixture/tsconfig.json(1 hunks)packages/eslint-plugin/src/utils/is-in-editor.ts(1 hunks)packages/eslint-plugin/src/workers/check-sql.worker.ts(1 hunks)packages/eslint-plugin/src/workers/index.ts(1 hunks)packages/eslint-plugin/src/workers/parse-sync.worker.ts(0 hunks)packages/eslint-plugin/tsconfig.json(1 hunks)packages/generate/.eslintrc.json(0 hunks)packages/generate/build.config.ts(1 hunks)packages/generate/package.json(1 hunks)packages/generate/src/generate.test.ts(2 hunks)packages/generate/src/generate.ts(3 hunks)packages/generate/src/utils/get-nonnullable-columns.test.ts(1 hunks)packages/generate/src/utils/get-relations-with-joins.test.ts(1 hunks)packages/generate/tsconfig.json(1 hunks)packages/shared/.eslintrc.json(0 hunks)packages/shared/package.json(1 hunks)
⛔ Files not processed due to max files limit (10)
- packages/shared/tsconfig.json
- packages/sql-tag/.eslintrc.json
- packages/sql-tag/package.json
- packages/sql-tag/tsconfig.json
- packages/test-utils/.eslintrc.json
- packages/test-utils/package.json
- packages/test-utils/tsconfig.json
- pnpm-workspace.yaml
- tsconfig.node.json
- turbo.json
💤 Files with no reviewable changes (20)
- demos/basic-migrations-raw/src/index.ts
- packages/generate/.eslintrc.json
- packages/eslint-plugin/.eslintrc.json
- packages/ast-types/.eslintrc.json
- demos/postgresjs-demo/.eslintrc.json
- demos/playground/.eslintrc.json
- demos/prisma/.eslintrc.json
- packages/shared/.eslintrc.json
- demos/basic-migrations-raw/.eslintrc.json
- demos/multi-connections/.eslintrc.json
- packages/eslint-plugin/src/workers/parse-sync.worker.ts
- demos/big-project/.eslintrc.json
- demos/vercel-postgres/.eslintrc.json
- packages/eslint-plugin/src/dirs.ts
- .eslintrc.json
- demos/postgresjs-custom-types/.eslintrc.json
- demos/basic/.eslintrc.json
- demos/basic-transform-type/.eslintrc.json
- demos/typeorm/.eslintrc.json
- demos/from-config-file/.eslintrc.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/eslint-plugin/src/workers/index.ts (1)
packages/eslint-plugin/src/workers/check-sql.worker.ts (1)
CheckSQLWorkerHandler(37-37)
🪛 markdownlint-cli2 (0.17.2)
docs/blog/safeql-v5-roadmap.md
33-33: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
🪛 LanguageTool
docs/blog/safeql-v5-roadmap.md
[style] ~122-~122: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...the library more flexible and powerful. I'm looking forward to hearing your feedb...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: check (ubuntu-latest, 20)
🔇 Additional comments (125)
.nvmrc (1)
1-1: Bump Node.js version to 20
This update aligns the runtime with upgraded ESLint configs and dependencies. Ensure that CI workflows, Dockerfiles, and any developer documentation are updated to reference Node 20..gitignore (1)
3-5: Approve new ignore patterns
Ignoring build artifacts (*.tsbuildinfo,dist,generated) aligns with the updated output directories and keeps the repo clean.demos/basic/.gitignore (1)
1-1: Approve updated ignore directory
Ignoring thedistdirectory matches the new build output path in this demo.demos/basic-flat-config/package.json (1)
13-18: Approve devDependencies upgrades
Upgrading@eslint/js,@types/node,eslint,tsx,typescript, andtypescript-eslintis consistent with the monorepo’s modernization and maintains alignment across demos.demos/shared/package.json (2)
4-4: Approve ES module field
Adding"type": "module"correctly marks this demo as an ES module.
6-6: Approve TypeScript version bump
Updating TypeScript to^5.8.2aligns with other demos and the root configuration.packages/ast-types/src/index.ts (1)
1-1: Verify that the new ESLint disable rule covers all previous cases.The ESLint disable comment has been simplified from three specific rules to a single
@typescript-eslint/no-empty-object-typerule. Ensure this new rule properly covers the same linting cases as the previous rules (no-empty-interface,ban-types, andno-namespace).#!/bin/bash # Description: Verify the ESLint rule change covers the same cases # Search for usage patterns that the old rules would have caught echo "=== Searching for empty interfaces ===" ast-grep --pattern 'interface $_ {}' echo "=== Searching for namespace declarations ===" ast-grep --pattern 'namespace $_ { $$$ }' echo "=== Searching for type aliases with object types ===" ast-grep --pattern 'type $_ = {}'packages/ast-types/tsconfig.json (1)
2-5: LGTM! Build output configuration aligned with codebase standards.The TypeScript configuration correctly specifies the output directory as
./dist, which aligns with the project-wide standardization mentioned in the AI summary.packages/ast-types/package.json (2)
27-27: LGTM! Clean script updated to align with new build output directory.The clean script correctly targets the new
distdirectory, consistent with the tsconfig.json changes.
30-35: Verify compatibility with major dependency updates.Several dependencies have been updated to newer major versions, particularly ESLint (8.x → 9.x) and TypeScript-ESLint (7.x → 8.x). Ensure these updates don't introduce breaking changes that affect the build or linting process.
#!/bin/bash # Description: Check for potential breaking changes in updated dependencies # Check if there are any ESLint configuration issues with the new versions echo "=== Checking ESLint configuration compatibility ===" cd packages/ast-types npm ls eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser echo "=== Testing lint command ===" npm run lint 2>&1 || echo "Linting may have issues with new versions" echo "=== Testing TypeScript compilation ===" npm run typecheck 2>&1 || echo "TypeScript compilation may have issues"packages/eslint-plugin/src/rules/ts-fixture/tsconfig.json (1)
1-10: LGTM! Well-configured TypeScript setup for ESLint rule testing.The TypeScript configuration uses appropriate modern settings for a test fixture environment. The ESNext target and Bundler module resolution are suitable for testing scenarios, and strict mode ensures type safety.
docs/blog/safeql-v5-roadmap.md (1)
2-2: LGTM! Comprehensive version update from v4 to v5.The documentation has been thoroughly updated to reflect the new major version across all relevant sections including metadata, headings, and content references.
Also applies to: 16-16, 19-19, 22-22, 25-25, 31-31, 35-35, 37-37, 51-51, 122-122
package.json (2)
5-5: Add"type": "module"for ESM support
Approving explicit ESM mode declaration to enable ES module resolution across the workspace.Please verify that all import paths and sub-package configurations are compatible with ESM (no remaining CommonJS-only imports).
31-34: Approve devDependency version bumps
The upgrades for@changesets/cli,prettier,turbo, andtypescriptalign with the modernization effort.demos/config-file-flat-config/eslint.config.js (1)
8-8: Formatting-only change (trailing comma)
This trailing comma addition does not affect functionality.demos/prisma/src/index.ts (1)
1-1: Verify@/prisma-clientpath alias
Confirm that the TypeScriptpathsconfiguration points to./generated/clientand that imports resolve correctly at runtime.demos/typeorm/tsconfig.json (1)
4-4: Verify.gitignorefordist
WithoutDirswitched to./dist, ensure thedistfolder is added to.gitignoreto avoid committing build artifacts.demos/multi-connections/.gitignore (1)
1-1: Approve: Updated ignore directory aligns with standard.Ignoring the
distdirectory matches the new output configuration and maintains consistency across demos.demos/prisma/prisma/schema.prisma (1)
6-6: Approve: Updated Prisma client output path.Switching the client generator
outputto"../generated/client"aligns with updated TypeScript path aliases and ensures generated code resides outsidenode_modules.demos/from-config-file/.gitignore (1)
1-1: Approve: Standardized output ignore folder.Ignoring
distaligns with the new build output directory and matches changes in other demos.demos/config-file-flat-config/tsconfig.json (1)
4-4: Standardize compile output todist.The
outDiris correctly set to./dist, aligning with the project-wide convention for emitted files.demos/basic-migrations-raw/tsconfig.json (1)
4-4: Standardize compile output todist.The
outDiris correctly set to./dist, aligning with the project-wide convention for emitted files.demos/basic-flat-config/tsconfig.json (1)
4-4: Standardize compile output todist.The
outDiris correctly set to./dist, aligning with the project-wide convention for emitted files.demos/from-config-file/tsconfig.json (1)
4-4: Standardize compile output todist.The
outDiris correctly set to./dist, aligning with the project-wide convention for emitted files.demos/postgresjs-demo/.gitignore (1)
1-1: Ignore thedistdirectory.Updated
.gitignoreto exclude thedistfolder instead oflib, matching the new output directory.docs/guide/getting-started.md (1)
9-9: Approve updated prerequisite instructions.The simplified standalone sentence is clear and the link is correct.
demos/basic-migrations-raw/.gitignore (1)
1-1: Approve updated ignore directory.Ignoring
distnow aligns with the updated build outputs.demos/config-file-flat-config/.gitignore (1)
1-1: Approve updated ignore directory.Standardizing on
distacross demos is consistent.demos/basic-transform-type/.gitignore (1)
1-1: Approve updated ignore directory.Consistent
distignore pattern applied.demos/vercel-postgres/src/setup.ts (1)
3-3: Confirm default import semantics forpg.
Switching from a named import ({ Client }) to a default import (pg) is fine under ESM, but please verify that your build/runtime interop supports it. If you encounter issues, consider reverting to:import { Client } from "pg";demos/basic-transform-type/tsconfig.json (1)
4-4: Emit compiled files intodist.
Replacing"noEmit": truewith"outDir": "./dist"aligns with other demos and enables your build artifacts to be generated. Make sure your scripts (e.g.,buildinpackage.json) referencedistaccordingly.demos/multi-connections/tsconfig.json (1)
4-4: Configure output directory for compiled code.
Adding"outDir": "./dist"ensures that all transpiled files land in a single folder. Verify that your CI/CD and local build steps target this directory.demos/basic/tsconfig.json (1)
4-4: Standardize output folder todist.
The new"outDir": "./dist"replacesnoEmitand standardizes artifact placement across demos. Confirm that your downstream tooling (e.g., demos launch scripts) points todist.demos/playground/tsconfig.json (1)
4-4: Enable emission todist.
Switching to"outDir": "./dist"aligns this project with the rest of the repo. Ensure.gitignoreis updated to excludedist/and that any import paths or scripts reference the new folder.demos/vercel-postgres/tsconfig.json (1)
4-4: Enable emitted output todistdirectory
Switching from suppressing emissions to specifying"outDir": "./dist"aligns with the standardized build outputs across demos. Ensure that any scripts, CI steps, and.gitignoreentries now referencedistinstead of relying onnoEmit.demos/big-project/tsconfig.json (1)
4-4: Emit compiled files intodist
Consistent with other demos,"outDir": "./dist"enables file emission. Please verify removal of any legacynoEmitflags and update downstream tooling to consume fromdist.demos/postgresjs-custom-types/tsconfig.json (1)
4-4: Standardize TypeScript output directory
ReplacingnoEmitwith"outDir": "./dist"ensures build artifacts are emitted. Confirm that.gitignoreand cleanup targets include thedistfolder.packages/generate/build.config.ts (1)
12-12: Marklibpg-queryas external
Adding"libpg-query"toexternalsprevents bundling its wasm/native binaries, reducing bundle size. Ensure it’s declared underdependenciesorpeerDependenciesinpackage.json.packages/generate/tsconfig.json (1)
2-5: Configure compiler output todist
Introducing"outDir": "./dist"enables generated files to be placed in thedistfolder. Verify removal ofnoEmitand update build/clean scripts accordingly.docs/package.json (2)
13-14: LGTM! Documentation dependency updates look good.The vitepress and plugin version updates are reasonable incremental upgrades that should provide bug fixes and new features.
18-18: LGTM! Analytics dependency update is appropriate.The @vercel/analytics update to ^1.5.0 is a reasonable minor version bump.
demos/basic-flat-config/eslint.config.js (1)
11-11: Good practice: Adding trailing comma improves maintainability.The trailing comma addition follows JavaScript best practices and will make future configuration changes result in cleaner diffs.
packages/eslint-plugin/build.config.ts (2)
12-12: LGTM! Externalizing libpg-query is appropriate for WASM builds.Adding libpg-query to externals makes sense with the migration to WASM builds, as it should now be a runtime dependency rather than bundled.
5-5: Verify removal of parse-sync worker references.The removal of the parse-sync worker from build entries aligns with the WASM migration. Ensure all imports and references to this worker have been removed from the codebase.
#!/bin/bash # Description: Verify that all references to parse-sync.worker.ts have been removed # Expected: No references should remain # Search for any remaining references to the removed worker rg -i "parse-sync\.worker" --type ts --type jspackages/eslint-plugin/tsconfig.json (1)
4-6: Let’s refine the checks for leftover “lib” references and ensuredist/is ignored:#!/bin/bash # 1. Verify .gitignore includes dist/ echo "Checking .gitignore for dist/…" grep -n 'dist/' .gitignore || echo "✗ dist/ not found in .gitignore" # 2. Look for any --outDir lib in package.json scripts echo -e "\nSearching package.json for --outDir lib…" grep -R '"scripts"' -n package.json | sed -n '1,20p' grep -R 'outDir.*lib' -n package.json || echo "✓ No --outDir lib references in package.json" # 3. Find any local imports or paths pointing to a lib/ directory echo -e "\nScanning .ts/.js files for './lib/' or '/lib/' paths…" rg -g '*.ts' -g '*.js' '(\./lib/|/lib/)' -n || echo "✓ No local lib/ imports found"demos/prisma/tsconfig.json (2)
4-4: LGTM! Enabling compilation output aligns with the migration.The change from
"noEmit": trueto"outDir": "./dist"properly enables TypeScript compilation output, consistent with the broader standardization todistdirectories across the project.
6-6: Good update to the Prisma client path alias.The path change from
"./node_modules/.prisma/client"to"./generated/client"aligns with the updated Prisma client output directory, making the generated client location more explicit and avoiding node_modules dependencies.demos/typeorm/src/data-source.ts (1)
3-4: Correct ES module __dirname implementation.This is the standard pattern for replicating CommonJS
__dirnamefunctionality in ES modules. The implementation correctly usesimport.meta.urlto obtain the current module's directory path, enabling the existing path resolution on line 11 to continue working.README.md (1)
36-36: Good simplification of prerequisites.The removal of node-gyp requirements and simplification to focus on ESLint setup aligns well with the migration to WebAssembly builds for
libpg-query. This reduces setup complexity for users while maintaining the essential TypeScript ESLint configuration guidance.packages/generate/package.json (2)
30-30: LGTM! Clean script updated for new output directory.The change from
"rm -rf lib"to"rm -rf dist"properly aligns with the standardization of output directories across the project.
33-41: ```shell
#!/bin/bashList all TypeScript config files across the repo (excluding node_modules)
echo "Listing all tsconfig.json files:"
find . -not -path "./node_modules/*" -name "tsconfig.json"List all ESLint configuration files across the repo
echo
echo "Listing all ESLint config files (.eslintrc.* and eslint.config.js):"
find . -not -path "./node_modules/*" (
-name "eslint.config.js"
-o -name ".eslintrc.js"
-o -name ".eslintrc.json"
-o -name ".eslintrc.yaml"
-o -name ".eslintrc.yml"
)</details> <details> <summary>demos/big-project/src/test.ts (1)</summary> `5-6`: **Consistent ES module __dirname implementation.** This follows the same correct pattern used in other files for ES module compatibility. The implementation properly enables the existing `path.join(__dirname, ...)` usage on line 7 to continue working in the ES module context. </details> <details> <summary>packages/generate/src/utils/get-relations-with-joins.test.ts (1)</summary> `119-119`: **Verify API compatibility and consistency across the codebase.** The change from `parser.parseQuery` to `parser.parse` aligns with the migration to WASM-based parsing. Ensure this API change is consistent throughout the codebase and that the new method has the same signature and behavior. ```shell #!/bin/bash # Description: Verify all usages of parser.parseQuery have been updated to parser.parse # Search for any remaining usage of the old API rg "parseQuery" --type ts # Search for the new API usage to confirm consistency rg "parser\.parse" --type ts -A 2packages/eslint-plugin/src/workers/check-sql.worker.ts (2)
25-28: Import reordering looks good.The import reordering is a cosmetic improvement with no functional impact.
30-35: ```shell
#!/bin/bashSearch for any remaining references to
pgParsedin the codebaserg --heading --line-number 'pgParsed' --color never
</details> <details> <summary>demos/config-file-flat-config/package.json (1)</summary> `13-18`: **Verify compatibility of major dependency upgrades.** Several major version upgrades require attention: - ESLint: 8.57.1 → 9.23.0 (breaking changes expected) - typescript-eslint: 7.18.0 → 8.28.0 (breaking changes expected) - @types/node: 18.19.68 → 22.13.13 (significant Node.js version jump) Ensure the new ESLint flat config system is properly supported and test the demo thoroughly. ```web What are the breaking changes in ESLint 9.0 compared to ESLint 8.x?What are the breaking changes in typescript-eslint 8.0 compared to 7.x?demos/from-config-file/eslint.config.js (1)
1-15: Excellent modernization to ESLint flat config.The new configuration properly implements the ESLint flat config system with:
- Correct TypeScript ESLint parser integration
- Modern
projectService: truefor better performance- Proper SafeQL plugin configuration
- Clean file targeting pattern
This is a significant improvement over the legacy
.eslintrc.jsonformat.demos/typeorm/package.json (2)
4-4: Verify ES modules compatibility throughout the demo.The addition of
"type": "module"is a significant change that requires:
- All imports to use explicit file extensions where needed
- Compatibility with CommonJS dependencies
- Proper handling of
__dirnameand__filename(useimport.meta.urlinstead)Ensure the demo works correctly with ES modules.
#!/bin/bash # Description: Check for potential ES modules compatibility issues # Look for CommonJS-style require statements that need updating rg "require\(" demos/typeorm/src --type ts # Check for __dirname/__filename usage that needs ES modules equivalent rg "__dirname|__filename" demos/typeorm/src --type ts # Verify import statements have proper extensions where needed rg "from ['\"]\.\.?/[^'\"]*[^\.]['\"]" demos/typeorm/src --type ts
15-23: Verify compatibility of upgraded dependencies.Multiple dependency upgrades include:
- Runtime: pg (8.14.1), reflect-metadata (0.2.2), typeorm (0.3.21)
- Dev: TypeScript (5.8.2), ESLint (9.23.0), typescript-eslint (8.28.0)
Ensure the TypeORM demo functions correctly with these updates, especially with the ES modules migration.
What are the breaking changes in TypeORM 0.3.21 compared to earlier versions?Also applies to: 27-29
packages/generate/src/utils/get-nonnullable-columns.test.ts (1)
82-82: LGTM - Clean API migrationThe change from
parser.parseQuerytoparser.parsealigns with the broader simplification of SQL parsing flows mentioned in the PR summary. This internal API update maintains the same functionality while using the updated libpg-query interface.eslint.config.js (1)
1-19: Well-structured ESLint flat config migrationThis configuration properly migrates to the modern ESLint flat config format with appropriate settings:
- Correct file targeting for the packages directory
- Proper exclusion of test files
- Modern typescript-eslint integration with projectService enabled
- Reasonable rule customization
The migration aligns with the broader modernization effort described in the PR.
demos/playground/eslint.config.js (1)
1-15: Appropriate demo-specific ESLint configurationThis configuration correctly adapts the flat config format for the playground demo with:
- Proper file targeting for the demo's source structure
- Correct integration with the SafeQL ESLint plugin
- Type-aware linting enabled via projectService
- Use of SafeQL's useConfigFile configuration
The setup supports the demo's SQL linting requirements while maintaining consistency with the overall modernization.
demos/basic-migrations-raw/package.json (2)
4-4: ES module migration enabledAdding
"type": "module"correctly enables ES modules for this demo package, aligning with the broader modernization effort.
12-15: Modern dependency consolidationThe dependency updates properly consolidate ESLint tooling and upgrade to recent versions. The migration from separate
@typescript-eslint/parserand@typescript-eslint/eslint-pluginpackages to the unifiedtypescript-eslintpackage follows current best practices.Let me verify these dependency versions are current and secure:
#!/bin/bash # Check for the latest versions of the updated dependencies echo "Checking latest versions of updated dependencies..." # Check latest stable versions npm view @eslint/js version npm view eslint version npm view typescript version npm view typescript-eslint version # Check for any security advisories npm audit --json | jq -r '.vulnerabilities | keys[]' 2>/dev/null || echo "No vulnerabilities found"packages/generate/src/generate.test.ts (2)
186-204: Simplified test flow aligns with parsing refactorThe removal of the
parseQueryTEstep and direct use ofgenerateTEwith the query object correctly reflects the architectural change to handle SQL parsing internally during generation rather than pre-parsing. This simplification reduces complexity while maintaining test coverage.
694-694: Correct error message updateThe removal of the "Internal error: " prefix from the expected error message aligns with the parsing workflow changes. The raw PostgreSQL syntax error is now exposed directly, which provides clearer error reporting.
packages/shared/package.json (3)
28-28: Update clean script to targetdistdirectory
Thecleanscript now removesdistinstead oflib, aligning with the new output directory convention.
31-38: Bump devDependencies to latest tooling versions
Upgraded to TS 5.8.2, ESLint 9.23.0, Vitest 3.0.9, etc. Ensure there are no regressions in type-checking, linting, or tests after these upgrades.
40-42: Verify compatibility ofminimatch@^10.0.1
Version 10 is pure ESM and may affect CJS import paths. Please confirm that allminimatchusages import correctly and update any require statements if needed.demos/from-config-file/package.json (3)
4-4: Mark package as ESM with"type": "module"
Good modernization. Ensure downstream scripts and imports are compatible with ESM.
13-18: Align devDependencies with upgraded tooling
Consolidating to@eslint/js,typescript-eslint, ESLint 9.23.0, TS 5.8.2, etc., matches the shared package. Verify lint and build pipelines still pass.
21-22: Add@types/nodefor Node type definitions
Pinning to^22.13.13ensures proper type coverage.demos/big-project/eslint.config.js (1)
3-5: Verify ESLint imports
Ensureimport tseslint from "typescript-eslint";andimport safeql from "@ts-safeql/eslint-plugin/config";resolve correctly given the demo’s dependencies.demos/basic/eslint.config.js (1)
9-12: Check parserOptions usage
Verify thatparserOptions.projectService: truecorrectly enables type-aware linting in this flat config. Otherwise, consider usingproject: ["./tsconfig.json"]withtsconfigRootDir.demos/basic-transform-type/package.json (3)
4-4: Add"type": "module"to package
Marking the demo as ESM. Ensure no CJSrequirecalls remain.
13-17: Upgrade and consolidate ESLint and TS dependencies
Switching to@eslint/jsandtypescript-eslint, upgrading ESLint to 9.23.0 and TS to 5.8.2, matches the modernization across demos.
21-22: Update@types/node
Bumped to^22.13.13for Node 22 definitions.demos/postgresjs-demo/package.json (2)
4-4: Approve ES module adoption.
Explicitly marking the demo as an ES module is correct and aligns with the project-wide migration.
13-17: Verify the consolidated ESLint packages.
Confirm that the newtypescript-eslintpackage covers both parsing and plugin functionality (replacing the previous@typescript-eslint/parserand@typescript-eslint/eslint-plugin) and is compatible with@eslint/js.demos/prisma/eslint.config.js (2)
1-5: Approve imports and TS-check directive.
The use of// @ts-checkalongsidetypescript-eslintand the SafeQL plugin import is correct and follows the new configuration pattern.
6-20: Approve programmatic ESLint configuration.
The parser, parserOptions, file globs, and SafeQL connections setup (migrationsDir and SQL tag targets) correctly implement the updated linting flow.demos/typeorm/eslint.config.js (2)
1-5: Approve imports and TS-check directive.
The initial setup withtypescript-eslint, SafeQL config import, and// @ts-checkaligns with the new ESLint config approach.
6-20: Approve ESLint configuration for TypeORM.
Files pattern, parser settings, and SafeQLconnectionsinvocation withdatabaseUrland SQL tag targets are applied correctly.demos/multi-connections/package.json (2)
4-4: Approve ES module adoption.
Adding"type": "module"brings this demo in line with the repository’s ES module standard.
12-16: Verify consolidated ESLint dependencies.
Ensure thattypescript-eslinteffectively replaces both parser and plugin packages, and that it integrates smoothly with@eslint/js.demos/vercel-postgres/package.json (3)
4-4: Approve ES module adoption.
Specifying"type": "module"here is correct and consistent with other demos.
13-19: Verify consolidated ESLint dependencies.
Confirm thattypescript-eslintprovides the necessary parser and plugin functionality in place of the old@typescript-eslintpackages when used with@eslint/js.
25-27: Verify database client upgrades.
Ensure bumping@vercel/postgresto 0.10.0 andpgto 8.14.1 doesn’t introduce breaking changes, and that the demo’s setup script still functions correctly.demos/basic/package.json (2)
4-4: Module type declaration is correct.
Setting"type": "module"ensures ESM usage across the demo.
13-17: Dev dependencies consolidated and upgraded.
Swapping out separate@typescript-eslintparser/plugin for unifiedtypescript-eslintand bumping ESLint, TS, and related tooling versions aligns with the other demos.demos/basic-migrations-raw/eslint.config.js (2)
1-5: Add TypeScript-aware ESLint setup.
The// @ts-checkcomment and imports fromtypescript-eslintand the SafeQL plugin are properly configured.
6-20: ESLint configuration for SafeQL migrations.
The new JavaScript-based config correctly targetssrc/**/*.ts, enables the TS parser service, and extends SafeQL’sconnectionsrules with the proper migrations directory and query-wrapper patterns.demos/prisma/package.json (3)
12-12: Update clean script to targetdist.
Switching from removinglibtodistmatches the new output directory convention.
15-23: Dev dependencies upgraded and unified.
Replacing separate@typescript-eslintpackages withtypescript-eslintplus@eslint/js, bumping TS/ESLint/tsx/zx versions keeps tooling in sync with other demos.
26-27: Prisma dependencies bumped to 6.5.0.
Locking both@prisma/clientandprismato the same new major version ensures compatibility.demos/postgresjs-demo/eslint.config.js (2)
1-5: Initialize TS-aware ESLint config.
Adding// @ts-checkand importingtypescript-eslintand SafeQL configs follows the pattern used across demos.
6-13: Core ESLint settings look solid.
Targetingsrc/**/*.ts, enabling the TS parser service, and setting the parser totypescript-eslintare all correctly applied.demos/playground/package.json (3)
4-4: Switch to ESM by setting"type": "module".
This aligns the playground demo with the rest of the project’s module format.
13-18: Upgrade and consolidate dev dependencies.
Replacing separate TypeScript ESLint packages withtypescript-eslintand adding@eslint/js, plus bumping TS/ESLint/tsx versions, standardizes tooling.
21-23: Runtime dependencies are in place.
Shared demo packages and the Postgres client remain independenciesas expected.demos/postgresjs-custom-types/package.json (2)
4-4: LGTM! ES module declaration added correctly.The explicit
"type": "module"declaration properly enables ES module support for this demo package.
12-17: Verify compatibility of major dependency upgrades.Several dependencies have been upgraded to newer major versions. Ensure these upgrades don't introduce breaking changes that could affect the demo functionality.
#!/bin/bash # Description: Check for breaking changes in upgraded dependencies echo "Checking for potential breaking changes in upgraded dependencies..." # Check ESLint 9.x breaking changes echo "ESLint 9.x introduced flat config as default and removed several rules" # Check TypeScript 5.8.x changes echo "TypeScript 5.8.x changes need verification" # Check if there are any usage patterns that might be affected rg -A 3 -B 3 "eslint|typescript" --type ts --type jsdemos/vercel-postgres/eslint.config.js (1)
1-20: LGTM! Well-structured ESLint flat config.The ESLint configuration properly:
- Uses the modern flat config format
- Integrates typescript-eslint and SafeQL plugins correctly
- Targets appropriate TypeScript files
- Enables projectService for better TypeScript integration
packages/generate/src/generate.ts (2)
25-25: LGTM! Direct libpg-query import for WebAssembly support.The change to import libpg-query directly aligns with the migration to WebAssembly builds and removes dependency on native binaries.
264-266: Verify error handling for runtime SQL parsing.The shift from pre-parsed ASTs to runtime parsing is a significant architectural change. Ensure proper error handling is in place for parsing failures.
#!/bin/bash # Description: Check for error handling patterns around libpg-query usage echo "Checking for error handling around libpg-query.parse calls..." ast-grep --pattern 'parser.parse($_)' echo "Checking for try-catch blocks around parsing..." ast-grep --pattern 'try { $$$ parser.parse($_) $$$ } catch ($_) { $$$ }'packages/eslint-plugin/package.json (4)
38-38: LGTM! Test output improvement.The
--hideSkippedTests=trueflag improves test output readability by hiding skipped tests.
42-42: LGTM! Output directory standardization.Changing the clean script from
libtodistaligns with the broader standardization effort across packages.
64-64: Clarify purpose of new "quansync" dependency.The addition of
quansyncas a new dependency needs clarification on its purpose and usage within the codebase.#!/bin/bash # Description: Check usage of quansync in the codebase echo "Searching for quansync usage..." rg "quansync" --type ts --type js -A 2 -B 2 echo "Checking imports of quansync..." ast-grep --pattern 'import $_ from "quansync"' ast-grep --pattern 'import { $_ } from "quansync"'
72-72: Verify impact of peer dependency version bump.The peer dependency on
@typescript-eslint/utilswas bumped from>=7.8.0to>=8.0.0. This is a breaking change that may affect downstream consumers.#!/bin/bash # Description: Check for potential breaking changes in @typescript-eslint/utils v8 echo "Checking current usage of @typescript-eslint/utils..." rg "@typescript-eslint/utils" --type ts -A 2 -B 2 echo "Looking for imports from @typescript-eslint/utils..." ast-grep --pattern 'import { $_ } from "@typescript-eslint/utils"'demos/basic-transform-type/eslint.config.js (1)
1-20: LGTM! Well-structured ESLint config with SafeQL integration.The configuration properly integrates SafeQL with specific database connection settings and query patterns.
demos/postgresjs-custom-types/eslint.config.js (2)
1-4: LGTM!The imports are correctly structured with
@ts-checkdirective for type checking in JavaScript files.
6-30: Configuration structure looks good!The SafeSQL configuration properly handles custom PostgreSQL types with appropriate overrides for
timestamptzand null handling options.demos/multi-connections/eslint.config.js (1)
15-24: Well-structured multi-connection configuration!The setup properly isolates each database client with its own migrations directory and query method patterns.
demos/big-project/package.json (3)
4-4: ES module configuration added correctly.The
"type": "module"declaration properly configures the package for ES modules.
14-18: Dependencies modernized correctly.The migration to the consolidated
typescript-eslintpackage and addition of@eslint/jsaligns with current ESLint best practices.
22-22: Verify Node.js version compatibility.The update from
@types/nodev18 to v22 is a significant jump. Please ensure this aligns with your minimum Node.js version requirements.#!/bin/bash # Check for Node.js version requirements in the repository fd -e json -e md -e yml -e yaml | xargs rg -i "node.*version|engines" -A 2 -B 2packages/eslint-plugin/src/rules/check-sql.rule.ts (2)
2-2: Import cleanup looks good.The removal of
PostgresErroraligns with the simplified parsing flow.
179-181: Good simplification of the parsing flow.Removing the intermediate parsing step reduces complexity and delegates all SQL parsing to the generate worker, ensuring consistency.
packages/eslint-plugin/src/rules/check-sql.test.ts (2)
9-9: Parser configuration modernized correctly.The update to use
languageOptionswith direct parser import follows ESLint's current best practices for flat configurations.Also applies to: 22-28
1758-1965: Comprehensive JSON/JSONB test coverage!The test suite thoroughly covers PostgreSQL JSON functions including
jsonb_build_object,json_agg, andjsonb_aggwith proper type inference validation.packages/eslint-plugin/src/workers/index.ts (5)
2-2: LGTM! Import changes align with the ES module migration.The switch from
AnyAsyncFntoAnyFnand the addition offileURLToPathimport are consistent with the modernization efforts described in the PR objectives.Also applies to: 4-4
6-6: LGTM! Local distDir definition replaces the removed import.The use of
fileURLToPathandURLwithimport.meta.urlis the correct approach for ES modules to resolve relative paths.
8-8: LGTM! Type constraint change is consistent with the import update.The change from
AnyAsyncFn<R>toAnyFn<R>aligns with the migration away from async-specific worker functions.
16-16: Verify that the timeout reduction is appropriate.The timeout was reduced from 5 minutes to 1 minute (80% reduction). Ensure this is sufficient for the worker's operations to prevent premature timeouts in production.
Based on the AI summary mentioning "streamlined worker usage pattern," this reduction may be intentional, but please confirm that 1 minute is adequate for the worker's expected workload.
9-9: ```shell
#!/bin/bash
set -eInspect how distDir is defined and used in index.ts
echo "→ distDir declarations in index.ts:"
grep -R "distDir" -n packages/eslint-plugin/src/workers/index.ts || trueecho -e "\n→ Top of index.ts (for context):"
sed -n '1,200p' packages/eslint-plugin/src/workers/index.ts || trueLook for any tsup config to see output directory settings
echo -e "\n→ tsup configuration (if present) in the repo:"
grep -R "tsup" -n .Check build scripts in package.json to find the build command for this plugin
echo -e "\n→ Build scripts in package.json files:"
grep -R ""build"" -n package.json packages/eslint-plugin/package.json || true</details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Documentation
Refactor