File tree Expand file tree Collapse file tree 5 files changed +35
-7
lines changed Expand file tree Collapse file tree 5 files changed +35
-7
lines changed Original file line number Diff line number Diff line change 31
31
"build:esm" : " cpy wrapper.mjs dist/esm/" ,
32
32
"docs" : " typedoc src/index.ts --out docs/v2" ,
33
33
"docs:json" : " typedoc --json docs/v2/spec.json --excludeExternals src/index.ts" ,
34
- "test" : " run-s format:check test:types db:clean db:run test:run db:clean" ,
34
+ "test" : " run-s format:check test:types db:clean db:run test:run db:clean && node test/smoke.cjs && node test/smoke.mjs " ,
35
35
"test:run" : " jest --runInBand" ,
36
36
"test:update" : " run-s db:clean db:run && jest --runInBand --updateSnapshot && run-s db:clean" ,
37
37
"test:types" : " run-s build && tsd --files test/*.test-d.ts" ,
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ export { default as PostgrestQueryBuilder } from './PostgrestQueryBuilder'
4
4
export { default as PostgrestFilterBuilder } from './PostgrestFilterBuilder'
5
5
export { default as PostgrestTransformBuilder } from './PostgrestTransformBuilder'
6
6
export { default as PostgrestBuilder } from './PostgrestBuilder'
7
- export {
7
+ export type {
8
8
PostgrestResponse ,
9
9
PostgrestResponseFailure ,
10
10
PostgrestResponseSuccess ,
Original file line number Diff line number Diff line change
1
+ // Check that the ESM build works as expected (namely has the same exports as the CJS build when imported via ESM).
2
+ const assert = require ( "node:assert" ) ;
3
+ const postgrestjs = require ( "@supabase/postgrest-js" ) ;
4
+
5
+ assert ( typeof postgrestjs . PostgrestClient === "function" ) ;
6
+ assert ( typeof postgrestjs . PostgrestQueryBuilder === "function" ) ;
7
+ assert ( typeof postgrestjs . PostgrestFilterBuilder === "function" ) ;
8
+ assert ( typeof postgrestjs . PostgrestTransformBuilder === "function" ) ;
9
+ assert ( typeof postgrestjs . PostgrestBuilder === "function" ) ;
10
+ assert ( typeof postgrestjs . default === "undefined" ) ;
Original file line number Diff line number Diff line change
1
+ // Check that the ESM build works as expected (namely has the same exports as the CJS build when imported via ESM).
2
+ import assert from "node:assert" ;
3
+ import * as postgrestjs from "@supabase/postgrest-js" ;
4
+
5
+ assert ( typeof postgrestjs . PostgrestClient === 'function' ) ;
6
+ assert ( typeof postgrestjs . PostgrestQueryBuilder === 'function' ) ;
7
+ assert ( typeof postgrestjs . PostgrestFilterBuilder === 'function' ) ;
8
+ assert ( typeof postgrestjs . PostgrestTransformBuilder === 'function' ) ;
9
+ assert ( typeof postgrestjs . PostgrestBuilder === 'function' ) ;
10
+ assert ( typeof postgrestjs . default === 'object' ) ;
11
+ assert ( typeof postgrestjs . default . PostgrestClient === 'function' ) ;
12
+ assert ( typeof postgrestjs . default . PostgrestQueryBuilder === 'function' ) ;
13
+ assert ( typeof postgrestjs . default . PostgrestFilterBuilder === 'function' ) ;
14
+ assert ( typeof postgrestjs . default . PostgrestTransformBuilder === 'function' ) ;
15
+ assert ( typeof postgrestjs . default . PostgrestBuilder === 'function' )
Original file line number Diff line number Diff line change 1
- import { default as PostgrestClient } from '../cjs/PostgrestClient.js'
2
- import { default as PostgrestQueryBuilder } from '../cjs/PostgrestQueryBuilder.js'
3
- import { default as PostgrestFilterBuilder } from '../cjs/PostgrestFilterBuilder.js'
4
- import { default as PostgrestTransformBuilder } from '../cjs/PostgrestTransformBuilder.js'
5
- import { default as PostgrestBuilder } from '../cjs/PostgrestBuilder.js'
1
+ import index from '../cjs/index.js'
2
+ const {
3
+ PostgrestClient,
4
+ PostgrestQueryBuilder,
5
+ PostgrestFilterBuilder,
6
+ PostgrestTransformBuilder,
7
+ PostgrestBuilder,
8
+ } = index
6
9
7
10
export {
8
11
PostgrestBuilder ,
You can’t perform that action at this time.
0 commit comments