Skip to content

Commit 0a01774

Browse files
kerwanpdrwpow
andauthored
chore(metadata): migrate to unbuild (#2115)
Co-authored-by: Drew Powers <[email protected]>
1 parent 0c35b32 commit 0a01774

File tree

5 files changed

+1090
-284
lines changed

5 files changed

+1090
-284
lines changed

.changeset/honest-horses-cheer.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-metadata": minor
3+
---
4+
5+
[#2097](https://github.com/openapi-ts/openapi-typescript/pull/2097): Migrate to unbuild and provide CJS support

packages/openapi-metadata/package.json

+17-21
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,28 @@
77
"email": "[email protected]"
88
},
99
"type": "module",
10+
"main": "./dist/index.cjs",
11+
"types": "./dist/index.d.ts",
1012
"exports": {
1113
".": {
12-
"types": "./dist/index.d.ts",
13-
"import": "./dist/index.js"
14+
"import": "./dist/index.mjs",
15+
"require": "./dist/index.cjs"
1416
},
1517
"./decorators": {
16-
"types": "./dist/decorators/index.d.ts",
17-
"import": "./dist/decorators/index.js"
18+
"import": "./dist/decorators/index.mjs",
19+
"require": "./dist/decorators/index.cjs"
1820
},
1921
"./metadata": {
20-
"types": "./dist/metadata/index.d.ts",
21-
"import": "./dist/metadata/index.js"
22+
"import": "./dist/metadata/index.mjs",
23+
"require": "./dist/metadata/index.cjs"
2224
},
2325
"./errors": {
24-
"types": "./dist/errors/index.d.ts",
25-
"import": "./dist/errors/index.js"
26+
"import": "./dist/errors/index.mjs",
27+
"require": "./dist/errors/index.cjs"
2628
},
2729
"./ui": {
28-
"types": "./dist/ui/index.d.ts",
29-
"import": "./dist/ui/index.js"
30+
"import": "./dist/ui/index.mjs",
31+
"require": "./dist/ui/index.cjs"
3032
}
3133
},
3234
"homepage": "https://openapi-ts.dev",
@@ -48,10 +50,8 @@
4850
"typescript"
4951
],
5052
"scripts": {
51-
"build": "pnpm run build:clean && pnpm run build:esm",
52-
"build:clean": "del-cli dist",
53-
"build:esm": "tsc -p tsconfig.build.json",
54-
"dev": "tsc -p tsconfig.build.json --watch",
53+
"build": "unbuild",
54+
"prepack": "unbuild",
5555
"format": "biome format . --write",
5656
"lint": "biome check .",
5757
"test": "vitest run",
@@ -60,22 +60,18 @@
6060
},
6161
"dependencies": {
6262
"deepmerge": "^4.3.1",
63-
"openapi-types": "^12.1.3"
63+
"openapi-types": "^12.1.3",
64+
"type-fest": "^4.31.0"
6465
},
6566
"peerDependencies": {
6667
"reflect-metadata": "^0.2.2"
6768
},
6869
"devDependencies": {
69-
"@types/lodash": "^4.17.14",
7070
"@types/node": "^22.10.5",
7171
"@vitest/coverage-v8": "^2.1.8",
72-
"del-cli": "^5.1.0",
73-
"esbuild": "^0.24.2",
74-
"execa": "^8.0.1",
7572
"reflect-metadata": "^0.2.2",
76-
"tsup": "^8.3.5",
77-
"type-fest": "^4.31.0",
7873
"typescript": "^5.7.2",
74+
"unbuild": "^3.3.1",
7975
"unplugin-swc": "^1.5.1"
8076
}
8177
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export { InvalidConfigurationError } from "./invalid-configuration.js";
2+
export { NoExplicitTypeError } from "./no-explicit-type.js";
3+
export { ReflectMetadataMissingError } from "./reflect-metadata-missing.js";
4+
export { SymbolKeysNotSupportedError } from "./symbol-keys-not-supported.js";

packages/openapi-metadata/tsup.config.ts

-8
This file was deleted.

0 commit comments

Comments
 (0)