Skip to content

Commit

Permalink
Add multi package support
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkarso-pon committed Mar 29, 2024
1 parent fedd118 commit dee3e23
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
11 changes: 11 additions & 0 deletions fixup
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cat >dist/cjs/package.json <<!EOF
{
"type": "commonjs"
}
!EOF

cat >dist/mjs/package.json <<!EOF
{
"type": "module"
}
!EOF
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"name": "@asteasolutions/zod-to-openapi",
"version": "6.4.0",
"version": "7.0.0",
"description": "Builds OpenAPI schemas from Zod schemas",
"main": "dist/index.js",
"main": "dist/cjs/index.js",
"module": "dist/mjs/index.js",
"exports": {
".": {
"import": "./dist/mjs/index.js",
"require": "./dist/cjs/index.js"
}
},
"types": "dist/index.d.ts",
"files": [
"dist",
Expand All @@ -23,7 +30,7 @@
},
"homepage": "https://github.com/asteasolutions/zod-to-openapi",
"scripts": {
"build": "tsc -p tsconfig.build.json",
"build": "rm -rf dist && tsc -p tsconfig.build.json && tsc -p tsconfig.esm.json && ./fixup",
"prepare": "npm run build",
"test": "jest",
"prettier": "prettier --write .",
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/cjs"
},
"include": ["src/**/*"]
}
9 changes: 9 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.build.json",
"compilerOptions": {
"outDir": "dist/mjs",
"target": "esnext",
"module": "esnext",
"moduleResolution": "node"
}
}

0 comments on commit dee3e23

Please sign in to comment.