File tree Expand file tree Collapse file tree 6 files changed +42
-5
lines changed Expand file tree Collapse file tree 6 files changed +42
-5
lines changed Original file line number Diff line number Diff line change 9
9
},
10
10
"main" : " ./dist/index.js" ,
11
11
"exports" : {
12
+ "node" : " ./dist/cjs/index.js" ,
12
13
"require" : " ./dist/cjs/index.js" ,
13
14
"import" : " ./dist/index.js" ,
14
- "node" : " ./dist/index.js" ,
15
15
"default" : " ./dist/index.js"
16
16
},
17
17
"types" : " ./src/index.ts" ,
28
28
"license" : " MIT" ,
29
29
"scripts" : {
30
30
"dev" : " bun run --hot example/index.ts" ,
31
- "test" : " bun wiptest" ,
31
+ "test" : " bun wiptest && npm run test:node" ,
32
+ "test:node" : " npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js" ,
32
33
"build" : " rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json" ,
33
34
"release" : " npm run build && npm run test && npm publish --access public"
34
35
},
35
36
"peerDependencies" : {
36
- "elysia" : " >= 0.5.0 "
37
+ "elysia" : " >= 0.5.12 "
37
38
},
38
39
"devDependencies" : {
39
40
"@types/node" : " ^20.1.4" ,
40
41
"bun-types" : " ^0.5.8" ,
41
- "elysia" : " 0.5.0 " ,
42
+ "elysia" : " 0.5.12 " ,
42
43
"eslint" : " ^8.40.0" ,
43
44
"rimraf" : " 4.3" ,
44
45
"typescript" : " ^5.0.4"
45
46
}
46
- }
47
+ }
Original file line number Diff line number Diff line change
1
+ node_modules /
2
+ package-lock.json
Original file line number Diff line number Diff line change
1
+ if ( 'Bun' in globalThis ) {
2
+ throw new Error ( '❌ Use Node.js to run this test!' ) ;
3
+ }
4
+
5
+ const { swagger } = require ( '@elysiajs/swagger' ) ;
6
+
7
+ if ( typeof swagger !== 'function' ) {
8
+ throw new Error ( '❌ CommonJS Node.js failed' ) ;
9
+ }
10
+
11
+ console . log ( '✅ CommonJS Node.js works!' ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " commonjs" ,
3
+ "dependencies" : {
4
+ "@elysiajs/swagger" : " ../../.."
5
+ }
6
+ }
Original file line number Diff line number Diff line change
1
+ if ( 'Bun' in globalThis ) {
2
+ throw new Error ( '❌ Use Node.js to run this test!' ) ;
3
+ }
4
+
5
+ import { swagger } from '@elysiajs/swagger' ;
6
+
7
+ if ( typeof swagger !== 'function' ) {
8
+ throw new Error ( '❌ ESM Node.js failed' ) ;
9
+ }
10
+
11
+ console . log ( '✅ ESM Node.js works!' ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " module" ,
3
+ "dependencies" : {
4
+ "@elysiajs/swagger" : " ../../.."
5
+ }
6
+ }
You can’t perform that action at this time.
0 commit comments