Skip to content

Commit

Permalink
fix: imports not working w/ Metro bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Jul 5, 2024
1 parent 7b8c974 commit 7b5922f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
25 changes: 20 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
// Always update wrapper.mjs when updating this file.
export { default as PostgrestClient } from './PostgrestClient'
export { default as PostgrestQueryBuilder } from './PostgrestQueryBuilder'
export { default as PostgrestFilterBuilder } from './PostgrestFilterBuilder'
export { default as PostgrestTransformBuilder } from './PostgrestTransformBuilder'
export { default as PostgrestBuilder } from './PostgrestBuilder'
import PostgrestClient from './PostgrestClient'
import PostgrestQueryBuilder from './PostgrestQueryBuilder'
import PostgrestFilterBuilder from './PostgrestFilterBuilder'
import PostgrestTransformBuilder from './PostgrestTransformBuilder'
import PostgrestBuilder from './PostgrestBuilder'

export {
PostgrestClient,
PostgrestQueryBuilder,
PostgrestFilterBuilder,
PostgrestTransformBuilder,
PostgrestBuilder,
}
export default {
PostgrestClient,
PostgrestQueryBuilder,
PostgrestFilterBuilder,
PostgrestTransformBuilder,
PostgrestBuilder,
}
export type {
PostgrestResponse,
PostgrestResponseFailure,
Expand Down
7 changes: 6 additions & 1 deletion test/smoke.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ assert(typeof postgrestjs.PostgrestQueryBuilder === "function");
assert(typeof postgrestjs.PostgrestFilterBuilder === "function");
assert(typeof postgrestjs.PostgrestTransformBuilder === "function");
assert(typeof postgrestjs.PostgrestBuilder === "function");
assert(typeof postgrestjs.default === "undefined");
assert(typeof postgrestjs.default === 'object');
assert(typeof postgrestjs.default.PostgrestClient === 'function');
assert(typeof postgrestjs.default.PostgrestQueryBuilder === 'function');
assert(typeof postgrestjs.default.PostgrestFilterBuilder === 'function');
assert(typeof postgrestjs.default.PostgrestTransformBuilder === 'function');
assert(typeof postgrestjs.default.PostgrestBuilder === 'function');
2 changes: 1 addition & 1 deletion test/smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ assert(typeof postgrestjs.default.PostgrestClient === 'function');
assert(typeof postgrestjs.default.PostgrestQueryBuilder === 'function');
assert(typeof postgrestjs.default.PostgrestFilterBuilder === 'function');
assert(typeof postgrestjs.default.PostgrestTransformBuilder === 'function');
assert(typeof postgrestjs.default.PostgrestBuilder === 'function')
assert(typeof postgrestjs.default.PostgrestBuilder === 'function');

0 comments on commit 7b5922f

Please sign in to comment.