File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " zip-bun" ,
3- "version" : " 1.3.7 " ,
3+ "version" : " 1.3.8 " ,
44 "description" : " A high-performance zip archive library for Bun with native C bindings" ,
55 "main" : " dist/index.mjs" ,
66 "types" : " dist/index.d.mts" ,
1111 " images"
1212 ],
1313 "exports" : {
14- "." : {
15- "import" : {
16- "types" : " ./dist/index.d.mts" ,
17- "default" : " ./dist/index.mjs"
18- }
19- }
20- },
14+ "." : {
15+ "import" : {
16+ "types" : " ./dist/index.d.mts" ,
17+ "default" : " ./dist/index.mjs"
18+ }
19+ }
20+ },
2121 "scripts" : {
2222 "test" : " bun test" ,
2323 "test:coverage" : " bun test --coverage" ,
Original file line number Diff line number Diff line change 11import { cc } from "bun:ffi" ;
22import { join } from "node:path" ;
33
4- const includePath = import . meta. dir ;
4+ function getIncludePath ( ) : string | null {
5+ // Attempt to get the directory of the current module
6+ if ( import . meta && import . meta. dir ) {
7+ return import . meta. dir ;
8+ }
9+
10+ // Fallback to a default path (adjust as necessary)
11+ const defaultPath = join ( process . cwd ( ) , "node_modules/zip-bun/dist" ) ;
12+ return defaultPath || null ;
13+ }
14+
15+ const includePath = getIncludePath ( ) ;
16+ if ( ! includePath ) {
17+ throw new Error ( "Could not determine include path for zip-bun" ) ;
18+ }
19+
520const wrapperPath = join ( includePath , "zip_wrapper.c" ) ;
621
722// Compile the C code with all the zip functions
You can’t perform that action at this time.
0 commit comments