mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
🔧fix: exports in package.json
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"exports": {
|
||||
"node": "./dist/cjs/index.js",
|
||||
"require": "./dist/cjs/index.js",
|
||||
"import": "./dist/index.js",
|
||||
"node": "./dist/index.js",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
"types": "./src/index.ts",
|
||||
@@ -28,17 +28,18 @@
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "bun run --hot example/index.ts",
|
||||
"test": "bun wiptest",
|
||||
"test": "bun wiptest && npm run test:node",
|
||||
"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",
|
||||
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
|
||||
"release": "npm run build && npm run test && npm publish --access public"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"elysia": ">= 0.5.0"
|
||||
"elysia": ">= 0.5.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.1.4",
|
||||
"bun-types": "^0.5.8",
|
||||
"elysia": "0.5.0",
|
||||
"elysia": "0.5.12",
|
||||
"eslint": "^8.40.0",
|
||||
"rimraf": "4.3",
|
||||
"typescript": "^5.0.4"
|
||||
|
||||
2
test/node/.gitignore
vendored
Normal file
2
test/node/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
package-lock.json
|
||||
11
test/node/cjs/index.js
Normal file
11
test/node/cjs/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
if ('Bun' in globalThis) {
|
||||
throw new Error('❌ Use Node.js to run this test!');
|
||||
}
|
||||
|
||||
const { swagger } = require('@elysiajs/swagger');
|
||||
|
||||
if (typeof swagger !== 'function') {
|
||||
throw new Error('❌ CommonJS Node.js failed');
|
||||
}
|
||||
|
||||
console.log('✅ CommonJS Node.js works!');
|
||||
6
test/node/cjs/package.json
Normal file
6
test/node/cjs/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "commonjs",
|
||||
"dependencies": {
|
||||
"@elysiajs/swagger": "../../.."
|
||||
}
|
||||
}
|
||||
11
test/node/esm/index.js
Normal file
11
test/node/esm/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
if ('Bun' in globalThis) {
|
||||
throw new Error('❌ Use Node.js to run this test!');
|
||||
}
|
||||
|
||||
import { swagger } from '@elysiajs/swagger';
|
||||
|
||||
if (typeof swagger !== 'function') {
|
||||
throw new Error('❌ ESM Node.js failed');
|
||||
}
|
||||
|
||||
console.log('✅ ESM Node.js works!');
|
||||
6
test/node/esm/package.json
Normal file
6
test/node/esm/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@elysiajs/swagger": "../../.."
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user