Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions orm/typedsql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
"author": "",
"license": "ISC",
"dependencies": {
"@prisma/client": "6.9.0"
"@prisma/client": "6.15.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Prisma Client bump to 6.15.0 looks good; ensure regeneration happens.

This aligns the example with current Prisma. Make sure @prisma/client postinstall runs or that CI executes prisma generate so TS types reflect 6.15.0.

Run:


🏁 Script executed:

#!/bin/bash
# Verify versions and that client is generated
jq -r '.dependencies["@prisma/client"]' orm/typedsql/package.json
jq -r '.devDependencies.prisma' orm/typedsql/package.json
rg -nP '(?i)prisma.*generate' -n -C2 orm/typedsql

Length of output: 1499


Ensure Prisma Client is regenerated after the version bump
Add a postinstall script in orm/typedsql/package.json (or ensure your CI runs npx prisma generate) so that TypeScript types are updated to 6.15.0, for example:

"scripts": {
  "postinstall": "prisma generate"
}
🤖 Prompt for AI Agents
In orm/typedsql/package.json around line 19, after bumping "@prisma/client" to
6.15.0 the Prisma Client must be regenerated; add a postinstall script to
package.json that runs the Prisma generator (e.g., "postinstall": "prisma
generate") or ensure your CI installs runs npx prisma generate, then run the
generate step locally (or in CI) so TypeScript types are updated to the new
Prisma version.

},
"devDependencies": {
"@types/node": "22.15.32",
"prisma": "6.9.0",
"tsx": "4.20.3"
"@types/node": "^24.3.0",
"dotenv": "^17.2.2",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

dotenv is added but not wired; ensure .env loading is actually invoked.

Right now scripts won’t load .env unless app code imports dotenv/config. Either import it in src/index.ts and prisma/seed.ts, or wrap scripts with the dotenv CLI.

If you prefer script-based loading (recommended for examples), update scripts (outside changed lines) like:

{
  "prisma": { "seed": "dotenv -e .env -- tsx prisma/seed.ts" },
  "scripts": {
    "start": "dotenv -e .env -- tsx src/index.ts",
    "dev": "dotenv -e .env -- tsx src/index.ts --watch",
    "test": "dotenv -e .env -- tsx src/index.ts",
    "debug": "dotenv -e .env -- tsx src/index.ts"
  }
}

Or add at the top of both entrypoints:

import 'dotenv/config'

Verification script:


🏁 Script executed:

#!/bin/bash
# Check if dotenv is imported or used via CLI
rg -nP 'dotenv/(config| -e )' -C2 orm/typedsql || true

Length of output: 55


🏁 Script executed:

#!/bin/bash
# Show the top of package.json to inspect scripts and dependencies
sed -n '1,200p' orm/typedsql/package.json

# Search for dotenv imports in TypeScript files
rg -nP "import\s+['\"]dotenv/config['\"]" -C2 orm/typedsql

# Search for dotenv requires in CommonJS-style files
rg -nP "require\(['\"]dotenv/config['\"]\)" -C2 orm/typedsql

# Broad search for any dotenv usage
rg -n 'dotenv' -C2 orm/typedsql

Length of output: 1039


Wire dotenv initialization
dotenv is installed but never invoked, so environment variables won’t load at runtime. You must either:

  • Add at the top of both entrypoints (src/index.ts and prisma/seed.ts):
    import 'dotenv/config'
  • Or update your package.json scripts to wrap with the dotenv CLI, for example:
    "prisma": {
      "seed": "dotenv -e .env -- tsx prisma/seed.ts"
    },
    "scripts": {
      "start": "dotenv -e .env -- tsx src/index.ts",
      "dev":   "dotenv -e .env -- tsx src/index.ts --watch",
      "test":  "dotenv -e .env -- tsx src/index.ts",
      "debug": "dotenv -e .env -- tsx src/index.ts"
    }
🤖 Prompt for AI Agents
In orm/typedsql/package.json around line 23, dotenv is listed as a dependency
but never initialized, so environment variables won’t be loaded; fix by either
importing dotenv/config at the top of both entrypoints (src/index.ts and
prisma/seed.ts) or by updating package.json scripts to run the entrypoints via
the dotenv CLI (wrap the start/dev/test/debug and prisma.seed commands with
dotenv -e .env --) so the .env file is loaded before execution.

"prisma": "6.15.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Prisma CLI 6.15.0 bump is consistent; validate config typing is resolved.

Since this PR targets a TypedSQL config type break, confirm prisma.config.ts (if present) type-checks and that prisma db seed still picks up your seed script.

Run:

If prisma.config.ts exists, ensure it imports from @prisma/config per 6.x typings.


🏁 Script executed:

#!/bin/bash
# Locate prisma.config and seed file
fd -a 'prisma.config.*' orm/typedsql || true
fd -a 'seed.ts' orm/typedsql || true

# Type-check if a tsconfig exists for the example
fd -a 'tsconfig*.json' orm/typedsql || true

Length of output: 152


Add Prisma TS config and tsconfig.json for TypeScript seed
No prisma.config.ts or tsconfig.json is present, so prisma db seed won’t load the prisma/seed.ts script. Create a prisma.config.ts (importing from @prisma/config per 6.x typings) alongside a tsconfig.json to enable runtime compilation of your TypeScript seed.

🤖 Prompt for AI Agents
In orm/typedsql/package.json around line 24, the project pins Prisma 6.15.0 but
lacks the runtime TypeScript seed configuration; add a new prisma.config.ts file
in the prisma/ directory that imports the proper helper from @prisma/config and
exports the configuration so prisma db seed can load prisma/seed.ts, and also
add a project-level tsconfig.json (or prisma/tsconfig.json) enabling compilation
for runtime seeds (target ES2020/ESNext, module ESNext or CommonJS to match your
build, allowJs false, resolveJsonModule true, esModuleInterop true, skipLibCheck
true, and include "prisma" and "prisma/seed.ts") so Prisma will compile and run
the TypeScript seed script when running prisma db seed.

"tsx": "4.20.5"
Comment on lines +22 to +25
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Dev deps bumps look fine; declare supported Node version to prevent type/runtime drift.

@types/node ^24 can expose newer APIs at type level; add an explicit engines constraint to document/support the intended Node runtime for this example.

Proposed addition (outside changed lines):

{
  "engines": { "node": ">=18.18 <=26" }
}

Adjust the range to your CI/runtime.

🤖 Prompt for AI Agents
In orm/typedsql/package.json around lines 22 to 25, add an "engines" field to
declare the supported Node runtime to avoid type/runtime drift from bumping
@types/node; insert an "engines": { "node": ">=18.18 <=26" } (or adjust the
range to match your CI/runtime) at the top-level of package.json so package
managers and CI enforce the intended Node version.

}
}
Loading