Skip to content

Commit

Permalink
fix: add peerDependencies for the publishes package
Browse files Browse the repository at this point in the history
  • Loading branch information
spirius committed Nov 23, 2023
1 parent d94b052 commit 3a6081e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@ const run = async () => {
},
}

const dependencies = packageJson.dependencies
const peerDependencies = packageJson["peerDependencies"] || {}

const moveToPeerDependencies = ["@types/aws-lambda", "json-schema-to-zod"]

moveToPeerDependencies.forEach(d => {
const ver = dependencies[d]
if (!ver) {
throw new Error(`pacakge ${d} was not found in dependencies`)
}
peerDependencies[d] = ver
delete dependencies[d]
})

if (Object.values(peerDependencies).length) {
packageJson["peerDependencies"] = peerDependencies
}

await Promise.all([
...builds
.map(build =>
Expand Down

0 comments on commit 3a6081e

Please sign in to comment.