File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 7171 "start:node" : " npm run build && node demo/node.mjs" ,
7272 "start:node:native" : " npm run build && node demo/node-native.mjs" ,
7373 "fix" : " npx prettier . --write" ,
74- "prepublishOnly" : " npm run build && npm run fix && npm run publint && npm run check-types" ,
74+ "prepublishOnly" : " npm run build && node scripts/verify-wasm.cjs && npm run fix && npm run publint && npm run check-types" ,
7575 "deploy" : " npm run prepublishOnly && git add . && git commit -am 'New release' && git push && npm publish --access public"
7676 },
7777 "postinstall" : " node scripts/postinstall.cjs || true" ,
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+ const fs = require ( 'fs' ) ;
3+ const path = require ( 'path' ) ;
4+
5+ const root = process . cwd ( ) ;
6+ const dir = path . join ( root , 'sqlite-wasm' , 'jswasm' ) ;
7+ const required = [
8+ 'sqlite3.wasm' ,
9+ 'sqlite3.mjs' ,
10+ 'sqlite3-bundler-friendly.mjs' ,
11+ 'sqlite3-worker1-promiser.mjs' ,
12+ ] ;
13+
14+ const missing = required . filter ( ( f ) => ! fs . existsSync ( path . join ( dir , f ) ) ) ;
15+ if ( missing . length ) {
16+ console . error ( '[verify-wasm] Missing required payload files in' , dir ) ;
17+ for ( const f of missing ) console . error ( ' -' , f ) ;
18+ console . error ( '\nFix: run `npm run build` (or ensure prebuilts are checked in).' ) ;
19+ process . exit ( 1 ) ;
20+ } else {
21+ console . log ( '[verify-wasm] Payload OK in' , dir ) ;
22+ }
23+
You can’t perform that action at this time.
0 commit comments