[Feature] Kysely CommonJs Export
Overview
This adds a CommonJS export for the @powersync/kysely-driver package. Previously only a ESM export was provided.
React Native typically transpiles import statements to require statements, but this might be fickle in some cases - potentially in React Native web.
How this works
See this for reference. The output of this module has changed to:
The cjs export will be used if the module is required e.g. const {} = require('@powersync/kysely-driver'). The ESM export will be used if the module is imported e.g. import {} from '@powersync/kysely-driver';
The CommonJS export is transpiled via an additional tsconfig.json file. The contents of this file use require statements for internal modules. This means this package will require CJS versions of those modules if they provide them. Kysely provides CJS exports.
🦋 Changeset detected
Latest commit: b89c6628dd430d89cf10ac590e724b023d5eee88
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @powersync/kysely-driver | Minor |
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
This should help with https://github.com/powersync-ja/powersync-js/issues/262
Closing this for now. The original purpose of this was to help support React Native web, but React Native web was incorrectly importing the kysely package (not this driver package).