Skip to content

chore: Update npm deps and node version#3664

Closed
sea-snake wants to merge 28 commits intomainfrom
sea-snake/update-npm-deps
Closed

chore: Update npm deps and node version#3664
sea-snake wants to merge 28 commits intomainfrom
sea-snake/update-npm-deps

Conversation

@sea-snake
Copy link
Contributor

@sea-snake sea-snake commented Mar 10, 2026

Update npm deps and node version including .nvmrc.

Changes

  • Remove unused dependencies previously used with legacy frontend CI and/or showcase.
  • Bump all dependencies to latest versions.
  • Add ./scripts/rewrite-dfinity-imports.sh to fix generated did interface imports since latest @icp-sdk/core no longer export @dfinity libs.
  • Update node and npm version to latest lts in package.json and add .nvmrc.
  • Use $effect.pre in components where props were used directly to initialize state (resolves svelte lint warning).
  • Add keys to svelte #each blocks (resolves svelte lint warning).
  • Update SignIdentity implementation since agent-js has switched to Uint8Array.
  • Update ts config lib from ES2021 to ES2022 to support source argument in error constructor (resolve lint warning).
  • Update canister forwarding plugin implementation to work with latest vite.

Tests

All existing tests should pass as-is.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the repository’s Node/npm and npm dependencies (notably Svelte/Vite/Vitest and @icp-sdk/*), and updates the frontend codebase to accommodate the new SDK/agent types plus updated lint rules. It also adds a small codegen post-processing script to keep generated did bindings compatible with the @icp-sdk/core/* import paths.

Changes:

  • Bump Node/npm requirements and update dependency versions across workspaces (Vite/Vitest/Svelte/TypeScript, @icp-sdk/*, etc.).
  • Migrate various identity / WebAuthn / recovery phrase utilities from ArrayBuffer to Uint8Array and replace @noble/hashes hex helpers with local toHex/fromHex.
  • Address new Svelte/eslint warnings (keys in #each, $effect.pre for derived state initialization, updated ESLint TS project config) and add scripts/rewrite-dfinity-imports.sh to rewrite generated did imports.

Reviewed changes

Copilot reviewed 50 out of 53 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tsconfig.eslint.json Add dedicated TS project for ESLint (includes Svelte + generated ambient types).
tsconfig.base.json Update TS lib target to ES2022.
src/vite-plugins/src/index.ts Update compression plugin configuration for newer vite-plugin-compression2.
src/vite-plugins/package.json Bump Vite + compression plugin versions for the vite-plugins workspace.
src/vc-api/src/generated/vc_issuer_types.ts Rewrite generated did imports from @dfinity/* to @icp-sdk/core/*.
src/sig-verifier-js/package.json Upgrade TypeScript/Vite/Vitest tooling in sig-verifier workspace.
src/frontend/src/routes/(new-styling)/self-service/+page.svelte Lint fixes (keys, void for ignored promises) + hex conversion via toHex.
src/frontend/src/routes/(new-styling)/manage/(authenticated)/(access-and-recovery)/access/utils.ts Use local toHex instead of @noble/hashes for passkey credential IDs.
src/frontend/src/routes/(new-styling)/manage/(authenticated)/(access-and-recovery)/access/utils.test.ts Update expectations to use toHex.
src/frontend/src/routes/(new-styling)/manage/(authenticated)/(access-and-recovery)/access/components/RenamePasskey.svelte Switch to $effect.pre pattern for prop-driven state init; lint fixes.
src/frontend/src/routes/(new-styling)/manage/(authenticated)/(access-and-recovery)/access/+page.svelte Prop/state initialization changes and promise-handling lint fixes (void goto).
src/frontend/src/lib/utils/webAuthnIdentity.ts Adapt WebAuthn identity implementation to Uint8Array APIs + local hex helpers.
src/frontend/src/lib/utils/webAuthn.ts Switch from bufferEqual to uint8ArrayEqual for key comparisons.
src/frontend/src/lib/utils/utils.ts Add uint8ArrayEqual, base64 helpers with fallbacks, and toHex/fromHex.
src/frontend/src/lib/utils/trackWindowSession.test.ts Adjust test callback typings.
src/frontend/src/lib/utils/recoveryPhrase.ts Use toHex and normalize inputs to WebCrypto (Uint8Array).
src/frontend/src/lib/utils/recoveryPhrase.test.ts Use fromHex for test vectors instead of @noble/hashes.
src/frontend/src/lib/utils/multiWebAuthnIdentity.ts Update signing APIs to Uint8Array and credentialId comparisons to uint8ArrayEqual.
src/frontend/src/lib/utils/iiConnection.ts Update WebAuthn identity typing (rawId to Uint8Array) and improve error cause.
src/frontend/src/lib/utils/iiConnection.test.ts Update mocks/signatures to match Uint8Array-based agent APIs.
src/frontend/src/lib/utils/findWebAuthnFlows.test.ts Update test credentialId types to Uint8Array.
src/frontend/src/lib/utils/discoverablePasskeyIdentity.ts Normalize WebAuthn/CBOR inputs and migrate credential IDs to Uint8Array.
src/frontend/src/lib/utils/discoverableDummyIdentity.ts Align dummy identity credentialId typing with Uint8Array.
src/frontend/src/lib/utils/credential-devices.ts Change credential IDs to Uint8Array and adjust DER pubkey handling.
src/frontend/src/lib/utils/authentication/passkey.ts Replace bytesToHex with toHex and simplify credential ID usage.
src/frontend/src/lib/utils/animation-dispatcher.ts Export TriggerFunction type for tests/consumers.
src/frontend/src/lib/utils/animation-dispatcher.test.ts Update typing/casts to use exported TriggerFunction.
src/frontend/src/lib/stores/authorization.store.ts Ensure stored session public key is Uint8Array.
src/frontend/src/lib/legacy/storage/index.ts Normalize WebCrypto HMAC inputs to Uint8Array.
src/frontend/src/lib/generated/internet_identity_types.d.ts Rewrite generated did imports to @icp-sdk/core/*.
src/frontend/src/lib/flows/registerAccessMethodFlow.svelte.ts Use SvelteURL/SvelteDate for reactive-safe URL/date values.
src/frontend/src/lib/flows/recoverWithPhraseFlow.svelte.ts Move agent imports to @icp-sdk/core/* and use uint8ArrayEqual.
src/frontend/src/lib/flows/migrationFlow.svelte.ts Use SvelteDate in delegation expiration.
src/frontend/src/lib/flows/confirmAccessMethodFlow.svelte.ts Use SvelteURL for reactive-safe URL values.
src/frontend/src/lib/flows/authLastUsedFlow.svelte.ts Use SvelteMap for reactive-safe map state.
src/frontend/src/lib/flows/authFlow.svelte.ts OpenID request config updated (note: configURL removed).
src/frontend/src/lib/components/wizards/createRecoveryPhrase/CreateRecoveryPhraseWizard.svelte Use $effect.pre to initialize local state from props without lint warnings.
src/frontend/src/lib/components/views/RecoveryPhraseInput.svelte Prop-driven state init via $effect.pre, lazy import lint fix, add keyed #each.
src/frontend/src/lib/components/views/EditAccount.svelte Prop-driven state init via $effect.pre.
src/frontend/src/lib/components/utils/ButtonOrAnchor.svelte Derive buttonProps/anchorProps with $derived to satisfy lint rules.
src/frontend/src/lib/components/utils/AuthorizationChannel.svelte Refactor authorize promise creation; avoid floating goto promise.
src/frontend/src/lib/components/ui/Tooltip.svelte Lint ignore + minor attribute syntax normalization.
src/frontend/src/lib/components/ui/TextFade.svelte Timer typing fix and avoid floating promise in next().
src/frontend/src/lib/components/ui/ProgressRing.svelte Make derived value reactive with $derived.
src/frontend/src/lib/components/ui/IdentitySwitcher.svelte Add lint ignore for local state snapshots.
scripts/rewrite-dfinity-imports.sh Add sed-based rewrite to convert generated @dfinity/* imports to @icp-sdk/core/*.
package.json Update engines, bump dependencies, and pipe didc outputs through rewrite script.
eslint.config.js Point ESLint to tsconfig.eslint.json, include Svelte TS/JS, adjust Svelte lint rule.
demos/vc_issuer/package.json Bump Vite + React plugin + polyfills in demo workspace.
demos/test-app/package.json Bump Vite + React plugin + polyfills in demo workspace.
.nvmrc Pin Node version for local development.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 51 out of 54 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the current didc setup generates js/ts files with @dfinity/* imports instead of @icp-sdk/core/*. Meanwhile the latest @icp-sdk version in this PR no longer makes the @dfinity/* imports available.

We can probably also update didc assuming that this would generate @icp-sdk imports now, but I wanted to avoid going there inside this PR for now.

@sea-snake
Copy link
Contributor Author

Superseded by #3666

@sea-snake sea-snake closed this Mar 12, 2026
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.

3 participants