cosmology-tech / telescope

A TypeScript Transpiler for Cosmos Protobufs ⚛️
https://cosmology.zone/products/telescope
Apache License 2.0
146 stars 43 forks source link

incompatible with ES Modules #591

Closed turadg closed 6 months ago

turadg commented 6 months ago

https://github.com/cosmology-tech/telescope/pull/587 was merged and then modified in https://github.com/cosmology-tech/telescope/pull/590 to be released in 1.5.0.

I tried replacing our patch with 1.5.0 and it still creates some non-JS imports:

export const createRPCQueryClient = async ({ rpcEndpoint, }) => {
    const tmClient = await Tendermint34Client.connect(rpcEndpoint);
    const client = new QueryClient(tmClient);
    return {
        agoric: {
            swingset: (await import('./swingset/query.rpc.Query')).createRpcQueryExtension(client),
            vbank: (await import('./vbank/query.rpc.Query')).createRpcQueryExtension(client),
            vstorage: (await import('./vstorage/query.rpc.Query')).createRpcQueryExtension(client),
        },
    };
};

Maybe those cases were neglected in crafting the option. But I think in those cases it should always include .js. I'm confused why the #590 turned the extension restoration into an option and especially why it made the characters of the file extension configurable.