Skip to content

feat: migrate @dfinity/* imports to @icp-sdk/core#368

Draft
andreacerulli wants to merge 4 commits intomainfrom
pr1/import-migration
Draft

feat: migrate @dfinity/* imports to @icp-sdk/core#368
andreacerulli wants to merge 4 commits intomainfrom
pr1/import-migration

Conversation

@andreacerulli
Copy link
Copy Markdown
Contributor

Migrate all frontend code from deprecated @dfinity/{agent,principal,candid,identity} to @icp-sdk/core/{agent,principal,candid,identity} and @dfinity/auth-client to @icp-sdk/auth/client.

  • Main library (frontend/ic_vetkeys): update deps and all source imports
  • All 7 example frontends: update deps, source imports, and Svelte components
  • Point example @dfinity/vetkeys deps to local build (file:../../../frontend/ic_vetkeys)
  • Fix encrypted_notes tsconfig for moduleResolution: bundler compatibility
  • Update prepare script to skip rebuild when dist/ exists

Migrate all frontend code from deprecated @dfinity/{agent,principal,candid,identity}
to @icp-sdk/core/{agent,principal,candid,identity} and @dfinity/auth-client to
@icp-sdk/auth/client.

- Main library (frontend/ic_vetkeys): update deps and all source imports
- All 7 example frontends: update deps, source imports, and Svelte components
- Point example @dfinity/vetkeys deps to local build (file:../../../frontend/ic_vetkeys)
- Fix encrypted_notes tsconfig for moduleResolution: bundler compatibility
- Update prepare script to skip rebuild when dist/ exists
When examples install @dfinity/vetkeys via file: reference, npm triggers
the prepare script. On CI (fresh checkout), devDependencies like vite
aren't available yet, causing exit code 127. Skip the build gracefully
when vite is not found, with a helpful message.
The file: reference to the local @dfinity/vetkeys library requires
the workspace to be installed first (so the library gets built via
its prepare script). Add actions/setup-node and npm install steps
to all example CI jobs before the deploy step.
dfx generate produces declarations with @dfinity/agent imports, which
conflict with the migrated @icp-sdk/core source imports. Add a sed
post-processing step to each gen_bindings.sh that rewrites the imports
after generation.

This is a temporary bridge until PR3 replaces dfx generate with
@icp-sdk/bindgen entirely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant