refactor: Use @icp-sdk/core for Principal and remove @dfinity deps#199
refactor: Use @icp-sdk/core for Principal and remove @dfinity deps#199raymondk wants to merge 1 commit intodfinity:mainfrom
@icp-sdk/core for Principal and remove @dfinity deps#199Conversation
|
Thank you for contributing! Unfortunately this repository does not accept external contributions yet. We are working on enabling this by aligning our internal processes and our CI setup to handle external contributions. However this will take some time to set up so in the meantime we unfortunately have to close this Pull Request. We hope you understand and will come back once we accept external PRs. — The DFINITY Foundation |
There was a problem hiding this comment.
Pull request overview
This PR migrates the codebase off the deprecated @dfinity/* packages by switching Principal imports to @icp-sdk/core and removing the direct @dfinity dependencies.
Changes:
- Replaced
@dfinity/principalimports with@icp-sdk/core/principalacross runtime and test code. - Removed
@dfinity/utilsusage by inliningisNullishin the CLI. - Updated
package.json/package-lock.jsonto drop@dfinity/principal+@dfinity/utilsand add@icp-sdk/core.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/signer/eth.ts | Switch Principal type import to @icp-sdk/core/principal. |
| src/signer/eth.test.ts | Switch test Principal import to @icp-sdk/core/principal. |
| src/signer/btc.ts | Switch Principal type import to @icp-sdk/core/principal. |
| src/signer/btc.test.ts | Switch test Principal import to @icp-sdk/core/principal. |
| src/schnorr/ed25519.ts | Switch Principal type import to @icp-sdk/core/principal. |
| src/schnorr/ed25519.tests/pocketic_derivation.test.ts | Switch test Principal import to @icp-sdk/core/principal. |
| src/schnorr/ed25519.tests/mainnet_derivation.test.ts | Switch test Principal import to @icp-sdk/core/principal. |
| src/schnorr/bip340secp256k1.tests/pocketic_derivation.test.ts | Switch test Principal import to @icp-sdk/core/principal. |
| src/schnorr/bip340secp256k1.tests/mainnet_derivation.test.ts | Switch test Principal import to @icp-sdk/core/principal. |
| src/ecdsa/secp256k1.ts | Switch Principal type import to @icp-sdk/core/principal. |
| src/ecdsa/secp256k1.tests/pocketic_derivation.test.ts | Switch test Principal import to @icp-sdk/core/principal. |
| src/ecdsa/secp256k1.tests/mainnet_derivation.test.ts | Switch test Principal import to @icp-sdk/core/principal. |
| src/cli.ts | Switch Principal import to @icp-sdk/core/principal and inline isNullish. |
| package.json | Remove direct @dfinity/* deps and add @icp-sdk/core. |
| package-lock.json | Lockfile updated to reflect dependency changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Inlined from `@dfinity/utils` to avoid depending on the package for a single helper. | ||
| const isNullish = <T>( | ||
| argument: T | undefined | null, |
Remove the dependency on the @dfinity packages since they're being deprecated in favor of icp-sdk/core