From dce1a72c344d68ca568fbd04f282f1d6185abd36 Mon Sep 17 00:00:00 2001 From: jxom <7336481+jxom@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:24:53 +1100 Subject: [PATCH] chore: update `normalize` to use `ox/Ens` --- .changeset/fair-berries-live.md | 5 +++ package.json | 2 +- pnpm-lock.yaml | 77 +++++++++++++++++++++++++++++---- src/package.json | 2 +- src/utils/ens/normalize.ts | 4 +- 5 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 .changeset/fair-berries-live.md diff --git a/.changeset/fair-berries-live.md b/.changeset/fair-berries-live.md new file mode 100644 index 0000000000..0f617491f6 --- /dev/null +++ b/.changeset/fair-berries-live.md @@ -0,0 +1,5 @@ +--- +"viem": patch +--- + +Updated \`normalize\` to use \`ox/Ens\`. diff --git a/package.json b/package.json index 54a77151d1..e50f5a4aad 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,7 @@ { "name": "import * from 'viem/ens'", "path": "./src/_esm/ens/index.js", - "limit": "47.5 kB", + "limit": "48.5 kB", "import": "*" }, { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c064b29cf..fa91ec186e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,7 +53,7 @@ importers: version: 20.16.12 '@vitest/coverage-v8': specifier: ^1.0.4 - version: 1.0.4(vitest@1.0.4(@types/node@20.16.12)(@vitest/ui@1.0.4)(terser@5.36.0)) + version: 1.0.4(vitest@1.0.4) '@vitest/ui': specifier: ^1.0.4 version: 1.0.4(vitest@1.0.4) @@ -537,9 +537,6 @@ importers: src: dependencies: - '@adraffy/ens-normalize': - specifier: 1.11.0 - version: 1.11.0 '@noble/curves': specifier: 1.6.0 version: 1.6.0 @@ -558,6 +555,9 @@ importers: isows: specifier: 1.0.6 version: 1.0.6(ws@8.18.0) + ox: + specifier: 0.1.0 + version: 0.1.0(typescript@5.6.3)(zod@3.23.8) webauthn-p256: specifier: 0.0.10 version: 0.0.10 @@ -2631,7 +2631,6 @@ packages: bun@1.1.30: resolution: {integrity: sha512-ysRL1pq10Xba0jqVLPrKU3YIv0ohfp3cTajCPtpjCyppbn3lfiAVNpGoHfyaxS17OlPmWmR67UZRPw/EueQuug==} - cpu: [arm64, x64] os: [darwin, linux, win32] hasBin: true @@ -4267,6 +4266,14 @@ packages: outdent@0.8.0: resolution: {integrity: sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==} + ox@0.1.0: + resolution: {integrity: sha512-xs+STnBP8XG38N+7W5c/5LRN68XOleiTfKJlSBw5rcorIfGvpJPB45lRE3AlziiiuZ+KrEd/1ZLrD+LkN5XFzQ==} + peerDependencies: + typescript: '>=5.4.0' + peerDependenciesMeta: + typescript: + optional: true + p-filter@2.1.0: resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} engines: {node: '>=8'} @@ -5428,6 +5435,14 @@ packages: typescript: optional: true + viem@2.21.42: + resolution: {integrity: sha512-PWBb3iaVFAzLWUaNrYLweOGwHPTQid5J4HfERh/WjJgixbAFwb4ZEc1leRfygvgJPtqUGdYNapvw9b2k2FoCAg==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + viem@file:src: resolution: {directory: src, type: directory} peerDependencies: @@ -6687,7 +6702,7 @@ snapshots: pino-http: 8.6.1 pino-pretty: 10.3.1 prom-client: 14.2.0 - viem: 2.21.41(typescript@5.6.2)(zod@3.23.8) + viem: 2.21.42(typescript@5.6.2)(zod@3.23.8) yargs: 17.7.2 zod: 3.23.8 zod-validation-error: 1.5.0(zod@3.23.8) @@ -7570,7 +7585,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/coverage-v8@1.0.4(vitest@1.0.4(@types/node@20.16.12)(@vitest/ui@1.0.4)(terser@5.36.0))': + '@vitest/coverage-v8@1.0.4(vitest@1.0.4)': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -9965,6 +9980,34 @@ snapshots: outdent@0.8.0: {} + ox@0.1.0(typescript@5.6.2)(zod@3.23.8): + dependencies: + '@adraffy/ens-normalize': 1.11.0 + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + '@scure/bip32': 1.5.0 + '@scure/bip39': 1.4.0 + abitype: 1.0.6(typescript@5.6.2)(zod@3.23.8) + eventemitter3: 5.0.1 + optionalDependencies: + typescript: 5.6.2 + transitivePeerDependencies: + - zod + + ox@0.1.0(typescript@5.6.3)(zod@3.23.8): + dependencies: + '@adraffy/ens-normalize': 1.11.0 + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + '@scure/bip32': 1.5.0 + '@scure/bip39': 1.4.0 + abitype: 1.0.6(typescript@5.6.3)(zod@3.23.8) + eventemitter3: 5.0.1 + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - zod + p-filter@2.1.0: dependencies: p-map: 2.1.0 @@ -11277,7 +11320,7 @@ snapshots: - utf-8-validate - zod - viem@file:src(typescript@5.6.2)(zod@3.23.8): + viem@2.21.42(typescript@5.6.2)(zod@3.23.8): dependencies: '@adraffy/ens-normalize': 1.11.0 '@noble/curves': 1.6.0 @@ -11295,6 +11338,24 @@ snapshots: - utf-8-validate - zod + viem@file:src(typescript@5.6.2)(zod@3.23.8): + dependencies: + '@noble/curves': 1.6.0 + '@noble/hashes': 1.5.0 + '@scure/bip32': 1.5.0 + '@scure/bip39': 1.4.0 + abitype: 1.0.6(typescript@5.6.2)(zod@3.23.8) + isows: 1.0.6(ws@8.18.0) + ox: 0.1.0(typescript@5.6.2)(zod@3.23.8) + webauthn-p256: 0.0.10 + ws: 8.18.0 + optionalDependencies: + typescript: 5.6.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + vite-node@1.0.4(@types/node@20.16.12)(terser@5.36.0): dependencies: cac: 6.7.14 diff --git a/src/package.json b/src/package.json index 3c206e27ae..5ae1fd0b65 100644 --- a/src/package.json +++ b/src/package.json @@ -139,13 +139,13 @@ } }, "dependencies": { - "@adraffy/ens-normalize": "1.11.0", "@noble/curves": "1.6.0", "@noble/hashes": "1.5.0", "@scure/bip32": "1.5.0", "@scure/bip39": "1.4.0", "abitype": "1.0.6", "isows": "1.0.6", + "ox": "0.1.0", "webauthn-p256": "0.0.10", "ws": "8.18.0" }, diff --git a/src/utils/ens/normalize.ts b/src/utils/ens/normalize.ts index 3af52fa097..6bc213ebb0 100644 --- a/src/utils/ens/normalize.ts +++ b/src/utils/ens/normalize.ts @@ -1,4 +1,4 @@ -import { ens_normalize } from '@adraffy/ens-normalize' +import * as Ens from 'ox/Ens' import type { ErrorType } from '../../errors/utils.js' export type NormalizeErrorType = ErrorType @@ -14,5 +14,5 @@ export type NormalizeErrorType = ErrorType * @see https://github.com/ensdomains/docs/blob/9edf9443de4333a0ea7ec658a870672d5d180d53/ens-improvement-proposals/ensip-15-normalization-standard.md */ export function normalize(name: string) { - return ens_normalize(name) + return Ens.normalize(name) }