diff --git a/CHANGELOG.md b/CHANGELOG.md index f9336aa..4400bfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.9] - 2024-03-07 + +### Changed +- Moved @dfinity/xxx dependencies from dependencies to peerDependencies to reduce package size. + ## [0.0.8] - 2024-03-04 ### Changed diff --git a/README.md b/README.md index 141c174..fe5757b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ ## Installation ```bash -npm install ic-use-internet-identity +npm install ic-use-internet-identity @dfinity/agent @dfinity/auth-client @dfinity/identity ``` ## Usage diff --git a/build.js b/build.js index 7ce57eb..b51255c 100644 --- a/build.js +++ b/build.js @@ -6,6 +6,12 @@ esbuild.build({ splitting: true, outdir: "dist", format: "esm", - external: ["react", "react-dom"], + external: [ + "react", + "react-dom", + "@dfinity/agent", + "@dfinity/auth-client", + "@dfinity/identity", + ], plugins: [], }); diff --git a/package-lock.json b/package-lock.json index 1c524b9..584b422 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,11 +8,6 @@ "name": "ic-use-internet-identity", "version": "0.0.8", "license": "MIT", - "dependencies": { - "@dfinity/agent": "^1.0.1", - "@dfinity/auth-client": "^1.0.1", - "@dfinity/identity": "^1.0.1" - }, "devDependencies": { "@types/node": "^20.10.6", "@types/react": "^18.2.39", @@ -28,6 +23,9 @@ "typescript": "^5.2.2" }, "peerDependencies": { + "@dfinity/agent": ">=1.0.1", + "@dfinity/auth-client": ">=1.0.1", + "@dfinity/identity": ">=1.0.1", "react": ">=18.0.0" } }, @@ -44,6 +42,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-1.0.1.tgz", "integrity": "sha512-QoCiKIWEgsXoaiHpb76M2qLXYDS9IdfvC81dLJYvX9KVXRq8Ojo4S82tBqBFGtM0j0EKEC6mIAJV/bqhOJTtjQ==", + "peer": true, "dependencies": { "@noble/curves": "^1.2.0", "@noble/hashes": "^1.3.1", @@ -61,6 +60,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@dfinity/auth-client/-/auth-client-1.0.1.tgz", "integrity": "sha512-QooHufXCDHTXySC1Tb1xf9+KRJISbw1sLYLIgY7PTxrA4Nc1ZgA7o4exwgRyIuJgoWMKrjgHPUZcu4N5ak69OQ==", + "peer": true, "dependencies": { "idb": "^7.0.2" }, @@ -83,6 +83,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@dfinity/identity/-/identity-1.0.1.tgz", "integrity": "sha512-ArajyKSkiA4LjOq/ocGLMd66svgMVntF9j9P7irZScrzTCPcEXk5c7VteAqRGMwHCpI4LRipjmuZA1agwmUzRw==", + "peer": true, "dependencies": { "@noble/curves": "^1.2.0", "@noble/hashes": "^1.3.1", @@ -593,6 +594,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "peer": true, "dependencies": { "@noble/hashes": "1.3.2" }, @@ -604,6 +606,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "peer": true, "engines": { "node": ">= 16" }, @@ -1268,6 +1271,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.2.0.tgz", "integrity": "sha512-7emyCsu1/xiBXgQZrscw/8KPRT44I4Yq9Pe6EGs3aPRTsWuggML1/1DTuZUuIaJPIm1FTDUVXl4x/yW8s0kQDQ==", + "peer": true, "engines": { "node": ">= 0.6.0" } @@ -1289,12 +1293,14 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "peer": true }, "node_modules/bignumber.js": { "version": "9.1.2", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "peer": true, "engines": { "node": "*" } @@ -1303,6 +1309,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/borc/-/borc-2.1.2.tgz", "integrity": "sha512-Sy9eoUi4OiKzq7VovMn246iTo17kzuyHJKomCfpWMlI6RpfN1gk95w7d7gH264nApVLg0HZfcpz62/g4VH1Y4w==", + "peer": true, "dependencies": { "bignumber.js": "^9.0.0", "buffer": "^5.5.0", @@ -1334,6 +1341,7 @@ "url": "https://feross.org/support" } ], + "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -1379,6 +1387,7 @@ "url": "https://feross.org/support" } ], + "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -1439,7 +1448,8 @@ "node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "peer": true }, "node_modules/concat-map": { "version": "0.0.1", @@ -1526,7 +1536,8 @@ "node_modules/delimit-stream": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/delimit-stream/-/delimit-stream-0.1.0.tgz", - "integrity": "sha512-a02fiQ7poS5CnjiJBAsjGLPp5EwVoGHNeu9sziBd9huppRfsAFIpv5zNLv0V1gbop53ilngAf5Kf331AwcoRBQ==" + "integrity": "sha512-a02fiQ7poS5CnjiJBAsjGLPp5EwVoGHNeu9sziBd9huppRfsAFIpv5zNLv0V1gbop53ilngAf5Kf331AwcoRBQ==", + "peer": true }, "node_modules/dir-glob": { "version": "3.0.1", @@ -2583,7 +2594,8 @@ "node_modules/idb": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", - "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==" + "integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==", + "peer": true }, "node_modules/ieee754": { "version": "1.2.1", @@ -2602,7 +2614,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "peer": true }, "node_modules/ignore": { "version": "5.3.0", @@ -3003,6 +3016,7 @@ "version": "0.4.7", "resolved": "https://registry.npmjs.org/iso-url/-/iso-url-0.4.7.tgz", "integrity": "sha512-27fFRDnPAMnHGLq36bWTpKET+eiXct3ENlCcdcMdk+mjXrb2kw3mhBUg1B7ewAC0kVzlOPhADzQgz1SE6Tglog==", + "peer": true, "engines": { "node": ">=10" } @@ -3054,6 +3068,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/json-text-sequence/-/json-text-sequence-0.1.1.tgz", "integrity": "sha512-L3mEegEWHRekSHjc7+sc8eJhba9Clq1PZ8kMkzf8OxElhXc8O4TS5MwcVlj9aEbm5dr81N90WHC5nAz3UO971w==", + "peer": true, "dependencies": { "delimit-stream": "0.1.0" } @@ -3564,6 +3579,7 @@ "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "peer": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -3719,7 +3735,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "peer": true }, "node_modules/safe-regex-test": { "version": "1.0.0", @@ -3820,7 +3837,8 @@ "node_modules/simple-cbor": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/simple-cbor/-/simple-cbor-0.4.1.tgz", - "integrity": "sha512-rijcxtwx2b4Bje3sqeIqw5EeW7UlOIC4YfOdwqIKacpvRQ/D78bWg/4/0m5e0U91oKvlGh7LlJuZCu07ISCC7w==" + "integrity": "sha512-rijcxtwx2b4Bje3sqeIqw5EeW7UlOIC4YfOdwqIKacpvRQ/D78bWg/4/0m5e0U91oKvlGh7LlJuZCu07ISCC7w==", + "peer": true }, "node_modules/slash": { "version": "3.0.0", @@ -3867,6 +3885,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "peer": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -4157,7 +4176,8 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "peer": true }, "node_modules/validate-npm-package-license": { "version": "3.0.4", diff --git a/package.json b/package.json index 2c07de3..07a2c0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ic-use-internet-identity", - "version": "0.0.8", + "version": "0.0.9", "description": "Hook that makes it easy to integrate IC Internet Identity into your React application.", "author": "Kristofer Lund ", "repository": { @@ -29,13 +29,12 @@ "dev:esbuild": "npm run build --watch" }, "license": "MIT", - "dependencies": { - "@dfinity/agent": "^1.0.1", - "@dfinity/auth-client": "^1.0.1", - "@dfinity/identity": "^1.0.1" - }, + "dependencies": {}, "peerDependencies": { - "react": ">=18.0.0" + "react": ">=18.0.0", + "@dfinity/agent": ">=1.0.1", + "@dfinity/auth-client": ">=1.0.1", + "@dfinity/identity": ">=1.0.1" }, "devDependencies": { "@types/node": "^20.10.6",