warp-contracts / warp

An implementation of the Arweave SmartWeave smart contracts protocol.
MIT License
159 stars 44 forks source link

[BUG] - Cannot find module 'contract/Signature' & 'core/Warp' or its corresponding type declarations. #392

Closed dtfiedler closed 1 year ago

dtfiedler commented 1 year ago

Describe the bug Missing type declarations.

To Reproduce tsconfig.json:

{
    "compilerOptions": {
      "target": "es2021",
      "module": "CommonJS",
      "moduleResolution": "node",
      "declaration": true,
      "outDir": "./dist",
      "strict": true,
      "esModuleInterop": true,
      "resolveJsonModule": true,

      /* Additional Checks */
      "pretty": true,
      "sourceMap": true,
      "noFallthroughCasesInSwitch": true,
      "noImplicitAny": true,
      "noImplicitReturns": true,
      "noUnusedLocals": true,
      "noUnusedParameters": true
    },
    "include": ["src", "tests"]
  }

app.ts

import { WarpFactory } from 'warp-sdk`

const warp = new WarpFactory.forMainnet();

...other server setup

on build:

yarn build

Error:

#18 11.04 node_modules/warp-contracts/lib/types/contract/deploy/CreateContract.d.ts:7:33 - error TS2307: Cannot find module 'contract/Signature' or its corresponding type declarations.
#18 11.04 
#18 11.04 7 import { CustomSignature } from 'contract/Signature';
#18 11.04                                   ~~~~~~~~~~~~~~~~~~~~
#18 11.04 
#18 11.04 node_modules/warp-contracts/lib/types/core/modules/impl/ArweaveGatewayBundledContractDefinitionLoader.d.ts:2:33 - error TS2307: Cannot find module 'core/Warp' or its corresponding type declarations.
#18 11.04 
#18 11.04 2 import { WarpEnvironment } from 'core/Warp';
#18 11.04                                   ~~~~~~~~~~~
#18 11.04 
#18 11.05 
#18 11.05 Found 2 errors in 2 files.
#18 11.05 
#18 11.05 Errors  Files
#18 11.05      1  node_modules/warp-contracts/lib/types/contract/deploy/CreateContract.d.ts:7
#18 11.05      1  node_modules/warp-contracts/lib/types/core/modules/impl/ArweaveGatewayBundledContractDefinitionLoader.d.ts:2

Expected behavior I'd expect the build to resolve type declarations as expected.

Desktop (please complete the following information):

Additional context No issues building with warp-contracts<1.2.54

ppedziwiatr commented 1 year ago

Hey @dtfiedler, the fix for this is already on main , will be released soon in 1.4.0

ppedziwiatr commented 1 year ago

Hey @dtfiedler , try with https://github.com/warp-contracts/warp/releases/tag/1.4.0 :-)

ppedziwiatr commented 1 year ago

1.4.0 was a bit broken - please use 1.4.1

dtfiedler commented 1 year ago

working as expected - thanks!