File tree Expand file tree Collapse file tree 5 files changed +55
-0
lines changed 
packages/instant-meilisearch Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ --- 
2+ " @meilisearch/instant-meilisearch "  : minor 
3+ --- 
4+ 
5+ Makes the umd build work in a nodeJs environment
Original file line number Diff line number Diff line change 1717    "playground:vue3" : " turbo run dev --filter=@meilisearch/vue3-ts-playground --parallel"  ,
1818    "playground:react" : " turbo run dev --filter=@meilisearch/react-playground --parallel"  ,
1919    "playground:local-react" : " turbo run dev --filter=@meilisearch/local-react-playground --parallel"  ,
20+     "playground:node" : " turbo run dev --filter=@meilisearch/node-playground --parallel"  ,
2021    "test:e2e" : " turbo run test:e2e"  ,
2122    "test:e2e:watch" : " turbo run test:e2e:watch"  ,
2223    "lint" : " turbo lint"  ,
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ module.exports = [
3535  // browser-friendly IIFE build 
3636  { 
3737    input : INPUT ,  // directory to transpilation of typescript 
38+     external : [ 'cross-fetch' ,  'cross-fetch/polyfill' ] , 
3839    output : { 
3940      name : 'window' , 
4041      extend : true , 
Original file line number Diff line number Diff line change 1+ const  {  instantMeiliSearch }  =  require ( '@meilisearch/instant-meilisearch' ) 
2+ const  {  MeiliSearch }  =  require ( 'meilisearch' ) 
3+ 
4+ 
5+ const  client  =  instantMeiliSearch ( 'http://localhost:7700' ,  'masterKey' ,  { } ) 
6+ const  msClient  =  new  MeiliSearch ( {  host : 'http://localhost:7700' ,  apiKey : 'masterKey' } ) 
7+ 
8+ ; ( async ( )  =>  { 
9+   try  { 
10+     const  task1  =  await  msClient . index ( 'node_test' ) . addDocuments ( [ ] ) 
11+     await  msClient . waitForTask ( task1 . taskUid ) 
12+     await  client . search ( [ 
13+       { 
14+         indexName : 'node_test' , 
15+         params : { 
16+           query : '' , 
17+         } , 
18+       } 
19+     ] ) 
20+ 
21+     const  task2  =  await  msClient . index ( 'node_test' ) . delete ( ) 
22+     await  msClient . waitForTask ( task2 . taskUid ) 
23+     process . exit ( 0 ) 
24+   }  catch ( e )  { 
25+     console . error ( 'Could not run the `umd` build in a node environment' ) 
26+     process . exit ( 1 ) 
27+   } 
28+ } ) ( ) 
Original file line number Diff line number Diff line change 1+ {
2+   "name" : " @meilisearch/node-playground"  ,
3+   "version" : " 0.0.0"  ,
4+   "private" : true ,
5+   "description" : " Instant-meilisearch playground written in node"  ,
6+   "main" : " index.js"  ,
7+   "scripts" : {
8+     "build" : " node index.js" 
9+   },
10+   "devDependencies" : {
11+     "eslint-config-meilisearch" : " *" 
12+   },
13+   "browserslist" : [
14+     " defaults" 
15+   ],
16+   "license" : " MIT"  ,
17+   "dependencies" : {
18+     "@meilisearch/instant-meilisearch" : " *" 
19+   }
20+ }
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments