Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions skills/icp-cli/references/binding-generation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Binding Generation

icp-cli does not have a built-in `dfx generate` command. Use `@icp-sdk/bindgen` to generate TypeScript bindings from `.did` files.
icp-cli does not have a built-in `dfx generate` command. Use `@icp-sdk/bindgen` (>= 0.2.0) to generate TypeScript bindings from `.did` files. It depends on `@icp-sdk/core` (>= 5.0.0).

## Vite plugin (recommended)

Expand Down Expand Up @@ -58,4 +58,4 @@ npx @icp-sdk/bindgen --did ../backend/backend.did --out ./src/bindings/backend
## Requirements
- The `.did` file must exist on disk. If using a recipe with `candid` specified, the file must be committed. If `candid` is omitted, run `icp build` first to auto-generate it.
- `@icp-sdk/bindgen` generates code that depends on `@icp-sdk/core`. Projects using `@dfinity/agent` must upgrade to `@icp-sdk/core` + `@icp-sdk/bindgen`. This is not optional — there is no way to generate TypeScript bindings with icp-cli while staying on `@dfinity/agent`.
- `@icp-sdk/bindgen` (>= 0.2.0) generates code that depends on `@icp-sdk/core` (>= 5.0.0). Projects using `@dfinity/agent` must upgrade to `@icp-sdk/core` + `@icp-sdk/bindgen`. This is not optional — there is no way to generate TypeScript bindings with icp-cli while staying on `@dfinity/agent`.
2 changes: 1 addition & 1 deletion skills/icp-cli/references/dfx-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Since `@icp-sdk/bindgen` generates code that depends on `@icp-sdk/core`, project

Steps:
1. `npm uninstall @dfinity/agent @dfinity/candid @dfinity/principal vite-plugin-environment`
2. `npm install @icp-sdk/core @icp-sdk/bindgen`
2. `npm install @icp-sdk/core@^5.0.0 @icp-sdk/bindgen@^0.2.0`
3. Delete `src/declarations/` (dfx-generated bindings)
4. Add `**/src/bindings/` to `.gitignore`
5. Commit the `.did` file(s) used by bindgen
Expand Down
Loading