fix(adapter-node-pg): rename binder dependency to publishable package name#439
fix(adapter-node-pg): rename binder dependency to publishable package name#439
Conversation
📝 WalkthroughWalkthroughThis PR renames the internal binder package from Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 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)
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/_shared/binder/package.json`:
- Around line 2-4: The package "@rawsql-ts/shared-binder" is marked "private":
true which prevents it being published and breaks consumers like adapter-node-pg
that import compileNamedParameters from it (see PgTestkitClient.ts and the
workspace:^ dependency). Fix by removing the "private": true field from
packages/_shared/binder/package.json and ensure the package has a proper version
and publish settings so it is published to npm; alternatively (if you prefer not
to publish the binder) update the adapter-node-pg build to bundle the binder by
adding noExternal: ['@rawsql-ts/shared-binder'] to the tsup/packager config so
compileNamedParameters is included in the adapter dist.
| "name": "@rawsql-ts/shared-binder", | ||
| "version": "0.0.0", | ||
| "private": true, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check adapter-node-pg package.json for shared-binder dependency
echo "=== Check adapter-node-pg dependencies ==="
cat packages/adapters/adapter-node-pg/package.json | grep -A 20 '"dependencies"'
echo ""
# Check if shared-binder is imported in adapter source
echo "=== Search for shared-binder imports in adapter-node-pg ==="
rg '@rawsql-ts/shared-binder' packages/adapters/adapter-node-pg/src/
echo ""
# Check if adapter has dist output
echo "=== Check adapter-node-pg dist structure ==="
ls -la packages/adapters/adapter-node-pg/dist 2>/dev/null || echo "No dist directory"
echo ""
# Look for build config
echo "=== Check build configuration ==="
fd -g 'tsup*' -g 'esbuild*' -g 'rollup*' packages/adapters/adapter-node-pg/
cat packages/adapters/adapter-node-pg/tsup.config.ts 2>/dev/null || echo "No tsup config"
echo ""
# Check package.json build/exports fields
echo "=== Check package.json exports and build ==="
cat packages/adapters/adapter-node-pg/package.json | jq '.exports, .main, .types, .scripts.build'Repository: mk3008/rawsql-ts
Length of output: 1265
"private": true will break adapter-node-pg consumers after publish.
The package is marked "private": true (Line 4), so it will never be published to npm. However, adapter-node-pg (a public package) declares "@rawsql-ts/shared-binder": "workspace:^" as a runtime dependency and actively imports compileNamedParameters from it in PgTestkitClient.ts. The adapter uses plain tsc to compile (no bundling), so the dist output will contain bare require/import statements for @rawsql-ts/shared-binder. When pnpm publishes adapter-node-pg, the workspace: protocol is replaced with a concrete version — but since @rawsql-ts/shared-binder is never published, npm install @rawsql-ts/adapter-node-pg`` will fail for end users.
Common solutions:
- Remove
"private": trueand publish the binder package. - Bundle the binder code into the adapter's
dist(e.g., configuretsupwithnoExternal: ['@rawsql-ts/shared-binder']). - Move the dependency to
devDependenciesif runtime presence is unnecessary (but it's imported and used).
🤖 Prompt for AI Agents
In `@packages/_shared/binder/package.json` around lines 2 - 4, The package
"@rawsql-ts/shared-binder" is marked "private": true which prevents it being
published and breaks consumers like adapter-node-pg that import
compileNamedParameters from it (see PgTestkitClient.ts and the workspace:^
dependency). Fix by removing the "private": true field from
packages/_shared/binder/package.json and ensure the package has a proper version
and publish settings so it is published to npm; alternatively (if you prefer not
to publish the binder) update the adapter-node-pg build to bundle the binder by
adding noExternal: ['@rawsql-ts/shared-binder'] to the tsup/packager config so
compileNamedParameters is included in the adapter dist.
Summary
@rawsql-ts/shared-binderWhy
@scope/name/sub@rawsql-ts/adapter-node-pgSummary by CodeRabbit