diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 6054d1a..0000000 --- a/.npmignore +++ /dev/null @@ -1,14 +0,0 @@ -.git -.gitignore - -biome.jsonc - -node_modules/ -bun.lockb - -trace/ - -test*.ts - -tsconfig.* - diff --git a/package.json b/package.json index 2083d6d..d81a4fd 100644 --- a/package.json +++ b/package.json @@ -1,32 +1,33 @@ { "name": "@nxht/typebox-extended-openapi", - "version": "0.0.3", + "version": "0.0.4", "repository": { "type": "git", "url": "https://github.com/nxht/typebox-extended-openapi" }, "keywords": ["typescript", "typebox", "json-schema", "openapi"], "type": "module", - "main": "./dist/cjs/index.js", + "main": "./dist/index.js", "types": "./src/index.ts", + "files": ["src", "dist"], "exports": { "bun": "./src/index.ts", - "require": "./dist/cjs/index.js", - "import": "./dist/esm/index.js" + "require": "./dist/index.cjs", + "import": "./dist/index.js" }, "scripts": { - "build:esm": "tsc -p tsconfig.build.json", - "build:cjs": "tsc -p tsconfig.build-cjs.json", - "build": "rm -rf dist/ && bun run build:esm && bun run build:cjs", + "build": "bun tsup", + "attw": "attw -P .", "trace": "bunx tsc --noEmit --generateTrace trace && bunx analyze-trace trace --force-millis 100", "prepublishOnly": "bun run build" }, - "peerDependencies": { + "dependencies": { "@sinclair/typebox": "^0.32.35 || ^0.33.7" }, "devDependencies": { - "@biomejs/biome": "^1.8.3", + "@biomejs/biome": "latest", "@types/bun": "latest", + "tsup": "^8.2.4", "typescript": "^5.5.4" } } diff --git a/tsconfig.build-cjs.json b/tsconfig.build-cjs.json deleted file mode 100644 index 28fdcab..0000000 --- a/tsconfig.build-cjs.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["src"], - "exclude": ["src/**/*.spec.ts"], - "compilerOptions": { - "outDir": "dist/cjs", - "module": "CommonJS", - "moduleResolution": "Node", - "target": "ESNext", - "verbatimModuleSyntax": false - } -} diff --git a/tsconfig.build.json b/tsconfig.build.json deleted file mode 100644 index e85b894..0000000 --- a/tsconfig.build.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["src"], - "exclude": ["src/**/*.spec.ts"], - "compilerOptions": { - "outDir": "dist/esm" - } -} diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..2190919 --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig({ + entry: ['src/index.ts'], + outDir: 'dist', + format: ['esm', 'cjs'], + dts: true, + sourcemap: true, + clean: true, +});