File tree 7 files changed +26
-0
lines changed
7 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 45
45
- run :
46
46
name : Build
47
47
command : yarn build
48
+ - run :
49
+ name : Test exports
50
+ command : yarn test:exports
48
51
- run :
49
52
name : Test size
50
53
command : yarn test:build-size
Original file line number Diff line number Diff line change 17
17
"test:browser-locally" : " yarn setup:browser && ./scripts/prepare-test-browser.sh && wdio ./wdio.local.conf.js" ,
18
18
"test:build-declarations" : " node --max-old-space-size=4096 scripts/test-build-declarations.js" ,
19
19
"test:build-size" : " bundlesize" ,
20
+ "test:exports" : " lerna run test:exports" ,
20
21
"test:lint" : " eslint . --ext .js,.ts" ,
21
22
"test:locally" : " lerna clean --yes && yarn lint && yarn test:types && yarn test:unit" ,
22
23
"test:types" : " yarn tsc" ,
Original file line number Diff line number Diff line change 24
24
" lite.js" ,
25
25
" lite.d.ts"
26
26
],
27
+ "scripts" : {
28
+ "test:exports" : " node --experimental-modules test/module/is-es-module.mjs && node test/module/is-cjs-module.cjs"
29
+ },
27
30
"dependencies" : {
28
31
"@algolia/cache-browser-local-storage" : " 4.23.0" ,
29
32
"@algolia/cache-common" : " 4.23.0" ,
Original file line number Diff line number Diff line change
1
+ /* eslint-disable import/no-commonjs */
2
+ /* eslint-disable no-console */
3
+ const algoliasearch = require ( 'algoliasearch' ) ;
4
+ const assert = require ( 'assert' ) ;
5
+
6
+ assert . ok ( algoliasearch ) ;
7
+ assert . doesNotThrow ( ( ) => algoliasearch ( '..' , '..' ) ) ;
8
+
9
+ console . log ( 'algoliasearch is valid CJS' ) ;
Original file line number Diff line number Diff line change
1
+ /* eslint-disable no-console */
2
+ import algoliasearch from 'algoliasearch' ;
3
+ import assert from 'assert' ;
4
+
5
+ assert . ok ( algoliasearch ) ;
6
+ assert . doesNotThrow ( ( ) => algoliasearch ( '..' , '..' ) ) ;
7
+
8
+ console . log ( 'algoliasearch is valid ESM' ) ;
Original file line number Diff line number Diff line change @@ -68,4 +68,5 @@ recommend.version = version;
68
68
69
69
export type RecommendClient = WithRecommendMethods < BaseRecommendClient > ;
70
70
71
+ export * from '../methods' ;
71
72
export * from '../types' ;
Original file line number Diff line number Diff line change @@ -62,4 +62,5 @@ recommend.version = version;
62
62
63
63
export type RecommendClient = WithRecommendMethods < BaseRecommendClient > & Destroyable ;
64
64
65
+ export * from '../methods' ;
65
66
export * from '../types' ;
You can’t perform that action at this time.
0 commit comments