Skip to content

Commit

Permalink
improve CJS support (#442)
Browse files Browse the repository at this point in the history
* cut cjs release

* Publish

 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]

* fix cjs release (#438)

* fix cjs release

* only rename index.cjs

* simplify renaming with postbuild

* restore module field

* Publish

 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]
 - @web3-react/[email protected]

* try using mjs

explicit folders for mjs and cjs

* bump example

* update yarn.lock

Co-authored-by: Zach Pomerantz <[email protected]>
  • Loading branch information
NoahZinsmeister and zzmp authored Feb 28, 2022
1 parent a09710c commit eb606d3
Show file tree
Hide file tree
Showing 26 changed files with 146 additions and 146 deletions.
20 changes: 10 additions & 10 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
"publishConfig": {
"access": "public"
},
"version": "8.0.12-beta.0",
"type": "module",
"version": "8.0.14-beta.0",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"types": "./dist/esm/index.d.ts",
"module": "./dist/esm/index.mjs",
"main": "./dist/cjs/index.cjs",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc && tsc --project tsconfig.cjs.json",
"postbuild": "mv dist/esm/index.js dist/esm/index.mjs && mv dist/cjs/index.js dist/cjs/index.cjs",
"start": "tsc --watch"
},
"dependencies": {
"@web3-react/store": "^8.0.7-beta.0",
"@web3-react/types": "^8.0.5-beta.0",
"@web3-react/store": "^8.0.9-beta.0",
"@web3-react/types": "^8.0.7-beta.0",
"zustand": "^4.0.0-beta.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"extends": "../../tsconfig.json",
"include": ["./src"],
"compilerOptions": {
"outDir": "./dist"
"outDir": "./dist/esm"
}
}
20 changes: 10 additions & 10 deletions packages/eip1193/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
"publishConfig": {
"access": "public"
},
"version": "8.0.7-beta.0",
"type": "module",
"version": "8.0.9-beta.0",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"types": "./dist/esm/index.d.ts",
"module": "./dist/esm/index.mjs",
"main": "./dist/cjs/index.cjs",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc && tsc --project tsconfig.cjs.json",
"postbuild": "mv dist/esm/index.js dist/esm/index.mjs && mv dist/cjs/index.js dist/cjs/index.cjs",
"start": "tsc --watch"
},
"dependencies": {
"@web3-react/types": "^8.0.5-beta.0"
"@web3-react/types": "^8.0.7-beta.0"
},
"devDependencies": {
"@ethersproject/experimental": "^5.5.0",
"@ethersproject/providers": "^5.5.1",
"@web3-react/store": "^8.0.7-beta.0"
"@web3-react/store": "^8.0.9-beta.0"
}
}
2 changes: 1 addition & 1 deletion packages/eip1193/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"extends": "../../tsconfig.json",
"include": ["./src"],
"compilerOptions": {
"outDir": "./dist"
"outDir": "./dist/esm"
}
}
18 changes: 9 additions & 9 deletions packages/empty/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@
"publishConfig": {
"access": "public"
},
"version": "8.0.5-beta.0",
"type": "module",
"version": "8.0.7-beta.0",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"types": "./dist/esm/index.d.ts",
"module": "./dist/esm/index.mjs",
"main": "./dist/cjs/index.cjs",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc && tsc --project tsconfig.cjs.json",
"postbuild": "mv dist/esm/index.js dist/esm/index.mjs && mv dist/cjs/index.js dist/cjs/index.cjs",
"start": "tsc --watch"
},
"dependencies": {
"@web3-react/types": "^8.0.5-beta.0"
"@web3-react/types": "^8.0.7-beta.0"
}
}
2 changes: 1 addition & 1 deletion packages/empty/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"extends": "../../tsconfig.json",
"include": ["./src"],
"compilerOptions": {
"outDir": "./dist"
"outDir": "./dist/esm"
}
}
18 changes: 9 additions & 9 deletions packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"@ethersproject/experimental": "^5.5.0",
"@ethersproject/providers": "^5.5.1",
"@ethersproject/units": "^5.4.0",
"@web3-react/core": "8.0.12-beta.0",
"@web3-react/eip1193": "8.0.7-beta.0",
"@web3-react/empty": "8.0.5-beta.0",
"@web3-react/metamask": "8.0.8-beta.0",
"@web3-react/network": "8.0.8-beta.0",
"@web3-react/types": "8.0.5-beta.0",
"@web3-react/url": "8.0.7-beta.0",
"@web3-react/walletconnect": "8.0.13-beta.0",
"@web3-react/walletlink": "8.0.13-beta.0",
"@web3-react/core": "8.0.14-beta.0",
"@web3-react/eip1193": "8.0.9-beta.0",
"@web3-react/empty": "8.0.7-beta.0",
"@web3-react/metamask": "8.0.10-beta.0",
"@web3-react/network": "8.0.10-beta.0",
"@web3-react/types": "8.0.7-beta.0",
"@web3-react/url": "8.0.9-beta.0",
"@web3-react/walletconnect": "8.0.15-beta.0",
"@web3-react/walletlink": "8.0.15-beta.0",
"next": "^12.1.0",
"react-dom": "^17.0.2"
}
Expand Down
22 changes: 11 additions & 11 deletions packages/example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@
dependencies:
"@ethersproject/logger" "^5.5.0"

"@ethersproject/[email protected].2", "@ethersproject/providers@^5.5.1":
version "5.5.2"
resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.5.2.tgz#131ccf52dc17afd0ab69ed444b8c0e3a27297d99"
integrity sha512-hkbx7x/MKcRjyrO4StKXCzCpWer6s97xnm34xkfPiarhtEUVAN4TBBpamM+z66WcTt7H5B53YwbRj1n7i8pZoQ==
"@ethersproject/[email protected].3", "@ethersproject/providers@^5.5.1":
version "5.5.3"
resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.5.3.tgz#56c2b070542ac44eb5de2ed3cf6784acd60a3130"
integrity sha512-ZHXxXXXWHuwCQKrgdpIkbzMNJMvs+9YWemanwp1fA7XZEv7QlilseysPvQe0D7Q7DlkJX/w/bGA1MdgK2TbGvA==
dependencies:
"@ethersproject/abstract-provider" "^5.5.0"
"@ethersproject/abstract-signer" "^5.5.0"
Expand Down Expand Up @@ -432,9 +432,9 @@ brorand@^1.1.0:
integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=

caniuse-lite@^1.0.30001283:
version "1.0.30001301"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001301.tgz#ebc9086026534cab0dab99425d9c3b4425e5f450"
integrity sha512-csfD/GpHMqgEL3V3uIgosvh+SVIQvCh43SNu9HRbP1lnxkKm1kjDG4f32PP571JplkLjfS+mg2p1gxR7MYrrIA==
version "1.0.30001312"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz#e11eba4b87e24d22697dae05455d5aea28550d5f"
integrity sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==

[email protected]:
version "6.5.4"
Expand All @@ -450,9 +450,9 @@ [email protected]:
minimalistic-crypto-utils "^1.0.1"

ethers@^5.5.0:
version "5.5.3"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.5.3.tgz#1e361516711c0c3244b6210e7e3ecabf0c75fca0"
integrity sha512-fTT4WT8/hTe/BLwRUtl7I5zlpF3XC3P/Xwqxc5AIP2HGlH15qpmjs0Ou78az93b1rLITzXLFxoNX63B8ZbUd7g==
version "5.5.4"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.5.4.tgz#e1155b73376a2f5da448e4a33351b57a885f4352"
integrity sha512-N9IAXsF8iKhgHIC6pquzRgPBJEzc9auw3JoRkaKe+y4Wl/LFBtDDunNe7YmdomontECAcC5APaAgWZBiu1kirw==
dependencies:
"@ethersproject/abi" "5.5.0"
"@ethersproject/abstract-provider" "5.5.1"
Expand All @@ -472,7 +472,7 @@ ethers@^5.5.0:
"@ethersproject/networks" "5.5.2"
"@ethersproject/pbkdf2" "5.5.0"
"@ethersproject/properties" "5.5.0"
"@ethersproject/providers" "5.5.2"
"@ethersproject/providers" "5.5.3"
"@ethersproject/random" "5.5.1"
"@ethersproject/rlp" "5.5.0"
"@ethersproject/sha2" "5.5.0"
Expand Down
18 changes: 9 additions & 9 deletions packages/frame/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@
"publishConfig": {
"access": "public"
},
"version": "8.0.5-beta.0",
"type": "module",
"version": "8.0.7-beta.0",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"types": "./dist/esm/index.d.ts",
"module": "./dist/esm/index.mjs",
"main": "./dist/cjs/index.cjs",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc && tsc --project tsconfig.cjs.json",
"postbuild": "mv dist/esm/index.js dist/esm/index.mjs && mv dist/cjs/index.js dist/cjs/index.cjs",
"start": "tsc --watch"
},
"dependencies": {
"@web3-react/types": "^8.0.5-beta.0"
"@web3-react/types": "^8.0.7-beta.0"
},
"peerDependencies": {
"eth-provider": "^0.9.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/frame/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"extends": "../../tsconfig.json",
"include": ["./src"],
"compilerOptions": {
"outDir": "./dist"
"outDir": "./dist/esm"
}
}
18 changes: 9 additions & 9 deletions packages/magic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
"publishConfig": {
"access": "public"
},
"version": "8.0.5-beta.0",
"type": "module",
"version": "8.0.7-beta.0",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"types": "./dist/esm/index.d.ts",
"module": "./dist/esm/index.mjs",
"main": "./dist/cjs/index.cjs",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc && tsc --project tsconfig.cjs.json",
"postbuild": "mv dist/esm/index.js dist/esm/index.mjs && mv dist/cjs/index.js dist/cjs/index.cjs",
"start": "tsc --watch"
},
"dependencies": {
"@ethersproject/experimental": "^5.5.0",
"@ethersproject/providers": "^5.5.1",
"@web3-react/types": "^8.0.5-beta.0"
"@web3-react/types": "^8.0.7-beta.0"
},
"peerDependencies": {
"magic-sdk": "^6.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/magic/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"extends": "../../tsconfig.json",
"include": ["./src"],
"compilerOptions": {
"outDir": "./dist"
"outDir": "./dist/esm"
}
}
20 changes: 10 additions & 10 deletions packages/metamask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
"publishConfig": {
"access": "public"
},
"version": "8.0.8-beta.0",
"type": "module",
"version": "8.0.10-beta.0",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"types": "./dist/esm/index.d.ts",
"module": "./dist/esm/index.mjs",
"main": "./dist/cjs/index.cjs",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc && tsc --project tsconfig.cjs.json",
"postbuild": "mv dist/esm/index.js dist/esm/index.mjs && mv dist/cjs/index.js dist/cjs/index.cjs",
"start": "tsc --watch"
},
"dependencies": {
"@metamask/detect-provider": "^1.2.0",
"@web3-react/types": "^8.0.5-beta.0"
"@web3-react/types": "^8.0.7-beta.0"
},
"devDependencies": {
"@web3-react/store": "^8.0.7-beta.0"
"@web3-react/store": "^8.0.9-beta.0"
}
}
2 changes: 1 addition & 1 deletion packages/metamask/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"extends": "../../tsconfig.json",
"include": ["./src"],
"compilerOptions": {
"outDir": "./dist"
"outDir": "./dist/esm"
}
}
20 changes: 10 additions & 10 deletions packages/network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@
"publishConfig": {
"access": "public"
},
"version": "8.0.8-beta.0",
"type": "module",
"version": "8.0.10-beta.0",
"files": [
"dist/*"
],
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.js"
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.mjs",
"require": "./dist/cjs/index.cjs"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"main": "./dist/cjs/index.js",
"types": "./dist/esm/index.d.ts",
"module": "./dist/esm/index.mjs",
"main": "./dist/cjs/index.cjs",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc && tsc --project tsconfig.cjs.json",
"postbuild": "mv dist/esm/index.js dist/esm/index.mjs && mv dist/cjs/index.js dist/cjs/index.cjs",
"start": "tsc --watch"
},
"dependencies": {
"@ethersproject/experimental": "^5.5.0",
"@ethersproject/providers": "^5.5.1",
"@web3-react/types": "^8.0.5-beta.0"
"@web3-react/types": "^8.0.7-beta.0"
},
"devDependencies": {
"@web3-react/store": "^8.0.7-beta.0"
"@web3-react/store": "^8.0.9-beta.0"
}
}
2 changes: 1 addition & 1 deletion packages/network/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"extends": "../../tsconfig.json",
"include": ["./src"],
"compilerOptions": {
"outDir": "./dist"
"outDir": "./dist/esm"
}
}
Loading

1 comment on commit eb606d3

@vercel
Copy link

@vercel vercel bot commented on eb606d3 Feb 28, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.