mirror of
https://github.com/hanzoai/viem.git
synced 2026-10-30 19:36:39 +00:00
* fix: emit type module marker in _types package.json Closes #4843. Mirror _esm/_cjs so nodenext resolves declarations as ESM. * test: remove build script assertion --------- Co-authored-by: jxom <[email protected]>
247 lines
8.7 KiB
JSON
247 lines
8.7 KiB
JSON
{
|
|
"name": "viem",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"bench": "vitest bench",
|
|
"bench:types": "TYPES=true vitest -c ./test/vitest.config.ts --project type-bench",
|
|
"build": "pnpm clean && pnpm build:cjs && pnpm build:esm && pnpm build:types",
|
|
"build:cjs": "pnpm build:trustedSetups:start && node scripts/runTsc.js --project ./tsconfig.build.json --module commonjs --moduleResolution node --outDir ./src/_cjs --removeComments --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./src/_cjs/package.json && pnpm build:trustedSetups:end",
|
|
"build:esm": "tsc --project ./tsconfig.build.json --outDir ./src/_esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./src/_esm/package.json",
|
|
"build:trustedSetups:start": "mv src/node/trustedSetups.ts src/node/trustedSetups_esm.ts && mv src/node/trustedSetups_cjs.ts src/node/trustedSetups.ts",
|
|
"build:trustedSetups:end": "mv src/node/trustedSetups.ts src/node/trustedSetups_cjs.ts && mv src/node/trustedSetups_esm.ts src/node/trustedSetups.ts",
|
|
"build:types": "rm -rf ./src/_types && tsc --project ./tsconfig.build.json --declarationDir ./src/_types --emitDeclarationOnly --declaration --declarationMap && printf '{\"type\":\"module\"}' > ./src/_types/package.json",
|
|
"changeset:prepublish": "pnpm version:update && pnpm build && bun scripts/prepublishOnly.ts",
|
|
"changeset:publish": "pnpm changeset:prepublish && changeset publish",
|
|
"changeset:version": "pnpm install --lockfile-only && changeset version && pnpm version:update && pnpm check",
|
|
"clean": "rm -rf *.tsbuildinfo src/*.tsbuildinfo src/_esm src/_cjs src/_types",
|
|
"contracts:build": "forge build --config-path ./contracts/foundry.toml && bun scripts/generateTypedArtifacts.ts",
|
|
"deps": "pnpx taze -r",
|
|
"docs:dev": "pnpm --filter site dev",
|
|
"docs:build": "pnpm --filter site build",
|
|
"check": "biome check --write --unsafe",
|
|
"check:repo": "sherif",
|
|
"check:types": "tsc -b",
|
|
"check:unused": "pnpm clean && knip",
|
|
"gen:tempo-abis": "bun scripts/generateTempoAbis.ts && biome check --write --unsafe src/tempo/Abis.ts src/tempo/Selectors.ts",
|
|
"gen:tempo-earn-abis": "bun scripts/generateTempoEarnAbis.ts && biome check --write --unsafe src/tempo/Abis.ts test/src/tempo/earnContracts.ts",
|
|
"gen:tokenlist": "bun scripts/generateTokenlist.ts && biome check --write --unsafe src/tokens && pnpm gen:token-lookup",
|
|
"gen:token-lookup": "bun scripts/generateTokenLookup.ts && biome check --write --unsafe site/data/tokens.ts",
|
|
"postinstall": "git submodule update --init --recursive && pnpm contracts:build",
|
|
"preconstruct": "bun scripts/preconstruct.ts",
|
|
"preinstall": "pnpx only-allow pnpm",
|
|
"prepare": "pnpm simple-git-hooks",
|
|
"prepublishOnly": "bun scripts/prepublishOnly.ts",
|
|
"size": "size-limit",
|
|
"test": "vitest -c ./test/vitest.config.ts",
|
|
"test:build": "publint --strict ./src && attw --pack ./src --ignore-rules false-esm",
|
|
"test:chains": "vitest test/scripts/chains.test.ts",
|
|
"test:env": "pnpm test:env:bun && pnpm test:env:next && pnpm test:env:node && pnpm test:env:tsc && pnpm test:env:vite",
|
|
"test:env:bun": "pnpm --filter test-bun test",
|
|
"test:env:next": "pnpm --filter test-next test",
|
|
"test:env:node": "pnpm --filter test-node test",
|
|
"test:env:tsc": "pnpm --filter test-tsc test",
|
|
"test:env:vite": "pnpm --filter test-vite test",
|
|
"test:typecheck": "SKIP_GLOBAL_SETUP=true vitest --typecheck.only -c ./test/vitest.config.ts",
|
|
"test:ui": "vitest dev -c ./test/vitest.config.ts --ui",
|
|
"vectors": "bun test vectors/**/*.test.ts",
|
|
"vectors:generate": "bun vectors/generate.ts",
|
|
"version:update": "bun scripts/updateVersion.ts"
|
|
},
|
|
"devDependencies": {
|
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
"@ark/attest": "^0.56.0",
|
|
"@biomejs/biome": "^2.2.4",
|
|
"@changesets/changelog-github": "^0.4.8",
|
|
"@changesets/cli": "^2.29.7",
|
|
"@ethereumjs/rlp": "^5.0.2",
|
|
"@paulmillr/trusted-setups": "^0.1.2",
|
|
"@pimlico/alto": "0.0.18",
|
|
"@remix-run/node-fetch-server": "^0.12.0",
|
|
"@size-limit/preset-big-lib": "^11.2.0",
|
|
"@types/bun": "^1.2.22",
|
|
"@types/node": "^24.5.2",
|
|
"@vitest/coverage-v8": "^4.1.8",
|
|
"bun": "^1.2.22",
|
|
"ethers": "^6.15.0",
|
|
"knip": "^5.64.0",
|
|
"micro-eth-signer": "^0.14.0",
|
|
"ox": "0.14.33",
|
|
"permissionless": "^0.2.57",
|
|
"prool": "~0.2.8",
|
|
"publint": "^0.2.12",
|
|
"sherif": "^0.8.4",
|
|
"simple-git-hooks": "^2.13.1",
|
|
"size-limit": "^11.2.0",
|
|
"testcontainers": "^11.10.0",
|
|
"typescript": "catalog:",
|
|
"vitest": "^4.1.8"
|
|
},
|
|
"packageManager": "[email protected]",
|
|
"engines": {
|
|
"node": ">=24.5"
|
|
},
|
|
"simple-git-hooks": {
|
|
"pre-commit": "pnpm check"
|
|
},
|
|
"knip": {
|
|
"ignore": [
|
|
".github/**",
|
|
"environments/**",
|
|
"vectors/**"
|
|
],
|
|
"ignoreBinaries": [
|
|
"dev",
|
|
"forge",
|
|
"only-allow",
|
|
"printf"
|
|
],
|
|
"ignoreDependencies": [
|
|
"bun",
|
|
"@size-limit/preset-big-lib"
|
|
],
|
|
"ignoreWorkspaces": [
|
|
"examples/**",
|
|
"test"
|
|
],
|
|
"vitest": {
|
|
"config": [
|
|
"test/vitest.config.ts"
|
|
],
|
|
"entry": [
|
|
"**/*.{bench,bench-d,test,test-d,spec}.?(c|m)[jt]s?(x)"
|
|
]
|
|
},
|
|
"workspaces": {
|
|
".": {
|
|
"project": "scripts/*.ts"
|
|
},
|
|
"src": {
|
|
"entry": [
|
|
"index.ts!",
|
|
"{account-abstraction,accounts,actions,celo,chains,ens,experimental,experimental/erc7739,experimental/erc7821,experimental/erc7811,experimental/erc7846,experimental/erc7895,linea,node,nonce,op-stack,siwe,tempo,tempo/actions,tempo/chains,tempo/zones,tokens,utils,window,zksync}/index.ts!",
|
|
"chains/utils.ts!"
|
|
],
|
|
"ignore": [
|
|
"node/trustedSetups_cjs.ts"
|
|
]
|
|
},
|
|
"site": {
|
|
"project": [
|
|
"**/*.ts",
|
|
"**/*.tsx"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"size-limit": [
|
|
{
|
|
"name": "import * from 'viem' (esm)",
|
|
"path": "./src/_esm/index.js",
|
|
"limit": "85 kB",
|
|
"import": "*"
|
|
},
|
|
{
|
|
"name": "const viem = require('viem') (cjs)",
|
|
"path": "./src/_cjs/index.js",
|
|
"limit": "105 kB"
|
|
},
|
|
{
|
|
"name": "import { createClient, http } from 'viem'",
|
|
"path": "./src/_esm/index.js",
|
|
"limit": "6.6 kB",
|
|
"import": "{ createClient, http }"
|
|
},
|
|
{
|
|
"name": "import * from 'viem/account-abstraction'",
|
|
"path": "./src/_esm/account-abstraction/index.js",
|
|
"limit": "61 kB",
|
|
"import": "*"
|
|
},
|
|
{
|
|
"name": "import * from 'viem/accounts'",
|
|
"path": "./src/_esm/accounts/index.js",
|
|
"limit": "97 kB",
|
|
"import": "*"
|
|
},
|
|
{
|
|
"name": "import { privateKeyToAccount } from 'viem/accounts'",
|
|
"path": "./src/_esm/accounts/index.js",
|
|
"limit": "22 kB",
|
|
"import": "{ privateKeyToAccount }"
|
|
},
|
|
{
|
|
"name": "import { mnemonicToAccount } from 'viem/accounts'",
|
|
"path": "./src/_esm/accounts/index.js",
|
|
"limit": "30 kB",
|
|
"import": "{ mnemonicToAccount }"
|
|
},
|
|
{
|
|
"name": "import * from 'viem/actions'",
|
|
"path": "./src/_esm/actions/index.js",
|
|
"limit": "69 kB",
|
|
"import": "*"
|
|
},
|
|
{
|
|
"name": "import { getBlockNumber } from 'viem/actions'",
|
|
"path": "./src/_esm/actions/index.js",
|
|
"limit": "1 kB",
|
|
"import": "{ getBlockNumber }"
|
|
},
|
|
{
|
|
"name": "import * from 'viem/chains'",
|
|
"path": "./src/_esm/chains/index.js",
|
|
"limit": "111 kB",
|
|
"import": "*"
|
|
},
|
|
{
|
|
"name": "import { mainnet } from 'viem/chains'",
|
|
"path": "./src/_esm/chains/index.js",
|
|
"limit": "500 B",
|
|
"import": "{ mainnet }"
|
|
},
|
|
{
|
|
"name": "import { tempoTestnet } from 'viem/chains'",
|
|
"path": "./src/_esm/chains/index.js",
|
|
"limit": "68 kB",
|
|
"import": "{ tempoTestnet }"
|
|
},
|
|
{
|
|
"name": "import * from 'viem/chains/utils'",
|
|
"path": "./src/_esm/chains/utils.js",
|
|
"limit": "8 kB",
|
|
"import": "*"
|
|
},
|
|
{
|
|
"name": "import * from 'viem/ens'",
|
|
"path": "./src/_esm/ens/index.js",
|
|
"limit": "53 kB",
|
|
"import": "*"
|
|
},
|
|
{
|
|
"name": "import { getEnsAvatar } from 'viem/ens'",
|
|
"path": "./src/_esm/ens/index.js",
|
|
"limit": "28 kB",
|
|
"import": "{ getEnsAvatar }"
|
|
},
|
|
{
|
|
"name": "import * from 'viem/siwe'",
|
|
"path": "./src/_esm/siwe/index.js",
|
|
"limit": "49 kB",
|
|
"import": "*"
|
|
},
|
|
{
|
|
"name": "import { verifySiweMessage } from 'viem/siwe'",
|
|
"path": "./src/_esm/siwe/index.js",
|
|
"limit": "48 kB",
|
|
"import": "{ verifySiweMessage }"
|
|
},
|
|
{
|
|
"name": "import { verifyHash } from 'viem/actions'",
|
|
"path": "./src/_esm/actions/index.js",
|
|
"limit": "47 kB",
|
|
"import": "{ verifyHash }"
|
|
}
|
|
]
|
|
}
|