From 2c87b196088e7b8f3df306b9ed7b37ca2f42c9ff Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Mon, 15 Dec 2025 11:50:54 +0100 Subject: [PATCH 01/10] setup publint and attw --- package.json | 6 + packages/analytics/package.json | 2 + packages/connect-evm/package.json | 2 + packages/connect-multichain/package.json | 2 + packages/connect/package.json | 2 + packages/multichain-ui/package.json | 2 + yarn.lock | 343 ++++++++++++++++++++++- 7 files changed, 354 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0cc4ec35..b7c0606a 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,11 @@ "lint:dependencies": "depcheck && yarn dedupe --check", "lint:dependencies:fix": "depcheck && yarn dedupe", "lint:eslint": "yarn build:only-clean && eslint . --cache", + "lint:exports": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run publint", "lint:fix": "yarn lint:eslint --fix && echo && yarn lint:misc --write && yarn constraints --fix && yarn lint:dependencies:fix", "lint:misc": "prettier --no-error-on-unmatched-pattern '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' '!merged-packages/**' --ignore-path .gitignore", + "lint:package-config": "yarn lint:exports && yarn lint:types", + "lint:types": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run attw", "prepare-preview-builds": "./scripts/prepare-preview-builds.sh", "publish-previews": "yarn workspaces foreach --all --no-private --parallel --verbose run publish:preview", "test": "yarn test:scripts --silent && yarn test:packages", @@ -39,9 +42,11 @@ "workspaces:list-versions": "./scripts/list-workspace-versions.sh" }, "simple-git-hooks": { + "pre-commit": "yarn lint:package-config", "pre-push": "yarn lint" }, "devDependencies": { + "@arethetypeswrong/cli": "^0.18.2", "@babel/core": "^7.28.4", "@babel/plugin-transform-modules-commonjs": "^7.23.3", "@babel/preset-typescript": "^7.23.3", @@ -80,6 +85,7 @@ "prettier": "^3.3.3", "prettier-2": "npm:prettier@^2.8.8", "prettier-plugin-packagejson": "^2.4.5", + "publint": "^0.2.9", "rimraf": "^5.0.5", "semver": "^7.6.3", "simple-git-hooks": "^2.8.0", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 7c2e63a7..44a2308a 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -36,8 +36,10 @@ "dist/" ], "scripts": { + "attw": "attw --pack .", "build": "yarn clean && tsc -b --force tsconfig.build.json && npx tsup src/index.ts --format esm,cjs", "build:docs": "typedoc", + "publint": "publint", "changelog:format": "../../scripts/format-changelog.sh @metamask/analytics", "changelog:update": "../../scripts/update-changelog.sh @metamask/analytics", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/analytics", diff --git a/packages/connect-evm/package.json b/packages/connect-evm/package.json index 9c0e51eb..6539bb24 100644 --- a/packages/connect-evm/package.json +++ b/packages/connect-evm/package.json @@ -38,8 +38,10 @@ "dist/" ], "scripts": { + "attw": "attw --pack .", "build": "yarn tsup ", "build:docs": "typedoc", + "publint": "publint", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-evm", "changelog:update": "../../scripts/update-changelog.sh @metamask/connect-evm", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/connect-evm", diff --git a/packages/connect-multichain/package.json b/packages/connect-multichain/package.json index 2a103f77..1a934c8c 100644 --- a/packages/connect-multichain/package.json +++ b/packages/connect-multichain/package.json @@ -47,8 +47,10 @@ "dist/" ], "scripts": { + "attw": "attw --pack .", "build": "yarn clean && tsc -b tsconfig.build.json && npx tsup", "build:docs": "typedoc", + "publint": "publint", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-multichain", "changelog:update": "../../scripts/update-changelog.sh @metamask/connect-multichain", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/connect-multichain", diff --git a/packages/connect/package.json b/packages/connect/package.json index 92515e27..58eb0a2a 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -56,8 +56,10 @@ "dist/" ], "scripts": { + "attw": "attw --pack .", "build": "yarn clean && tsc -b --force tsconfig.build.json && npx tsup src/index.ts src/multichain/index.ts src/evm/index.ts --format esm,cjs --external @metamask/connect-multichain --external @metamask/connect-evm", "build:docs": "typedoc", + "publint": "publint", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect", "changelog:update": "../../scripts/update-changelog.sh @metamask/connect", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/connect", diff --git a/packages/multichain-ui/package.json b/packages/multichain-ui/package.json index db89f41f..83b3841f 100644 --- a/packages/multichain-ui/package.json +++ b/packages/multichain-ui/package.json @@ -47,8 +47,10 @@ ], "collection": "dist/collection/collection-manifest.json", "scripts": { + "attw": "attw --pack .", "build:docs": "typedoc", "build:types": "tsc --project tsconfig.json --emitDeclarationOnly --outDir dist/types", + "publint": "publint", "build:clean": "yarn clean && yarn build", "build": "stencil build --prod", "build:dev": "NODE_ENV=development stencil build --debug --dev", diff --git a/yarn.lock b/yarn.lock index bce9d58b..50202756 100644 --- a/yarn.lock +++ b/yarn.lock @@ -48,6 +48,13 @@ __metadata: languageName: node linkType: hard +"@andrewbranch/untar.js@npm:^1.0.3": + version: 1.0.3 + resolution: "@andrewbranch/untar.js@npm:1.0.3" + checksum: 10/a32de53839fc61af90a394cf93d4368aacd167c9c80f0b3ba0c268460942a6ce2bfe257b6d3f03986b9dcb7368f10b9dc7f66c2f94254d2662da8278454e7d12 + languageName: node + linkType: hard + "@apideck/better-ajv-errors@npm:^0.3.1": version: 0.3.6 resolution: "@apideck/better-ajv-errors@npm:0.3.6" @@ -61,6 +68,39 @@ __metadata: languageName: node linkType: hard +"@arethetypeswrong/cli@npm:^0.18.2": + version: 0.18.2 + resolution: "@arethetypeswrong/cli@npm:0.18.2" + dependencies: + "@arethetypeswrong/core": "npm:0.18.2" + chalk: "npm:^4.1.2" + cli-table3: "npm:^0.6.3" + commander: "npm:^10.0.1" + marked: "npm:^9.1.2" + marked-terminal: "npm:^7.1.0" + semver: "npm:^7.5.4" + bin: + attw: dist/index.js + checksum: 10/8b4506edeb37d58f15e347302df68981c5aefecce973e746026d46370bb560c1ebc05ef8a38eba3102881df4cd3c901961186e3df41077efca4e58adffd455a1 + languageName: node + linkType: hard + +"@arethetypeswrong/core@npm:0.18.2": + version: 0.18.2 + resolution: "@arethetypeswrong/core@npm:0.18.2" + dependencies: + "@andrewbranch/untar.js": "npm:^1.0.3" + "@loaderkit/resolve": "npm:^1.0.2" + cjs-module-lexer: "npm:^1.2.3" + fflate: "npm:^0.8.2" + lru-cache: "npm:^11.0.1" + semver: "npm:^7.5.4" + typescript: "npm:5.6.1-rc" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/9c3edeb8e09e572682e37f55bd523d0dad45388232d31fa1d8875f7f5c414a184070c2bb6d0c8f254dfce4ed9248da373d549ecdeaa571a0cfff04c387c94cf1 + languageName: node + linkType: hard + "@asamuzakjp/css-color@npm:^3.2.0": version: 3.2.0 resolution: "@asamuzakjp/css-color@npm:3.2.0" @@ -1744,6 +1784,13 @@ __metadata: languageName: node linkType: hard +"@braidai/lang@npm:^1.0.0": + version: 1.1.2 + resolution: "@braidai/lang@npm:1.1.2" + checksum: 10/04ece1b744eb8b6c2417afe220ad96c7078f83ed533117cc49300b6322f6b58f5e649c80bd990c27e2d16bfdd976481d5252ff3206b7069fc863890ab1b96277 + languageName: node + linkType: hard + "@coinbase/cdp-sdk@npm:^1.0.0": version: 1.38.5 resolution: "@coinbase/cdp-sdk@npm:1.38.5" @@ -1780,6 +1827,13 @@ __metadata: languageName: node linkType: hard +"@colors/colors@npm:1.5.0": + version: 1.5.0 + resolution: "@colors/colors@npm:1.5.0" + checksum: 10/9d226461c1e91e95f067be2bdc5e6f99cfe55a721f45afb44122e23e4b8602eeac4ff7325af6b5a369f36396ee1514d3809af3f57769066d80d83790d8e53339 + languageName: node + linkType: hard + "@craco/craco@npm:^7.1.0": version: 7.1.0 resolution: "@craco/craco@npm:7.1.0" @@ -3914,6 +3968,15 @@ __metadata: languageName: node linkType: hard +"@loaderkit/resolve@npm:^1.0.2": + version: 1.0.4 + resolution: "@loaderkit/resolve@npm:1.0.4" + dependencies: + "@braidai/lang": "npm:^1.0.0" + checksum: 10/e999f0fc289c2e3f9f80ec92db69c123a5a74b5db7c4bc10292658fc9ef2e1afe6430346ca6cd52d941d7fc407bf28188c95bbbe0aa212c02c8716b5c4b03316 + languageName: node + linkType: hard + "@metamask/abi-utils@npm:^3.0.0": version: 3.0.0 resolution: "@metamask/abi-utils@npm:3.0.0" @@ -4086,6 +4149,7 @@ __metadata: version: 0.0.0-use.local resolution: "@metamask/connect-monorepo@workspace:." dependencies: + "@arethetypeswrong/cli": "npm:^0.18.2" "@babel/core": "npm:^7.28.4" "@babel/plugin-transform-modules-commonjs": "npm:^7.23.3" "@babel/preset-typescript": "npm:^7.23.3" @@ -4124,6 +4188,7 @@ __metadata: prettier: "npm:^3.3.3" prettier-2: "npm:prettier@^2.8.8" prettier-plugin-packagejson: "npm:^2.4.5" + publint: "npm:^0.2.9" rimraf: "npm:^5.0.5" semver: "npm:^7.6.3" simple-git-hooks: "npm:^2.8.0" @@ -6653,6 +6718,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/is@npm:^4.6.0": + version: 4.6.0 + resolution: "@sindresorhus/is@npm:4.6.0" + checksum: 10/e7f36ed72abfcd5e0355f7423a72918b9748bb1ef370a59f3e5ad8d40b728b85d63b272f65f63eec1faf417cda89dcb0aeebe94015647b6054659c1442fe5ce0 + languageName: node + linkType: hard + "@sinonjs/commons@npm:^1.7.0": version: 1.8.6 resolution: "@sinonjs/commons@npm:1.8.6" @@ -10222,6 +10294,15 @@ __metadata: languageName: node linkType: hard +"ansi-escapes@npm:^7.0.0": + version: 7.2.0 + resolution: "ansi-escapes@npm:7.2.0" + dependencies: + environment: "npm:^1.0.0" + checksum: 10/0d03e8a39aed844dc40e69891ef21f09bd12e481876e3d1daea711fa19334e698a9b077d87e4027fb3af4686e9609237cd986285755465a7793bd7192fd115f9 + languageName: node + linkType: hard + "ansi-html-community@npm:^0.0.8": version: 0.0.8 resolution: "ansi-html-community@npm:0.0.8" @@ -10254,7 +10335,7 @@ __metadata: languageName: node linkType: hard -"ansi-regex@npm:^6.0.1": +"ansi-regex@npm:^6.0.1, ansi-regex@npm:^6.1.0": version: 6.2.2 resolution: "ansi-regex@npm:6.2.2" checksum: 10/9b17ce2c6daecc75bcd5966b9ad672c23b184dc3ed9bf3c98a0702f0d2f736c15c10d461913568f2cf527a5e64291c7473358885dd493305c84a1cfed66ba94f @@ -12155,7 +12236,7 @@ __metadata: languageName: node linkType: hard -"cjs-module-lexer@npm:^1.0.0, cjs-module-lexer@npm:^1.3.1": +"cjs-module-lexer@npm:^1.0.0, cjs-module-lexer@npm:^1.2.3, cjs-module-lexer@npm:^1.3.1": version: 1.4.3 resolution: "cjs-module-lexer@npm:1.4.3" checksum: 10/d2b92f919a2dedbfd61d016964fce8da0035f827182ed6839c97cac56e8a8077cfa6a59388adfe2bc588a19cef9bbe830d683a76a6e93c51f65852062cfe2591 @@ -12212,6 +12293,22 @@ __metadata: languageName: node linkType: hard +"cli-highlight@npm:^2.1.11": + version: 2.1.11 + resolution: "cli-highlight@npm:2.1.11" + dependencies: + chalk: "npm:^4.0.0" + highlight.js: "npm:^10.7.1" + mz: "npm:^2.4.0" + parse5: "npm:^5.1.1" + parse5-htmlparser2-tree-adapter: "npm:^6.0.0" + yargs: "npm:^16.0.0" + bin: + highlight: bin/highlight + checksum: 10/05d2b5beb8a4d3259f693517d013bf53d04ad20f470b77c3d02e051963092fae388388e3127f67d3679884a0c32cb855bf590292017c5e68c0f8d86f4b8e146e + languageName: node + linkType: hard + "cli-spinners@npm:^2.0.0, cli-spinners@npm:^2.5.0, cli-spinners@npm:^2.6.1": version: 2.9.2 resolution: "cli-spinners@npm:2.9.2" @@ -12219,6 +12316,19 @@ __metadata: languageName: node linkType: hard +"cli-table3@npm:^0.6.3, cli-table3@npm:^0.6.5": + version: 0.6.5 + resolution: "cli-table3@npm:0.6.5" + dependencies: + "@colors/colors": "npm:1.5.0" + string-width: "npm:^4.2.0" + dependenciesMeta: + "@colors/colors": + optional: true + checksum: 10/8dca71256f6f1367bab84c33add3f957367c7c43750a9828a4212ebd31b8df76bd7419d386e3391ac7419698a8540c25f1a474584028f35b170841cde2e055c5 + languageName: node + linkType: hard + "cli-width@npm:^3.0.0": version: 3.0.0 resolution: "cli-width@npm:3.0.0" @@ -12437,6 +12547,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^10.0.1": + version: 10.0.1 + resolution: "commander@npm:10.0.1" + checksum: 10/8799faa84a30da985802e661cc9856adfaee324d4b138413013ef7f087e8d7924b144c30a1f1405475f0909f467665cd9e1ce13270a2f41b141dab0b7a58f3fb + languageName: node + linkType: hard + "commander@npm:^12.0.0": version: 12.1.0 resolution: "commander@npm:12.1.0" @@ -14097,6 +14214,13 @@ __metadata: languageName: node linkType: hard +"emojilib@npm:^2.4.0": + version: 2.4.0 + resolution: "emojilib@npm:2.4.0" + checksum: 10/bef767eca49acaa881388d91bee6936ea57ae367d603d5227ff0a9da3e2d1e774a61c447e5f2f4901797d023c4b5239bc208285b6172a880d3655024a0f44980 + languageName: node + linkType: hard + "emojis-list@npm:^3.0.0": version: 3.0.0 resolution: "emojis-list@npm:3.0.0" @@ -14218,6 +14342,13 @@ __metadata: languageName: node linkType: hard +"environment@npm:^1.0.0": + version: 1.1.0 + resolution: "environment@npm:1.1.0" + checksum: 10/dd3c1b9825e7f71f1e72b03c2344799ac73f2e9ef81b78ea8b373e55db021786c6b9f3858ea43a436a2c4611052670ec0afe85bc029c384cc71165feee2f4ba6 + languageName: node + linkType: hard + "err-code@npm:^2.0.2": version: 2.0.3 resolution: "err-code@npm:2.0.3" @@ -16241,6 +16372,13 @@ __metadata: languageName: node linkType: hard +"fflate@npm:^0.8.2": + version: 0.8.2 + resolution: "fflate@npm:0.8.2" + checksum: 10/2bd26ba6d235d428de793c6a0cd1aaa96a06269ebd4e21b46c8fd1bd136abc631acf27e188d47c3936db090bf3e1ede11d15ce9eae9bffdc4bfe1b9dc66ca9cb + languageName: node + linkType: hard + "figures@npm:^3.0.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -16897,6 +17035,19 @@ __metadata: languageName: node linkType: hard +"glob@npm:^8.0.1": + version: 8.1.0 + resolution: "glob@npm:8.1.0" + dependencies: + fs.realpath: "npm:^1.0.0" + inflight: "npm:^1.0.4" + inherits: "npm:2" + minimatch: "npm:^5.0.1" + once: "npm:^1.3.0" + checksum: 10/9aab1c75eb087c35dbc41d1f742e51d0507aa2b14c910d96fb8287107a10a22f4bbdce26fc0a3da4c69a20f7b26d62f1640b346a4f6e6becfff47f335bb1dc5e + languageName: node + linkType: hard + "global-dirs@npm:^0.1.1": version: 0.1.1 resolution: "global-dirs@npm:0.1.1" @@ -17225,6 +17376,13 @@ __metadata: languageName: node linkType: hard +"highlight.js@npm:^10.7.1": + version: 10.7.3 + resolution: "highlight.js@npm:10.7.3" + checksum: 10/db8d10a541936b058e221dbde77869664b2b45bca75d660aa98065be2cd29f3924755fbc7348213f17fd931aefb6e6597448ba6fe82afba6d8313747a91983ee + languageName: node + linkType: hard + "hmac-drbg@npm:^1.0.1": version: 1.0.1 resolution: "hmac-drbg@npm:1.0.1" @@ -17606,6 +17764,15 @@ __metadata: languageName: node linkType: hard +"ignore-walk@npm:^5.0.1": + version: 5.0.1 + resolution: "ignore-walk@npm:5.0.1" + dependencies: + minimatch: "npm:^5.0.1" + checksum: 10/a88b3fbda155496363fb3db66c7c7b85cf04d614fb51146f0aa5fc6b35c65370c57f9e6c550cd6048651fc378985b7a2bb9015c9fcb3e0dc798fc0728746703c + languageName: node + linkType: hard + "ignore@npm:^5.2.0, ignore@npm:^5.2.4, ignore@npm:^5.3.1, ignore@npm:^5.3.2": version: 5.3.2 resolution: "ignore@npm:5.3.2" @@ -20641,6 +20808,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.1": + version: 11.2.4 + resolution: "lru-cache@npm:11.2.4" + checksum: 10/3b2da74c0b6653767f8164c38c4c4f4d7f0cc10c62bfa512663d94a830191ae6a5af742a8d88a8b30d5f9974652d3adae53931f32069139ad24fa2a18a199aca + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -20791,6 +20965,32 @@ __metadata: languageName: node linkType: hard +"marked-terminal@npm:^7.1.0": + version: 7.3.0 + resolution: "marked-terminal@npm:7.3.0" + dependencies: + ansi-escapes: "npm:^7.0.0" + ansi-regex: "npm:^6.1.0" + chalk: "npm:^5.4.1" + cli-highlight: "npm:^2.1.11" + cli-table3: "npm:^0.6.5" + node-emoji: "npm:^2.2.0" + supports-hyperlinks: "npm:^3.1.0" + peerDependencies: + marked: ">=1 <16" + checksum: 10/1dfdfe752a4ebe6aec8de4a51180612a5f29982026b104a86215efb46b82b2a1942531a6bb840163c8d827e3eadc5cf93272e6eb29ec549f72b73b8b2eb97cfe + languageName: node + linkType: hard + +"marked@npm:^9.1.2": + version: 9.1.6 + resolution: "marked@npm:9.1.6" + bin: + marked: bin/marked.js + checksum: 10/29d073500c70b6b53cd35a8d19f5e43df6e2819ddeca8848a31901b87b82ca0ea46a8a831920c656c69c33ad5dce4b75654c4c4ced34a67f4e4e4a31c7620cfe + languageName: node + linkType: hard + "marky@npm:^1.2.2": version: 1.3.0 resolution: "marky@npm:1.3.0" @@ -21707,6 +21907,13 @@ __metadata: languageName: node linkType: hard +"mri@npm:^1.1.0": + version: 1.2.0 + resolution: "mri@npm:1.2.0" + checksum: 10/6775a1d2228bb9d191ead4efc220bd6be64f943ad3afd4dcb3b3ac8fc7b87034443f666e38805df38e8d047b29f910c3cc7810da0109af83e42c82c73bd3f6bc + languageName: node + linkType: hard + "ms@npm:2.0.0": version: 2.0.0 resolution: "ms@npm:2.0.0" @@ -21767,7 +21974,7 @@ __metadata: languageName: node linkType: hard -"mz@npm:^2.7.0": +"mz@npm:^2.4.0, mz@npm:^2.7.0": version: 2.7.0 resolution: "mz@npm:2.7.0" dependencies: @@ -21909,6 +22116,18 @@ __metadata: languageName: node linkType: hard +"node-emoji@npm:^2.2.0": + version: 2.2.0 + resolution: "node-emoji@npm:2.2.0" + dependencies: + "@sindresorhus/is": "npm:^4.6.0" + char-regex: "npm:^1.0.2" + emojilib: "npm:^2.4.0" + skin-tone: "npm:^2.0.0" + checksum: 10/2548668f5cc9f781c94dc39971a630b2887111e0970c29fc523e924819d1b39b53a2694a4d1046861adf538c4462d06ee0269c48717ccad30336a918d9a911d5 + languageName: node + linkType: hard + "node-fetch-native@npm:^1.6.7": version: 1.6.7 resolution: "node-fetch-native@npm:1.6.7" @@ -22098,6 +22317,15 @@ __metadata: languageName: node linkType: hard +"npm-bundled@npm:^2.0.0": + version: 2.0.1 + resolution: "npm-bundled@npm:2.0.1" + dependencies: + npm-normalize-package-bin: "npm:^2.0.0" + checksum: 10/adf5d727915cbd61603e2171ba67e39319efa343ceb72868348232a36ad774a8365d5af5e1aad29acc41c3caeda4ebd80e5b7a3da319985509aeedf79e352c0d + languageName: node + linkType: hard + "npm-install-checks@npm:^6.0.0": version: 6.3.0 resolution: "npm-install-checks@npm:6.3.0" @@ -22114,6 +22342,13 @@ __metadata: languageName: node linkType: hard +"npm-normalize-package-bin@npm:^2.0.0": + version: 2.0.0 + resolution: "npm-normalize-package-bin@npm:2.0.0" + checksum: 10/7c5379f9b188b564c4332c97bdd9a5d6b7b15f02b5823b00989d6a0e6fb31eb0280f02b0a924f930e1fcaf00e60fae333aec8923d2a4c7747613c7d629d8aa25 + languageName: node + linkType: hard + "npm-package-arg@npm:^11.0.0": version: 11.0.3 resolution: "npm-package-arg@npm:11.0.3" @@ -22126,6 +22361,20 @@ __metadata: languageName: node linkType: hard +"npm-packlist@npm:^5.1.3": + version: 5.1.3 + resolution: "npm-packlist@npm:5.1.3" + dependencies: + glob: "npm:^8.0.1" + ignore-walk: "npm:^5.0.1" + npm-bundled: "npm:^2.0.0" + npm-normalize-package-bin: "npm:^2.0.0" + bin: + npm-packlist: bin/index.js + checksum: 10/78aa1c69a349c40cf7ba556581bff2dd5cbc1455614a44bd673e076f7f402096ac7c01660c45ec17cbd51bf0db3a4df7e9bc3a0a8e8e497ebf6d53848f33dfad + languageName: node + linkType: hard + "npm-pick-manifest@npm:^9.0.0": version: 9.1.0 resolution: "npm-pick-manifest@npm:9.1.0" @@ -22878,13 +23127,29 @@ __metadata: languageName: node linkType: hard -"parse5@npm:6.0.1": +"parse5-htmlparser2-tree-adapter@npm:^6.0.0": + version: 6.0.1 + resolution: "parse5-htmlparser2-tree-adapter@npm:6.0.1" + dependencies: + parse5: "npm:^6.0.1" + checksum: 10/3400a2cd1ad450b2fe148544154f86ea53d3ed6b6eab56c78bb43b9629d3dfe9f580dffd75bbf32be134ffef645b68081fc764bf75c210f236ab9c5c8c38c252 + languageName: node + linkType: hard + +"parse5@npm:6.0.1, parse5@npm:^6.0.1": version: 6.0.1 resolution: "parse5@npm:6.0.1" checksum: 10/dfb110581f62bd1425725a7c784ae022a24669bd0efc24b58c71fc731c4d868193e2ebd85b74cde2dbb965e4dcf07059b1e651adbec1b3b5267531bd132fdb75 languageName: node linkType: hard +"parse5@npm:^5.1.1": + version: 5.1.1 + resolution: "parse5@npm:5.1.1" + checksum: 10/5b509744cfe81488a33be05578df490c460690e64519fa67f0a0acb9c1bca05914e8acad17a977e2cf5964a000e43959b40024f0c243dd6595dd0cca8a32f71b + languageName: node + linkType: hard + "parse5@npm:^7.0.0, parse5@npm:^7.2.1": version: 7.3.0 resolution: "parse5@npm:7.3.0" @@ -24481,6 +24746,19 @@ __metadata: languageName: node linkType: hard +"publint@npm:^0.2.9": + version: 0.2.12 + resolution: "publint@npm:0.2.12" + dependencies: + npm-packlist: "npm:^5.1.3" + picocolors: "npm:^1.1.1" + sade: "npm:^1.8.1" + bin: + publint: lib/cli.js + checksum: 10/7432845a760aa0c5843de4fdc8e53458e4f35502dcc8f785a3e78c652c9bf4a49a358d9b72220ba06bac823481bbfaf3020d168918148b88f5cbab9621ecd6b5 + languageName: node + linkType: hard + "pump@npm:^3.0.0": version: 3.0.3 resolution: "pump@npm:3.0.3" @@ -25939,6 +26217,15 @@ __metadata: languageName: node linkType: hard +"sade@npm:^1.8.1": + version: 1.8.1 + resolution: "sade@npm:1.8.1" + dependencies: + mri: "npm:^1.1.0" + checksum: 10/1c67ba03c94083e0ae307ff5564ecb86c2104c0f558042fdaa40ea0054f91a63a9783f14069870f2f784336adabb70f90f22a84dc457b5a25e859aaadefe0910 + languageName: node + linkType: hard + "safe-array-concat@npm:^1.1.2, safe-array-concat@npm:^1.1.3": version: 1.1.3 resolution: "safe-array-concat@npm:1.1.3" @@ -26560,6 +26847,15 @@ __metadata: languageName: node linkType: hard +"skin-tone@npm:^2.0.0": + version: 2.0.0 + resolution: "skin-tone@npm:2.0.0" + dependencies: + unicode-emoji-modifier-base: "npm:^1.0.0" + checksum: 10/19de157586b8019cacc55eb25d9d640f00fc02415761f3e41a4527142970fd4e7f6af0333bc90e879858766c20a976107bb386ffd4c812289c01d51f2c8d182c + languageName: node + linkType: hard + "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" @@ -27424,6 +27720,16 @@ __metadata: languageName: node linkType: hard +"supports-hyperlinks@npm:^3.1.0": + version: 3.2.0 + resolution: "supports-hyperlinks@npm:3.2.0" + dependencies: + has-flag: "npm:^4.0.0" + supports-color: "npm:^7.0.0" + checksum: 10/f7924de6049fc30bc808f98d3561318c1a4e3d55d786f9fede5e23dc5a7b0f625485bd1143135b496d521ccd0110463f2c077eb71a4ce0cf783b8b31f7909242 + languageName: node + linkType: hard + "supports-preserve-symlinks-flag@npm:^1.0.0": version: 1.0.0 resolution: "supports-preserve-symlinks-flag@npm:1.0.0" @@ -28380,6 +28686,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:5.6.1-rc": + version: 5.6.1-rc + resolution: "typescript@npm:5.6.1-rc" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/5716659d5baf142b5c84b96209b30730a5e9dcc0202f879349f9974823f7452ec4ef3904397b6d89d861c688acdbb1dad0a449d753163519fae2ee06ea4a68be + languageName: node + linkType: hard + "typescript@npm:^5.9.3": version: 5.9.3 resolution: "typescript@npm:5.9.3" @@ -28390,6 +28706,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A5.6.1-rc#optional!builtin": + version: 5.6.1-rc + resolution: "typescript@patch:typescript@npm%3A5.6.1-rc#optional!builtin::version=5.6.1-rc&hash=8c6c40" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/462e0bb46c63abfc5bfc43f2bb00b9777a4228f3ed52d8930b46404dce71dbada63c27a99262ff4570b5ff7d01455701bfd36823bd3c766e443b6fa33cd31dea + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A^5.9.3#optional!builtin": version: 5.9.3 resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" @@ -28512,6 +28838,13 @@ __metadata: languageName: node linkType: hard +"unicode-emoji-modifier-base@npm:^1.0.0": + version: 1.0.0 + resolution: "unicode-emoji-modifier-base@npm:1.0.0" + checksum: 10/6e1521d35fa69493207eb8b41f8edb95985d8b3faf07c01d820a1830b5e8403e20002563e2f84683e8e962a49beccae789f0879356bf92a4ec7a4dd8e2d16fdb + languageName: node + linkType: hard + "unicode-match-property-ecmascript@npm:^2.0.0": version: 2.0.0 resolution: "unicode-match-property-ecmascript@npm:2.0.0" @@ -30427,7 +30760,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^16.2.0": +"yargs@npm:^16.0.0, yargs@npm:^16.2.0": version: 16.2.0 resolution: "yargs@npm:16.2.0" dependencies: From a561af9d1aea09859c139898df6e4eaeab1652ee Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Wed, 14 Jan 2026 13:02:03 +0000 Subject: [PATCH 02/10] adjust type generation --- packages/analytics/package.json | 9 +++++---- packages/analytics/tsconfig.types.json | 13 +++++++++++++ packages/analytics/tsup.config.ts | 16 ++++++++++++++++ packages/connect-evm/package.json | 20 ++++++++++++-------- packages/connect-evm/tsup.config.ts | 17 +++++++++++++++++ packages/connect-multichain/package.json | 12 ++++++------ packages/connect/package.json | 15 ++++++++------- packages/multichain-ui/package.json | 7 ++++--- 8 files changed, 81 insertions(+), 28 deletions(-) create mode 100644 packages/analytics/tsconfig.types.json create mode 100644 packages/analytics/tsup.config.ts diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 44a2308a..d62c984b 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -12,14 +12,15 @@ }, "repository": { "type": "git", - "url": "https://github.com/MetaMask/connect-monorepo.git" + "url": "git+https://github.com/MetaMask/connect-monorepo.git" }, "license": "MIT", "sideEffects": false, + "type": "commonjs", "exports": { ".": { "import": { - "types": "./dist/index.d.ts", + "types": "./dist/index.d.mts", "default": "./dist/index.mjs" }, "require": { @@ -37,14 +38,14 @@ ], "scripts": { "attw": "attw --pack .", - "build": "yarn clean && tsc -b --force tsconfig.build.json && npx tsup src/index.ts --format esm,cjs", + "build": "yarn clean && npx tsup && cp dist/index.d.ts dist/index.d.mts && cp dist/index.d.ts dist/index.d.cts", "build:docs": "typedoc", - "publint": "publint", "changelog:format": "../../scripts/format-changelog.sh @metamask/analytics", "changelog:update": "../../scripts/update-changelog.sh @metamask/analytics", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/analytics", "clean": "npx rimraf ./dist ./tsconfig.build.tsbuildinfo", "prepare-manifest:preview": "../../scripts/prepare-preview-manifest.sh", + "publint": "publint", "publish:preview": "yarn npm publish --tag preview", "since-latest-release": "../../scripts/since-latest-release.sh", "test": "vitest", diff --git a/packages/analytics/tsconfig.types.json b/packages/analytics/tsconfig.types.json new file mode 100644 index 00000000..dee9c4d4 --- /dev/null +++ b/packages/analytics/tsconfig.types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "module": "ES2020", + "moduleResolution": "bundler", + "composite": false + }, + "include": ["./src"], + "exclude": ["node_modules", "dist", "**/*.test.ts"] +} diff --git a/packages/analytics/tsup.config.ts b/packages/analytics/tsup.config.ts new file mode 100644 index 00000000..21848866 --- /dev/null +++ b/packages/analytics/tsup.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig([ + { + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + clean: true, + sourcemap: true, + tsconfig: './tsconfig.json', + }, + { + entry: ['src/index.ts'], + dts: { only: true }, + tsconfig: './tsconfig.types.json', + }, +]); diff --git a/packages/connect-evm/package.json b/packages/connect-evm/package.json index 6539bb24..273aea82 100644 --- a/packages/connect-evm/package.json +++ b/packages/connect-evm/package.json @@ -12,41 +12,45 @@ }, "repository": { "type": "git", - "url": "https://github.com/MetaMask/connect-monorepo.git" + "url": "git+https://github.com/MetaMask/connect-monorepo.git" }, "license": "MIT", "sideEffects": false, + "type": "commonjs", "exports": { ".": { + "browser": { + "types": "./dist/types/index.d.mts", + "import": "./dist/browser/es/connect-evm.mjs" + }, "import": { - "types": "./dist/types/index.d.ts", + "types": "./dist/types/index.d.mts", "default": "./dist/browser/es/connect-evm.mjs" }, "require": { "types": "./dist/types/index.d.ts", - "default": "./dist/browser/es/connect-evm.mjs" + "default": "./dist/node/cjs/connect-evm.js" }, - "default": "./dist/browser/es/connect-evm.mjs" + "default": "./dist/node/cjs/connect-evm.js" }, "./package.json": "./package.json" }, - "main": "./dist/browser/es/connect-evm.mjs", + "main": "./dist/node/cjs/connect-evm.js", "module": "./dist/browser/es/connect-evm.mjs", - "browser": "./dist/browser/es/connect-evm.mjs", "types": "./dist/types/index.d.ts", "files": [ "dist/" ], "scripts": { "attw": "attw --pack .", - "build": "yarn tsup ", + "build": "yarn tsup && cp dist/types/index.d.ts dist/types/index.d.mts && cp dist/types/index.d.ts dist/types/index.d.cts", "build:docs": "typedoc", - "publint": "publint", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-evm", "changelog:update": "../../scripts/update-changelog.sh @metamask/connect-evm", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/connect-evm", "clean": "npx rimraf ./dist", "dev": "tsup --watch ", + "publint": "publint", "publish:preview": "yarn npm publish --tag preview", "since-latest-release": "../../scripts/since-latest-release.sh", "test": "vitest run", diff --git a/packages/connect-evm/tsup.config.ts b/packages/connect-evm/tsup.config.ts index f84398fb..9a91b193 100644 --- a/packages/connect-evm/tsup.config.ts +++ b/packages/connect-evm/tsup.config.ts @@ -25,6 +25,23 @@ export default defineConfig([ o.outExtension = { '.js': '.mjs' }; }, }, + { + entry: { [entryName]: 'src/index.ts' }, + outDir: 'dist/node/cjs', + format: 'cjs', + platform: 'node', + bundle: true, + splitting: false, + sourcemap: true, + external, + tsconfig: './tsconfig.json', + esbuildOptions: (o) => { + o.platform = 'node'; + o.mainFields = ['module', 'main']; + o.conditions = ['node']; + o.outExtension = { '.js': '.js' }; + }, + }, { entry: { index: 'src/index.ts' }, outDir: 'dist/types', diff --git a/packages/connect-multichain/package.json b/packages/connect-multichain/package.json index 1a934c8c..51dec3d1 100644 --- a/packages/connect-multichain/package.json +++ b/packages/connect-multichain/package.json @@ -12,22 +12,23 @@ }, "repository": { "type": "git", - "url": "https://github.com/MetaMask/connect-monorepo.git" + "url": "git+https://github.com/MetaMask/connect-monorepo.git" }, "license": "MIT", "sideEffects": false, + "type": "commonjs", "exports": { ".": { "browser": { - "types": "./dist/types/connect-multichain.d.ts", + "types": "./dist/browser/es/connect-multichain.d.mts", "import": "./dist/browser/es/connect-multichain.mjs" }, "react-native": { - "types": "./dist/types/connect-multichain.d.ts", + "types": "./dist/react-native/es/connect-multichain.d.mts", "import": "./dist/react-native/es/connect-multichain.mjs" }, "import": { - "types": "./dist/types/connect-multichain.d.ts", + "types": "./dist/node/es/connect-multichain.d.mts", "default": "./dist/node/es/connect-multichain.mjs" }, "require": { @@ -40,7 +41,6 @@ }, "main": "./dist/node/cjs/connect-multichain.js", "module": "./dist/browser/es/connect-multichain.mjs", - "browser": "./dist/browser/es/connect-multichain.mjs", "react-native": "./dist/react-native/es/connect-multichain.mjs", "types": "./dist/types/connect-multichain.d.ts", "files": [ @@ -50,13 +50,13 @@ "attw": "attw --pack .", "build": "yarn clean && tsc -b tsconfig.build.json && npx tsup", "build:docs": "typedoc", - "publint": "publint", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-multichain", "changelog:update": "../../scripts/update-changelog.sh @metamask/connect-multichain", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/connect-multichain", "clean": "npx rimraf ./dist", "dev": "tsup --watch", "prepare-manifest:preview": "../../scripts/prepare-preview-manifest.sh", + "publint": "publint", "publish:preview": "yarn npm publish --tag preview", "since-latest-release": "../../scripts/since-latest-release.sh", "pretest": "yarn workspace @metamask/analytics run build && yarn workspace @metamask/multichain-ui run build", diff --git a/packages/connect/package.json b/packages/connect/package.json index 58eb0a2a..9b68eb2b 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -12,22 +12,23 @@ }, "repository": { "type": "git", - "url": "https://github.com/MetaMask/connect-monorepo.git" + "url": "git+https://github.com/MetaMask/connect-monorepo.git" }, "license": "MIT", "sideEffects": false, + "type": "commonjs", "exports": { ".": { "browser": { - "types": "./dist/multichain/index.d.ts", + "types": "./dist/multichain/index.d.mts", "import": "./dist/multichain/index.mjs" }, "react-native": { - "types": "./dist/multichain/index.d.ts", + "types": "./dist/multichain/index.d.mts", "import": "./dist/multichain/index.mjs" }, "import": { - "types": "./dist/multichain/index.d.ts", + "types": "./dist/multichain/index.d.mts", "default": "./dist/multichain/index.mjs" }, "require": { @@ -38,7 +39,7 @@ }, "./evm": { "import": { - "types": "./dist/evm/index.d.ts", + "types": "./dist/evm/index.d.mts", "default": "./dist/evm/index.mjs" }, "require": { @@ -57,14 +58,14 @@ ], "scripts": { "attw": "attw --pack .", - "build": "yarn clean && tsc -b --force tsconfig.build.json && npx tsup src/index.ts src/multichain/index.ts src/evm/index.ts --format esm,cjs --external @metamask/connect-multichain --external @metamask/connect-evm", + "build": "yarn clean && tsc -b --force tsconfig.build.json && npx tsup src/index.ts src/multichain/index.ts src/evm/index.ts --format esm,cjs --external @metamask/connect-multichain --external @metamask/connect-evm && cp dist/multichain/index.d.ts dist/multichain/index.d.mts && cp dist/multichain/index.d.ts dist/multichain/index.d.cts && cp dist/evm/index.d.ts dist/evm/index.d.mts && cp dist/evm/index.d.ts dist/evm/index.d.cts", "build:docs": "typedoc", - "publint": "publint", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect", "changelog:update": "../../scripts/update-changelog.sh @metamask/connect", "changelog:validate": "../../scripts/validate-changelog.sh @metamask/connect", "clean": "npx rimraf ./dist ./tsconfig.build.tsbuildinfo", "prepare-manifest:preview": "../../scripts/prepare-preview-manifest.sh", + "publint": "publint", "publish:preview": "yarn npm publish --tag preview", "since-latest-release": "../../scripts/since-latest-release.sh", "test": "echo \"No test specified\"", diff --git a/packages/multichain-ui/package.json b/packages/multichain-ui/package.json index 83b3841f..5846fc87 100644 --- a/packages/multichain-ui/package.json +++ b/packages/multichain-ui/package.json @@ -12,19 +12,20 @@ }, "repository": { "type": "git", - "url": "https://github.com/MetaMask/connect-monorepo.git" + "url": "git+https://github.com/MetaMask/connect-monorepo.git" }, + "type": "commonjs", "license": "MIT", "sideEffects": false, "exports": { ".": { "import": { "types": "./dist/types/index.d.ts", - "default": "./dist/index.mjs" + "default": "./dist/index.js" }, "require": { "types": "./dist/types/index.d.ts", - "default": "./dist/index.cjs" + "default": "./dist/index.cjs.js" } }, "./loader": { From d105ea56e76ef8305729aedf1f83f9f5a6a17dc5 Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Wed, 14 Jan 2026 16:07:57 +0000 Subject: [PATCH 03/10] revert build changes --- package.json | 2 +- packages/analytics/package.json | 4 ++-- packages/connect-evm/package.json | 6 +++--- packages/connect-multichain/package.json | 6 +++--- packages/connect/package.json | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index b7c0606a..cf7aa07e 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "lint:exports": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run publint", "lint:fix": "yarn lint:eslint --fix && echo && yarn lint:misc --write && yarn constraints --fix && yarn lint:dependencies:fix", "lint:misc": "prettier --no-error-on-unmatched-pattern '**/*.json' '**/*.md' '**/*.yml' '!.yarnrc.yml' '!merged-packages/**' --ignore-path .gitignore", - "lint:package-config": "yarn lint:exports && yarn lint:types", + "lint:package-config": "yarn lint:exports; yarn lint:types", "lint:types": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run attw", "prepare-preview-builds": "./scripts/prepare-preview-builds.sh", "publish-previews": "yarn workspaces foreach --all --no-private --parallel --verbose run publish:preview", diff --git a/packages/analytics/package.json b/packages/analytics/package.json index d62c984b..1e76e81a 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -20,7 +20,7 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.mts", + "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }, "require": { @@ -38,7 +38,7 @@ ], "scripts": { "attw": "attw --pack .", - "build": "yarn clean && npx tsup && cp dist/index.d.ts dist/index.d.mts && cp dist/index.d.ts dist/index.d.cts", + "build": "yarn clean && npx tsup", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/analytics", "changelog:update": "../../scripts/update-changelog.sh @metamask/analytics", diff --git a/packages/connect-evm/package.json b/packages/connect-evm/package.json index 273aea82..9bd73026 100644 --- a/packages/connect-evm/package.json +++ b/packages/connect-evm/package.json @@ -20,11 +20,11 @@ "exports": { ".": { "browser": { - "types": "./dist/types/index.d.mts", + "types": "./dist/types/index.d.ts", "import": "./dist/browser/es/connect-evm.mjs" }, "import": { - "types": "./dist/types/index.d.mts", + "types": "./dist/types/index.d.ts", "default": "./dist/browser/es/connect-evm.mjs" }, "require": { @@ -43,7 +43,7 @@ ], "scripts": { "attw": "attw --pack .", - "build": "yarn tsup && cp dist/types/index.d.ts dist/types/index.d.mts && cp dist/types/index.d.ts dist/types/index.d.cts", + "build": "yarn tsup", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-evm", "changelog:update": "../../scripts/update-changelog.sh @metamask/connect-evm", diff --git a/packages/connect-multichain/package.json b/packages/connect-multichain/package.json index 51dec3d1..9496883a 100644 --- a/packages/connect-multichain/package.json +++ b/packages/connect-multichain/package.json @@ -20,15 +20,15 @@ "exports": { ".": { "browser": { - "types": "./dist/browser/es/connect-multichain.d.mts", + "types": "./dist/types/connect-multichain.d.ts", "import": "./dist/browser/es/connect-multichain.mjs" }, "react-native": { - "types": "./dist/react-native/es/connect-multichain.d.mts", + "types": "./dist/types/connect-multichain.d.ts", "import": "./dist/react-native/es/connect-multichain.mjs" }, "import": { - "types": "./dist/node/es/connect-multichain.d.mts", + "types": "./dist/types/connect-multichain.d.ts", "default": "./dist/node/es/connect-multichain.mjs" }, "require": { diff --git a/packages/connect/package.json b/packages/connect/package.json index 9b68eb2b..3df68da9 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -20,15 +20,15 @@ "exports": { ".": { "browser": { - "types": "./dist/multichain/index.d.mts", + "types": "./dist/multichain/index.d.ts", "import": "./dist/multichain/index.mjs" }, "react-native": { - "types": "./dist/multichain/index.d.mts", + "types": "./dist/multichain/index.d.ts", "import": "./dist/multichain/index.mjs" }, "import": { - "types": "./dist/multichain/index.d.mts", + "types": "./dist/multichain/index.d.ts", "default": "./dist/multichain/index.mjs" }, "require": { @@ -39,7 +39,7 @@ }, "./evm": { "import": { - "types": "./dist/evm/index.d.mts", + "types": "./dist/evm/index.d.ts", "default": "./dist/evm/index.mjs" }, "require": { @@ -50,15 +50,15 @@ }, "./package.json": "./package.json" }, - "main": "./dist/index.js", - "module": "./dist/index.mjs", - "types": "./dist/index.d.ts", + "main": "./dist/multichain/index.js", + "module": "./dist/multichain/index.mjs", + "types": "./dist/multichain/index.d.ts", "files": [ "dist/" ], "scripts": { "attw": "attw --pack .", - "build": "yarn clean && tsc -b --force tsconfig.build.json && npx tsup src/index.ts src/multichain/index.ts src/evm/index.ts --format esm,cjs --external @metamask/connect-multichain --external @metamask/connect-evm && cp dist/multichain/index.d.ts dist/multichain/index.d.mts && cp dist/multichain/index.d.ts dist/multichain/index.d.cts && cp dist/evm/index.d.ts dist/evm/index.d.mts && cp dist/evm/index.d.ts dist/evm/index.d.cts", + "build": "yarn clean && tsc -b --force tsconfig.build.json && npx tsup src/index.ts src/multichain/index.ts src/evm/index.ts --format esm,cjs --external @metamask/connect-multichain --external @metamask/connect-evm", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect", "changelog:update": "../../scripts/update-changelog.sh @metamask/connect", From 311880daf1b68b280e6af6f3c881271a30ec5f2d Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Thu, 5 Feb 2026 15:47:32 +0000 Subject: [PATCH 04/10] add package linting to solana --- packages/connect-solana/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/connect-solana/package.json b/packages/connect-solana/package.json index 1cc7a8a9..4fac6a59 100644 --- a/packages/connect-solana/package.json +++ b/packages/connect-solana/package.json @@ -38,6 +38,7 @@ "dist/" ], "scripts": { + "attw": "attw --pack .", "build": "yarn tsup", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-solana", @@ -45,6 +46,7 @@ "changelog:validate": "../../scripts/validate-changelog.sh @metamask/connect-solana", "clean": "npx rimraf ./dist", "dev": "tsup --watch", + "publint": "publint", "publish:preview": "yarn npm publish --tag preview", "since-latest-release": "../../scripts/since-latest-release.sh", "test": "vitest run", From 61e145a74fc152068086d0706a9803dcb2c49f62 Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Thu, 5 Feb 2026 19:23:23 +0000 Subject: [PATCH 05/10] ignore benign rules and add explanation doc --- docs/package-lint-ignored-rules.md | 327 +++++++++++++++++++++++ packages/analytics/package.json | 2 +- packages/connect-evm/package.json | 2 +- packages/connect-multichain/package.json | 2 +- packages/connect-solana/package.json | 10 +- packages/connect/package.json | 2 +- packages/multichain-ui/package.json | 2 +- 7 files changed, 337 insertions(+), 10 deletions(-) create mode 100644 docs/package-lint-ignored-rules.md diff --git a/docs/package-lint-ignored-rules.md b/docs/package-lint-ignored-rules.md new file mode 100644 index 00000000..7aebc4df --- /dev/null +++ b/docs/package-lint-ignored-rules.md @@ -0,0 +1,327 @@ +# Package Lint Ignored Rules + +This document explains the `yarn lint:package-config` warnings and why certain rules are ignored in the `attw` (Are The Types Wrong) configuration. + +## Overview + +The `yarn lint:package-config` command runs two tools: + +- **publint**: Validates package.json configuration for npm publishing +- **attw**: Checks TypeScript type declarations for module resolution issues + +All packages now pass exit code 0, but some warnings remain. These warnings are intentionally ignored because they represent edge cases that don't affect real-world usage. + +--- + +## Ignored Rules Configuration + +Each package's `attw` script includes `--ignore-rules` to skip expected warnings: + +| Package | Ignored Rules | +| ------------------------------ | -------------------------------------------------------- | +| `@metamask/analytics` | `false-cjs`, `no-resolution` | +| `@metamask/connect` | `false-cjs`, `no-resolution` | +| `@metamask/connect-evm` | `false-cjs`, `no-resolution` | +| `@metamask/connect-multichain` | `false-cjs`, `no-resolution` | +| `@metamask/connect-solana` | `false-cjs`, `no-resolution`, `cjs-resolves-to-esm` | +| `@metamask/multichain-ui` | `false-cjs`, `no-resolution`, `unexpected-module-syntax` | + +--- + +## Rule Explanations + +### 1. `false-cjs` (Masquerading as CJS) + +**What it means:** + +The `.d.ts` type declaration files are interpreted as CommonJS by TypeScript when using `moduleResolution: "node16"` or `"nodenext"`, even though the corresponding `.mjs` JavaScript files are ESM. This creates a theoretical mismatch between the module format of types and runtime code. + +**Example warning:** + +``` +pkg.exports["."].import.types types is interpreted as CJS when resolving +with the "import" condition. Consider using the .mts extension. +``` + +**Why it's acceptable:** + +1. **Bundler environments (99% of consumers):** Webpack, Vite, esbuild, Rollup, and other bundlers don't care about this distinction. They resolve types and code independently and handle the interop correctly. + +2. **Real-world impact is minimal:** This issue only manifests when ALL of these conditions are met simultaneously: + - Running in Node.js directly (not through a bundler like webpack/vite/esbuild) + - Using `moduleResolution: "node16"` or `"nodenext"` in tsconfig (stricter than the common `"bundler"` setting) + - TypeScript then interprets the `.d.ts` types as CJS while the `.mjs` runtime is ESM + + Most real-world consumers use bundlers, which handle module interop seamlessly regardless of file extensions. + +3. **The fix is complex:** Properly fixing this requires: + - Generating separate `.d.mts` (ESM types) and `.d.cts` (CJS types) files + - Restructuring package.json exports with separate type conditions + - Updating build tooling (tsup/TypeScript configuration) + - This significantly increases build complexity for marginal benefit + +4. **Industry standard:** Many popular packages (React, Vue, Angular, Lodash) have this same "issue" and function perfectly in practice. + +**Technical details:** + +The issue arises because TypeScript determines module format from file extension: + +- `.d.ts` → interpreted as CJS types +- `.d.mts` → interpreted as ESM types +- `.d.cts` → interpreted as CJS types + +When you have `.d.ts` files paired with `.mjs` runtime files, TypeScript sees a format mismatch in strict module resolution modes. + +--- + +### 2. `no-resolution` (Resolution Failed for node10) + +**What it means:** + +When using Node.js 10's legacy module resolution algorithm, the package's subpath exports (like `@metamask/connect/evm`) can't be resolved. + +**Example warning:** + +``` +Resolution failed for "@metamask/connect/evm" in node10 mode +``` + +**Why it's acceptable:** + +1. **Node 10 reached End-of-Life on April 30, 2021** - over 4 years ago. Security updates stopped, and it's no longer maintained. + +2. **Node 10 doesn't support subpath exports** in `package.json` - this is a fundamental limitation of that Node version, not a bug in the package. The `exports` field was introduced in Node 12.7.0. + +3. **The monorepo requires Node 20.19.0+** as specified in `engines.node`, so Node 10 was never a supported runtime. + +4. **No modern tooling targets Node 10:** + - TypeScript 5.x requires Node 14.17+ + - All current bundlers work with modern resolution algorithms + - npm 7+ (which uses Node 10+) understands exports + +5. **Backward compatibility is impossible:** Supporting Node 10 would require removing the `exports` field entirely, which would break modern module resolution for all current consumers. + +--- + +### 3. `cjs-resolves-to-esm` (CJS Resolves to ESM) + +**What it means:** + +When a CommonJS file tries to `require('@metamask/connect-solana')`, it resolves to an ESM file (`.mjs`), which will throw an error in Node.js because synchronous `require()` can't load ESM modules. + +**Example warning:** + +``` +A require call resolved to an ESM JavaScript file, which is an error in Node +and some bundlers. CommonJS consumers will need to use a dynamic import. +``` + +**Why it's acceptable for `@metamask/connect-solana`:** + +1. **Intentionally built as browser-only:** The tsup configuration explicitly targets browsers: + + ```typescript + // tsup.config.ts + { + outDir: 'dist/browser/es', // Browser-specific output path + platform: 'browser', // Explicitly browser platform + esbuildOptions: (options) => { + options.platform = 'browser'; + options.mainFields = ['browser', 'module', 'main']; + options.conditions = ['browser']; + }, + } + ``` + +2. **Wallet connection is a browser use case:** The package provides MetaMask wallet connectivity for Solana using the [Wallet Standard](https://github.com/wallet-standard/wallet-standard) - an API designed for browser extensions and web applications. There is no server-side use case for connecting to a browser wallet extension. + +3. **Dependencies support CJS, but that's irrelevant here:** While the dependencies (`@solana/web3.js`, `@wallet-standard/base`, `@metamask/solana-wallet-standard`) do support CJS, this package itself is only useful in browser contexts where wallet extensions exist. + +4. **CJS consumers can use dynamic import:** If an unusual use case emerges, CJS consumers can still use: + + ```javascript + // Instead of: const solana = require('@metamask/connect-solana'); + const solana = await import('@metamask/connect-solana'); + ``` + +5. **Avoids unnecessary build complexity:** Adding a CJS build for a non-existent use case increases: + - Build time + - Bundle size (shipping both formats) + - Maintenance burden + - Potential for bugs in the rarely-tested CJS path + +**How to fix (if needed):** + +If CJS support becomes necessary, update `tsup.config.ts`: + +```typescript +export default defineConfig([ + // Existing ESM build + { + entry: { [entryName]: 'src/index.ts' }, + outDir: 'dist/browser/es', + format: 'esm', + // ... rest of config + }, + // Add CJS build + { + entry: { [entryName]: 'src/index.ts' }, + outDir: 'dist/node/cjs', + format: 'cjs', + platform: 'node', + bundle: true, + splitting: false, + sourcemap: true, + external, + tsconfig: './tsconfig.json', + esbuildOptions: (o) => { + o.platform = 'node'; + o.mainFields = ['module', 'main']; + o.conditions = ['node']; + o.outExtension = { '.js': '.js' }; + }, + }, + // Existing types build + // ... +]); +``` + +Then update `package.json`: + +```json +"exports": { + ".": { + "import": { + "types": "./dist/types/index.d.ts", + "default": "./dist/browser/es/connect-solana.mjs" + }, + "require": { + "types": "./dist/types/index.d.ts", + "default": "./dist/node/cjs/connect-solana.js" + }, + "default": { + "types": "./dist/types/index.d.ts", + "default": "./dist/node/cjs/connect-solana.js" + } + } +} +``` + +--- + +### 4. `unexpected-module-syntax` (Unexpected Module Syntax) + +**What it means:** + +The JavaScript files contain ESM syntax (`import`/`export`) but are interpreted as CJS because the `package.json` has `"type": "commonjs"` and the files use `.js` extension instead of `.mjs`. + +**Example warning:** + +``` +Syntax detected in the module is incompatible with the module kind according +to the package.json or file extension. +``` + +**Why it's acceptable for `@metamask/multichain-ui`:** + +1. **Stencil tooling limitation:** multichain-ui is built with Stencil (a web components compiler), which outputs ESM code with `.js` extensions by design. This is how Stencil's build system works. + +2. **Bundlers handle it correctly:** When consumed through a bundler (which is how web components are typically used), the bundler: + - Reads the actual module syntax in the file + - Ignores the file extension + - Handles it appropriately as ESM + +3. **Changing would break Stencil:** Modifying Stencil's output format would require: + - Forking or heavily customizing Stencil + - Maintaining custom build scripts + - Potential breakage on Stencil updates + +4. **Web components are browser-only:** Like connect-solana, this package is consumed in browser environments where: + - Bundlers are universal + - Native ESM works correctly + - The file extension is irrelevant + +5. **Node.js consumption is not intended:** If someone tries to use this in Node.js directly (without a bundler), they would encounter issues, but that's not a supported use case for a web components library. + +--- + +## Remaining publint Warnings + +These warnings appear in publint output but don't cause failures: + +### TypeScript Declaration Files Interpreted as CJS + +Same as the `false-cjs` rule above. publint warns about this, but it's safe to ignore for the same reasons. + +### `pkg.browser` Field Suggestion (connect-solana) + +**Warning:** + +``` +pkg.browser with a string value can be refactored to use pkg.exports +and the "browser" condition +``` + +**Why it's acceptable:** + +- The current setup works correctly +- Changing would be a breaking change for consumers +- The `exports` field already provides browser support via the `"import"` condition +- The `browser` field provides backward compatibility for older tooling + +--- + +## Summary Table + +| Rule | Issue | Impact | Why Ignore | Affected Packages | +| -------------------------- | ---------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------ | ----------------- | +| `false-cjs` | Types interpreted as CJS for ESM imports | Theoretical type ambiguity in strict Node.js ESM | Bundlers handle correctly; fix is complex; industry standard | All packages | +| `no-resolution` | Subpaths fail on Node 10 | None | Node 10 is EOL (2021); never supported | All packages | +| `cjs-resolves-to-esm` | `require()` fails for ESM files | CJS consumers can't use sync require | Browser-only wallet connection library; no server use case; dynamic import available | connect-solana | +| `unexpected-module-syntax` | ESM syntax in CJS-typed files | Node.js would reject if run directly | Stencil limitation; bundlers work fine; browser-only | multichain-ui | + +--- + +## Testing the Configuration + +To verify the lint configuration passes: + +```bash +# Run the full package config lint +yarn lint:package-config + +# Run just publint on a specific package +yarn workspace @metamask/connect-solana publint + +# Run just attw on a specific package +yarn workspace @metamask/connect-solana attw +``` + +Expected output: + +- Exit code: 0 (success) +- publint: Warnings only (no errors) +- attw: "No problems found 🌟" (with ignored rules noted) + +--- + +## When to Revisit These Decisions + +Consider addressing these warnings if: + +1. **`false-cjs`**: TypeScript makes `.d.mts` generation significantly easier, or a major consumer reports actual issues (not theoretical ones) + +2. **`no-resolution`**: Never - Node 10 will never be supported + +3. **`cjs-resolves-to-esm`**: A legitimate Node.js CJS use case emerges for connect-solana (unlikely given Solana's browser focus) + +4. **`unexpected-module-syntax`**: Stencil changes its output format, or the package needs Node.js compatibility + +--- + +## References + +- [Are The Types Wrong documentation](https://github.com/arethetypeswrong/arethetypeswrong.github.io) +- [publint documentation](https://publint.dev/) +- [Node.js Package Entry Points](https://nodejs.org/api/packages.html#package-entry-points) +- [TypeScript Module Resolution](https://www.typescriptlang.org/docs/handbook/module-resolution.html) diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 1e76e81a..25604a9d 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -37,7 +37,7 @@ "dist/" ], "scripts": { - "attw": "attw --pack .", + "attw": "attw --pack . --ignore-rules false-cjs no-resolution", "build": "yarn clean && npx tsup", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/analytics", diff --git a/packages/connect-evm/package.json b/packages/connect-evm/package.json index c426b009..f9b09a97 100644 --- a/packages/connect-evm/package.json +++ b/packages/connect-evm/package.json @@ -42,7 +42,7 @@ "dist/" ], "scripts": { - "attw": "attw --pack .", + "attw": "attw --pack . --ignore-rules false-cjs no-resolution", "build": "yarn tsup", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-evm", diff --git a/packages/connect-multichain/package.json b/packages/connect-multichain/package.json index 63b00460..e26e53f5 100644 --- a/packages/connect-multichain/package.json +++ b/packages/connect-multichain/package.json @@ -51,7 +51,7 @@ ], "scripts": { "allow-scripts": "", - "attw": "attw --pack .", + "attw": "attw --pack . --ignore-rules false-cjs no-resolution", "build": "yarn clean && tsc -b tsconfig.build.json && npx tsup", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-multichain", diff --git a/packages/connect-solana/package.json b/packages/connect-solana/package.json index 4fac6a59..ece4acdc 100644 --- a/packages/connect-solana/package.json +++ b/packages/connect-solana/package.json @@ -12,21 +12,21 @@ }, "repository": { "type": "git", - "url": "https://github.com/MetaMask/connect-monorepo.git" + "url": "git+https://github.com/MetaMask/connect-monorepo.git" }, "license": "MIT", "sideEffects": false, + "type": "commonjs", "exports": { ".": { "import": { "types": "./dist/types/index.d.ts", "default": "./dist/browser/es/connect-solana.mjs" }, - "require": { + "default": { "types": "./dist/types/index.d.ts", "default": "./dist/browser/es/connect-solana.mjs" - }, - "default": "./dist/browser/es/connect-solana.mjs" + } }, "./package.json": "./package.json" }, @@ -38,7 +38,7 @@ "dist/" ], "scripts": { - "attw": "attw --pack .", + "attw": "attw --pack . --ignore-rules false-cjs no-resolution cjs-resolves-to-esm", "build": "yarn tsup", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-solana", diff --git a/packages/connect/package.json b/packages/connect/package.json index 3df68da9..eab3647e 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -57,7 +57,7 @@ "dist/" ], "scripts": { - "attw": "attw --pack .", + "attw": "attw --pack . --ignore-rules false-cjs no-resolution", "build": "yarn clean && tsc -b --force tsconfig.build.json && npx tsup src/index.ts src/multichain/index.ts src/evm/index.ts --format esm,cjs --external @metamask/connect-multichain --external @metamask/connect-evm", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect", diff --git a/packages/multichain-ui/package.json b/packages/multichain-ui/package.json index 5846fc87..91cf3480 100644 --- a/packages/multichain-ui/package.json +++ b/packages/multichain-ui/package.json @@ -48,7 +48,7 @@ ], "collection": "dist/collection/collection-manifest.json", "scripts": { - "attw": "attw --pack .", + "attw": "attw --pack . --ignore-rules false-cjs no-resolution unexpected-module-syntax", "build:docs": "typedoc", "build:types": "tsc --project tsconfig.json --emitDeclarationOnly --outDir dist/types", "publint": "publint", From a6831a84e376ecd3c3c90984124a786f8a725958 Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Thu, 5 Feb 2026 19:50:29 +0000 Subject: [PATCH 06/10] update constraints --- yarn.config.cjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yarn.config.cjs b/yarn.config.cjs index b06db612..bdab65ee 100644 --- a/yarn.config.cjs +++ b/yarn.config.cjs @@ -53,7 +53,10 @@ module.exports = defineConfig({ for (const workspace of Yarn.workspaces()) { // We skip playground and integration checks, as these are not user facing packages - if (workspace.cwd.includes('playground') || workspace.cwd.includes('integrations')) { + if ( + workspace.cwd.includes('playground') || + workspace.cwd.includes('integrations') + ) { continue; } const workspaceBasename = getWorkspaceBasename(workspace); @@ -101,7 +104,7 @@ module.exports = defineConfig({ expectWorkspaceField( workspace, 'repository.url', - `${repositoryUri}.git`, + `git+${repositoryUri}.git`, ); // All non-root packages must have a license, defaulting to MIT. From 87110997c2bc88c121399fd5ba4b10cb597c73af Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Thu, 5 Feb 2026 20:00:37 +0000 Subject: [PATCH 07/10] revert multichain-ui package change --- packages/multichain-ui/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/multichain-ui/package.json b/packages/multichain-ui/package.json index 91cf3480..b48af0f2 100644 --- a/packages/multichain-ui/package.json +++ b/packages/multichain-ui/package.json @@ -14,7 +14,6 @@ "type": "git", "url": "git+https://github.com/MetaMask/connect-monorepo.git" }, - "type": "commonjs", "license": "MIT", "sideEffects": false, "exports": { From b6aa35478390fc5814e223fff0d30e0bd3f27478 Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Thu, 5 Feb 2026 20:02:28 +0000 Subject: [PATCH 08/10] fix linting issue on connect-evm tsup.config --- packages/connect-evm/tsup.config.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/connect-evm/tsup.config.ts b/packages/connect-evm/tsup.config.ts index a5d2a5a7..55f2bcf3 100644 --- a/packages/connect-evm/tsup.config.ts +++ b/packages/connect-evm/tsup.config.ts @@ -42,11 +42,11 @@ export default defineConfig([ sourcemap: true, external, tsconfig: './tsconfig.json', - esbuildOptions: (o) => { - o.platform = 'node'; - o.mainFields = ['module', 'main']; - o.conditions = ['node']; - o.outExtension = { '.js': '.js' }; + esbuildOptions: (options) => { + options.platform = 'node'; + options.mainFields = ['module', 'main']; + options.conditions = ['node']; + options.outExtension = { '.js': '.js' }; }, }, { From 7af8cdaaaded09015a12081d91baca5410eef031 Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Fri, 6 Feb 2026 15:01:36 +0000 Subject: [PATCH 09/10] remove ignored cjs rule for solana --- docs/package-lint-ignored-rules.md | 129 +--------- packages/connect-solana/package.json | 2 +- yarn.lock | 343 ++++++++++++++++++++++++++- 3 files changed, 349 insertions(+), 125 deletions(-) diff --git a/docs/package-lint-ignored-rules.md b/docs/package-lint-ignored-rules.md index 7aebc4df..128744dc 100644 --- a/docs/package-lint-ignored-rules.md +++ b/docs/package-lint-ignored-rules.md @@ -1,4 +1,4 @@ -# Package Lint Ignored Rules +# Package Configuration Lint Analysis This document explains the `yarn lint:package-config` warnings and why certain rules are ignored in the `attw` (Are The Types Wrong) configuration. @@ -23,7 +23,7 @@ Each package's `attw` script includes `--ignore-rules` to skip expected warnings | `@metamask/connect` | `false-cjs`, `no-resolution` | | `@metamask/connect-evm` | `false-cjs`, `no-resolution` | | `@metamask/connect-multichain` | `false-cjs`, `no-resolution` | -| `@metamask/connect-solana` | `false-cjs`, `no-resolution`, `cjs-resolves-to-esm` | +| `@metamask/connect-solana` | `false-cjs`, `no-resolution` | | `@metamask/multichain-ui` | `false-cjs`, `no-resolution`, `unexpected-module-syntax` | --- @@ -51,7 +51,7 @@ with the "import" condition. Consider using the .mts extension. - Running in Node.js directly (not through a bundler like webpack/vite/esbuild) - Using `moduleResolution: "node16"` or `"nodenext"` in tsconfig (stricter than the common `"bundler"` setting) - TypeScript then interprets the `.d.ts` types as CJS while the `.mjs` runtime is ESM - + Most real-world consumers use bundlers, which handle module interop seamlessly regardless of file extensions. 3. **The fix is complex:** Properly fixing this requires: @@ -103,113 +103,7 @@ Resolution failed for "@metamask/connect/evm" in node10 mode --- -### 3. `cjs-resolves-to-esm` (CJS Resolves to ESM) - -**What it means:** - -When a CommonJS file tries to `require('@metamask/connect-solana')`, it resolves to an ESM file (`.mjs`), which will throw an error in Node.js because synchronous `require()` can't load ESM modules. - -**Example warning:** - -``` -A require call resolved to an ESM JavaScript file, which is an error in Node -and some bundlers. CommonJS consumers will need to use a dynamic import. -``` - -**Why it's acceptable for `@metamask/connect-solana`:** - -1. **Intentionally built as browser-only:** The tsup configuration explicitly targets browsers: - - ```typescript - // tsup.config.ts - { - outDir: 'dist/browser/es', // Browser-specific output path - platform: 'browser', // Explicitly browser platform - esbuildOptions: (options) => { - options.platform = 'browser'; - options.mainFields = ['browser', 'module', 'main']; - options.conditions = ['browser']; - }, - } - ``` - -2. **Wallet connection is a browser use case:** The package provides MetaMask wallet connectivity for Solana using the [Wallet Standard](https://github.com/wallet-standard/wallet-standard) - an API designed for browser extensions and web applications. There is no server-side use case for connecting to a browser wallet extension. - -3. **Dependencies support CJS, but that's irrelevant here:** While the dependencies (`@solana/web3.js`, `@wallet-standard/base`, `@metamask/solana-wallet-standard`) do support CJS, this package itself is only useful in browser contexts where wallet extensions exist. - -4. **CJS consumers can use dynamic import:** If an unusual use case emerges, CJS consumers can still use: - - ```javascript - // Instead of: const solana = require('@metamask/connect-solana'); - const solana = await import('@metamask/connect-solana'); - ``` - -5. **Avoids unnecessary build complexity:** Adding a CJS build for a non-existent use case increases: - - Build time - - Bundle size (shipping both formats) - - Maintenance burden - - Potential for bugs in the rarely-tested CJS path - -**How to fix (if needed):** - -If CJS support becomes necessary, update `tsup.config.ts`: - -```typescript -export default defineConfig([ - // Existing ESM build - { - entry: { [entryName]: 'src/index.ts' }, - outDir: 'dist/browser/es', - format: 'esm', - // ... rest of config - }, - // Add CJS build - { - entry: { [entryName]: 'src/index.ts' }, - outDir: 'dist/node/cjs', - format: 'cjs', - platform: 'node', - bundle: true, - splitting: false, - sourcemap: true, - external, - tsconfig: './tsconfig.json', - esbuildOptions: (o) => { - o.platform = 'node'; - o.mainFields = ['module', 'main']; - o.conditions = ['node']; - o.outExtension = { '.js': '.js' }; - }, - }, - // Existing types build - // ... -]); -``` - -Then update `package.json`: - -```json -"exports": { - ".": { - "import": { - "types": "./dist/types/index.d.ts", - "default": "./dist/browser/es/connect-solana.mjs" - }, - "require": { - "types": "./dist/types/index.d.ts", - "default": "./dist/node/cjs/connect-solana.js" - }, - "default": { - "types": "./dist/types/index.d.ts", - "default": "./dist/node/cjs/connect-solana.js" - } - } -} -``` - ---- - -### 4. `unexpected-module-syntax` (Unexpected Module Syntax) +### 3. `unexpected-module-syntax` (Unexpected Module Syntax) **What it means:** @@ -273,12 +167,11 @@ and the "browser" condition ## Summary Table -| Rule | Issue | Impact | Why Ignore | Affected Packages | -| -------------------------- | ---------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------ | ----------------- | -| `false-cjs` | Types interpreted as CJS for ESM imports | Theoretical type ambiguity in strict Node.js ESM | Bundlers handle correctly; fix is complex; industry standard | All packages | -| `no-resolution` | Subpaths fail on Node 10 | None | Node 10 is EOL (2021); never supported | All packages | -| `cjs-resolves-to-esm` | `require()` fails for ESM files | CJS consumers can't use sync require | Browser-only wallet connection library; no server use case; dynamic import available | connect-solana | -| `unexpected-module-syntax` | ESM syntax in CJS-typed files | Node.js would reject if run directly | Stencil limitation; bundlers work fine; browser-only | multichain-ui | +| Rule | Issue | Impact | Why Ignore | Affected Packages | +| -------------------------- | ---------------------------------------- | ------------------------------------------------ | ---------------------------------------------------- | ----------------- | +| `false-cjs` | Types interpreted as CJS for ESM imports | Theoretical type ambiguity in strict Node.js ESM | Bundlers handle correctly; fix is complex; industry standard | All packages | +| `no-resolution` | Subpaths fail on Node 10 | None | Node 10 is EOL (2021); never supported | All packages | +| `unexpected-module-syntax` | ESM syntax in CJS-typed files | Node.js would reject if run directly | Stencil limitation; bundlers work fine; browser-only | multichain-ui | --- @@ -313,9 +206,7 @@ Consider addressing these warnings if: 2. **`no-resolution`**: Never - Node 10 will never be supported -3. **`cjs-resolves-to-esm`**: A legitimate Node.js CJS use case emerges for connect-solana (unlikely given Solana's browser focus) - -4. **`unexpected-module-syntax`**: Stencil changes its output format, or the package needs Node.js compatibility +3. **`unexpected-module-syntax`**: Stencil changes its output format, or the package needs Node.js compatibility --- diff --git a/packages/connect-solana/package.json b/packages/connect-solana/package.json index b2096cb7..5e335b64 100644 --- a/packages/connect-solana/package.json +++ b/packages/connect-solana/package.json @@ -43,7 +43,7 @@ "dist/" ], "scripts": { - "attw": "attw --pack . --ignore-rules false-cjs no-resolution cjs-resolves-to-esm", + "attw": "attw --pack . --ignore-rules false-cjs no-resolution", "build": "yarn tsup", "build:docs": "typedoc", "changelog:format": "../../scripts/format-changelog.sh @metamask/connect-solana", diff --git a/yarn.lock b/yarn.lock index dccd4d30..d2f2aefd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -48,6 +48,13 @@ __metadata: languageName: node linkType: hard +"@andrewbranch/untar.js@npm:^1.0.3": + version: 1.0.3 + resolution: "@andrewbranch/untar.js@npm:1.0.3" + checksum: 10/a32de53839fc61af90a394cf93d4368aacd167c9c80f0b3ba0c268460942a6ce2bfe257b6d3f03986b9dcb7368f10b9dc7f66c2f94254d2662da8278454e7d12 + languageName: node + linkType: hard + "@apideck/better-ajv-errors@npm:^0.3.1": version: 0.3.6 resolution: "@apideck/better-ajv-errors@npm:0.3.6" @@ -61,6 +68,39 @@ __metadata: languageName: node linkType: hard +"@arethetypeswrong/cli@npm:^0.18.2": + version: 0.18.2 + resolution: "@arethetypeswrong/cli@npm:0.18.2" + dependencies: + "@arethetypeswrong/core": "npm:0.18.2" + chalk: "npm:^4.1.2" + cli-table3: "npm:^0.6.3" + commander: "npm:^10.0.1" + marked: "npm:^9.1.2" + marked-terminal: "npm:^7.1.0" + semver: "npm:^7.5.4" + bin: + attw: dist/index.js + checksum: 10/8b4506edeb37d58f15e347302df68981c5aefecce973e746026d46370bb560c1ebc05ef8a38eba3102881df4cd3c901961186e3df41077efca4e58adffd455a1 + languageName: node + linkType: hard + +"@arethetypeswrong/core@npm:0.18.2": + version: 0.18.2 + resolution: "@arethetypeswrong/core@npm:0.18.2" + dependencies: + "@andrewbranch/untar.js": "npm:^1.0.3" + "@loaderkit/resolve": "npm:^1.0.2" + cjs-module-lexer: "npm:^1.2.3" + fflate: "npm:^0.8.2" + lru-cache: "npm:^11.0.1" + semver: "npm:^7.5.4" + typescript: "npm:5.6.1-rc" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/9c3edeb8e09e572682e37f55bd523d0dad45388232d31fa1d8875f7f5c414a184070c2bb6d0c8f254dfce4ed9248da373d549ecdeaa571a0cfff04c387c94cf1 + languageName: node + linkType: hard + "@asamuzakjp/css-color@npm:^3.2.0": version: 3.2.0 resolution: "@asamuzakjp/css-color@npm:3.2.0" @@ -1744,6 +1784,13 @@ __metadata: languageName: node linkType: hard +"@braidai/lang@npm:^1.0.0": + version: 1.1.2 + resolution: "@braidai/lang@npm:1.1.2" + checksum: 10/04ece1b744eb8b6c2417afe220ad96c7078f83ed533117cc49300b6322f6b58f5e649c80bd990c27e2d16bfdd976481d5252ff3206b7069fc863890ab1b96277 + languageName: node + linkType: hard + "@coinbase/cdp-sdk@npm:^1.0.0": version: 1.38.5 resolution: "@coinbase/cdp-sdk@npm:1.38.5" @@ -1780,6 +1827,13 @@ __metadata: languageName: node linkType: hard +"@colors/colors@npm:1.5.0": + version: 1.5.0 + resolution: "@colors/colors@npm:1.5.0" + checksum: 10/9d226461c1e91e95f067be2bdc5e6f99cfe55a721f45afb44122e23e4b8602eeac4ff7325af6b5a369f36396ee1514d3809af3f57769066d80d83790d8e53339 + languageName: node + linkType: hard + "@craco/craco@npm:^7.1.0": version: 7.1.0 resolution: "@craco/craco@npm:7.1.0" @@ -3914,6 +3968,15 @@ __metadata: languageName: node linkType: hard +"@loaderkit/resolve@npm:^1.0.2": + version: 1.0.4 + resolution: "@loaderkit/resolve@npm:1.0.4" + dependencies: + "@braidai/lang": "npm:^1.0.0" + checksum: 10/e999f0fc289c2e3f9f80ec92db69c123a5a74b5db7c4bc10292658fc9ef2e1afe6430346ca6cd52d941d7fc407bf28188c95bbbe0aa212c02c8716b5c4b03316 + languageName: node + linkType: hard + "@metamask/abi-utils@npm:^3.0.0": version: 3.0.0 resolution: "@metamask/abi-utils@npm:3.0.0" @@ -4098,6 +4161,7 @@ __metadata: version: 0.0.0-use.local resolution: "@metamask/connect-monorepo@workspace:." dependencies: + "@arethetypeswrong/cli": "npm:^0.18.2" "@babel/core": "npm:^7.28.4" "@babel/plugin-transform-modules-commonjs": "npm:^7.23.3" "@babel/preset-typescript": "npm:^7.23.3" @@ -4136,6 +4200,7 @@ __metadata: prettier: "npm:^3.3.3" prettier-2: "npm:prettier@^2.8.8" prettier-plugin-packagejson: "npm:^2.4.5" + publint: "npm:^0.2.9" rimraf: "npm:^5.0.5" semver: "npm:^7.6.3" simple-git-hooks: "npm:^2.8.0" @@ -6714,6 +6779,13 @@ __metadata: languageName: node linkType: hard +"@sindresorhus/is@npm:^4.6.0": + version: 4.6.0 + resolution: "@sindresorhus/is@npm:4.6.0" + checksum: 10/e7f36ed72abfcd5e0355f7423a72918b9748bb1ef370a59f3e5ad8d40b728b85d63b272f65f63eec1faf417cda89dcb0aeebe94015647b6054659c1442fe5ce0 + languageName: node + linkType: hard + "@sinonjs/commons@npm:^1.7.0": version: 1.8.6 resolution: "@sinonjs/commons@npm:1.8.6" @@ -10605,6 +10677,15 @@ __metadata: languageName: node linkType: hard +"ansi-escapes@npm:^7.0.0": + version: 7.3.0 + resolution: "ansi-escapes@npm:7.3.0" + dependencies: + environment: "npm:^1.0.0" + checksum: 10/189e23e75aacf00ee647ba0545687456cc4bc62547dd0cf6c7728f91fce88854c8e885d5819a278b39981bb846d9427693d2380c562aecdb0cf91d3342141e93 + languageName: node + linkType: hard + "ansi-html-community@npm:^0.0.8": version: 0.0.8 resolution: "ansi-html-community@npm:0.0.8" @@ -10637,7 +10718,7 @@ __metadata: languageName: node linkType: hard -"ansi-regex@npm:^6.0.1": +"ansi-regex@npm:^6.0.1, ansi-regex@npm:^6.1.0": version: 6.2.2 resolution: "ansi-regex@npm:6.2.2" checksum: 10/9b17ce2c6daecc75bcd5966b9ad672c23b184dc3ed9bf3c98a0702f0d2f736c15c10d461913568f2cf527a5e64291c7473358885dd493305c84a1cfed66ba94f @@ -12376,7 +12457,7 @@ __metadata: languageName: node linkType: hard -"cjs-module-lexer@npm:^1.0.0, cjs-module-lexer@npm:^1.3.1": +"cjs-module-lexer@npm:^1.0.0, cjs-module-lexer@npm:^1.2.3, cjs-module-lexer@npm:^1.3.1": version: 1.4.3 resolution: "cjs-module-lexer@npm:1.4.3" checksum: 10/d2b92f919a2dedbfd61d016964fce8da0035f827182ed6839c97cac56e8a8077cfa6a59388adfe2bc588a19cef9bbe830d683a76a6e93c51f65852062cfe2591 @@ -12433,6 +12514,22 @@ __metadata: languageName: node linkType: hard +"cli-highlight@npm:^2.1.11": + version: 2.1.11 + resolution: "cli-highlight@npm:2.1.11" + dependencies: + chalk: "npm:^4.0.0" + highlight.js: "npm:^10.7.1" + mz: "npm:^2.4.0" + parse5: "npm:^5.1.1" + parse5-htmlparser2-tree-adapter: "npm:^6.0.0" + yargs: "npm:^16.0.0" + bin: + highlight: bin/highlight + checksum: 10/05d2b5beb8a4d3259f693517d013bf53d04ad20f470b77c3d02e051963092fae388388e3127f67d3679884a0c32cb855bf590292017c5e68c0f8d86f4b8e146e + languageName: node + linkType: hard + "cli-spinners@npm:^2.0.0, cli-spinners@npm:^2.5.0, cli-spinners@npm:^2.6.1": version: 2.9.2 resolution: "cli-spinners@npm:2.9.2" @@ -12440,6 +12537,19 @@ __metadata: languageName: node linkType: hard +"cli-table3@npm:^0.6.3, cli-table3@npm:^0.6.5": + version: 0.6.5 + resolution: "cli-table3@npm:0.6.5" + dependencies: + "@colors/colors": "npm:1.5.0" + string-width: "npm:^4.2.0" + dependenciesMeta: + "@colors/colors": + optional: true + checksum: 10/8dca71256f6f1367bab84c33add3f957367c7c43750a9828a4212ebd31b8df76bd7419d386e3391ac7419698a8540c25f1a474584028f35b170841cde2e055c5 + languageName: node + linkType: hard + "cli-width@npm:^3.0.0": version: 3.0.0 resolution: "cli-width@npm:3.0.0" @@ -12665,6 +12775,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^10.0.1": + version: 10.0.1 + resolution: "commander@npm:10.0.1" + checksum: 10/8799faa84a30da985802e661cc9856adfaee324d4b138413013ef7f087e8d7924b144c30a1f1405475f0909f467665cd9e1ce13270a2f41b141dab0b7a58f3fb + languageName: node + linkType: hard + "commander@npm:^12.0.0": version: 12.1.0 resolution: "commander@npm:12.1.0" @@ -14211,6 +14328,13 @@ __metadata: languageName: node linkType: hard +"emojilib@npm:^2.4.0": + version: 2.4.0 + resolution: "emojilib@npm:2.4.0" + checksum: 10/bef767eca49acaa881388d91bee6936ea57ae367d603d5227ff0a9da3e2d1e774a61c447e5f2f4901797d023c4b5239bc208285b6172a880d3655024a0f44980 + languageName: node + linkType: hard + "emojis-list@npm:^3.0.0": version: 3.0.0 resolution: "emojis-list@npm:3.0.0" @@ -14332,6 +14456,13 @@ __metadata: languageName: node linkType: hard +"environment@npm:^1.0.0": + version: 1.1.0 + resolution: "environment@npm:1.1.0" + checksum: 10/dd3c1b9825e7f71f1e72b03c2344799ac73f2e9ef81b78ea8b373e55db021786c6b9f3858ea43a436a2c4611052670ec0afe85bc029c384cc71165feee2f4ba6 + languageName: node + linkType: hard + "err-code@npm:^2.0.2": version: 2.0.3 resolution: "err-code@npm:2.0.3" @@ -16335,6 +16466,13 @@ __metadata: languageName: node linkType: hard +"fflate@npm:^0.8.2": + version: 0.8.2 + resolution: "fflate@npm:0.8.2" + checksum: 10/2bd26ba6d235d428de793c6a0cd1aaa96a06269ebd4e21b46c8fd1bd136abc631acf27e188d47c3936db090bf3e1ede11d15ce9eae9bffdc4bfe1b9dc66ca9cb + languageName: node + linkType: hard + "figures@npm:^3.0.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -16991,6 +17129,19 @@ __metadata: languageName: node linkType: hard +"glob@npm:^8.0.1": + version: 8.1.0 + resolution: "glob@npm:8.1.0" + dependencies: + fs.realpath: "npm:^1.0.0" + inflight: "npm:^1.0.4" + inherits: "npm:2" + minimatch: "npm:^5.0.1" + once: "npm:^1.3.0" + checksum: 10/9aab1c75eb087c35dbc41d1f742e51d0507aa2b14c910d96fb8287107a10a22f4bbdce26fc0a3da4c69a20f7b26d62f1640b346a4f6e6becfff47f335bb1dc5e + languageName: node + linkType: hard + "global-dirs@npm:^0.1.1": version: 0.1.1 resolution: "global-dirs@npm:0.1.1" @@ -17287,6 +17438,13 @@ __metadata: languageName: node linkType: hard +"highlight.js@npm:^10.7.1": + version: 10.7.3 + resolution: "highlight.js@npm:10.7.3" + checksum: 10/db8d10a541936b058e221dbde77869664b2b45bca75d660aa98065be2cd29f3924755fbc7348213f17fd931aefb6e6597448ba6fe82afba6d8313747a91983ee + languageName: node + linkType: hard + "hoist-non-react-statics@npm:^3.3.0": version: 3.3.2 resolution: "hoist-non-react-statics@npm:3.3.2" @@ -17650,6 +17808,15 @@ __metadata: languageName: node linkType: hard +"ignore-walk@npm:^5.0.1": + version: 5.0.1 + resolution: "ignore-walk@npm:5.0.1" + dependencies: + minimatch: "npm:^5.0.1" + checksum: 10/a88b3fbda155496363fb3db66c7c7b85cf04d614fb51146f0aa5fc6b35c65370c57f9e6c550cd6048651fc378985b7a2bb9015c9fcb3e0dc798fc0728746703c + languageName: node + linkType: hard + "ignore@npm:^5.2.0, ignore@npm:^5.2.4, ignore@npm:^5.3.1, ignore@npm:^5.3.2": version: 5.3.2 resolution: "ignore@npm:5.3.2" @@ -20653,6 +20820,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.1": + version: 11.2.5 + resolution: "lru-cache@npm:11.2.5" + checksum: 10/be50f66c6e23afeaab9c7eefafa06344dd13cde7b3528809c2660c4ad70d93b9ba537366634623cbb2eb411671f526b5a4af2c602507b9258aead0fa8d713f6c + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -20803,6 +20977,32 @@ __metadata: languageName: node linkType: hard +"marked-terminal@npm:^7.1.0": + version: 7.3.0 + resolution: "marked-terminal@npm:7.3.0" + dependencies: + ansi-escapes: "npm:^7.0.0" + ansi-regex: "npm:^6.1.0" + chalk: "npm:^5.4.1" + cli-highlight: "npm:^2.1.11" + cli-table3: "npm:^0.6.5" + node-emoji: "npm:^2.2.0" + supports-hyperlinks: "npm:^3.1.0" + peerDependencies: + marked: ">=1 <16" + checksum: 10/1dfdfe752a4ebe6aec8de4a51180612a5f29982026b104a86215efb46b82b2a1942531a6bb840163c8d827e3eadc5cf93272e6eb29ec549f72b73b8b2eb97cfe + languageName: node + linkType: hard + +"marked@npm:^9.1.2": + version: 9.1.6 + resolution: "marked@npm:9.1.6" + bin: + marked: bin/marked.js + checksum: 10/29d073500c70b6b53cd35a8d19f5e43df6e2819ddeca8848a31901b87b82ca0ea46a8a831920c656c69c33ad5dce4b75654c4c4ced34a67f4e4e4a31c7620cfe + languageName: node + linkType: hard + "marky@npm:^1.2.2": version: 1.3.0 resolution: "marky@npm:1.3.0" @@ -21689,6 +21889,13 @@ __metadata: languageName: node linkType: hard +"mri@npm:^1.1.0": + version: 1.2.0 + resolution: "mri@npm:1.2.0" + checksum: 10/6775a1d2228bb9d191ead4efc220bd6be64f943ad3afd4dcb3b3ac8fc7b87034443f666e38805df38e8d047b29f910c3cc7810da0109af83e42c82c73bd3f6bc + languageName: node + linkType: hard + "ms@npm:2.0.0": version: 2.0.0 resolution: "ms@npm:2.0.0" @@ -21749,7 +21956,7 @@ __metadata: languageName: node linkType: hard -"mz@npm:^2.7.0": +"mz@npm:^2.4.0, mz@npm:^2.7.0": version: 2.7.0 resolution: "mz@npm:2.7.0" dependencies: @@ -21891,6 +22098,18 @@ __metadata: languageName: node linkType: hard +"node-emoji@npm:^2.2.0": + version: 2.2.0 + resolution: "node-emoji@npm:2.2.0" + dependencies: + "@sindresorhus/is": "npm:^4.6.0" + char-regex: "npm:^1.0.2" + emojilib: "npm:^2.4.0" + skin-tone: "npm:^2.0.0" + checksum: 10/2548668f5cc9f781c94dc39971a630b2887111e0970c29fc523e924819d1b39b53a2694a4d1046861adf538c4462d06ee0269c48717ccad30336a918d9a911d5 + languageName: node + linkType: hard + "node-fetch-native@npm:^1.6.7": version: 1.6.7 resolution: "node-fetch-native@npm:1.6.7" @@ -22045,6 +22264,15 @@ __metadata: languageName: node linkType: hard +"npm-bundled@npm:^2.0.0": + version: 2.0.1 + resolution: "npm-bundled@npm:2.0.1" + dependencies: + npm-normalize-package-bin: "npm:^2.0.0" + checksum: 10/adf5d727915cbd61603e2171ba67e39319efa343ceb72868348232a36ad774a8365d5af5e1aad29acc41c3caeda4ebd80e5b7a3da319985509aeedf79e352c0d + languageName: node + linkType: hard + "npm-install-checks@npm:^6.0.0": version: 6.3.0 resolution: "npm-install-checks@npm:6.3.0" @@ -22061,6 +22289,13 @@ __metadata: languageName: node linkType: hard +"npm-normalize-package-bin@npm:^2.0.0": + version: 2.0.0 + resolution: "npm-normalize-package-bin@npm:2.0.0" + checksum: 10/7c5379f9b188b564c4332c97bdd9a5d6b7b15f02b5823b00989d6a0e6fb31eb0280f02b0a924f930e1fcaf00e60fae333aec8923d2a4c7747613c7d629d8aa25 + languageName: node + linkType: hard + "npm-package-arg@npm:^11.0.0": version: 11.0.3 resolution: "npm-package-arg@npm:11.0.3" @@ -22073,6 +22308,20 @@ __metadata: languageName: node linkType: hard +"npm-packlist@npm:^5.1.3": + version: 5.1.3 + resolution: "npm-packlist@npm:5.1.3" + dependencies: + glob: "npm:^8.0.1" + ignore-walk: "npm:^5.0.1" + npm-bundled: "npm:^2.0.0" + npm-normalize-package-bin: "npm:^2.0.0" + bin: + npm-packlist: bin/index.js + checksum: 10/78aa1c69a349c40cf7ba556581bff2dd5cbc1455614a44bd673e076f7f402096ac7c01660c45ec17cbd51bf0db3a4df7e9bc3a0a8e8e497ebf6d53848f33dfad + languageName: node + linkType: hard + "npm-pick-manifest@npm:^9.0.0": version: 9.1.0 resolution: "npm-pick-manifest@npm:9.1.0" @@ -22798,13 +23047,29 @@ __metadata: languageName: node linkType: hard -"parse5@npm:6.0.1": +"parse5-htmlparser2-tree-adapter@npm:^6.0.0": + version: 6.0.1 + resolution: "parse5-htmlparser2-tree-adapter@npm:6.0.1" + dependencies: + parse5: "npm:^6.0.1" + checksum: 10/3400a2cd1ad450b2fe148544154f86ea53d3ed6b6eab56c78bb43b9629d3dfe9f580dffd75bbf32be134ffef645b68081fc764bf75c210f236ab9c5c8c38c252 + languageName: node + linkType: hard + +"parse5@npm:6.0.1, parse5@npm:^6.0.1": version: 6.0.1 resolution: "parse5@npm:6.0.1" checksum: 10/dfb110581f62bd1425725a7c784ae022a24669bd0efc24b58c71fc731c4d868193e2ebd85b74cde2dbb965e4dcf07059b1e651adbec1b3b5267531bd132fdb75 languageName: node linkType: hard +"parse5@npm:^5.1.1": + version: 5.1.1 + resolution: "parse5@npm:5.1.1" + checksum: 10/5b509744cfe81488a33be05578df490c460690e64519fa67f0a0acb9c1bca05914e8acad17a977e2cf5964a000e43959b40024f0c243dd6595dd0cca8a32f71b + languageName: node + linkType: hard + "parse5@npm:^7.0.0, parse5@npm:^7.2.1": version: 7.3.0 resolution: "parse5@npm:7.3.0" @@ -24357,6 +24622,19 @@ __metadata: languageName: node linkType: hard +"publint@npm:^0.2.9": + version: 0.2.12 + resolution: "publint@npm:0.2.12" + dependencies: + npm-packlist: "npm:^5.1.3" + picocolors: "npm:^1.1.1" + sade: "npm:^1.8.1" + bin: + publint: lib/cli.js + checksum: 10/7432845a760aa0c5843de4fdc8e53458e4f35502dcc8f785a3e78c652c9bf4a49a358d9b72220ba06bac823481bbfaf3020d168918148b88f5cbab9621ecd6b5 + languageName: node + linkType: hard + "pump@npm:^3.0.0": version: 3.0.3 resolution: "pump@npm:3.0.3" @@ -25785,6 +26063,15 @@ __metadata: languageName: node linkType: hard +"sade@npm:^1.8.1": + version: 1.8.1 + resolution: "sade@npm:1.8.1" + dependencies: + mri: "npm:^1.1.0" + checksum: 10/1c67ba03c94083e0ae307ff5564ecb86c2104c0f558042fdaa40ea0054f91a63a9783f14069870f2f784336adabb70f90f22a84dc457b5a25e859aaadefe0910 + languageName: node + linkType: hard + "safe-array-concat@npm:^1.1.2, safe-array-concat@npm:^1.1.3": version: 1.1.3 resolution: "safe-array-concat@npm:1.1.3" @@ -26406,6 +26693,15 @@ __metadata: languageName: node linkType: hard +"skin-tone@npm:^2.0.0": + version: 2.0.0 + resolution: "skin-tone@npm:2.0.0" + dependencies: + unicode-emoji-modifier-base: "npm:^1.0.0" + checksum: 10/19de157586b8019cacc55eb25d9d640f00fc02415761f3e41a4527142970fd4e7f6af0333bc90e879858766c20a976107bb386ffd4c812289c01d51f2c8d182c + languageName: node + linkType: hard + "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" @@ -27248,6 +27544,16 @@ __metadata: languageName: node linkType: hard +"supports-hyperlinks@npm:^3.1.0": + version: 3.2.0 + resolution: "supports-hyperlinks@npm:3.2.0" + dependencies: + has-flag: "npm:^4.0.0" + supports-color: "npm:^7.0.0" + checksum: 10/f7924de6049fc30bc808f98d3561318c1a4e3d55d786f9fede5e23dc5a7b0f625485bd1143135b496d521ccd0110463f2c077eb71a4ce0cf783b8b31f7909242 + languageName: node + linkType: hard + "supports-preserve-symlinks-flag@npm:^1.0.0": version: 1.0.0 resolution: "supports-preserve-symlinks-flag@npm:1.0.0" @@ -28188,6 +28494,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:5.6.1-rc": + version: 5.6.1-rc + resolution: "typescript@npm:5.6.1-rc" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/5716659d5baf142b5c84b96209b30730a5e9dcc0202f879349f9974823f7452ec4ef3904397b6d89d861c688acdbb1dad0a449d753163519fae2ee06ea4a68be + languageName: node + linkType: hard + "typescript@npm:^5.9.3": version: 5.9.3 resolution: "typescript@npm:5.9.3" @@ -28198,6 +28514,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A5.6.1-rc#optional!builtin": + version: 5.6.1-rc + resolution: "typescript@patch:typescript@npm%3A5.6.1-rc#optional!builtin::version=5.6.1-rc&hash=8c6c40" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10/462e0bb46c63abfc5bfc43f2bb00b9777a4228f3ed52d8930b46404dce71dbada63c27a99262ff4570b5ff7d01455701bfd36823bd3c766e443b6fa33cd31dea + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A^5.9.3#optional!builtin": version: 5.9.3 resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" @@ -28320,6 +28646,13 @@ __metadata: languageName: node linkType: hard +"unicode-emoji-modifier-base@npm:^1.0.0": + version: 1.0.0 + resolution: "unicode-emoji-modifier-base@npm:1.0.0" + checksum: 10/6e1521d35fa69493207eb8b41f8edb95985d8b3faf07c01d820a1830b5e8403e20002563e2f84683e8e962a49beccae789f0879356bf92a4ec7a4dd8e2d16fdb + languageName: node + linkType: hard + "unicode-match-property-ecmascript@npm:^2.0.0": version: 2.0.0 resolution: "unicode-match-property-ecmascript@npm:2.0.0" @@ -30205,7 +30538,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^16.2.0": +"yargs@npm:^16.0.0, yargs@npm:^16.2.0": version: 16.2.0 resolution: "yargs@npm:16.2.0" dependencies: From 822fb4d4d6d33b480ae50fb28e734972d1b9e5d1 Mon Sep 17 00:00:00 2001 From: Alex Mendonca Date: Fri, 6 Feb 2026 15:20:13 +0000 Subject: [PATCH 10/10] lint doc --- docs/package-lint-ignored-rules.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/package-lint-ignored-rules.md b/docs/package-lint-ignored-rules.md index 128744dc..253cb30a 100644 --- a/docs/package-lint-ignored-rules.md +++ b/docs/package-lint-ignored-rules.md @@ -51,7 +51,7 @@ with the "import" condition. Consider using the .mts extension. - Running in Node.js directly (not through a bundler like webpack/vite/esbuild) - Using `moduleResolution: "node16"` or `"nodenext"` in tsconfig (stricter than the common `"bundler"` setting) - TypeScript then interprets the `.d.ts` types as CJS while the `.mjs` runtime is ESM - + Most real-world consumers use bundlers, which handle module interop seamlessly regardless of file extensions. 3. **The fix is complex:** Properly fixing this requires: @@ -167,11 +167,11 @@ and the "browser" condition ## Summary Table -| Rule | Issue | Impact | Why Ignore | Affected Packages | -| -------------------------- | ---------------------------------------- | ------------------------------------------------ | ---------------------------------------------------- | ----------------- | +| Rule | Issue | Impact | Why Ignore | Affected Packages | +| -------------------------- | ---------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------ | ----------------- | | `false-cjs` | Types interpreted as CJS for ESM imports | Theoretical type ambiguity in strict Node.js ESM | Bundlers handle correctly; fix is complex; industry standard | All packages | -| `no-resolution` | Subpaths fail on Node 10 | None | Node 10 is EOL (2021); never supported | All packages | -| `unexpected-module-syntax` | ESM syntax in CJS-typed files | Node.js would reject if run directly | Stencil limitation; bundlers work fine; browser-only | multichain-ui | +| `no-resolution` | Subpaths fail on Node 10 | None | Node 10 is EOL (2021); never supported | All packages | +| `unexpected-module-syntax` | ESM syntax in CJS-typed files | Node.js would reject if run directly | Stencil limitation; bundlers work fine; browser-only | multichain-ui | ---