File tree Expand file tree Collapse file tree 11 files changed +43
-33
lines changed
src/ExtensionAccountsProvider Expand file tree Collapse file tree 11 files changed +43
-33
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,14 @@ export const getTemplate = async (name) => {
9595export const generatePackageJson = async (
9696 inputDir : string ,
9797 outputDir : string ,
98- bundler : "gulp" | "tsup" | "module" | null
98+ bundler : "gulp" | "tsup" | "module" | null ,
99+ additionalExports : Record <
100+ string ,
101+ {
102+ import : string ;
103+ require : string ;
104+ }
105+ > = { }
99106) : Promise < boolean > => {
100107 try {
101108 // Read the original package.json.
@@ -134,6 +141,7 @@ export const generatePackageJson = async (
134141 import : "./mjs/index.js" ,
135142 require : "./cjs/index.js" ,
136143 } ,
144+ ...additionalExports ,
137145 } ,
138146 } ;
139147 }
@@ -148,6 +156,7 @@ export const generatePackageJson = async (
148156 import : "./index.js" ,
149157 require : "./index.cjs" ,
150158 } ,
159+ ...additionalExports ,
151160 } ,
152161 } ;
153162 }
Original file line number Diff line number Diff line change @@ -35,7 +35,19 @@ export const build = async () => {
3535 ! ( await generatePackageJson (
3636 libDirectory ,
3737 `${ libDirectory } /${ PACKAGE_OUTPUT } ` ,
38- "tsup"
38+ "tsup" ,
39+ // Defining the additional entry points as `polkadot/util` and `polkadot/util-crypto`
40+ // packages are re-exported.
41+ {
42+ "./util" : {
43+ import : "./util/index.js" ,
44+ require : "./util/index.cjs" ,
45+ } ,
46+ "./util-crypto" : {
47+ import : "./util-crypto/index.js" ,
48+ require : "./util-crypto/index.cjs" ,
49+ } ,
50+ }
3951 ) )
4052 ) {
4153 throw `Failed to generate package.json file.` ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @w3ux/react-connect-kit-source" ,
33 "license" : " GPL-3.0-only" ,
4- "version" : " 1.6 .0" ,
4+ "version" : " 1.7 .0" ,
55 "type" : " module" ,
66 "scripts" : {
77 "clear" : " rm -rf node_modules dist tsconfig.tsbuildinfo" ,
88 "build" : " gulp --silent"
99 },
1010 "dependencies" : {
1111 "@chainsafe/metamask-polkadot-adapter" : " ^0.6.0" ,
12- "@polkadot/util" : " ^13.1.1" ,
1312 "@polkagate/extension-dapp" : " ^0.46.13" ,
1413 "@w3ux/extension-assets" : " ^0.3.1" ,
1514 "@w3ux/hooks" : " ^1.1.0" ,
16- "@w3ux/utils" : " ^0.7 .0"
15+ "@w3ux/utils" : " ^0.9 .0"
1716 },
1817 "devDependencies" : {
1918 "@chainsafe/metamask-polkadot-types" : " ^0.7.0" ,
Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ import type {
1515 SignerPayloadRaw ,
1616 SignerResult ,
1717} from "@polkadot/types/types" ;
18- import type { HexString } from "@polkadot/util/types" ;
1918import { SnapConfig } from "@chainsafe/metamask-polkadot-types" ;
2019import { ExtensionAccount } from "../ExtensionsProvider/types" ;
20+ import { HexString } from "types" ;
2121
2222interface Web3Window extends InjectedWindow {
2323 ethereum : unknown ;
Original file line number Diff line number Diff line change @@ -28,3 +28,5 @@ export interface HandleImportExtension {
2828 removedActiveAccount : MaybeAddress ;
2929 } ;
3030}
31+
32+ export type HexString = `0x${string } `;
Original file line number Diff line number Diff line change 11{
22 "name" : " @w3ux/react-polkicon-source" ,
33 "license" : " GPL-3.0-only" ,
4- "version" : " 1.2 .0" ,
4+ "version" : " 1.3 .0" ,
55 "type" : " module" ,
66 "scripts" : {
77 "clear" : " rm -rf node_modules dist tsconfig.tsbuildinfo" ,
88 "build" : " gulp --silent"
99 },
1010 "dependencies" : {
11- "@polkadot/util" : " ^12.6.2" ,
12- "@w3ux/utils" : " ^0.4.0" ,
11+ "@w3ux/utils" : " ^0.9.0" ,
1312 "framer-motion" : " ^11.2.10"
1413 },
1514 "devDependencies" : {
Original file line number Diff line number Diff line change 11/* @license Copyright 2024 w3ux authors & contributors
22SPDX-License-Identifier: GPL-3.0-only */
33
4- import { decodeAddress , blake2AsU8a } from "@polkadot /util-crypto" ;
4+ import { decodeAddress , blake2AsU8a } from "@w3ux/utils /util-crypto" ;
55
66/*
77 A generic identity icon, taken from
Original file line number Diff line number Diff line change 11{
22 "name" : " @w3ux/utils-source" ,
33 "license" : " GPL-3.0-only" ,
4- "version" : " 0.7 .0" ,
4+ "version" : " 0.9 .0" ,
55 "type" : " module" ,
66 "scripts" : {
77 "clear" : " rm -rf node_modules dist tsconfig.tsbuildinfo" ,
Original file line number Diff line number Diff line change 1+ export * from "@polkadot/util-crypto" ;
Original file line number Diff line number Diff line change 1+ export * from "@polkadot/util" ;
You can’t perform that action at this time.
0 commit comments