Repository navigation
chore(tooling): migrate from dfx to icp-cli - #498
Conversation
dfx is deprecated. Its local II also lacks the app delegation methods that @icp-sdk/auth 10 needs. - Replace dfx.json and canister_ids.json with icp.yaml and .icp/data/mappings/ic.ids.json. - Run the local network with icp-cli (devDependency). The network has NNS, SNS and II. Add an e2e network without the update delay. - Create the local backend with its mainnet ID through the PocketIC REST API, because icp-cli has no --specified-id. - Generate the backend declarations with @icp-sdk/bindgen. - Use the II frontend canister for local login. Answer the dummy-auth seed prompt in the e2e login. - Move the mainnet queries in release-prod to icp. dfx-orbit still needs a dfx identity.
📊 Build Bundle StatsThe latest build generated the following assets: |
|
✅ No security or compliance issues detected. Reviewed everything up to a0da93a. Security OverviewDetected Code Changes
|
There was a problem hiding this comment.
🟡 Changes recommended
PocketIC 202 responses are resubmitted instead of polled, risking duplicate fixed-ID creation failures.
2 open findings
What changed in this PR
Migrates local development, bindings generation, CI, and release queries from dfx to icp-cli.
Changes:
- Adds icp-cli network configuration and fixed-ID local canister creation.
- Replaces dfx-generated bindings with
@icp-sdk/bindgen. - Updates local II login, CI, documentation, and release tooling.
| File | Description |
|---|---|
.github/workflows/check.yaml |
Generates bindings with bindgen. |
.github/workflows/e2e.yml |
Runs and caches icp-cli networks. |
.gitignore |
Ignores icp-cli runtime state. |
.icp/data/mappings/ic.ids.json |
Maps the production canister ID. |
canister_ids.json |
Removes the dfx ID mapping. |
dfx.json |
Removes dfx project configuration. |
docker/Dockerfile.build |
Uses bindgen during builds. |
docs/DEVELOP.md |
Documents the new local workflow. |
icp.yaml |
Defines networks, environments, and backend builds. |
package-lock.json |
Locks icp-cli and bindgen dependencies. |
package.json |
Adds icp-cli and binding generation. |
scripts/config.sh |
Updates the local II canister ID. |
scripts/create-local-canister.mjs |
Creates a fixed-ID PocketIC canister. |
scripts/release-prod |
Uses icp-cli for mainnet queries. |
scripts/start-pocket-ic.sh |
Starts and deploys to managed networks. |
src/governance-app-frontend/package.json |
Adds the bindgen command and dependency. |
src/governance-app-frontend/vite.config.js |
Updates the generated IDL alias. |
…/tests/e2e/utils/login.ts |
Supports dummy-auth II login. |
…/tests/fixtures/exchangeRate.ts |
Updates generated type imports. |
…/components/SendICPButton.tsx |
Updates generated type imports. |
…/components/AddAddressModal.tsx |
Updates generated type imports. |
…/components/AddressBookEntry.tsx |
Updates generated type imports. |
…/components/AddressBookModal.tsx |
Updates generated type imports. |
…/components/AddressBookSelect.tsx |
Updates generated type imports. |
…/components/RemoveAddressConfirmation.tsx |
Updates generated type imports. |
…/hooks/addressBook/useAddressBook.ts |
Updates generated service imports. |
…/hooks/addressBook/useGovernanceAppCanister.ts |
Uses the renamed IDL factory. |
…/hooks/addressBook/useSaveAddressBook.ts |
Updates generated type imports. |
…/hooks/tickers/useExchangeRate.ts |
Updates generated type imports. |
…/hooks/tickers/useFiatExchangeRates.ts |
Updates generated type imports. |
…/hooks/tickers/useIcpRateHistory.ts |
Updates generated type imports. |
…/utils/addressBook.ts |
Updates generated type imports. |
…/utils/errors/addressBook.ts |
Updates generated type imports. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🔵 Needs a closer look
The migration spans local networking, PocketIC provisioning, CI, and production release tooling whose end-to-end behavior requires final human validation.
0 open findings
2 resolved since last review
🧠 Review effort: Balanced
…igrate-dfx-to-icp-cli # Conflicts: # src/governance-app-frontend/src/common/hooks/addressBook/useSaveAddressBook.ts
…icp-cli # Conflicts: # src/governance-app-frontend/src/features/addressBook/components/AddressBookSelect.tsx
daniel-wong-dfinity-org-twin
left a comment
There was a problem hiding this comment.
I didn't review everything here, but Claude says this is basically fine. Hence, I approve.
| AddressBook, | ||
| NamedAddress, | ||
| } from '@declarations/governance-app-backend/governance-app-backend.did'; | ||
| import type { AddressBook, NamedAddress } from '@declarations/governance-app-backend/backend.did'; |
There was a problem hiding this comment.
If you wanted to, I think you could avoid all this churn by renaming the .did file to governance-app-backend.did.


Motivation
dfxis deprecated. Its local II (dfx 0.31.0) has noapp_prepare_delegation, so it blocks the@icp-sdk/auth10 upgrade. This replaces #489.Changes
dfx.jsonandcanister_ids.jsonwithicp.yamland.icp/data/mappings/ic.ids.json, and added@icp-sdk/icp-clias a devDependency.start-pocket-ic.shtoicp network start, with a newe2eenvironment that has no update delay.scripts/create-local-canister.mjsto create the backend with its mainnet ID through the PocketIC REST API.dfx generatewith@icp-sdk/bindgen(npm run generate:candid-bindings).uqzsh-gqaaa-aaaaq-qaada-cai, and updated the e2e login for its dummy-auth seed prompt.release-prodtoicp, and keptdfx-orbitfor the Orbit request (Support icp-cli orbit#635).