Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
311 changes: 252 additions & 59 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"@dfinity/agent",
"@dfinity/candid",
"@dfinity/principal",
"@icp-sdk/core",
"@dfinity/utils"
]
},
Expand All @@ -74,6 +75,7 @@
"@dfinity/agent",
"@dfinity/candid",
"@dfinity/principal",
"@icp-sdk/core",
"@dfinity/utils"
]
},
Expand All @@ -86,6 +88,7 @@
"@dfinity/agent",
"@dfinity/candid",
"@dfinity/principal",
"@icp-sdk/core",
"@dfinity/utils"
]
},
Expand All @@ -98,6 +101,7 @@
"@dfinity/agent",
"@dfinity/candid",
"@dfinity/principal",
"@icp-sdk/core",
"@dfinity/utils"
]
},
Expand All @@ -110,6 +114,7 @@
"@dfinity/agent",
"@dfinity/candid",
"@dfinity/principal",
"@icp-sdk/core",
"@dfinity/utils"
]
},
Expand All @@ -122,6 +127,7 @@
"@dfinity/agent",
"@dfinity/candid",
"@dfinity/principal",
"@icp-sdk/core",
"@dfinity/utils",
"@dfinity/ledger-icp"
]
Expand All @@ -141,6 +147,7 @@
"@dfinity/agent",
"@dfinity/candid",
"@dfinity/principal",
"@icp-sdk/core",
"@dfinity/utils",
"@dfinity/ledger-icrc"
]
Expand All @@ -153,7 +160,8 @@
"ignore": [
"@dfinity/agent",
"@dfinity/candid",
"@dfinity/principal"
"@dfinity/principal",
"@icp-sdk/core"
]
},
{
Expand All @@ -163,7 +171,8 @@
"gzip": true,
"ignore": [
"zod",
"@dfinity/principal"
"@dfinity/principal",
"@icp-sdk/core"
]
},
{
Expand All @@ -175,6 +184,7 @@
"@dfinity/agent",
"@dfinity/candid",
"@dfinity/principal",
"@icp-sdk/core",
"@dfinity/utils"
]
}
Expand Down
6 changes: 2 additions & 4 deletions packages/ckbtc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@
],
"homepage": "https://github.com/dfinity/ic-js#readme",
"peerDependencies": {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/principal": "^3",
"@dfinity/utils": "^3"
"@dfinity/utils": "^3",
"@icp-sdk/core": "^4"
},
"dependencies": {
"@noble/hashes": "^1.8.0",
Expand Down
6 changes: 2 additions & 4 deletions packages/cketh/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
],
"homepage": "https://github.com/dfinity/ic-js#readme",
"peerDependencies": {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/principal": "^3",
"@dfinity/utils": "^3"
"@dfinity/utils": "^3",
"@icp-sdk/core": "^4"
}
}
6 changes: 2 additions & 4 deletions packages/cmc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
],
"homepage": "https://github.com/dfinity/ic-js#readme",
"peerDependencies": {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/principal": "^3",
"@dfinity/utils": "^3"
"@dfinity/utils": "^3",
"@icp-sdk/core": "^4"
}
}
6 changes: 2 additions & 4 deletions packages/ic-management/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
],
"homepage": "https://github.com/dfinity/ic-js#readme",
"peerDependencies": {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/principal": "^3",
"@dfinity/utils": "^3"
"@dfinity/utils": "^3",
"@icp-sdk/core": "^4"
}
}
6 changes: 2 additions & 4 deletions packages/ledger-icp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
],
"homepage": "https://github.com/dfinity/ic-js#readme",
"peerDependencies": {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/principal": "^3",
"@dfinity/utils": "^3"
"@dfinity/utils": "^3",
"@icp-sdk/core": "^4"
}
}
6 changes: 2 additions & 4 deletions packages/ledger-icrc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
],
"homepage": "https://github.com/dfinity/ic-js#readme",
"peerDependencies": {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/principal": "^3",
"@dfinity/utils": "^3"
"@dfinity/utils": "^3",
"@icp-sdk/core": "^4"
}
}
6 changes: 2 additions & 4 deletions packages/nns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@
"network-nervous-system"
],
"peerDependencies": {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/ledger-icp": "^6",
"@dfinity/principal": "^3",
"@dfinity/utils": "^3"
"@dfinity/utils": "^3",
"@icp-sdk/core": "^4"
}
}
6 changes: 2 additions & 4 deletions packages/sns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@
"sns"
],
"peerDependencies": {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/ledger-icrc": "^4",
"@dfinity/principal": "^3",
"@dfinity/utils": "^3"
"@dfinity/utils": "^3",
"@icp-sdk/core": "^4"
},
"dependencies": {
"@noble/hashes": "^1.8.0"
Expand Down
4 changes: 1 addition & 3 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
"service-nervous-system"
],
"peerDependencies": {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/principal": "^3"
"@icp-sdk/core": "^4"
}
}
2 changes: 1 addition & 1 deletion packages/zod-schemas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"service-nervous-system"
],
"peerDependencies": {
"@dfinity/principal": "*",
"@icp-sdk/core": "*",
"zod": "^4"
}
}
11 changes: 10 additions & 1 deletion scripts/esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ const rootPeerDependencies = () => {
return peerDependencies(packageJson);
};

const commonPeerDependencies = rootPeerDependencies();
// TODO: To be removed once all imports have been migrated to `@icp-sdk/core/...`
const agentJsPeerDependencies = {
"@dfinity/agent": "^3",
"@dfinity/candid": "^3",
"@dfinity/principal": "^3",
};
const commonPeerDependencies = {
...rootPeerDependencies(),
...agentJsPeerDependencies,
};
const workspacePeerDependencies = peerDependencies(
join(process.cwd(), "package.json"),
);
Expand Down
25 changes: 6 additions & 19 deletions scripts/update-agent
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,25 @@
function rm_agent() {
local package=$1

npm rm @dfinity/agent @dfinity/candid @dfinity/principal --workspace=packages/"$package"
}

function install_agent() {
local package=$1
npm rm @icp-sdk/core --workspace=packages/"$package"

npm i @dfinity/agent@latest @dfinity/candid@latest @dfinity/principal@latest --workspace=packages/"$package" --save-peer
# Just in case, make sure the dependencies re-exported by `@icp-sdk/core` are properly removed
npm rm @dfinity/agent @dfinity/candid @dfinity/principal @dfinity/identity @dfinity/identity-secp256k1 --workspace=packages/"$package"
}

function install_principal() {
function install_agent() {
local package=$1

npm i @dfinity/principal@latest --workspace=packages/"$package" --save-peer
npm i @icp-sdk/core@latest --workspace=packages/"$package" --save-peer
}

PACKAGES=utils,ckbtc,cketh,cmc,ic-management,ledger-icp,ledger-icrc,nns,sns

PACKAGES_PRINCIPAL_ONLY=zod-schemas
PACKAGES=utils,ckbtc,cketh,cmc,ic-management,ledger-icp,ledger-icrc,nns,sns,zod-schemas

# Remove agent-js libraries from all packages first to avoid resolve conflicts between those
for package in $(echo $PACKAGES | sed "s/,/ /g"); do
rm_agent "$package"
done

for package in $(echo $PACKAGES_PRINCIPAL_ONLY | sed "s/,/ /g"); do
rm_agent "$package"
done

for package in $(echo $PACKAGES | sed "s/,/ /g"); do
install_agent "$package"
done

for package in $(echo $PACKAGES_PRINCIPAL_ONLY | sed "s/,/ /g"); do
install_principal "$package"
done