diff --git a/packages/cli/package.json b/packages/cli/package.json index b91cc7a7..78691d24 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -36,7 +36,7 @@ "type": "module", "dependencies": { "@abstract-money/bundle-require": "workspace:*", - "@abstract-money/ts-codegen": "0.37.0-beta-3", + "@abstract-money/ts-codegen": "0.37.0-beta-5", "@cosmjs/cosmwasm-stargate": "^0.32.3", "@cosmjs/stargate": "^0.32.3", "abort-controller": "^3.0.0", diff --git a/packages/cli/src/plugins/react.ts b/packages/cli/src/plugins/react.ts index 8cb0476f..672af682 100644 --- a/packages/cli/src/plugins/react.ts +++ b/packages/cli/src/plugins/react.ts @@ -69,14 +69,22 @@ export function react(options: ReactOptions = {}): ReactResult { (guardedContract) => guardedContract.name !== name, ), ) - .map(({ name, path }) => ({ name, dir: path })) - console.log('absContracts', absContracts) - - await codegen({ - options: codegenOptions, - contracts: absContracts, - outPath: cosmwasmCodegenDirPath, - }) + .map(({ name, path, moduleType }) => ({ name, dir: path, moduleType })) + console.debug('absContracts', absContracts) + + await Promise.all( + absContracts.map( + async ({ moduleType, ...contract }) => + await codegen({ + options: { + ...codegenOptions, + abstractApp: { ...codegenOptions.abstractApp, moduleType }, + }, + contracts: [contract], + outPath: cosmwasmCodegenDirPath, + }), + ), + ) if (contractsWithoutAbstractApp.length !== 0) await codegen({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e4dbe8c7..9b395788 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -550,8 +550,8 @@ importers: specifier: workspace:* version: link:../bundle-require '@abstract-money/ts-codegen': - specifier: 0.37.0-beta-3 - version: 0.37.0-beta-3 + specifier: 0.37.0-beta-5 + version: 0.37.0-beta-5 '@cosmjs/cosmwasm-stargate': specifier: ^0.32.3 version: 0.32.3(patch_hash=ac4bp4jmz6fix4oxonhymnas5q) @@ -907,8 +907,8 @@ importers: packages: - /@abstract-money/ts-codegen@0.37.0-beta-3: - resolution: {integrity: sha512-XrgDPRdsXUCpeKoEKIZgysh88217oMMl53rc2sG1Z7IoJj4maA+kW7+1RjmzmJOqg8jipFtUK5kMmH6hXocORg==} + /@abstract-money/ts-codegen@0.37.0-beta-5: + resolution: {integrity: sha512-8UWh1WkszEeLGiSEXILLtFuKL5enSxlQ7YTg7ugZ4mWrXIFDguhyyjbhAMXT+SdGyFS0SAFhpG3R2KmrThkbuQ==} hasBin: true dependencies: '@babel/core': 7.18.10 @@ -937,13 +937,13 @@ packages: parse-package-name: 1.0.0 rimraf: 3.0.2 shelljs: 0.8.5 - wasm-ast-types: /@abstract-money/wasm-ast-types@0.28.0-beta-3 + wasm-ast-types: /@abstract-money/wasm-ast-types@0.28.0-beta-5 transitivePeerDependencies: - supports-color dev: false - /@abstract-money/wasm-ast-types@0.28.0-beta-3: - resolution: {integrity: sha512-fTUVZBjFpo+IRm+krtNYBCLRDcPIeKxpJgB1cosJAWOmHt8IHNagMYrMrmFrGV6ZbW5Us73/D6oe9n5KMv4eRw==} + /@abstract-money/wasm-ast-types@0.28.0-beta-5: + resolution: {integrity: sha512-ZBGfn0cs72OX9azRrMxYTHHy2apBlyaDfC7gHtIPmZVj35XwezHp1rSnO7/T8pCevmv94qFYIhC27b2yrSy/IA==} dependencies: '@babel/runtime': 7.25.7 '@babel/types': 7.18.10 @@ -1609,6 +1609,20 @@ packages: '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.18.10) '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.18.10) + /@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.18.10): + resolution: {integrity: sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==} + engines: {node: '>=6.9.0'} + deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead. + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/compat-data': 7.25.8 + '@babel/core': 7.18.10 + '@babel/helper-compilation-targets': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.18.10) + '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.18.10) + /@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.25.8): resolution: {integrity: sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==} engines: {node: '>=6.9.0'} @@ -2650,7 +2664,7 @@ packages: '@babel/plugin-proposal-logical-assignment-operators': 7.20.7(@babel/core@7.18.10) '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.18.10) '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.18.10) - '@babel/plugin-proposal-object-rest-spread': 7.18.9(@babel/core@7.18.10) + '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.18.10) '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.18.10) '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.18.10) '@babel/plugin-proposal-private-methods': 7.18.6(@babel/core@7.18.10)