Skip to content

Conversation

@L-Mario564
Copy link

Addresses #182.

This PR aims to fix CJS imports, something that may be blocking the Drizzle Team from merging drizzle-team/drizzle-orm#4998 due to our CJS import test for drizzle-orm/libsql. We assume this issue is caused by what is described in #182 which is using the same typings for both ESM and CJS.

ATTW was used to verify the new build outputs work in both ESM and CJS.

libsql-core subpackage:

Current

npm run build && npm pack && attw ./[generated package file].tgz
Screenshot_20251114_092458

In this PR

npm ru build && cd dist && npm pack --pack-destination .. && cd .. && attw ./[generated package file].tgz
Screenshot_20251114_094433

libsql-client subpackage:

In this PR

Screenshot_20251114_103915

Changes made

  • Introduce tsup to properly generate .cjs and .d.cts files.
  • Remove unusued imports in libsql-core/src/util.ts.
  • Update publish workflow according to the new output produced by tsup.
  • Remove what seems to be unused prebuild and postbuild scripts in libsql-core and libsql-client.
  • Remove files that are no longer relevant with to tsup (like tsconfig.build-cjs.json).
  • Update @libsql/core in libsql-client. Had to update as there was a type introduced in 0.16.0 and the build wasn't going to work if I kept @libsql/core on 0.15.x.

@L-Mario564 L-Mario564 changed the title Fix cjs Fix CJS imports for @libsql/client Nov 14, 2025
@L-Mario564
Copy link
Author

@penberg Hi there. Let me know if there's anything that needs to be done with this PR for it to be merged. Would greatly appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant