File tree Expand file tree Collapse file tree 6 files changed +44
-7
lines changed Expand file tree Collapse file tree 6 files changed +44
-7
lines changed Original file line number Diff line number Diff line change 12
12
"url" : " https://github.com/elysiajs/elysia-cors"
13
13
},
14
14
"exports" : {
15
+ "bun" : " ./dist/index.js" ,
16
+ "node" : " ./dist/cjs/index.js" ,
15
17
"require" : " ./dist/cjs/index.js" ,
16
18
"import" : " ./dist/index.js" ,
17
- "node" : " ./dist/cjs/index.js" ,
18
- "default" : " ./dist/cjs/index.js" ,
19
- "bun" : " ./dist/index.js"
19
+ "default" : " ./dist/cjs/index.js"
20
20
},
21
21
"types" : " ./src/index.ts" ,
22
22
"homepage" : " https://github.com/elysiajs/elysia-cors" ,
27
27
"license" : " MIT" ,
28
28
"scripts" : {
29
29
"dev" : " bun run --hot example/index.ts" ,
30
- "test" : " bun wiptest" ,
30
+ "test" : " bun wiptest && npm run test:node" ,
31
+ "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" ,
31
32
"build" : " rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json" ,
32
33
"release" : " npm run build && npm run test && npm publish --access public"
33
34
},
34
35
"devDependencies" : {
35
36
"@types/node" : " ^18.11.7" ,
36
37
"bun-types" : " ^0.5.7" ,
37
- "elysia" : " 0.5.0 " ,
38
+ "elysia" : " 0.5.12 " ,
38
39
"eslint" : " ^8.26.0" ,
39
40
"rimraf" : " ^3.0.2" ,
40
41
"typescript" : " ^5.0.4"
41
42
},
42
43
"peerDependencies" : {
43
- "elysia" : " >= 0.5.0 "
44
+ "elysia" : " >= 0.5.12 "
44
45
}
45
- }
46
+ }
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 { cors } = require ( '@elysiajs/cors' ) ;
6
+
7
+ if ( typeof cors !== '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/cors" : " ../../.."
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 { cors } from '@elysiajs/cors' ;
6
+
7
+ if ( typeof cors !== '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/cors" : " ../../.."
5
+ }
6
+ }
You can’t perform that action at this time.
0 commit comments