-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for new compute budget instruction
- Loading branch information
Showing
4 changed files
with
453 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//@ts-check | ||
|
||
// https://pnpm.io/pnpmfile | ||
// https://github.com/pnpm/pnpm/issues/4214 | ||
// https://github.com/pnpm/pnpm/issues/5391 | ||
|
||
const rootPkg = require('./package.json'); | ||
|
||
console.log (`Checking for package peerDependency overrides`); | ||
|
||
const remapPeerDependencies = [ | ||
{ package: '@solana-program/compute-budget', packageVersion: '0.6.1', peerDependency: '@solana/web3.js', newVersion: '2.0.0' }, | ||
]; | ||
|
||
function overridesPeerDependencies(pkg) { | ||
if (pkg.peerDependencies) { | ||
remapPeerDependencies.map(dep => { | ||
if (pkg.name === dep.package && pkg.version.startsWith(dep.packageVersion)) { | ||
console.log(` - Checking ${pkg.name}@${pkg.version}`); // , pkg.peerDependencies); | ||
|
||
if (dep.peerDependency in pkg.peerDependencies) { | ||
try { | ||
console.log(` - Overriding ${pkg.name}@${pkg.version} peerDependency ${dep.peerDependency}@${pkg.peerDependencies[dep.peerDependency]}`); | ||
|
||
// First add a new dependency to the package and then remove the peer dependency. | ||
// This approach has the added advantage that scoped overrides should now work, too. | ||
pkg.dependencies[dep.peerDependency] = dep.newVersion; | ||
delete pkg.peerDependencies[dep.peerDependency]; | ||
|
||
console.log(` - Overrode ${pkg.name}@${pkg.version} peerDependency ${dep.peerDependency}@${pkg.dependencies[dep.peerDependency]}`); | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
|
||
module.exports = { | ||
hooks: { | ||
readPackage(pkg, _context) { | ||
// skipDeps(pkg); | ||
overridesPeerDependencies(pkg); | ||
return pkg; | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
"@project-serum/serum": "^0.13.61", | ||
"@react-hook/debounce": "^4.0.0", | ||
"@react-hook/previous": "^1.0.1", | ||
"@solana-program/compute-budget": "^0.6.1", | ||
"@solana/buffer-layout": "^3.0.0", | ||
"@solana/spl-account-compression": "^0.1.8", | ||
"@solana/spl-token": "^0.1.8", | ||
|
@@ -61,7 +62,7 @@ | |
"typescript": "5.0.4", | ||
"use-async-effect": "^2.2.7", | ||
"use-tab-visibility": "^1.0.9", | ||
"web3js-experimental": "npm:@solana/[email protected]-rc.0" | ||
"web3js-experimental": "npm:@solana/[email protected]" | ||
}, | ||
"devDependencies": { | ||
"@solana/eslint-config-solana": "^1.0.1", | ||
|
Oops, something went wrong.