osmosis-labs / beaker

Beaker helps streamlining CosmWasm development workflow.
Apache License 2.0
106 stars 30 forks source link

Can't open beaker console after ts-gen #115

Closed AtticusDavid closed 1 year ago

AtticusDavid commented 1 year ago

after type beaker console --network testnet,

the following errors show up in terminal.

counter git:(main) ✗ beaker console --network testnet
beaker[testnet] ◇ /Users/agrajak/.npm/_npx/b773047406ff4129/node_modules/beaker-console/dist/index.js:315
        throw Error(msg);
              ^

Error: "CounterContract" not found in sdk.
    at errorIfNotFound (/Users/agrajak/.npm/_npx/b773047406ff4129/node_modules/beaker-console/dist/index.js:315:15)
    at /Users/agrajak/.npm/_npx/b773047406ff4129/node_modules/beaker-console/dist/index.js:269:27
    at /Users/agrajak/.npm/_npx/b773047406ff4129/node_modules/beaker-console/dist/index.js:180:16
    at Array.map (<anonymous>)
    at mapKV (/Users/agrajak/.npm/_npx/b773047406ff4129/node_modules/beaker-console/dist/index.js:178:49)
    at getContracts (/Users/agrajak/.npm/_npx/b773047406ff4129/node_modules/beaker-console/dist/index.js:265:12)
    at initializeContext (/Users/agrajak/.npm/_npx/b773047406ff4129/node_modules/beaker-console/src/console.js:82:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async run (/Users/agrajak/.npm/_npx/b773047406ff4129/node_modules/beaker-console/src/console.js:93:3)

Node.js v19.2.0
Error: Failed to execute npx

Steps to reproduce

Enviroments

iboss-ptk commented 1 year ago

could you try beaker 0.1.2?

AtticusDavid commented 1 year ago

this also doesn't work in 0.1.2 too. I guess Counter(target contract name in PascalCase) is in sdk.contracts.contracts, not sdk.contracts

iboss-ptk commented 1 year ago

can you try changing ts/sdk/index.ts from

export * as contracts from "./contracts";

to

export * from "./contracts";

ts-codegen integration is a bit messy at the moment, need to revisit on the design.

iboss-ptk commented 1 year ago

updated the template and it should work out of the box by now

https://github.com/osmosis-labs/beaker/commit/c85e728b45d623a8dc05e03a8dcc310879a933ee