Skip to content

Commit 107d511

Browse files
committed
feat: migrate @dfinity/* to @icp-sdk/core and icp-cli
Migrate the frontend library and backend infrastructure from deprecated @dfinity/* packages and dfx to @icp-sdk/core and icp-cli. Frontend library (frontend/ic_vetkeys): - Replace @dfinity/{agent,principal,candid,identity} with @icp-sdk/core - Regenerate declarations with @icp-sdk/bindgen@0.3.0 - Replace createActor wrappers with direct Actor.createActor calls - Update test host ports and add canister ID null guards - Reformat tsconfig, vite.config, eslint config Backend infrastructure: - Replace dfx.json with icp.yaml for all backend canisters - Update Makefiles for icp-cli compatible builds - Update test key from dfx_test_key to test_key_1 - Update CI workflows for icp-cli CI: - Update frontend.yml and backend-motoko.yml for icp-cli - Update provision scripts - Add .icp to .gitignore
1 parent a1bd294 commit 107d511

49 files changed

Lines changed: 975 additions & 463 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/backend-motoko.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ on:
1313
- backend/rs/canisters/**
1414
- Cargo.toml
1515
- Cargo.lock
16-
- .github/workflows/provision-linux.sh
17-
- .github/workflows/provision-darwin.sh
16+
- .github/workflows/provision-frontend-linux.sh
17+
- .github/workflows/provision-frontend-darwin.sh
1818
- .github/workflows/backend-motoko.yml
1919

2020
jobs:
@@ -24,12 +24,17 @@ jobs:
2424
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2525
with:
2626
persist-credentials: false
27+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
28+
with:
29+
node-version: '22'
2730
- uses: ZenVoich/setup-mops@3e94e453352269b34137b5ce49f09a8df81bed7d # v1.4.1
2831
with:
2932
mops-version: 1
3033
- name: Provision Linux
31-
run: bash .github/workflows/provision-linux.sh
34+
run: bash .github/workflows/provision-frontend-linux.sh
3235
- name: Run MOPS Test Linux
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3338
run: |
3439
set -eExuo pipefail
3540
cd backend/mo/ic_vetkeys
@@ -45,12 +50,17 @@ jobs:
4550
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
4651
with:
4752
persist-credentials: false
53+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
54+
with:
55+
node-version: '22'
4856
- uses: ZenVoich/setup-mops@3e94e453352269b34137b5ce49f09a8df81bed7d # v1.4.1
4957
with:
5058
mops-version: 1
5159
- name: Provision Darwin
52-
run: bash .github/workflows/provision-darwin.sh
60+
run: bash .github/workflows/provision-frontend-darwin.sh
5361
- name: Run MOPS Test Darwin
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5464
run: |
5565
set -eExuo pipefail
5666
cd backend/mo/ic_vetkeys

.github/workflows/frontend.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ on:
1111
- backend/**/canisters/**
1212
- package.json
1313
- package-lock.json
14-
- .github/workflows/frontend_ic_vetkeys.yml
15-
- .github/workflows/provision-darwin.sh
16-
- .github/workflows/provision-linux.sh
14+
- .github/workflows/frontend.yml
15+
- .github/workflows/provision-frontend-darwin.sh
16+
- .github/workflows/provision-frontend-linux.sh
1717
concurrency:
1818
group: ${{ github.workflow }}-${{ github.ref }}
1919
cancel-in-progress: true
@@ -24,9 +24,14 @@ jobs:
2424
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2525
with:
2626
persist-credentials: false
27+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
28+
with:
29+
node-version: '22'
2730
- name: Provision Linux
28-
run: bash .github/workflows/provision-linux.sh
31+
run: bash .github/workflows/provision-frontend-linux.sh
2932
- name: Frontend Tests and Lint
33+
env:
34+
ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3035
run: |
3136
set -eExuo pipefail
3237
npm install
@@ -40,10 +45,15 @@ jobs:
4045
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
4146
with:
4247
persist-credentials: false
48+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
49+
with:
50+
node-version: '22'
4351
- name: Provision Darwin
4452
run: |
45-
bash .github/workflows/provision-darwin.sh
53+
bash .github/workflows/provision-frontend-darwin.sh
4654
- name: Frontend Tests and Lint
55+
env:
56+
ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4757
run: |
4858
set -eExuo pipefail
4959
npm install

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ target/
1717
.idea/
1818

1919
**/.dfx/*
20+
**/.icp/cache
2021
**/deps/*
2122
backend/**/declarations
2223
examples/**/declarations

backend/mo/canisters/ic_vetkeys_encrypted_maps_canister/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ PWD:=$(shell pwd)
33
.PHONY: compile-wasm
44
.SILENT: compile-wasm
55
compile-wasm:
6-
dfx build --check
6+
icp build
77

88
# Test the APIs of this canister using the respective Rust canister tests.
99
# This has the advantage that the tests are consistent (less room for bugs by having only one implementation of the tests) and the checked expected behavior is consistent across Rust and Motoko.
1010
.PHONY: test
1111
.SILENT: test
1212
test: compile-wasm
13-
CUSTOM_WASM_PATH=$(PWD)/.dfx/local/canisters/ic_vetkeys_encrypted_maps_canister/ic_vetkeys_encrypted_maps_canister.wasm cargo test -p ic-vetkeys-encrypted-maps-canister
13+
@echo "Testing Motoko canister WASM: $(PWD)/.icp/cache/artifacts/ic_vetkeys_encrypted_maps_canister"
14+
CUSTOM_WASM_PATH=$(PWD)/.icp/cache/artifacts/ic_vetkeys_encrypted_maps_canister cargo test -p ic-vetkeys-encrypted-maps-canister

backend/mo/canisters/ic_vetkeys_encrypted_maps_canister/dfx.json

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
canisters:
2+
- name: ic_vetkeys_encrypted_maps_canister
3+
recipe:
4+
type: "@dfinity/motoko@v4.1.0"
5+
configuration:
6+
main: src/Main.mo
7+
args: --enhanced-orthogonal-persistence

backend/mo/canisters/ic_vetkeys_encrypted_maps_canister/mops.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[toolchain]
2+
moc = "1.5.0"
3+
14
[package]
25
name = "ic-vetkeys-encrypted-maps-canister"
36
version = "0.1.0"

backend/mo/canisters/ic_vetkeys_manager_canister/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ PWD:=$(shell pwd)
33
.PHONY: compile-wasm
44
.SILENT: compile-wasm
55
compile-wasm:
6-
dfx build --check
6+
icp build
77

88
# Test the APIs of this canister using the respective Rust canister tests.
99
# This has the advantage that the tests are consistent (less room for bugs by having only one implementation of the tests) and the checked expected behavior is consistent across Rust and Motoko.
1010
.PHONY: test
1111
.SILENT: test
1212
test: compile-wasm
13-
CUSTOM_WASM_PATH=$(PWD)/.dfx/local/canisters/ic_vetkeys_manager_canister/ic_vetkeys_manager_canister.wasm cargo test -p ic-vetkeys-manager-canister
13+
@echo "Testing Motoko canister WASM: $(PWD)/.icp/cache/artifacts/ic_vetkeys_manager_canister"
14+
CUSTOM_WASM_PATH=$(PWD)/.icp/cache/artifacts/ic_vetkeys_manager_canister cargo test -p ic-vetkeys-manager-canister

backend/mo/canisters/ic_vetkeys_manager_canister/dfx.json

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
canisters:
2+
- name: ic_vetkeys_manager_canister
3+
recipe:
4+
type: "@dfinity/motoko@v4.1.0"
5+
configuration:
6+
main: src/Main.mo
7+
args: --enhanced-orthogonal-persistence

0 commit comments

Comments
 (0)