feat: add icp-cli support for motoko/hello_world#1308
Merged
Conversation
Add icp.yaml configuration for icp-cli alongside existing dfx.json. Migrate frontend from @dfinity/agent to @icp-sdk/core and use @icp-sdk/bindgen for auto-generating TypeScript bindings from the Candid interface. Update README.md and BUILD.md with icp-cli instructions.
viviveevee
reviewed
Feb 26, 2026
- Remove HttpAgent import — createActor accepts agentOptions.rootKey directly - Remove fetchRootKey() — asset canister (SDK ≥0.30.2) sets ic_env cookie with root key on all HTML responses, eliminating the need for runtime fetch - Unify vite dev server: dfx path now also sets ic_env cookie (via dfx ping for root key + dfx canister id for backend canister ID) - Keep process.env.CANISTER_ID_BACKEND fallback for dfx production builds (dfx does not inject PUBLIC_CANISTER_ID:* env vars into asset canister)
Replace manual regex-based .env parsing and the unsafe
define: { "process.env": process.env } (which leaked all env vars into
the bundle) with Vite's built-in loadEnv scoped to CANISTER_* prefix.
Also remove unused DFX_NETWORK define (no longer referenced after
removing fetchRootKey).
viviveevee
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
icp.yamlconfiguration for icp-cli alongside existingdfx.json@dfinity/agentto@icp-sdk/corewith@icp-sdk/bindgenfor auto-generating TypeScript bindings from the Candid interfacebackend/backend.didas a committed interface definition (used by bindgen at build time)vite.config.jsauto-detects icp-cli vs dfx for the dev serverREADME.mdwith overview, icp-cli instructions, and Candid regeneration guideBUILD.mdwith concise icp-cli versionmops.tomlwith[toolchain]section**/frontend/src/bindings/to.gitignorefor bindgen output