nucypher / taco-web

🌮 A TypeScript client for TACo (Threshold Access Control)
https://docs.threshold.network/app-development/threshold-access-control-tac
GNU General Public License v3.0
14 stars 22 forks source link

Type inference issues from @nucypher/shared #469

Closed ghardin1314 closed 7 months ago

ghardin1314 commented 7 months ago

Attempting to upgrade to the new v0.2.2 package and not getting any type inference from things exported from @nucypher/shared when installing via pnpm. For instance,

const porterUri = getProterUri(domain);

porterUri is inferred as any type. I believe this is due to improperly configured monorepo dependencies. I am also getting this error when installing via pnpm which I believe is related:

 WARN  Issues with peer dependencies found
.
└─┬ @nucypher/taco 0.2.2
  └── ✕ missing peer @nucypher/shared@"*"
Peer dependencies that should be installed:
  @nucypher/shared@"*"  

This is throwing major havoc in our linting as we are trying to upgrade

ghardin1314 commented 7 months ago

Also getting errors when trying to build

Could not resolve "@nucypher/shared"
       ../../node_modules/.pnpm/@nucypher+taco@0.2.2/node_modules/@nucypher/taco/dist/es/conditions/condition-expr.js
       2 │ import { toJSON } from '@nucypher/shared';
       Could not resolve "@nucypher/shared"
       ../../node_modules/.pnpm/@nucypher+taco@0.2.2/node_modules/@nucypher/taco/dist/es/conditions/condition.js
       1 │ import { objectEquals } from '@nucypher/shared';
       Could not resolve "@nucypher/shared"
       ../../node_modules/.pnpm/@nucypher+taco@0.2.2/node_modules/@nucypher/taco/dist/es/conditions/const.js
       1 │ import { ChainId } from '@nucypher/shared';
       Could not resolve "@nucypher/shared"
       ../../node_modules/.pnpm/@nucypher+taco@0.2.2/node_modules/@nucypher/taco/dist/es/conditions/context/context.js
       2 │ import { fromJSON, toJSON } from '@nucypher/shared';
       Could not resolve "@nucypher/shared"
       ../../node_modules/.pnpm/@nucypher+taco@0.2.2/node_modules/@nucypher/taco/dist/es/dkg.js
       2 │ import { DkgCoordinatorAgent, DkgRitualState, fromHexString, } from '@nucypher/shared';
       Could not resolve "@nucypher/shared"
       ../../node_modules/.pnpm/@nucypher+taco@0.2.2/node_modules/@nucypher/taco/dist/es/index.js
       2 │ export { domains, fromBytes, getPorterUri, initialize, toBytes, toHexString, } from '@nucypher/shared';
       Could not resolve "@nucypher/shared"
       ../../node_modules/.pnpm/@nucypher+taco@0.2.2/node_modules/@nucypher/taco/dist/es/taco.js
       2 │ import { DkgCoordinatorAgent, fromHexString, getPorterUri, GlobalAllowListAgent, toBytes, } from '@nucypher/shared';
       Could not resolve "@nucypher/shared"
       ../../node_modules/.pnpm/@nucypher+taco@0.2.2/node_modules/@nucypher/taco/dist/es/tdec.js
       2 │ import { DkgCoordinatorAgent, PorterClient, toBytes, } from '@nucypher/shared';
ghardin1314 commented 7 months ago

Last working versions we had were:

"@nucypher/taco": "0.1.0-rc.4",
"@nucypher/nucypher-core": "0.13.0-alpha.1"
piotr-roslaniec commented 7 months ago

Hi @ghardin1314, thanks for reporting this issue.

Please try using the following packages. The newest taco@0.2.4 contains the fix.

"@nucypher/taco": "0.2.4",
"@nucypher/nucypher-core": "0.14.0"

nucypher-core is functionally the same as 0.13.0-alpha.1, and should cause no breaking changes. taco may contain some breaking changes due to some changes in the structure of exported modules. Both packages are compatible with current testnets.

ghardin1314 commented 7 months ago

Seems to be working great on testnet, will report if there are any new issues on mainnet next week