Skip to content

Commit

Permalink
use pnpm overrides instead of root syncpack
Browse files Browse the repository at this point in the history
  • Loading branch information
turbocrime committed Jul 5, 2024
1 parent 39f338b commit 7de2d55
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 163 deletions.
25 changes: 25 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Developers may wish to use pnpm.overrides to specify local tarballs or other
* customization, but pnpm currently does not respect overrides during peer
* dependency resolution.
*
* @see https://github.com/pnpm/pnpm/issues/4214
*
* @param pkg manifest of package currently being read
*/
const overridePeerDependencies = (pkg, context) => {
const overrides = require('./package.json').pnpm?.overrides ?? {};
for (const dep of Object.keys(pkg.peerDependencies ?? {})) {
if (dep in overrides) pkg.peerDependencies[dep] = overrides[dep];
}
return pkg;
};

module.exports = {
hooks: {
readPackage(pkg, context) {
pkg = overridePeerDependencies(pkg, context);
return pkg;
},
},
};
10 changes: 0 additions & 10 deletions .syncpackrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"dependencyTypes": [
"dev",
"peer",
"pnpmOverrides",
"prod"
],
"versionGroups": [
Expand Down Expand Up @@ -47,15 +46,6 @@
"snapTo": [
"prax-wallet"
]
},
{
"label": "Control @penumbra-zone packages from root",
"dependencies": [
"@penumbra-zone/*"
],
"snapTo": [
"prax-wallet"
]
}
]
}
18 changes: 4 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"private": true,
"license": "(MIT OR Apache-2.0)",
"packageManager": "[email protected]+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a",
"type": "module",
"scripts": {
"add:tgz": "tsx scripts/add-tgz.ts",
"all-check": "pnpm clean && pnpm install && pnpm lint && pnpm build && pnpm test",
"buf-update": "pnpm update --latest \"@buf/*\" \"@bufbuild/*\" \"@connectrpc/*\" && pnpm syncpack fix-mismatches && pnpm install",
"build": "turbo build",
Expand All @@ -20,6 +22,7 @@
"lint:prettier": "prettier --check .",
"lint:rust": "turbo lint:rust",
"lint:syncpack": "syncpack lint",
"postadd:tgz": "$npm_execpath install",
"postinstall": "syncpack list-mismatches",
"pretest": "playwright install",
"test": "turbo test",
Expand All @@ -35,20 +38,7 @@
"@bufbuild/protobuf": "^1.10.0",
"@connectrpc/connect": "^1.4.0",
"@connectrpc/connect-web": "^1.4.0",
"@penumbra-zone/bech32m": "^6.1.1",
"@penumbra-zone/client": "^10.0.1",
"@penumbra-zone/crypto-web": "^11.0.0",
"@penumbra-zone/getters": "^10.1.0",
"@penumbra-zone/keys": "^4.2.1",
"@penumbra-zone/perspective": "^12.0.0",
"@penumbra-zone/protobuf": "^5.3.1",
"@penumbra-zone/query": "^13.0.0",
"@penumbra-zone/services": "^15.0.0",
"@penumbra-zone/storage": "^12.0.0",
"@penumbra-zone/transport-chrome": "^5.0.1",
"@penumbra-zone/transport-dom": "^7.2.1",
"@penumbra-zone/types": "^14.0.0",
"@penumbra-zone/wasm": "^15.0.0"
"tsx": "^4.16.2"
},
"devDependencies": {
"@buf/connectrpc_eliza.bufbuild_es": "1.10.0-20230913231627-233fca715f49.1",
Expand Down
1 change: 1 addition & 0 deletions packages/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@penumbra-labs/registry": "9.3.0",
"@penumbra-zone/bech32m": "^6.1.1",
"@penumbra-zone/crypto-web": "^11.0.0",
"@penumbra-zone/getters": "^10.1.0",
"@penumbra-zone/protobuf": "^5.3.1",
"@penumbra-zone/query": "^13.0.0",
"@penumbra-zone/storage": "^12.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@penumbra-zone/bech32m": "^6.1.1",
"@penumbra-zone/getters": "^10.1.0",
"@penumbra-zone/perspective": "^12.0.0",
"@penumbra-zone/protobuf": "^5.3.1",
"@penumbra-zone/types": "^14.0.0",
"@penumbra-zone/wasm": "^15.0.0",
"@radix-ui/react-avatar": "^1.0.4",
Expand Down
Loading

0 comments on commit 7de2d55

Please sign in to comment.